Revision: 201017
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 15:53:02 +0300
changeset 17 4f2773374eff
parent 15 e11368ed4880
child 19 4b22a598b890
child 20 ba8a586c45f1
child 24 6053b7ae82ab
Revision: 201017 Kit: 201019
creator/creator.pro
creator/data/creator.rss
creator/data/creator_reg.rss
creator/data/datacreator.rss
creator/engine/inc/creator.hrh
creator/engine/inc/creator.pan
creator/engine/inc/creator_accesspoint.h
creator/engine/inc/creator_browser.h
creator/engine/inc/creator_browserelement.h
creator/engine/inc/creator_calendar.h
creator/engine/inc/creator_calendarbase.h
creator/engine/inc/creator_calendarelement.h
creator/engine/inc/creator_cmdscriptrun.h
creator/engine/inc/creator_connectionmethod.h
creator/engine/inc/creator_connectionmethodbase.h
creator/engine/inc/creator_connectionmethodelement.h
creator/engine/inc/creator_contactelement.h
creator/engine/inc/creator_contactsetcache.h
creator/engine/inc/creator_factory.h
creator/engine/inc/creator_file.h
creator/engine/inc/creator_fileelement.h
creator/engine/inc/creator_landmark.h
creator/engine/inc/creator_landmarkelement.h
creator/engine/inc/creator_log.h
creator/engine/inc/creator_logelement.h
creator/engine/inc/creator_mailbox.h
creator/engine/inc/creator_mailboxelement.h
creator/engine/inc/creator_message.h
creator/engine/inc/creator_messageelement.h
creator/engine/inc/creator_modulebase.h
creator/engine/inc/creator_note.h
creator/engine/inc/creator_noteelement.h
creator/engine/inc/creator_phonebook.h
creator/engine/inc/creator_phonebookbase.h
creator/engine/inc/creator_randomdatafield.h
creator/engine/inc/creator_randomdataparser.h
creator/engine/inc/creator_scriptelement.h
creator/engine/inc/creator_scriptelementfactory.h
creator/engine/inc/creator_scriptentry.h
creator/engine/inc/creator_scriptparser.h
creator/engine/inc/creator_std.h
creator/engine/inc/creator_traces.h
creator/engine/inc/creator_virtualphonebook.h
creator/engine/inc/creator_wepsecuritysettings.h
creator/engine/inc/randomdata.txt
creator/engine/src/creator_accesspoint.cpp
creator/engine/src/creator_browser.cpp
creator/engine/src/creator_browserelement.cpp
creator/engine/src/creator_calendar.cpp
creator/engine/src/creator_calendarelement.cpp
creator/engine/src/creator_cmdscriptrun.cpp
creator/engine/src/creator_connectionmethod.cpp
creator/engine/src/creator_connectionmethodelement.cpp
creator/engine/src/creator_contactelement.cpp
creator/engine/src/creator_contactsetcache.cpp
creator/engine/src/creator_factory.cpp
creator/engine/src/creator_file.cpp
creator/engine/src/creator_fileelement.cpp
creator/engine/src/creator_landmark.cpp
creator/engine/src/creator_landmarkelement.cpp
creator/engine/src/creator_log.cpp
creator/engine/src/creator_logelement.cpp
creator/engine/src/creator_mailbox.cpp
creator/engine/src/creator_mailboxelement.cpp
creator/engine/src/creator_message.cpp
creator/engine/src/creator_messageelement.cpp
creator/engine/src/creator_note.cpp
creator/engine/src/creator_noteelement.cpp
creator/engine/src/creator_phonebook.cpp
creator/engine/src/creator_phonebookbase.cpp
creator/engine/src/creator_randomdataparser.cpp
creator/engine/src/creator_scriptelement.cpp
creator/engine/src/creator_scriptelementfactory.cpp
creator/engine/src/creator_scriptentry.cpp
creator/engine/src/creator_scriptparser.cpp
creator/engine/src/creator_virtualphonebook.cpp
creator/engine/src/creator_wepsecuritysettings.cpp
creator/files/backup_registration.xml
creator/group/ReleaseNotes_Creator.txt
creator/group/backup_registration.xml
creator/group/bld.inf
creator/group/creator.mmp
creator/group/creator_icons_aif.mk
creator/group/creator_stub_sis.mk
creator/inc/creator.hrh
creator/inc/creator.pan
creator/inc/creator_accesspoint.h
creator/inc/creator_app.h
creator/inc/creator_appui.h
creator/inc/creator_browser.h
creator/inc/creator_browserelement.h
creator/inc/creator_calendar.h
creator/inc/creator_calendarbase.h
creator/inc/creator_calendarelement.h
creator/inc/creator_connectionmethod.h
creator/inc/creator_connectionmethodbase.h
creator/inc/creator_connectionmethodelement.h
creator/inc/creator_contactelement.h
creator/inc/creator_contactsetcache.h
creator/inc/creator_container.h
creator/inc/creator_document.h
creator/inc/creator_factory.h
creator/inc/creator_file.h
creator/inc/creator_fileelement.h
creator/inc/creator_imps.h
creator/inc/creator_impselement.h
creator/inc/creator_landmark.h
creator/inc/creator_landmarkelement.h
creator/inc/creator_log.h
creator/inc/creator_logelement.h
creator/inc/creator_mailbox.h
creator/inc/creator_mailboxelement.h
creator/inc/creator_message.h
creator/inc/creator_messageelement.h
creator/inc/creator_model.h
creator/inc/creator_modulebase.h
creator/inc/creator_note.h
creator/inc/creator_noteelement.h
creator/inc/creator_phonebook.h
creator/inc/creator_phonebookbase.h
creator/inc/creator_randomdatafield.h
creator/inc/creator_randomdataparser.h
creator/inc/creator_scriptelement.h
creator/inc/creator_scriptelementfactory.h
creator/inc/creator_scriptentry.h
creator/inc/creator_scriptparser.h
creator/inc/creator_std.h
creator/inc/creator_traces.h
creator/inc/creator_virtualphonebook.h
creator/inc/creator_wepsecuritysettings.h
creator/inc/engine.h
creator/inc/enginewrapper.h
creator/inc/mainview.h
creator/inc/notifications.h
creator/rom/creator.iby
creator/sis/Creator_S60-30.pkg
creator/sis/Creator_S60-30.sis
creator/sis/Creator_S60-32.pkg
creator/sis/Creator_S60-32.sis
creator/sis/Creator_stub.pkg
creator/src/creator.cpp
creator/src/creator_accesspoint.cpp
creator/src/creator_app.cpp
creator/src/creator_appui.cpp
creator/src/creator_browser.cpp
creator/src/creator_browserelement.cpp
creator/src/creator_calendar.cpp
creator/src/creator_calendarelement.cpp
creator/src/creator_connectionmethod.cpp
creator/src/creator_connectionmethodelement.cpp
creator/src/creator_contactelement.cpp
creator/src/creator_contactsetcache.cpp
creator/src/creator_container.cpp
creator/src/creator_document.cpp
creator/src/creator_factory.cpp
creator/src/creator_file.cpp
creator/src/creator_fileelement.cpp
creator/src/creator_imps.cpp
creator/src/creator_impselement.cpp
creator/src/creator_landmark.cpp
creator/src/creator_landmarkelement.cpp
creator/src/creator_log.cpp
creator/src/creator_logelement.cpp
creator/src/creator_mailbox.cpp
creator/src/creator_mailboxelement.cpp
creator/src/creator_message.cpp
creator/src/creator_messageelement.cpp
creator/src/creator_model.cpp
creator/src/creator_note.cpp
creator/src/creator_noteelement.cpp
creator/src/creator_phonebook.cpp
creator/src/creator_phonebookbase.cpp
creator/src/creator_randomdataparser.cpp
creator/src/creator_scriptelement.cpp
creator/src/creator_scriptelementfactory.cpp
creator/src/creator_scriptentry.cpp
creator/src/creator_scriptparser.cpp
creator/src/creator_virtualphonebook.cpp
creator/src/creator_wepsecuritysettings.cpp
creator/src/engine.cpp
creator/src/enginewrapper.cpp
creator/src/main.cpp
creator/src/mainview.cpp
creator/src/notifications.cpp
creator/symbian_version.hrh
filebrowser/data/filebrowser.rss
filebrowser/data/filebrowser_reg.rss
filebrowser/engine/FB.hrh
filebrowser/engine/FBFileOps.cpp
filebrowser/engine/FBFileOps.h
filebrowser/engine/FBFileUtils.cpp
filebrowser/engine/FBFileUtils.h
filebrowser/engine/FBStd.h
filebrowser/engine/FBTraces.h
filebrowser/engine/engine.cpp
filebrowser/engine/engine.h
filebrowser/envpatcher/EnvPatcher.pl
filebrowser/envpatcher/ReadMe.txt
filebrowser/filebrowser.pro
filebrowser/fileopclient/inc/FBFileOpClient.h
filebrowser/group/ReleaseNotes_FileBrowser.txt
filebrowser/group/bld.inf
filebrowser/group/bld_generic.inf
filebrowser/group/filebrowser.mmp
filebrowser/group/filebrowser_extraicons.mk
filebrowser/group/filebrowser_icons_aif.mk
filebrowser/group/group.pro
filebrowser/helpertools/snapshot_compare_dirs.pl
filebrowser/inc/FB.hrh
filebrowser/inc/FBApp.h
filebrowser/inc/FBAppUi.h
filebrowser/inc/FBDocument.h
filebrowser/inc/FBFileDlgs.h
filebrowser/inc/FBFileEditor.h
filebrowser/inc/FBFileListContainer.h
filebrowser/inc/FBFileListView.h
filebrowser/inc/FBFileOps.h
filebrowser/inc/FBFileUtils.h
filebrowser/inc/FBModel.h
filebrowser/inc/FBSettingViewDlg.h
filebrowser/inc/FBStd.h
filebrowser/inc/FBToolbar.h
filebrowser/inc/FBTraces.h
filebrowser/rom/filebrowser.iby
filebrowser/sis/FileBrowser_S60-30.pkg
filebrowser/sis/FileBrowser_S60-30.sis
filebrowser/sis/FileBrowser_S60-50.pkg
filebrowser/sis/FileBrowser_S60-50.sis
filebrowser/sis/FileBrowser_stub.pkg
filebrowser/src/FBApp.cpp
filebrowser/src/FBAppUi.cpp
filebrowser/src/FBDocument.cpp
filebrowser/src/FBFileDlgs.cpp
filebrowser/src/FBFileEditor.cpp
filebrowser/src/FBFileListContainer.cpp
filebrowser/src/FBFileListView.cpp
filebrowser/src/FBFileOps.cpp
filebrowser/src/FBFileUtils.cpp
filebrowser/src/FBModel.cpp
filebrowser/src/FBSettingViewDlg.cpp
filebrowser/src/FBToolbar.cpp
filebrowser/ui/inc/driveentry.h
filebrowser/ui/inc/editorview.h
filebrowser/ui/inc/enginewrapper.h
filebrowser/ui/inc/filebrowsermainwindow.h
filebrowser/ui/inc/filebrowsermodel.h
filebrowser/ui/inc/filebrowsersettings.h
filebrowser/ui/inc/filebrowserview.h
filebrowser/ui/inc/fileentry.h
filebrowser/ui/inc/menuaction.h
filebrowser/ui/inc/notifications.h
filebrowser/ui/inc/searchview.h
filebrowser/ui/inc/settingsview.h
filebrowser/ui/src/driveentry.cpp
filebrowser/ui/src/editorview.cpp
filebrowser/ui/src/enginewrapper.cpp
filebrowser/ui/src/filebrowsermainwindow.cpp
filebrowser/ui/src/filebrowsermodel.cpp
filebrowser/ui/src/filebrowserview.cpp
filebrowser/ui/src/fileentry.cpp
filebrowser/ui/src/main.cpp
filebrowser/ui/src/notifications.cpp
filebrowser/ui/src/searchview.cpp
filebrowser/ui/src/settingsview.cpp
filebrowser/ui/ui.pro
filebrowser/ui/ui.qrc
group/bld.inf
htiui/HtiAdminQt/HtiAdmin.pro
htiui/HtiAdminQt/mainview.cpp
htiui/HtiDeviceReboot/group/HtiDeviceReboot.mmp
htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp
htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp
htiui/HtiServicePlugins/HtiMessagesServicePlugin/group/HtiMessagesServicePlugin.mmp
htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMailboxHandler.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/group/HtiPIMServicePlugin.mmp
htiui/HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiPIMServicePlugin.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiSimDirHandler.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiSimDirHandlerVPbk.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/PIMHandler.h
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiPIMServicePlugin.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandler.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandlerVPbk.cpp
htiui/HtiServicePlugins/HtiPIMServicePlugin/src/PIMHandler.cpp
htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group/HtiScreenshotServicePlugin.mmp
htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiScreenshotServicePlugin.cpp
htiui/group/bld.inf
htiui/htiui.pro
htiui/rom/htiui_10_1.iby
htiui/sis/HTI_S60-10_1.pkg
htiui/sis/HTI_S60-52.pkg
htiui/sis/HTI_S60_Upgrade-10_1.pkg
htiui/sis/HTI_S60_Upgrade-52.pkg
htiui/sis/HTI_stub.pkg
launcher/data/launcher.rss
launcher/data/launcher_reg.rss
launcher/engine/inc/e32image.h
launcher/engine/inc/e32imageheaders.h
launcher/engine/inc/launcherdllelement.h
launcher/engine/inc/launcherdllparser.h
launcher/engine/inc/launcherengine.h
launcher/engine/inc/launcherparserobserver.h
launcher/engine/inc/launchertraces.h
launcher/engine/inc/launcherxmlparser.h
launcher/engine/src/e32image.cpp
launcher/engine/src/launcherdllelement.cpp
launcher/engine/src/launcherdllparser.cpp
launcher/engine/src/launcherengine.cpp
launcher/engine/src/launcherxmlparser.cpp
launcher/envpatcher/EnvPatcher.pl
launcher/envpatcher/ReadMe.txt
launcher/group/ReleaseNotes_Launcher.txt
launcher/group/backup_registration.xml
launcher/group/bld.inf
launcher/group/launcher.mmp
launcher/group/launcher_icons_aif.mk
launcher/group/launcher_stub_sis.mk
launcher/icons/check.svg
launcher/inc/applicationview.h
launcher/inc/commonActions.h
launcher/inc/e32image.h
launcher/inc/e32imageheaders.h
launcher/inc/enginewrapper.h
launcher/inc/launcher.hrh
launcher/inc/launcher.pan
launcher/inc/launcherapplication.h
launcher/inc/launcherappui.h
launcher/inc/launchercontainerapps.h
launcher/inc/launchercontaineroutput.h
launcher/inc/launcherdllelement.h
launcher/inc/launcherdllparser.h
launcher/inc/launcherdocument.h
launcher/inc/launcherengine.h
launcher/inc/launchermainwindow.h
launcher/inc/launcherparserobserver.h
launcher/inc/launchertraces.h
launcher/inc/launcherviewapps.h
launcher/inc/launcherviewoutput.h
launcher/inc/launcherxmlparser.h
launcher/inc/notifications.h
launcher/inc/outputview.h
launcher/launcher.pro
launcher/launcher.qrc
launcher/rom/Launcher.iby
launcher/rom/backup_registration.xml
launcher/sis/Launcher_S60-30.pkg
launcher/sis/Launcher_S60-30.sis
launcher/sis/Launcher_S60-5x.pkg
launcher/sis/Launcher_stub.pkg
launcher/sis/launcher_stub_sis.mk
launcher/src/applicationview.cpp
launcher/src/applicationview.xml
launcher/src/commonActions.cpp
launcher/src/e32image.cpp
launcher/src/enginewrapper.cpp
launcher/src/launcher.cpp
launcher/src/launcherapplication.cpp
launcher/src/launcherappui.cpp
launcher/src/launchercontainerapps.cpp
launcher/src/launchercontaineroutput.cpp
launcher/src/launcherdllelement.cpp
launcher/src/launcherdllparser.cpp
launcher/src/launcherdocument.cpp
launcher/src/launcherengine.cpp
launcher/src/launchermainwindow.cpp
launcher/src/launcherviewapps.cpp
launcher/src/launcherviewoutput.cpp
launcher/src/launcherxmlparser.cpp
launcher/src/main.cpp
launcher/src/notifications.cpp
launcher/src/outputview.cpp
launcher/src/outputview.xml
launcher/symbian_version.hrh
layers.sysdef.xml
loadgen/data/loadgen.rss
loadgen/data/loadgen_reg.rss
loadgen/engine/inc/loadgen.hrh
loadgen/engine/inc/loadgen_applications.h
loadgen/engine/inc/loadgen_bluetooth.h
loadgen/engine/inc/loadgen_cpuload.h
loadgen/engine/inc/loadgen_keypress.h
loadgen/engine/inc/loadgen_loadattributes.h
loadgen/engine/inc/loadgen_loadbase.h
loadgen/engine/inc/loadgen_memoryeat.h
loadgen/engine/inc/loadgen_messages.h
loadgen/engine/inc/loadgen_netconn.h
loadgen/engine/inc/loadgen_phonecall.h
loadgen/engine/inc/loadgen_photocapture.h
loadgen/engine/inc/loadgen_pointerevent.h
loadgen/engine/inc/loadgen_std.h
loadgen/engine/inc/loadgen_traces.h
loadgen/engine/inc/loadgen_utils.h
loadgen/engine/src/loadgen_applications.cpp
loadgen/engine/src/loadgen_bluetooth.cpp
loadgen/engine/src/loadgen_cpuload.cpp
loadgen/engine/src/loadgen_keypress.cpp
loadgen/engine/src/loadgen_loadbase.cpp
loadgen/engine/src/loadgen_memoryeat.cpp
loadgen/engine/src/loadgen_messages.cpp
loadgen/engine/src/loadgen_netconn.cpp
loadgen/engine/src/loadgen_phonecall.cpp
loadgen/engine/src/loadgen_photocapture.cpp
loadgen/engine/src/loadgen_pointerevent.cpp
loadgen/engine/src/loadgen_utils.cpp
loadgen/envpatcher/EnvPatcher.pl
loadgen/envpatcher/ReadMe.txt
loadgen/group/ReleaseNotes_LoadGen.txt
loadgen/group/bld.inf
loadgen/group/bld_generic.inf
loadgen/group/group.pro
loadgen/group/loadgen.mmp
loadgen/group/loadgen_extraicons.mk
loadgen/group/loadgen_icons_aif.mk
loadgen/group/loadgen_stub_sis.mk
loadgen/inc/loadgen.hrh
loadgen/inc/loadgen_app.h
loadgen/inc/loadgen_applications.h
loadgen/inc/loadgen_appui.h
loadgen/inc/loadgen_bluetooth.h
loadgen/inc/loadgen_cpuload.h
loadgen/inc/loadgen_document.h
loadgen/inc/loadgen_editors.h
loadgen/inc/loadgen_keypress.h
loadgen/inc/loadgen_loadattributes.h
loadgen/inc/loadgen_loadbase.h
loadgen/inc/loadgen_maincontainer.h
loadgen/inc/loadgen_mainview.h
loadgen/inc/loadgen_memoryeat.h
loadgen/inc/loadgen_messages.h
loadgen/inc/loadgen_model.h
loadgen/inc/loadgen_netconn.h
loadgen/inc/loadgen_phonecall.h
loadgen/inc/loadgen_photocapture.h
loadgen/inc/loadgen_pointerevent.h
loadgen/inc/loadgen_settingsviewdlg.h
loadgen/inc/loadgen_std.h
loadgen/inc/loadgen_traces.h
loadgen/loadgen.pro
loadgen/rom/loadgen.iby
loadgen/sis/LoadGen_S60-30.pkg
loadgen/sis/LoadGen_S60-30.sis
loadgen/sis/LoadGen_stub.pkg
loadgen/src/loadgen_app.cpp
loadgen/src/loadgen_applications.cpp
loadgen/src/loadgen_appui.cpp
loadgen/src/loadgen_bluetooth.cpp
loadgen/src/loadgen_cpuload.cpp
loadgen/src/loadgen_document.cpp
loadgen/src/loadgen_editors.cpp
loadgen/src/loadgen_keypress.cpp
loadgen/src/loadgen_loadbase.cpp
loadgen/src/loadgen_maincontainer.cpp
loadgen/src/loadgen_mainview.cpp
loadgen/src/loadgen_memoryeat.cpp
loadgen/src/loadgen_messages.cpp
loadgen/src/loadgen_model.cpp
loadgen/src/loadgen_netconn.cpp
loadgen/src/loadgen_phonecall.cpp
loadgen/src/loadgen_photocapture.cpp
loadgen/src/loadgen_pointerevent.cpp
loadgen/src/loadgen_settingsviewdlg.cpp
loadgen/ui/avkon/data/loadgen.rss
loadgen/ui/avkon/data/loadgen_reg.rss
loadgen/ui/avkon/group/bld.inf
loadgen/ui/avkon/group/loadgen.mmp
loadgen/ui/avkon/inc/loadgen_app.h
loadgen/ui/avkon/inc/loadgen_appui.h
loadgen/ui/avkon/inc/loadgen_document.h
loadgen/ui/avkon/inc/loadgen_editors.h
loadgen/ui/avkon/inc/loadgen_maincontainer.h
loadgen/ui/avkon/inc/loadgen_mainview.h
loadgen/ui/avkon/inc/loadgen_model.h
loadgen/ui/avkon/inc/loadgen_settingsviewdlg.h
loadgen/ui/avkon/src/loadgen_app.cpp
loadgen/ui/avkon/src/loadgen_appui.cpp
loadgen/ui/avkon/src/loadgen_document.cpp
loadgen/ui/avkon/src/loadgen_editors.cpp
loadgen/ui/avkon/src/loadgen_maincontainer.cpp
loadgen/ui/avkon/src/loadgen_mainview.cpp
loadgen/ui/avkon/src/loadgen_model.cpp
loadgen/ui/avkon/src/loadgen_settingsviewdlg.cpp
loadgen/ui/hb/hb.pro
loadgen/ui/hb/inc/engine.h
loadgen/ui/hb/inc/enginewrapper.h
loadgen/ui/hb/inc/mainview.h
loadgen/ui/hb/inc/notifications.h
loadgen/ui/hb/inc/settingsview.h
loadgen/ui/hb/loadgen.qrc
loadgen/ui/hb/rom/loadgen.iby
loadgen/ui/hb/src/engine.cpp
loadgen/ui/hb/src/enginewrapper.cpp
loadgen/ui/hb/src/main.cpp
loadgen/ui/hb/src/mainview.cpp
loadgen/ui/hb/src/notifications.cpp
loadgen/ui/hb/src/settingsview.cpp
memspyui/group/MemSpyCapabilities.mmh
memspyui/group/bld.inf
memspyui/group/bld_generic.inf
memspyui/group/group.pro
memspyui/group/memspyui.mmp
memspyui/include/MemSpy.hrh
memspyui/include/MemSpyApp.h
memspyui/include/MemSpyAppUi.h
memspyui/include/MemSpyContainer.h
memspyui/include/MemSpyContainerObserver.h
memspyui/include/MemSpyDeviceWideOperationDialog.h
memspyui/include/MemSpyDocument.h
memspyui/include/MemSpyExportBitmapsToMemoryCardDialog.h
memspyui/include/MemSpySettings.h
memspyui/include/MemSpyUiUtils.h
memspyui/include/MemSpyViewBase.h
memspyui/include/MemSpyViewChunkList.h
memspyui/include/MemSpyViewCodeSegList.h
memspyui/include/MemSpyViewDriveInfo.h
memspyui/include/MemSpyViewECom.h
memspyui/include/MemSpyViewFBServBitmaps.h
memspyui/include/MemSpyViewHeapTracking.h
memspyui/include/MemSpyViewHeapTrackingResults.h
memspyui/include/MemSpyViewHeapTrackingSettings.h
memspyui/include/MemSpyViewKernel.h
memspyui/include/MemSpyViewKernelContainers.h
memspyui/include/MemSpyViewKernelHeap.h
memspyui/include/MemSpyViewKernelObjects.h
memspyui/include/MemSpyViewMainMenu.h
memspyui/include/MemSpyViewMemoryTrackingAutoStartConfig.h
memspyui/include/MemSpyViewObserver.h
memspyui/include/MemSpyViewOpenFiles.h
memspyui/include/MemSpyViewProcesses.h
memspyui/include/MemSpyViewRAMInfo.h
memspyui/include/MemSpyViewROMInfo.h
memspyui/include/MemSpyViewServerList.h
memspyui/include/MemSpyViewSystemConfig.h
memspyui/include/MemSpyViewThreadInfoItemActiveObject.h
memspyui/include/MemSpyViewThreadInfoItemChunk.h
memspyui/include/MemSpyViewThreadInfoItemCodeSeg.h
memspyui/include/MemSpyViewThreadInfoItemGeneralInfo.h
memspyui/include/MemSpyViewThreadInfoItemGeneric.h
memspyui/include/MemSpyViewThreadInfoItemHeap.h
memspyui/include/MemSpyViewThreadInfoItemList.h
memspyui/include/MemSpyViewThreadInfoItemMemoryTracking.h
memspyui/include/MemSpyViewThreadInfoItemServer.h
memspyui/include/MemSpyViewThreadInfoItemStack.h
memspyui/include/MemSpyViewThreads.h
memspyui/include/MemSpyViewType.h
memspyui/include/MemSpyViewWindowGroups.h
memspyui/include/viewcli.h
memspyui/memspyui.pro
memspyui/rom/memspyui.iby
memspyui/source/MemSpyApp.cpp
memspyui/source/MemSpyAppUi.cpp
memspyui/source/MemSpyContainer.cpp
memspyui/source/MemSpyDeviceWideOperationDialog.cpp
memspyui/source/MemSpyDocument.cpp
memspyui/source/MemSpyExportBitmapsToMemoryCardDialog.cpp
memspyui/source/MemSpySettings.cpp
memspyui/source/MemSpyUiUtils.cpp
memspyui/source/MemSpyViewBase.cpp
memspyui/source/MemSpyViewChunkList.cpp
memspyui/source/MemSpyViewCodeSegList.cpp
memspyui/source/MemSpyViewDriveInfo.cpp
memspyui/source/MemSpyViewECom.cpp
memspyui/source/MemSpyViewFBServBitmaps.cpp
memspyui/source/MemSpyViewHeapTracking.cpp
memspyui/source/MemSpyViewHeapTrackingResults.cpp
memspyui/source/MemSpyViewHeapTrackingSettings.cpp
memspyui/source/MemSpyViewKernel.cpp
memspyui/source/MemSpyViewKernelContainers.cpp
memspyui/source/MemSpyViewKernelHeap.cpp
memspyui/source/MemSpyViewKernelObjects.cpp
memspyui/source/MemSpyViewMainMenu.cpp
memspyui/source/MemSpyViewMemoryTrackingAutoStartConfig.cpp
memspyui/source/MemSpyViewOpenFiles.cpp
memspyui/source/MemSpyViewProcesses.cpp
memspyui/source/MemSpyViewRAMInfo.cpp
memspyui/source/MemSpyViewROMInfo.cpp
memspyui/source/MemSpyViewServerList.cpp
memspyui/source/MemSpyViewSystemConfig.cpp
memspyui/source/MemSpyViewThreadInfoItemActiveObject.cpp
memspyui/source/MemSpyViewThreadInfoItemChunk.cpp
memspyui/source/MemSpyViewThreadInfoItemCodeSeg.cpp
memspyui/source/MemSpyViewThreadInfoItemGeneralInfo.cpp
memspyui/source/MemSpyViewThreadInfoItemGeneric.cpp
memspyui/source/MemSpyViewThreadInfoItemHeap.cpp
memspyui/source/MemSpyViewThreadInfoItemList.cpp
memspyui/source/MemSpyViewThreadInfoItemMemoryTracking.cpp
memspyui/source/MemSpyViewThreadInfoItemServer.cpp
memspyui/source/MemSpyViewThreadInfoItemStack.cpp
memspyui/source/MemSpyViewThreads.cpp
memspyui/source/MemSpyViewType.cpp
memspyui/source/MemSpyViewWindowGroups.cpp
memspyui/ui/avkon/group/MemSpyCapabilities.mmh
memspyui/ui/avkon/group/bld.inf
memspyui/ui/avkon/group/memspyui.mmp
memspyui/ui/avkon/inc/MemSpy.hrh
memspyui/ui/avkon/inc/MemSpyApp.h
memspyui/ui/avkon/inc/MemSpyAppUi.h
memspyui/ui/avkon/inc/MemSpyContainer.h
memspyui/ui/avkon/inc/MemSpyContainerObserver.h
memspyui/ui/avkon/inc/MemSpyDeviceWideOperationDialog.h
memspyui/ui/avkon/inc/MemSpyDocument.h
memspyui/ui/avkon/inc/MemSpyExportBitmapsToMemoryCardDialog.h
memspyui/ui/avkon/inc/MemSpySettings.h
memspyui/ui/avkon/inc/MemSpyUiUtils.h
memspyui/ui/avkon/inc/MemSpyViewBase.h
memspyui/ui/avkon/inc/MemSpyViewChunkList.h
memspyui/ui/avkon/inc/MemSpyViewCodeSegList.h
memspyui/ui/avkon/inc/MemSpyViewDriveInfo.h
memspyui/ui/avkon/inc/MemSpyViewECom.h
memspyui/ui/avkon/inc/MemSpyViewFBServBitmaps.h
memspyui/ui/avkon/inc/MemSpyViewHeapTracking.h
memspyui/ui/avkon/inc/MemSpyViewHeapTrackingResults.h
memspyui/ui/avkon/inc/MemSpyViewHeapTrackingSettings.h
memspyui/ui/avkon/inc/MemSpyViewKernel.h
memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h
memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h
memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h
memspyui/ui/avkon/inc/MemSpyViewMainMenu.h
memspyui/ui/avkon/inc/MemSpyViewMemoryTrackingAutoStartConfig.h
memspyui/ui/avkon/inc/MemSpyViewObserver.h
memspyui/ui/avkon/inc/MemSpyViewOpenFiles.h
memspyui/ui/avkon/inc/MemSpyViewProcesses.h
memspyui/ui/avkon/inc/MemSpyViewRAMInfo.h
memspyui/ui/avkon/inc/MemSpyViewROMInfo.h
memspyui/ui/avkon/inc/MemSpyViewServerList.h
memspyui/ui/avkon/inc/MemSpyViewSystemConfig.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemList.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemMemoryTracking.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h
memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h
memspyui/ui/avkon/inc/MemSpyViewThreads.h
memspyui/ui/avkon/inc/MemSpyViewType.h
memspyui/ui/avkon/inc/MemSpyViewWindowGroups.h
memspyui/ui/avkon/inc/viewcli.h
memspyui/ui/avkon/src/MemSpyApp.cpp
memspyui/ui/avkon/src/MemSpyAppUi.cpp
memspyui/ui/avkon/src/MemSpyContainer.cpp
memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp
memspyui/ui/avkon/src/MemSpyDocument.cpp
memspyui/ui/avkon/src/MemSpyExportBitmapsToMemoryCardDialog.cpp
memspyui/ui/avkon/src/MemSpySettings.cpp
memspyui/ui/avkon/src/MemSpyUiUtils.cpp
memspyui/ui/avkon/src/MemSpyViewBase.cpp
memspyui/ui/avkon/src/MemSpyViewChunkList.cpp
memspyui/ui/avkon/src/MemSpyViewCodeSegList.cpp
memspyui/ui/avkon/src/MemSpyViewDriveInfo.cpp
memspyui/ui/avkon/src/MemSpyViewECom.cpp
memspyui/ui/avkon/src/MemSpyViewFBServBitmaps.cpp
memspyui/ui/avkon/src/MemSpyViewHeapTracking.cpp
memspyui/ui/avkon/src/MemSpyViewHeapTrackingResults.cpp
memspyui/ui/avkon/src/MemSpyViewHeapTrackingSettings.cpp
memspyui/ui/avkon/src/MemSpyViewKernel.cpp
memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp
memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp
memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp
memspyui/ui/avkon/src/MemSpyViewMainMenu.cpp
memspyui/ui/avkon/src/MemSpyViewMemoryTrackingAutoStartConfig.cpp
memspyui/ui/avkon/src/MemSpyViewOpenFiles.cpp
memspyui/ui/avkon/src/MemSpyViewProcesses.cpp
memspyui/ui/avkon/src/MemSpyViewRAMInfo.cpp
memspyui/ui/avkon/src/MemSpyViewROMInfo.cpp
memspyui/ui/avkon/src/MemSpyViewServerList.cpp
memspyui/ui/avkon/src/MemSpyViewSystemConfig.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemMemoryTracking.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp
memspyui/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp
memspyui/ui/avkon/src/MemSpyViewThreads.cpp
memspyui/ui/avkon/src/MemSpyViewType.cpp
memspyui/ui/avkon/src/MemSpyViewWindowGroups.cpp
memspyui/ui/hb/hb.pro
memspyui/ui/hb/inc/enginewrapper.h
memspyui/ui/hb/inc/memspykernelobjectdetailview.h
memspyui/ui/hb/inc/memspykernelobjecttypeview.h
memspyui/ui/hb/inc/memspykernelobjectview.h
memspyui/ui/hb/inc/memspymainview.h
memspyui/ui/hb/inc/memspyprocessview.h
memspyui/ui/hb/inc/memspythreaddetailview.h
memspyui/ui/hb/inc/memspythreadview.h
memspyui/ui/hb/inc/memspyview.h
memspyui/ui/hb/inc/viewmanager.h
memspyui/ui/hb/src/enginewrapper.cpp
memspyui/ui/hb/src/main.cpp
memspyui/ui/hb/src/memspykernelobjectdetailview.cpp
memspyui/ui/hb/src/memspykernelobjecttypeview.cpp
memspyui/ui/hb/src/memspykernelobjectview.cpp
memspyui/ui/hb/src/memspymainview.cpp
memspyui/ui/hb/src/memspyprocessview.cpp
memspyui/ui/hb/src/memspythreaddetailview.cpp
memspyui/ui/hb/src/memspythreadview.cpp
memspyui/ui/hb/src/memspyview.cpp
memspyui/ui/hb/src/viewmanager.cpp
perfmon/engine/src/perfmon_engine.cpp
perfmon/ui/hb/app/app.pro
perfmon/ui/hb/app/src/enginewrapper.cpp
perfmon/ui/hb/app/src/mainview.cpp
perfmon/ui/hb/app/src/settingsview.cpp
perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp
perfmon/ui/hb/win/enginewrapper.cpp
screengrabber/inc/mainview.h
screengrabber/inc/notifications.h
screengrabber/inc/settingsview.h
screengrabber/rom/backup_registration.xml
screengrabber/rom/screengrabber.iby
screengrabber/screengrabber.pro
screengrabber/sis/ScreenGrabber_S60-30.pkg
screengrabber/sis/ScreenGrabber_S60-30.sis
screengrabber/sis/ScreenGrabber_S60-32.pkg
screengrabber/sis/ScreenGrabber_S60-32.sis
screengrabber/sis/ScreenGrabber_stub.pkg
screengrabber/src/mainview.cpp
screengrabber/src/notifications.cpp
screengrabber/src/settingsview.cpp
stifui/avkon/group/ReleaseNote.txt
stifui/avkon/group/bld.inf
stifui/avkon/rom/Stifui.iby
stifui/avkon/sis/Stifui.pkg
stifui/avkon/sis/Stifui_31.sis
stifui/avkon/sis/Stifui_31_Stub.SIS
stifui/avkon/stifui/data/Stifui.rss
stifui/avkon/stifui/data/Stifui_reg.rss
stifui/avkon/stifui/group/Stifui.mmp
stifui/avkon/stifui/group/bld.inf
stifui/avkon/stifui/inc/AppUIApp.h
stifui/avkon/stifui/inc/AppUIAppUi.h
stifui/avkon/stifui/inc/AppUIDocument.h
stifui/avkon/stifui/inc/Container.h
stifui/avkon/stifui/inc/CreatedTestSetMenuContainer.h
stifui/avkon/stifui/inc/CreatedTestSetMenuView.h
stifui/avkon/stifui/inc/MainMenuContainer.h
stifui/avkon/stifui/inc/MainMenuView.h
stifui/avkon/stifui/inc/MenuListBox.h
stifui/avkon/stifui/inc/ShowStartedCasesContainer.h
stifui/avkon/stifui/inc/ShowStartedCasesView.h
stifui/avkon/stifui/inc/StartCasesContainer.h
stifui/avkon/stifui/inc/StartCasesView.h
stifui/avkon/stifui/inc/StartedCasesMenuContainer.h
stifui/avkon/stifui/inc/StartedCasesMenuView.h
stifui/avkon/stifui/inc/StatisticsContainer.h
stifui/avkon/stifui/inc/StatisticsView.h
stifui/avkon/stifui/inc/Stifui.hrh
stifui/avkon/stifui/inc/Stifui_loc.hrh
stifui/avkon/stifui/inc/TestCaseMenuContainer.h
stifui/avkon/stifui/inc/TestCaseMenuView.h
stifui/avkon/stifui/inc/TestCaseOutputContainer.h
stifui/avkon/stifui/inc/TestCaseOutputView.h
stifui/avkon/stifui/inc/TestModulesMenuContainer.h
stifui/avkon/stifui/inc/TestModulesMenuView.h
stifui/avkon/stifui/inc/TestSetBaseMenuContainer.h
stifui/avkon/stifui/inc/TestSetBaseMenuView.h
stifui/avkon/stifui/inc/TestSetInsertMenuContainer.h
stifui/avkon/stifui/inc/TestSetInsertMenuView.h
stifui/avkon/stifui/inc/TestSetMenuContainer.h
stifui/avkon/stifui/inc/TestSetMenuView.h
stifui/avkon/stifui/inc/TestSetStartedCasesContainer.h
stifui/avkon/stifui/inc/TestSetStartedCasesView.h
stifui/avkon/stifui/inc/UIStoreHandler.h
stifui/avkon/stifui/inc/View.h
stifui/avkon/stifui/inc/version.h
stifui/avkon/stifui/src/AppUIApp.cpp
stifui/avkon/stifui/src/AppUIAppUi.cpp
stifui/avkon/stifui/src/AppUIDocument.cpp
stifui/avkon/stifui/src/Container.cpp
stifui/avkon/stifui/src/CreatedTestSetMenuContainer.cpp
stifui/avkon/stifui/src/CreatedTestSetMenuView.cpp
stifui/avkon/stifui/src/MainMenuContainer.cpp
stifui/avkon/stifui/src/MainMenuView.cpp
stifui/avkon/stifui/src/MenuListBox.cpp
stifui/avkon/stifui/src/ShowStartedCasesContainer.cpp
stifui/avkon/stifui/src/ShowStartedCasesView.cpp
stifui/avkon/stifui/src/StartCasesContainer.cpp
stifui/avkon/stifui/src/StartCasesView.cpp
stifui/avkon/stifui/src/StartedCasesMenuContainer.cpp
stifui/avkon/stifui/src/StartedCasesMenuView.cpp
stifui/avkon/stifui/src/StatisticsContainer.cpp
stifui/avkon/stifui/src/StatisticsView.cpp
stifui/avkon/stifui/src/TestCaseMenuContainer.cpp
stifui/avkon/stifui/src/TestCaseMenuView.cpp
stifui/avkon/stifui/src/TestCaseOutputContainer.cpp
stifui/avkon/stifui/src/TestCaseOutputView.cpp
stifui/avkon/stifui/src/TestModulesMenuContainer.cpp
stifui/avkon/stifui/src/TestSetBaseMenuContainer.cpp
stifui/avkon/stifui/src/TestSetBaseMenuView.cpp
stifui/avkon/stifui/src/TestSetInsertMenuContainer.cpp
stifui/avkon/stifui/src/TestSetInsertMenuView.cpp
stifui/avkon/stifui/src/TestSetMenuContainer.cpp
stifui/avkon/stifui/src/TestSetMenuView.cpp
stifui/avkon/stifui/src/TestSetStartedCasesContainer.cpp
stifui/avkon/stifui/src/TestSetStartedCasesView.cpp
stifui/avkon/stifui/src/Testmodulesmenuview.cpp
stifui/avkon/stifui/src/UIStoreHandler.cpp
stifui/avkon/stifui/src/View.cpp
stifui/avkon/uitestserverstarter/data/UITestServerStarter.rls
stifui/avkon/uitestserverstarter/data/UITestServerStarter.rss
stifui/avkon/uitestserverstarter/data/UITestServerStarter_reg.rss
stifui/avkon/uitestserverstarter/group/UITestServerStarter.mmp
stifui/avkon/uitestserverstarter/group/bld.inf
stifui/avkon/uitestserverstarter/inc/AknUiEnvProxy.h
stifui/avkon/uitestserverstarter/inc/EventUtil.h
stifui/avkon/uitestserverstarter/inc/TestServerThreadStarter.h
stifui/avkon/uitestserverstarter/inc/UITestServerStarter.hrh
stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppContainer.h
stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppUi.h
stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppView.h
stifui/avkon/uitestserverstarter/inc/UITestServerStarterApplication.h
stifui/avkon/uitestserverstarter/inc/UITestServerStarterDocument.h
stifui/avkon/uitestserverstarter/src/AknUiEnvProxy.cpp
stifui/avkon/uitestserverstarter/src/EventUtil.cpp
stifui/avkon/uitestserverstarter/src/TestServerThreadStarter.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarter.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarterAppContainer.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarterAppUi.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarterAppView.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarterApplication.cpp
stifui/avkon/uitestserverstarter/src/UITestServerStarterDocument.cpp
stifui/group/ReleaseNote.txt
stifui/group/bld.inf
stifui/qt/ReleaseNote.txt
stifui/qt/inc/cstfcase.h
stifui/qt/inc/cstfmodule.h
stifui/qt/inc/dlgoutput.h
stifui/qt/inc/dlgsetting.h
stifui/qt/inc/frmmain.h
stifui/qt/inc/istfqtuicontroller.h
stifui/qt/inc/istfqtuimodel.h
stifui/qt/inc/stfqtuicontroller.h
stifui/qt/inc/stfqtuimodel.h
stifui/qt/inc/stifexecutor.h
stifui/qt/inc/uisetting.h
stifui/qt/inc/version.h
stifui/qt/sis/stifqtui.sisx
stifui/qt/src/dlgoutput.cpp
stifui/qt/src/dlgsetting.cpp
stifui/qt/src/frmmain.cpp
stifui/qt/src/main.cpp
stifui/qt/src/stfqtuicontroller.cpp
stifui/qt/src/stfqtuimodel.cpp
stifui/qt/src/stifexecutor.cpp
stifui/qt/src/uisetting.cpp
stifui/qt/stifqtui.pro
stifui/rom/Stifui.iby
stifui/sis/Stifui.pkg
stifui/sis/Stifui_31.sis
stifui/sis/Stifui_31_Stub.SIS
stifui/stifui/data/Stifui.rss
stifui/stifui/data/Stifui_reg.rss
stifui/stifui/group/Stifui.mmp
stifui/stifui/group/bld.inf
stifui/stifui/inc/AppUIApp.h
stifui/stifui/inc/AppUIAppUi.h
stifui/stifui/inc/AppUIDocument.h
stifui/stifui/inc/Container.h
stifui/stifui/inc/CreatedTestSetMenuContainer.h
stifui/stifui/inc/CreatedTestSetMenuView.h
stifui/stifui/inc/MainMenuContainer.h
stifui/stifui/inc/MainMenuView.h
stifui/stifui/inc/MenuListBox.h
stifui/stifui/inc/ShowStartedCasesContainer.h
stifui/stifui/inc/ShowStartedCasesView.h
stifui/stifui/inc/StartCasesContainer.h
stifui/stifui/inc/StartCasesView.h
stifui/stifui/inc/StartedCasesMenuContainer.h
stifui/stifui/inc/StartedCasesMenuView.h
stifui/stifui/inc/StatisticsContainer.h
stifui/stifui/inc/StatisticsView.h
stifui/stifui/inc/Stifui.hrh
stifui/stifui/inc/Stifui_loc.hrh
stifui/stifui/inc/TestCaseMenuContainer.h
stifui/stifui/inc/TestCaseMenuView.h
stifui/stifui/inc/TestCaseOutputContainer.h
stifui/stifui/inc/TestCaseOutputView.h
stifui/stifui/inc/TestModulesMenuContainer.h
stifui/stifui/inc/TestModulesMenuView.h
stifui/stifui/inc/TestSetBaseMenuContainer.h
stifui/stifui/inc/TestSetBaseMenuView.h
stifui/stifui/inc/TestSetInsertMenuContainer.h
stifui/stifui/inc/TestSetInsertMenuView.h
stifui/stifui/inc/TestSetMenuContainer.h
stifui/stifui/inc/TestSetMenuView.h
stifui/stifui/inc/TestSetStartedCasesContainer.h
stifui/stifui/inc/TestSetStartedCasesView.h
stifui/stifui/inc/UIStoreHandler.h
stifui/stifui/inc/View.h
stifui/stifui/inc/version.h
stifui/stifui/src/AppUIApp.cpp
stifui/stifui/src/AppUIAppUi.cpp
stifui/stifui/src/AppUIDocument.cpp
stifui/stifui/src/Container.cpp
stifui/stifui/src/CreatedTestSetMenuContainer.cpp
stifui/stifui/src/CreatedTestSetMenuView.cpp
stifui/stifui/src/MainMenuContainer.cpp
stifui/stifui/src/MainMenuView.cpp
stifui/stifui/src/MenuListBox.cpp
stifui/stifui/src/ShowStartedCasesContainer.cpp
stifui/stifui/src/ShowStartedCasesView.cpp
stifui/stifui/src/StartCasesContainer.cpp
stifui/stifui/src/StartCasesView.cpp
stifui/stifui/src/StartedCasesMenuContainer.cpp
stifui/stifui/src/StartedCasesMenuView.cpp
stifui/stifui/src/StatisticsContainer.cpp
stifui/stifui/src/StatisticsView.cpp
stifui/stifui/src/TestCaseMenuContainer.cpp
stifui/stifui/src/TestCaseMenuView.cpp
stifui/stifui/src/TestCaseOutputContainer.cpp
stifui/stifui/src/TestCaseOutputView.cpp
stifui/stifui/src/TestModulesMenuContainer.cpp
stifui/stifui/src/TestSetBaseMenuContainer.cpp
stifui/stifui/src/TestSetBaseMenuView.cpp
stifui/stifui/src/TestSetInsertMenuContainer.cpp
stifui/stifui/src/TestSetInsertMenuView.cpp
stifui/stifui/src/TestSetMenuContainer.cpp
stifui/stifui/src/TestSetMenuView.cpp
stifui/stifui/src/TestSetStartedCasesContainer.cpp
stifui/stifui/src/TestSetStartedCasesView.cpp
stifui/stifui/src/Testmodulesmenuview.cpp
stifui/stifui/src/UIStoreHandler.cpp
stifui/stifui/src/View.cpp
stifui/uitestserverstarter/data/UITestServerStarter.rls
stifui/uitestserverstarter/data/UITestServerStarter.rss
stifui/uitestserverstarter/data/UITestServerStarter_reg.rss
stifui/uitestserverstarter/group/UITestServerStarter.mmp
stifui/uitestserverstarter/group/bld.inf
stifui/uitestserverstarter/inc/AknUiEnvProxy.h
stifui/uitestserverstarter/inc/EventUtil.h
stifui/uitestserverstarter/inc/TestServerThreadStarter.h
stifui/uitestserverstarter/inc/UITestServerStarter.hrh
stifui/uitestserverstarter/inc/UITestServerStarterAppContainer.h
stifui/uitestserverstarter/inc/UITestServerStarterAppUi.h
stifui/uitestserverstarter/inc/UITestServerStarterAppView.h
stifui/uitestserverstarter/inc/UITestServerStarterApplication.h
stifui/uitestserverstarter/inc/UITestServerStarterDocument.h
stifui/uitestserverstarter/src/AknUiEnvProxy.cpp
stifui/uitestserverstarter/src/EventUtil.cpp
stifui/uitestserverstarter/src/TestServerThreadStarter.cpp
stifui/uitestserverstarter/src/UITestServerStarter.cpp
stifui/uitestserverstarter/src/UITestServerStarterAppContainer.cpp
stifui/uitestserverstarter/src/UITestServerStarterAppUi.cpp
stifui/uitestserverstarter/src/UITestServerStarterAppView.cpp
stifui/uitestserverstarter/src/UITestServerStarterApplication.cpp
stifui/uitestserverstarter/src/UITestServerStarterDocument.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/creator.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,247 @@
+#
+# 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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = app
+TARGET = Creator
+
+DEPENDPATH += .
+DEPENDPATH += src engine/src
+INCLUDEPATH += inc engine/inc
+
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
+
+HEADERS += \
+	inc/mainview.h \
+	inc/notifications.h
+
+SOURCES += main.cpp \
+	src/mainview.cpp \
+	src/notifications.cpp
+
+symbian: {
+
+	HEADERS += engine/inc/creator.hrh \
+			engine/inc/creator_accesspoint.h \
+			engine/inc/creator_browser.h \
+			engine/inc/creator_browserelement.h \
+			engine/inc/creator_calendar.h \
+			engine/inc/creator_calendarbase.h \
+			engine/inc/creator_calendarelement.h \
+			engine/inc/creator_cmdscriptrun.h \
+			engine/inc/creator_connectionmethod.h \
+			engine/inc/creator_connectionmethodbase.h \
+			engine/inc/creator_connectionmethodelement.h \
+			engine/inc/creator_contactelement.h \
+			engine/inc/creator_contactsetcache.h \
+			engine/inc/creator_factory.h \
+			engine/inc/creator_file.h \
+			engine/inc/creator_fileelement.h \
+			engine/inc/creator_landmark.h \
+			engine/inc/creator_landmarkelement.h \
+			engine/inc/creator_log.h \
+			engine/inc/creator_logelement.h \
+			engine/inc/creator_mailbox.h \
+			engine/inc/creator_mailboxelement.h \
+			engine/inc/creator_message.h \
+			engine/inc/creator_messageelement.h \
+			engine/inc/creator_modulebase.h \
+			engine/inc/creator_note.h \
+			engine/inc/creator_phonebook.h \
+			engine/inc/creator_phonebookbase.h \
+			engine/inc/creator_randomdatafield.h \
+			engine/inc/creator_randomdataparser.h \
+			engine/inc/creator_scriptelement.h \
+			engine/inc/creator_scriptelementfactory.h \
+			engine/inc/creator_scriptentry.h \
+			engine/inc/creator_scriptparser.h \
+			engine/inc/creator_std.h \
+			engine/inc/creator_traces.h \
+			engine/inc/creator_wepsecuritysettings.h \
+			engine/inc/randomData.txt \
+			inc/engine.h \
+			inc/enginewrapper.h
+
+	SOURCES += engine/src/creator_accesspoint.cpp \
+			engine/src/creator_browser.cpp \
+			engine/src/creator_browserelement.cpp \
+			engine/src/creator_calendar.cpp \
+			engine/src/creator_calendarelement.cpp \
+			engine/src/creator_cmdscriptrun.cpp \
+			engine/src/creator_connectionmethod.cpp \
+			engine/src/creator_connectionmethodelement.cpp \
+			engine/src/creator_contactelement.cpp \
+			engine/src/creator_contactsetcache.cpp \
+			engine/src/creator_factory.cpp \
+			engine/src/creator_file.cpp \
+			engine/src/creator_fileelement.cpp \
+			engine/src/creator_landmark.cpp \
+			engine/src/creator_landmarkelement.cpp \
+			engine/src/creator_log.cpp \
+			engine/src/creator_logelement.cpp \
+			engine/src/creator_mailbox.cpp \
+			engine/src/creator_mailboxelement.cpp \
+			engine/src/creator_message.cpp \
+			engine/src/creator_messageelement.cpp \
+			engine/src/creator_note.cpp \
+			engine/src/creator_phonebook.cpp \
+			engine/src/creator_phonebookbase.cpp \
+			engine/src/creator_randomdataparser.cpp \
+			engine/src/creator_scriptelement.cpp \
+			engine/src/creator_scriptelementfactory.cpp \
+			engine/src/creator_scriptentry.cpp \
+			engine/src/creator_scriptparser.cpp \
+			src/engine.cpp \
+			src/enginewrapper.cpp
+
+	LIBS += -lestor \
+			-lws32 \
+			-lPlatformEnv \
+			-limageconversion \
+			-leikcore \
+			-leuser \
+			-lapparc \
+			-lcone \ 
+			-lcntmodel \
+			-lfavouritesengine \
+			-lmsgs \
+			-llogwrap \
+			-llogcli \
+			-lefsrv \
+			-lgsmu \
+			-limcm \
+			-lbafl \ 
+			-leikcoctl \ 
+			-leikctl \
+			-lcommdb \
+			-letext \ 
+			-lcommonengine \ 
+			-lcommonui \ 
+			-lplatformenv \ 
+			-lapgrfx \
+			-lapmime \
+			-lobexmtmutil \
+			-lsmcm \
+			-laknskins \
+			-laknskinsrv \ 
+			-lflogger \
+			-letel \
+			-letelmm \
+			-lxmlframework \
+			-lcharconv \ 
+			-lsenutils \
+			-lcalinterimapi \
+			-leposlandmarks \
+			-llbs \
+			-lecom \
+			-lcaf \
+			-lcafutils \ 
+			-ldrmrights \
+			-ledbms \
+			-lfbscli \
+			-lbitmaptransforms \
+			-lcmmanager \
+			-lcmmanagerdatabase \
+			-lapengine \
+			-lnoteseditor \
+			-lxqservice \
+		    -lQtContacts \
+		    -lmobcntmodel \ 
+			-lagendainterface 
+
+	creatorDataBlock = \
+			"SOURCEPATH ." \
+			"START RESOURCE data/datacreator.rss" \
+			"HEADER" \
+			"TARGETPATH /resource/apps" \
+			"END"
+
+	MMP_RULES += creatorDataBlock
+
+    BLD_INF_RULES.prj_exports += "./rom/creator.iby CORE_IBY_EXPORT_PATH(tools,creator.iby)
+	BLD_INF_RULES.prj_exports += \
+				"./files/backup_registration.xml    Z:/private/20011383/backup_registration.xml" \
+				"./files/3GPP-70kB.dat              Z:/private/20011383/3GPP-70kB.3gpp" \
+				"./files/AAC-100kB.dat              Z:/private/20011383/AAC-100kB.aac" \
+				"./files/AMR-20kB.dat               Z:/private/20011383/AMR-20kB.amr" \
+				"./files/BMP-25kB.dat               Z:/private/20011383/BMP-25kB.bmp" \
+				"./files/Deck-1kB.dat               Z:/private/20011383/Deck-1kB.saveddeck" \
+				"./files/DOC-20kB.dat               Z:/private/20011383/DOC-20kB.doc" \
+				"./files/GIF-2kB.dat                Z:/private/20011383/GIF-2kB.gif" \
+				"./files/HTML-20kB.dat              Z:/private/20011383/HTML-20kB.html" \
+				"./files/JAD-1kB.dat                Z:/private/20011383/JAD-1kB.jad" \
+				"./files/JAR-10kB.dat               Z:/private/20011383/JAR-10kB.jar" \
+				"./files/JP2-65kB.dat               Z:/private/20011383/JP2-65kB.jp2" \
+				"./files/JPEG-200kB.dat             Z:/private/20011383/JPEG-200kB.jpg" \
+				"./files/JPEG-25kB.dat              Z:/private/20011383/JPEG-25kB.jpg" \
+				"./files/JPEG-500kB.dat             Z:/private/20011383/JPEG-500kB.jpg" \
+				"./files/MIDI-10kB.dat              Z:/private/20011383/MIDI-10kB.mid" \
+				"./files/MP3-250kB.dat              Z:/private/20011383/MP3-250kB.mp3" \
+				"./files/MP4-200kB.dat              Z:/private/20011383/MP4-200kB.mp4" \
+				"./files/MXMF-40kB.dat              Z:/private/20011383/MXMF-40kB.mxmf" \
+				"./files/PNG-15kB.dat               Z:/private/20011383/PNG-15kB.png" \
+				"./files/PPT-40kB.dat               Z:/private/20011383/PPT-40kB.ppt" \
+				"./files/RAM-1kB.dat                Z:/private/20011383/RAM-1kB.ram" \
+				"./files/RM-95kB.dat                Z:/private/20011383/RM-95kB.rm" \
+				"./files/RNG-1kB.dat                Z:/private/20011383/RNG-1kB.rng" \
+				"./files/SVG-15kB.dat               Z:/private/20011383/SVG-15kB.svg" \
+				"./files/SWF-15kB.dat               Z:/private/20011383/SWF-15kB.swf" \
+				"./files/TIF-25kB.dat               Z:/private/20011383/TIF-25kB.tif" \
+				"./files/TXT-10kB.dat               Z:/private/20011383/TXT-10kB.txt" \
+				"./files/TXT-70kB.dat               Z:/private/20011383/TXT-70kB.txt" \
+				"./files/VCF-1kB.dat                Z:/private/20011383/VCF-1kB.vcf" \
+				"./files/VCS-1kB.dat                Z:/private/20011383/VCS-1kB.vcs" \
+				"./files/WAV-20kB.dat               Z:/private/20011383/WAV-20kB.wav" \
+				"./files/XLS-15kB.dat               Z:/private/20011383/XLS-15kB.xls" \
+				"./files/SISX-10kB.dat              Z:/private/20011383/SISX-10kB.sisx" \
+				"./files/WMA-50kB.dat               Z:/private/20011383/WMA-50kB.wma" \
+				"./files/WMV-200kB.dat              Z:/private/20011383/WMV-200kB.wmv" \
+				"./scripts/creator.xsd                   +/tools/s60rndtools/creator/creator.xsd" \
+				"./scripts/browserEx.creatorxml          +/tools/s60rndtools/creator/browserEx.creatorxml" \
+				"./scripts/calendarEx.creatorxml         +/tools/s60rndtools/creator/calendarEx.creatorxml" \
+				"./scripts/connectionmethodEx.creatorxml +/tools/s60rndtools/creator/connectionmethodEx.creatorxml" \
+				"./scripts/contactEx.creatorxml          +/tools/s60rndtools/creator/contactEx.creatorxml" \
+				"./scripts/filesEx.creatorxml            +/tools/s60rndtools/creator/filesEx.creatorxml" \
+				"./scripts/landmarkEx.creatorxml         +/tools/s60rndtools/creator/landmarkEx.creatorxml" \
+				"./scripts/logEx.creatorxml              +/tools/s60rndtools/creator/logEx.creatorxml" \
+				"./scripts/mailboxEx.creatorxml          +/tools/s60rndtools/creator/mailboxEx.creatorxml" \
+				"./scripts/messagesEx.creatorxml         +/tools/s60rndtools/creator/messagesEx.creatorxml" \
+				"./scripts/notepadEx.creatorxml          +/tools/s60rndtools/creator/notepadEx.creatorxml" 
+    
+    creator_buildstubsis_extension = \
+        "$${LITERAL_HASH}ifdef MARM" \
+        "    START EXTENSION app-services/buildstubsis" \
+        "    OPTION SRCDIR sis" \
+        "    OPTION SISNAME creator_stub" \
+        "    END" \
+        "$${LITERAL_HASH}endif" 
+        
+    BLD_INF_RULES.prj_extensions += creator_buildstubsis_extension
+    
+	RSS_RULES += "group_name = \"RnD Tools\"";
+	TARGET.CAPABILITY = CAP_APPLICATION AllFiles
+
+	TARGET.UID2 = 0x100039CE
+	TARGET.UID3 = 0x20011383
+	TARGET.SID = 0x20011383
+	TARGET.VID = 0x101FB657 // Nokia
+	TARGET.EPOCHEAPSIZE = 0x20000 0x1000000  // Min 128Kb, Max 16Mb
+
+	ICON = icons/qgn_menu_creator.svg 
+
+} else {
+	error("Only Symbian supported!")
+}
--- a/creator/data/creator.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2332 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-NAME MATT
-
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <avkon.mbg>
-#include <AvkonIcons.hrh>
-
-
-
-#include "creator.hrh"
-#include <data_caging_paths_strings.hrh>
-#include <appinfo.rh>
-
-// ---------------------------------------------------------
-//   
-//    Define the resource file signature 
-//    This resource should be empty.
-//
-// ---------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//   
-//    Default Document Name
-//
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name { buf=""; }
-
-// ---------------------------------------------------------
-//   
-//    Define default menu and CBA key.
-//
-// ---------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-    menubar = r_creator_menubar;
-    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
-    }
-
-
-// ---------------------------------------------------------
-//   
-//   r_creator_menubar
-//   Menubar for Creator
-//
-// ---------------------------------------------------------
-//
-RESOURCE MENU_BAR r_creator_menubar
-    {
-    titles =
-        {
-        MENU_TITLE {menu_pane = r_creator_menu;}
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   
-//   r_creator_menu
-//   Menu for "Options"
-//
-// ---------------------------------------------------------
-//
-RESOURCE MENU_PANE r_creator_menu
-    {
-    items = 
-        {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-        MENU_ITEM 
-            {
-            command = ECmdCreateFromFile;
-             txt = "Run script";
-            },
-#endif
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntries;
-            cascade = r_creator_agendaentries_submenu;
-             txt = "Calendar";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateBrowserEntries;
-            cascade = r_creator_browserentries_submenu;
-             txt = "Browser";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntries;
-            cascade = r_creator_fileentries_submenu;
-             txt = "Files";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateLogEntries;
-            cascade = r_creator_logentries_submenu;
-             txt = "Logs";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntries;
-            cascade = r_creator_messagingentries_submenu;
-             txt = "Messaging";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntries;
-            cascade = r_creator_miscentries_submenu;
-             txt = "Misc";
-            },
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-        MENU_ITEM 
-            {
-            command = ECmdCreatePhoneBookEntries;
-            cascade = r_creator_phonebookentries_submenu;
-             txt = "Phonebook";
-            },
-#endif
-        MENU_ITEM 
-            {
-            command = ECmdDeleteEntries;
-            cascade = r_creator_deleteentries_submenu;
-            txt = "Delete";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdSelectRandomDataFile;
-            txt = "Select random data file";
-            },
-
-        MENU_ITEM 
-            {
-            command = ECmdAboutCreator;
-            txt = "About Creator";
-            },
-
-        MENU_ITEM 
-            {
-            command = EAknSoftkeyExit;   
-            txt = "Exit";
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_agendaentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntryAppointments;
-            txt = "Appointments";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntryEvents;
-            txt = "Events";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntryAnniversaries;
-            txt = "Anniversaries";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntryToDos;
-            txt = "Todos";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateCalendarEntryReminders;
-            txt = "Reminders";
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_browserentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdCreateBrowserBookmarkEntries;
-            txt = "Bookmarks";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateBrowserBookmarkFolderEntries;
-            txt = "Bookmark folders";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateBrowserSavedPageEntries;
-            txt = "Saved pages";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateBrowserSavedPageFolderEntries;
-            txt = "Saved page folders";
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_fileentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryEmptyFolder;
-            txt = "Empty folder";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJPEG_25kB;
-            txt = "JPEG 25kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJPEG_200kB;
-            txt = "JPEG 200kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJPEG_500kB;
-            txt = "JPEG 500kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryPNG_15kB;
-            txt = "PNG 15kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryGIF_2kB;
-            txt = "GIF 2kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryBMP_25kB;
-            txt = "BMP 25kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJP2_65kB;
-            txt = "JP2 65kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntrySVG_15kB;
-            txt = "SVG 15kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryTIF_25kB;
-            txt = "TIF 25kB";
-            },                                                
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryRNG_1kB;
-            txt = "RNG 1kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryMIDI_10kB;
-            txt = "MIDI 10kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryWAV_20kB;
-            txt = "WAVE 20kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryAMR_20kB;
-            txt = "AMR 20kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryXLS_15kB;
-            txt = "Excel 15kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryDOC_20kB;
-            txt = "Word 20kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryPPT_40kB;
-            txt = "PowerPoint 40kB";
-            },
-        MENU_ITEM 
-            {            
-            command = ECmdCreateFileEntryTXT_10kB;
-            txt = "Text 10kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryTXT_70kB;
-            txt = "Text 70kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryHTML_20kB;
-            txt = "HTML 20kB";
-            },
-        /*MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryDeck_1kB;
-            txt = "Savedeck 1kB";
-            },*/
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryMXMF_40kB;
-            txt = "MXMF 40kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryRAM_1kB;
-            txt = "RAM 1kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJAD_1kB;
-            txt = "JAD 1kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryJAR_10kB;
-            txt = "JAR 10kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryVCF_1kB;
-            txt = "VCF 1kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryVCS_1kB;
-            txt = "VCS 1kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntrySISX_10kB;
-            txt = "SISX 10kB";
-            },               
-        MENU_ITEM 
-            {                     
-            command = ECmdCreateFileEntry3GPP_70kB;
-            txt = "3GPP 70kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryMP3_250kB;
-            txt = "MP3 250kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryAAC_100kB;
-            txt = "AAC 100kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntrySWF_15kB;
-            txt = "SWF 15kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryMP4_200kB;
-            txt = "MP4 200kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryRM_95kB;
-            txt = "RM 95kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryWMA_50kB;
-            txt = "WMA 50kB";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateFileEntryWMV_200kB;
-            txt = "WMV 200kB";
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_logentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdCreateLogEntryMissedCalls;
-            txt = "Missed calls";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateLogEntryReceivedCalls;
-            txt = "Received calls";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateLogEntryDialledNumbers;
-            txt = "Dialled numbers";
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_messagingentries_submenu
-    {
-    items = 
-        {
-/*        
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntryCBSTopics;
-            txt = "CBS topics";
-            },
-        MENU_ITEM
-            {
-            command = ECmdCreateMessagingEntryDocumentsFolders;
-            txt = "Documents folders";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntrySMSMessageCenters;
-            txt = "SMS Message Centers";
-            },
-*/
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntryMailboxes;
-            txt = "Mailboxes";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntryMessages;
-            txt = "Messages";
-            }
-/*            
-            ,
-        MENU_ITEM 
-            {
-            command = ECmdCreateMessagingEntryTemplates;
-            txt = "Templates";
-            }
-*/
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_miscentries_submenu
-    {
-    items = 
-        {
-      #if defined (__SERIES60_30__) || defined(__SERIES60_31__)
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryAccessPoints;
-             txt = "Access Points";
-            },
-                
-      #else
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryAccessPoints;
-            txt = "Connection Methods";
-            },
-            
-      #endif                 
-            
-/*
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryAppMenuFolders;
-             txt = "App menu folders";
-            },
-*/
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-    #ifdef __PRESENCE
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryIMPSServers;
-             txt = "IMPS servers";
-            },
-    #endif
-    
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryNotes;
-             txt = "Notes";
-            },
- 
-#endif
-/*            
-            ,
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntrySyncSettings;
-             txt = "Sync settings";
-            }
-*/
-            
-        MENU_ITEM 
-            {
-            command = ECmdCreateMiscEntryLandmarks;
-            txt = "Landmarks";
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_phonebookentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdCreatePhoneBookEntryContacts;
-             txt = "Contacts";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdCreatePhoneBookEntryGroups;
-             txt = "Groups";
-            }
-/*            
-            ,
-        MENU_ITEM 
-            {
-            command = ECmdCreatePhoneBookEntrySubscribedContacts;
-             txt = "Subscribed contacts";
-            }
-*/
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE MENU_PANE r_creator_deleteentries_submenu
-    {
-    items = 
-        {
-        MENU_ITEM 
-            {
-            command = ECmdDeleteAllEntries;
-            cascade = r_creator_deleteall_submenu;
-            txt = "All items";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteCalendarEntries;
-            cascade = r_creator_deletecalendar_submenu;
-            txt = "Calendar entries";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteBrowserBookmarks;
-            cascade = r_creator_deletebookmarks_submenu;
-            txt = "Br bookmarks";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteCreatorBrowserBookmarkFolders;
-            cascade = r_creator_deletebookmarkfolders_submenu;
-            txt = "Br bookmark folders";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteBrowserSavedPages;
-            cascade = r_creator_deletesavedpages_submenu;
-            txt = "Br saved pages";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteBrowserSavedPageFolders;
-            cascade = r_creator_deletesavedpagefolders_submenu;
-            txt = "Br saved page folders";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteCreatorFiles;
-            cascade = r_creator_deletefiles_submenu;
-            txt = "Files";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteLogs;
-            cascade = r_creator_deletelogs_submenu;
-            txt = "Logs";
-            },
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-        MENU_ITEM 
-            {
-            command = ECmdDeleteMessages;
-            cascade = r_creator_deletemessages_submenu;
-            txt = "Messages";
-            },
-#endif            
-        MENU_ITEM 
-            {
-            command = ECmdDeleteIAPs; // ECmdDeleteMiscEntryAccessPoints
-            cascade = r_creator_deleteiaps_submenu;
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
-            txt = "Access Points";
-#else
-            txt = "Connection methods";
-#endif
-            },
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-        MENU_ITEM 
-            {
-            command = ECmdDeleteIMPSs;
-            cascade = r_creator_deleteimps_submenu;
-            txt = "IMPS servers";
-            },
-        MENU_ITEM 
-            {
-            command = ECmdDeleteNotes;
-            cascade = r_creator_deletenotes_submenu;
-            txt = "Notes";
-            },
-#endif            
-        MENU_ITEM 
-            {
-            command = ECmdDeleteLandmarks;
-            cascade = r_creator_deletelandmarks_submenu;
-            txt = "Landmarks";
-            }
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-            ,
-            
-        MENU_ITEM 
-            {
-            command = ECmdDeleteContacts;
-            cascade = r_creator_deletecontacts_submenu;
-            txt = "Contacts";
-            },           
-        MENU_ITEM 
-            {
-            command = ECmdDeleteContactGroups;
-            cascade = r_creator_deletecontactgroups_submenu;
-            txt = "Contact groups";
-            }
-#endif            
-        /*
-        MENU_ITEM 
-            {
-            command = ECmdDeleteMiscEntryAccessPoints;
-            txt = "All Connection Methods";
-            }
-        */
-        };
-    }
-
-#define string_creator_deletemenu_all "All"
-#define string_creator_deletemenu_by_creator "By Creator"
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deleteall_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteAllEntries;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteAllCreatorEntries;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletecalendar_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteCalendarEntries;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorCalendarEntries;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletebookmarks_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteBrowserBookmarks;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorBrowserBookmarks;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletebookmarkfolders_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteBrowserBookmarkFolders;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorBrowserBookmarkFolders;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletesavedpages_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteBrowserSavedPages;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorBrowserSavedPages;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletesavedpagefolders_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteBrowserSavedPageFolders;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorBrowserSavedPageFolders;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletefiles_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorFiles;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletelogs_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteLogs;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorLogs;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletemailboxes_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteMailboxes;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorMailboxes;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletemessages_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteMessages;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorMessages;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deleteiaps_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteIAPs;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorIAPs;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deleteimps_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteIMPSs;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorIMPSs;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletenotes_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteNotes;
-            txt = string_creator_deletemenu_all;
-            }
-        // By Creator not supported because 
-        // note id is not available via Notepad API
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletelandmarks_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteLandmarks;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorLandmarks;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletecontacts_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteContacts;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorContacts;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-RESOURCE MENU_PANE r_creator_deletecontactgroups_submenu
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ECmdDeleteContactGroups;
-            txt = string_creator_deletemenu_all;
-            },
-        MENU_ITEM
-            {
-            command = ECmdDeleteCreatorContactGroups;
-            txt = string_creator_deletemenu_by_creator;
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   
-//   r_creator_about_dialog
-//   About dialog - show version and copyright info etc.
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_creator_about_dialog
-{
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-    {
-        DLG_LINE
-        {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-            {
-                label = "About Creator";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-            };
-        },
-        DLG_LINE
-        {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-            {
-                message = "Version 5.3.5 - 30th October 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
-            };
-        }
-    };
-}
-
-
-// ---------------------------------------------------------
-//   
-//   r_entry_query
-//   Dialog to query the amount of entries to create
-//
-// ---------------------------------------------------------
-//
-
-
-RESOURCE DIALOG r_entry_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = ENumberLayout;
-                label = "Insert label to ExecuteLD";
-                control = AVKON_INTEGER_EDWIN
-                    {
-                    min = 0;
-                    max = 9999;
-                    };
-                };
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   
-//   r_start_date_query
-//   Dialog to query a start date
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_start_date_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = EDateLayout;
-                label = "Start date of creation period";
-                control = DATE_EDITOR
-                    {
-                    minDate = DATE
-                        {
-                        year = 1900;
-                        };
-                    maxDate = DATE
-                        {
-                        year = 3000;
-                        };
-                    flags = 0;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_end_date_query
-//   Dialog to query a start date
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_end_date_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = EDateLayout;
-                label = "End date of creation period";
-                control = DATE_EDITOR
-                    {
-                    minDate = DATE
-                        {
-                        year = 1900;
-                        };
-                    maxDate = DATE
-                        {
-                        year = 3000;
-                        };
-                    flags = 0;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_contact_creation_type_query
-//   Dialog to query a contact creation type
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_contact_creation_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_contact_creation_type_query_array;
-                    };
-                heading = "Fields in contact";                
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_contact_creation_type_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Default fields"; },
-        LBUF {txt = "Define..."; }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   
-//   r_message_type_query
-//   Dialog to query a message type
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_message_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_message_type_query_array;
-                    };
-                heading = "Message type";                
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_message_type_query_array
-    {
-    items =
-        {
-        LBUF {txt = "SMS"; },
-        LBUF {txt = "MMS"; },
-        LBUF {txt = "AMS"; },
-        LBUF {txt = "Email"; },
-        LBUF {txt = "Smart Message"; },
-        LBUF {txt = "IR Message"; },
-        LBUF {txt = "BT Message"; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_folder_type_query
-//   Dialog to query a message type
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_folder_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_folder_type_query_array;
-                    };
-                heading = "Folder type";                
-                };
-            }
-        };
-    }
-    
-RESOURCE ARRAY r_folder_type_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Inbox"; },
-        LBUF {txt = "Drafts"; },
-        LBUF {txt = "Outbox"; },
-        LBUF {txt = "Sent"; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_folder_type_with_mailbox_query
-//   Dialog to query a message type
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_folder_type_with_mailbox_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_folder_type_with_mailbox_query_array;
-                    };
-                heading = "Folder type";                
-                };
-            }
-        };
-    }
-RESOURCE ARRAY r_folder_type_with_mailbox_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Inbox"; },
-        LBUF {txt = "Drafts"; },
-        LBUF {txt = "Outbox"; },
-        LBUF {txt = "Sent"; },
-        LBUF {txt = "Mailbox..."; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_app_selection_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_mailbox_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    };
-                heading = "Choose mailbox:";                
-                };
-            }
-        };
-    } 
-        
-// ---------------------------------------------------------
-//   
-//   r_unread_type_query
-//   Dialog to query whether to create the message unread or not
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_unread_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_unread_query_array;
-                    };
-                heading = "Message status";                
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_unread_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Read"; },
-        LBUF {txt = "New"; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_attachment_single_selection_query
-//   r_attachment_multi_selection_query
-//   Dialogs to query attachments
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_attachment_single_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_attachment_query_array;
-                    };
-                heading = "Choose attachment:";                
-                };
-            }
-        };
-    }
-
-RESOURCE DIALOG r_ams_attachment_single_selection_query
-{
-flags = EGeneralQueryFlags;
-buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-items =
-    {
-    AVKON_LIST_QUERY_DLG_LINE
-        {
-        control= AVKON_LIST_QUERY_CONTROL
-            {
-            listtype = EAknCtSinglePopupMenuListBox;
-            listbox = AVKON_LIST_QUERY_LIST
-                {
-                array_id = r_ams_attachment_query_array;
-                };
-            heading = "Choose attachment:";                
-            };
-        }
-    };
-}
-
-
-RESOURCE DIALOG r_attachment_multi_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_MULTISELECTION_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSingleGraphicPopupMenuListBox;
-                listbox = AVKON_MULTISELECTION_LIST_QUERY_LIST
-                    {
-                    array_id = r_attachment_multiselection_query_array;
-                    };
-                heading = "Choose attachments:";                
-                };
-            }
-        };
-    }
-
-
-RESOURCE ARRAY r_attachment_query_array
-    {
-    items =
-        {
-        LBUF {txt = "JPEG 25kB"; },
-        LBUF {txt = "JPEG 300kB"; },
-        LBUF {txt = "JPEG 500kB"; },
-        LBUF {txt = "PNG 15kB"; },
-        LBUF {txt = "GIF 2kB"; },
-        LBUF {txt = "RNG 1kB"; },
-        LBUF {txt = "MIDI 10kB"; },
-        LBUF {txt = "WAVE 20kB"; },
-        LBUF {txt = "AMR 20kB"; },
-        LBUF {txt = "Excel 15kB"; },
-        LBUF {txt = "Word 20kB"; },
-        LBUF {txt = "PowerPoint 40kB"; },
-        LBUF {txt = "Text 10kB"; },
-        LBUF {txt = "Text 70kB"; },
-        LBUF {txt = "3GPP 70kB"; },
-        LBUF {txt = "MP3 250kB"; },
-        LBUF {txt = "AAC 100kB"; },
-        LBUF {txt = "RM 95kB"; }
-        };
-    }
-
-RESOURCE ARRAY r_ams_attachment_query_array
-    {
-    items =
-        {
-        LBUF {txt = "AMR 20kB"; }
-        };
-    }
-
-RESOURCE ARRAY r_attachment_multiselection_query_array
-    {
-    items =
-        {
-        LBUF {txt = "1\tNone"; },
-        LBUF {txt = "1\tJPEG 25kB"; },
-        LBUF {txt = "1\tJPEG 200kB"; },
-        LBUF {txt = "1\tJPEG 500kB"; },
-        LBUF {txt = "1\tPNG 15kB"; },
-        LBUF {txt = "1\tGIF 2kB"; },
-        LBUF {txt = "1\tRNG 1kB"; },
-        LBUF {txt = "1\tMIDI 10kB"; },
-        LBUF {txt = "1\tWAVE 20kB"; },
-        LBUF {txt = "1\tAMR 20kB"; },
-        LBUF {txt = "1\tExcel 15kB"; },
-        LBUF {txt = "1\tWord 20kB"; },
-        LBUF {txt = "1\tPowerPoint 40kB"; },
-        LBUF {txt = "1\tText 10kB"; },
-        LBUF {txt = "1\tText 70kB"; },
-        LBUF {txt = "1\t3GPP 70kB"; },
-        LBUF {txt = "1\tMP3 250kB"; },
-        LBUF {txt = "1\tAAC 100kB"; },
-        LBUF {txt = "1\tRM 95kB"; },        
-        LBUF {txt = "1\tBMP 25kB"; },
-        LBUF {txt = "1\tHTML 20kB"; },
-        LBUF {txt = "1\tJAD 1kB"; },
-        LBUF {txt = "1\tJAR 10kB"; },
-        LBUF {txt = "1\tJP2 65kB"; },
-        LBUF {txt = "1\tMP4 200kB"; },
-        LBUF {txt = "1\tMXMF 40kB"; },
-        LBUF {txt = "1\tRAM 1kB"; },
-        LBUF {txt = "1\tSVG 15kB"; },
-        LBUF {txt = "1\tSWF 15kB"; },
-        LBUF {txt = "1\tTIF 25kB"; },
-        LBUF {txt = "1\tVCF 1kB"; },
-        LBUF {txt = "1\tVCS 1kB"; },
-        LBUF {txt = "1\tSISX 10kB"; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_group_creation_type_query
-//   Dialog to query a group creation type
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_group_creation_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_group_creation_type_query_array;
-                    };
-                heading = "Fields in contact";                
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_group_creation_type_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Random"; },
-        LBUF {txt = "Define..."; }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_directory_query
-//   Dialog to query the directory from the user
-//
-// ---------------------------------------------------------
-//
-
-
-RESOURCE DIALOG r_directory_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = EDataLayout;
-                label = "Specify the directory";
-                control = EDWIN
-                    {
-                    };
-                };
-            }
-        };
-    }
-
-
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_progress_note
-    {
-    flags = EAknProgressNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = EProgressNote;
-            control= AVKON_NOTE 
-                { 
-                layout = EProgressLayout;
-                imagefile = AVKON_ICON_FILE;
-                imageid = EMbmAvkonQgn_note_progress;
-                imagemask = EMbmAvkonQgn_note_progress_mask;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-
-RESOURCE ARRAY r_data_firstnames
-    {
-    items=
-        {
-        LBUF { txt="John"; },
-        LBUF { txt="Francis"; },
-        LBUF { txt="Andrew"; },
-        LBUF { txt="Lawrence"; },
-        LBUF { txt="Gregory"; },
-        LBUF { txt="Fulke"; },
-        LBUF { txt="Thomas"; },
-        LBUF { txt="Nicholas"; },
-        LBUF { txt="Hakle"; },
-        LBUF { txt="Roger"; },
-        LBUF { txt="Nathaniel"; },
-        LBUF { txt="Luke"; },
-        LBUF { txt="William"; },
-        LBUF { txt="Ralph"; },
-        LBUF { txt="Leonar"; },
-        LBUF { txt="Daniel"; },
-        LBUF { txt="Aban"; },
-        LBUF { txt="Mathias"; },
-        LBUF { txt="Robert"; },
-        LBUF { txt="Christopher"; },
-        LBUF { txt="Martin"; },
-        LBUF { txt="Michael"; },
-        LBUF { txt="Barnaby"; },
-        LBUF { txt="Tobias"; },
-        LBUF { txt="Richard"; },
-        LBUF { txt="Anthony"; },
-        LBUF { txt="Simon"; },
-        LBUF { txt="Samuel"; },
-        LBUF { txt="Geoffrey"; },
-        LBUF { txt="Isaac"; },
-        LBUF { txt="Henry"; },
-        LBUF { txt="Matthew"; },
-        LBUF { txt="Peter"; },
-        LBUF { txt="Allen"; },
-        LBUF { txt="Reynold"; },
-        LBUF { txt="Jerome"; },
-        LBUF { txt="Elizabeth"; },
-        LBUF { txt="Catherine"; },
-        LBUF { txt="Frances"; },
-        LBUF { txt="Cecily"; },
-        LBUF { txt="Millicent"; },
-        LBUF { txt="Audrey"; },
-        LBUF { txt="Joan"; },
-        LBUF { txt="Elinor"; },
-        LBUF { txt="Joyce"; },
-        LBUF { txt="Frideswide"; },
-        LBUF { txt="Rose"; },
-        LBUF { txt="Helen"; },
-        LBUF { txt="Margaret"; },
-        LBUF { txt="Isabel"; },
-        LBUF { txt="Bridget"; },
-        LBUF { txt="Grace"; },
-        LBUF { txt="Thomasin"; },
-        LBUF { txt="Janet"; },
-        LBUF { txt="Agnes"; },
-        LBUF { txt="Dorothy"; },
-        LBUF { txt="Christian"; },
-        LBUF { txt="Amy"; },
-        LBUF { txt="Fortune"; },
-        LBUF { txt="Sybil"; },
-        LBUF { txt="Alice"; },
-        LBUF { txt="Margery"; },
-        LBUF { txt="Edith"; },
-        LBUF { txt="Barbara"; },
-        LBUF { txt="Gillian"; },
-        LBUF { txt="Ursula"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_surnames
-    {
-    items=
-        {
-        LBUF { txt="Lux"; },
-        LBUF { txt="Mandot"; },
-        LBUF { txt="Mansfield"; },
-        LBUF { txt="Mayberry"; },
-        LBUF { txt="McCarrel"; },
-        LBUF { txt="McDaniel"; },
-        LBUF { txt="Mefford"; },
-        LBUF { txt="Metcalf"; },
-        LBUF { txt="Metchell"; },
-        LBUF { txt="Moller"; },
-        LBUF { txt="Margan"; },
-        LBUF { txt="Keaney"; },
-        LBUF { txt="Kenyon"; },
-        LBUF { txt="Kesler"; },
-        LBUF { txt="Kinman"; },
-        LBUF { txt="Kreinert"; },
-        LBUF { txt="Kummerlin"; },
-        LBUF { txt="Lamgley"; },
-        LBUF { txt="Leas"; },
-        LBUF { txt="Leighton"; },
-        LBUF { txt="Lillie"; },
-        LBUF { txt="Hilms"; },
-        LBUF { txt="Holt"; },
-        LBUF { txt="Hosier"; },
-        LBUF { txt="Howard"; },
-        LBUF { txt="Hypes"; },
-        LBUF { txt="Jacmor"; },
-        LBUF { txt="Behnson"; },
-        LBUF { txt="Kammer"; },
-        LBUF { txt="Patts"; },
-        LBUF { txt="West"; },
-        LBUF { txt="Wilbar"; },
-        LBUF { txt="Witsan"; },
-        LBUF { txt="Gillams"; },
-        LBUF { txt="Good"; },
-        LBUF { txt="Wreght"; },
-        LBUF { txt="Worthley"; },
-        LBUF { txt="Adams"; },
-        LBUF { txt="Allen"; },
-        LBUF { txt="Ansley"; },
-        LBUF { txt="Ayries"; },
-        LBUF { txt="Bartlett"; },
-        LBUF { txt="Barton"; },
-        LBUF { txt="Payne"; },
-        LBUF { txt="Pintard"; },
-        LBUF { txt="Prence"; },
-        LBUF { txt="Richards"; },
-        LBUF { txt="Dillman"; },
-        LBUF { txt="Dory"; },
-        LBUF { txt="Edgards"; },
-        LBUF { txt="Engell"; },
-        LBUF { txt="Farprington"; },
-        LBUF { txt="Fisher"; },
-        LBUF { txt="Foed"; },
-        LBUF { txt="Burges"; },
-        LBUF { txt="Childwall"; },
-        LBUF { txt="Smith"; },
-        LBUF { txt="Sipon"; },
-        LBUF { txt="Simmons"; },
-        LBUF { txt="Stewert"; },
-        LBUF { txt="Stiles"; },
-        LBUF { txt="Stratton"; },
-        LBUF { txt="Dennis"; },
-        LBUF { txt="Talmot"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_companies
-    {
-    items=
-        {
-        LBUF { txt="CDP"; },
-        LBUF { txt="Exbox"; },
-        LBUF { txt="Munro"; },
-        LBUF { txt="Majaka"; },
-        LBUF { txt="Bitzumi"; },
-        LBUF { txt="Melroy"; },
-        LBUF { txt="Matal"; },
-        LBUF { txt="Japponi"; },
-        LBUF { txt="Siwaka"; },
-        LBUF { txt="Keiku"; },
-        LBUF { txt="Naamate"; },
-        LBUF { txt="Remonti"; },
-        LBUF { txt="Melleva"; },
-        LBUF { txt="WEX"; },
-        LBUF { txt="Chataz"; },
-        LBUF { txt="Ponly"; },
-        LBUF { txt="Alriva"; },
-        LBUF { txt="Giate"; },
-        LBUF { txt="Kesso"; },
-        LBUF { txt="Nyssa"; },
-        LBUF { txt="Peger"; },
-        LBUF { txt="Metrio"; },
-        LBUF { txt="Mitchitatchi"; },
-        LBUF { txt="Neppari"; },
-        LBUF { txt="Amcuila"; },
-        LBUF { txt="Muipitsu"; },
-        LBUF { txt="Redex"; },
-        LBUF { txt="Maariz"; },
-        LBUF { txt="Swerck"; },
-        LBUF { txt="Makiac"; },
-        LBUF { txt="Dumpia"; },
-        LBUF { txt="Worldmom"; },
-        LBUF { txt="Renfaul"; },
-        LBUF { txt="Kmartissori"; },
-        LBUF { txt="Findo"; },
-        LBUF { txt="Samsanc"; },
-        LBUF { txt="Dellervo"; },
-        LBUF { txt="Manrel"; },
-        LBUF { txt="WSMRL"; },
-        LBUF { txt="Eripox"; },
-        LBUF { txt="Abiturien"; },
-        LBUF { txt="Vesus"; },
-        LBUF { txt="MI4"; },
-        LBUF { txt="Overhiba"; },
-        LBUF { txt="Tridune"; },
-        LBUF { txt="Kyomcera"; },
-        LBUF { txt="Praston"; },
-        LBUF { txt="Gapmis"; },
-        LBUF { txt="WPPDCD"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_addresses
-    {
-    items=
-        {
-        LBUF { txt="Barnes Street"; },
-        LBUF { txt="Barnes Place"; },
-        LBUF { txt="Eastman Street"; },
-        LBUF { txt="West Park"; },
-        LBUF { txt="South Park"; },
-        LBUF { txt="Park Avenue"; },
-        LBUF { txt="Richards Court"; },
-        LBUF { txt="Pukershire Avenue"; },
-        LBUF { txt="Ellis Avenue"; },
-        LBUF { txt="East Mountain"; },
-        LBUF { txt="Chestnut Hill"; },
-        LBUF { txt="Plains Road"; },
-        LBUF { txt="Fremont Street"; },
-        LBUF { txt="Heritage Court"; },
-        LBUF { txt="Highland Avenue Extension"; },
-        LBUF { txt="Maple Heights"; },
-        LBUF { txt="McKenzie Avenue"; },
-        LBUF { txt="McKenzie Lane"; },
-        LBUF { txt="West Terrace Street"; },
-        LBUF { txt="Windsor Avenue"; },
-        LBUF { txt="Windsor Road"; },
-        LBUF { txt="Mechanic Street Extension"; },
-        LBUF { txt="Granite Place"; },
-        LBUF { txt="Meadow Street"; },
-        LBUF { txt="Sugar River"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_cities
-    {
-    items=
-        {
-        LBUF { txt="Kuopio"; },       
-        LBUF { txt="Los Angeles"; },        
-        LBUF { txt="Lappeenranta"; },
-        LBUF { txt="London"; },        
-        LBUF { txt="Bangkok"; },
-        LBUF { txt="St. Michel"; },                
-        LBUF { txt="St. Petersburg"; },        
-        LBUF { txt="Tokyo"; },
-        LBUF { txt="Helsinki"; },
-        LBUF { txt="Trondheim"; },        
-        LBUF { txt="Nairobi"; },
-        LBUF { txt="Havana"; }        
-        };
-    }
-
-RESOURCE ARRAY r_data_countries
-    {
-    items=
-        {
-        LBUF { txt="Finland"; },
-        LBUF { txt="Cuba"; },
-        LBUF { txt="United States of America"; },
-        LBUF { txt="Thailand"; },
-        LBUF { txt="Sweden"; },
-        LBUF { txt="Russia"; },
-        LBUF { txt="Japan"; },
-        LBUF { txt="Norway"; },
-        LBUF { txt="Kenya"; }                
-        };
-    }
-
-RESOURCE ARRAY r_data_postcodes
-    {
-    items=
-        {
-        LBUF { txt="00310"; },
-        LBUF { txt="FI-70100"; },
-        LBUF { txt="99002"; },
-        LBUF { txt="11233"; }            
-        };
-    }
-
-RESOURCE ARRAY r_data_states
-    {
-    items=
-        {
-        LBUF { txt="California state"; }, 
-        LBUF { txt="Alaska state"; },
-        LBUF { txt="Florida state"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_poboxes
-    {
-    items=
-        {
-        LBUF { txt="P.O BOX 5532"; },
-        LBUF { txt="P.O BOX 701"; },
-        LBUF { txt="99"; },
-        LBUF { txt="1133"; },
-        LBUF { txt="P.O. BOX 113322"; },
-        LBUF { txt="112"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_prefixes
-    {
-    items=
-        {
-        LBUF { txt="Ms."; },
-        LBUF { txt="Mrs."; }, 
-        LBUF { txt="Mr."; },
-        LBUF { txt="Dr."; }
-        
-        };
-    }
-
-RESOURCE ARRAY r_data_suffixes
-    {
-    items=
-        {
-        LBUF { txt="Jr."; },
-        LBUF { txt="Sr."; }        
-        };
-    }
-
-RESOURCE ARRAY r_data_jobtitles
-    {
-    items=
-        {
-        LBUF { txt="Doctor"; },
-        LBUF { txt="SW Engineer"; },
-        LBUF { txt="Administrative Assistant"; },
-        LBUF { txt="Bookkeeper"; },
-        LBUF { txt="Credit Controller"; },
-        LBUF { txt="Data Entry Operator"; },
-        LBUF { txt="Payroll Officer"; },
-        LBUF { txt="Receptionist"; },
-        LBUF { txt="Trainee"; },
-        LBUF { txt="Accounts Clerk"; },
-        LBUF { txt="Administrator"; },
-        LBUF { txt="Taxation Assistant"; },
-        LBUF { txt="Financial Director"; },
-        LBUF { txt="Bank Manager"; },
-        LBUF { txt="Mobile Lending"; },
-        LBUF { txt="Overseas Transactions"; },
-        LBUF { txt="Restructuring"; },
-        LBUF { txt="Business Analyst"; },
-        LBUF { txt="Call Centre Manager"; },
-        LBUF { txt="Administration"; },
-        LBUF { txt="Manager"; },
-        LBUF { txt="Student"; },
-        LBUF { txt="Mail Sorter"; },
-        LBUF { txt="Mayor"; },
-        LBUF { txt="Account Servicing"; },
-        LBUF { txt="Management"; },
-        LBUF { txt="Media Consultant"; },
-        LBUF { txt="Newsagent"; },
-        LBUF { txt="Librarian"; },
-        LBUF { txt="Creative Director"; },
-        LBUF { txt="Announcer"; },
-        LBUF { txt="Copywriter"; },
-        LBUF { txt="Presenter"; },
-        LBUF { txt="Promotions Manager"; },
-        LBUF { txt="Advertising Sales Representative"; },
-        LBUF { txt="Editor"; },
-        LBUF { txt="Marketing, Sales & Publicity"; },
-        LBUF { txt="Publisher"; },
-        LBUF { txt="Gallery Assistant"; },
-        LBUF { txt="Photographer"; },
-        LBUF { txt="Storyboard Artist"; },
-        LBUF { txt="Events Manager"; },
-        LBUF { txt="Cameraman"; },
-        LBUF { txt="Technician"; },
-        LBUF { txt="Producer"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_phonenumbers
-    {
-    items=
-        {
-        LBUF { txt="0307834387"; },
-        LBUF { txt="0230328732"; },
-        LBUF { txt="0430365562"; },
-        LBUF { txt="0530328732"; },
-        LBUF { txt="0433032865"; },
-        LBUF { txt="0542306532"; },
-        LBUF { txt="0342303777"; },
-        LBUF { txt="0250235603"; },
-        LBUF { txt="0492303652"; },
-        LBUF { txt="0542303286"; },
-        LBUF { txt="0543656546"; },
-        LBUF { txt="0545545454"; },
-        LBUF { txt="0543444454"; },
-        LBUF { txt="0776463255"; },
-        LBUF { txt="0432443343"; },
-        LBUF { txt="0243334344"; },
-        LBUF { txt="0544543443"; },
-        LBUF { txt="0231343243"; },
-        LBUF { txt="0213443434"; },
-        LBUF { txt="0143234476"; },
-        LBUF { txt="0785434444"; },
-        LBUF { txt="0454445345"; },
-        LBUF { txt="0342443433"; },
-        LBUF { txt="0432434454"; },
-        LBUF { txt="0455454454"; },
-        LBUF { txt="0656565655"; },
-        LBUF { txt="0343434443"; },
-        LBUF { txt="0565645455"; },
-        LBUF { txt="0343243243"; },
-        LBUF { txt="0565466565"; },
-        LBUF { txt="0465565655"; },
-        LBUF { txt="0435445454"; },
-        LBUF { txt="+35854553456"; },
-        LBUF { txt="+35878453486"; },
-        LBUF { txt="+35876653456"; },
-        LBUF { txt="+35834435486"; },
-        LBUF { txt="+35876766466"; },
-        LBUF { txt="+4465665456"; },
-        LBUF { txt="+4432434334"; },
-        LBUF { txt="+4488776776"; },
-        LBUF { txt="+4465655656"; },
-        LBUF { txt="+4443433434"; },
-        LBUF { txt="+4465656565"; },
-        LBUF { txt="+4454454354"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_groupnames
-    {
-    items=
-        {
-        LBUF { txt="Nice guys"; },
-        LBUF { txt="Repairs"; },
-        LBUF { txt="Office works"; },
-        LBUF { txt="The buddies"; },
-        LBUF { txt="Football team"; },
-        LBUF { txt="Gold club"; },
-        LBUF { txt="Silver club"; },
-        LBUF { txt="Bronze club"; },
-        LBUF { txt="Best buddies"; },
-        LBUF { txt="Rockers"; },
-        LBUF { txt="Science group"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_meetingreasons
-    {
-    items=
-        {
-        LBUF { txt="Security issues"; },
-        LBUF { txt="Team meeting"; },
-        LBUF { txt="Discussion about"; },
-        LBUF { txt="Work plans"; },
-        LBUF { txt="Meeting with the professor"; },
-        LBUF { txt="Meeting with the boss"; },
-        LBUF { txt="Work issues"; },
-        LBUF { txt="New workers"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_meetingplaces
-    {
-    items=
-        {
-        LBUF { txt="Room"; },
-        LBUF { txt="Home"; },
-        LBUF { txt="Auditorium"; },
-        LBUF { txt="Company"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_landmark_names
-    {
-    items=
-        {
-        LBUF { txt="Good place to fish";},
-        LBUF { txt="Uncle over board";},
-        LBUF { txt="Best food ever!";},
-        LBUF { txt="Nice beach";},
-        LBUF { txt="Good hamburgers";},
-        LBUF { txt="Nice view";},
-        LBUF { txt="John's home";},
-        LBUF { txt="Carage";},
-        LBUF { txt="Gas station";},
-        LBUF { txt="Food store";},
-        LBUF { txt="Car wash";},
-        LBUF { txt="Summer cottage";},
-        LBUF { txt="My home";},
-        LBUF { txt="Bank";},
-        LBUF { txt="Hospital";},
-        LBUF { txt="Ice hall";},
-        LBUF { txt="Work place";}
-        };
-    }
-
-RESOURCE ARRAY r_data_landmark_descriptions
-    {
-    items=
-        {
-        LBUF { txt="The salmons were really big here!";},        
-        LBUF { txt="Delicious strawberries sold here. Must visit again sometime!";},
-        LBUF { txt="Place looks really nice.";},
-        LBUF { txt="This is my favorite place";},
-        LBUF { txt="Words are not enough to describe this landmark";},        
-        LBUF { txt="What a shocking place to visit! Remember to bring camera next time :-)";}
-        };
-    }
-
-RESOURCE ARRAY r_data_memos
-    {
-    items=
-        {
-        LBUF { txt="No work today!"; },
-        LBUF { txt="Movies tonight"; },
-        LBUF { txt="Ship new binaries"; },
-        LBUF { txt="New works"; },
-        LBUF { txt="Exam"; },
-        LBUF { txt="Community service"; },
-        LBUF { txt="Volunteer work"; },
-        LBUF { txt="Don't forget the dinner at the restaurant"; },
-        LBUF { txt="Go the bank"; },
-        LBUF { txt="Go to the store"; },
-        LBUF { txt="Buy goods"; },
-        LBUF { txt="Buy food"; },
-        LBUF { txt="Buy new pair of socks"; },
-        LBUF { txt="Buy vegetables"; },
-        LBUF { txt="Buy fruits"; },
-        LBUF { txt="Umbrella"; },
-        LBUF { txt="New shoes"; },
-        LBUF { txt="New suit"; },
-        LBUF { txt="Buy flowers"; },
-        LBUF { txt="School day"; }
-        };
-    }
-RESOURCE ARRAY r_data_anniversaries
-    {
-    items=
-        {
-        LBUF { txt="birthday"; },
-        LBUF { txt="anniversary"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_todos
-    {
-    items=
-        {
-        LBUF { txt="Watch for gum on my shoe"; },
-        LBUF { txt="Watch my step in the hall"; },
-        LBUF { txt="Always think big"; },
-        LBUF { txt="Don't ever think small"; },
-        LBUF { txt="Keep pedaling my bike"; },
-        LBUF { txt="Watch for bees in my pop"; },
-        LBUF { txt="Keep moving forward"; },
-        LBUF { txt="Don't ever stop"; },
-        LBUF { txt="Keep my sled underneath me"; },
-        LBUF { txt="Keep my stick on the ice"; },
-        LBUF { txt="Don't swim in a whirlpool"; },
-        LBUF { txt="Don't look for a fight"; },
-        LBUF { txt="Don't spit in the wind"; },
-        LBUF { txt="Just do what is right"; },
-        LBUF { txt="Go out in the world"; },
-        LBUF { txt="Enjoy a warm rain"; },
-        LBUF { txt="Don't worship TV"; },
-        LBUF { txt="Keep my oars in the water"; },
-        LBUF { txt="Point my boat right downstream"; },
-        LBUF { txt="Face head on my problems"; },
-        LBUF { txt="Change underwear daily"; },
-        LBUF { txt="Believe myself first"; },
-        LBUF { txt="Go out and have fun"; },
-        LBUF { txt="Turn the cards one by one"; },
-        LBUF { txt="Get out and do something"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_reminders
-    {
-    items=
-        {
-        LBUF { txt="Remeber to fix car"; },
-        LBUF { txt="Remeber to eat vegetables"; },
-        LBUF { txt="Remeber to go shopping"; },
-        LBUF { txt="Remeber to buy boxes for moving"; },
-        LBUF { txt="Remeber to fix bike"; },
-        LBUF { txt="Remeber to buy christmast presents"; },
-        LBUF { txt="Remeber to send flowers to grandmother"; },
-        LBUF { txt="Remeber to talk with son"; },
-        LBUF { txt="Remeber to cut hedge"; },
-        LBUF { txt="Remeber to bumper potatoes"; },
-        LBUF { txt="Remeber to harvest corn field"; },
-        LBUF { txt="Remeber to sleep enaugh"; },
-        LBUF { txt="Remeber to wash teeths ewery morning"; },
-        LBUF { txt="Remeber to get sleep early"; },
-        LBUF { txt="Remeber to give some wather to flowers"; },
-        LBUF { txt="Remeber to wax snowboard"; },
-        LBUF { txt="Remeber to wax skiis"; },
-        LBUF { txt="Remeber to wax cross country skiis"; },
-        LBUF { txt="Remeber to call mother"; },
-        LBUF { txt="Remeber to call father"; },
-        LBUF { txt="Remeber to call brother"; },
-        LBUF { txt="Remeber to call sister"; },
-        LBUF { txt="Remeber to call daughter"; },
-        LBUF { txt="Remeber to call son"; },
-        LBUF { txt="Remeber to rent villa"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_messagesubjects
-    {
-    items=
-        {
-        LBUF { txt="Whaaasssaaap!!??"; },
-        LBUF { txt="Hello"; },
-        LBUF { txt="How are you doing?"; },
-        LBUF { txt="You will win the battle, GUARANTEED!"; },
-        LBUF { txt="Why pay more for something if you don't have to?"; },
-        LBUF { txt="You can afford health care now"; },
-        LBUF { txt="Re: *Buddy* *Lists*!!~ (it's soooo cool)!!~"; },
-        LBUF { txt="Weedmon say: call, we be open 7 days, mon"; },
-        LBUF { txt="Want her to look better?"; },
-        LBUF { txt="Good Morning andyw, how are you?"; },
-        LBUF { txt="Happy Assumption"; },
-        LBUF { txt="There is NO Risk involved"; },
-        LBUF { txt="Free Bottle Offer!"; },
-        LBUF { txt="Introduction on MDSL"; },
-        LBUF { txt="Theres Help out there for you"; },
-        LBUF { txt="hello there - check this out"; },
-        LBUF { txt="Darling"; },
-        LBUF { txt="It doesn't have to be that way"; },
-        LBUF { txt="Webmaster, Free health insurance quotes!"; },
-        LBUF { txt="Join us at the OSGi 2003 World Congress"; },
-        LBUF { txt="Put your subject line here"; },
-        LBUF { txt="You are not protected"; },
-        LBUF { txt="Please try again"; },
-        LBUF { txt="you didn't reply my email ? why ? ???"; },
-        LBUF { txt="A very funny game"; },
-        LBUF { txt="Meeting notice"; },
-        LBUF { txt="Opportunities"; }
-        };
-    }
-
-RESOURCE ARRAY r_data_messagetexts
-    {
-    items=
-        {
-        LBUF { txt="The contents of these pages are copyrighted. Any rights not expressly granted herein are reserved. The use of this site is permitted to private use."; },
-        LBUF { txt="Reproduction, transfer, distribution or storage of part or all of the contents in any form without the prior written permission is prohibited."; },
-        LBUF { txt="We consents to you browsing the pages on your computer or printing copies of extracts from these pages for your personal use only."; },
-        LBUF { txt="If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information."; },
-        LBUF { txt="The use of press releases and other documents classified as public is permitted in public communications if the source for the information has been stated."; },
-        LBUF { txt="For your easy accessibility we may include links to sites on the Internet that are owned or operated by third parties."; },
-        LBUF { txt="You also agree that we have no control over the content of that site and cannot assume any responsibility for material by such third-party sites."; },
-        LBUF { txt="In addition, a link to a such site does not imply that we endorses the site or the products or services referenced in such third party site."; },
-        LBUF { txt="In order to respond to your questions or manage interactive customer programs, it may be necessary to ask for personal information."; },
-        LBUF { txt="We may use this information to respond to your requests, or to contact you via mail, e-mail or phone to inform you of new products."; },
-        LBUF { txt="If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information."; }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   
-//    New framework:
-//    Secure platform and scalable UI changes 
-//
-// ---------------------------------------------------------
-//
-RESOURCE LOCALISABLE_APP_INFO r_creator_localisable_app_info
-    {
-    short_caption = "Creator";
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = "Creator";
-
-        number_of_icons = 1;
-
-        // Note for ROM-based apps it is recommended to add the drive letter
-        // icon_file = "z:"APP_BITMAP_DIR"\\myapp_aif.mif";
-        icon_file = APP_BITMAP_DIR"\\creator_aif.mif";
-        };
-    }
-
-RESOURCE DIALOG r_yes_no_dialog
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout = EConfirmationQueryLayout;
-                animation = R_QGN_NOTE_QUERY_ANIM;
-                };
-            }
-        };
-    }
-    
-RESOURCE DIALOG r_encryption_dialog
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtListQueryControl;
-            id = EListQueryControl;
-            control = AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = LISTBOX
-                    {
-                    flags = EAknListBoxSelectionList;
-                    height = 3;
-                    width = 3;
-                    };
-                heading = "Encryption";
-                };
-            }
-        };
-    }
--- a/creator/data/creator_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <creator.rsg>
-#include <appinfo.rh>
-#include <data_caging_paths_strings.hrh>
-
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x20011383
-
-
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "Creator";
-    localisable_resource_file = APP_RESOURCE_DIR"\\Creator";
-    localisable_resource_id = R_CREATOR_LOCALISABLE_APP_INFO;
-    group_name = "RnD Tools";
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/data/datacreator.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,682 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+NAME ORBT
+
+#include <appinfo.rh>
+#include <eikon.rh>
+#include <eikon.rsg>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE ARRAY r_data_firstnames
+    {
+    items=
+        {
+        LBUF { txt="John"; },
+        LBUF { txt="Francis"; },
+        LBUF { txt="Andrew"; },
+        LBUF { txt="Lawrence"; },
+        LBUF { txt="Gregory"; },
+        LBUF { txt="Fulke"; },
+        LBUF { txt="Thomas"; },
+        LBUF { txt="Nicholas"; },
+        LBUF { txt="Hakle"; },
+        LBUF { txt="Roger"; },
+        LBUF { txt="Nathaniel"; },
+        LBUF { txt="Luke"; },
+        LBUF { txt="William"; },
+        LBUF { txt="Ralph"; },
+        LBUF { txt="Leonar"; },
+        LBUF { txt="Daniel"; },
+        LBUF { txt="Aban"; },
+        LBUF { txt="Mathias"; },
+        LBUF { txt="Robert"; },
+        LBUF { txt="Christopher"; },
+        LBUF { txt="Martin"; },
+        LBUF { txt="Michael"; },
+        LBUF { txt="Barnaby"; },
+        LBUF { txt="Tobias"; },
+        LBUF { txt="Richard"; },
+        LBUF { txt="Anthony"; },
+        LBUF { txt="Simon"; },
+        LBUF { txt="Samuel"; },
+        LBUF { txt="Geoffrey"; },
+        LBUF { txt="Isaac"; },
+        LBUF { txt="Henry"; },
+        LBUF { txt="Matthew"; },
+        LBUF { txt="Peter"; },
+        LBUF { txt="Allen"; },
+        LBUF { txt="Reynold"; },
+        LBUF { txt="Jerome"; },
+        LBUF { txt="Elizabeth"; },
+        LBUF { txt="Catherine"; },
+        LBUF { txt="Frances"; },
+        LBUF { txt="Cecily"; },
+        LBUF { txt="Millicent"; },
+        LBUF { txt="Audrey"; },
+        LBUF { txt="Joan"; },
+        LBUF { txt="Elinor"; },
+        LBUF { txt="Joyce"; },
+        LBUF { txt="Frideswide"; },
+        LBUF { txt="Rose"; },
+        LBUF { txt="Helen"; },
+        LBUF { txt="Margaret"; },
+        LBUF { txt="Isabel"; },
+        LBUF { txt="Bridget"; },
+        LBUF { txt="Grace"; },
+        LBUF { txt="Thomasin"; },
+        LBUF { txt="Janet"; },
+        LBUF { txt="Agnes"; },
+        LBUF { txt="Dorothy"; },
+        LBUF { txt="Christian"; },
+        LBUF { txt="Amy"; },
+        LBUF { txt="Fortune"; },
+        LBUF { txt="Sybil"; },
+        LBUF { txt="Alice"; },
+        LBUF { txt="Margery"; },
+        LBUF { txt="Edith"; },
+        LBUF { txt="Barbara"; },
+        LBUF { txt="Gillian"; },
+        LBUF { txt="Ursula"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_surnames
+    {
+    items=
+        {
+        LBUF { txt="Lux"; },
+        LBUF { txt="Mandot"; },
+        LBUF { txt="Mansfield"; },
+        LBUF { txt="Mayberry"; },
+        LBUF { txt="McCarrel"; },
+        LBUF { txt="McDaniel"; },
+        LBUF { txt="Mefford"; },
+        LBUF { txt="Metcalf"; },
+        LBUF { txt="Metchell"; },
+        LBUF { txt="Moller"; },
+        LBUF { txt="Margan"; },
+        LBUF { txt="Keaney"; },
+        LBUF { txt="Kenyon"; },
+        LBUF { txt="Kesler"; },
+        LBUF { txt="Kinman"; },
+        LBUF { txt="Kreinert"; },
+        LBUF { txt="Kummerlin"; },
+        LBUF { txt="Lamgley"; },
+        LBUF { txt="Leas"; },
+        LBUF { txt="Leighton"; },
+        LBUF { txt="Lillie"; },
+        LBUF { txt="Hilms"; },
+        LBUF { txt="Holt"; },
+        LBUF { txt="Hosier"; },
+        LBUF { txt="Howard"; },
+        LBUF { txt="Hypes"; },
+        LBUF { txt="Jacmor"; },
+        LBUF { txt="Behnson"; },
+        LBUF { txt="Kammer"; },
+        LBUF { txt="Patts"; },
+        LBUF { txt="West"; },
+        LBUF { txt="Wilbar"; },
+        LBUF { txt="Witsan"; },
+        LBUF { txt="Gillams"; },
+        LBUF { txt="Good"; },
+        LBUF { txt="Wreght"; },
+        LBUF { txt="Worthley"; },
+        LBUF { txt="Adams"; },
+        LBUF { txt="Allen"; },
+        LBUF { txt="Ansley"; },
+        LBUF { txt="Ayries"; },
+        LBUF { txt="Bartlett"; },
+        LBUF { txt="Barton"; },
+        LBUF { txt="Payne"; },
+        LBUF { txt="Pintard"; },
+        LBUF { txt="Prence"; },
+        LBUF { txt="Richards"; },
+        LBUF { txt="Dillman"; },
+        LBUF { txt="Dory"; },
+        LBUF { txt="Edgards"; },
+        LBUF { txt="Engell"; },
+        LBUF { txt="Farprington"; },
+        LBUF { txt="Fisher"; },
+        LBUF { txt="Foed"; },
+        LBUF { txt="Burges"; },
+        LBUF { txt="Childwall"; },
+        LBUF { txt="Smith"; },
+        LBUF { txt="Sipon"; },
+        LBUF { txt="Simmons"; },
+        LBUF { txt="Stewert"; },
+        LBUF { txt="Stiles"; },
+        LBUF { txt="Stratton"; },
+        LBUF { txt="Dennis"; },
+        LBUF { txt="Talmot"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_companies
+    {
+    items=
+        {
+        LBUF { txt="CDP"; },
+        LBUF { txt="Exbox"; },
+        LBUF { txt="Munro"; },
+        LBUF { txt="Majaka"; },
+        LBUF { txt="Bitzumi"; },
+        LBUF { txt="Melroy"; },
+        LBUF { txt="Matal"; },
+        LBUF { txt="Japponi"; },
+        LBUF { txt="Siwaka"; },
+        LBUF { txt="Keiku"; },
+        LBUF { txt="Naamate"; },
+        LBUF { txt="Remonti"; },
+        LBUF { txt="Melleva"; },
+        LBUF { txt="WEX"; },
+        LBUF { txt="Chataz"; },
+        LBUF { txt="Ponly"; },
+        LBUF { txt="Alriva"; },
+        LBUF { txt="Giate"; },
+        LBUF { txt="Kesso"; },
+        LBUF { txt="Nyssa"; },
+        LBUF { txt="Peger"; },
+        LBUF { txt="Metrio"; },
+        LBUF { txt="Mitchitatchi"; },
+        LBUF { txt="Neppari"; },
+        LBUF { txt="Amcuila"; },
+        LBUF { txt="Muipitsu"; },
+        LBUF { txt="Redex"; },
+        LBUF { txt="Maariz"; },
+        LBUF { txt="Swerck"; },
+        LBUF { txt="Makiac"; },
+        LBUF { txt="Dumpia"; },
+        LBUF { txt="Worldmom"; },
+        LBUF { txt="Renfaul"; },
+        LBUF { txt="Kmartissori"; },
+        LBUF { txt="Findo"; },
+        LBUF { txt="Samsanc"; },
+        LBUF { txt="Dellervo"; },
+        LBUF { txt="Manrel"; },
+        LBUF { txt="WSMRL"; },
+        LBUF { txt="Eripox"; },
+        LBUF { txt="Abiturien"; },
+        LBUF { txt="Vesus"; },
+        LBUF { txt="MI4"; },
+        LBUF { txt="Overhiba"; },
+        LBUF { txt="Tridune"; },
+        LBUF { txt="Kyomcera"; },
+        LBUF { txt="Praston"; },
+        LBUF { txt="Gapmis"; },
+        LBUF { txt="WPPDCD"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_addresses
+    {
+    items=
+        {
+        LBUF { txt="Barnes Street"; },
+        LBUF { txt="Barnes Place"; },
+        LBUF { txt="Eastman Street"; },
+        LBUF { txt="West Park"; },
+        LBUF { txt="South Park"; },
+        LBUF { txt="Park Avenue"; },
+        LBUF { txt="Richards Court"; },
+        LBUF { txt="Pukershire Avenue"; },
+        LBUF { txt="Ellis Avenue"; },
+        LBUF { txt="East Mountain"; },
+        LBUF { txt="Chestnut Hill"; },
+        LBUF { txt="Plains Road"; },
+        LBUF { txt="Fremont Street"; },
+        LBUF { txt="Heritage Court"; },
+        LBUF { txt="Highland Avenue Extension"; },
+        LBUF { txt="Maple Heights"; },
+        LBUF { txt="McKenzie Avenue"; },
+        LBUF { txt="McKenzie Lane"; },
+        LBUF { txt="West Terrace Street"; },
+        LBUF { txt="Windsor Avenue"; },
+        LBUF { txt="Windsor Road"; },
+        LBUF { txt="Mechanic Street Extension"; },
+        LBUF { txt="Granite Place"; },
+        LBUF { txt="Meadow Street"; },
+        LBUF { txt="Sugar River"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_cities
+    {
+    items=
+        {
+        LBUF { txt="Kuopio"; },       
+        LBUF { txt="Los Angeles"; },        
+        LBUF { txt="Lappeenranta"; },
+        LBUF { txt="London"; },        
+        LBUF { txt="Bangkok"; },
+        LBUF { txt="St. Michel"; },                
+        LBUF { txt="St. Petersburg"; },        
+        LBUF { txt="Tokyo"; },
+        LBUF { txt="Helsinki"; },
+        LBUF { txt="Trondheim"; },        
+        LBUF { txt="Nairobi"; },
+        LBUF { txt="Havana"; }        
+        };
+    }
+
+RESOURCE ARRAY r_data_countries
+    {
+    items=
+        {
+        LBUF { txt="Finland"; },
+        LBUF { txt="Cuba"; },
+        LBUF { txt="United States of America"; },
+        LBUF { txt="Thailand"; },
+        LBUF { txt="Sweden"; },
+        LBUF { txt="Russia"; },
+        LBUF { txt="Japan"; },
+        LBUF { txt="Norway"; },
+        LBUF { txt="Kenya"; }                
+        };
+    }
+
+RESOURCE ARRAY r_data_postcodes
+    {
+    items=
+        {
+        LBUF { txt="00310"; },
+        LBUF { txt="FI-70100"; },
+        LBUF { txt="99002"; },
+        LBUF { txt="11233"; }            
+        };
+    }
+
+RESOURCE ARRAY r_data_states
+    {
+    items=
+        {
+        LBUF { txt="California state"; }, 
+        LBUF { txt="Alaska state"; },
+        LBUF { txt="Florida state"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_poboxes
+    {
+    items=
+        {
+        LBUF { txt="P.O BOX 5532"; },
+        LBUF { txt="P.O BOX 701"; },
+        LBUF { txt="99"; },
+        LBUF { txt="1133"; },
+        LBUF { txt="P.O. BOX 113322"; },
+        LBUF { txt="112"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_prefixes
+    {
+    items=
+        {
+        LBUF { txt="Ms."; },
+        LBUF { txt="Mrs."; }, 
+        LBUF { txt="Mr."; },
+        LBUF { txt="Dr."; }
+        
+        };
+    }
+
+RESOURCE ARRAY r_data_suffixes
+    {
+    items=
+        {
+        LBUF { txt="Jr."; },
+        LBUF { txt="Sr."; }        
+        };
+    }
+
+RESOURCE ARRAY r_data_jobtitles
+    {
+    items=
+        {
+        LBUF { txt="Doctor"; },
+        LBUF { txt="SW Engineer"; },
+        LBUF { txt="Administrative Assistant"; },
+        LBUF { txt="Bookkeeper"; },
+        LBUF { txt="Credit Controller"; },
+        LBUF { txt="Data Entry Operator"; },
+        LBUF { txt="Payroll Officer"; },
+        LBUF { txt="Receptionist"; },
+        LBUF { txt="Trainee"; },
+        LBUF { txt="Accounts Clerk"; },
+        LBUF { txt="Administrator"; },
+        LBUF { txt="Taxation Assistant"; },
+        LBUF { txt="Financial Director"; },
+        LBUF { txt="Bank Manager"; },
+        LBUF { txt="Mobile Lending"; },
+        LBUF { txt="Overseas Transactions"; },
+        LBUF { txt="Restructuring"; },
+        LBUF { txt="Business Analyst"; },
+        LBUF { txt="Call Centre Manager"; },
+        LBUF { txt="Administration"; },
+        LBUF { txt="Manager"; },
+        LBUF { txt="Student"; },
+        LBUF { txt="Mail Sorter"; },
+        LBUF { txt="Mayor"; },
+        LBUF { txt="Account Servicing"; },
+        LBUF { txt="Management"; },
+        LBUF { txt="Media Consultant"; },
+        LBUF { txt="Newsagent"; },
+        LBUF { txt="Librarian"; },
+        LBUF { txt="Creative Director"; },
+        LBUF { txt="Announcer"; },
+        LBUF { txt="Copywriter"; },
+        LBUF { txt="Presenter"; },
+        LBUF { txt="Promotions Manager"; },
+        LBUF { txt="Advertising Sales Representative"; },
+        LBUF { txt="Editor"; },
+        LBUF { txt="Marketing, Sales & Publicity"; },
+        LBUF { txt="Publisher"; },
+        LBUF { txt="Gallery Assistant"; },
+        LBUF { txt="Photographer"; },
+        LBUF { txt="Storyboard Artist"; },
+        LBUF { txt="Events Manager"; },
+        LBUF { txt="Cameraman"; },
+        LBUF { txt="Technician"; },
+        LBUF { txt="Producer"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_phonenumbers
+    {
+    items=
+        {
+        LBUF { txt="0307834387"; },
+        LBUF { txt="0230328732"; },
+        LBUF { txt="0430365562"; },
+        LBUF { txt="0530328732"; },
+        LBUF { txt="0433032865"; },
+        LBUF { txt="0542306532"; },
+        LBUF { txt="0342303777"; },
+        LBUF { txt="0250235603"; },
+        LBUF { txt="0492303652"; },
+        LBUF { txt="0542303286"; },
+        LBUF { txt="0543656546"; },
+        LBUF { txt="0545545454"; },
+        LBUF { txt="0543444454"; },
+        LBUF { txt="0776463255"; },
+        LBUF { txt="0432443343"; },
+        LBUF { txt="0243334344"; },
+        LBUF { txt="0544543443"; },
+        LBUF { txt="0231343243"; },
+        LBUF { txt="0213443434"; },
+        LBUF { txt="0143234476"; },
+        LBUF { txt="0785434444"; },
+        LBUF { txt="0454445345"; },
+        LBUF { txt="0342443433"; },
+        LBUF { txt="0432434454"; },
+        LBUF { txt="0455454454"; },
+        LBUF { txt="0656565655"; },
+        LBUF { txt="0343434443"; },
+        LBUF { txt="0565645455"; },
+        LBUF { txt="0343243243"; },
+        LBUF { txt="0565466565"; },
+        LBUF { txt="0465565655"; },
+        LBUF { txt="0435445454"; },
+        LBUF { txt="+35854553456"; },
+        LBUF { txt="+35878453486"; },
+        LBUF { txt="+35876653456"; },
+        LBUF { txt="+35834435486"; },
+        LBUF { txt="+35876766466"; },
+        LBUF { txt="+4465665456"; },
+        LBUF { txt="+4432434334"; },
+        LBUF { txt="+4488776776"; },
+        LBUF { txt="+4465655656"; },
+        LBUF { txt="+4443433434"; },
+        LBUF { txt="+4465656565"; },
+        LBUF { txt="+4454454354"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_groupnames
+    {
+    items=
+        {
+        LBUF { txt="Nice guys"; },
+        LBUF { txt="Repairs"; },
+        LBUF { txt="Office works"; },
+        LBUF { txt="The buddies"; },
+        LBUF { txt="Football team"; },
+        LBUF { txt="Gold club"; },
+        LBUF { txt="Silver club"; },
+        LBUF { txt="Bronze club"; },
+        LBUF { txt="Best buddies"; },
+        LBUF { txt="Rockers"; },
+        LBUF { txt="Science group"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_meetingreasons
+    {
+    items=
+        {
+        LBUF { txt="Security issues"; },
+        LBUF { txt="Team meeting"; },
+        LBUF { txt="Discussion about"; },
+        LBUF { txt="Work plans"; },
+        LBUF { txt="Meeting with the professor"; },
+        LBUF { txt="Meeting with the boss"; },
+        LBUF { txt="Work issues"; },
+        LBUF { txt="New workers"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_meetingplaces
+    {
+    items=
+        {
+        LBUF { txt="Room"; },
+        LBUF { txt="Home"; },
+        LBUF { txt="Auditorium"; },
+        LBUF { txt="Company"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_landmark_names
+    {
+    items=
+        {
+        LBUF { txt="Good place to fish";},
+        LBUF { txt="Uncle over board";},
+        LBUF { txt="Best food ever!";},
+        LBUF { txt="Nice beach";},
+        LBUF { txt="Good hamburgers";},
+        LBUF { txt="Nice view";},
+        LBUF { txt="John's home";},
+        LBUF { txt="Carage";},
+        LBUF { txt="Gas station";},
+        LBUF { txt="Food store";},
+        LBUF { txt="Car wash";},
+        LBUF { txt="Summer cottage";},
+        LBUF { txt="My home";},
+        LBUF { txt="Bank";},
+        LBUF { txt="Hospital";},
+        LBUF { txt="Ice hall";},
+        LBUF { txt="Work place";}
+        };
+    }
+
+RESOURCE ARRAY r_data_landmark_descriptions
+    {
+    items=
+        {
+        LBUF { txt="The salmons were really big here!";},        
+        LBUF { txt="Delicious strawberries sold here. Must visit again sometime!";},
+        LBUF { txt="Place looks really nice.";},
+        LBUF { txt="This is my favorite place";},
+        LBUF { txt="Words are not enough to describe this landmark";},        
+        LBUF { txt="What a shocking place to visit! Remember to bring camera next time :-)";}
+        };
+    }
+
+RESOURCE ARRAY r_data_memos
+    {
+    items=
+        {
+        LBUF { txt="No work today!"; },
+        LBUF { txt="Movies tonight"; },
+        LBUF { txt="Ship new binaries"; },
+        LBUF { txt="New works"; },
+        LBUF { txt="Exam"; },
+        LBUF { txt="Community service"; },
+        LBUF { txt="Volunteer work"; },
+        LBUF { txt="Don't forget the dinner at the restaurant"; },
+        LBUF { txt="Go the bank"; },
+        LBUF { txt="Go to the store"; },
+        LBUF { txt="Buy goods"; },
+        LBUF { txt="Buy food"; },
+        LBUF { txt="Buy new pair of socks"; },
+        LBUF { txt="Buy vegetables"; },
+        LBUF { txt="Buy fruits"; },
+        LBUF { txt="Umbrella"; },
+        LBUF { txt="New shoes"; },
+        LBUF { txt="New suit"; },
+        LBUF { txt="Buy flowers"; },
+        LBUF { txt="School day"; }
+        };
+    }
+RESOURCE ARRAY r_data_anniversaries
+    {
+    items=
+        {
+        LBUF { txt="birthday"; },
+        LBUF { txt="anniversary"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_todos
+    {
+    items=
+        {
+        LBUF { txt="Watch for gum on my shoe"; },
+        LBUF { txt="Watch my step in the hall"; },
+        LBUF { txt="Always think big"; },
+        LBUF { txt="Don't ever think small"; },
+        LBUF { txt="Keep pedaling my bike"; },
+        LBUF { txt="Watch for bees in my pop"; },
+        LBUF { txt="Keep moving forward"; },
+        LBUF { txt="Don't ever stop"; },
+        LBUF { txt="Keep my sled underneath me"; },
+        LBUF { txt="Keep my stick on the ice"; },
+        LBUF { txt="Don't swim in a whirlpool"; },
+        LBUF { txt="Don't look for a fight"; },
+        LBUF { txt="Don't spit in the wind"; },
+        LBUF { txt="Just do what is right"; },
+        LBUF { txt="Go out in the world"; },
+        LBUF { txt="Enjoy a warm rain"; },
+        LBUF { txt="Don't worship TV"; },
+        LBUF { txt="Keep my oars in the water"; },
+        LBUF { txt="Point my boat right downstream"; },
+        LBUF { txt="Face head on my problems"; },
+        LBUF { txt="Change underwear daily"; },
+        LBUF { txt="Believe myself first"; },
+        LBUF { txt="Go out and have fun"; },
+        LBUF { txt="Turn the cards one by one"; },
+        LBUF { txt="Get out and do something"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_reminders
+    {
+    items=
+        {
+        LBUF { txt="Remeber to fix car"; },
+        LBUF { txt="Remeber to eat vegetables"; },
+        LBUF { txt="Remeber to go shopping"; },
+        LBUF { txt="Remeber to buy boxes for moving"; },
+        LBUF { txt="Remeber to fix bike"; },
+        LBUF { txt="Remeber to buy christmast presents"; },
+        LBUF { txt="Remeber to send flowers to grandmother"; },
+        LBUF { txt="Remeber to talk with son"; },
+        LBUF { txt="Remeber to cut hedge"; },
+        LBUF { txt="Remeber to bumper potatoes"; },
+        LBUF { txt="Remeber to harvest corn field"; },
+        LBUF { txt="Remeber to sleep enaugh"; },
+        LBUF { txt="Remeber to wash teeths ewery morning"; },
+        LBUF { txt="Remeber to get sleep early"; },
+        LBUF { txt="Remeber to give some wather to flowers"; },
+        LBUF { txt="Remeber to wax snowboard"; },
+        LBUF { txt="Remeber to wax skiis"; },
+        LBUF { txt="Remeber to wax cross country skiis"; },
+        LBUF { txt="Remeber to call mother"; },
+        LBUF { txt="Remeber to call father"; },
+        LBUF { txt="Remeber to call brother"; },
+        LBUF { txt="Remeber to call sister"; },
+        LBUF { txt="Remeber to call daughter"; },
+        LBUF { txt="Remeber to call son"; },
+        LBUF { txt="Remeber to rent villa"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_messagesubjects
+    {
+    items=
+        {
+        LBUF { txt="Whaaasssaaap!!??"; },
+        LBUF { txt="Hello"; },
+        LBUF { txt="How are you doing?"; },
+        LBUF { txt="You will win the battle, GUARANTEED!"; },
+        LBUF { txt="Why pay more for something if you don't have to?"; },
+        LBUF { txt="You can afford health care now"; },
+        LBUF { txt="Re: *Buddy* *Lists*!!~ (it's soooo cool)!!~"; },
+        LBUF { txt="Weedmon say: call, we be open 7 days, mon"; },
+        LBUF { txt="Want her to look better?"; },
+        LBUF { txt="Good Morning andyw, how are you?"; },
+        LBUF { txt="Happy Assumption"; },
+        LBUF { txt="There is NO Risk involved"; },
+        LBUF { txt="Free Bottle Offer!"; },
+        LBUF { txt="Introduction on MDSL"; },
+        LBUF { txt="Theres Help out there for you"; },
+        LBUF { txt="hello there - check this out"; },
+        LBUF { txt="Darling"; },
+        LBUF { txt="It doesn't have to be that way"; },
+        LBUF { txt="Webmaster, Free health insurance quotes!"; },
+        LBUF { txt="Join us at the OSGi 2003 World Congress"; },
+        LBUF { txt="Put your subject line here"; },
+        LBUF { txt="You are not protected"; },
+        LBUF { txt="Please try again"; },
+        LBUF { txt="you didn't reply my email ? why ? ???"; },
+        LBUF { txt="A very funny game"; },
+        LBUF { txt="Meeting notice"; },
+        LBUF { txt="Opportunities"; }
+        };
+    }
+
+RESOURCE ARRAY r_data_messagetexts
+    {
+    items=
+        {
+        LBUF { txt="The contents of these pages are copyrighted. Any rights not expressly granted herein are reserved. The use of this site is permitted to private use."; },
+        LBUF { txt="Reproduction, transfer, distribution or storage of part or all of the contents in any form without the prior written permission is prohibited."; },
+        LBUF { txt="We consents to you browsing the pages on your computer or printing copies of extracts from these pages for your personal use only."; },
+        LBUF { txt="If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information."; },
+        LBUF { txt="The use of press releases and other documents classified as public is permitted in public communications if the source for the information has been stated."; },
+        LBUF { txt="For your easy accessibility we may include links to sites on the Internet that are owned or operated by third parties."; },
+        LBUF { txt="You also agree that we have no control over the content of that site and cannot assume any responsibility for material by such third-party sites."; },
+        LBUF { txt="In addition, a link to a such site does not imply that we endorses the site or the products or services referenced in such third party site."; },
+        LBUF { txt="In order to respond to your questions or manage interactive customer programs, it may be necessary to ask for personal information."; },
+        LBUF { txt="We may use this information to respond to your requests, or to contact you via mail, e-mail or phone to inform you of new products."; },
+        LBUF { txt="If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information."; }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CREATOR_HRH__
+#define __CREATOR_HRH__
+
+
+enum TCreatorIds
+    {
+    ECmdCreateFromFile=1,
+
+    ECmdCreateCalendarEntries,
+    ECmdCreateCalendarEntryAppointments,
+    ECmdCreateCalendarEntryEvents,
+    ECmdCreateCalendarEntryAnniversaries,
+    ECmdCreateCalendarEntryToDos,
+    ECmdCreateCalendarEntryReminders,
+
+    ECmdCreateBrowserEntries,
+    ECmdCreateBrowserBookmarkEntries,
+    ECmdCreateBrowserBookmarkFolderEntries,
+    ECmdCreateBrowserSavedPageEntries,
+    ECmdCreateBrowserSavedPageFolderEntries,
+
+    ECmdCreateFileEntries,
+    ECmdCreateFileEntryEmptyFolder,
+
+    ECmdCreateFileEntry3GPP_70kB,
+    ECmdCreateFileEntryAAC_100kB,
+    ECmdCreateFileEntryAMR_20kB,
+    ECmdCreateFileEntryBMP_25kB,
+    ECmdCreateFileEntryDeck_1kB,
+    ECmdCreateFileEntryDOC_20kB,
+    ECmdCreateFileEntryGIF_2kB,
+    ECmdCreateFileEntryHTML_20kB,
+    ECmdCreateFileEntryJAD_1kB,
+    ECmdCreateFileEntryJAR_10kB,
+    ECmdCreateFileEntryJP2_65kB,
+    ECmdCreateFileEntryJPEG_200kB,
+    ECmdCreateFileEntryJPEG_25kB,
+    ECmdCreateFileEntryJPEG_500kB,
+    ECmdCreateFileEntryMIDI_10kB,
+    ECmdCreateFileEntryMP3_250kB,
+    ECmdCreateFileEntryMP4_200kB,
+    ECmdCreateFileEntryMXMF_40kB,
+    ECmdCreateFileEntryPNG_15kB,
+    ECmdCreateFileEntryPPT_40kB,
+    ECmdCreateFileEntryRAM_1kB,
+    ECmdCreateFileEntryRM_95kB,
+    ECmdCreateFileEntryRNG_1kB,
+    ECmdCreateFileEntrySVG_15kB,
+    ECmdCreateFileEntrySWF_15kB,
+    ECmdCreateFileEntryTIF_25kB,
+    ECmdCreateFileEntryTXT_10kB,
+    ECmdCreateFileEntryTXT_70kB,
+    ECmdCreateFileEntryVCF_1kB,
+    ECmdCreateFileEntryVCS_1kB,
+    ECmdCreateFileEntryWAV_20kB,
+    ECmdCreateFileEntryXLS_15kB,
+    ECmdCreateFileEntrySISX_10kB,
+    ECmdCreateFileEntryWMA_50kB,
+    ECmdCreateFileEntryWMV_200kB,
+
+    ECmdCreateLogEntries,
+    ECmdCreateLogEntryMissedCalls,
+    ECmdCreateLogEntryReceivedCalls,
+    ECmdCreateLogEntryDialledNumbers,
+
+    ECmdCreateMessagingEntries,
+    ECmdCreateMessagingEntryCBSTopics,
+    ECmdCreateMessagingEntryDocumentsFolders,
+    ECmdCreateMessagingEntrySMSMessageCenters,
+    ECmdCreateMessagingEntryMailboxes,
+    ECmdCreateMessagingEntryMessages,
+    ECmdCreateMessagingEntryMessagesViaScript,
+    ECmdCreateMessagingEntryTemplates,
+
+    ECmdCreateRandomEntrySMSInbox,
+    ECmdCreateRandomEntrySMSDrafts,
+    ECmdCreateRandomEntrySMSOutbox,
+    ECmdCreateRandomEntrySMSSent,
+    ECmdCreateRandomEntryMMSInbox,
+    ECmdCreateRandomEntryMMSDrafts,
+    ECmdCreateRandomEntryMMSOutbox,
+    ECmdCreateRandomEntryMMSSent,
+    ECmdCreateRandomEntryAMSInbox,
+    ECmdCreateRandomEntryAMSDrafts,
+    ECmdCreateRandomEntryAMSOutbox,
+    ECmdCreateRandomEntryAMSSent,
+    ECmdCreateRandomEntryEmailInbox,
+    ECmdCreateRandomEntryEmailDrafts,
+    ECmdCreateRandomEntryEmailOutbox,
+    ECmdCreateRandomEntryEmailSent,
+    ECmdCreateRandomEntryBIOInbox,
+    ECmdCreateRandomEntryBIODrafts,
+    ECmdCreateRandomEntryBIOOutbox,
+    ECmdCreateRandomEntryBIOSent,
+    ECmdCreateRandomEntryIRInbox,
+    ECmdCreateRandomEntryIRDrafts,
+    ECmdCreateRandomEntryIROutbox,
+    ECmdCreateRandomEntryIRSent,
+    ECmdCreateRandomEntryBTInbox,
+    ECmdCreateRandomEntryBTDrafts,
+    ECmdCreateRandomEntryBTOutbox,
+    ECmdCreateRandomEntryBTSent,
+
+    ECmdCreateMiscEntries,
+    ECmdCreateMiscEntryAccessPoints,
+    ECmdCreateMiscEntryAppMenuFolders,
+    ECmdCreateMiscEntryIMPSServers,
+    ECmdCreateMiscEntryNotes,
+    ECmdCreateMiscEntrySyncSettings,
+    ECmdCreateMiscEntryLandmarks,
+
+    ECmdCreatePhoneBookEntries,
+    ECmdCreatePhoneBookEntryContacts,
+    ECmdCreatePhoneBookEntryGroups,
+    ECmdCreatePhoneBookEntrySubscribedContacts,
+
+    ECmdDeleteEntries,
+    ECmdDeleteAllEntries,
+    ECmdDeleteAllCreatorEntries,
+    ECmdDeleteContacts,
+    ECmdDeleteCreatorContacts,
+    ECmdDeleteContactGroups,
+    ECmdDeleteCreatorContactGroups,
+    ECmdDeleteCalendarEntries,
+    ECmdDeleteCreatorCalendarEntries,
+    ECmdDeleteBrowserBookmarks,
+    ECmdDeleteCreatorBrowserBookmarks,
+    ECmdDeleteBrowserBookmarkFolders,
+    ECmdDeleteCreatorBrowserBookmarkFolders,
+    ECmdDeleteBrowserSavedPages,
+    ECmdDeleteCreatorBrowserSavedPages,
+    ECmdDeleteBrowserSavedPageFolders,
+    ECmdDeleteCreatorBrowserSavedPageFolders,
+    ECmdDeleteCreatorFiles,
+    ECmdDeleteLogs,
+    ECmdDeleteCreatorLogs,
+    ECmdDeleteMessages,
+    ECmdDeleteCreatorMessages,
+    ECmdDeleteMailboxes,
+    ECmdDeleteCreatorMailboxes,
+    ECmdDeleteIAPs,
+    ECmdDeleteCreatorIAPs,
+    ECmdDeleteIMPSs,
+    ECmdDeleteCreatorIMPSs,
+    ECmdDeleteNotes,
+    // ECmdDeleteCreatorNotes, not supported
+    ECmdDeleteLandmarks,
+    ECmdDeleteCreatorLandmarks,
+
+    ECmdAboutCreator,
+
+    ECmdSelectRandomDataFile,
+
+    EProgressNote
+
+    };
+
+#endif // __CREATOR_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator.pan	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CREATOR_PAN__
+#define __CREATOR_PAN__
+
+
+/** Creator application panic codes */
+enum TCreatorPanics 
+    {
+    ECreatorBasicUi = 1
+    // add further panics here
+    };
+
+#endif // __CREATOR_PAN__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_accesspoint.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORACCESSPOINTS_H__
+#define __CREATORACCESSPOINTS_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+#include "creator_connectionmethodbase.h"
+
+#include <e32base.h>
+#include <commdb.h>
+#include <apselect.h>
+#include <apdatahandler.h>
+#include <apaccesspointitem.h>
+#include <aputils.h>
+#include <apengineconsts.h>
+#include <msvapi.h>
+#include <mtclreg.h>
+#include <mmsclient.h>
+
+
+class CCreatorEngine;
+class CAccessPointsParameters;
+
+
+
+class CCreatorAccessPoints : public CCreatorConnectionSettingsBase, public MMsvSessionObserver
+    {
+public: 
+    static CCreatorAccessPoints* NewL(CCreatorEngine* aEngine);
+    static CCreatorAccessPoints* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorAccessPoints();
+
+private:
+    CCreatorAccessPoints();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+
+    TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters);    
+    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
+    
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    CCommsDatabase* iCommsDb;
+    CApDataHandler* iApDataHandler;
+    CApUtils* iApUtils;
+    CAccessPointsParameters* iParameters;
+    RArray<TUint32> iEntryIds; // TUint32 CApDataHandler::CreateFromDataL
+
+public:
+    };
+
+
+class CAccessPointsParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*          iConnectionName; // connection name
+    TApBearerType   iBearerType; // bearer type
+    HBufC*          iWapStartPage; // WAP start page
+    TUint32         iWapWspOption; // connection type
+    HBufC*          iGprsAcessPointName; // access point name
+    HBufC*          iIspLoginName; // username
+    TBool           iSecureAuthentication; // password authentication
+    HBufC*          iIspLoginPass; // password
+    TBool           iPromptPassword; // prompt password
+    HBufC*          iWapGatewayAddress; // WAP gateway address
+    HBufC*          iIspIPAddr; // phone IP
+    HBufC*          iIspIPNameServer1;  // primary name server
+    HBufC*          iIspIPNameServer2;  // secondary name server
+    HBufC*          iIspDefaultTelNumber; // datacall number
+    TUint32         iIspBearerCallTypeIsdn; // datacall type
+    TUint32         iIspBearerSpeed;  // max connection speed
+    HBufC*          iProxyServerAddress;  // proxy address
+    TUint32         iProxyPortNumber; // proxy number
+    
+    void SetRandomCMNameL(CCreatorEngine& aEngine);
+    void SetRandomLoginNameL(CCreatorEngine& aEngine);
+    void SetRandomLoginPassL(CCreatorEngine& aEngine);
+    void SetRandomSecureAuthenticationL(CCreatorEngine& aEngine);
+    void SetRandomPromptPasswordL(CCreatorEngine& aEngine);
+    void SetRandomProxyAddressL(CCreatorEngine& aEngine);
+    void SetRandomProxyPortL(CCreatorEngine& aEngine);
+    void SetRandomStartPageL(CCreatorEngine& aEngine);
+    void SetRandomIPAddressL(CCreatorEngine& aEngine);
+    void SetRandomIP4NameServer1L(CCreatorEngine& aEngine);
+    void SetRandomIP4NameServer2L(CCreatorEngine& aEngine);
+    void SetRandomTelephoneNumberL(CCreatorEngine& aEngine);
+    void SetRandomBearerTypeIsdnL(CCreatorEngine& aEngine);
+    void SetRandomBearerSpeedL(CCreatorEngine& aEngine);
+    void SetRandomWapWspOptionL(CCreatorEngine& aEngine);
+    void SetRandomGatewayAddressL(CCreatorEngine& aEngine);
+    
+
+public:
+    CAccessPointsParameters();
+    ~CAccessPointsParameters();
+    };
+
+
+
+#endif // __CREATORACCESSPOINTS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_browser.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORBROWSER_H__
+#define __CREATORBROWSER_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+#include <e32base.h>
+#include <favouritesitem.h>
+#include <favouritesdb.h>
+#include <favouritesfile.h>
+
+
+
+class CCreatorEngine;
+class CBrowserParameters;
+
+
+class CCreatorBrowser : public CBase, public MCreatorModuleBase
+    {
+public: 
+    static CCreatorBrowser* NewL(CCreatorEngine* aEngine);
+    static CCreatorBrowser* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorBrowser();
+
+private:
+    CCreatorBrowser();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    TInt CreateBookmarkEntryL(CBrowserParameters *aParameters);    
+    TInt CreateBookmarkFolderEntryL(CBrowserParameters *aParameters);
+    TInt CreateSavedDeckEntryL(CBrowserParameters *aParameters); 
+    TInt CreateSavedDeckFolderEntryL(CBrowserParameters *aParameters);
+    
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+    
+    void DeleteAllBookmarksL();
+    void DeleteAllBookmarksCreatedByCreatorL();
+    void DeleteAllBookmarkFoldersL();
+    void DeleteAllBookmarkFoldersCreatedByCreatorL();
+    void DeleteAllSavedPagesL();
+    void DeleteAllSavedPagesCreatedByCreatorL();
+    void DeleteAllSavedPageFoldersL();
+    void DeleteAllSavedPageFoldersCreatedByCreatorL();
+
+private:
+    void DeleteAllItemsL( const TDesC& aDbName, CFavouritesItem::TType aTypeFilter, TBool aOnlyCreatedWithCreator, RArray<TInt>& aEntryIds, const TUid aDictUid );
+    
+
+
+private:
+    CBrowserParameters* iParameters;
+    RArray<TInt> iBmEntryIds;
+    RArray<TInt> iBmFEntryIds;
+    RArray<TInt> iSpEntryIds;
+    RArray<TInt> iSpFEntryIds;
+public:
+    };
+
+
+class CBrowserParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*              iBookmarkName;
+    HBufC*              iBookmarkAddress;
+    TFavouritesWapAp    iBookmarkAccessPoint;
+    HBufC*              iBookmarkUsername;
+    HBufC*              iBookmarkPassword;    
+
+    HBufC*              iBookmarkFolderName;
+    
+    HBufC*              iSavedDeckLinkName;
+    HBufC*              iSavedDeckLocalAddress;
+            
+    HBufC*              iSavedDeckFolderName;
+
+public:
+    CBrowserParameters();
+    ~CBrowserParameters();
+    };
+
+
+
+#endif // __CREATORBROWSER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_browserelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORBROWSERELEMENT_H_
+#define CREATORBROWSERELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorbrowser
+{
+_LIT(KBookmark, "bookmark");
+_LIT(KBookmarkFolder, "bookmarkfolder");
+_LIT(KSavedPage, "savedpage");
+_LIT(KSavedPageFolder, "savedpagefolder");
+
+_LIT(KName, "name");
+_LIT(KPath, "path");
+_LIT(KUsername, "username");
+_LIT(KPassword, "password");
+_LIT(KUrl, "url");
+}
+
+class CCreatorBrowserElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorBrowserElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorBrowserElement(CCreatorEngine* aEngine);    
+    TInt GetBrowserCommandL() const;
+};
+#endif /*CREATORBROWSERELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_calendar.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORCALENDARINTERIM_H__
+#define __CREATORCALENDARINTERIM_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+#include "creator_calendarbase.h"
+
+#include <e32base.h>
+#include <e32std.h>
+
+//#include <calenlauncher.h> 
+#include <calentry.h>
+#include <calentryview.h>
+#include <caltime.h>
+#include <calsession.h>
+#include <calprogresscallback.h>
+#include <calcategory.h>
+#include <caluser.h>
+#include <calrrule.h>
+
+
+class CCreatorEngine;
+class CCalenderInterimParameters;
+class CAsyncWaiter;
+
+class CCreatorInterimCalendar : public CCreatorCalendarBase, public MCalProgressCallBack
+    {
+public: 
+    static CCreatorInterimCalendar* NewL(CCreatorEngine* aEngine);
+    static CCreatorInterimCalendar* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorInterimCalendar();
+
+private:
+    CCreatorInterimCalendar();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+    void AddRepeatingRuleL(const TCalTime& aStartTime, CCalEntry& aCalEntry, CCalenderInterimParameters* parameters=0);
+    void SetRandomAlarmL(CCalEntry& aCalEntry);
+    void SetAlarmL(CCalEntry& aCalEntry, CCalenderInterimParameters* params);
+    void AddAttendeesL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters=0);
+    void SetPhoneOwnerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy );
+    void SetOrganizerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy);
+    void SetOrganizerL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters );
+    
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+
+    TInt CreateAppointmentEntryL(CCreatorModuleBaseParameters *aParameters);    
+    TInt CreateEventEntryL(CCreatorModuleBaseParameters *aParameters);
+    TInt CreateAnniversaryEntryL(CCreatorModuleBaseParameters *aParameters); 
+    TInt CreateTodoEntryL(CCreatorModuleBaseParameters *aParameters);
+    TInt CreateReminderEntryL(CCreatorModuleBaseParameters *aParameters);
+    
+    void GenerateRandomId(TDes8& aText);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+
+    CCalenderInterimParameters* iParameters;
+    TTime   iRandomModeStartTime;
+    TTime   iRandomModeEndTime;
+    TInt    iNumberRepeatingEntries;
+    TInt    iNumberOfAttendees;
+    CCalEntryView* 		iCalEntryView;
+    CCalSession* 		iCalSession;
+    TBool iSetAlarm;
+    CDesCArrayFlat* iSoundFileArray;
+    CAsyncWaiter* iWaiter;
+    HBufC* iTmpCN;
+    HBufC* iTmpEmail;
+    RArray<TUint32> iEntryIds; // TCalLocalUid ( == TUint32 ) CCalEntry::LocalUidL
+
+public:
+
+    //Observer implementation for MCalProgressCallBack
+	void Progress(TInt aPercentageCompleted);
+	
+	void Completed(TInt aError);
+	
+	TBool NotifyProgress();
+
+    };
+
+class CCreatorCalenderAttendee : public CBase
+{
+public:
+    virtual ~CCreatorCalenderAttendee();
+    static CCreatorCalenderAttendee* NewL();
+    void SetCommonNameL(const TDesC& aName);
+    void SetEmailAddressL(const TDesC& aEmail);
+    void SetRole(CCalAttendee::TCalRole aRole);
+    void SetStatus(CCalAttendee::TCalStatus);
+    
+    const TDesC& CommonName() const;
+    const TDesC& EmailAddress() const;
+    CCalAttendee::TCalRole Role() const;
+    CCalAttendee::TCalStatus Status() const;
+    
+private:
+    CCreatorCalenderAttendee();
+    TPtrC  iDummy;
+    HBufC* iCommonName;
+    HBufC* iEmailAddress;
+    CCalAttendee::TCalRole iRole;
+    CCalAttendee::TCalStatus iStatus;
+};
+
+class CCalenderInterimParameters : public CCreatorModuleBaseParameters
+    {
+public:
+
+	void ParseL(CCommandParser* parser, TParseParams aCase);
+	TBool IsAllowedEntryStatus(CCalEntry::TType aType, CCalEntry::TStatus aStatus);
+
+	TCalRRule::TType iRecurrentFrequency;
+	TInt iRecurrentInterval;
+	TTime iRecurrentStartTime;
+	TTime iRecurrentEndTime;
+	TInt iRepeatingCount; // This is used when running a script...
+	TTime iAlarmTime; // NullTTime means no alarm
+	TBool iUseRandomAlarmTime; // ETrue if random alarm should be set. Overwrites the iAlarmTime.
+	
+	RPointerArray<CCreatorCalenderAttendee> iAttendees;
+	RArray<TLinkIdParam> iAttendeeLinkIds; // For attendees. Stores the linked contact ids.
+	HBufC* iOrganizerName;
+	HBufC* iOrganizerEmail;
+		 
+	HBufC*  iDescription;
+	HBufC*  iSummary;
+	HBufC*  iLocation;
+	TTime   iStartTime;
+	TTime   iEndTime;
+	TInt    iNumberRepeatingEntries; // This is used when user input is used...
+	TInt    iNumberOfAttendees; // Number of randomly generated attendees
+	TInt    iNumberOfExistingAttendees; // Number of attendees selected from existing contacts.
+	
+	//An appointment, which has a start time and end time.
+    TTime   iAppointmentStartTime;
+    TTime   iAppointmentEndTime;
+    HBufC*  iAppointmentLocation;
+    HBufC*  iAppointmentReason;
+
+    //An event, which has a start time and end time.
+    
+    TTime   iEventStartTime;
+    TTime   iEventEndTime;
+    HBufC*  iEventReason;
+
+    //A reminder, which has a start time only.
+    TTime   iReminderStartTime;
+    HBufC*  iReminderReason;
+    
+    //An anniversary, which has a start time and end time.
+    TTime   iAnniversaryStartTime;
+    TTime   iAnniversaryEndTime;
+    HBufC*  iAnniversaryReason;
+
+    //A to-do, which can have a start time and end time (the end time is the due date), or can be undated.
+    TTime   iTodoStartTime;//optional
+    TTime   iTodoDueTime;//also end time (optional)
+    HBufC*  iTodoTask;
+    TInt    iTodoPriority;
+
+    TTime   iRandomModeStartTime;
+    TTime   iRandomModeEndTime;
+    
+    CCalEntry::TStatus iStatus;
+    
+public:
+	CCalenderInterimParameters();
+    ~CCalenderInterimParameters();   
+    
+    };
+
+
+
+#endif // __CREATORCALENDARINTERIM_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_calendarbase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CCREATORCALENDARBASE_
+#define CCREATORCALENDARBASE_
+
+#include "creator_modulebase.h"
+
+class CCreatorModuleBaseParameters;
+
+class CCreatorCalendarBase : public CBase, public MCreatorModuleBase{
+public:
+
+
+    //An appointment, which has a start time and end time. EAppt.
+    virtual TInt CreateAppointmentEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+    //An event, which has a start time and end time. EEvent.
+    virtual TInt CreateEventEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+    //An anniversary, which has a start time and end time. EAnniv.
+    virtual TInt CreateAnniversaryEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+    //A to-do, which can have a start time and end time (the end time is the due date), or can be undated. ETodo.
+    virtual TInt CreateTodoEntryL(CCreatorModuleBaseParameters *aParameters) = 0;     
+    //A reminder, which has a start time only. EReminder.
+    virtual TInt CreateReminderEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+
+};
+
+#endif /*CCREATORCALENDARBASE_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_calendarelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORCALENDARELEMENT_H_
+#define CREATORCALENDARELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+class CCalenderInterimParameters;
+
+// Calendar elements:
+namespace creatorcalendar
+{
+    _LIT(KCalendar, "calendar");
+
+    // Calendar entry types:
+    _LIT(KType, "type");
+    _LIT(KCalTypeAppointment, "appointment");
+    _LIT(KCalTypeEvent, "event");
+    _LIT(KCalTypeReminder, "reminder");
+    _LIT(KCalTypeAnniversary, "anniversary");
+    _LIT(KCalTypeTodo, "todo");
+
+    // Calendar entry field elements:
+    _LIT(KSummary, "summary");
+    _LIT(KDescription, "description");
+    _LIT(KLocation, "location");
+    _LIT(KStarttime, "starttime");
+    _LIT(KEndtime, "endtime");
+    _LIT(KRecurrentFreq, "recurrentfrequency");
+    _LIT(KRecurrentInterval, "recurrentinterval");
+    _LIT(KRecurrentFrom, "recurrentfrom");
+    _LIT(KRecurrentTo, "recurrentto");
+    _LIT(KRepeatingCount, "repeatingcount");
+    _LIT(KAlarmtime, "alarmtime");
+    _LIT(KSynchronization, "synchronization");
+    _LIT(KOrganizername, "organizername");
+    _LIT(KOrganizeremail, "organizeremail");
+    _LIT(KAttendees, "attendees");
+    _LIT(KAttendee, "attendee");
+    _LIT(KCommonname, "commonname");
+    _LIT(KEmail, "email");
+    _LIT(KRole, "role");
+    _LIT(KStatus, "status");
+    _LIT(KPriority, "priority");
+
+    // Recurrency frequency values:
+    _LIT(KNotRepeated, "not-repeated");
+    _LIT(KWeekly, "weekly");
+    _LIT(KDaily, "daily");
+    _LIT(KMonthly, "monthly");
+    _LIT(KYearly, "yearly");
+
+    // Attendee role values:
+    _LIT(KRoleRequired, "required");
+    _LIT(KRoleOptional, "optional");
+    _LIT(KRoleNonPart, "non-participant");
+    _LIT(KRoleChair, "chair");
+    
+    // Calendar entry status values:
+    _LIT(KCalStatusTentative, "tentative");
+    _LIT(KCalStatusConfirmed, "confirmed");
+    _LIT(KCalStatusCancelled, "cancelled");
+    _LIT(KCalStatusNeedsAction, "todoneedsaction");
+    _LIT(KCalStatusCompleted, "todocompleted");
+    _LIT(KCalStatusInProcess, "todoinprocess");
+
+    // Attendee status values:
+    _LIT(KStatusNeedsAction, "needsaction");
+    _LIT(KStatusAccepted, "accepted");
+    _LIT(KStatusTentative, "tentative");
+    _LIT(KStatusConfirmed, "confirmed");
+    _LIT(KStatusDeclined, "declined");
+    _LIT(KStatusCompleted, "completed");
+    _LIT(KStatusDelegated, "delegated");
+    _LIT(KStatusInProcess, "inprocess");
+    
+    // Priority values:
+    _LIT(KPriorityHigh, "high");
+    _LIT(KPriorityMedium, "medium");
+    _LIT(KPriorityLow, "low");
+}
+
+class CCreatorCalendarElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorCalendarElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+protected:
+    CCreatorCalendarElement(CCreatorEngine* aEngine);
+    
+    enum TEntryType {
+        EAppointment,
+        EEvent,
+        EReminder,
+        EAnniversary,
+        ETodo
+    };
+    
+    void FillEntryParamsL(TEntryType aType, const RPointerArray<CCreatorScriptElement>& fields, CCalenderInterimParameters* parameters); 
+};
+
+#endif /*CREATORCALENDARELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_cmdscriptrun.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef __CREATORCMDSCRIPTRUN_H__
+#define __CREATORCMDSCRIPTRUN_H__
+
+#include "engine.h"
+
+class CCreatorCmdScriptRun : public MBeating
+    {
+public:
+
+    static CCreatorCmdScriptRun* NewL(CCreatorEngine* aEngine);
+	static CCreatorCmdScriptRun* NewLC(CCreatorEngine* aEngine);
+	~CCreatorCmdScriptRun();
+
+    // callback from engine when the commands from the script file have been executed
+    void RunScriptDone();
+
+    // from MBeating
+    void Beat();
+    void Synchronize();
+	
+private:
+    CCreatorCmdScriptRun();
+    void ConstructL(CCreatorEngine* aEngine);
+	void Tick();
+	
+private:
+    CCreatorEngine* iEngine;
+	HBufC* iCommandLineScriptName;
+	HBufC* iCommandLineRandomDataFileName;
+	CHeartbeat* iTimer;
+	enum TTimerMode
+		{
+		ETimerModeNone,
+		ETimerModeStartScript,
+		ETimerModeExitAppUi
+		};
+	TTimerMode iMode;
+	TInt iTickCount;
+    };
+	
+#endif // __CREATORCMDSCRIPTRUN_H__	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_connectionmethod.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CREATORCONNECTIONSETTINGS_H__
+#define __CREATORCONNECTIONSETTINGS_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+#include "creator_connectionmethodbase.h"
+
+#include <e32base.h>
+#include <commdb.h>
+#include <msvapi.h>
+#include <mtclreg.h>
+#include <mmsclient.h>
+
+#include <cmconnectionmethoddef.h>
+#include <cmmanagerext.h>
+#include <cmpluginwlandef.h>
+using namespace CMManager;
+
+#include <etelpckt.h>//ETel Packet API needed for enums
+
+class CCreatorEngine;
+class CConnectionSettingsParameters;
+
+class CCreatorConnectionSettings : public CCreatorConnectionSettingsBase, public MMsvSessionObserver
+    {
+public: 
+    static CCreatorConnectionSettings* NewL(CCreatorEngine* aEngine);
+    static CCreatorConnectionSettings* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorConnectionSettings();
+
+private:
+    CCreatorConnectionSettings();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
+        
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    
+    TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters);    
+    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
+    
+    //Setting default connection method, if not set
+    void SetDefaultCML(RCmConnectionMethodExt conMethod);
+    //Set random parameters
+    void SetRandomParametersL(CConnectionSettingsParameters& parameters);
+    void SetRandomBearerTypeL(CConnectionSettingsParameters& parameters);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+private:
+    void DeleteAllDestinationsL( TBool aOnlyCreatedWithCreator );
+private:
+    CCommsDatabase* iCommsDb;
+    
+    RCmManagerExt iCmManagerExt;
+
+    CConnectionSettingsParameters* iParameters;
+    
+    RArray<TUint32> iEntryIds; // TUint32 RCmDestinationExt::Id()
+
+public:
+    };
+
+   
+class CConnectionSettingsParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*          iConnectionName; // connection name
+    TUint           iBearerType; // bearer type
+    HBufC*          iStartPage; // start page
+    TWapWSPOption   iWapWspOption; // Indicating whether connection-oriented  or connectionless API should be used.
+    
+    RPacketContext::TProtocolType iProtocolType; //Type of protocol EPdpTypeIPv4 or EPdpTypeIPv4
+    
+    HBufC*          iLoginName; // username
+    TBool           iSecureAuthentication; // password authentication
+    HBufC*          iLoginPass; // password
+    TBool           iPromptPassword; // prompt password
+    HBufC*          iGatewayAddress; // gateway address
+    HBufC*          iSubnetMask;  // subnet mask
+    HBufC*          iIPAddr; // phone IP
+    HBufC*          iIP4NameServer1;  // primary name server
+    HBufC*          iIP4NameServer2;  // secondary name server
+    HBufC*          iDefaultTelNumber; // datacall number
+    TUint32         iBearerCallTypeIsdn; // datacall type
+    TUint32         iBearerSpeed;  // max connection speed
+    TBool           iUseProxy; //Use proxy or not
+    HBufC*          iProxyServerAddress;  // proxy address
+    TUint32         iProxyPortNumber; // proxy number
+    HBufC*          iWLANName;//WLAN network name
+    HBufC*          iWlanIpAddr;//IP address of EPOC.
+    TWlanSecMode    iWLanSecMode;//WLAN security modes
+    TWlanNetMode    iWlanNetMode;//WLAN connection mode. Ad-hoc or infrastructure.
+
+    HBufC*          iIP6NameServer1;  // primary name server for IP v6
+    HBufC*          iIP6NameServer2;  // secondary name server for IP v6
+    TBool           iDisableTextAuth; // Disable plaintext authentication 
+    
+    CCreatorEngine* iEngine;
+    
+public:
+    CConnectionSettingsParameters();
+    ~CConnectionSettingsParameters();   
+    
+    void SetRandomCMNameL(CCreatorEngine& aEngine);
+    void SetRandomWLANNameL(CCreatorEngine& aEngine);
+    void SetRandomWLANNetModeL(CCreatorEngine& aEngine);
+    void SetRandomWLANSecurityModeL(CCreatorEngine& aEngine);
+    void SetRandomLoginNameL(CCreatorEngine& aEngine);
+    void SetRandomLoginPassL(CCreatorEngine& aEngine);
+    void SetRandomSecureAuthenticationL(CCreatorEngine& aEngine);
+    void SetRandomPromptPasswordL(CCreatorEngine& aEngine);
+    void SetRandomUseProxyL(CCreatorEngine& aEngine);
+    void SetRandomProxyAddressL(CCreatorEngine& aEngine);
+    void SetRandomProxyPortL(CCreatorEngine& aEngine);
+    void SetRandomStartPageL(CCreatorEngine& aEngine);
+    void SetRandomIPAddressL(CCreatorEngine& aEngine);
+    void SetRandomIP4NameServer1L(CCreatorEngine& aEngine);
+    void SetRandomIP4NameServer2L(CCreatorEngine& aEngine);
+    void SetRandomProtocolTypeL(CCreatorEngine& aEngine);
+    void SetRandomTelephoneNumberL(CCreatorEngine& aEngine);
+    void SetRandomBearerTypeIsdnL(CCreatorEngine& aEngine);
+    void SetRandomBearerSpeedL(CCreatorEngine& aEngine);
+    void SetRandomWapWspOptionL(CCreatorEngine& aEngine);
+    void SetRandomSubnetMaskL(CCreatorEngine& aEngine);
+    void SetRandomGatewayAddressL(CCreatorEngine& aEngine);
+    void SetRandomWlanIpAddrL(CCreatorEngine& aEngine);
+    void SetRandomIPv6NameServer1L(CCreatorEngine& aEngine);
+    void SetRandomIPv6NameServer2L(CCreatorEngine& aEngine);
+    void SetRandomDisableTextAuthL(CCreatorEngine& aEngine);
+    };
+
+
+
+#endif // __CREATORCONNECTIONSETTINGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_connectionmethodbase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CCREATORCONNECTIONSETTINGSBASE_H_
+#define __CCREATORCONNECTIONSETTINGSBASE_H_
+
+#include "creator_modulebase.h"
+
+class CCreatorModuleBaseParameters;
+
+const TUint KRandomBearerType = 0xEEEEEEEE;
+
+class CCreatorConnectionSettingsBase : public CBase, public MCreatorModuleBase
+    {
+public:
+    
+    virtual ~CCreatorConnectionSettingsBase(){};
+
+    virtual TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters) = 0;    
+    virtual TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse ) = 0;
+    virtual void DeleteAllConnectionMethodsL(){};
+    };
+
+#endif /*__CCREATORCONNECTIONSETTINGSBASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_connectionmethodelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORCONNECTIONMETHODELEMENT_H_
+#define CREATORCONNECTIONMETHODELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorconnectionmethod
+{
+    _LIT(KCm, "connectionmethod");
+    _LIT(Kconnectionname, "connectionname");
+    _LIT(Kbearertype, "bearertype");
+    _LIT(Kstartpage, "startpage");
+    _LIT(Kwapwspoption, "wapwspoption");
+    _LIT(Kprotocoltype, "protocoltype");
+    _LIT(Kloginname, "loginname");
+    _LIT(Ksecureauthentication, "secureauthentication");
+    _LIT(Kloginpass, "loginpass");
+    _LIT(Kpromptpassword, "promptpassword");
+    _LIT(Kgatewayaddress, "gatewayaddress");
+    _LIT(Ksubnetmask, "subnetmask");
+    _LIT(Kdeviceipaddr, "deviceipaddr");
+    _LIT(Kip4nameserver1, "ip4nameserver1");
+    _LIT(Kip4nameserver2, "ip4nameserver2");
+    _LIT(Kdatacalltelnumber, "datacalltelnumber");
+    _LIT(Kdatacalltypeisdn, "datacalltypeisdn");
+    _LIT(Kdatacalllinespeed, "datacalllinespeed");
+    _LIT(Kuseproxy, "useproxy");
+    _LIT(Kproxyserveraddress, "proxyserveraddress");
+    _LIT(Kproxyportnumber, "proxyportnumber");
+    _LIT(Kip6nameserver1, "ip6nameserver1");
+    _LIT(Kip6nameserver2, "ip6nameserver2");
+    _LIT(Kdisabletextauth, "disabletextauth");
+    _LIT(Kwlanname, "wlanname");
+    _LIT(Kwlanipaddr, "wlanipaddr");
+    _LIT(Kwlansecmode, "wlansecmode");
+    _LIT(Kwlannetmode, "wlannetmode");
+    
+    // Bearer type:
+    _LIT(Kwlan, "wlan");
+    _LIT(Kgprs, "gprs");
+    _LIT(Kdatacall, "datacall");
+    _LIT(Khsgsm, "hsgsm");
+    _LIT(Kembedded, "embedded");
+    _LIT(Kvpn, "vpn");
+    _LIT(Klan, "lan");
+    
+    // Data call type isdn:
+    _LIT(Kanalogue, "analogue");
+    _LIT(Kisdnv110, "isdnv110");
+    _LIT(Kisdnv120, "isdnv120");
+    
+    // Line speed:
+    _LIT(Kautomatic, "automatic");
+    // WAP wps options:
+    _LIT(Kconnectionless, "connectionless"); // ECmWapWspOptionConnectionless
+    _LIT(Kconnectionoriented, "connectionoriented"); // ECmWapWspOptionConnectionOriented
+    
+    // Protocol
+    _LIT(Kipv4, "ipv4");
+    _LIT(Kipv6, "ipv6");
+
+    // WLAN security mode:
+    _LIT(Kopen, "open");
+    _LIT(Kwep, "wep");
+    _LIT(Ke802_1x, "e802_1x");
+    _LIT(Kwpa, "wpa");
+    _LIT(Kwpa2, "wpa2");
+}
+
+class CCreatorConnectionMethodElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorConnectionMethodElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorConnectionMethodElement(CCreatorEngine* aEngine);
+};
+
+#endif /*CREATORCONNECTIONMETHODELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_contactelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORCONTACTELEMENT_H_
+#define CREATORCONTACTELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorcontact
+{ 
+    _LIT(KContact, "contact");
+    _LIT(KContactSet, "contact-set");
+    _LIT(KContactGroup, "contactgroup");
+    _LIT(KMembers, "members");
+    _LIT(KName, "name");
+    
+    // Contact field elements:
+    _LIT(KFirstname, "firstname");
+    _LIT(KLastname, "lastname");
+    _LIT(KFirstnameReading, "firstnamereading");
+    _LIT(KLastnameReading, "lastnamereading");
+    _LIT(KPrefix, "prefix");
+    _LIT(KSuffix, "suffix");
+    _LIT(KSecondname, "secondname");
+    _LIT(KLandphoneHome, "landphonehome");
+    
+    _LIT(KMobilephoneHome, "mobilephonehome");
+    _LIT(KVideonumberHome, "videonumberhome");
+    _LIT(KFaxnumberHome, "faxnumberhome");
+    _LIT(KVoipHome, "voiphome");
+    _LIT(KEmailHome, "emailhome");
+    _LIT(KUrlHome, "urlhome");
+    _LIT(KAddrlabelHome, "addrlabelhome");
+    _LIT(KAddrpoHome, "addrpohome");
+    
+    _LIT(KAddrextHome, "addrexthome");
+    _LIT(KAddrstreetHome, "addrstreethome");
+    _LIT(KAddrlocalHome, "addrlocalhome");
+    _LIT(KAddrregionHome, "addrregionhome");
+    _LIT(KAddrpostcodeHome, "addrpostcodehome");
+    _LIT(KAddrcountryHome, "addrcountryhome");
+    _LIT(KJobtitle, "jobtitle");
+    _LIT(KCompanyname, "company");
+    
+    _LIT(KLandphoneWork, "landphonework");
+    _LIT(KMobilephoneWork, "mobilephonework");
+    _LIT(KVideonumberWork, "videonumberwork");
+    _LIT(KFaxnumberWork, "faxnumberwork");
+    _LIT(KVoipWork, "voipwork");
+    _LIT(KEmailWork, "emailwork");
+    _LIT(KUrlWork, "urlwork");
+    _LIT(KAddrlabelWork, "addrlabelwork");
+    
+    _LIT(KAddrpoWork, "addrpowork");
+    _LIT(KAddrextWork, "addrextwork");
+    _LIT(KAddrstreetWork, "addrstreetwork");
+    _LIT(KAddrlocalWork, "addrlocalwork");
+    _LIT(KAddrregionWork, "addrregionwork");
+    _LIT(KAddrpostcodeWork, "addrpostcodework");
+    _LIT(KAddrcountryWork, "addrcountrywork");
+    _LIT(KLandphoneGen, "landphonegen");
+    
+    _LIT(KMobilephoneGen, "mobilephonegen");
+    _LIT(KVideonumberGen, "videonumbergen");
+    _LIT(KFaxnumberGen, "faxnumbergen");
+    _LIT(KVoipGen, "voipgen");
+    _LIT(KPoc, "poc");
+    _LIT(KSwis, "swis");
+    _LIT(KSip, "sip");
+    _LIT(KEmailGen, "emailgen");
+    
+    _LIT(KUrlGen, "urlgen");
+    _LIT(KAddrlabelGen, "addrlabelgen");
+    _LIT(KAddrpoGen, "addrpogen");
+    _LIT(KAddrextGen, "addrextgen");
+    _LIT(KAddrstreetGen, "addrstreetgen");
+    _LIT(KAddrlocalGen, "addrlocalgen");
+    _LIT(KAddrregionGen, "addrregiongen");
+    _LIT(KAddrpostcodeGen, "addrpostcodegen");
+    
+    _LIT(KAddrcountryGen, "addrcountrygen");
+    _LIT(KPagerNumber, "pagernumber");
+    _LIT(KDtmfString, "dtmfstring");
+    _LIT(KWvAddress, "wvaddress");
+    _LIT(KDate, "date");
+    _LIT(KNote, "note");
+    _LIT(KThumbnailPath, "thumbnailpath");
+    _LIT(KThumbnailId, "thumbnailid");
+    _LIT(KRingTone, "ringtonepath");
+    _LIT(KRingToneId, "ringtoneid");
+    
+    _LIT(KCallerobjImg, "callerobjimg");
+    _LIT(KCallerobjText, "callerobjtext");
+    _LIT(KMiddlename, "middlename");
+    _LIT(KDepartment, "department");
+    _LIT(KAsstname, "asstname");
+    _LIT(KSpouse, "spouse");
+    _LIT(KChildren, "children");
+    _LIT(KAsstphone, "asstphone");
+    
+    _LIT(KCarphone, "caphone");
+    _LIT(KAnniversary, "anniversary");
+    _LIT(KSyncclass, "synchronization");
+    _LIT(KLocPrivacy, "locprivacy");
+    _LIT(KGenlabel, "genlabel");
+}
+/**
+ * Contact elements
+ */
+
+/**
+ * Base class for contact elements
+ */
+class CCreatorContactElementBase : public CCreatorScriptElement
+{
+public:
+    static CCreatorContactElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+protected:
+    CCreatorContactElementBase(CCreatorEngine* aEngine);
+};
+
+/**
+ * Contact element
+ */
+class CCreatorContactElement : public CCreatorContactElementBase
+{
+public:
+    static CCreatorContactElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+protected:
+    CCreatorContactElement(CCreatorEngine* aEngine);
+};
+
+/**
+ * Contact-set element
+ */
+class CCreatorContactSetElement : public CCreatorContactElementBase
+{
+public:
+    static CCreatorContactSetElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    virtual void AddToCacheL();
+protected:
+    CCreatorContactSetElement(CCreatorEngine* aEngine);
+};
+
+/**
+ * Contact group element
+ */
+class CCreatorContactGroupElement : public CCreatorContactElementBase
+{
+public:
+    static CCreatorContactGroupElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+protected:
+    CCreatorContactGroupElement(CCreatorEngine* aEngine);
+};
+
+/**
+ * Contact field element
+ */
+class CCreatorContactFieldElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorContactFieldElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+protected:
+    CCreatorContactFieldElement(CCreatorEngine* aEngine);
+};
+
+#endif /*CREATORCONTACTELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_contactsetcache.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORCONTACTSETCACHE_H_
+#define CREATORCONTACTSETCACHE_H_
+
+#include <e32base.h>
+
+// Forward declarations
+class CContactLinkCacheImp;
+
+class CCreatorContactSet : public CBase
+{
+public:
+    static CCreatorContactSet* NewL(TInt aLinkId, TInt aNumOfExistingContacts);
+    virtual ~CCreatorContactSet();
+    TInt LinkId() const;
+
+private:
+    CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts);    
+    //void ConstructL();
+    TInt iLinkId;
+    TInt iNumOfExistingContacts;
+};
+
+class MContactLinkCache
+{
+public:
+    virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
+    virtual RPointerArray<CCreatorContactSet>& ContactSets() = 0;
+    virtual const RPointerArray<CCreatorContactSet>& ContactSets() const = 0;
+    virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const = 0;
+    virtual CCreatorContactSet& ContactSet(TInt aLinkId) = 0;
+};
+
+class ContactLinkCache
+{
+public:
+    static void InitializeL();
+    static void DestroyL();
+    
+    static MContactLinkCache* Instance();
+    
+private:
+    ContactLinkCache(){};
+    static CContactLinkCacheImp* iImp;
+};
+
+#endif /*CREATORCONTACTSETCACHE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_factory.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef TCREATORFACTORY_H_
+#define TCREATORFACTORY_H_
+
+#include "creator_modulebase.h"
+
+class CCreatorEngine;
+class CCreatorPhonebookBase;
+class CCreatorConnectionSettingsBase;
+
+
+class TCreatorFactory{
+
+public: 
+	static CCreatorPhonebookBase* CreatePhoneBookL(CCreatorEngine* aEngine);
+	static CCreatorModuleBaseParameters* CreatePhoneBookParametersL();
+
+    static CCreatorConnectionSettingsBase* CreateConnectionSettingsL(CCreatorEngine* aEngine);
+    static CCreatorModuleBaseParameters* CreateConnectionSettingsParametersL();
+	
+
+};
+
+#endif /*TCREATORFACTORY_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_file.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORFiles_H__
+#define __CREATORFiles_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+#include <caf/caf.h>
+using namespace ContentAccess;
+
+#include <e32base.h>
+#include <bautils.h>
+#include <pathinfo.h>
+#include <apgcli.h> // RApaLsSession
+
+class CCreatorEngine;
+class CFilesParameters;
+class CDRMPermission;
+class CDRMConstraint;
+
+class CCreatorFiles : public CBase, public MCreatorModuleBase
+    {
+public: 
+    static CCreatorFiles* NewL(CCreatorEngine* aEngine);
+    static CCreatorFiles* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorFiles();
+
+private:
+    CCreatorFiles();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    TInt CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand);    
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    
+    void EncryptFileL( const TDesC& aFileName, const TDesC& aOutFileName, CFilesParameters *aParameters );
+    void SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters );
+    void SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters );
+    TBool AskDRMDataFromUserL();
+    TBool AskDRMCDDataFromUserL();
+    void StorePathsForDeleteL( CDesCArray& aPaths );
+    void GenerateFileNameL( TFileName& aRootName );
+    
+private:
+    CFilesParameters* iParameters;
+    CFilesParameters* iUserParameters;
+    HBufC* iDirectoryQueriedFromUser;
+    RFs& iFs;
+    RApaLsSession iApaLs;
+    CDesCArray* iFilePaths;
+    TInt iFileId;
+
+public:
+    };
+
+
+class CFilesParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*          iFullFilePath;
+    TInt            iFileCommand;
+    CDRMPermission* iPermission;
+    TBool           iEncrypt;
+    
+public:
+    CFilesParameters();
+    CFilesParameters( CFilesParameters& aCopy );
+    ~CFilesParameters();
+    };
+
+
+
+#endif // __CREATORFiles_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_fileelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORFILEELEMENT_H_
+#define CREATORFILEELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorfile
+{
+    _LIT(KFile, "file");
+    _LIT(KType, "type");
+    _LIT(KDirectory, "directory");
+    _LIT(KDefaultDir, "c:\\data");
+    _LIT(KEncryption, "encryption");
+    _LIT(KDRMRight, "right");
+    _LIT(KDRMFL, "DRM-FL");
+    _LIT(KDRMCD, "DRM-CD");
+    _LIT(KDRMPlayRight, "play");
+    _LIT(KDRMDisplayRight, "display");
+    _LIT(KDRMPrintRight, "print");
+    _LIT(KDRMExecuteRight, "execute");
+    _LIT(KDRMCount, "count");
+    _LIT(KDRMInterval, "interval");
+    _LIT(KDRMStartTime, "starttime");
+    _LIT(KDRMEndTime, "endtime");
+    _LIT(KDRMAccumulated, "accumulated");
+}
+
+class CDRMConstraint;
+class CFilesParameters;
+
+class CCreatorFileElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorFileElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorFileElement(CCreatorEngine* aEngine);
+    TInt GetFileCommandL( const TDesC& aFileIdStr, TBool aRandom ) const;
+private:
+    void ParseDRMElementsL( CCreatorScriptElement* aField, CFilesParameters* aParam );
+    void ParseDRMConstraintsL( CCreatorScriptElement* aRight, CDRMConstraint* aConstraint );
+    TTimeIntervalSeconds ParseTimeInterval( TDesC& aTimeString );
+private: // Data
+    TInt64 iTimeZone;
+};
+
+#endif // CREATORFILEELEMENT_H_
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_landmark.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef LANDMARKS_H_
+#define LANDMARKS_H_
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+#include <e32base.h>
+#include <epos_landmarks.h>
+
+class CLandmarkParameters;
+class CPosLandmarkDatabase;
+class CPosLmOperation;
+
+static const TInt KLandmarkFieldLength = 256;
+
+class CCreatorLandmarks : public CBase, public MCreatorModuleBase
+    {
+public: 
+    static CCreatorLandmarks* NewL(CCreatorEngine* aEngine);
+    static CCreatorLandmarks* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorLandmarks();
+
+private:
+    CCreatorLandmarks();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase    
+    TPosLmItemId GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID );
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    TInt CreateLandmarkEntryL(CLandmarkParameters *aParameters);
+    static TPosLmGlobalCategory GetCategoryIdL(const TDesC& aCategoryStr);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    CPosLandmarkDatabase* iLandmarkDb;    
+    CLandmarkParameters* iParameters;
+    CPosLmOperation* iLmOperation;
+    RArray<TPosLmItemId> iEntryIds; // TPosLmItemId (==TUint32) CPosLandmark::LandmarkId()
+public:
+    };
+
+
+class CLandmarkParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*              iName;
+    RArray<TUint>       iCategories;
+    HBufC*              iStreet;
+    HBufC*              iCity;    
+    HBufC*              iState;
+    HBufC*              iCountry;
+    HBufC*              iPostCode;    
+    HBufC*              iDescription;
+    HBufC*              iPhonenumber;
+    HBufC*              iUrl;
+    TReal64             iLatitude;
+    TReal64             iLongitude;
+    TReal32             iPositionAccuracy;
+    TReal32             iAltitude;
+    TReal32             iAltitudeAccuracy;
+    
+    void SetRandomNameL(CCreatorEngine& aEngine);
+    void SetRandomUrlL(CCreatorEngine& aEngine);
+    void AddRandomCategoryL(CCreatorEngine& aEngine);
+    void SetRandomStreetL(CCreatorEngine& aEngine);
+    void SetRandomCityL(CCreatorEngine& aEngine);
+    void SetRandomStateL(CCreatorEngine& aEngine);
+    void SetRandomCountryL(CCreatorEngine& aEngine);
+    void SetRandomPostCodeL(CCreatorEngine& aEngine);
+    void SetRandomLatitudeL(CCreatorEngine& aEngine);
+    void SetRandomLongitudeL(CCreatorEngine& aEngine);
+    void SetRandomPositionAccuracyL(CCreatorEngine& aEngine);
+    void SetRandomAltitudeL(CCreatorEngine& aEngine);
+    void SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine);
+    void SetRandomDescriptionL(CCreatorEngine& aEngine);
+    void SetRandomPhoneNumberL(CCreatorEngine& aEngine);
+    
+private:
+    
+public:
+    CLandmarkParameters();
+    ~CLandmarkParameters();
+    };
+#endif /*LANDMARKS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_landmarkelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORLANDMARKELEMENT_H_
+#define CREATORLANDMARKELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorlandmark
+{
+    _LIT(KLandmark, "landmark");
+    _LIT(KName, "name");
+    _LIT(KCategory, "category");
+    _LIT(KDescription, "description");
+    _LIT(KStreet, "street");
+    _LIT(KPostalcode, "postalcode");
+    _LIT(KCity, "city");
+    _LIT(KState, "state");
+    _LIT(KCountry, "country");
+    _LIT(KPhonenumber, "phonenbr");
+    _LIT(KUrl, "url");
+    _LIT(KLatitude, "latitude");
+    _LIT(KLongitude, "longitude");
+    _LIT(KPositionaccuracy, "positionaccuracy");
+    _LIT(KAltitude, "altitude");
+    _LIT(KAltitudeaccuracy, "altitudeaccuracy");
+}
+
+class CCreatorLandmarkElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorLandmarkElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorLandmarkElement(CCreatorEngine* aEngine);
+};
+
+#endif /*CREATORLANDMARKELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_log.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORLOGS_H__
+#define __CREATORLOGS_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+
+#include <e32base.h>
+//#include <logwrap.h>
+#include <logwraplimits.h>
+#include <logcli.h>
+//#include <logeng.h>
+#include <logengdurations.h>
+
+
+
+class CCreatorEngine;
+class CLogsParameters;
+
+
+class CCreatorLogs : public CActive, public MCreatorModuleBase
+    {
+public: 
+    static CCreatorLogs* NewL(CCreatorEngine* aEngine);
+    static CCreatorLogs* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorLogs();
+
+private:
+    CCreatorLogs();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+    void RunL();  // from CActive
+	void DoCancel();  // from CActive
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+
+    TInt CreateMissedCallEntryL(CLogsParameters *aParameters);    
+    TInt CreateReceivedCallEntryL(CLogsParameters *aParameters);
+    TInt CreateDialledNumberEntryL(CLogsParameters *aParameters);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    CLogClient* iLogClient;
+    CLogEvent* iLogEvent;
+    CActiveSchedulerWait iLogWriteWait;
+
+    CLogsParameters* iParameters;
+    RArray<TInt> iEntryIds; // TLogId ( == TInt32) CLogEvent::Id()
+
+public:
+    };
+
+
+class CLogsParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    /*HBufC*              iMissedCallPhoneNumber;
+    TTime               iMissedCallEventTime;
+	
+    HBufC*              iReceivedCallPhoneNumber;
+    TTime               iReceivedCallEventTime;
+    TLogDuration        iReceivedCallDuration;
+
+    HBufC*              iDialledNumberPhoneNumber;
+    TTime               iDialledNumberEventTime;
+    TLogDuration        iDialledNumberDuration;*/
+    HBufC*              iPhoneNumber;
+    TTime               iEventTime;
+    TLogDuration        iDuration;
+
+public:
+    CLogsParameters();
+    ~CLogsParameters();
+    };
+
+
+
+#endif // __CREATORLOGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_logelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORLOGELEMENT_H_
+#define CREATORLOGELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatorlog
+{
+    _LIT(KLog, "log");
+    _LIT(KDirection, "direction");
+    _LIT(KDuration, "duration");
+    _LIT(KPhonenumber, "phonenumber");
+    _LIT(KDatetime, "datetime");
+    _LIT(KMissed, "missed");
+    _LIT(KIn, "in");
+    _LIT(KOut, "out");
+}
+
+class CCreatorLogElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorLogElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorLogElement(CCreatorEngine* aEngine);
+    TInt GetLogCommandL( const TDesC& aFileIdStr, TBool aRandom ) const;
+};
+
+#endif /*CREATORLOGELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_mailbox.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORMAILBOXES_H__
+#define __CREATORMAILBOXES_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+
+#include <e32base.h>
+#include <SenduiMtmUids.h>
+#include <SMTPSET.h>
+#include <imapset.h>
+#include <POP3SET.h>
+#include <mtmuibas.h>
+#include <IAPPrefs.h>
+#include <cemailaccounts.h>
+
+class CCreatorEngine;
+class CMailboxesParameters;
+
+const TInt KDefaultSmtpPort = 25;
+
+enum TMailboxType
+    {
+    EMailboxPOP3,
+    EMailboxIMAP4
+    };
+
+class CCreatorMailboxes : public CBase, public MCreatorModuleBase, public MMsvSessionObserver
+    {
+public: 
+    static CCreatorMailboxes* NewL(CCreatorEngine* aEngine);
+    static CCreatorMailboxes* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorMailboxes();
+
+private:
+    CCreatorMailboxes();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
+    void StoreIMEIToEntryL(const TMsvId aMailboxId);
+    void GetIMEIFromThePhoneL();
+    
+    void PopulateSmtpSettingsL( 
+            CEmailAccounts& aEmailAccount, 
+            CImSmtpSettings& aSmtpSettings, 
+            CImIAPPreferences& aIApSettings, 
+            const CMailboxesParameters& aParameters );
+    
+    void PopulateImapSettingsL( 
+            CEmailAccounts& aEmailAccount, 
+            CImImap4Settings& aImapSettings, 
+            CImIAPPreferences& aIApSettings, 
+            const CMailboxesParameters& aParameters );
+    
+    void PopulatePopSettingsL( 
+            CEmailAccounts& aEmailAccount, 
+            CImPop3Settings& aPopSettings, 
+            CImIAPPreferences& aIApSettings, 
+            const CMailboxesParameters& aParameters );
+
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    TInt CreateMailboxEntryL(CMailboxesParameters *aParameters);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+
+private:
+    CMailboxesParameters* iParameters;
+    TBuf<50> iIMEI;
+    RArray<TInt> iEntryIds;
+
+public:
+    };
+
+
+class CMailboxesParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+//    HBufC*          iMailboxName;
+//    HBufC*          iAccessPoint;
+//    HBufC*          iMyMailAddress;
+//    HBufC*          iOutgoingMailServer;
+//    TBool           iSendMessageImmediately;
+//    TBool           iSendCopyToSelf;
+//    TBool           iIncludeSignature;
+//    HBufC*          iUserName;
+//    HBufC*          iPassword;
+//    HBufC*          iIncomingMailServer;
+//    TMailboxType    iMailboxType;  // IMAP4 or POP3
+//    TBool           iSecurityOn; // SecureSockets
+//    TBool           iSSLWrapper; // SSL Wrapper
+//    TBool           iAPOPSecureLogin; // POP3 only
+//    TBool           iRetrieveAttachment; // IMAP4 only
+//    TInt32          iRetrieveHeaders;  // IMAP4 only
+
+    enum TGetEmailOption
+    {
+    EUndef = 0,
+    EGetHeaders,
+    EGetBodyText,
+    EGetBodyTextAndAttachments,
+    EGetAttachments,
+    EGetBodyAlternativeText,
+    EGetEmailOptionLast
+    };
+
+    HBufC*  iMailboxName;    
+    HBufC*  iIncomingLoginName;
+    HBufC*  iIncomingPassword;
+    HBufC*  iIncomingServerName;
+    HBufC*  iIncomingConnectionMethod;
+    HBufC*  iIncomingFolderPath;
+    HBufC*  iPathSeparator;
+    HBufC*  iOutgoingLoginName;
+    HBufC*  iOutgoingPassword;
+    HBufC*  iOutgoingServerName;
+    HBufC*  iOutgoingConnectionMethod;
+    HBufC*  iOwnEmailAddress;
+    HBufC*  iOwnEmailAlias;
+    HBufC*  iReceiptAddress;
+    HBufC*  iReplyToAddress;
+    
+    TInt    iIncomingPort;
+    TInt    iAttachmentSizeLimit;
+    TInt    iBodyTextSizeLimit;
+    TInt    iAttachmentFetchSize;
+    TInt    iImapIdleTimeout;
+    TInt    iMaxEmailSize;
+    TInt    iSyncRate;
+    TInt    iInboxSyncLimit; // -1 = All
+    TInt    iMailboxSyncLimit; // -1 = All
+    TInt    iOutgoingPort;
+    TInt    iToCCIncludeLimit;
+    
+    TBool   iIncomingSSLWrapper;
+    TBool   iIncomingSecureSockets;
+    TBool   iAcknowledgeReceipts;
+    TBool   iAutoSendOnConnect;
+    TBool   iDeleteEmailsAtDisconnect;
+    TBool   iImapIdleCommand;
+    TBool   iMarkSeenInSync;
+    TBool   iEnableExpungeMode;
+    TBool   iUseApop;
+    TBool   iDisconnectedUserMode;
+    TBool   iOutgoingSSLWrapper;
+    TBool   iOutgoingSecureSockets;
+    TBool   iIncludeSignature;
+    TBool   iAddVCard;
+    TBool   iRequestReceipts;
+    TBool   iSmtpAuth;
+    
+    TGetEmailOption iGetEmailOptions;   
+    TFolderSubscribeType iSubscribeType;    
+    TFolderSyncType iSyncType;  
+    TImSMTPSendCopyToSelf iSendCopyToSelf;
+    TImSMTPSendMessageOption iSendOption;    
+    TMailboxType iMailboxType;  // IMAP4 or POP3
+    
+public:
+    CMailboxesParameters();
+    ~CMailboxesParameters();
+    };
+
+
+
+#endif // __CREATORMAILBOXES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_mailboxelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORMAILBOXELEMENT_H_
+#define CREATORMAILBOXELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatormailbox
+{
+    _LIT(Kmailbox, "mailbox");
+    _LIT(Kname, "name");
+    _LIT(Kincomingport, "incomingport");
+    _LIT(Kincomingsslwrapper, "incomingsslwrapper");
+    _LIT(Kincomingsecuresockets, "incomingsecuresockets");
+    _LIT(Kincomingloginname, "incomingloginname");
+    _LIT(Kincomingpassword, "incomingpassword");
+    _LIT(Kincomingservername, "incomingservername");
+    _LIT(Kincomingconnectionmethod, "incomingconnectionmethod");
+    _LIT(Kacknowledgereceipts, "acknowledgereceipts");
+    _LIT(Kattachmentsizelimit, "attachmentsizelimit");
+    _LIT(Kautosendonconnect, "autosendonconnect");
+    _LIT(Kbodytextsizelimit, "bodytextsizelimit");
+    _LIT(Kdeletemailsatdisconnect, "deletemailsatdisconnect");
+    _LIT(Kattachmentfetchsize, "attachmentfetchsize");
+    _LIT(Kincomingfolderpath, "incomingfolderpath");
+    _LIT(Kpathseparator, "pathseparator");
+    _LIT(Kgetemailoptions, "getemailoptions");
+    _LIT(Kimapidlecommand, "imapidlecommand");
+    _LIT(Kimapidletimeout, "imapidletimeout");
+    _LIT(Kmaxemailsize, "maxemailsize");
+    _LIT(Ksubscribetype, "subscribetype");
+    _LIT(Ksyncrate, "syncrate");
+    _LIT(Kfoldersynctype, "foldersynctype");
+    _LIT(Kmarkseeninsync, "markseeninsync");
+    _LIT(Kenableexpungemode, "enableexpungemode");
+    _LIT(Kuseapopsecurelogin, "useapopsecurelogin");
+    _LIT(Kinboxsynclimit, "inboxsynclimit");
+    _LIT(Kmailboxsynclimit, "mailboxsynclimit");
+    _LIT(Kdisconnectedusermode, "disconnectedusermode");
+    _LIT(Koutgoingport, "outgoingport");
+    _LIT(Koutgoingsslwrapper, "outgoingsslwrapper");
+    _LIT(Koutgoingsecuresockets, "outgoingsecuresockets");
+    _LIT(Koutgoingloginname, "outgoingloginname");
+    _LIT(Koutgoingpassword, "outgoingpassword");
+    _LIT(Koutgoingservername, "outgoingservername");
+    _LIT(Koutgoingconnectionmethod, "outgoingconnectionmethod");
+    _LIT(Kincludesignature, "includesignature");
+    _LIT(Kaddvcard, "addvcard");
+    _LIT(Kownemail, "ownemail");
+    _LIT(Kemailalias, "emailalias");
+    _LIT(Kreceiptaddress, "receiptaddress");
+    _LIT(Kreplytoaddress, "replytoaddress");
+    _LIT(Krequestreceipts, "requestreceipts");
+    _LIT(Ksmtpauth, "smtpauth");
+    _LIT(Kcopytoself, "copytoself");
+    _LIT(Ksendoption, "sendoption");
+    _LIT(Ktoccincludelimit, "toccincludelimit");
+    
+    
+    // Get email options:
+    _LIT(Kgetheaders, "getheaders");
+    _LIT(Kgetbodytext, "getbodytext");
+    _LIT(Kgetbodytextandattachments, "getbodytextandattachments");
+    _LIT(Kgetattachments, "getattachments");
+    _LIT(Kgetbodyalternativetext, "getbodyalternativetext");
+    
+    // Subscribe types:
+    _LIT(Kupdateneither, "updateneither");
+    _LIT(Kupdatelocal, "updatelocal");
+    _LIT(Kupdateremote, "updateremote");
+    _LIT(Kupdateboth, "updateboth");
+    
+    // Folder sync. types:
+    _LIT(Kusecombination, "usecombination");
+    _LIT(Kuselocal, "uselocal");
+    _LIT(Kuseremote, "useremote");
+    
+    // Send copy to self option:
+    _LIT(Kno, "no");
+    _LIT(Kto, "to");
+    _LIT(Kcc, "cc");
+    _LIT(Kbcc, "bcc");
+    
+    // Send option:
+    _LIT(Kimmediately, "immediately");
+    _LIT(Konnextconnection, "onnextconnection");
+    _LIT(Konrequest, "onrequest");
+    
+    // Mailbox types:
+    _LIT(KMailboxType, "type");
+    _LIT(Kpop3, "pop3");
+    _LIT(Kimap4, "imap4");
+    _LIT(Ksyncml, "syncml");
+}
+
+class CCreatorMailboxElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorMailboxElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorMailboxElement(CCreatorEngine* aEngine);
+    TBool SetTextParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
+    TBool SetBooleanParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
+    TBool SetIntegerParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
+    TBool SetEnumParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
+    
+    TBool GetBooleanValueL(const TDesC& aElemContent, TBool aSetRandom);
+};
+
+#endif /*CREATORMAILBOXELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_message.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORMESSAGES_H__
+#define __CREATORMESSAGES_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+#include <e32base.h>
+#include <e32std.h>
+#include <msvapi.h>
+#include <mtclbase.h>
+#include <mtclreg.h>
+#include <smut.h>
+#include <smuthdr.h>
+#include <smsclnt.h>
+#include <miutset.h>
+#include <mmsclient.h>
+#include <ircmtm.h>
+#include <irmsgtypeuid.h>
+#include <btmsgtypeuid.h>
+#include <bif.h>
+#include <biouids.h>
+#include <miuthdr.h>
+
+#include <cmsvmimeheaders.h>
+#include <smtcmtm.h>
+#include <ircmtm.h>
+#include <btcmtm.h>
+#include <mmsvattachmentmanager.h>
+
+
+class CCreatorEngine;
+class CMessagesParameters;
+class CAsyncWaiter; 
+
+enum TMessageType
+    {
+    ESMS = 0,
+    EMMS,
+    EAMS,
+    EEmail,
+    ESmartMessage,
+    EIrMessage,
+    EBTMessage
+    };
+
+enum TFolderType
+    {
+    EInbox = 0,
+    EDrafts,
+    EOutbox,
+    ESent,
+    EMailbox
+    };
+    
+class CRecipientInfo : public CBase
+{
+public:
+    CRecipientInfo();
+    virtual ~CRecipientInfo();
+    
+    void SetPhoneNumber(HBufC* aPhone);
+    void SetEmailAddress(HBufC* aEmail);
+    const HBufC* PhoneNumber() const;
+    const HBufC* EmailAddress() const;
+    
+private:
+    HBufC* iPhoneNumber;
+    HBufC* iEmailAddress;
+};
+
+class CCreatorMessages : public CBase, public MCreatorModuleBase, public MMsvSessionObserver
+    {
+public: 
+    static CCreatorMessages* NewL(CCreatorEngine* aEngine);
+    static CCreatorMessages* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorMessages();
+
+private:
+    CCreatorMessages();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+    TInt CreateSMSEntryL(const CMessagesParameters& parameters);
+    TInt CreateMMSEntryL(const CMessagesParameters& parameters);
+    TInt CreateAMSEntryL(const CMessagesParameters& parameters);
+    TInt CreateEmailEntryL(const CMessagesParameters& parameters);
+    TInt CreateSmartMessageEntryL(const CMessagesParameters& parameters);
+    TInt CreateObexEntryL(TUid aMtm, const CMessagesParameters& parameters);
+    void HandleAttachementsL(const CMessagesParameters& parameters, CMsvStore* store, TInt err );
+    void HandleAttachementL(CMsvStore* store, TInt err, TFileName& sourceFileName );
+
+    CMsvEntrySelection* DoGetListOfAccountsL(CMsvSession& aSession, TUid aMtm, TBool aAlwaysListHidden);
+    TMsvId DefaultServiceForMTML(CMsvSession& aSession, TUid aMtm, TBool aFindFirstServiceIfNoDefault);
+
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
+    
+    void AddRecipientsL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
+    void GetLinkedAddressesL(   RPointerArray<HBufC>& aAddressArray, 
+                                const RArray<TLinkIdParam>& aLinkIds, 
+                                TBool aUseEmailAddress,
+                                TInt aNumOfExistingAddresses );
+    
+    void GetAllRecipientsL(RPointerArray<HBufC>& aRecipientArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
+    void SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
+    void SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
+    void AddSenderToMtmAddresseeL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
+    void AddMtmSenderL(CMmsClientMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
+    void GetSendersL(RPointerArray<HBufC>& aSenderArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress, TInt aMaxNum );
+    void DeleteAllMessagesL( TBool aOnlyCreatedWithCreator );
+    void DeleteAllFromFolderL( const TMsvId aContext, CMsvSession* aSession, CSmsClientMtm* aClientMtm, TBool aOnlyCreatedWithCreator = EFalse );
+    
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+
+    TInt CreateMessageEntryL(CMessagesParameters *aParameters, TBool aTakeUserGivenParameters=EFalse);    
+    TInt CreateRandomMessageEntryL(TInt aCommand);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    CMessagesParameters*    iParameters;
+    TMessageType            iMessageType;
+    TFolderType             iFolderType;
+    TInt                    iDefinedMessageLength;
+    CArrayFixFlat<TInt>*    iAttachments; 
+    //RPointerArray<HBufC>    iAttachmentPaths;
+    TBool                   iCreateAsUnread;
+    TMsvId                  iUserSelectedMailbox;
+    HBufC*                  iTmpPhoneNumber;
+    HBufC*                  iTmpEmail;
+    RArray<TInt>            iEntryIds; // TMsvId ( == TInt32 ) TMsvEntry::Id()
+    CAsyncWaiter* iWaiter;
+    RPointerArray<HBufC>    iSenderArray;
+    RPointerArray<HBufC>    iRecipientArray;
+public:
+    };
+
+
+class CMessagesParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    TMessageType            iMessageType;
+    TFolderType             iFolderType;
+    HBufC*                  iSenderAddress;    
+    HBufC*                  iRecipientAddress;
+    RPointerArray<HBufC>    iRecipientAddressArray;
+    HBufC*                  iMessageSubject;
+    HBufC*                  iMessageBodyText;
+    CArrayFixFlat<TInt>*    iAttachments; 
+    RPointerArray<HBufC>    iAttachmentPaths;
+    TInt                    iDefinedMessageLength;
+    TUid                    iBIOMessageType;
+    TBool                   iCreateAsUnread;
+    RArray<TLinkIdParam>    iRecipientLinkIds;
+    RArray<TLinkIdParam>    iSenderLinkIds;
+    TInt                    iNumberOfExistingRecipients;
+    TInt                    iNumberOfExistingSenders;
+
+public:
+    CMessagesParameters();
+    ~CMessagesParameters();
+    };
+
+
+
+#endif // __CREATORMESSAGES_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_messageelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef CREATORMESSAGEELEMENT_H_
+#define CREATORMESSAGEELEMENT_H_
+
+#include "creator_scriptelement.h"
+#include "creator_message.h"
+
+namespace creatormsg
+{
+    _LIT(KMessage, "message");
+    _LIT(KType, "type");
+    _LIT(KTo, "to");
+    _LIT(KFrom, "from");
+    _LIT(KFolder, "folder");
+    _LIT(KSubject, "subject");
+    _LIT(KText, "text");
+    _LIT(KAttachmentPath, "attachmentpath");
+    _LIT(KAttachmentId, "attachmentid");
+    _LIT(KStatus, "status");
+    _LIT(KSms, "sms");
+    _LIT(KMms, "mms");
+    _LIT(KAms, "ams");
+    _LIT(KEmail, "email");
+    _LIT(KSmart, "smart");
+    _LIT(KBt, "bt");
+    _LIT(KIr, "ir");
+    _LIT(KSent, "sent");
+    _LIT(KInbox, "inbox");
+    _LIT(KDraft, "draft");
+    _LIT(KOutbox, "outbox");
+    _LIT(KMailbox, "mailbox");
+    _LIT(KRead, "read");
+    _LIT(KNew, "new");
+}
+
+/*
+ * Builds message parameters from the parsed script and adds a command to the engine 
+ */
+class CCreatorMessageElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorMessageElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+protected:    
+    CCreatorMessageElement(CCreatorEngine* aEngine);
+    /*
+     * Creates message address. The address type is based on the message type.
+     * @return Phone number string for SMS, MMS, AMS and Smart messages. Email address for other types.
+     * @param msgType Message type.
+     */
+    HBufC* CreateMessageAddressLC(const TDesC& msgType);
+    /*
+     * Sets message type to parameters
+     * @param aParameters Message parameters
+     * @param aMsgTypeStr Message type string
+     */
+    void SetMessageTypeL(CMessagesParameters& aParameters, const TDesC& aMsgTypeStr ) const;
+    /*
+     * Gets length of the random data
+     * @return Length of the random data
+     * @param aRandomLenStr String defining the random length (from the script)
+     * @param aMsgType Message type string
+     */
+    TInt GetRandomBodyLengthL(const TDesC& aRandomLenStr, const TDesC& aMsgType ) const;
+    /*
+     * Gets maximum length of the body text
+     * @return Maximum length of the body text
+     * @param aMsgType Message type string
+     */
+    TInt GetMaxBodyLength( const TDesC& aMsgType ) const;
+
+};
+    
+
+#endif /*CREATORMESSAGEELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_modulebase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CREATOR_MODULEBASE_H__
+#define __CREATOR_MODULEBASE_H__
+
+#include <e32base.h>
+
+// Dictionary uids for each Creator module.
+// Dictionaries are for storing item identifiers created by Creator.
+// Item identifiers are for enabling deletion of only items created by Creator. 
+const TUid KUidDictionaryUidContacts         = { 0x00 };
+const TUid KUidDictionaryUidContactGroups    = { 0x01 };
+const TUid KUidDictionaryUidCalendar         = { 0x02 };
+const TUid KUidDictionaryUidBrowserBookmarks = { 0x03 };
+const TUid KUidDictionaryUidFiles            = { 0x04 };
+const TUid KUidDictionaryUidLogs             = { 0x05 };
+const TUid KUidDictionaryUidMessages         = { 0x06 };
+const TUid KUidDictionaryUidMailbox          = { 0x07 };
+const TUid KUidDictionaryUidIAP              = { 0x08 };
+const TUid KUidDictionaryUidIMPS             = { 0x09 };
+const TUid KUidDictionaryUidNotes            = { 0x0A };
+const TUid KUidDictionaryUidLandmarks        = { 0x0B };
+const TUid KUidDictionaryUidBrowserSavedPg   = { 0x0C };
+const TUid KUidDictionaryUidBrowserBookmarkF = { 0x0D };
+const TUid KUidDictionaryUidBrowserSavedPgF  = { 0x0E };
+
+class CCreatorEngine;
+class MCreatorModuleBaseParameters;
+class CCommandParser;
+
+class MCreatorModuleBase
+    {
+public:
+
+private:
+    // constructs the module, add "iEngine = aEngine" and other construction stuff to the body
+    virtual void ConstructL(CCreatorEngine* aEngine) = 0;
+
+public:
+    // this one is called when user select some features directly from menu, not running a script
+    // should call CreateRandomData() function
+    // returns ETrue when success, EFalse when user has cancelled
+    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries) = 0;
+    virtual void DeleteAllL() = 0;
+    virtual void DeleteAllCreatedByCreatorL() = 0;
+
+public:
+    CCreatorEngine* iEngine;
+
+private:
+
+    };
+
+
+class MCreatorModuleBaseParameters
+    {
+    // a base class for the parameters, no default implementation
+    
+    public:
+    	enum TParseParams
+    	{
+    	EParamNone = 0,
+    	ECalendarMeeting,
+    	ECalendarMemo,
+    	ECalendarAnniv,
+    	ECalendarTodo
+    	};
+    
+public:
+	virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/) = 0;
+
+	
+    };
+    
+// Following struct represents the parameters that links for example contact groups
+// to contac-sets.
+typedef struct 
+    {
+    TInt iLinkId; // ID
+    TInt iLinkAmount; // Amount of elements in linked set 
+    } TLinkIdParam;
+
+        
+class CCreatorModuleBaseParameters : public CBase, public MCreatorModuleBaseParameters
+        {
+        public:
+        virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/){};
+        virtual TInt ScriptLinkId() const {return -1;};
+        virtual void SetScriptLinkId(TInt) {};
+        // a base class for the parameters, no default implementation
+        };
+        
+
+
+
+#endif  // __CREATOR_MODULEBASE_H__
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_note.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORNOTEPAD_H__
+#define __CREATORNOTEPAD_H__
+
+#include "engine.h"
+#include "creator_modulebase.h"
+
+
+#include <e32base.h>
+//#include <npdapi.h>
+#include <NotesEditor>
+#include <AgendaUtil>
+#include <AgendaEntry>
+
+
+static const TInt KNotepadFieldLength = 1024;
+
+class CCreatorEngine;
+class CNotepadParameters;
+
+
+class CCreatorNotepad : public CBase, public MCreatorModuleBase
+    {
+public: 
+    static CCreatorNotepad* NewL(CCreatorEngine* aEngine);
+    static CCreatorNotepad* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorNotepad();
+
+private:
+    CCreatorNotepad();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+public:
+    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+    TInt CreateNoteEntryL(CNotepadParameters *aParameters);
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+
+private:
+    AgendaUtil *iAgendaUtil;
+    NotesEditor *iNotepadApi;	//QT Notes api 
+    //CNotepadApi *iNotepadApi;
+
+    CNotepadParameters* iParameters;
+    RFs& iFs;
+
+public:
+    };
+
+
+class CNotepadParameters : public CCreatorModuleBaseParameters
+    {
+public: 
+    HBufC*              iNoteText;
+
+public:
+    CNotepadParameters();
+    ~CNotepadParameters();
+    };
+
+
+
+#endif // __CREATORNOTEPAD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_noteelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef CREATORNOTEELEMENT_H_
+#define CREATORNOTEELEMENT_H_
+
+#include "creator_scriptelement.h"
+
+namespace creatornote
+{
+    _LIT(KNote, "note");
+    _LIT(KText, "text");
+}
+
+class CCreatorNoteElement : public CCreatorScriptElement
+{
+public:
+    static CCreatorNoteElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+    void ExecuteCommandL();
+    
+protected:
+    CCreatorNoteElement(CCreatorEngine* aEngine);
+};
+
+#endif /*CREATORNOTEELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_phonebook.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORPHONEBOOK_H__
+#define __CREATORPHONEBOOK_H__
+
+#include "engine.h"
+#include "creator_phonebookbase.h"
+#include "creator_randomdatafield.h"
+
+
+//#include <qmobilityglobal.h> //defines Q_SFW_EXPORT
+//#include <xqservicerequest.h>
+
+#include <QString>
+#include <qglobal.h>
+#include <QTime>
+#include <qtcontacts.h>
+//#include <qcontactmanager.h>
+//#include <qcontactname.h>
+//#include <qcontactid.h>
+//#include <qcontactphonenumber.h>
+//#include <qcontacturl.h>
+//#include <qcontactemailaddress.h>
+//#include <qcontact.h>
+
+//#include <e32base.h>
+//#include <cntdef.h>
+//#include <cntdb.h>
+//#include <cntitem.h>
+//#include <cntfldst.h>
+//#include <cntview.h>
+//#include <cvpbkcontactmanager.h>
+//#include <pbkfields.hrh>
+//#include <cpbk2imagemanager.h>
+//#include <mvpbkcontactstorelistobserver.h>
+//#include <mvpbkbatchoperationobserver.h>
+//#include <mvpbkcontactfindobserver.h>
+//#include <mvpbkcontactobserver.h>
+//#include <mpbk2imageoperationobservers.h>
+//#include <vpbkeng.rsg>
+//#include <cvpbkcontactlinkarray.h>
+//#include <MVPbkContactViewObserver.h>
+QTM_USE_NAMESPACE
+
+class CCreatorEngine;
+class CCreatorModuleBaseParameters;
+
+//class QContactManager;
+//class QContact;
+//class QContactId;
+//class QContactData;
+//class QContactName;
+
+//class MVPbkStoreContact;  //to change
+//class MVPbkContactStore;	//to change
+//class CAsyncWaiter;			//to change - remove
+class CContactDatabase;	
+//class MVPbkContactLinkArray;	//to change
+class CPhonebookParameters;	
+
+
+class CCreatorPhonebook : public CCreatorPhonebookBase 
+    {
+public: 
+    static CCreatorPhonebook* NewL(CCreatorEngine* aEngine);
+    static CCreatorPhonebook* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorPhonebook();
+
+private:
+    CCreatorPhonebook();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+public:  
+    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries);
+    TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters);    
+    TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters);
+    TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters); 
+
+    
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+    void DeleteAllGroupsL();
+    void DeleteAllGroupsCreatedByCreatorL();
+    
+private:
+    
+    void InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/);
+    TBool IsContactGroupL(/*const MVPbkContactLink& aLink*/);																								//modify
+    void StoreLinksForDeleteL( RArray<TUint32>& aLinks, TUid aStoreUid );														//modify
+    void DeleteContactsL( QList<QContactLocalId>& contacts /*MVPbkContactLinkArray* aContacts, TBool aGroup*/ );																//modify
+    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
+    void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
+    TBool HasOtherThanGroupsL( /*MVPbkContactLinkArray* aContacts */);																			//modify
+    
+    QContactDetail CreateContactDetail(QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand );
+
+private:
+	
+    QContactManager* iContactMngr;//CVPbkContactManager* iContactManager;
+    TInt iOpCounter;
+    
+    CPhonebookParameters* iParameters;
+    
+    static QString iPhoneNumberFields[];
+    static TInt iUrlFields[];
+    static TInt iEmailFields[];
+    TBool iAddAllFields;
+    //QList<QContactLocalId> 
+    RArray<TUint32> iContactLinkArray;//CVPbkContactLinkArray* iContactLinkArray;	//modify
+    RArray<TUint32>  iContactsToDelete;	//CVPbkContactLinkArray* iContactsToDelete;	//modify
+    RArray<TUint32>  iContactGroupsToDelete;	//CVPbkContactLinkArray* iContactGroupsToDelete;	//modify
+    
+    RArray<TUint32> iPreviousDeleteLinks;
+    //RPointerArray<MVPbkContactLinkArray> iPreviousDeleteLinks;  //modify
+    
+private:
+	//new variables
+	/// Ref: the target of the copy
+	QContact* iStore;     //MVPbkContactStore* iStore;  
+    
+    //CAsyncWaiter* iWaiter;	//remove
+    
+    /// Own: Contact database for this store
+    CContactDatabase* iContactDb;    
+    
+    //Contacts found in contacts db.
+    QList<QContactId>* iContactResults;//MVPbkContactLinkArray* iContactResults;
+    // Contact groups that are found in the store. These are used in filtering
+    // the groups from the find results.
+    QList<QContactId>* iContactGroupsInStore;//MVPbkContactLinkArray* iContactGroupsInStore;
+    
+    };
+
+/**
+ * Virtual phonebook parameters
+ */
+    
+
+class CPhonebookParameters : public CCreatorModuleBaseParameters
+    {
+public:
+	void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
+	
+	TInt CPhonebookParameters::ScriptLinkId() const;
+	void CPhonebookParameters::SetScriptLinkId(TInt aLinkId);
+
+	QList<QContactDetail> iContactFields;//	RPointerArray<CCreatorContactField> iContactFields;
+
+    QString iGroupName;//HBufC*  iGroupName;
+    TInt    iContactsInGroup;
+    TInt iNumberOfPhoneNumberFields;
+    TInt iNumberOfURLFields;
+    TInt iNumberOfEmailAddressFields;
+    TInt iContactSetPtr;
+    RArray<TLinkIdParam> iLinkIds; //QList<QContactId> iLinkIds;// For contactgroup. Stores the linked contact ids.
+    
+public:
+    CPhonebookParameters();
+    ~CPhonebookParameters();
+    
+private:
+    TInt iLinkId; // For contact. Stores the contact id
+    };
+
+
+
+#endif // __CREATORPHONEBOOK_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_phonebookbase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CCREATORPHONEBOOKBASE_H_
+#define __CCREATORPHONEBOOKBASE_H_
+
+#include "creator_modulebase.h"
+
+static const TInt KPhonebookFieldLength = 128;
+static const TInt KCreateRandomAmountOfGroups = -9999;
+
+class CCreatorModuleBaseParameters;
+
+class CCreatorPhonebookBase : public CBase, public MCreatorModuleBase{
+public:
+
+    virtual TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;    
+    virtual TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+    virtual TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
+    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
+//    virtual TBool IsActive() = 0;
+//    virtual void CancelOperation() = 0;
+    virtual void DeleteAllGroupsL() = 0;
+    virtual void DeleteAllGroupsCreatedByCreatorL() = 0;
+    
+protected:
+
+    virtual void SetDefaultParameters();    
+    TInt iNumberOfPhoneNumberFields;
+    TInt iNumberOfURLFields;
+    TInt iNumberOfEmailAddressFields;
+    TInt iContactsInGroup;    
+    TBool iDefaultFieldsSelected;
+};
+
+
+#endif /*__CCREATORPHONEBOOKBASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_randomdatafield.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORDATAFIELD_H_
+#define CREATORDATAFIELD_H_
+
+#include <e32base.h>
+
+class MCreatorRandomDataField
+{
+public:
+    enum TRandomLengthType
+    {
+    ERandomLengthUndefined,
+    ERandomLengthDefault, // Default length (use data from engine)
+    ERandomLengthMax,     // Maximum length
+    ERandomLengthExplicit // Explicitly defined length
+    };
+    
+    /**
+     * Set field content to random.     
+     * @param aRandomLenType Random length type
+     * @param aExplicitRandomLen Random length when ERandomLengthExplicit is used. Ignored otherwise.
+     */
+    virtual void SetRandomParametersL( TRandomLengthType aRandomLenType, TInt aRandomLen ) = 0;
+};
+
+#endif /*CREATORDATAFIELD_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_randomdataparser.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORRANDOMDATAPARSER_H_
+#define CREATORRANDOMDATAPARSER_H_
+
+#include <e32base.h>
+#include <badesca.h>
+#include <xml/contenthandler.h>
+#include <xml/parser.h>
+
+//using namespace Xml;
+
+class CCreatorRandomDataParser : public CBase, public Xml::MContentHandler
+	{
+
+public:
+    enum TRandomDataType
+    	{
+    	EFirstName,
+    	ESurname,
+    	ECompany,
+    	EAddress,
+    	EJobTitle,
+    	EPhoneNumber,
+    	EGroupName,
+    	EMeetingReason,
+    	EMeetingPlace,
+    	EMemoText,
+    	EAnniversaryReason,
+    	EToDoText,
+    	EReminderText,
+    	EMessageSubject,
+    	EMessageText,
+    	ECity,
+    	ECountry,
+    	EPostcode,
+    	EState,
+    	EPobox,
+    	EPrefix,
+    	ESuffix,
+    	ELandmarkName,
+    	ELandmarkDescription
+    	};
+
+public:
+
+    virtual ~CCreatorRandomDataParser();
+    static CCreatorRandomDataParser* NewL();
+    static CCreatorRandomDataParser* NewLC();    
+    CDesCArrayFlat* ParseL(const TDesC& aFileName, const TRandomDataType aDataType);
+    
+    TInt GetError() const;
+    
+private:
+
+    CCreatorRandomDataParser();
+    void ConstructL();
+    
+    /**
+     * Converts 8 bit descriptor to 16 bit descriptor
+     * @param aDes 8 bit descriptor to be converted
+     * @return Pointer to the new 16 bit descriptor     
+     */
+    HBufC* Convert8BitTo16BitLC(const TDesC8& aInput);
+    void GetTextFileMode(RFile& aFile, TInt& aFileSize);
+
+    
+public:
+    // From MContentHandler:    
+    void OnStartDocumentL(const Xml::RDocumentParameters &aDocParam, TInt aErrorCode);
+    void OnEndDocumentL(TInt aErrorCode);
+    void OnStartElementL(const Xml::RTagInfo& aElement, 
+                         const Xml::RAttributeArray& aAttributes, 
+                         TInt aErrorCode);
+    void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode);
+    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnStartPrefixMappingL(const RString& aPrefix, 
+                               const RString& aUri, 
+                               TInt aErrorCode);
+    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+    void OnProcessingInstructionL(const TDesC8& aTarget, 
+                                  const TDesC8& aData, 
+                                  TInt aErrorCode);
+    void OnError(TInt aErrorCode);
+    TAny* GetExtendedInterface(const TInt32 aUid);
+    
+private:
+	TRandomDataType iDataType;
+	CDesCArray* iElementNameArray;
+	HBufC* iContentData;
+	TBool iInsideRootElement;
+	TBool iContentParsingActive;
+
+	CDesCArrayFlat* iResultArray;
+	
+    enum TFileFormat
+        {
+        EFormatANSIASCII,
+        EFormatUTF8,
+        EFormatUTF16LE,
+        EFormatUTF16BE
+        };
+    
+    // XML parser
+    Xml::CParser* iParser;
+    
+    TFileFormat iScriptTextFormat;
+    TInt iLastError;
+};
+
+#endif /*CREATORRANDOMDATAPARSER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_scriptelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORSCRIPTELEMENT_H_
+#define CREATORSCRIPTELEMENT_H_
+
+#include "creator_randomdatafield.h"
+#include "creator_modulebase.h"
+#include "engine.h"
+#include <e32base.h>
+
+class CCreatorScriptElement;
+class CCreatorEngine;
+
+_LIT(KEmpty, "");
+_LIT(KContextSep, "::");
+
+// Common attributes:
+_LIT(KAmount, "amount");
+_LIT(KRandomLength, "randomlength");
+_LIT(KId, "id");
+_LIT(KMaxAmount, "maxamount");
+
+// Common element names:
+_LIT(KScript, "creatorscript");
+_LIT(KFields, "fields");
+_LIT(KContactSetRef, "contact-set-reference");
+_LIT(KExistingContacts, "numberofexistingcontacts");
+
+// Common attribute values:
+_LIT(KMax, "max");
+_LIT(KDefault, "default");
+_LIT(KIncrease, "incvalueforeachcopy");
+
+class CCreatorScriptElementCache : public CBase
+{
+public:
+    static CCreatorScriptElementCache* CCreatorScriptElementCache::NewL();
+    virtual ~CCreatorScriptElementCache();    
+        
+    void RemoveElements();    
+    void AddElementL(CCreatorScriptElement* aElement);
+private:
+    CCreatorScriptElementCache();
+    void ConstructL();
+    RPointerArray<CCreatorScriptElement> iElementCache;
+
+};
+
+
+class CCreatorScriptAttribute : public CBase
+{
+public:
+    static CCreatorScriptAttribute* NewL(const TDesC& aName, const TDesC& aValue);
+    static CCreatorScriptAttribute* NewLC(const TDesC& aName, const TDesC& aValue);
+    virtual ~CCreatorScriptAttribute();    
+    
+    TPtrC Name() const;
+    void SetNameL(const TDesC& aName);      
+    TPtrC Value() const;
+    void SetValueL(const TDesC& aValue);
+    
+protected:
+
+    CCreatorScriptAttribute();
+    virtual void ConstructL(const TDesC& aName, const TDesC& aValue);
+    
+private:
+    HBufC* iName;
+    HBufC* iValue;    
+};
+
+/**
+ * Base class for all elements
+ */
+class CCreatorScriptElement : public CBase
+{
+public:
+
+    static CCreatorScriptElement* CCreatorScriptElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+
+    /**
+     * Destructor
+     */
+    virtual ~CCreatorScriptElement();
+    
+    /**
+     * Returns the array of sub-elements.
+     * @return Reference to the sub-element array.
+     */
+    virtual RPointerArray<CCreatorScriptElement> const& SubElements() const;
+    virtual RPointerArray<CCreatorScriptElement>& SubElements();
+    
+    /**
+     * Returns a sub-element.
+     * @param aIndex Sub-element array index.
+     * @return Pointer to a sub-element
+     */ 
+    virtual CCreatorScriptElement* SubElement(TInt aIndex);
+    
+    /**
+     * Finds a sub-element by a name.
+     * @param aName Name of the sub-element
+     * @return Pointer to the first matching sub-element. NULL if not found.
+     */
+    virtual CCreatorScriptElement* FindSubElement(const TDesC& aName);
+    
+    /**
+     * Removes all sub-elements.
+     */
+    virtual void RemoveSubElements();
+    
+    /**
+     * Removes a sub-element
+     * @param aIndex Index of the element to be removed
+     */
+    virtual void RemoveSubElementL(TInt aIndex);
+    
+    /**
+     * Adds an element to the sub-element list. 
+     * Leaves with error KErrNotSupported, if sub-element is illegal.
+     * Leaves with error KErrArgument, if the index in out of bounds.
+     * @param aElem Pointer to the element to be added. Takes ownership of the pointer.
+     * @param aIndex Sub-element array index where to add the element. -1 means that
+     * the element is added to the end of the array.
+     */
+    virtual void AddSubElementL(CCreatorScriptElement* aElem, TInt aIndex = -1);
+  
+    /**
+     * Returns the array of attributes.
+     * @return Reference to the attribute array.
+     */
+    virtual RPointerArray<CCreatorScriptAttribute> const& Attributes() const;
+        
+    /**
+     * Returns an attribute.
+     * @param aIndex Attribute array index.
+     * @return Pointer to a attribute
+     */ 
+    virtual CCreatorScriptAttribute* Attribute(TInt aIndex);
+    
+    /**
+     * Removes all attributes.
+     */
+    virtual void RemoveAttributes();
+    
+    /**
+     * Removes an attribute
+     * @param aIndex Index of the attribute to be removed
+     */
+    virtual void RemoveAttributeL(TInt aIndex);
+    
+    /**
+     * Adds an attribute to the attribute list. 
+     * Leaves with error KErrNotSupported, if attribute is illegal.
+     * @param aAttribute Pointer to the element to be added. Takes ownership of the pointer.
+     * @param aIndex Attribute array index where to add the attribute. -1 means that
+     * the attribute is added to the end of the array.
+     */
+    virtual void AddAttributeL(CCreatorScriptAttribute* aAttribute, TInt aIndex = -1);
+    
+    /**
+     * Finds attribute with the given name. First match is returned.
+     */
+    virtual const CCreatorScriptAttribute* FindAttributeByName(const TDesC& aName) const;
+    virtual CCreatorScriptAttribute* FindAttributeByName(const TDesC& aName);
+
+    /**
+     * Returns element name
+     * @return Element name
+     */
+    virtual TPtrC Name() const;
+    
+    /**
+     * Sets the element name.
+     * @param aName Element name
+     */
+    virtual void SetNameL(const TDesC& aName);
+    
+    /**
+     * Returns element content
+     * @return Element content
+     */
+    virtual TPtrC Content() const;
+    
+    /**
+     * Set the content of the element.
+     * @param aContenct Element content
+     */
+    virtual void SetContentL(const TDesC& aContent);
+    virtual void AppendContentL(const TDesC& aContent);
+    
+    /**
+     * Returns element context
+     * @return Element context
+     */
+    virtual TPtrC Context() const;
+        
+    /**
+     * Set the context of the element.
+     * @param aContenct Element context
+     */
+    virtual void SetContextL(const TDesC& aContext);
+    
+    /**
+     * Tells whether the element should be cached for future use.
+     * @return ETrue if the element should be cached for future use, EFalse otherwise.
+     */
+    virtual TBool IsCacheNeeded();
+    virtual void AddToCacheL(CCreatorScriptElementCache& aCache);
+    virtual void AddToCacheL();
+    virtual TBool IsCommandElement() const;
+    virtual void ExecuteCommandL();
+    //virtual void SaveCommandResultsL();
+    //virtual void DiscardCommandResultsL();
+    virtual TBool IsRoot() const;
+    virtual RPointerArray<CCreatorModuleBaseParameters>& CommandParameters();
+    virtual const RPointerArray<CCreatorModuleBaseParameters>& CommandParameters() const;
+    
+protected:
+
+    /**
+     * Constructors. 
+     */    
+    CCreatorScriptElement(CCreatorEngine* aEngine = 0);
+    
+    /**
+     * @param aName Name of the element.
+     */
+    virtual void ConstructL(const TDesC& aName, const TDesC& aContext = KNullDesC);
+    
+    /**
+     * Tells whethet the sub-element is allowed or not.
+     * @param aElem Sub-element to be tested.
+     * @return Boolean value telling whether the sub-element is allowed 
+     * to be added or not.
+     */
+    virtual TBool IsSubElementSupported(const CCreatorScriptElement& aElem) const;
+    
+    virtual MCreatorRandomDataField::TRandomLengthType ResolveRandomDataTypeL(const CCreatorScriptAttribute& aAttr, TInt& aRandomLen ) const;
+    
+    virtual TBool ConvertStrToBooleanL(const TDesC& aStr) const;
+    virtual TInt ConvertStrToIntL(const TDesC& aStr) const;
+    virtual TUint ConvertStrToUintL(const TDesC& aStr) const;
+    virtual void ConvertStrToReal64L(const TDesC& aStr, TReal64& aVal) const;
+    virtual void ConvertStrToReal32L(const TDesC& aStr, TReal32& aVal) const;
+    
+    virtual void AppendContactSetReferenceL(const CCreatorScriptElement& aContactSetRefElem, RArray<TLinkIdParam>& aLinkArray ) const;    
+    
+    virtual void SetContentToTextParamL(HBufC*& aPtr, const TDesC& aContent );
+    
+    virtual TTime ConvertToDateTimeL(const TDesC& aDtStr) const;
+    
+    virtual TInt CompareIgnoreCase(const TDesC& aStr1, const TDesC& aStr2 ) const;
+    
+    /**
+     * Increases phonenumber by aDelta.
+     * 
+     * Special cases, that are handled:
+     * +9          -> +9, +10, +11...
+     * +3584098#99 -> +3584098#99, +3584098#100, +3584098#101...
+     * #           -> #0, #1, #2...
+     * 123#        -> 123#0, 123#1, 123#2...
+     * 099         -> 099, 100, 101...
+     * 
+     * @param aOriginal original phonenumber
+     * @param aDelta number to be added to original number. Must be >= 0.
+     * @param aIncreased on return contains the increased number.
+     *        The buffer must be allocated by the caller.
+     */
+    void IncreasePhoneNumL( const TDesC& aOriginal, TInt aDelta, HBufC* aIncreased ) const;
+    
+protected:
+    
+    // Sub-element array
+    RPointerArray<CCreatorScriptElement> iSubElements;
+    // Attribute array
+    RPointerArray<CCreatorScriptAttribute> iAttributes;
+    // Element name (e.g. "contact")
+    HBufC* iName;
+    // Element content
+    HBufC* iContent;
+    // Context
+    HBufC* iContext;
+    
+    TBool iIsCommandElement;
+    TBool iIsRoot;
+    CCreatorEngine* iEngine;
+    RPointerArray<CCreatorModuleBaseParameters> iParameters;
+};
+
+/**
+ * Script element
+ */
+class CCreatorScriptRoot : public CCreatorScriptElement
+{
+public:
+    static CCreatorScriptRoot* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+protected:
+    CCreatorScriptRoot(CCreatorEngine* aEngine);
+};
+
+/**
+ * Calendar elements
+ */
+
+/**
+ * Base class for calendar elements
+ */
+class CCreatorCalendarElementBase : public CCreatorScriptElement
+{
+public:
+    static CCreatorCalendarElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+protected:
+    CCreatorCalendarElementBase(CCreatorEngine* aEngine);
+};
+
+/**
+ * Message elements
+ */
+
+/**
+ * Base class for message elements
+ */
+class CCreatorMessageElementBase : public CCreatorScriptElement
+{
+public:
+    static CCreatorMessageElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
+protected:
+    CCreatorMessageElementBase(CCreatorEngine* aEngine);
+};
+
+#endif /*CREATORSCRIPTELEMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_scriptelementfactory.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORSCRIPTELEMENTFACTORY_H_
+#define CREATORSCRIPTELEMENTFACTORY_H_
+
+#include "creator_scriptelement.h"
+
+/**
+ * Creates script element instance based on the element name and context.
+ */
+class TCreatorScriptElementFactory
+{
+public:
+    static CCreatorScriptElement* CreateElementL(CCreatorEngine* aEngine, const TDesC& aElementName, const TDesC& aContext = KNullDesC);
+};
+
+#endif /*CREATORSCRIPTELEMENTFACTORY_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_scriptentry.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __FILEUTILS_H__
+#define __FILEUTILS_H__
+
+
+#include "engine.h"
+
+#include <e32base.h>
+#include <f32file.h>
+#include <badesca.h>
+#include <aknglobalnote.h>
+#include <akniconarray.h> 
+#include <aknmemorycardui.mbg>
+#include <msvapi.h>
+
+
+class CCreatorEngine;
+
+class CreatorFileUtils
+{
+public:
+    static TInt FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
+    static TInt FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
+};
+
+class CCommandParser : public CBase, public MMsvSessionObserver
+    {
+public:
+    static CCommandParser* NewL(CCreatorEngine* aEngine);
+    static CCommandParser* NewLC(CCreatorEngine* aEngine);
+    ~CCommandParser();
+    
+    void StrParserL(HBufC*& aDestinationBuf, TUint aToken);
+    void StrParserL(HBufC8*& aDestinationBuf, TUint aToken);
+
+private:
+    CCommandParser();
+    void ConstructL(CCreatorEngine* aEngine);
+
+    TInt FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
+    TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
+    TInt ReadLineFromFileL(RFile& aInputFile);    
+    //void ParseCommandFromDescriptorL();
+
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
+
+public:
+    void OpenScriptL();
+    TBool OpenScriptL(RFile& aScriptFile);
+    TBool GetRandomDataFilenameL(TDes& aFilename);
+
+private:
+    CCreatorEngine* iEngine;
+    CDesCArrayFlat* iSearchArray;
+
+    TInt iParserPosition;
+    TInt iParserOldPosition;
+
+    HBufC8* iReadBuf;
+
+    };
+
+
+
+#endif // __FILEUTILS_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_scriptparser.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORSCRIPTPARSER_H_
+#define CREATORSCRIPTPARSER_H_
+
+#include <e32base.h>
+#include <xml/contenthandler.h>
+#include <xml/parser.h>
+
+using namespace Xml;
+
+class CCreatorScriptElement;
+class CCreatorEngine;
+class CCreatorScriptElementCache;
+
+class TCreatorScriptElementInfo
+{
+public:
+    enum TElementStatus
+    {
+    EStatusUndefined,   // undefined
+    EStatusParsing,     // currently being parsed
+    EStatusParsed       // parsed
+    };
+    TCreatorScriptElementInfo()
+        {
+        iStatus = EStatusUndefined;
+        iElement = 0;
+        }
+    TCreatorScriptElementInfo(TElementStatus aStatus, CCreatorScriptElement* aElement)
+        {
+        iStatus = aStatus;
+        iElement = aElement;
+        };
+    
+    TElementStatus iStatus;    
+    CCreatorScriptElement* iElement;
+};
+
+class CCreatorScriptParser : public CBase, public MContentHandler
+{
+public:
+
+    virtual ~CCreatorScriptParser();
+    static CCreatorScriptParser* NewL(CCreatorEngine* aEngine);
+    static CCreatorScriptParser* NewLC(CCreatorEngine* aEngine);    
+    void ParseL(const TDesC& aFileName);
+    void ParseL(RFile& aFile);
+    
+    TInt GetError() const;
+    
+private:
+
+    CCreatorScriptParser();
+    void ConstructL(CCreatorEngine* aEngine);
+    
+    /**
+     * Converts 8 bit descriptor to 16 bit descriptor
+     * @param aDes 8 bit descriptor to be converted
+     * @return Pointer to the new 16 bit descriptor     
+     */
+    HBufC* Convert8BitTo16BitLC(const TDesC8& aInput);
+    const TCreatorScriptElementInfo& LastElementInfo() const;
+    void GetTextFileMode(RFile& aFile, TInt& aFileSize);
+
+    
+public:
+    // From MContentHandler:    
+    void OnStartDocumentL(const RDocumentParameters &aDocParam, TInt aErrorCode);
+    void OnEndDocumentL(TInt aErrorCode);
+    void OnStartElementL(   const RTagInfo& aElement, 
+                            const RAttributeArray& aAttributes, 
+                            TInt aErrorCode);
+    void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnStartPrefixMappingL( const RString& aPrefix, 
+                                const RString& aUri, 
+                                TInt aErrorCode);
+    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+    void OnProcessingInstructionL(  const TDesC8& aTarget, 
+                                    const TDesC8& aData, 
+                                    TInt aErrorCode);
+    void OnError(TInt aErrorCode);
+    TAny* GetExtendedInterface(const TInt32 aUid);
+    
+private:
+
+    enum TFileFormat
+        {
+        EFormatANSIASCII,
+        EFormatUTF8,
+        EFormatUTF16LE,
+        EFormatUTF16BE
+        };
+    // XML parser
+    CParser* iParser;
+    
+    /**
+     * Element stack holding the elements that are currently being parsed.
+     */
+    RArray<TCreatorScriptElementInfo> iElementStack;
+    
+    /**
+     * Cache object containig the elements that are referred in future and thus should
+     * not be deleted after parsing.
+     */
+    CCreatorScriptElementCache* iElementCache;
+    
+    /**
+     * Pointer to the engine
+     */
+    CCreatorEngine* iEngine;
+    
+    TCreatorScriptElementInfo iDefaultElement;
+    
+    TFileFormat iScriptTextFormat;
+    TInt iLastError;
+};
+
+#endif /*CREATORSCRIPTPARSER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_std.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __CREATOR_STD_H__
+#define __CREATOR_STD_H__
+
+#include <e32base.h>
+
+class TCommand;
+typedef CArrayFixSeg<TCommand> CCommandArray;
+
+
+#endif // __CREATOR_STD_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_traces.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATOR_TRACES_H__
+#define __CREATOR_TRACES_H__
+
+#include <e32def.h>
+
+
+// ---------------------------------------------------------------------------
+// You change these logging method values below! Recompile the application to take changes effect.
+
+    // logging methods
+    // 0 = No logging
+    // 1 = Flogger
+    // 2 = RDebug
+    // 3 = Flogger and RDebug
+    
+    #ifndef _DEBUG
+        
+        // Logging method for UREL builds:
+        #define CREATOR_LOGGING_METHOD  3
+
+    #else
+
+        // Logging method for UDEB builds:
+        #define CREATOR_LOGGING_METHOD  3
+
+    #endif    
+    
+
+
+// ---------------------------------------------------------------------------
+// Do not make any changes to lines below...
+
+    #if CREATOR_LOGGING_METHOD == 1 || CREATOR_LOGGING_METHOD == 3
+
+        #include <flogger.h>
+        _LIT(KLogFolder,"Creator");
+        _LIT(KLogFile,"Creator_Trace.txt");
+
+    #endif
+
+    #if CREATOR_LOGGING_METHOD == 2 || CREATOR_LOGGING_METHOD == 3
+
+        #include <e32debug.h>
+
+    #endif
+
+
+    #if CREATOR_LOGGING_METHOD == 0
+    
+        #define LOGTEXT(AAA)
+        #define LOGSTRING(AAA)
+        #define LOGSTRING2(AAA,BBB)
+        #define LOGSTRING3(AAA,BBB,CCC)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD)
+    
+    
+    #elif CREATOR_LOGGING_METHOD == 1
+    
+        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+   
+    #elif CREATOR_LOGGING_METHOD == 2
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
+    
+    #elif CREATOR_LOGGING_METHOD == 3
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+
+    #endif
+
+// ---------------------------------------------------------------------------
+
+#endif // __LAUNCHER_TRACES_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_virtualphonebook.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,299 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+
+#ifndef __CREATORVIRTUALPHONEBOOK_H__
+#define __CREATORVIRTUALPHONEBOOK_H__
+
+#include "engine.h"
+#include "creator_phonebookbase.h"
+#include "creator_randomdatafield.h"
+
+#include <e32base.h>
+#include <cntdef.h>
+#include <cntdb.h>
+#include <cntitem.h>
+#include <cntfldst.h>
+#include <cntview.h>
+#include <cvpbkcontactmanager.h>
+#include <pbkfields.hrh>
+#include <cpbk2imagemanager.h>
+#include <mvpbkcontactstorelistobserver.h>
+#include <mvpbkbatchoperationobserver.h>
+#include <mvpbkcontactfindobserver.h>
+#include <mvpbkcontactobserver.h>
+#include <mpbk2imageoperationobservers.h>
+#include <vpbkeng.rsg>
+#include <cvpbkcontactlinkarray.h>
+#include <MVPbkContactViewObserver.h>
+
+class CCreatorEngine;
+class CCreatorModuleBaseParameters;
+
+class MVPbkStoreContact;
+class MVPbkContactStore;
+class CAsyncWaiter;
+class CContactDatabase;
+class MVPbkContactLinkArray;
+class CVirtualPhonebookParameters;
+
+
+class CCreatorVirtualPhonebook : public CCreatorPhonebookBase,  
+	public MVPbkContactStoreListObserver, public MVPbkBatchOperationObserver,
+	public MVPbkContactFindObserver, public MVPbkContactObserver, public MPbk2ImageSetObserver,
+	public MVPbkSingleContactOperationObserver, public MVPbkContactViewObserver
+    {
+public: 
+    static CCreatorVirtualPhonebook* NewL(CCreatorEngine* aEngine);
+    static CCreatorVirtualPhonebook* NewLC(CCreatorEngine* aEngine);
+    ~CCreatorVirtualPhonebook();
+
+private:
+    CCreatorVirtualPhonebook();
+    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
+
+public:  
+    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries);
+    TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters);    
+    TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters);
+    TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters); 
+
+    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TDesC& aFieldText);
+    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TDesC8& aFieldText);
+    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TTime& aFieldText);
+    
+    void AddImageToContactL(MVPbkStoreContact& aContact, TInt aFieldResId, const TDesC& aFileName);
+    TBool IsActive();
+    void CancelOperation();
+    void DeleteAllL();
+    void DeleteAllCreatedByCreatorL();
+    void DeleteAllGroupsL();
+    void DeleteAllGroupsCreatedByCreatorL();
+    
+private:
+    void CompactPbkDatabaseL(TBool aCompressImmediately=EFalse);    
+    void AddFieldToParamsL(TInt aFieldType, const TDesC& aData);
+    void AddFieldToParamsL(TInt aFieldType, const TDesC8& aData);
+    void AddFieldToParamsL(TInt aFieldType, const TTime& aData);    
+    void InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/);
+    TBool IsContactGroupL(const MVPbkContactLink& aLink);
+    void StoreLinksForDeleteL( MVPbkContactLinkArray& aLinks, TUid aStoreUid );
+    void DeleteContactsL( MVPbkContactLinkArray* aContacts, TBool aGroup );
+    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
+    void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
+    TBool HasOtherThanGroupsL( MVPbkContactLinkArray* aContacts );
+
+public: // MVPbkSingleContactOperationObserver
+    
+    void VPbkSingleContactOperationComplete(
+                    MVPbkContactOperationBase& aOperation,
+                    MVPbkStoreContact* aContact );
+    void VPbkSingleContactOperationFailed(
+                    MVPbkContactOperationBase& aOperation, 
+                    TInt aError );
+
+private: // MVPbkContactViewObserver
+    
+    void ContactViewReady( MVPbkContactViewBase& aView );
+    void ContactViewUnavailable(
+            MVPbkContactViewBase& aView );
+    void ContactAddedToView(
+            MVPbkContactViewBase& aView, 
+            TInt aIndex, 
+            const MVPbkContactLink& aContactLink );
+    void ContactRemovedFromView(
+            MVPbkContactViewBase& aView, 
+            TInt aIndex, 
+            const MVPbkContactLink& aContactLink );
+    void ContactViewError(
+            MVPbkContactViewBase& aView, 
+            TInt aError, 
+            TBool aErrorNotified );
+
+private:
+	CVPbkContactManager* iContactManager;
+    TInt iOpCounter;
+
+    CVirtualPhonebookParameters* iParameters;
+    
+    static TInt iPhoneNumberFields[];
+    static TInt iUrlFields[];
+    static TInt iEmailFields[];
+    TBool iAddAllFields;
+    CVPbkContactLinkArray* iContactLinkArray;
+    CVPbkContactLinkArray* iContactsToDelete;
+    CVPbkContactLinkArray* iContactGroupsToDelete;
+    RPointerArray<MVPbkContactLinkArray> iPreviousDeleteLinks;   
+    
+private:
+	//new variables
+	/// Ref: the target of the copy
+	MVPbkContactStore* iStore;
+    
+    CAsyncWaiter* iWaiter;	
+    
+    /// Own: Contact database for this store
+    CContactDatabase* iContactDb;    
+    
+    //Contacts found in contacts db.
+    MVPbkContactLinkArray* iContactResults;
+    // Contact groups that are found in the store. These are used in filtering
+    // the groups from the find results.
+    MVPbkContactLinkArray* iContactGroupsInStore;
+    
+    // Phonebook asynchronous operation
+    MVPbkContactOperationBase* iOperation;
+    
+    // Flag to indicate whether it is required to notify
+    // iEngine after operation is complete. This happens
+    // when user has cancelled the operation during 
+    // iOperation exists.
+    TBool iCancelCbRequested;
+
+public:
+	//Observer implentation from MVPbkContactStoreListObserver
+	void OpenComplete();
+
+	//observer implentation from MVPbkContactStoreObserver
+
+	void StoreReady(MVPbkContactStore& aContactStore);
+
+	void StoreUnavailable(MVPbkContactStore& aContactStore, 
+	        TInt aReason);
+
+	void HandleStoreEventL(
+	        MVPbkContactStore& aContactStore, 
+	        TVPbkContactStoreEvent aStoreEvent);
+
+	 TAny* ContactStoreObserverExtension(TUid aExtensionUid); 
+	        	
+	
+
+    
+    
+public:
+	//Observer implementation for MVPbkBatchOperationObserver
+
+	void StepComplete( 
+	        MVPbkContactOperationBase& aOperation,
+	        TInt aStepSize );
+	
+	TBool StepFailed(
+	        MVPbkContactOperationBase& aOperation,
+	        TInt aStepSize, TInt aError );
+	
+	void OperationComplete( 
+	        MVPbkContactOperationBase& aOperation );
+	
+	TAny* BatchOperationObserverExtension( 
+	        TUid aExtensionUid ) ;
+
+	
+	//--------------------------------------------
+	//Observer implementation for MVPbkContactFindObserver
+	public: // Interface
+
+	        void FindCompleteL( MVPbkContactLinkArray* aResults );
+
+	        void FindFailed( TInt aError );
+
+	        TAny* ContactFindObserverExtension( 
+	                TUid aExtensionUid );	
+	
+	
+	
+   	//--------------------------------------------
+   	//Observer implementation for MVPbkContactObserver
+
+	public:
+		void ContactOperationCompleted(TContactOpResult aResult);
+	
+		void ContactOperationFailed
+			(TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified);
+	
+	    TAny* ContactObserverExtension(TUid aExtensionUid) ;
+	     //~MVPbkContactObserver();	        
+	        
+	//--------------------------------------------
+	// Implementation of MPbk2ImageSetObserver:
+	public:
+	    void Pbk2ImageSetComplete(MPbk2ImageOperation& aOperation);
+	    void Pbk2ImageSetFailed(MPbk2ImageOperation& aOperation, TInt aError );	        
+    };
+
+class CCreatorContactFieldImpl;
+class CCreatorContactField : public CBase, public MCreatorRandomDataField
+    {
+public:    
+    static CCreatorContactField* NewL(TInt aFieldType, const TDesC& aData);
+    static CCreatorContactField* NewL(TInt aFieldType, const TDesC8& aData);
+    static CCreatorContactField* NewL(TInt aFieldType, const TTime& aData);
+    
+    static CCreatorContactField* NewL(TInt aFieldType, TRandomLengthType aRandomLenType, TInt aRandomLen);
+    
+    ~CCreatorContactField();    
+    TInt FieldType();
+    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
+    virtual void SetRandomParametersL(  MCreatorRandomDataField::TRandomLengthType aRandomLenType = MCreatorRandomDataField::ERandomLengthDefault, 
+                                TInt aRandomLen = 0 );
+    virtual void ParseL(CCommandParser* parser);
+    
+private:    
+    CCreatorContactField();
+    void ConstructL(TInt aFieldType, const TDesC& aData);
+    void ConstructL(TInt aFieldType, const TDesC8& aData);
+    void ConstructL(TInt aFieldType, const TTime& aData);
+    CCreatorContactFieldImpl* pImpl;    
+    };
+    
+    
+/**
+ * Virtual phonebook parameters
+ */
+    
+
+class CVirtualPhonebookParameters : public CCreatorModuleBaseParameters
+    {
+public:
+	void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
+	
+	TInt CVirtualPhonebookParameters::ScriptLinkId() const;
+	void CVirtualPhonebookParameters::SetScriptLinkId(TInt aLinkId);
+	RPointerArray<CCreatorContactField> iContactFields;
+
+    HBufC*  iGroupName;
+    TInt    iContactsInGroup;
+    TInt iNumberOfPhoneNumberFields;
+    TInt iNumberOfURLFields;
+    TInt iNumberOfEmailAddressFields;
+    TInt iContactSetPtr;
+    RArray<TLinkIdParam> iLinkIds; // For contactgroup. Stores the linked contact ids.
+    
+public:
+    CVirtualPhonebookParameters();
+    ~CVirtualPhonebookParameters();
+    
+private:
+    TInt iLinkId; // For contact. Stores the contact id
+    };
+
+
+
+#endif // __CREATORVIRTUALPHONEBOOK_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/creator_wepsecuritysettings.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef CREATORWEPSECURITYSETTINGS_H_
+#define CREATORWEPSECURITYSETTINGS_H_
+
+//
+// Methods copied from WEPSecuritySettingsImpl.h 
+// (Part of  : WEP Security Settings UI)
+// @see \s60\mw\networking\networkingutilities\WEPSecuritySettingsUI\inc\WEPSecuritySettingsImpl.h
+//
+
+
+// INCLUDES
+
+//#include "engine.h"
+
+#include <e32base.h>
+#include <metadatabase.h>
+using namespace CommsDat;
+
+// FORWARD DECLARATIONS
+
+class CCommsDatabase;
+
+// Index of first key
+const TInt KFirstKey = 0;
+
+// Index of second key
+const TInt KSecondKey = 1;
+
+// Index of third key
+const TInt KThirdKey = 2;
+
+// Index of fourth key
+const TInt KFourthKey = 3;
+
+const TInt KMaxNumberofKeys = 4;
+
+// Number of characters for a 232 bits key
+const TUint KKeyDataLength232Bits = 58;
+
+// The maximum length of key data
+const TUint KMaxLengthOfKeyData = KKeyDataLength232Bits;
+
+
+
+
+class CCreatorWEPSecuritySettings : public CBase
+    {
+public: 
+    static CCreatorWEPSecuritySettings* NewL();
+    static CCreatorWEPSecuritySettings* NewLC();
+    ~CCreatorWEPSecuritySettings();
+
+private:
+    CCreatorWEPSecuritySettings();
+    void ConstructL(); // from MCreatorModuleBase
+
+
+public:
+/**
+* Save to database.
+* @param aIapId Wlan Service Table Id of the IAP to be saved
+* @param aCommsDb Comms database.
+*/
+void SaveL( TUint32 aIapId, CCommsDatabase& aCommsDb ) const;
+
+public:
+// Enumeration of the possible keys in use
+enum TWEPKeyInUse
+    {
+    EKeyNumber1,            // Key number 1
+    EKeyNumber2,            // Key number 2
+    EKeyNumber3,            // Key number 3
+    EKeyNumber4             // Key number 4
+    };
+
+
+// Enumeration of the possible authentication types
+enum TWEPAuthentication
+    {
+    EAuthOpen,              // Open authentication
+    EAuthShared             // Shared authentication
+    };
+
+
+// Possible lengths of the keys
+enum TWEPKeyLength
+    {
+    E40Bits,                // 40 bits
+    E104Bits,               // 104 bits
+    E232Bits                // 232 bits
+    };
+
+
+// Possible formats of the keys
+enum TWEPKeyFormat
+    {
+    EAscii,                 // Ascii format
+    EHexadecimal            // Hex format
+    };
+    
+    
+
+private:
+
+// Index of the key currently in use (EKeyNumber1, EKeyNumber2, 
+// EKeyNumber3, EKeyNumber4
+CCreatorWEPSecuritySettings::TWEPKeyInUse iKeyInUse;
+
+// Type of authentication (EAuthOpen, EAuthShared)
+CCreatorWEPSecuritySettings::TWEPAuthentication iAuthentication;
+
+// Length of the key (E40Bits, E104Bits, E232Bits)
+CCreatorWEPSecuritySettings::TWEPKeyLength iKeyLength[KMaxNumberofKeys];
+
+// Format of the key (EAscii, EHexadecimal)
+CCreatorWEPSecuritySettings::TWEPKeyFormat iKeyFormat[KMaxNumberofKeys];
+
+
+    };
+
+
+
+#endif /*CREATORWEPSECURITYSETTINGS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/inc/randomdata.txt	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,589 @@
+// ---------------------------------------------------------
+
+struct r_data_firstnames
+        {
+        "John";
+        "Francis";
+        "Andrew";
+        "Lawrence";
+        "Gregory";
+        "Fulke";
+        "Thomas";
+        "Nicholas";
+        "Hakle";
+        "Roger";
+        "Nathaniel";
+        "Luke";
+        "William";
+        "Ralph";
+        "Leonar";
+        "Daniel";
+        "Aban";
+        "Mathias";
+        "Robert";
+        "Christopher";
+        "Martin";
+        "Michael";
+        "Barnaby";
+        "Tobias";
+        "Richard";
+        "Anthony";
+        "Simon";
+        "Samuel";
+        "Geoffrey";
+        "Isaac";
+        "Henry";
+        "Matthew";
+        "Peter";
+        "Allen";
+        "Reynold";
+        "Jerome";
+        "Elizabeth";
+        "Catherine";
+        "Frances";
+        "Cecily";
+        "Millicent";
+        "Audrey";
+        "Joan";
+        "Elinor";
+        "Joyce";
+        "Frideswide";
+        "Rose";
+        "Helen";
+        "Margaret";
+        "Isabel";
+        "Bridget";
+        "Grace";
+        "Thomasin";
+        "Janet";
+        "Agnes";
+        "Dorothy";
+        "Christian";
+        "Amy";
+        "Fortune";
+        "Sybil";
+        "Alice";
+        "Margery";
+        "Edith";
+        "Barbara";
+        "Gillian";
+        "Ursula";
+        };
+
+struct r_data_surnames
+        {
+        "Lux";
+        "Mandot";
+        "Mansfield";
+        "Mayberry";
+        "McCarrel";
+        "McDaniel";
+        "Mefford";
+        "Metcalf";
+        "Metchell";
+        "Moller";
+        "Margan";
+        "Keaney";
+        "Kenyon";
+        "Kesler";
+        "Kinman";
+        "Kreinert";
+        "Kummerlin";
+        "Lamgley";
+        "Leas";
+        "Leighton";
+        "Lillie";
+        "Hilms";
+        "Holt";
+        "Hosier";
+        "Howard";
+        "Hypes";
+        "Jacmor";
+        "Behnson";
+        "Kammer";
+        "Patts";
+        "West";
+        "Wilbar";
+        "Witsan";
+        "Gillams";
+        "Good";
+        "Wreght";
+        "Worthley";
+        "Adams";
+        "Allen";
+        "Ansley";
+        "Ayries";
+        "Bartlett";
+        "Barton";
+        "Payne";
+        "Pintard";
+        "Prence";
+        "Richards";
+        "Dillman";
+        "Dory";
+        "Edgards";
+        "Engell";
+        "Farprington";
+        "Fisher";
+        "Foed";
+        "Burges";
+        "Childwall";
+        "Smith";
+        "Sipon";
+        "Simmons";
+        "Stewert";
+        "Stiles";
+        "Stratton";
+        "Dennis";
+        "Talmot";
+        };
+    }
+
+struct r_data_companies
+        {
+        "CDP";
+        "Exbox";
+        "Munro";
+        "Majaka";
+        "Bitzumi";
+        "Melroy";
+        "Matal";
+        "Japponi";
+        "Siwaka";
+        "Keiku";
+        "Naamate";
+        "Remonti";
+        "Melleva";
+        "WEX";
+        "Chataz";
+        "Ponly";
+        "Alriva";
+        "Giate";
+        "Kesso";
+        "Nyssa";
+        "Peger";
+        "Metrio";
+        "Mitchitatchi";
+        "Neppari";
+        "Amcuila";
+        "Muipitsu";
+        "Redex";
+        "Maariz";
+        "Swerck";
+        "Makiac";
+        "Dumpia";
+        "Worldmom";
+        "Renfaul";
+        "Kmartissori";
+        "Findo";
+        "Samsanc";
+        "Dellervo";
+        "Manrel";
+        "WSMRL";
+        "Eripox";
+        "Abiturien";
+        "Vesus";
+        "MI4";
+        "Overhiba";
+        "Tridune";
+        "Kyomcera";
+        "Praston";
+        "Gapmis";
+        "WPPDCD";
+        };
+
+struct r_data_addresses
+        {
+        "Barnes Street";
+        "Barnes Place";
+        "Eastman Street";
+        "West Park";
+        "South Park";
+        "Park Avenue";
+        "Richards Court";
+        "Pukershire Avenue";
+        "Ellis Avenue";
+        "East Mountain";
+        "Chestnut Hill";
+        "Plains Road";
+        "Fremont Street";
+        "Heritage Court";
+        "Highland Avenue Extension";
+        "Maple Heights";
+        "McKenzie Avenue";
+        "McKenzie Lane";
+        "West Terrace Street";
+        "Windsor Avenue";
+        "Windsor Road";
+        "Mechanic Street Extension";
+        "Granite Place";
+        "Meadow Street";
+        "Sugar River";
+        };
+
+struct r_data_cities
+        {
+        "Kuopio";       
+        "Los Angeles";        
+        "Lappeenranta";
+        "London";        
+        "Bangkok";
+        "St. Michel";                
+        "St. Petersburg";        
+        "Tokyo";
+        "Helsinki";
+        "Trondheim";        
+        "Nairobi";
+        "Havana";        
+        };
+
+struct r_data_countries
+        {
+        "Finland";
+        "Cuba";
+        "United States of America";
+        "Thailand";
+        "Sweden";
+        "Russia";
+        "Japan";
+        "Norway";
+        "Kenya";                
+        };
+
+struct r_data_postcodes
+        {
+        "00310";
+        "FI-70100";
+        "99002";
+        "11233";            
+        };
+
+struct r_data_states
+        {
+        "California state"; 
+        "Alaska state";
+        "Florida state";
+        };
+
+struct r_data_poboxes
+        {
+        "P.O BOX 5532";
+        "P.O BOX 701";
+        "99";
+        "1133";
+        "P.O. BOX 113322";
+        "112";
+        };
+
+struct r_data_prefixes
+        {
+        "Ms.";
+        "Mrs."; 
+        "Mr.";
+        "Dr.";
+        };
+
+struct r_data_suffixes
+        {
+        "Jr.";
+        "Sr.";        
+        };
+
+struct r_data_jobtitles
+        {
+        "Doctor";
+        "SW Engineer";
+        "Administrative Assistant";
+        "Bookkeeper";
+        "Credit Controller";
+        "Data Entry Operator";
+        "Payroll Officer";
+        "Receptionist";
+        "Trainee";
+        "Accounts Clerk";
+        "Administrator";
+        "Taxation Assistant";
+        "Financial Director";
+        "Bank Manager";
+        "Mobile Lending";
+        "Overseas Transactions";
+        "Restructuring";
+        "Business Analyst";
+        "Call Centre Manager";
+        "Administration";
+        "Manager";
+        "Student";
+        "Mail Sorter";
+        "Mayor";
+        "Account Servicing";
+        "Management";
+        "Media Consultant";
+        "Newsagent";
+        "Librarian";
+        "Creative Director";
+        "Announcer";
+        "Copywriter";
+        "Presenter";
+        "Promotions Manager";
+        "Advertising Sales Representative";
+        "Editor";
+        "Marketing, Sales & Publicity";
+        "Publisher";
+        "Gallery Assistant";
+        "Photographer";
+        "Storyboard Artist";
+        "Events Manager";
+        "Cameraman";
+        "Technician";
+        "Producer";
+        };
+ 
+struct r_data_phonenumbers
+        {
+        "0307834387";
+        "0230328732";
+        "0430365562";
+        "0530328732";
+        "0433032865";
+        "0542306532";
+        "0342303777";
+        "0250235603";
+        "0492303652";
+        "0542303286";
+        "0543656546";
+        "0545545454";
+        "0543444454";
+        "0776463255";
+        "0432443343";
+        "0243334344";
+        "0544543443";
+        "0231343243";
+        "0213443434";
+        "0143234476";
+        "0785434444";
+        "0454445345";
+        "0342443433";
+        "0432434454";
+        "0455454454";
+        "0656565655";
+        "0343434443";
+        "0565645455";
+        "0343243243";
+        "0565466565";
+        "0465565655";
+        "0435445454";
+        "+35854553456";
+        "+35878453486";
+        "+35876653456";
+        "+35834435486";
+        "+35876766466";
+        "+4465665456";
+        "+4432434334";
+        "+4488776776";
+        "+4465655656";
+        "+4443433434";
+        "+4465656565";
+        "+4454454354";
+        };
+
+struct r_data_groupnames
+        {
+        "Nice guys";
+        "Repairs";
+        "Office works";
+        "The buddies";
+        "Football team";
+        "Gold club";
+        "Silver club";
+        "Bronze club";
+        "Best buddies";
+        "Rockers";
+        "Science group";
+        };
+
+struct r_data_meetingreasons
+        {
+        "Security issues";
+        "Team meeting";
+        "Discussion about";
+        "Work plans";
+        "Meeting with the professor";
+        "Meeting with the boss";
+        "Work issues";
+        "New workers";
+        };
+
+struct r_data_meetingplaces
+        {
+        "Room";
+        "Home";
+        "Auditorium";
+        "Company";
+        };
+
+struct r_data_landmark_names
+        {
+        "Good place to fish";},
+        "Uncle over board";},
+        "Best food ever!";},
+        "Nice beach";},
+        "Good hamburgers";},
+        "Nice view";},
+        "John's home";},
+        "Carage";},
+        "Gas station";},
+        "Food store";},
+        "Car wash";},
+        "Summer cottage";},
+        "My home";},
+        "Bank";},
+        "Hospital";},
+        "Ice hall";},
+        "Work place";}
+        };
+
+struct r_data_landmark_descriptions
+        {
+        "The salmons were really big here!";},        
+        "Delicious strawberries sold here. Must visit again sometime!";},
+        "Place looks really nice.";},
+        "This is my favorite place";},
+        "Words are not enough to describe this landmark";},        
+        "What a shocking place to visit! Remember to bring camera next time :-)";}
+        };
+
+struct r_data_memos
+        {
+        "No work today!";
+        "Movies tonight";
+        "Ship new binaries";
+        "New works";
+        "Exam";
+        "Community service";
+        "Volunteer work";
+        "Don't forget the dinner at the restaurant";
+        "Go the bank";
+        "Go to the store";
+        "Buy goods";
+        "Buy food";
+        "Buy new pair of socks";
+        "Buy vegetables";
+        "Buy fruits";
+        "Umbrella";
+        "New shoes";
+        "New suit";
+        "Buy flowers";
+        "School day";
+        };
+
+struct r_data_anniversaries
+        {
+        "birthday";
+        "anniversary";
+        };
+
+struct r_data_todos
+        {
+        "Watch for gum on my shoe";
+        "Watch my step in the hall";
+        "Always think big";
+        "Don't ever think small";
+        "Keep pedaling my bike";
+        "Watch for bees in my pop";
+        "Keep moving forward";
+        "Don't ever stop";
+        "Keep my sled underneath me";
+        "Keep my stick on the ice";
+        "Don't swim in a whirlpool";
+        "Don't look for a fight";
+        "Don't spit in the wind";
+        "Just do what is right";
+        "Go out in the world";
+        "Enjoy a warm rain";
+        "Don't worship TV";
+        "Keep my oars in the water";
+        "Point my boat right downstream";
+        "Face head on my problems";
+        "Change underwear daily";
+        "Believe myself first";
+        "Go out and have fun";
+        "Turn the cards one by one";
+        "Get out and do something";
+        };
+
+struct r_data_reminders
+        {
+        "Remeber to fix car";
+        "Remeber to eat vegetables";
+        "Remeber to go shopping";
+        "Remeber to buy boxes for moving";
+        "Remeber to fix bike";
+        "Remeber to buy christmast presents";
+        "Remeber to send flowers to grandmother";
+        "Remeber to talk with son";
+        "Remeber to cut hedge";
+        "Remeber to bumper potatoes";
+        "Remeber to harvest corn field";
+        "Remeber to sleep enaugh";
+        "Remeber to wash teeths ewery morning";
+        "Remeber to get sleep early";
+        "Remeber to give some wather to flowers";
+        "Remeber to wax snowboard";
+        "Remeber to wax skiis";
+        "Remeber to wax cross country skiis";
+        "Remeber to call mother";
+        "Remeber to call father";
+        "Remeber to call brother";
+        "Remeber to call sister";
+        "Remeber to call daughter";
+        "Remeber to call son";
+        "Remeber to rent villa";
+        };
+
+struct r_data_messagesubjects
+        {
+        "Whaaasssaaap!!??";
+        "Hello";
+        "How are you doing?";
+        "You will win the battle, GUARANTEED!";
+        "Why pay more for something if you don't have to?";
+        "You can afford health care now";
+        "Re: *Buddy* *Lists*!!~ (it's soooo cool)!!~";
+        "Weedmon say: call, we be open 7 days, mon";
+        "Want her to look better?";
+        "Good Morning andyw, how are you?";
+        "Happy Assumption";
+        "There is NO Risk involved";
+        "Free Bottle Offer!";
+        "Introduction on MDSL";
+        "Theres Help out there for you";
+        "hello there - check this out";
+        "Darling";
+        "It doesn't have to be that way";
+        "Webmaster, Free health insurance quotes!";
+        "Join us at the OSGi 2003 World Congress";
+        "Put your subject line here";
+        "You are not protected";
+        "Please try again";
+        "you didn't reply my email ? why ? ???";
+        "A very funny game";
+        "Meeting notice";
+        "Opportunities";
+        };
+
+struct r_data_messagetexts
+        {
+        "The contents of these pages are copyrighted. Any rights not expressly granted herein are reserved. The use of this site is permitted to private use.";
+        "Reproduction, transfer, distribution or storage of part or all of the contents in any form without the prior written permission is prohibited.";
+        "We consents to you browsing the pages on your computer or printing copies of extracts from these pages for your personal use only.";
+        "If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information.";
+        "The use of press releases and other documents classified as public is permitted in public communications if the source for the information has been stated.";
+        "For your easy accessibility we may include links to sites on the Internet that are owned or operated by third parties.";
+        "You also agree that we have no control over the content of that site and cannot assume any responsibility for material by such third-party sites.";
+        "In addition, a link to a such site does not imply that we endorses the site or the products or services referenced in such third party site.";
+        "In order to respond to your questions or manage interactive customer programs, it may be necessary to ask for personal information.";
+        "We may use this information to respond to your requests, or to contact you via mail, e-mail or phone to inform you of new products.";
+        "If you place an order for a product, request a service or submit content to this site, we may need to contact you for additional information.";
+        };
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_accesspoint.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,471 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#include "creator_accesspoint.h" 
+#include "creator_traces.h"
+#include <aplistitemlist.h>
+#include <aplistitem.h> 
+#include "enginewrapper.h"
+
+static const TInt KAccessPointsFieldLength = 128;
+
+_LIT(KCreatorAccessPointsPrefixName, "CR_");
+_LIT(KZeroIP, "0.0.0.0");
+
+//----------------------------------------------------------------------------
+
+CAccessPointsParameters::CAccessPointsParameters()
+    {
+    LOGSTRING("Creator: CAccessPointsParameters::CAccessPointsParameters");
+
+    iConnectionName = HBufC::New(KAccessPointsFieldLength);
+    iWapStartPage = HBufC::New(KAccessPointsFieldLength);
+    iGprsAcessPointName = HBufC::New(KAccessPointsFieldLength);
+    iIspLoginName = HBufC::New(KAccessPointsFieldLength);
+    iIspLoginPass = HBufC::New(KAccessPointsFieldLength);
+    iWapGatewayAddress = HBufC::New(KAccessPointsFieldLength);
+    iIspIPAddr = HBufC::New(KAccessPointsFieldLength);
+    iIspIPNameServer1 = HBufC::New(KAccessPointsFieldLength);
+    iIspIPNameServer2 = HBufC::New(KAccessPointsFieldLength);
+    iIspDefaultTelNumber = HBufC::New(KAccessPointsFieldLength);
+    iProxyServerAddress = HBufC::New(KAccessPointsFieldLength);
+    }
+
+CAccessPointsParameters::~CAccessPointsParameters()
+    {
+    LOGSTRING("Creator: CAccessPointsParameters::~CAccessPointsParameters");
+
+    delete iProxyServerAddress;
+    delete iIspDefaultTelNumber;
+    delete iIspIPNameServer2;
+    delete iIspIPNameServer1;
+    delete iIspIPAddr;
+    delete iWapGatewayAddress;
+    delete iIspLoginPass;
+    delete iIspLoginName;
+    delete iGprsAcessPointName;
+    delete iWapStartPage;
+    delete iConnectionName;
+    }
+
+void CAccessPointsParameters::SetRandomCMNameL(CCreatorEngine& aEngine)
+	{
+	TInt num = aEngine.RandomNumber(1, 3);
+	TBuf<10> apType;
+
+	if (num==1)
+		apType = _L("mms");
+	else if (num==2)
+		apType = _L("wap");
+	else
+		apType = _L("internet");
+
+	TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
+
+	iConnectionName->Des() = KCreatorAccessPointsPrefixName;
+	iConnectionName->Des().Append( company );
+	iConnectionName->Des().Append(_L(" "));
+	iConnectionName->Des().Append(apType);
+	}
+
+void CAccessPointsParameters::SetRandomLoginNameL(CCreatorEngine& aEngine)
+	{
+	iIspLoginName->Des() = aEngine.RandomString(CCreatorEngine::EFirstName);
+	iIspLoginName->Des().LowerCase();
+	}
+
+void CAccessPointsParameters::SetRandomLoginPassL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomSecureAuthenticationL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomPromptPasswordL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomProxyAddressL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomProxyPortL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomStartPageL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomIPAddressL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomIP4NameServer1L(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomIP4NameServer2L(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomTelephoneNumberL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomBearerTypeIsdnL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomBearerSpeedL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomWapWspOptionL(CCreatorEngine& /*aEngine*/)
+	{}
+
+void CAccessPointsParameters::SetRandomGatewayAddressL(CCreatorEngine& /*aEngine*/)
+	{}
+
+//----------------------------------------------------------------------------
+
+CCreatorAccessPoints* CCreatorAccessPoints::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorAccessPoints* self = CCreatorAccessPoints::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorAccessPoints* CCreatorAccessPoints::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorAccessPoints* self = new (ELeave) CCreatorAccessPoints;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorAccessPoints::CCreatorAccessPoints()
+    {
+    }
+
+void CCreatorAccessPoints::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorAccessPoints::ConstructL");
+
+    iEngine = aEngine;
+
+    iCommsDb = CCommsDatabase::NewL();;
+    iApDataHandler = CApDataHandler::NewLC(*iCommsDb);
+    CleanupStack::Pop();
+    iApUtils = CApUtils::NewLC(*iCommsDb);
+    CleanupStack::Pop();
+    }
+
+CCreatorAccessPoints::~CCreatorAccessPoints()
+    {
+    LOGSTRING("Creator: CCreatorAccessPoints::~CCreatorAccessPoints");
+
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidIAP ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    delete iApUtils;
+    delete iApDataHandler;
+    delete iCommsDb;
+
+    if (iParameters)
+        delete iParameters;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorAccessPoints::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorAccessPoints::AskDataFromUserL");
+
+    if( aCommand == ECmdDeleteIAPs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Access Points?") );
+        }
+    else if( aCommand == ECmdDeleteCreatorIAPs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Access Points created with Creator?") );
+        }
+
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"));
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorAccessPoints::CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorAccessPoints::CreateAccessPointEntryL");
+
+    CAccessPointsParameters* parameters = (CAccessPointsParameters*) aParameters;
+    
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    
+            
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        TBuf<160> company = iEngine->RandomString(CCreatorEngine::ECompany);
+        TInt num = iEngine->RandomNumber(1, 3);
+        TBuf<10> apType;
+        
+        if (num==1)
+            apType = _L("mms");
+        else if (num==2)
+            apType = _L("wap");
+        else
+            apType = _L("internet");
+        
+        iParameters = new(ELeave) CAccessPointsParameters;
+        parameters = iParameters;
+
+        parameters->SetRandomCMNameL(*iEngine);
+
+        // in random mode just create GPRS access points
+        parameters->iBearerType = EApBearerTypeGPRS;
+
+        parameters->SetRandomLoginNameL(*iEngine);
+
+        iParameters->iIspLoginPass->Des() = iEngine->RandomString(CCreatorEngine::ESurname);
+        iParameters->iIspLoginPass->Des().LowerCase();
+
+        iParameters->iSecureAuthentication = EFalse;
+        iParameters->iPromptPassword = EFalse;
+
+        iParameters->iProxyServerAddress->Des() = _L("127.0.0.1");
+        iParameters->iProxyPortNumber = 80;
+
+        iParameters->iWapStartPage->Des() = _L("http://");
+        iParameters->iWapStartPage->Des().Append(apType);
+        iParameters->iWapStartPage->Des().Append(_L("."));
+        iParameters->iWapStartPage->Des().Append(company);
+        iParameters->iWapStartPage->Des().Append(_L(".com"));
+        iParameters->iWapStartPage->Des().LowerCase();
+
+        iParameters->iIspIPAddr->Des() = KZeroIP;
+        iParameters->iIspIPNameServer1->Des() = KZeroIP;
+        iParameters->iIspIPNameServer1->Des() = KZeroIP;
+        iParameters->iGprsAcessPointName->Des() = apType;
+        iParameters->iIspDefaultTelNumber->Des() = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
+        iParameters->iIspBearerCallTypeIsdn = ECallTypeISDNv110;
+        iParameters->iIspBearerSpeed = KSpeed14400;
+
+        iParameters->iWapWspOption = EWapWspOptionConnectionOriented;
+        iParameters->iWapGatewayAddress->Des() = KZeroIP;
+        }
+    else
+        {
+        // otherwise replace the parameters object
+        iParameters = parameters;
+        }
+
+    TInt err = KErrNone;
+
+    // access point item
+    CApAccessPointItem* apItem = CApAccessPointItem::NewLC();
+
+    // set the bearer type, if it fails try to set a default type
+    TRAPD(bearerErr, apItem->SetBearerTypeL(iParameters->iBearerType));
+    if (bearerErr != KErrNone)
+        {
+        iParameters->iBearerType = EApBearerTypeGPRS;
+        TRAPD(bearerErr2, apItem->SetBearerTypeL(iParameters->iBearerType));
+        bearerErr2=bearerErr2;
+        }
+
+    if (iParameters->iBearerType == EApBearerTypeGPRS) // GPRS
+        {
+        err = apItem->WriteLongTextL(EApGprsAccessPointName, iParameters->iGprsAcessPointName->Des());
+        }
+    else  // CSD or HCSD
+        {
+        err = apItem->WriteTextL(EApIspDefaultTelNumber, iParameters->iIspDefaultTelNumber->Des());
+        err = apItem->WriteUint(EApIspBearerCallTypeIsdn, iParameters->iIspBearerCallTypeIsdn);
+        err = apItem->WriteUint(EApIspBearerSpeed, iParameters->iIspBearerSpeed);
+        }
+
+    err = apItem->WriteTextL(EApIspLoginName, iParameters->iIspLoginName->Des());
+    err = apItem->WriteTextL(EApIspIfAuthName, iParameters->iIspLoginName->Des());
+    err = apItem->WriteTextL(EApIspLoginPass, iParameters->iIspLoginPass->Des());
+    err = apItem->WriteTextL(EApIspIfAuthPass, iParameters->iIspLoginPass->Des());
+    err = apItem->WriteTextL(EApGprsIfAuthPassword, iParameters->iIspLoginPass->Des());
+    err = apItem->WriteBool(EApIspDisablePlainTextAuth, iParameters->iSecureAuthentication);
+    err = apItem->WriteBool(EApIspPromptForLogin, iParameters->iPromptPassword);
+    err = apItem->WriteTextL(EApWapGatewayAddress, iParameters->iWapGatewayAddress->Des());
+    err = apItem->WriteLongTextL(EApProxyServerAddress, iParameters->iProxyServerAddress->Des());
+    err = apItem->WriteUint(EApProxyPortNumber, iParameters->iProxyPortNumber);
+    err = apItem->WriteLongTextL(EApWapStartPage, iParameters->iWapStartPage->Des());
+    err = apItem->WriteUint(EApWapWspOption, iParameters->iWapWspOption);
+    err = apItem->WriteTextL(EApGprsIPNameServer1, iParameters->iIspIPNameServer1->Des());
+    err = apItem->WriteTextL(EApGprsIPNameServer2, iParameters->iIspIPNameServer2->Des());
+    err = apItem->WriteTextL(EApIspIPAddr, iParameters->iIspIPAddr->Des());
+
+
+    TUint32 uid = iApDataHandler->CreateFromDataL(*apItem);  // save the access point, returns the uid of the AP
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( uid );
+        
+    TBuf<256> name = iParameters->iConnectionName->Des();
+    iApUtils->SetNameL(name, uid); // sets the AP name
+
+
+    // if no defaults set, set the created AP as a default
+
+    // MMS access point
+    if (iParameters->iWapStartPage->Des().FindF(_L("mms")) >=0  ||  iParameters->iConnectionName->Des().FindF(_L("mms")) >=0 )
+        {
+        //User::Panic(_L("Not done yet..."), 123);
+        }
+
+
+    // WAP access point
+    else if (iParameters->iConnectionName->Des().FindF(_L("wap")) >=0  ||  iParameters->iGprsAcessPointName->Des().FindF(_L("wap")) >= 0)
+        {
+        TUint32 defID = 0;
+        TRAP( err, defID = iApDataHandler->DefaultL(ETrue) );  // ETrue==WAP
+
+        if (defID <= 1)
+            TRAP( err, iApDataHandler->SetAsDefaultL(uid, EIspTypeWAPOnly) );
+
+        }
+
+    // Internet access point
+    else if (iParameters->iConnectionName->Des().FindF(_L("internet")) >=0  ||  iParameters->iGprsAcessPointName->Des().FindF(_L("internet")) >= 0)
+        {
+        TUint32 defID = 0;
+        TRAP( err, defID = iApDataHandler->DefaultL(EFalse) );  // EFalse==IAP
+
+        if (defID <= 1)
+            TRAP( err, iApDataHandler->SetAsDefaultL(uid, EIspTypeInternetOnly) );  //  <--  POSSIBLY NOT CORRECT, NEEDS MORE TESTING
+        }
+
+
+
+    CleanupStack::PopAndDestroy(); //apItem
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TUint32 CCreatorAccessPoints::AccessPointNameToIdL(const TDesC& aAPName, TBool /*aAnyIfNotFound*/ )
+    {
+    LOGSTRING("Creator: CCreatorEngine::AccessPointNameToIdL");
+
+    TBuf<256> apName = aAPName.Left(256);
+    apName.Trim();
+
+    TUint32 APId = iEngine->GetDefaultIAPL();
+
+    // return default IAP if requested
+    if (apName.CompareF(_L("DEFAULT-IAP")) == 0 || apName.CompareF(_L("DEFAULT")) == 0)
+        {
+        return APId;
+        }
+
+    CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(db);
+    CApUtils* apUtils = CApUtils::NewLC(*db);
+    CApSelect* apSelect = CApSelect::NewLC(*db, KEApIspTypeAll, EApBearerTypeAll, KEApSortNameAscending);
+
+
+    // loop through all access points and try to find a matching name
+    if (apSelect->MoveToFirst())
+        {
+        do
+            {
+            TBuf<256> apName2;
+            apUtils->NameL(apSelect->Uid(), apName2);
+            apName2.Trim();
+
+            if (apName2.CompareF( apName ) == 0)
+                {
+                // match found, get uid and break the loop
+                TRAPD( err, APId = apUtils->IapIdFromWapIdL(apSelect->Uid()) );
+                err=err;
+                break;
+                }
+            }
+        while (apSelect->MoveNext());
+        }
+
+    CleanupStack::PopAndDestroy(3);  //apSelect, apUtils, db
+
+    return APId;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorAccessPoints::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
+    {
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorAccessPoints::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::DeleteAllL");
+    
+    CApSelect* selector = CApSelect::NewLC( *iCommsDb, 
+                                            KEApIspTypeAll,
+                                            EApBearerTypeAllBearers,
+                                            KEApSortUidAscending );
+    
+    CApListItemList* list = new (ELeave) CApListItemList();
+    CleanupStack::PushL( list );
+    TInt count = selector->AllListItemDataL( *list );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TRAP_IGNORE( iApDataHandler->RemoveAPL( (*list)[i]->Uid() ) );
+        }
+
+    CleanupStack::PopAndDestroy( list );
+    CleanupStack::PopAndDestroy( selector );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Logs related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorAccessPoints::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::DeleteAllCreatedByCreatorL");
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidIAP );
+    
+    // delete entries
+    for ( TInt i = 0; i < iEntryIds.Count(); i++ )
+        {
+        TRAP_IGNORE( iApDataHandler->RemoveAPL( iEntryIds[i] ) );
+        }
+    
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Logs related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_browser.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,593 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <favouriteswapap.h> 
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_browser.h" 
+#include "creator_traces.h"
+
+
+static const TInt KBrowserFieldLength = 128;
+
+_LIT(KCreatorBrowserPrefixName, "CR_");
+_LIT(KCreatorBrowserPrefixFolderName, "CR_FLDR_");
+
+//----------------------------------------------------------------------------
+
+CBrowserParameters::CBrowserParameters()
+    {
+    LOGSTRING("Creator: CBrowserParameters::CBrowserParameters");
+
+    iBookmarkName = HBufC::New(KBrowserFieldLength);
+    iBookmarkAddress = HBufC::New(KBrowserFieldLength);
+    iBookmarkUsername = HBufC::New(KBrowserFieldLength);
+    iBookmarkPassword = HBufC::New(KBrowserFieldLength);    
+    iBookmarkFolderName = HBufC::New(KBrowserFieldLength);
+    iSavedDeckLinkName = HBufC::New(KBrowserFieldLength);
+    iSavedDeckLocalAddress = HBufC::New(KBrowserFieldLength);
+    iSavedDeckFolderName = HBufC::New(KBrowserFieldLength);
+    }
+
+CBrowserParameters::~CBrowserParameters()
+    {
+    LOGSTRING("Creator: CBrowserParameters::~CBrowserParameters");
+
+    delete iSavedDeckFolderName;
+    delete iSavedDeckLocalAddress;
+    delete iSavedDeckLinkName;
+    delete iBookmarkFolderName;
+    delete iBookmarkPassword;    
+    delete iBookmarkUsername;
+    delete iBookmarkAddress;
+    delete iBookmarkName;
+
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorBrowser* CCreatorBrowser::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorBrowser* self = CCreatorBrowser::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorBrowser* CCreatorBrowser::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorBrowser* self = new (ELeave) CCreatorBrowser;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorBrowser::CCreatorBrowser()
+    {
+    }
+
+void CCreatorBrowser::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::ConstructL");
+
+    iEngine = aEngine;
+    }
+
+CCreatorBrowser::~CCreatorBrowser()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::~CCreatorBrowser");
+    if ( iEngine && iBmEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iBmEntryIds, KUidDictionaryUidBrowserBookmarks ) );
+        }
+    iBmEntryIds.Reset();
+    iBmEntryIds.Close();
+
+    if ( iEngine && iBmFEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iBmFEntryIds, KUidDictionaryUidBrowserBookmarkF ) );
+        }
+    iBmFEntryIds.Reset();
+    iBmFEntryIds.Close();
+
+    if ( iEngine && iSpEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iSpEntryIds, KUidDictionaryUidBrowserSavedPg ) );
+        }
+    iSpEntryIds.Reset();
+    iSpEntryIds.Close();
+
+    if ( iEngine && iSpFEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iSpFEntryIds, KUidDictionaryUidBrowserSavedPgF ) );
+        }
+    iSpFEntryIds.Reset();
+    iSpFEntryIds.Close();
+
+    delete iParameters;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorBrowser::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::AskDataFromUserL");
+
+    TBool result( EFalse );
+    switch ( aCommand )
+        {
+        case ECmdDeleteBrowserBookmarks:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmarks?") );
+            break;
+            }
+        case ECmdDeleteCreatorBrowserBookmarks:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmarks created with Creator?") );
+            break;
+            }
+        case ECmdDeleteBrowserBookmarkFolders:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmark folders?") );
+            break;
+            }
+        case ECmdDeleteCreatorBrowserBookmarkFolders:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmark folders created with Creator?") );
+            break;
+            }
+        case ECmdDeleteBrowserSavedPages:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages?") );
+            break;
+            }
+        case ECmdDeleteCreatorBrowserSavedPages:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages created with Creator?") );
+            break;
+            }
+        case ECmdDeleteBrowserSavedPageFolders:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages folders?") );
+            break;
+            }
+        case ECmdDeleteCreatorBrowserSavedPageFolders:
+            {
+            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages folders created with Creator?") );
+            break;
+            }
+        default:
+            {
+            result = iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"));
+            break;
+            }
+        }
+    return result;
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorBrowser::CreateBookmarkEntryL(CBrowserParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::CreateBookmarkEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CBrowserParameters* parameters = aParameters;
+        
+    // random data needed if no predefined data available
+    if( !parameters )
+        {
+        iParameters = new(ELeave) CBrowserParameters;
+        parameters = iParameters; 
+
+        TFileName userAndPassword = iEngine->RandomString(CCreatorEngine::EFirstName);
+        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
+        TFileName url = name;
+        url.Insert(0, _L("http://www."));
+        url.Append(_L(".com/"));
+        name.Insert(0, KCreatorBrowserPrefixName);
+
+        parameters->iBookmarkName->Des() = name;
+        parameters->iBookmarkAddress->Des() = url;
+        parameters->iBookmarkUsername->Des() = userAndPassword;
+        parameters->iBookmarkPassword->Des() = userAndPassword;
+        }
+   
+    TInt err = KErrNone;
+
+    RFavouritesSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL<RFavouritesSession>(session);
+    RFavouritesDb db;
+    User::LeaveIfError( db.Open(session, KBrowserBookmarks) );
+    CleanupClosePushL<RFavouritesDb>(db);
+
+    CFavouritesItem* item = CFavouritesItem::NewLC();
+    item->SetType( CFavouritesItem::EItem );
+    item->SetParentFolder( KFavouritesRootUid ) ;
+    item->SetNameL( parameters->iBookmarkName->Des() );
+    item->SetUrlL( parameters->iBookmarkAddress->Des() );
+    item->SetUserNameL( parameters->iBookmarkUsername->Des() );
+    item->SetPasswordL( parameters->iBookmarkPassword->Des() );
+    err = db.Add(*item, /*aAutoRename=*/ETrue);
+    if (err)
+        db.Commit();
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iBmEntryIds.Append( item->Uid() );
+    
+    CleanupStack::PopAndDestroy(3); //db, session, item
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorBrowser::CreateBookmarkFolderEntryL(CBrowserParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::CreateBookmarkFolderEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CBrowserParameters* parameters = aParameters;
+    
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CBrowserParameters;
+        parameters = iParameters;
+
+        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
+        name.Insert(0, KCreatorBrowserPrefixFolderName);
+
+        parameters->iBookmarkFolderName->Des() = name;
+        }
+    
+    TInt err = KErrNone;
+
+    RFavouritesSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL<RFavouritesSession>(session);
+    RFavouritesDb db;
+    User::LeaveIfError( db.Open(session, KBrowserBookmarks) );
+    CleanupClosePushL<RFavouritesDb>(db);
+
+    CFavouritesItem* item = CFavouritesItem::NewLC();
+    item->SetType( CFavouritesItem::EFolder );
+    item->SetParentFolder( KFavouritesRootUid ) ;
+    item->SetNameL( parameters->iBookmarkFolderName->Des() );
+    
+    err = db.Add(*item, /*aAutoRename=*/ETrue);
+    if (err)
+        db.Commit();
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iBmFEntryIds.Append( item->Uid() );
+    
+    CleanupStack::PopAndDestroy(3); //db, session, item
+            
+
+    return err;
+    
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorBrowser::CreateSavedDeckEntryL(CBrowserParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::CreateSavedDeckEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CBrowserParameters* parameters = aParameters;
+    
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CBrowserParameters;
+        parameters = iParameters;
+
+        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
+        name.Insert(0, KCreatorBrowserPrefixName);
+
+        parameters->iSavedDeckLinkName->Des() = name;
+        parameters->iSavedDeckLocalAddress->Des() = iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB);
+        }
+   
+    TInt err = KErrNone;
+
+    // check the deck address is correct
+    if ( parameters->iSavedDeckLocalAddress->Des().Length() == 0 ||
+    		!BaflUtils::FileExists( CEikonEnv::Static()->FsSession(), parameters->iSavedDeckLocalAddress->Des() ))
+        {
+        // not found, use a default deck instead
+        delete parameters->iSavedDeckLocalAddress;
+        parameters->iSavedDeckLocalAddress = 0;
+        TPtrC tmp = iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB);
+        parameters->iSavedDeckLocalAddress = HBufC::NewL(tmp.Length());
+        parameters->iSavedDeckLocalAddress->Des() = tmp;
+        }
+
+
+    RFavouritesSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL<RFavouritesSession>(session);
+    RFavouritesDb db;
+    User::LeaveIfError( db.Open(session, KBrowserSavedPages) );
+    CleanupClosePushL<RFavouritesDb>(db);
+
+    CFavouritesItem* item = CFavouritesItem::NewLC();
+    item->SetType( CFavouritesItem::EItem );
+    item->SetParentFolder( KFavouritesRootUid ) ;
+    item->SetNameL( parameters->iSavedDeckLinkName->Des() );
+    item->SetUrlL( _L(" ") );
+
+    TFavouritesWapAp favouritesAp;
+    favouritesAp.SetDefault();
+    item->SetWapAp( favouritesAp );
+
+    
+    err = db.Add(*item, /*aAutoRename=*/ETrue);
+    if (err)
+        db.Commit();
+    
+    // read the source deck to buffer
+    RFile sourceFile;
+    User::LeaveIfError( sourceFile.Open(CEikonEnv::Static()->FsSession(), parameters->iSavedDeckLocalAddress->Des(), EFileRead) );
+    CleanupClosePushL<RFile>(sourceFile);
+    TInt sourceFileSize(0);
+    err = sourceFile.Size(sourceFileSize);
+    HBufC8* sourceBuf = HBufC8::NewLC(sourceFileSize);
+    TPtr8 sourcePtr = sourceBuf->Des();
+    sourceFile.Read(sourcePtr);
+    
+    // write the deck
+    RFavouritesFile destinationFile;
+    User::LeaveIfError( destinationFile.Replace(db, item->Uid() ));
+    CleanupClosePushL<RFavouritesFile>(destinationFile);
+    err = destinationFile.Write(sourceBuf->Des());
+
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iSpEntryIds.Append( item->Uid() );
+
+ 
+    CleanupStack::PopAndDestroy(6); //db, session, item, sourceFile, destinationFile, sourceBuf    
+    
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorBrowser::CreateSavedDeckFolderEntryL(CBrowserParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorBrowser::CreateSavedDeckFolderEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+            
+    CBrowserParameters* parameters = aParameters;
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CBrowserParameters;
+        parameters = iParameters;
+        
+        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
+        name.Insert(0, KCreatorBrowserPrefixFolderName);
+
+        parameters->iSavedDeckFolderName->Des() = name;
+        }
+   
+    TInt err = KErrNone;
+
+    RFavouritesSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL<RFavouritesSession>(session);
+    RFavouritesDb db;
+    User::LeaveIfError( db.Open(session, KBrowserSavedPages) );
+    CleanupClosePushL<RFavouritesDb>(db);
+
+    CFavouritesItem* item = CFavouritesItem::NewLC();
+    item->SetType( CFavouritesItem::EFolder );
+    item->SetParentFolder( KFavouritesRootUid ) ;
+    item->SetNameL( parameters->iSavedDeckFolderName->Des() );
+    
+    err = db.Add(*item, /*aAutoRename=*/ETrue);
+    if (err)
+        db.Commit();
+
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iSpFEntryIds.Append( item->Uid() );
+
+    CleanupStack::PopAndDestroy(3); //db, session, item
+                
+    return err;
+    
+    }
+
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllL");
+    User::Leave( KErrNotSupported );
+    // will not be supported, see separate implementations below
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllCreatedByCreatorL");
+    User::Leave( KErrNotSupported );
+    // will not be supported, see separate implementations below
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllBookmarksL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarksL");
+    DeleteAllItemsL( KBrowserBookmarks,
+                     CFavouritesItem::EItem,
+                     EFalse,
+                     iBmEntryIds, // ignored, because deleting all
+                     KUidDictionaryUidBrowserBookmarks );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllBookmarksCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarksCreatedByCreatorL");
+    DeleteAllItemsL( KBrowserBookmarks,
+                     CFavouritesItem::EItem,
+                     ETrue,
+                     iBmEntryIds,
+                     KUidDictionaryUidBrowserBookmarks );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllBookmarkFoldersL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarkFoldersL");
+    DeleteAllItemsL( KBrowserBookmarks,
+                     CFavouritesItem::EFolder,
+                     EFalse,
+                     iBmFEntryIds, // ignored, because deleting all
+                     KUidDictionaryUidBrowserBookmarkF );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllBookmarkFoldersCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarkFoldersCreatedByCreatorL");
+    DeleteAllItemsL( KBrowserBookmarks,
+                     CFavouritesItem::EFolder,
+                     ETrue,
+                     iBmFEntryIds,
+                     KUidDictionaryUidBrowserBookmarkF );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllSavedPagesL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPagesL");
+    DeleteAllItemsL( KBrowserSavedPages,
+                     CFavouritesItem::EItem,
+                     EFalse,
+                     iSpEntryIds, // ignored, because deleting all
+                     KUidDictionaryUidBrowserSavedPg );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllSavedPagesCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPagesCreatedByCreatorL");
+    DeleteAllItemsL( KBrowserSavedPages,
+                     CFavouritesItem::EItem,
+                     ETrue,
+                     iSpEntryIds,
+                     KUidDictionaryUidBrowserSavedPg );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllSavedPageFoldersL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPageFoldersL");
+    DeleteAllItemsL( KBrowserSavedPages,
+                     CFavouritesItem::EFolder,
+                     EFalse,
+                     iSpFEntryIds, // ignored, because deleting all
+                     KUidDictionaryUidBrowserSavedPgF );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllSavedPageFoldersCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPageFolderssCreatedByCreatorL");
+    DeleteAllItemsL( KBrowserSavedPages,
+                     CFavouritesItem::EFolder,
+                     ETrue,
+                     iSpFEntryIds,
+                     KUidDictionaryUidBrowserSavedPgF );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorBrowser::DeleteAllItemsL( const TDesC& aDbName, 
+                                       CFavouritesItem::TType aTypeFilter,
+                                       TBool aOnlyCreatedWithCreator,
+                                       RArray<TInt>& aEntryIds,
+                                       const TUid aDictUid )
+    {
+    LOGSTRING("Creator: CCreatorBrowser::DeleteItemL");
+    RFavouritesSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL( session );
+    RFavouritesDb db;
+    User::LeaveIfError( db.Open( session, aDbName ) );
+    CleanupClosePushL( db );
+       
+    if ( aOnlyCreatedWithCreator )
+        {
+        // read uids from Creator internal store
+        aEntryIds.Reset();
+        iEngine->ReadEntryIdsFromStoreL( aEntryIds, aDictUid );
+        
+        // delete entries from db
+        for ( TInt i = 0; i < aEntryIds.Count(); i++ )
+            {
+            db.Delete( aEntryIds[i] );
+            }
+        }
+    else
+        {
+        CArrayFixFlat<TInt>* uids = new (ELeave) CArrayFixFlat<TInt>(64);
+        CleanupStack::PushL( uids );
+        
+        // read uids from browser db
+        User::LeaveIfError( db.GetUids( *uids, KFavouritesRootUid, aTypeFilter ) );
+
+        // delete entries from db
+        for ( TInt i = 0; i < uids->Count(); i++ )
+            {
+            db.Delete( uids->At(i) );
+            }
+        
+        // db.Commit() seems to panic with EFavouritesNoTransaction
+        // deletion is successful even without commit, so not calling it
+        CleanupStack::PopAndDestroy( uids );
+        }
+       
+    // entries deleted, remove the Browser related registry
+    aEntryIds.Reset();
+    iEngine->RemoveStoreL( aDictUid );
+
+    CleanupStack::PopAndDestroy( &db );
+    CleanupStack::PopAndDestroy( &session );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_browserelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#include "creator_browserelement.h"
+#include "creator_traces.h"
+#include "creator_browser.h"
+
+using namespace creatorbrowser;
+
+/*
+ * 
+ */
+CCreatorBrowserElement* CCreatorBrowserElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorBrowserElement* self = new (ELeave) CCreatorBrowserElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorBrowserElement::CCreatorBrowserElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+
+
+/*
+ * 
+ */
+void CCreatorBrowserElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    TInt entryAmount = 1;
+    TBool addAll = EFalse;
+    if( amountAttr )
+        {
+        entryAmount = ConvertStrToIntL(amountAttr->Value());
+        }
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement )
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
+        // Create browser entries, the amount of entries is defined by entryAmount:
+        for( TInt cI = 0; cI < entryAmount; ++cI )
+            {
+            CBrowserParameters* param = 0;
+            
+            if( fields.Count() > 0 )
+            	param = new (ELeave) CBrowserParameters;
+            else
+            	{
+            	// No fields defined --> Add all fields with random values:
+            	addAll = ETrue;
+            	break;
+            	}
+            
+            CleanupStack::PushL(param);
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();                
+                TPtrC elemContent = field->Content();
+                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+                if( elemName == KName )
+                    {
+                    if( randomAttr || elemContent.Length() == 0)
+                        {
+                        elemContent.Set(iEngine->RandomString(CCreatorEngine::ECompany));
+                        }
+                    if( iName->Des() == KBookmark )
+                        {
+                        SetContentToTextParamL(param->iBookmarkName, elemContent);                        
+                        }
+                    else if( iName->Des() == KBookmarkFolder )
+                        {
+                        SetContentToTextParamL(param->iBookmarkFolderName, elemContent);
+                        }
+                    else if( iName->Des() == KSavedPage )
+                        {
+                        SetContentToTextParamL(param->iSavedDeckLinkName, elemContent);
+                        }
+                    else if( iName->Des() == KSavedPageFolder )
+                        {
+                        SetContentToTextParamL(param->iSavedDeckFolderName, elemContent);
+                        }
+                    }
+                
+                else if( elemName == KPath )
+                    {                    
+                    if( randomAttr || elemContent.Length() == 0)
+                        {
+                        SetContentToTextParamL(param->iSavedDeckLocalAddress, iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB));
+                        }
+                    else
+                        {
+                        SetContentToTextParamL(param->iSavedDeckLocalAddress, elemContent);
+                        }
+                    }
+                else if( elemName == KUsername )
+                    {
+                    if( randomAttr || elemContent.Length() == 0)
+                        {
+                        // Set username and password to same string
+                        if( param->iBookmarkPassword && param->iBookmarkPassword->Length() > 0 )
+                            {
+                            SetContentToTextParamL(param->iBookmarkUsername, param->iBookmarkPassword->Des());
+                            }
+                        else
+                            {
+                            SetContentToTextParamL(param->iBookmarkUsername, iEngine->RandomString(CCreatorEngine::EFirstName));
+                            }
+                        }
+                    else
+                        {
+                        SetContentToTextParamL(param->iBookmarkUsername, elemContent);
+                        }
+                    }
+                else if( elemName == KPassword )
+                    {
+                    if( randomAttr || elemContent.Length() == 0)
+                        {
+                        // Set username and password to same string
+                        if( param->iBookmarkUsername && param->iBookmarkUsername->Length() > 0 )
+                            {
+                            SetContentToTextParamL(param->iBookmarkPassword, param->iBookmarkUsername->Des());
+                            }
+                        else
+                            {
+                            SetContentToTextParamL(param->iBookmarkPassword, iEngine->RandomString(CCreatorEngine::EFirstName));                                                    
+                            }
+                        }
+                    else
+                        {
+                        SetContentToTextParamL(param->iBookmarkPassword, elemContent);
+                        }
+                    }
+                else if( elemName == KUrl )
+                    {
+                    if( randomAttr || elemContent.Length() == 0)
+                        {
+                        TDesC* tmpUrl = iEngine->CreateHTTPUrlLC();
+                        if( tmpUrl )
+                            {
+                            SetContentToTextParamL(param->iBookmarkAddress, *tmpUrl );
+                            }
+                        CleanupStack::PopAndDestroy(); // tmpUrl                        
+                        }
+                    else
+                        {
+                        SetContentToTextParamL(param->iBookmarkAddress, elemContent);
+                        }
+                    }
+                }
+            iEngine->AppendToCommandArrayL(GetBrowserCommandL(), param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	addAll = ETrue;
+    	}
+    
+    if( addAll )
+    	{
+    	iEngine->AppendToCommandArrayL(GetBrowserCommandL(), 0, entryAmount);
+    	}
+    }
+
+TInt CCreatorBrowserElement::GetBrowserCommandL() const
+    {
+    if( iName->Des() == KBookmark )
+        {
+        return ECmdCreateBrowserBookmarkEntries;
+        }
+    else if( iName->Des() == KBookmarkFolder )
+        {
+        return ECmdCreateBrowserBookmarkFolderEntries;
+        }
+    else if( iName->Des() == KSavedPage )
+        {
+        return ECmdCreateBrowserSavedPageEntries;
+        }
+    else if( iName->Des() == KSavedPageFolder )
+        {
+        return ECmdCreateBrowserSavedPageFolderEntries;
+        }
+    
+    LOGSTRING("CCreatorFileElement::GetBrowserCommandL: Unknown browser entry");
+    User::Leave(KErrGeneral);
+    return 0; // Not reached, but disables compiler warning...
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_calendar.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1296 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+
+#include "creator_calendar.h" 
+#include "creator_traces.h"
+#include "creator_scriptentry.h"
+#include <e32base.h>
+#include <e32math.h>
+#include <calrrule.h> 
+#include <calalarm.h>
+
+static const TInt KCalendarFieldLength = 128;
+
+
+CCreatorCalenderAttendee::CCreatorCalenderAttendee() 
+    {}
+
+CCreatorCalenderAttendee::~CCreatorCalenderAttendee()
+    {
+    delete iCommonName;
+    delete iEmailAddress;
+    }
+
+CCreatorCalenderAttendee* CCreatorCalenderAttendee::NewL()
+    {
+    CCreatorCalenderAttendee* self = new (ELeave) CCreatorCalenderAttendee;
+    return self;
+    }
+
+void CCreatorCalenderAttendee::SetCommonNameL(const TDesC& aName)
+    {
+    delete iCommonName;
+    iCommonName = 0;
+    iCommonName = HBufC::NewL(aName.Length());
+    iCommonName->Des().Copy(aName);
+    }
+
+void CCreatorCalenderAttendee::SetEmailAddressL(const TDesC& aEmail)
+    {
+    delete iEmailAddress;
+    iEmailAddress = 0;
+    iEmailAddress = HBufC::NewL(aEmail.Length());
+    iEmailAddress->Des().Copy(aEmail);
+    }
+
+void CCreatorCalenderAttendee::SetRole(CCalAttendee::TCalRole aRole)
+    {
+    iRole = aRole;
+    }
+
+void CCreatorCalenderAttendee::SetStatus(CCalAttendee::TCalStatus aStatus)
+    {
+    iStatus = aStatus;
+    }
+
+const TDesC& CCreatorCalenderAttendee::CommonName() const
+    {
+    if( iCommonName == 0 )
+    	return iDummy;
+    return *iCommonName;
+    }
+
+const TDesC& CCreatorCalenderAttendee::EmailAddress() const
+    {
+    if( iEmailAddress == 0 )
+    	return iDummy;
+    
+    return *iEmailAddress;
+    }
+
+CCalAttendee::TCalRole CCreatorCalenderAttendee::Role() const
+    {
+    return iRole;
+    }
+
+CCalAttendee::TCalStatus CCreatorCalenderAttendee::Status() const
+    {
+    return iStatus;
+    }
+
+TBool CCalenderInterimParameters::IsAllowedEntryStatus(CCalEntry::TType aType, CCalEntry::TStatus aStatus)
+    {
+    if( aType == CCalEntry::ETodo )
+        {
+        return  aStatus == CCalEntry::ECancelled ||
+                aStatus == CCalEntry::ETodoNeedsAction ||
+                aStatus == CCalEntry::ETodoCompleted ||
+                aStatus == CCalEntry::ETodoInProcess;
+        }
+    
+    return  aStatus == CCalEntry::ETentative ||
+            aStatus == CCalEntry::EConfirmed ||
+            aStatus == CCalEntry::ECancelled;
+    }
+
+//----------------------------------------------------------------------------
+
+CCalenderInterimParameters::CCalenderInterimParameters ( )
+    {
+    LOGSTRING("Creator: CCalenderInterimParameters::CCalenderInterimParameters");
+
+    iAppointmentLocation = HBufC::New (KCalendarFieldLength );
+    iAppointmentReason = HBufC::New (KCalendarFieldLength );
+    iEventReason = HBufC::New (KCalendarFieldLength );
+    iAnniversaryReason = HBufC::New (KCalendarFieldLength );
+    iTodoTask = HBufC::New (KCalendarFieldLength );
+    iReminderReason = HBufC::New (KCalendarFieldLength );
+    iDescription = HBufC::New (KCalendarFieldLength );
+    iSummary = HBufC::New (KCalendarFieldLength );
+    iLocation = HBufC::New (KCalendarFieldLength );
+    iOrganizerName = HBufC::New (KCalendarFieldLength );
+    iOrganizerEmail = HBufC::New (KCalendarFieldLength );
+
+    // set defaults, start date today and end date = today + 1 month
+    iRandomModeStartTime.HomeTime ( );
+    iRandomModeEndTime = iRandomModeStartTime;
+    iRandomModeEndTime += TTimeIntervalMonths (1 );
+    iAlarmTime = Time::NullTTime();
+    iUseRandomAlarmTime = EFalse;
+    iStatus = CCalEntry::ENullStatus;
+    }
+
+CCalenderInterimParameters::~CCalenderInterimParameters ( )
+    {
+    LOGSTRING("Creator: CCalenderInterimParameters::~CCalenderInterimParameters");
+
+    delete iTodoTask;
+    delete iAnniversaryReason;
+    delete iEventReason;
+    delete iAppointmentReason;
+    delete iAppointmentLocation;
+    delete iReminderReason;
+    delete iDescription;
+    delete iSummary;
+    delete iLocation;
+    delete iOrganizerName;
+    delete iOrganizerEmail;
+    iAttendees.ResetAndDestroy();
+    iAttendees.Close();
+    iAttendeeLinkIds.Reset();
+    iAttendeeLinkIds.Close();
+    }
+
+void CCalenderInterimParameters::ParseL (CCommandParser* parser,
+        TParseParams aCase )
+    {
+    LOGSTRING("Creator: CCalenderInterimParameters::ParseL");
+
+    HBufC* tempBuf= NULL;
+
+    switch (aCase )
+        {
+
+        case MCreatorModuleBaseParameters::ECalendarTodo:
+            {
+
+            parser->StrParserL (tempBuf, '|' );
+
+            CleanupStack::PushL (tempBuf );
+
+            this->iTodoDueTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (this->iTodoTask, '|' );
+
+            parser->StrParserL (tempBuf, ';' );
+            this->iTodoPriority = 2;
+            if (tempBuf->Compare (_L("LOW") ) == 0 )
+                this->iTodoPriority = 3;
+            else
+                if (tempBuf->Compare (_L("HIGH") ) == 0 )
+                    this->iTodoPriority = 1;
+
+            CleanupStack::PopAndDestroy (tempBuf );
+
+            }
+
+        case MCreatorModuleBaseParameters::ECalendarMemo:
+            {
+
+            parser->StrParserL (tempBuf, '|' );
+
+            this->iStartTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (tempBuf, '|' );
+            this->iEndTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (this->iDescription, ';' );
+
+            CleanupStack::PopAndDestroy (tempBuf );
+            }
+
+        case MCreatorModuleBaseParameters::ECalendarMeeting:
+            {
+
+            parser->StrParserL (tempBuf, '|' );
+
+            CleanupStack::PushL (tempBuf );
+
+            this->iStartTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (tempBuf, '|' );
+            this->iEndTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (this->iLocation, '|' );
+            parser->StrParserL (this->iDescription, ';' );
+
+            CleanupStack::PopAndDestroy (tempBuf );
+            }
+
+        case MCreatorModuleBaseParameters::ECalendarAnniv:
+            {
+
+            parser->StrParserL (tempBuf, '|' );
+
+            CleanupStack::PushL (tempBuf );
+
+            this->iStartTime = TTime (tempBuf->Des ( ) );
+
+            parser->StrParserL (this->iDescription, ';' );
+
+            CleanupStack::PopAndDestroy (tempBuf );
+
+            }
+        default:
+            {
+            //implement 
+            }
+        }
+    }
+//----------------------------------------------------------------------------
+
+CCreatorInterimCalendar* CCreatorInterimCalendar::NewL (CCreatorEngine* aEngine )
+    {
+    CCreatorInterimCalendar* self = CCreatorInterimCalendar::NewLC (aEngine );
+    CleanupStack::Pop (self );
+    return self;
+    }
+
+CCreatorInterimCalendar* CCreatorInterimCalendar::NewLC (CCreatorEngine* aEngine )
+    {
+    CCreatorInterimCalendar* self = new (ELeave) CCreatorInterimCalendar;
+    CleanupStack::PushL (self );
+    self->ConstructL (aEngine );
+    return self;
+    }
+
+CCreatorInterimCalendar::CCreatorInterimCalendar ( )
+    {
+    }
+
+void CCreatorInterimCalendar::ConstructL (CCreatorEngine* aEngine )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::ConstructL");
+
+    iEngine = aEngine;
+
+    // set defaults, start date today and end date = today + 1 month
+    iRandomModeStartTime.HomeTime ( );
+    iRandomModeEndTime = iRandomModeStartTime;
+    iRandomModeEndTime += TTimeIntervalMonths (1 );
+
+    iCalSession = CCalSession::NewL ( );
+    // Create and open a calendar file
+    const TDesC& fileName = iCalSession->DefaultFileNameL ( );//default filename is: "C:Calendar"
+    TRAPD(err, iCalSession->CreateCalFileL(fileName))
+    ;
+    // ignore KErrAlreadyExists leave code
+    if (err != KErrAlreadyExists )
+        {
+        User::LeaveIfError (err );
+        }
+    // Open the calendar file
+    iCalSession->OpenL (fileName );
+    iCalEntryView = CCalEntryView::NewL (*iCalSession, *this );
+    iNumberRepeatingEntries = 0;
+    iNumberOfAttendees = 0; //iEngine->RandomNumber(2, 15);
+    iSetAlarm = EFalse;
+    iWaiter = CAsyncWaiter::NewL();
+    }
+
+CCreatorInterimCalendar::~CCreatorInterimCalendar ( )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::~CCreatorInterimCalendar");
+
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidCalendar ) );
+        }
+        
+    iEntryIds.Reset();
+    iEntryIds.Close();
+        
+    if (iParameters )
+        {
+        delete iParameters;
+        }
+
+    if (iCalEntryView )
+        {
+        delete iCalEntryView;
+        }
+
+    if (iCalSession )
+        {
+        delete iCalSession;
+        }
+    delete iSoundFileArray;
+    delete iWaiter;
+    delete iTmpCN;
+    delete iTmpEmail;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorInterimCalendar::AskDataFromUserL (TInt aCommand,
+        TInt& aNumberOfEntries )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::AskDataFromUserL");
+
+    if( aCommand == ECmdDeleteCalendarEntries )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all calendar entries?") );
+        }
+    if( aCommand == ECmdDeleteCreatorCalendarEntries )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all calendar entries created with Creator?") ); 
+        }
+
+    // display queries
+    if (iEngine->GetEngineWrapper()->EntriesQueryDialog (aNumberOfEntries, _L("How many entries to create?") ) ) // ask number of entries to create
+        {
+        if( aCommand == ECmdCreateCalendarEntryEvents ||
+            aCommand == ECmdCreateCalendarEntryAppointments)
+            {
+            _LIT(KRepeatingNum, "How many repeating (weekly) entries");
+            if( !iEngine->GetEngineWrapper()->EntriesQueryDialog(iNumberRepeatingEntries, KRepeatingNum, ETrue))
+                {
+                return EFalse;
+                }
+            _LIT(KAttendeesNum, "How many attendees to create");
+            if( !iEngine->GetEngineWrapper()->EntriesQueryDialog(iNumberOfAttendees, KAttendeesNum, ETrue))
+                {
+                return EFalse;
+                }
+            }
+        if (iEngine->GetEngineWrapper()->TimeQueryDialog(iRandomModeStartTime, _L("Start date of creation period\n dd/mm/yyyy") ) ) // ask start date
+            {
+            if (iEngine->GetEngineWrapper()->TimeQueryDialog (iRandomModeEndTime, _L("End date of creation period\n dd/mm/yyyy") ) ) // ask end date
+                {
+                if (iRandomModeStartTime > iRandomModeEndTime ) // check end date is ok
+                    {
+                    iEngine->GetEngineWrapper()->ShowNote(_L("End date must be after start date") );
+                    return EFalse;
+                    }
+                else 
+                    {
+                    if( iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add default alarm?")))
+                        {
+                        iSetAlarm = ETrue;
+                        }                   
+                    }                    
+                    return ETrue;
+                }
+            else
+                return EFalse;
+            }
+        else
+            return EFalse;
+        }
+    else
+        return EFalse;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorInterimCalendar::CreateAppointmentEntryL (
+        CCreatorModuleBaseParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL");
+        
+    delete iParameters;
+    iParameters = 0;
+    
+    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;   
+    
+    if( !parameters )
+        {
+        iParameters = new(ELeave) CCalenderInterimParameters;
+        parameters = iParameters;  
+        parameters->iRandomModeStartTime = iRandomModeStartTime;
+        parameters->iRandomModeEndTime = iRandomModeEndTime;    
+    
+        // difference between start and end times
+        TTimeIntervalMinutes differenceInMinutes;
+        parameters->iRandomModeEndTime.MinutesFrom (
+                parameters->iRandomModeStartTime, differenceInMinutes );
+
+        // start time (= something between the period start and end date)        
+        parameters->iStartTime = parameters->iRandomModeStartTime;
+        parameters->iStartTime
+                += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) );   
+        // set end time (= start time + some random time)    
+        parameters->iEndTime = parameters->iStartTime;    
+        parameters->iEndTime
+                += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) );
+        
+
+        // strings        
+        parameters->iLocation->Des ( )
+                = iEngine->RandomString (CCreatorEngine::EMeetingPlace );
+        parameters->iDescription->Des ( )
+                = iEngine->RandomString (CCreatorEngine::EMeetingReason );
+        
+        parameters->iSummary->Des()
+                        = parameters->iDescription->Des();
+        
+        parameters->iNumberRepeatingEntries = iNumberRepeatingEntries;
+        parameters->iNumberOfAttendees = iNumberOfAttendees;
+        }
+
+    TInt err = KErrNone;
+    HBufC8* guid = HBufC8::NewLC (255 );
+    TPtr8 uidP=guid->Des ( );
+    GenerateRandomId (uidP );
+    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAppt, guid,
+            CCalEntry::EMethodAdd, 0 );
+    CleanupStack::PushL (entry );
+
+    //Using same text as description and summary	
+    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
+    entry->SetSummaryL (parameters->iSummary->Des ( ) );
+    entry->SetLocationL (parameters->iLocation->Des ( ) );
+
+    TCalTime startTime;
+    TCalTime endTime;
+    // Set the start and end times using time values local to the current system time zone
+    TInt month = (TInt) parameters->iStartTime.DateTime().Month();
+    TInt date = parameters->iStartTime.DateTime().Day();
+    startTime.SetTimeLocalL (parameters->iStartTime );
+    endTime.SetTimeLocalL (parameters->iEndTime );
+    entry->SetStartAndEndTimeL (startTime, endTime );       
+    
+    if( parameters->IsAllowedEntryStatus(CCalEntry::EAppt, parameters->iStatus))
+        {
+        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL setting entry status: %d", parameters->iStatus);
+        entry->SetStatusL(parameters->iStatus);
+        }
+    
+    // Repeating times:
+    AddRepeatingRuleL(startTime, *entry, parameters);
+    SetOrganizerL(*entry, parameters);
+    
+    // Alarm:    
+    if( iSetAlarm || parameters->iUseRandomAlarmTime )
+        {        
+        SetRandomAlarmL(*entry);
+        }
+    else
+        {
+        SetAlarmL(*entry, parameters);
+        }
+        
+    // Add attendees:
+    AddAttendeesL(*entry, parameters);
+    
+    RPointerArray<CCalEntry> array;
+    CleanupClosePushL (array );
+    array.AppendL (entry );
+    
+    TInt success(0);
+    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
+    iCalEntryView->StoreL (array, success );
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( entry->LocalUidL() );
+    
+    //One item should be added at time
+    if (success != 1 )
+        {
+        err = 1;
+        }
+
+    CleanupStack::PopAndDestroy (&array );
+    CleanupStack::PopAndDestroy (entry );
+    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
+
+    return err;
+    }
+
+void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
+    {    
+    HBufC* orgName = 0;
+    HBufC* orgEmail = 0;
+    _LIT(KSpace, " ");
+    
+    //
+    // Common name
+    //
+    if( parameters == 0 || 
+        parameters->iOrganizerName == 0 || 
+        parameters->iOrganizerName->Length() == 0 )
+        {     
+        // Random:
+        TPtrC firstname  = iEngine->RandomString(CCreatorEngine::EFirstName);
+        TPtrC lastname = iEngine->RandomString(CCreatorEngine::ESurname);
+        orgName = HBufC::NewL(firstname.Length() + lastname.Length() + 1 );
+        CleanupStack::PushL(orgName);
+        orgName->Des().Copy(firstname);
+        orgName->Des().Append(KSpace);
+        orgName->Des().Append(lastname);        
+        }
+    else
+        {
+        orgName = HBufC::NewL(parameters->iOrganizerName->Length());
+        CleanupStack::PushL(orgName);
+        orgName->Des().Copy(parameters->iOrganizerName->Des());
+        }
+    
+    //
+    // Email
+    //
+    if( parameters == 0 ||
+        parameters->iOrganizerEmail == 0 || 
+        parameters->iOrganizerEmail->Length() == 0 )
+        {        
+        // Random:
+        TDesC* tmp = iEngine->CreateEmailAddressLC();
+        orgEmail = HBufC::NewL(tmp->Length());
+        orgEmail->Des().Copy(*tmp);
+        CleanupStack::PopAndDestroy(); // tmp
+        CleanupStack::PushL(orgEmail);
+        }
+    else
+        {
+        orgEmail = HBufC::NewL(parameters->iOrganizerEmail->Length());
+        CleanupStack::PushL(orgEmail);
+        orgEmail->Des().Copy(parameters->iOrganizerEmail->Des());
+        }
+    
+    SetOrganizerL(aCalEntry, orgName->Des(), orgEmail->Des(), orgEmail->Des());
+    CleanupStack::PopAndDestroy(); // orgName
+    CleanupStack::PopAndDestroy(); // orgEmail
+    }
+
+void CCreatorInterimCalendar::AddRepeatingRuleL(const TCalTime& aStartTime, CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
+    {
+    RArray<TDay> days;
+    CleanupClosePushL(days);
+    
+    // Recurrence rule. Weekly event.
+    if( parameters->iNumberRepeatingEntries > 0 )
+        {
+        TCalRRule calRepeat(TCalRRule::EWeekly);   
+        calRepeat.SetDtStart(aStartTime);
+        calRepeat.SetCount(parameters->iNumberRepeatingEntries);        
+        calRepeat.SetInterval(1);
+        //days.AppendL((TDay) iEngine->RandomNumber((TInt)EMonday, (TInt) ESunday));
+        TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek());
+        days.AppendL(tempDay);
+        calRepeat.SetByDay(days);        
+        aCalEntry.SetRRuleL(calRepeat);
+        }
+    else if(parameters->iRecurrentFrequency > TCalRRule::EInvalid)
+        {
+        TCalTime calTime;        
+        // Recurrent frequency
+        TCalRRule calRepeat(parameters->iRecurrentFrequency);
+        // Recurrent start        
+        calRepeat.SetDtStart(aStartTime);
+        if( parameters->iRecurrentFrequency == TCalRRule::EWeekly )
+        	{
+        	TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek());
+        	days.AppendL(tempDay);        
+        	calRepeat.SetByDay(days);  
+        	}
+        else if( parameters->iRecurrentFrequency == TCalRRule::EMonthly )
+        	{
+        	RArray< TInt > daysInMonth;
+        	CleanupClosePushL(daysInMonth);
+        	daysInMonth.AppendL(aStartTime.TimeLocalL().DayNoInMonth());
+        	calRepeat.SetByMonthDay(daysInMonth);
+        	CleanupStack::PopAndDestroy(&daysInMonth);
+        	}
+        else if( parameters->iRecurrentFrequency == TCalRRule::EYearly)
+        	{
+        	RArray< TMonth > monthsInYear;
+        	CleanupClosePushL(monthsInYear);
+        	monthsInYear.AppendL(aStartTime.TimeLocalL().DateTime().Month());
+        	calRepeat.SetByMonth(monthsInYear);
+        	CleanupStack::PopAndDestroy(&monthsInYear);
+        	}
+        
+        // Recurrent interval
+        if( parameters->iRecurrentInterval > 0 )
+        	calRepeat.SetInterval(parameters->iRecurrentInterval);
+                
+        // Recurrent end. End can be given as a number of repeating entries or as an end date.
+        // End date must be later than the start date, otherwise CCalEntry::SetRRuleL() panics.
+        if( parameters->iRepeatingCount > 0 )
+            {
+            calRepeat.SetCount(parameters->iRepeatingCount);
+            aCalEntry.SetRRuleL(calRepeat);            
+            }
+        else
+            {
+            TCalTime endTime;
+            endTime.SetTimeLocalL(parameters->iRecurrentEndTime);
+            if( endTime.TimeLocalL() > aStartTime.TimeLocalL())
+            	{
+            	calRepeat.SetUntil(endTime);
+            	aCalEntry.SetRRuleL(calRepeat);
+            	}
+            }           
+        }
+    CleanupStack::PopAndDestroy(&days);
+    }
+
+void CCreatorInterimCalendar::SetAlarmL(CCalEntry& aCalEntry, CCalenderInterimParameters* params)
+    {
+    if( params->iAlarmTime != Time::NullTTime() )
+        {
+        CCalAlarm* alarm = CCalAlarm::NewL();
+        CleanupStack::PushL(alarm);
+        //if( params->iAlarmTime <= params->iStartTime )
+        //	{
+        	TTimeIntervalMinutes diff;
+        	TInt err = params->iStartTime.MinutesFrom(params->iAlarmTime, diff);
+        	if( err == KErrNone)
+        		{
+        		alarm->SetTimeOffset(diff);
+        		TRAP(err, aCalEntry.SetAlarmL(alarm));
+        		if( err != KErrNone && err !=  KErrNotSupported )
+        			{
+        			User::Leave(err);
+        			}        		
+        		}
+        //	}
+        CleanupStack::PopAndDestroy(alarm);
+        }
+    }
+
+void CCreatorInterimCalendar::SetRandomAlarmL(CCalEntry& aCalEntry)
+    {
+    CCalAlarm* alarm = CCalAlarm::NewL();
+    CleanupStack::PushL(alarm);
+    alarm->SetTimeOffset(TTimeIntervalMinutes(iEngine->RandomNumber(0, 60)));
+    
+    TRAPD(err, aCalEntry.SetAlarmL(alarm));
+    if( err != KErrNone && err !=  KErrNotSupported )
+    	{
+    	User::Leave(err);
+    	}
+    CleanupStack::PopAndDestroy(alarm);
+    }
+
+void CCreatorInterimCalendar::SetPhoneOwnerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy )
+    {
+    CCalUser* phOwner = CCalUser::NewL(aEmail, aSentBy);
+    CleanupStack::PushL(phOwner);
+    TRAPD(err, aCalEntry.SetPhoneOwnerL(phOwner));            
+    CleanupStack::Pop(phOwner);
+    if( err == KErrNone )
+        {
+        phOwner->SetCommonNameL(aCN);
+        }
+    else
+        {
+        delete phOwner;
+        }
+    }
+
+void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy)
+    {
+    CCalUser* organizer = CCalUser::NewL(aEmail, aSentBy);
+    CleanupStack::PushL(organizer);
+    TRAPD(err, aCalEntry.SetOrganizerL(organizer));
+    CleanupStack::Pop(organizer);
+    if( err == KErrNone )
+        {
+        organizer->SetCommonNameL(aCN);
+        }
+    else
+        {
+        delete organizer;
+        }
+    }
+
+void CCreatorInterimCalendar::AddAttendeesL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
+    {
+    if( !parameters )
+        return;
+            
+    // Random attendees:
+    TInt numOfAttendees = parameters->iNumberOfAttendees;
+    for( TInt i = 0; i < numOfAttendees; ++i )
+        {
+        TPtrC firstname  = iEngine->RandomString(CCreatorEngine::EFirstName);
+        TPtrC lastname   = iEngine->RandomString(CCreatorEngine::ESurname);
+        TPtrC company    = iEngine->RandomString(CCreatorEngine::ECompany);
+        _LIT(KCountry, "com");        
+        TDesC* emailAddr = iEngine->CreateEmailAddressLC(firstname, lastname, company, KCountry);        
+        CCalAttendee* attendee = CCalAttendee::NewL(*emailAddr);        
+        CleanupStack::PushL(attendee);
+        aCalEntry.AddAttendeeL(attendee);
+        CleanupStack::Pop(attendee);
+        attendee->SetCommonNameL(firstname);
+                
+        // Set phone owner:
+        if( i == 1 )
+            {             
+            SetPhoneOwnerL(aCalEntry, firstname, *emailAddr, *emailAddr); 
+            attendee->SetRoleL(CCalAttendee::EReqParticipant); 
+            }
+        // Set organizer:
+        else if ( i == 0 )
+            {            
+            // Organizer is the chairman of the meeting:
+            SetOrganizerL(aCalEntry, firstname, *emailAddr, *emailAddr);
+            attendee->SetRoleL(CCalAttendee::EChair);
+            }
+        else if( i % 3 == 0 )
+            {
+            // every third attendee is optional:
+            attendee->SetRoleL(CCalAttendee::EOptParticipant);
+            }
+        else
+            {
+            // Others are required attendees:
+            attendee->SetRoleL(CCalAttendee::EReqParticipant);            
+            }
+        
+        TInt attStatus = iEngine->RandomNumber(0,5);
+        attendee->SetStatusL((CCalAttendee::TCalStatus) attStatus);
+        
+        CleanupStack::PopAndDestroy(emailAddr);
+        }
+    
+    // Explicit attendees:
+    for( TInt i = 0; i < parameters->iAttendees.Count(); ++i )
+        {
+        CCreatorCalenderAttendee* attendeeInfo = parameters->iAttendees[i];
+        if( attendeeInfo && attendeeInfo->EmailAddress().Length() > 0)
+        	{
+        	CCalAttendee* attendee = CCalAttendee::NewL(attendeeInfo->EmailAddress());
+        	CleanupStack::PushL(attendee);
+        	if( attendeeInfo->CommonName().Length() > 0 )
+        		attendee->SetCommonNameL(attendeeInfo->CommonName());
+        	attendee->SetRoleL(attendeeInfo->Role());
+        	attendee->SetStatusL(attendeeInfo->Status());
+        	attendee->SetResponseRequested(ETrue);
+        	aCalEntry.AddAttendeeL(attendee);
+        	CleanupStack::Pop(); // attendee
+        	}
+        }
+    }
+//----------------------------------------------------------------------------
+
+TInt CCreatorInterimCalendar::CreateEventEntryL (
+        CCreatorModuleBaseParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::CreateEventEntryL");
+
+    delete iParameters;
+    iParameters = 0;
+        
+    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;       
+    
+    // random data needed if no predefined data available
+    if (!parameters )
+        {
+        iParameters = new(ELeave) CCalenderInterimParameters;
+
+        iParameters->iRandomModeStartTime = iRandomModeStartTime;
+        iParameters->iRandomModeEndTime = iRandomModeEndTime;
+        iParameters->iNumberRepeatingEntries = iNumberRepeatingEntries;
+        iParameters->iNumberOfAttendees = iNumberOfAttendees;
+        
+        // difference between start and end times
+        TTimeIntervalMinutes differenceInMinutes;
+        iParameters->iRandomModeEndTime.MinutesFrom (
+                iParameters->iRandomModeStartTime, differenceInMinutes );
+
+        // start time (= something between the period start and end date)
+        iParameters->iStartTime = iParameters->iRandomModeStartTime;
+        iParameters->iStartTime
+                += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) );
+
+        // set end time (= start time + some random time)
+        iParameters->iEndTime = iParameters->iStartTime;
+        iParameters->iEndTime
+                += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) );        
+
+        // strings
+        iParameters->iDescription->Des()
+                = iEngine->RandomString (CCreatorEngine::EMemoText );
+        
+        iParameters->iSummary->Des() = iParameters->iDescription->Des();
+        
+        // Random event status:
+        iParameters->iStatus = 
+            (CCalEntry::TStatus) iEngine->RandomNumber(0, (TInt) CCalEntry::ECancelled);
+        
+        parameters = iParameters;
+        }
+
+    TInt err = KErrNone;
+    HBufC8* guid = HBufC8::NewLC (255 );
+    TPtr8 uidP=guid->Des ( );
+    GenerateRandomId (uidP );
+    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EEvent, guid,
+            CCalEntry::EMethodAdd, 0 );
+    CleanupStack::PushL (entry );
+    // iEntryUids->AppendL( *guid->Alloc() );
+    
+    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
+    entry->SetSummaryL (parameters->iSummary->Des ( ) );
+
+    TCalTime startTime;
+    TCalTime endTime;
+    // Set the start and end times using time values local to the current system time zone
+    startTime.SetTimeLocalL (parameters->iStartTime );
+    endTime.SetTimeLocalL (parameters->iEndTime );
+    entry->SetStartAndEndTimeL (startTime, endTime );
+
+    // Repeating times:
+    AddRepeatingRuleL(startTime, *entry, parameters);
+    
+    if( iSetAlarm || parameters->iUseRandomAlarmTime )
+        {        
+        SetRandomAlarmL(*entry);
+        }
+    else
+        {
+        SetAlarmL(*entry, parameters);
+        }
+    
+    // Add attendees:
+    AddAttendeesL(*entry, parameters);    
+    
+    if( parameters->IsAllowedEntryStatus(CCalEntry::EEvent, parameters->iStatus))
+        {
+        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateEventEntryL setting entry status: %d", parameters->iStatus);
+        entry->SetStatusL(parameters->iStatus);
+        }
+        
+    RPointerArray<CCalEntry> array;
+    CleanupClosePushL (array );
+    array.AppendL (entry );
+
+    TInt success(0);
+    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
+    iCalEntryView->StoreL (array, success );
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( entry->LocalUidL() );
+    
+    //One item should be added at time
+    if (success != 1 )
+        {
+        err = 1;
+        }
+
+    CleanupStack::PopAndDestroy (&array );
+    CleanupStack::PopAndDestroy (entry );
+    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
+    return err;
+
+    }
+
+//----------------------------------------------------------------------------
+
+
+TInt CCreatorInterimCalendar::CreateReminderEntryL (
+        CCreatorModuleBaseParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::CreateReminderEntryL");
+
+    delete iParameters;
+    iParameters = NULL;
+    
+    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
+
+    // random data needed if no predefined data available
+    if (!parameters )
+        {
+        iParameters = new(ELeave) CCalenderInterimParameters;
+
+        iParameters->iRandomModeStartTime = iRandomModeStartTime;
+        iParameters->iRandomModeEndTime = iRandomModeEndTime;
+
+        // difference between start and end times
+        TTimeIntervalDays
+                differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime );
+
+        // due time (= something between the period start and end date)
+        iParameters->iStartTime = iParameters->iRandomModeStartTime;
+        iParameters->iStartTime
+                += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) );
+
+        // strings
+        iParameters->iDescription->Des()
+                = iEngine->RandomString (CCreatorEngine::EReminderText );
+        
+        iParameters->iSummary->Des() = iParameters->iDescription->Des();
+
+        parameters = iParameters;
+        }
+
+    TInt err = KErrNone;
+
+    HBufC8* guid = HBufC8::NewLC (255 );
+    TPtr8 uidP=guid->Des ( );
+    GenerateRandomId (uidP );
+
+    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EReminder, guid,
+            CCalEntry::EMethodAdd, 0 );
+    CleanupStack::PushL (entry );
+
+    //Using same text as description and summary    
+    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
+    entry->SetSummaryL (parameters->iSummary->Des ( ) );
+
+    TCalTime startTime;
+    TCalTime endTime;
+    // Set the start and end times using time values local to the current system time zone
+    startTime.SetTimeLocalL (parameters->iStartTime );
+    TTime nullTime = Time::NullTTime ( );
+    endTime.SetTimeLocalL (nullTime );
+    entry->SetStartAndEndTimeL (startTime, endTime );
+        
+    if( parameters->IsAllowedEntryStatus(CCalEntry::EReminder, parameters->iStatus))
+        {
+        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateReminderEntryL setting entry status: %d", parameters->iStatus);
+        entry->SetStatusL(parameters->iStatus);
+        }
+    
+    if( iSetAlarm || parameters->iUseRandomAlarmTime )
+        {        
+        SetRandomAlarmL(*entry);
+        }
+    else
+        {
+        SetAlarmL(*entry, parameters);
+        }
+
+    RPointerArray<CCalEntry> array;
+    CleanupClosePushL (array );
+    array.AppendL (entry );
+
+    TInt success(0);
+    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
+    iCalEntryView->StoreL (array, success );
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( entry->LocalUidL() );
+    
+    //One item should be added at time
+    if (success != 1 )
+        {
+        err = 1;
+        }
+
+    CleanupStack::PopAndDestroy (&array );
+    CleanupStack::PopAndDestroy (entry );
+    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorInterimCalendar::CreateAnniversaryEntryL (
+        CCreatorModuleBaseParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::CreateAnniversaryEntryL");
+
+    delete iParameters;
+    iParameters = NULL;
+    
+    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
+
+    // random data needed if no predefined data available
+    if (!parameters )
+        {
+        iParameters = new(ELeave) CCalenderInterimParameters;
+
+        iParameters->iRandomModeStartTime = iRandomModeStartTime;
+        iParameters->iRandomModeEndTime = iRandomModeEndTime;
+
+        // difference between start and end times
+        TTimeIntervalDays differenceInDays = iParameters->iRandomModeEndTime.DaysFrom(iParameters->iRandomModeStartTime);  
+
+        // start time (= something between the period start and end date)
+        iParameters->iStartTime = iParameters->iRandomModeStartTime;
+        iParameters->iStartTime += TTimeIntervalDays( iEngine->RandomNumber(differenceInDays.Int()) );        
+        
+        // strings
+        iParameters->iDescription->Des().Copy (iEngine->RandomString (CCreatorEngine::EFirstName ) );
+        iParameters->iDescription->Des().Append ( _L("'s ") );
+        iParameters->iDescription->Des().Append (iEngine->RandomString (CCreatorEngine::EAnniversaryReason ) );
+        iParameters->iSummary->Des() = iParameters->iDescription->Des();
+        parameters = iParameters;
+        }
+ 
+    TInt err = KErrNone;
+
+    HBufC8* guid = HBufC8::NewLC (255 );
+    TPtr8 uidP=guid->Des ( );
+    GenerateRandomId (uidP );
+
+    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAnniv, guid,
+            CCalEntry::EMethodNone, 0 );
+    CleanupStack::PushL (entry );
+
+    //Using same text as description and summary	
+    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
+    entry->SetSummaryL (parameters->iSummary->Des ( ) );
+
+    TCalTime startTime;
+    TCalTime endTime;
+    TTime nullTime = Time::NullTTime ( );
+    endTime.SetTimeLocalL (nullTime );
+    
+    // Set the start time using time value local to the current system time zone
+    startTime.SetTimeLocalL (parameters->iStartTime );
+
+    entry->SetStartAndEndTimeL (startTime, endTime );
+
+    if( iSetAlarm || parameters->iUseRandomAlarmTime )
+        {        
+        SetRandomAlarmL(*entry);
+        }
+    else
+        {
+        SetAlarmL(*entry, parameters);
+        }
+    
+    //set repeating rule
+    TCalRRule yearlyRptRule(TCalRRule::EYearly);
+    yearlyRptRule.SetDtStart (startTime );
+    //Set repeating until forever, not setting it to stop
+    //yearlyRptRule.SetUntil(endTime);
+    entry->SetRRuleL (yearlyRptRule );
+
+    RPointerArray<CCalEntry> array;
+    CleanupClosePushL (array );
+    array.AppendL (entry );
+
+    TInt success(0);
+    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
+    iCalEntryView->StoreL (array, success );
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( entry->LocalUidL() );
+    
+    //One item should be added at time
+    if (success != 1 )
+        {
+        err = 1;
+        }
+
+    CleanupStack::PopAndDestroy (&array );
+    CleanupStack::PopAndDestroy (entry );
+    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorInterimCalendar::CreateTodoEntryL (
+        CCreatorModuleBaseParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::CreateTodoEntryL");
+
+    delete iParameters;
+    iParameters = NULL;
+    
+    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
+
+    // random data needed if no predefined data available
+    if (!parameters )
+        {
+        iParameters = new(ELeave) CCalenderInterimParameters;
+
+        iParameters->iRandomModeStartTime = iRandomModeStartTime;
+        iParameters->iRandomModeEndTime = iRandomModeEndTime;
+
+        // difference between start and end times
+        TTimeIntervalDays
+                differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime );
+
+        // due time (= something between the period start and end date)
+        iParameters->iTodoDueTime = iParameters->iRandomModeStartTime;
+        iParameters->iTodoDueTime
+                += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) );
+
+        // strings
+        iParameters->iDescription->Des ( )
+                = iEngine->RandomString (CCreatorEngine::EToDoText );
+        
+        iParameters->iSummary->Des() = iParameters->iDescription->Des();
+
+        //priority
+        iParameters->iTodoPriority = iEngine->RandomNumber (1, 3 );
+        iParameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber((TInt) CCalEntry::ETodoNeedsAction, (TInt) CCalEntry::ETodoInProcess);
+        parameters = iParameters;
+        
+        }
+
+    TInt err = KErrNone;
+
+    HBufC8* guid = HBufC8::NewLC (255 );
+    TPtr8 uidP=guid->Des ( );
+    GenerateRandomId (uidP );
+
+    CCalEntry* entry = CCalEntry::NewL (CCalEntry::ETodo, guid,
+            CCalEntry::EMethodAdd, 0 );
+    CleanupStack::PushL (entry );
+
+    //Using same text as description and summary	
+    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
+    entry->SetSummaryL (parameters->iSummary->Des ( ) );
+
+    entry->SetPriorityL (parameters->iTodoPriority );
+    
+    if( parameters->IsAllowedEntryStatus(CCalEntry::ETodo, parameters->iStatus))
+        {
+        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateTodoEntryL setting entry status: %d", parameters->iStatus);
+        entry->SetStatusL(parameters->iStatus);
+        }
+
+    TCalTime startTime;
+    TCalTime endTime;
+    // Set the start and end times using time values local to the current system time zone
+    startTime.SetTimeLocalL (parameters->iTodoDueTime );
+    endTime.SetTimeLocalL (parameters->iTodoDueTime );
+    entry->SetStartAndEndTimeL (startTime, endTime );
+
+    if( iSetAlarm || parameters->iUseRandomAlarmTime )
+        {        
+        SetRandomAlarmL(*entry);
+        }
+    else
+        {
+        SetAlarmL(*entry, parameters);
+        }
+    
+    RPointerArray<CCalEntry> array;
+    CleanupClosePushL (array );
+    array.AppendL (entry );
+
+    TInt success(0);
+    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
+    iCalEntryView->StoreL (array, success );
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( entry->LocalUidL() );
+    
+    //One item should be added at time
+    if (success != 1 )
+        {
+        err = 1;
+        }
+
+    CleanupStack::PopAndDestroy (&array );
+    CleanupStack::PopAndDestroy (entry );
+    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorInterimCalendar::Progress (TInt /*aPercentageCompleted*/)
+    {
+    //Not really needed but observer need to be implement
+    }
+
+void CCreatorInterimCalendar::Completed (TInt aError )
+    {
+    //Not really needed but observer need to be implement
+    LOGSTRING2("Creator: CCreatorInterimCalendar::Completed err=%d", aError);
+    }
+
+TBool CCreatorInterimCalendar::NotifyProgress ( )
+    {
+    //Not really needed but observer need to be implement
+    return NULL;
+    }
+
+//----------------------------------------------------------------------------
+
+
+void CCreatorInterimCalendar::GenerateRandomId (TDes8& aText )
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::GenerateRandomId");
+
+    aText.Zero ( );
+
+    TTime now;
+    now.UniversalTime ( );
+    TInt64 time = now.Int64 ( );
+
+    // The number of characters in the guid should be
+    // more than 8 (to ensure the guids are not too small)
+    // less than 255 (this is the maximum length of a guid)
+    // less than MaxLength of the descriptor passed in		
+    TInt numChar(0);
+    do
+        {
+        numChar = Math::Rand (time ) % (aText.MaxLength ( ) - 1);
+        }
+    while (numChar > 255|| numChar < 8 );
+
+    for (TInt i(0); i < numChar ; ++i )
+        {
+        TInt character = Math::Rand (time )%6;
+        character = Math::Rand (time ) % 26+ ((character == 2) ? 'A' : 'a');
+        aText.Append (character );
+        }
+
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorInterimCalendar::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllL");
+    TCalTime zeroTime;
+    zeroTime.SetTimeUtcL( TCalTime::MinTime() );
+    RArray<TUint32> allIds;
+    CleanupClosePushL( allIds );
+    iCalEntryView->GetIdsModifiedSinceDateL( zeroTime, allIds );
+    if ( allIds.Count() )
+        {
+        TInt successCount( KErrNotFound );
+        iCalEntryView->DeleteL( allIds, successCount );
+        if ( successCount != allIds.Count() )
+            {
+            User::Leave( KErrGeneral );
+            }        
+        }
+    CleanupStack::PopAndDestroy( &allIds );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Calendar related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidCalendar );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorInterimCalendar::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllCreatedByCreatorL");
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidCalendar );
+    
+    // delete entries
+    TInt successCount(0); // ignore
+    TRAP_IGNORE( iCalEntryView->DeleteL( iEntryIds, successCount ) );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Calendar related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidCalendar );
+    }
+
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_calendarelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,595 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_calendarelement.h"
+#include "creator_traces.h"
+#include "creator_calendar.h"
+
+using namespace creatorcalendar;
+
+CCreatorCalendarElement* CCreatorCalendarElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorCalendarElement* self = new (ELeave) CCreatorCalendarElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void CCreatorCalendarElement::FillEntryParamsL(TEntryType aType, const RPointerArray<CCreatorScriptElement>& fields, CCalenderInterimParameters* parameters)
+    {
+    if( parameters == 0 )
+        return;
+    
+    TBool startResolved = EFalse;    
+    TBool endResolved = EFalse;
+    
+    for( TInt i = 0; i < fields.Count(); ++i )
+        {
+        TPtrC elemName = fields[i]->Name();
+        TPtrC elemContent = fields[i]->Content();
+        const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+        
+        if( elemName == KSummary || elemName == KDescription )
+            {           
+            if( randomAttr || elemContent.Length() == 0 )
+                {      
+                TPtrC reason;
+                if( aType == EAppointment )
+                    {
+                    reason.Set(iEngine->RandomString (CCreatorEngine::EMeetingReason ));                    
+                    }
+                else if( aType == EEvent )
+                    {
+                    reason.Set(iEngine->RandomString(CCreatorEngine::EMemoText));                    
+                    }
+                else if( aType == EReminder )
+                    {
+                    reason.Set(iEngine->RandomString(CCreatorEngine::EReminderText));                    
+                    }
+                else if( aType == EAnniversary )
+                    {                   
+                    reason.Set(iEngine->RandomString(CCreatorEngine::EAnniversaryReason));                    
+                    }
+                else if( aType == ETodo )
+                    {
+                    reason.Set(iEngine->RandomString(CCreatorEngine::EToDoText));                    
+                    }
+                
+                if( elemName == KDescription )
+                    {
+                    delete parameters->iDescription;
+                    parameters->iDescription = 0;
+                    parameters->iDescription = HBufC::NewL(reason.Length());
+                    parameters->iDescription->Des().Copy(reason);
+                    }
+                else if(elemName == KSummary)
+                    {
+                    delete parameters->iSummary;
+                    parameters->iSummary = 0;
+                    parameters->iSummary = HBufC::NewL(reason.Length());
+                    parameters->iSummary->Des().Copy(reason);
+                    }
+                }
+            else if( elemName == KDescription )                
+                {                
+                delete parameters->iDescription;
+                parameters->iDescription = 0;
+                parameters->iDescription = HBufC::NewL(elemContent.Length());
+                parameters->iDescription->Des().Copy(elemContent);
+                }
+            else if( elemName == KSummary)
+                {
+                delete parameters->iSummary;
+                parameters->iSummary = 0;
+                parameters->iSummary = HBufC::NewL(elemContent.Length());
+                parameters->iSummary->Des().Copy(elemContent);
+                }
+            }
+        else if( elemName == KLocation )
+            {
+            delete parameters->iLocation;
+            parameters->iLocation = 0;
+            
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                TPtrC reason = iEngine->RandomString (CCreatorEngine::EMeetingPlace );
+                parameters->iLocation = HBufC::NewL(reason.Length());
+                parameters->iLocation->Des().Copy(reason);
+                }
+            else
+                {
+                parameters->iLocation = HBufC::NewL(elemContent.Length());
+                parameters->iLocation->Des().Copy(elemContent);
+                }
+            }
+        else if( elemName == KStarttime )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {                
+                // Random start time used. If end time is already resolved, let's use that one for the basis. 
+                if( endResolved )
+                    {                    
+                    parameters->iStartTime = iEngine->RandomTime(parameters->iEndTime, CCreatorEngine::EDatePast);                    
+                    }
+                else
+                    {
+                    // Past or future:
+                    CCreatorEngine::TRandomDateType pastOrfuture = 
+                    (CCreatorEngine::TRandomDateType) iEngine->RandomNumber((TInt) CCreatorEngine::EDatePast,
+                                                                            (TInt) CCreatorEngine::EDateFuture);
+                    
+                    parameters->iStartTime = 
+                        iEngine->RandomTime(iEngine->RandomDate(pastOrfuture), pastOrfuture);  
+                    }
+                }
+            else
+                {
+                parameters->iStartTime = ConvertToDateTimeL(elemContent);                
+                }            
+            startResolved = ETrue;
+            }
+        else if( elemName == KEndtime )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                // Random end time used. If start time is already resolved, let's use that one.                
+                if( startResolved )
+                    {                    
+                    parameters->iEndTime = iEngine->RandomTime(parameters->iStartTime, CCreatorEngine::EDateFuture);                    
+                    }
+                else
+                    {
+                    // Past or future:
+                    CCreatorEngine::TRandomDateType pastOrfuture = 
+                    (CCreatorEngine::TRandomDateType) iEngine->RandomNumber((TInt) CCreatorEngine::EDatePast,
+                            (TInt) CCreatorEngine::EDateFuture);
+                    
+                    parameters->iEndTime = 
+                    iEngine->RandomTime(iEngine->RandomDate(pastOrfuture), pastOrfuture);  
+                    }                          
+                }
+            else
+                {
+                parameters->iEndTime = ConvertToDateTimeL(elemContent);
+                }
+            if( aType == ETodo )
+                {
+                parameters->iTodoDueTime = parameters->iEndTime;
+                }
+            }
+        else if( elemName == KRecurrentFreq )
+            {
+            TInt randomFreq = 0;
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                randomFreq = iEngine->RandomNumber(1, 4);
+                }
+            if(randomFreq == 1 || CompareIgnoreCase(elemContent, KDaily) == 0 )
+                parameters->iRecurrentFrequency = TCalRRule::EDaily;
+            else if( randomFreq == 2 || CompareIgnoreCase(elemContent, KWeekly) == 0 )
+                parameters->iRecurrentFrequency = TCalRRule::EWeekly;
+            else if( randomFreq == 3 || CompareIgnoreCase(elemContent, KMonthly) == 0 )
+                parameters->iRecurrentFrequency = TCalRRule::EMonthly;
+            else if( randomFreq == 4 || CompareIgnoreCase(elemContent, KYearly) == 0 )
+                parameters->iRecurrentFrequency = TCalRRule::EYearly;
+            else
+                parameters->iRecurrentFrequency = TCalRRule::EInvalid;            
+            }
+        else if( elemName == KRecurrentInterval )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                parameters->iRecurrentInterval = iEngine->RandomNumber(1,7);
+                }
+            else
+                {
+                parameters->iRecurrentInterval = ConvertStrToIntL(elemContent);
+                }
+            }
+        else if( elemName == KRecurrentFrom )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                if( startResolved )
+                    {
+                    // Let's use the start time if it's resolved.
+                    parameters->iRecurrentStartTime = parameters->iStartTime;
+                    }
+                else
+                    {
+                    parameters->iRecurrentStartTime = iEngine->RandomDate(CCreatorEngine::EDateFuture);
+                    }
+                }
+            else
+                {
+                parameters->iRecurrentStartTime = ConvertToDateTimeL(elemContent);
+                }           
+            }
+        else if( elemName == KRecurrentTo )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                parameters->iRepeatingCount = iEngine->RandomNumber(1, 6);
+                //parameters->iRecurrentEndTime = iEngine->RandomDate(CCreatorEngine::EDateFuture);                
+                }
+            else
+                {
+                parameters->iRecurrentEndTime = ConvertToDateTimeL(elemContent);
+                }           
+            }
+        else if( elemName == KRepeatingCount )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                parameters->iRepeatingCount = iEngine->RandomNumber(1, 52);
+                }
+            else
+                {
+                parameters->iRepeatingCount = ConvertStrToIntL(elemContent);
+                }
+            }
+        else if( elemName == KAlarmtime )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {                
+                parameters->iUseRandomAlarmTime = ETrue;
+                }
+            else
+                {
+                parameters->iAlarmTime = ConvertToDateTimeL(elemContent);
+                }
+            }
+        else if( elemName == KOrganizername )
+            {
+            delete parameters->iOrganizerName;
+            parameters->iOrganizerName = 0;
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                TPtrC name = iEngine->RandomString (CCreatorEngine::EFirstName );
+                parameters->iOrganizerName = HBufC::NewL(name.Length());
+                parameters->iOrganizerName->Des().Copy(name);
+                }
+            else
+                {            
+                parameters->iOrganizerName = HBufC::NewL(elemContent.Length());
+                parameters->iOrganizerName->Des().Copy(elemContent);
+                }
+            }
+        else if( elemName == KOrganizeremail )
+            {
+            delete parameters->iOrganizerEmail;
+            parameters->iOrganizerEmail = 0;
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                TDesC* email = iEngine->CreateEmailAddressLC();
+                parameters->iOrganizerEmail = (HBufC*) email;
+                CleanupStack::Pop(); // email
+                }
+            else
+                {
+                parameters->iOrganizerEmail = HBufC::NewL(elemContent.Length());
+                parameters->iOrganizerEmail->Des().Copy(elemContent);
+                }
+            }
+        else if( elemName == KStatus )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                if( aType == ETodo )
+                	{
+                	parameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber(CCalEntry::ETodoNeedsAction, CCalEntry::ETodoInProcess);
+                	}
+                else
+                	{
+                	parameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber(CCalEntry::ETentative, CCalEntry::ECancelled);
+                	}
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusTentative) == 0 )
+                {
+                parameters->iStatus = CCalEntry::ETentative;
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusConfirmed) == 0 )
+                {
+                parameters->iStatus = CCalEntry::EConfirmed;
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusCancelled) == 0 )
+                {
+                parameters->iStatus = CCalEntry::ECancelled;
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusNeedsAction) == 0 )
+                {
+                parameters->iStatus = CCalEntry::ETodoNeedsAction;
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusCompleted) == 0 )
+                {
+                parameters->iStatus = CCalEntry::ETodoCompleted;
+                }
+            else if( CompareIgnoreCase(elemContent, KCalStatusInProcess) == 0 )
+                {
+                parameters->iStatus = CCalEntry::ETodoInProcess;
+                }
+            else
+                {
+                parameters->iStatus = CCalEntry::ENullStatus;
+                }
+            }
+        else if( elemName == KPriority )
+            {
+            if( randomAttr || elemContent.Length() == 0 )
+                {
+                parameters->iTodoPriority = iEngine->RandomNumber(1,3);
+                }            
+            else if( CompareIgnoreCase(elemContent, KPriorityHigh) == 0)
+                {
+                parameters->iTodoPriority = 1;
+                }
+            else if( CompareIgnoreCase(elemContent, KPriorityMedium) == 0)
+                {
+                parameters->iTodoPriority = 2;
+                }
+            else if( CompareIgnoreCase(elemContent, KPriorityLow) == 0 )
+                {
+                parameters->iTodoPriority = 3;
+                }
+            else
+                {
+                parameters->iTodoPriority = ConvertStrToIntL(elemContent);
+                }
+            }
+        else if( elemName == KAttendees )
+            {            
+            const RPointerArray<CCreatorScriptElement>& attendeesSubElems = fields[i]->SubElements();
+            for( TInt j = 0; j < attendeesSubElems.Count(); ++j )
+                {
+                TPtrC eName = attendeesSubElems[j]->Name();
+                TPtrC eContent = attendeesSubElems[j]->Content();
+                if( eName == KContactSetRef )
+                    {
+                    AppendContactSetReferenceL(*attendeesSubElems[j], parameters->iAttendeeLinkIds);
+                    }
+                else if( eName == KAttendee )
+                    {
+                    CCreatorCalenderAttendee* calAtt = CCreatorCalenderAttendee::NewL();
+                    CleanupStack::PushL(calAtt);
+                    const RPointerArray<CCreatorScriptElement>& attendeeFields = attendeesSubElems[j]->SubElements();
+                    // Make sure that at least email is given:
+                    if(attendeeFields.Count() == 0 )
+                    	{
+                    	CCreatorScriptElement* emailField =  CCreatorScriptElement::NewL(iEngine, KEmail );
+                    	CleanupStack::PushL(emailField);
+                    	fields[i]->SubElements().AppendL(emailField);
+                    	CleanupStack::Pop(); // emailField	
+                    	}
+                    for( TInt k = 0; k < attendeeFields.Count(); ++k )
+                        {
+                        const CCreatorScriptAttribute* randomAttr = attendeeFields[k]->FindAttributeByName(KRandomLength);
+                        TPtrC attElemName = attendeeFields[k]->Name();
+                        TPtrC attElemCont = attendeeFields[k]->Content();
+                        if( attElemName == KCommonname )
+                            {
+                            if( randomAttr || attElemCont.Length() == 0)
+                                {
+                                // Random data:
+                                calAtt->SetCommonNameL(iEngine->RandomString(CCreatorEngine::EFirstName));
+                                }
+                            else
+                                {
+                                calAtt->SetCommonNameL(attElemCont);
+                                }
+                            }
+                        else if( attElemName == KEmail )
+                            {
+                            if( randomAttr || attElemCont.Length() == 0)
+                                {
+                                // Random data:
+                                TDesC* email = iEngine->CreateEmailAddressLC();
+                                calAtt->SetEmailAddressL(*email);
+                                CleanupStack::PopAndDestroy(); // email
+                                }
+                            else
+                                {                                
+                                calAtt->SetEmailAddressL(attElemCont);
+                                }
+                            }
+                        else if( attElemName == KRole )
+                            {
+                            if( randomAttr || attElemCont.Length() == 0)
+                                {
+                                // Random role:
+                                CCalAttendee::TCalRole randomRole = 
+                                    (CCalAttendee::TCalRole) iEngine->RandomNumber(
+                                            (TInt) CCalAttendee::EReqParticipant, 
+                                            (TInt) CCalAttendee::EChair);
+                                calAtt->SetRole(randomRole);
+                                }                                
+                            else if( CompareIgnoreCase(attElemCont, KRoleRequired) == 0 )
+                                {
+                                calAtt->SetRole(CCalAttendee::EReqParticipant);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KRoleOptional) == 0 )
+                                {
+                                calAtt->SetRole(CCalAttendee::EOptParticipant);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KRoleNonPart) == 0 )
+                                {
+                                calAtt->SetRole(CCalAttendee::ENonParticipant);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KRoleChair) == 0 )
+                                {
+                                calAtt->SetRole(CCalAttendee::EChair);
+                                }
+                            }
+                        else if( attElemName == KStatus )
+                            {
+                            if( randomAttr || attElemCont.Length() == 0)
+                                {
+                                // Random role:
+                                CCalAttendee::TCalStatus randomStatus = 
+                                (CCalAttendee::TCalStatus) iEngine->RandomNumber(
+                                        (TInt) CCalAttendee::ENeedsAction, 
+                                        (TInt) CCalAttendee::EInProcess);
+                                calAtt->SetStatus(randomStatus);
+                                }                                
+                            else if( CompareIgnoreCase(attElemCont, KStatusNeedsAction) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::ENeedsAction);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusAccepted) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::EAccepted);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusTentative) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::ETentative);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusConfirmed) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::EConfirmed);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusDeclined) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::EDeclined);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusCompleted) == 0 )
+                                {
+                                calAtt->SetStatus(CCalAttendee::ECompleted);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusDelegated) == 0 )
+                                {                                
+                                calAtt->SetStatus(CCalAttendee::EDelegated);
+                                }
+                            else if( CompareIgnoreCase(attElemCont, KStatusInProcess) == 0 )
+                                {                                
+                                calAtt->SetStatus(CCalAttendee::EInProcess);
+                                }
+                            }
+                        }
+                    parameters->iAttendees.AppendL(calAtt);
+                    CleanupStack::Pop(); // calAtt
+                    }
+                }
+            }
+        }    
+    }
+
+void CCreatorCalendarElement::ExecuteCommandL()
+	{
+	LOGSTRING("Creator: CCreatorCalendarElement::ExecuteCommandL");
+	// Amount of calendar entries:
+	const CCreatorScriptAttribute* calEntryAmountAttr = this->FindAttributeByName(KAmount);
+	const CCreatorScriptAttribute* calEntryTypeAttr = this->FindAttributeByName(KType);    
+	TInt entryAmount = 1;    
+	if( calEntryAmountAttr )
+		{
+		entryAmount = ConvertStrToIntL(calEntryAmountAttr->Value());
+		}
+	if( calEntryTypeAttr == 0 )
+		{
+		LOGSTRING("ERROR in CCreatorCalendarElement::ExecuteCommandL: Type attribute is missing.");
+		User::Leave(KErrGeneral); // type is required attribute
+		}
+
+	// Find fields element:
+	CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+	
+	for( TInt cI = 0; cI < entryAmount; ++cI )
+		{
+		CCalenderInterimParameters* param = new (ELeave) CCalenderInterimParameters;
+		CleanupStack::PushL(param);
+		if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeAppointment) == 0 )
+			{
+			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+				{
+				FillEntryParamsL(EAppointment, fieldsElement->SubElements(), param);
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAppointments, param);
+				}
+			else
+				{
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAppointments, 0, entryAmount);
+				CleanupStack::PopAndDestroy(param);
+				break; // We can step out from the for-loop, because the amount is given to engine.
+				}
+			}		
+		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeEvent ) == 0 )
+			{
+			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+				{
+				FillEntryParamsL(EEvent, fieldsElement->SubElements(), param);
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryEvents, param);
+				}
+			else
+				{
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryEvents, 0, entryAmount);
+				CleanupStack::PopAndDestroy(param);
+				break;  // We can step out from the for-loop, because the amount is given to engine.
+				}
+			}
+		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeReminder ) == 0 )
+			{
+			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+				{
+				FillEntryParamsL(EReminder, fieldsElement->SubElements(), param);
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryReminders, param);
+				}
+			else
+				{
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryReminders, 0, entryAmount);
+				CleanupStack::PopAndDestroy(param);
+				break;  // We can step out from the for-loop, because the amount is given to engine.
+				}
+			}
+		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeAnniversary ) == 0 )
+			{
+			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+				{
+				FillEntryParamsL(EAnniversary, fieldsElement->SubElements(), param);
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAnniversaries, param);
+				}
+			else
+				{
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAnniversaries, 0, entryAmount);
+				CleanupStack::PopAndDestroy(param);
+				break;  // We can step out from the for-loop, because the amount is given to engine.
+				}
+			}
+		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeTodo ) == 0 )
+			{
+			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+				{
+				FillEntryParamsL(ETodo, fieldsElement->SubElements(), param);
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryToDos, param);
+				}
+			else
+				{
+				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryToDos, 0, entryAmount);
+				CleanupStack::PopAndDestroy(param);
+				break;  // We can step out from the for-loop, because the amount is given to engine.
+				}
+			}
+		CleanupStack::Pop(); // param
+		}
+	}
+
+CCreatorCalendarElement::CCreatorCalendarElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_cmdscriptrun.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <EIKENV.H>
+#include <COEAUI.H>  
+#include <pathinfo.h> 
+#include "creator_cmdscriptrun.h"
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator.pan"
+
+
+// delay before script running and application exiting in seconds
+// when script is run from command line
+const TInt KCommandLineDelay = 3;
+
+//----------------------------------------------------------------------------
+
+CCreatorCmdScriptRun* CCreatorCmdScriptRun::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorCmdScriptRun* self = CCreatorCmdScriptRun::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorCmdScriptRun* CCreatorCmdScriptRun::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorCmdScriptRun* self = new (ELeave) CCreatorCmdScriptRun;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+
+// ConstructL 
+void CCreatorCmdScriptRun::ConstructL(CCreatorEngine* aEngine)
+    {
+    iEngine = aEngine;
+ 
+	iMode = ETimerModeNone;
+	iTickCount = 0;
+    iTimer = CHeartbeat::NewL(0);
+    
+    // parse script name and random data file name from command line
+    iCommandLineScriptName = HBufC::NewL(User::CommandLineLength());
+    iCommandLineRandomDataFileName = HBufC::NewL(User::CommandLineLength());
+    HBufC* commandLine = HBufC::NewLC(User::CommandLineLength());
+    TPtr16 ptr = commandLine->Des();
+    User::CommandLine(ptr);
+    commandLine->Des().Trim();
+    
+    TInt pos = commandLine->Des().Find(_L(" "));
+    if (pos != KErrNotFound)
+    	{
+    	iCommandLineScriptName->Des().Copy(commandLine->Des().Left(pos));
+    	iCommandLineRandomDataFileName->Des().Copy(commandLine->Des().Mid(pos));
+    	iCommandLineRandomDataFileName->Des().Trim();
+    	}
+    else
+    	{
+    	iCommandLineScriptName->Des().Copy(commandLine->Des());
+    	iCommandLineRandomDataFileName->Des().Copy(KNullDesC);
+    	}
+
+    CleanupStack::PopAndDestroy(commandLine);
+    
+    if (iCommandLineScriptName->Des().Length() > 0)
+    	{
+    	iMode = ETimerModeStartScript;
+    	iTimer->Start(ETwelveOClock, this);
+    	}
+    }
+
+
+ CCreatorCmdScriptRun::CCreatorCmdScriptRun()                              
+    {
+    // add any construction that cannot leave here
+    }
+
+
+ CCreatorCmdScriptRun::~CCreatorCmdScriptRun()
+    {
+    delete iCommandLineRandomDataFileName;
+    delete iCommandLineScriptName;
+    
+    if (iTimer)
+    	{
+    	iTimer->Cancel();
+        delete iTimer;
+        iTimer = NULL;
+    	}
+    }
+
+void  CCreatorCmdScriptRun::RunScriptDone()
+	{
+	if (iMode == ETimerModeStartScript)
+		{
+		iMode = ETimerModeExitAppUi;
+		iTimer->Start(ETwelveOClock, this);
+		}
+	}
+
+void  CCreatorCmdScriptRun::Beat()
+	{
+	Tick();
+	}
+
+void  CCreatorCmdScriptRun::Synchronize()
+	{
+	Tick();
+	}
+
+void  CCreatorCmdScriptRun::Tick()
+	{
+	iTickCount++;
+	if (iTickCount > KCommandLineDelay)
+		{
+		iTimer->Cancel();
+		iTickCount = 0;
+		if (iMode == ETimerModeStartScript)
+			{
+        	iEngine->GetRandomDataFromFileL(*iCommandLineRandomDataFileName);
+			TInt status = iEngine->RunScriptL(*iCommandLineScriptName);
+			if (status != KErrNone)
+				{
+				TBuf<128> noteMsg;
+				if (status == KErrNotFound)
+					{
+					_LIT(KMessage1, "Error in opening script file.");
+					noteMsg.Copy(KMessage1);
+					}
+				else if (status == KErrCorrupt)
+					{
+					_LIT(KMessage2, "Error in parsing script file.");
+					noteMsg.Copy(KMessage2);
+					}
+				else if (status == KErrCompletion)
+					{
+					_LIT(KMessage3, "Script file does not contain any elements.");
+					noteMsg.Copy(KMessage3);
+					}
+				else
+					{
+					_LIT(KMessage4, "Unknown error in opening script file.");
+					noteMsg.Copy(KMessage4);
+					}
+				iEngine->GetEngineWrapper()->ShowNote(noteMsg);
+				RunScriptDone();
+				}
+			}
+		else if (iMode == ETimerModeExitAppUi)
+	    	{
+	    	iMode = ETimerModeNone;
+	    	iEngine->GetEngineWrapper()->CloseCreatorApp();
+	    	}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_connectionmethod.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,952 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_connectionmethod.h" 
+#include "creator_traces.h"
+
+
+
+using namespace CMManager;
+//#define KUidLanBearerType  0x1020737A
+#include <cmpluginpacketdatadef.h>  
+#include <cmplugincsddef.h> 
+#include <cmpluginhscsddef.h> 
+#include <cmmanagerext.h>
+#include <cmdestinationext.h> 
+#include <cmpluginembdestinationdef.h>
+#include <cmpluginvpndef.h>
+#include <cmpluginlandef.h> 
+#include <cmdefconnvalues.h>
+#include <cmconnectionmethoddef.h>
+
+
+#include <wlanmgmtinterface.h>
+#include <wlanmgmtclient.h>
+#include <wlanmgmtclient.inl> 
+#include <wlanmgmtcommon.h> 
+#include <wlanscaninfo.h> 
+#include <wlanscaninfo.inl> 
+#include <wlanscaninfointerface.h>
+
+//#include <WEPSecuritySettingsUI.h>//For WEP setting
+//#include <dbcreatorcommon.h>
+
+static const TInt KConnectionSettingssFieldLength = 128;
+
+_LIT(KCreatorConnectionSettingssPrefixName, "CR_");
+
+//----------------------------------------------------------------------------
+
+CConnectionSettingsParameters::CConnectionSettingsParameters()
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::CConnectionSettingsParameters");
+        
+    iConnectionName = HBufC::New(KConnectionSettingssFieldLength);
+    iStartPage = HBufC::New(KConnectionSettingssFieldLength);
+    iLoginName = HBufC::New(KConnectionSettingssFieldLength);
+    iLoginPass = HBufC::New(KConnectionSettingssFieldLength);
+    iIPAddr = HBufC::New(KConnectionSettingssFieldLength);
+    iIP4NameServer1 = HBufC::New(KConnectionSettingssFieldLength);
+    iIP4NameServer2 = HBufC::New(KConnectionSettingssFieldLength);
+    iDefaultTelNumber = HBufC::New(KConnectionSettingssFieldLength);
+    iProxyServerAddress = HBufC::New(KConnectionSettingssFieldLength);
+    iSubnetMask = HBufC::New(KConnectionSettingssFieldLength); 
+    iGatewayAddress = HBufC::New(KConnectionSettingssFieldLength);
+    iWLANName = HBufC::New(KConnectionSettingssFieldLength);
+    iWlanIpAddr = HBufC::New(KConnectionSettingssFieldLength);
+    iIP6NameServer1 = HBufC::New(KConnectionSettingssFieldLength);
+    iIP6NameServer2 = HBufC::New(KConnectionSettingssFieldLength);
+    }
+
+CConnectionSettingsParameters::~CConnectionSettingsParameters()
+    {
+    LOGSTRING("Creator: CConnectionSettingssParameters::~CConnectionSettingssParameters");
+
+    delete iProxyServerAddress;
+    delete iDefaultTelNumber;
+    delete iIP4NameServer2;
+    delete iIP4NameServer1;
+    delete iIPAddr;    
+    delete iLoginPass;
+    delete iLoginName;
+    delete iStartPage;
+    delete iConnectionName;
+    delete iSubnetMask;  
+    delete iGatewayAddress;
+    delete iWLANName;
+    delete iWlanIpAddr;
+    delete iIP6NameServer1;
+    delete iIP6NameServer2;    
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorConnectionSettings* CCreatorConnectionSettings::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorConnectionSettings* self = CCreatorConnectionSettings::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorConnectionSettings* CCreatorConnectionSettings::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorConnectionSettings* self = new (ELeave) CCreatorConnectionSettings;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorConnectionSettings::CCreatorConnectionSettings()
+    {
+    }
+
+void CCreatorConnectionSettings::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::ConstructL");
+
+    iEngine = aEngine;
+    
+    iCmManagerExt.CreateTablesAndOpenL();
+    }
+
+CCreatorConnectionSettings::~CCreatorConnectionSettings()
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::~CCreatorConnectionSettings");
+
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidIAP ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    if (iParameters)
+        {
+        delete iParameters;
+        }
+    
+    iCmManagerExt.Close();
+    }
+    
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorConnectionSettings::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::AskDataFromUserL");
+
+    if( aCommand == ECmdDeleteIAPs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Connection Methods?") );
+        }
+    else if( aCommand == ECmdDeleteCreatorIAPs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Connection Methods created with Creator?") );
+        }
+    else
+        {
+        return iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"));
+        }
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorConnectionSettings::CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::CreateConnectionSettingsEntryL");
+
+    CConnectionSettingsParameters* parameters = (CConnectionSettingsParameters*) aParameters;
+    
+    // clear any existing parameter definations 
+    delete iParameters;
+    iParameters = NULL;
+            
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new (ELeave) CConnectionSettingsParameters();
+        parameters = iParameters;
+        SetRandomParametersL(*parameters);
+        }
+    
+    if( parameters->iBearerType == KRandomBearerType )
+    	{
+    	SetRandomBearerTypeL(*parameters);
+    	}
+    
+    TInt err = KErrNone;
+
+    // create unique name for each network destination
+    RCmDestinationExt dest;
+    TInt destinationError = KErrNone;
+    TInt count = 0;
+	TBuf<KConnectionSettingssFieldLength> name;
+	name.Copy(parameters->iConnectionName->Des());
+    do
+    	{
+    	TRAP(destinationError, dest = iCmManagerExt.CreateDestinationL(name));
+    	if (destinationError == KErrAlreadyExists)
+    		{
+    		name.Copy(parameters->iConnectionName->Des());
+    		count++;
+    		name.AppendFormat(_L(" (%d)"), count);
+    		}
+    	else if (destinationError != KErrNone)
+    		{
+    		User::Leave(destinationError);
+    		}
+    	}
+    while (destinationError == KErrAlreadyExists);
+    parameters->iConnectionName->Des().Copy(name);        
+
+    CleanupClosePushL(dest);
+    dest.UpdateL();
+    
+    RCmConnectionMethodExt conMethod = dest.CreateConnectionMethodL( parameters->iBearerType);//KUidPacketDataBearerType
+    CleanupClosePushL( conMethod );
+    
+    if(parameters->iBearerType == KUidWlanBearerType)
+        {
+        //IP net mask of interface
+        conMethod.SetStringAttributeL( EWlanIpNetMask, parameters->iSubnetMask->Des()  );
+
+        //IP address of EPOC.
+        conMethod.SetStringAttributeL( EWlanIpAddr, parameters->iWlanIpAddr->Des()  );
+        //
+        //following gateway ID:s is not workin, 
+        //logically ID would be EWlanIpGateway because EWlanIpNetMask
+        //is going to net mask, which is just before gateway in ui
+        //--->
+        conMethod.SetStringAttributeL( EWlanIpGateway, parameters->iGatewayAddress->Des()  );
+        //conMethod.SetStringAttributeL( EApIspIPGateway, parameters->iGatewayAddress->Des()  );
+        conMethod.SetStringAttributeL( ECmWapIPGatewayAddress, parameters->iGatewayAddress->Des()  );
+        conMethod.SetStringAttributeL( ECmIPGateway, parameters->iGatewayAddress->Des()  );
+        //<---
+        
+        //IP Address of primary and secondary name server (IP v4).
+        conMethod.SetStringAttributeL( EWlanIpNameServer1, parameters->iIP4NameServer1->Des()  );
+        conMethod.SetStringAttributeL( EWlanIpNameServer2, parameters->iIP4NameServer2->Des()  );
+        //The SSID of this WLAN connection.
+        conMethod.SetStringAttributeL( EWlanSSID, parameters->iWLANName->Des()  );
+
+        //IP6 address of primary and secondary name servers
+        conMethod.SetStringAttributeL( EWlanIp6NameServer1, parameters->iIP6NameServer1->Des()  );
+        conMethod.SetStringAttributeL( EWlanIp6NameServer2, parameters->iIP6NameServer2->Des()  );        
+
+        //
+        //Setting secure mode settings
+        //
+        
+        //Network status (default: EWlanSecModeOpen) // EWlanAuthenticationMode use instead?
+        conMethod.SetIntAttributeL( EWlanSecurityMode, parameters->iWLanSecMode );
+        //WLAN Network mode  
+        conMethod.SetIntAttributeL( EWlanConnectionMode, parameters->iWlanNetMode );
+        
+        
+        if(parameters->iWLanSecMode == EWlanSecModeOpen)
+            {}//Nothing to set when mode is open
+        else if(parameters->iWLanSecMode == EWlanSecModeWep)
+            {
+            //See WEPSecuritySettingsUI.h
+            
+            
+            ///CWEPSecuritySettings
+           // conMethod.SetIntAttributeL( EWlanSecurityMode, parameters->iWLanSecMode );
+            }
+        else if(parameters->iWLanSecMode == EWlanSecMode802_1x)
+            {
+            }
+        else if(parameters->iWLanSecMode == EWlanSecModeWpa)
+            {
+            }
+        else if(parameters->iWLanSecMode == EWlanSecModeWpa2)
+            {
+            }            
+        
+        //WLAN security setting 
+        //conMethod.SetStringAttributeL( EWlanAuthenticationMode, parameters->iIP6NameServer2->Des()  );
+        //Utilise this method
+        //conMethod.SetStringAttributeL( EWlanSecurityMode, parameters->iWLanSecMode  );
+        }
+    //Not known special attributes for packet data 
+    else if(parameters->iBearerType == KUidPacketDataBearerType)
+        {
+
+        //Access point name.
+        conMethod.SetStringAttributeL( EPacketDataAPName, parameters->iConnectionName->Des() );//crash
+        
+        //Authentication user name
+        conMethod.SetStringAttributeL( EPacketDataIFAuthName, parameters->iLoginName->Des()  );
+        ///TProtocolType a;
+        //EPdpTypeIPv4 or EPdpTypeIPv6
+        conMethod.SetIntAttributeL( EPacketDataPDPType, parameters->iProtocolType  );
+                
+        //IP6 address of primary and secondary name servers
+        conMethod.SetStringAttributeL( EPacketDataIPIP6NameServer1, parameters->iIP6NameServer1->Des()  );
+        conMethod.SetStringAttributeL( EPacketDataIPIP6NameServer2, parameters->iIP6NameServer2->Des()  );                
+        //IP address of primary name server
+        conMethod.SetStringAttributeL( EPacketDataIPNameServer1, parameters->iIP4NameServer1->Des()  );
+        //IP address of secondary name server
+        conMethod.SetStringAttributeL( EPacketDataIPNameServer2, parameters->iIP4NameServer2->Des()  );
+        
+        //Also existing but UI not showing them: EPacketDataHeaderCompression, EPacketDataDisablePlainTextAuth
+        //EPacketDataIFAuthPass, EDialIFAuthPass, EPacketDataIFPromptForAuth, EPacketDataIPAddr
+        }
+    else if(parameters->iBearerType == KUidCSDBearerType || parameters->iBearerType == KUidHSCSDBearerType)
+        {
+        //Authentication user name
+        conMethod.SetStringAttributeL( EDialIFAuthName, parameters->iLoginName->Des()  );
+        //Dial-up number
+        conMethod.SetStringAttributeL( EDialDefaultTelNum, parameters->iDefaultTelNumber->Des() );
+        //Call type
+        conMethod.SetIntAttributeL( EDialCallType , parameters->iBearerCallTypeIsdn );
+        //Maximum speed
+        conMethod.SetIntAttributeL( EDialMaxConnSpeed, parameters->iBearerSpeed );
+        //Prompt user for username and password? (Only for dial out)
+        conMethod.SetBoolAttributeL( EDialPromptForLogin, parameters->iPromptPassword );
+        //IP6 address of primary and secondary name servers
+        conMethod.SetStringAttributeL( EDialIP6NameServer1, parameters->iIP6NameServer1->Des()  );
+        conMethod.SetStringAttributeL( EDialIP6NameServer2, parameters->iIP6NameServer2->Des()  );         
+        //Disable plaintext authentication
+        conMethod.SetBoolAttributeL( EDialDisablePlainTextAuth, parameters->iDisableTextAuth );       
+        //IP address of primary name server
+        conMethod.SetStringAttributeL( EDialIPNameServer1, parameters->iIP4NameServer1->Des()  );
+        //IP address of secondary name server
+        conMethod.SetStringAttributeL( EDialIPNameServer2, parameters->iIP4NameServer2->Des()  );
+
+        //Also existing  EDialEnableIPHeaderComp; EDialIFPromptForAuth;EDialIPAddress parameters
+        
+        }
+    else if(parameters->iBearerType == KUidLanBearerType)
+        {
+
+        conMethod.SetStringAttributeL( ELanIpNetMask, parameters->iSubnetMask->Des() );
+        conMethod.SetStringAttributeL( ELanIpGateway, parameters->iGatewayAddress->Des());
+        conMethod.SetStringAttributeL( ELanIpAddr, parameters->iIPAddr->Des() );
+        conMethod.SetStringAttributeL( ELanIpNameServer1, parameters->iIP4NameServer1->Des() );
+        conMethod.SetStringAttributeL( ELanIpNameServer2, parameters->iIP4NameServer2->Des() );
+        conMethod.SetStringAttributeL( ELanIp6NameServer1,parameters->iIP6NameServer1->Des() );
+        conMethod.SetStringAttributeL( ELanIp6NameServer2,parameters->iIP6NameServer2->Des() );
+        
+        }
+    else //KUidEmbeddedDestination and KPluginVPNBearerTypeUid
+        {
+        //NOTE: NOT Tested, because no supporting Emulator for them
+        
+        //Authentication user name
+        conMethod.SetStringAttributeL( ECmIFAuthName, parameters->iLoginName->Des()  );
+        //IP6 address of primary and secondary name servers
+        conMethod.SetStringAttributeL( ECmIP6NameServer1, parameters->iIP6NameServer1->Des()  );
+        conMethod.SetStringAttributeL( ECmIP6NameServer2, parameters->iIP6NameServer2->Des()  );        
+        //Disable plaintext authentication
+        conMethod.SetBoolAttributeL( ECmDisablePlainTextAuth, parameters->iDisableTextAuth );
+        //Prompt user for authentication
+        conMethod.SetBoolAttributeL( ECmIFPromptForAuth, parameters->iPromptPassword );
+        //Authentication password
+        conMethod.SetStringAttributeL( ECmIFAuthPass, parameters->iLoginPass->Des()  );
+        }
+    
+    //
+    //Adding common attributes, all not neccessary used with all bearer types, but should not cause any problems eather
+    //
+
+    //CM Name (Connection Method, formelly known as Access Point)         
+    conMethod.SetStringAttributeL( ECmName, parameters->iConnectionName->Des() );        
+    // Start page of CM
+    conMethod.SetStringAttributeL( ECmStartPage, parameters->iStartPage->Des() );
+    // Enable Proxy   
+    conMethod.SetBoolAttributeL( ECmProxyUsageEnabled, parameters->iUseProxy );
+    // Server Name
+    conMethod.SetStringAttributeL( ECmProxyServerName, parameters->iProxyServerAddress->Des() );
+    // Port Number
+    conMethod.SetIntAttributeL( ECmProxyPortNumber, parameters->iProxyPortNumber );
+    //Proxy login name
+    conMethod.SetStringAttributeL( ECmWapIPProxyLoginName, parameters->iLoginName->Des() );
+    //Proxy login password
+    conMethod.SetStringAttributeL( ECmWapIPProxyLoginPass, parameters->iLoginPass->Des() );
+    //IP address of gateway
+    conMethod.SetStringAttributeL( ECmIPGateway, parameters->iGatewayAddress->Des() );
+    //connection-oriented or connectionless API should be used
+    //ECmWapIPWSPOption option TWapWSPOption: ECmWapWspOptionConnectionless or ECmWapWspOptionConnectionOriented    
+    conMethod.SetIntAttributeL( ECmWapIPWSPOption, parameters->iWapWspOption );   
+    //NOT WORKING????? Attempt secure WTLS connection to the gateway
+    conMethod.SetBoolAttributeL( ECmWapIPSecurity, parameters->iSecureAuthentication );
+      
+    //
+    //Adding advanced settings (Network type, Phone IP addr, DNS addr, proxy srv name, proxy port nbr
+    //
+    
+    //IP address of interface
+    conMethod.SetStringAttributeL( ECmIPAddress, parameters->iIPAddr->Des() );    
+    //IP address of primary name server
+    conMethod.SetStringAttributeL( ECmIPNameServer1, parameters->iIP4NameServer1->Des()  );
+    //IP address of secondary name server
+    conMethod.SetStringAttributeL( ECmIPNameServer2, parameters->iIP4NameServer2->Des()  );
+      
+    
+    conMethod.UpdateL();
+
+    //If no defaults set, set the created CM as a default
+    SetDefaultCML( conMethod );
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( dest.Id() );
+    
+    conMethod.Close();
+    CleanupStack::Pop(  );//conMethod
+    
+    dest.UpdateL();
+    dest.Close();
+    CleanupStack::Pop(); // dest
+        
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+void CConnectionSettingsParameters::SetRandomCMNameL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomCMNameL");
+
+    TInt num = aEngine.RandomNumber(1, 3);
+    TBuf<10> apType;
+
+    if (num==1)
+        {
+        apType = _L("mms");
+        }            
+    else if (num==2)
+        {
+        apType = _L("wap");
+        }
+    else
+        {
+        apType = _L("internet");
+        }
+    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
+    iConnectionName->Des() = KCreatorConnectionSettingssPrefixName;
+    iConnectionName->Des().Append( company );
+    iConnectionName->Des().Append(_L(" "));
+    iConnectionName->Des().Append(apType);
+    }
+
+void CConnectionSettingsParameters::SetRandomWLANNameL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANNameL");
+
+    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
+    iWLANName->Des() = KCreatorConnectionSettingssPrefixName;
+    iWLANName->Des().Append( company );
+    iWLANName->Des().Append( _L(" WLAN") );
+    }
+
+void CConnectionSettingsParameters::SetRandomWLANNetModeL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANNetModeL");
+
+    TInt wlanNetModeRand = aEngine.RandomNumber(1, 2);
+    if(wlanNetModeRand == 1)
+        {
+        iWlanNetMode = EAdhoc;//Ad-Hoc mode
+        }
+    else
+        {
+        iWlanNetMode = CMManager::EInfra;//Infrastructure mode
+        } 
+    }
+
+void CConnectionSettingsParameters::SetRandomWLANSecurityModeL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANSecurityModeL");
+
+    TInt wlanSecModeRand = aEngine.RandomNumber(1, 5);
+    if(wlanSecModeRand == 1)
+        {
+        iWLanSecMode = EWlanSecModeOpen;///< Open security mode
+        }
+    else if(wlanSecModeRand == 2)
+        {
+        iWLanSecMode = EWlanSecModeWep;///< WEP security mode
+        //See WEPSecuritySettingsUI.h
+                
+        ///CWEPSecuritySettings
+                
+        //WEP key in us
+        
+        //Authentication type
+                
+        //WEP Key settings (key len, key format, key data)        
+        }
+    else if(wlanSecModeRand == 3)
+        {
+        iWLanSecMode = EWlanSecMode802_1x; ///< 802.1x security mode
+        }
+    else if(wlanSecModeRand == 4)
+        {
+        iWLanSecMode = EWlanSecModeWpa;///< WPA security mode
+        }
+    else if(wlanSecModeRand == 5)
+        {
+        iWLanSecMode = EWlanSecModeWpa2;///< WPA@ security mode
+        }
+    }
+
+void CConnectionSettingsParameters::SetRandomLoginNameL(CCreatorEngine& aEngine)
+    {
+    iLoginName->Des() = aEngine.RandomString(CCreatorEngine::EFirstName);
+    iLoginName->Des().LowerCase();
+    }
+
+void CConnectionSettingsParameters::SetRandomLoginPassL(CCreatorEngine& aEngine)
+    {
+    iLoginPass->Des() = aEngine.RandomString(CCreatorEngine::ESurname);
+    iLoginPass->Des().LowerCase();
+    }
+
+void CConnectionSettingsParameters::SetRandomSecureAuthenticationL(CCreatorEngine& /*aEngine*/)
+    {
+    iSecureAuthentication = EFalse;
+    }
+
+void CConnectionSettingsParameters::SetRandomPromptPasswordL(CCreatorEngine& /*aEngine*/)
+    {
+    iPromptPassword = ETrue;
+    }
+
+void CConnectionSettingsParameters::SetRandomUseProxyL(CCreatorEngine& /*aEngine*/)
+    {
+    iUseProxy = ETrue;
+    }
+
+void CConnectionSettingsParameters::SetRandomProxyAddressL(CCreatorEngine& /*aEngine*/)
+    {
+    iProxyServerAddress->Des() = _L("127.0.0.1");
+    }
+
+void CConnectionSettingsParameters::SetRandomProxyPortL(CCreatorEngine& /*aEngine*/)
+    {
+    iProxyPortNumber = 80;
+    }
+
+void CConnectionSettingsParameters::SetRandomStartPageL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomStartPageL");
+
+    TInt num = aEngine.RandomNumber(1, 3);
+    TBuf<10> apType;
+
+    if (num==1)
+        {
+        apType = _L("mms");
+        }            
+    else if (num==2)
+        {
+        apType = _L("wap");
+        }
+    else
+        {
+        apType = _L("internet");
+        }
+    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);    
+    iStartPage->Des() = _L("http://");
+    iStartPage->Des().Append(apType);
+    iStartPage->Des().Append(_L("."));
+    iStartPage->Des().Append(company);
+    iStartPage->Des().Append(_L(".com"));
+    iStartPage->Des().LowerCase();
+    }
+
+void CConnectionSettingsParameters::SetRandomIPAddressL(CCreatorEngine& /*aEngine*/)
+    {
+    iIPAddr->Des() = _L("10.10.10.10");
+    }
+
+void CConnectionSettingsParameters::SetRandomIP4NameServer1L(CCreatorEngine& /*aEngine*/)
+    {
+    iIP4NameServer1->Des() = _L("10.1.1.1");
+    }
+void CConnectionSettingsParameters::SetRandomIP4NameServer2L(CCreatorEngine& /*aEngine*/)
+    {
+    iIP4NameServer2->Des() = _L("10.2.2.2");
+    }
+
+void CConnectionSettingsParameters::SetRandomProtocolTypeL(CCreatorEngine& aEngine)
+    {
+    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomProtocolTypeL");
+
+    TInt protocolTypeRand = aEngine.RandomNumber(1, 2);
+    if(protocolTypeRand == 1)
+        {
+        iProtocolType = RPacketContext::EPdpTypeIPv4;
+        }
+    else
+        {
+        iProtocolType = RPacketContext::EPdpTypeIPv6;
+        }
+    }
+
+void CConnectionSettingsParameters::SetRandomTelephoneNumberL(CCreatorEngine& aEngine)
+    {
+    iDefaultTelNumber->Des() = aEngine.RandomString(CCreatorEngine::EPhoneNumber);
+    }
+
+void CConnectionSettingsParameters::SetRandomBearerTypeIsdnL(CCreatorEngine& /*aEngine*/)
+    {
+    iBearerCallTypeIsdn = ECmCallTypeISDNv110;
+    }
+
+void CConnectionSettingsParameters::SetRandomBearerSpeedL(CCreatorEngine& /*aEngine*/)
+    {
+    iBearerSpeed = ECmSpeed14400;
+    }
+
+void CConnectionSettingsParameters::SetRandomWapWspOptionL(CCreatorEngine& /*aEngine*/)
+    {
+    iWapWspOption = ECmWapWspOptionConnectionless;
+    }
+
+void CConnectionSettingsParameters::SetRandomSubnetMaskL(CCreatorEngine& /*aEngine*/)
+    {
+    iSubnetMask->Des() = _L("255.255.255.0");
+    }
+
+void CConnectionSettingsParameters::SetRandomGatewayAddressL(CCreatorEngine& /*aEngine*/)
+    {
+    iGatewayAddress->Des() = _L("10.0.0.1");
+    }
+
+void CConnectionSettingsParameters::SetRandomWlanIpAddrL(CCreatorEngine& /*aEngine*/)
+    {
+    iWlanIpAddr->Des() = _L("10.0.0.99");
+    }
+
+void CConnectionSettingsParameters::SetRandomIPv6NameServer1L(CCreatorEngine& /*aEngine*/)
+    {
+    iIP6NameServer1->Des() = _L("2007:abcd:1000:2000:3000:4000:5000:6001");
+    }
+
+void CConnectionSettingsParameters::SetRandomIPv6NameServer2L(CCreatorEngine& /*aEngine*/)
+    {
+    iIP6NameServer2->Des() = _L("2007:abcd:1000:2000:3000:4000:5000:6002");
+    }
+
+void CConnectionSettingsParameters::SetRandomDisableTextAuthL(CCreatorEngine& /*aEngine*/)
+    {
+    iDisableTextAuth = EFalse;
+    }
+
+void CCreatorConnectionSettings::SetRandomBearerTypeL(CConnectionSettingsParameters& parameters)
+	{
+    LOGSTRING("Creator: CCreatorConnectionSettings::SetRandomBearerTypeL");
+
+	RArray<TUint32> supportedBearers = RArray<TUint32>( 10 );
+	iCmManagerExt.SupportedBearersL(supportedBearers);
+	CleanupClosePushL( supportedBearers );
+	    
+	//In random mode, skipping KUidLanBearerType
+	//Because of Emulator migh show it as supported, when it's really not
+	//and that causes weird situation in UI when there is an item, but it can't be opened
+	TInt lanID = supportedBearers.Find(KUidLanBearerType);
+	if( lanID != KErrNotFound )
+		{
+		supportedBearers.Remove(lanID);
+		}
+	
+	// in emulator remove WLAN
+	#ifdef __WINSCW__	
+	TInt wlanID = supportedBearers.Find(KUidWlanBearerType);
+	if( wlanID != KErrNotFound )
+		{
+		supportedBearers.Remove(wlanID);
+		}
+	#endif	
+				
+	/*
+	    for(TInt i = 0; i<supportedCount; i++)
+	        {
+	        TUint bearer = supportedBearers[i];
+	        if(bearer == KUidLanBearerType)
+	            {
+	            supportedBearers.Remove(i);
+	            }
+	        }
+	    */
+	    
+	//Select random bearer type. 
+	//Also possible to use SupportedBearersL() -method to find supported methods
+	//but using that will cause problems when setting attributes.
+	TInt supportedCount = supportedBearers.Count();    
+	TInt bearerTypeID = iEngine->RandomNumber(0, supportedCount-1);
+	    
+	TUint bearerType = supportedBearers[bearerTypeID];
+	    
+	//Bearer types KUidEmbeddedDestination and KPluginVPNBearerTypeUid is not supported
+	if(bearerType == KUidWlanBearerType)//Wireless LAN
+		{            
+		parameters.iBearerType = KUidWlanBearerType;
+		}
+	else if(bearerType == KUidPacketDataBearerType)//Packet data (GPRS)
+		{
+		parameters.iBearerType = KUidPacketDataBearerType;
+		}
+	else if(bearerType == KUidCSDBearerType)//Data Call
+		{
+		parameters.iBearerType = KUidCSDBearerType;
+		}
+	else if(bearerType == KUidHSCSDBearerType) //High speed GSM
+		{
+		parameters.iBearerType = KUidHSCSDBearerType;
+		}
+	else if(bearerType == KUidEmbeddedDestination)
+		{
+		parameters.iBearerType = KUidEmbeddedDestination;
+		}
+	else// if(bearerType == KPluginVPNBearerTypeUid)
+		{
+		parameters.iBearerType = KPluginVPNBearerTypeUid;
+		}
+	/* In random mode skipping LAN type
+	    else// if(bearerType == KUidLanBearerType)
+	        {
+	        iBearerType = KUidLanBearerType;
+	        }*/
+	    
+	CleanupStack::PopAndDestroy(); // supportedBearers
+	}
+
+void CCreatorConnectionSettings::SetRandomParametersL(CConnectionSettingsParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::SetRandomParametersL");
+        
+    // Connection method name:
+    parameters.SetRandomCMNameL(*iEngine);
+    
+    SetRandomBearerTypeL(parameters);
+ 
+    if(parameters.iBearerType == KUidWlanBearerType)//Wireless LAN
+        {           
+        // WLAN name:
+        parameters.SetRandomWLANNameL(*iEngine);
+        
+        //WLAN network mode        
+        parameters.SetRandomWLANNetModeL(*iEngine);     
+        
+        //WLAN security mode:
+        parameters.SetRandomWLANSecurityModeL(*iEngine);
+        }
+    
+    // Login name:
+    parameters.SetRandomLoginNameL(*iEngine);
+
+    // Login password:
+    parameters.SetRandomLoginPassL(*iEngine);
+
+    // Secure authentication:
+    parameters.SetRandomSecureAuthenticationL(*iEngine);
+    
+    // Prompt password:
+    parameters.SetRandomPromptPasswordL(*iEngine);    
+
+    // Use proxy:
+    parameters.SetRandomUseProxyL(*iEngine);    
+    
+    // Proxy address
+    parameters.SetRandomProxyAddressL(*iEngine);    
+    
+    // Proxy port number:
+    parameters.SetRandomProxyPortL(*iEngine);    
+
+    // Start page:
+    parameters.SetRandomStartPageL(*iEngine);
+       
+    // IP address:
+    parameters.SetRandomIPAddressL(*iEngine);    
+    
+    // IPv4 name servers:
+    parameters.SetRandomIP4NameServer1L(*iEngine);
+    parameters.SetRandomIP4NameServer2L(*iEngine);
+      
+    // Protocol type:
+    parameters.SetRandomProtocolTypeL(*iEngine);
+    
+    // Default telephone number:
+    parameters.SetRandomTelephoneNumberL(*iEngine);
+         
+    // Bearer isdn
+    parameters.SetRandomBearerTypeIsdnL(*iEngine);
+
+    // Bearer speed:
+    parameters.SetRandomBearerSpeedL(*iEngine);    
+
+    // WAP wsp option:
+    parameters.SetRandomWapWspOptionL(*iEngine);
+
+    // Subnet mask:
+    parameters.SetRandomSubnetMaskL(*iEngine);
+    
+    // Gateway address:
+    parameters.SetRandomGatewayAddressL(*iEngine);
+    
+    // WLAN ip address:
+    parameters.SetRandomWlanIpAddrL(*iEngine);
+
+    // IPv6 name servers:
+    parameters.SetRandomIPv6NameServer1L(*iEngine);
+    parameters.SetRandomIPv6NameServer2L(*iEngine);
+    
+    // Disable text authorization:
+    parameters.SetRandomDisableTextAuthL(*iEngine);    
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorConnectionSettings::SetDefaultCML(RCmConnectionMethodExt conMethod)
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::SetDefaultCM");
+
+    TCmDefConnValue defConnValue;
+        
+    //Returns the default connection method/SNAP.
+    TRAPD( err, iCmManagerExt.ReadDefConnL( defConnValue ) );
+    if( err ==  KErrNotSupported )
+        {
+        return; //If Default Connection NOT supported, just returning 
+        }
+    else if ( err != KErrNone )
+        {
+        User::Leave( err ); //If something else happend
+        }
+    else if ( defConnValue.iId == 0 ) // default not set
+        {       
+        TCmDefConnValue newDefaultCM;        
+        HBufC* cmName = conMethod.GetStringAttributeL( ECmName );        
+        CleanupStack::PushL( cmName );
+        newDefaultCM.iId = AccessPointNameToIdL( cmName->Des() );
+        newDefaultCM.iType = ECmDefConnDestination;
+        //Stores the default connection method/SNAP.
+        iCmManagerExt.WriteDefConnL( newDefaultCM );
+        CleanupStack::PopAndDestroy( cmName );        
+       }
+    }
+
+//----------------------------------------------------------------------------
+
+TUint32 CCreatorConnectionSettings::AccessPointNameToIdL(const TDesC& aAPName,
+                                                         TBool aAnyIfNotFound )
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::AccessPointNameToIdL");
+
+    //RCmDestination destination
+    
+    RArray<TUint32> destIdArray = RArray<TUint32>( 10 );
+    
+    iCmManagerExt.AllDestinationsL( destIdArray );
+    
+    CleanupClosePushL( destIdArray );
+    TUint32 id = 0 ;
+    TBool found = EFalse;
+    
+    for( TInt i = 0; i < destIdArray.Count(); i++ )
+        {
+        RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );           
+        CleanupClosePushL( dest );        
+
+        HBufC* destName = dest.NameLC();
+        
+        if (destName->CompareF(aAPName) == 0){        
+         id = dest.Id();
+         found = ETrue;
+        }
+        if ( !found && id == 0 && aAnyIfNotFound )
+            {
+            id = dest.Id();
+            }
+        CleanupStack::PopAndDestroy( 2 ); // destName , dest
+        if(found)
+            {
+            break;
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // destIdArray   
+    return id;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorConnectionSettings::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::HandleSessionEventL");
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorConnectionSettings::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllL");
+    DeleteAllDestinationsL( EFalse );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorConnectionSettings::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllCreatedByCreatorL");
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidIAP );
+    
+    // delete entries
+    DeleteAllDestinationsL( ETrue );
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorConnectionSettings::DeleteAllDestinationsL( TBool aOnlyCreatedWithCreator )
+    {
+    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllDestinationsL");
+    RArray<TUint32> destIdArray(5);
+    CleanupClosePushL( destIdArray );
+    iCmManagerExt.AllDestinationsL( destIdArray );    
+    
+    for( TInt i = 0; i < destIdArray.Count(); i++ )
+        {
+        TRAP_IGNORE
+            (
+            RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );           
+            CleanupClosePushL( dest );
+            
+            if ( !aOnlyCreatedWithCreator || iEntryIds.Find( destIdArray[i]) != KErrNotFound )
+                {
+                dest.DeleteLD();
+                }
+            CleanupStack::PopAndDestroy(); // dest
+            );
+        }
+   
+    CleanupStack::PopAndDestroy(); // destIdArray 
+    
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the IMPS related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
+    }
+//----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_connectionmethodelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_connectionmethodelement.h"
+#include "creator_traces.h"
+#include "creator_accesspoint.h"
+
+
+using namespace creatorconnectionmethod;
+
+// connection name needs extra space for possible renaming
+const TInt KExtraSpace = 10;
+
+/*
+ * 
+ */
+CCreatorConnectionMethodElement* CCreatorConnectionMethodElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorConnectionMethodElement* self = new (ELeave) CCreatorConnectionMethodElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorConnectionMethodElement::CCreatorConnectionMethodElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+
+void CCreatorConnectionMethodElement::ExecuteCommandL()
+	{
+	const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+	TInt cmAmount = 1;    
+	if( amountAttr )
+		{
+		cmAmount = ConvertStrToIntL(amountAttr->Value());
+		}
+	// Get 'fields' element 
+	CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+	if( fieldsElement )
+		{
+		// Get sub-elements
+		const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
+		// Create connection method entries, the amount of entries is defined by cmAmount:
+		for( TInt cI = 0; cI < cmAmount; ++cI )
+			{            
+			CAccessPointsParameters* param = new (ELeave) CAccessPointsParameters;
+			CleanupStack::PushL(param);
+
+			for( TInt i = 0; i < fields.Count(); ++i )
+				{
+				CCreatorScriptElement* field = fields[i];
+				TPtrC elemName = field->Name();
+				TPtrC elemContent = field->Content();
+				const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+				TBool useRandom = EFalse;
+				if( randomAttr || elemContent.Length() == 0 )
+					{
+					useRandom = ETrue;
+					}
+
+				if( elemName == Kconnectionname )
+					{
+					if( useRandom )
+						{
+						param->SetRandomCMNameL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iConnectionName, elemContent);
+                        // reserve extra space for possible renaming
+                        TInt newLen = param->iConnectionName->Length() + KExtraSpace;
+                        param->iConnectionName = param->iConnectionName->ReAllocL(newLen);
+
+                        SetContentToTextParamL(param->iGprsAcessPointName, elemContent);
+						}
+					}
+				else if( elemName == Kstartpage )
+					{
+					if( useRandom )
+						{
+						param->SetRandomStartPageL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iWapStartPage, elemContent);
+						}
+					}
+				else if( elemName == Kwapwspoption )
+					{
+					if( useRandom )
+						{
+						param->SetRandomWapWspOptionL(*iEngine);
+						}
+					else
+						{
+						if( CompareIgnoreCase(elemContent, Kconnectionless) == 0 )
+							{
+							param->iWapWspOption = EWapWspOptionConnectionless;
+							}
+						else if( CompareIgnoreCase(elemContent, Kconnectionoriented) == 0 )
+							{
+							param->iWapWspOption = EWapWspOptionConnectionOriented;
+							}
+						}
+					}
+				else if( elemName == Kloginname )
+					{
+					if( useRandom )
+						{
+						param->SetRandomLoginNameL(*iEngine);                		
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspLoginName, elemContent);
+						}
+					}
+				else if( elemName == Ksecureauthentication )
+					{
+					if( useRandom )
+						{
+						param->SetRandomSecureAuthenticationL(*iEngine);
+						}
+					else
+						{
+						param->iSecureAuthentication = ConvertStrToBooleanL(elemContent);
+						}
+					}
+				else if( elemName == Kloginpass )
+					{
+					if( useRandom )
+						{
+						param->SetRandomLoginPassL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspLoginPass, elemContent);
+						}
+					}
+				else if( elemName == Kpromptpassword )
+					{
+					if( useRandom )
+						{
+						param->SetRandomPromptPasswordL(*iEngine);
+						}
+					else
+						{
+						param->iPromptPassword = ConvertStrToBooleanL(elemContent);
+						}
+					}
+				else if( elemName == Kgatewayaddress )
+					{
+					if( useRandom )
+						{
+						param->SetRandomGatewayAddressL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iWapGatewayAddress, elemContent);
+						}
+					}
+				else if( elemName == Kdeviceipaddr )
+					{
+					if( useRandom )
+						{
+						param->SetRandomIPAddressL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspIPAddr, elemContent);
+						}
+					}
+				else if( elemName == Kip4nameserver1 )
+					{
+					if( useRandom )
+						{
+						param->SetRandomIP4NameServer1L(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspIPNameServer1, elemContent);
+						}
+					}
+				else if( elemName == Kip4nameserver2 )
+					{
+					if( useRandom )
+						{
+						param->SetRandomIP4NameServer2L(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspIPNameServer2, elemContent);
+						}
+					}
+				else if( elemName == Kdatacalltelnumber )
+					{
+					if( useRandom )
+						{
+						param->SetRandomTelephoneNumberL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iIspDefaultTelNumber, elemContent);
+						}
+					}
+				else if( elemName == Kdatacalltypeisdn )
+					{
+					if( useRandom )
+						{
+						param->SetRandomBearerTypeIsdnL(*iEngine);
+						}
+					else
+						{
+						if( CompareIgnoreCase(elemContent, Kanalogue) == 0 )
+							param->iIspBearerCallTypeIsdn = ECallTypeAnalogue;
+						else if( CompareIgnoreCase( elemContent, Kisdnv110) == 0 )
+							param->iIspBearerCallTypeIsdn = ECallTypeISDNv110;
+						else if( CompareIgnoreCase( elemContent, Kisdnv120) == 0 )
+							param->iIspBearerCallTypeIsdn = ECallTypeISDNv120;
+						}
+					}
+				else if( elemName == Kbearertype )
+					{
+					if( useRandom )
+						{
+						param->iBearerType = EApBearerTypeGPRS;
+						}
+					else
+						{
+						if( CompareIgnoreCase(elemContent, Kwlan) == 0 )
+							{
+							param->iBearerType = EApBearerTypeWLAN;
+							}
+						else if( CompareIgnoreCase(elemContent, Kgprs) == 0 )
+							{
+							param->iBearerType = EApBearerTypeGPRS;
+							}
+						else if( CompareIgnoreCase(elemContent, Kdatacall) == 0 )
+							{
+							param->iBearerType = EApBearerTypeCSD;
+							}
+						else if( CompareIgnoreCase(elemContent, Khsgsm) == 0 )
+							{
+							param->iBearerType = EApBearerTypeHSCSD;
+							}
+						else if( CompareIgnoreCase(elemContent, Klan) == 0 )
+							{
+							param->iBearerType = EApBearerTypeLAN;
+							}
+						}
+					}
+				else if( elemName == Kdatacalllinespeed )
+					{
+					if( useRandom )
+						{
+						param->SetRandomBearerSpeedL(*iEngine);
+						}
+					else
+						{
+						if( CompareIgnoreCase(elemContent, Kautomatic) == 0 )
+							{                			 
+							param->iIspBearerSpeed = KSpeedAutobaud;
+							}
+						else
+							{
+							TUint lineSpeed = ConvertStrToUintL(elemContent);
+							if( lineSpeed == 9600 )
+								param->iIspBearerSpeed = KSpeed9600;
+							else if( lineSpeed == 14400 )
+								param->iIspBearerSpeed = KSpeed14400;
+							else if( lineSpeed == 19200 )
+								param->iIspBearerSpeed = KSpeed19200;
+							else if( lineSpeed == 28800 )
+								param->iIspBearerSpeed = KSpeed28800;
+							else if( lineSpeed == 38400 )
+								param->iIspBearerSpeed = KSpeed38400;
+							else if( lineSpeed == 43200 )
+								param->iIspBearerSpeed = KSpeed43200;
+							else if( lineSpeed == 56000 )
+								param->iIspBearerSpeed = KSpeed56000;
+							}                			
+						}
+					}
+				else if( elemName == Kproxyserveraddress )
+					{
+					if( useRandom )
+						{
+						param->SetRandomProxyAddressL(*iEngine);
+						}
+					else
+						{
+						SetContentToTextParamL(param->iProxyServerAddress, elemContent);                		
+						}
+					}
+				else if( elemName == Kproxyportnumber )
+					{
+					if( useRandom )
+						{
+						param->SetRandomProxyPortL(*iEngine);
+						}
+					else
+						{
+						param->iProxyPortNumber = ConvertStrToUintL(elemContent);                		
+						}
+					}
+				}
+			iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, param);
+			CleanupStack::Pop(); // param
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_contactelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_contactelement.h"
+#include "creator_traces.h"
+#include "creator_factory.h"
+#include "creator_contactsetcache.h"
+#include <xml/documentparameters.h>
+
+using namespace Xml;
+using namespace creatorcontact;
+
+/**
+ * Contact field element mappings:
+ */
+enum TContactFieldDataType
+    {
+    EDataTypeText,
+    EDataTypeBinary,
+    EDataTypeDateTime    
+    };
+    
+class FieldMapping
+{
+public:
+    TPtrC iElementName;
+    TInt  iFieldCode;
+    TContactFieldDataType iDataType;
+};
+
+CCreatorContactElementBase* CCreatorContactElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    LOGSTRING("Creator: CCreatorContactElementBase::NewL");
+    CCreatorContactElementBase* self = new (ELeave) CCreatorContactElementBase(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorContactElementBase::CCreatorContactElementBase(CCreatorEngine* aEngine) : CCreatorScriptElement(aEngine)
+    { }
+
+CCreatorContactElement* CCreatorContactElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    LOGSTRING("Creator: CCreatorContactElement::NewL");
+    CCreatorContactElement* self = new (ELeave) CCreatorContactElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorContactElement::CCreatorContactElement(CCreatorEngine* aEngine) 
+: 
+CCreatorContactElementBase(aEngine)
+    { 
+    iIsCommandElement = ETrue;
+    }
+
+
+void CCreatorContactElement::ExecuteCommandL()
+    {}
+
+CCreatorContactSetElement* CCreatorContactSetElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    LOGSTRING("Creator: CCreatorContactSetElement::NewL");
+    CCreatorContactSetElement* self = new (ELeave) CCreatorContactSetElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorContactSetElement::CCreatorContactSetElement(CCreatorEngine* aEngine) 
+: 
+CCreatorContactElementBase(aEngine)
+    { }
+
+void CCreatorContactSetElement::ExecuteCommandL()
+    { }
+
+void CCreatorContactSetElement::AddToCacheL()
+    {    
+    LOGSTRING("Creator: CCreatorContactSetElement::AddToCacheL");
+    const CCreatorScriptAttribute* linkIdAttr = this->FindAttributeByName(KId);
+    const CCreatorScriptAttribute* existingElemsAttr = this->FindAttributeByName(KExistingContacts);
+    TInt numOfExistingContacts = 0;
+    if( existingElemsAttr )
+        {
+        numOfExistingContacts = ConvertStrToIntL(existingElemsAttr->Value());
+        }
+    if( linkIdAttr )
+        {
+        TInt linkId = ConvertStrToIntL(linkIdAttr->Value());
+        if( linkId > 0 )
+            {    
+            CCreatorContactSet* newSet = CCreatorContactSet::NewL(linkId, numOfExistingContacts);
+            CleanupStack::PushL(newSet);
+            ContactLinkCache::Instance()->AppendL(newSet);
+            CleanupStack::Pop(newSet);
+                 
+            // Mark sub-elements (i.e. contacts) to this contact-set:
+            for( TInt i = 0; i < iSubElements.Count(); ++i )
+                {
+                for( TInt j = 0; j < iSubElements[i]->CommandParameters().Count(); ++j)
+                    {
+                    CCreatorModuleBaseParameters* params = iSubElements[i]->CommandParameters()[j];
+                    if( params )
+                        {
+                        params->SetScriptLinkId(linkId);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+CCreatorContactGroupElement* CCreatorContactGroupElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    LOGSTRING("Creator: CCreatorContactGroupElement::NewL");
+    CCreatorContactGroupElement* self = new (ELeave) CCreatorContactGroupElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorContactGroupElement::CCreatorContactGroupElement(CCreatorEngine* aEngine)
+: 
+CCreatorContactElementBase(aEngine)
+    { 
+    iIsCommandElement = ETrue;
+    }
+
+
+void CCreatorContactGroupElement::ExecuteCommandL()
+    {}
+
+CCreatorContactFieldElement* CCreatorContactFieldElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    LOGSTRING("Creator: CCreatorContactFieldElement::NewL");
+    CCreatorContactFieldElement* self = new (ELeave) CCreatorContactFieldElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+
+CCreatorContactFieldElement::CCreatorContactFieldElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_contactsetcache.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_contactsetcache.h"
+
+
+CContactLinkCacheImp* ContactLinkCache::iImp = 0;
+
+CCreatorContactSet* CCreatorContactSet::NewL(TInt aLinkId, TInt aNumOfExistingContacts)
+    {
+    return new (ELeave) CCreatorContactSet(aLinkId, aNumOfExistingContacts);    
+    }
+
+TInt CCreatorContactSet::LinkId() const
+    {
+    return iLinkId;
+    }
+
+
+CCreatorContactSet::~CCreatorContactSet()
+    {
+    }
+
+
+CCreatorContactSet::CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts)
+    {
+    iLinkId = aLinkId;
+    iNumOfExistingContacts = aNumOfExistingContacts;
+    }
+
+class CContactLinkCacheImp : public CBase, public MContactLinkCache
+{
+public:
+    static CContactLinkCacheImp* NewL();
+    virtual ~CContactLinkCacheImp();
+    virtual void AppendL(CCreatorContactSet* aContactSet); 
+    virtual RPointerArray<CCreatorContactSet>& ContactSets();
+    virtual const RPointerArray<CCreatorContactSet>& ContactSets() const;
+    virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const;
+    virtual CCreatorContactSet& ContactSet(TInt aLinkId);
+    
+private:
+    void ConstructL();
+    CContactLinkCacheImp();
+    RPointerArray<CCreatorContactSet> iContactSets;
+    CCreatorContactSet* iDummyContactSet;
+};
+
+CContactLinkCacheImp* CContactLinkCacheImp::NewL()
+    {
+    CContactLinkCacheImp* self = new (ELeave) CContactLinkCacheImp();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+void CContactLinkCacheImp::ConstructL()
+    {
+    if( iDummyContactSet == 0 )
+        iDummyContactSet = CCreatorContactSet::NewL(-1, 0);    
+    }
+
+CContactLinkCacheImp::CContactLinkCacheImp()
+: iDummyContactSet(0)
+    {}
+
+CContactLinkCacheImp::~CContactLinkCacheImp()
+    {
+    iContactSets.ResetAndDestroy();
+    iContactSets.Close();
+    delete iDummyContactSet;
+    }
+void CContactLinkCacheImp::AppendL(CCreatorContactSet* aContactSet)
+    {
+    iContactSets.AppendL(aContactSet);
+    }
+
+const CCreatorContactSet& CContactLinkCacheImp::ContactSet(TInt aLinkId) const
+    {
+    for( TInt i = 0; i < iContactSets.Count(); ++i )
+        {
+        if( iContactSets[i]->LinkId() == aLinkId )
+            {
+            return *iContactSets[i];
+            }
+        }
+        
+    return *iDummyContactSet;
+    }
+
+CCreatorContactSet& CContactLinkCacheImp::ContactSet(TInt aLinkId)
+    {
+    for( TInt i = 0; i < iContactSets.Count(); ++i )
+        {
+        if( iContactSets[i]->LinkId() == aLinkId )
+            {
+            return *iContactSets[i];
+            }
+        }
+        
+    return *iDummyContactSet;
+    }
+
+RPointerArray<CCreatorContactSet>& CContactLinkCacheImp::ContactSets()
+    {
+    return iContactSets;
+    }
+
+const RPointerArray<CCreatorContactSet>& CContactLinkCacheImp::ContactSets() const
+    {
+    return iContactSets;
+    }
+
+
+void ContactLinkCache::InitializeL()
+    {
+    if( iImp == 0 )
+        {
+        iImp = CContactLinkCacheImp::NewL();
+        }
+    }
+
+void ContactLinkCache::DestroyL()
+    {
+    delete iImp;
+    iImp = 0;
+    }
+
+MContactLinkCache* ContactLinkCache::Instance()
+    {
+    return iImp;
+    }
+
+
+    /*{
+public:
+    static void ;
+    static void DestructLD();
+    
+    static MContactLinkCache* Instance();
+    
+private:
+    CContactLinkImp* iImp;
+};*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_factory.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "creator_factory.h"
+
+#include "creator_accessPoint.h"
+#include "creator_phonebook.h"
+
+CCreatorPhonebookBase* TCreatorFactory::CreatePhoneBookL(CCreatorEngine* aEngine)
+{
+    return CCreatorPhonebook::NewL(aEngine);    
+}
+
+CCreatorModuleBaseParameters* TCreatorFactory::CreatePhoneBookParametersL()
+	{
+	//return new(ELeave) CVirtualPhonebookParameters;
+    return NULL;
+	}
+
+CCreatorConnectionSettingsBase* TCreatorFactory::CreateConnectionSettingsL(CCreatorEngine* aEngine)
+{
+    return CCreatorAccessPoints::NewL(aEngine); 
+}
+
+CCreatorModuleBaseParameters* TCreatorFactory::CreateConnectionSettingsParametersL()
+    {
+    return new(ELeave) CAccessPointsParameters;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_file.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,851 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <drmrights.h>
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_file.h" 
+#include "creator_traces.h"
+
+using namespace ContentAccess;
+
+static const TInt KFilesFieldLength = 256;
+
+//_LIT(KCreatorFilesPrefixName, "CR_");
+//_LIT(KCreatorFilesPrefixFolderName, "CR_FLDR_");
+
+//----------------------------------------------------------------------------
+
+CFilesParameters::CFilesParameters()
+    {
+    LOGSTRING("Creator: CFilesParameters::CFilesParameters");
+    iFullFilePath = HBufC::New(KFilesFieldLength);
+    }
+CFilesParameters::CFilesParameters( CFilesParameters& aCopy )
+    {
+    LOGSTRING("Creator: CFilesParameters::CFilesParameters");
+    iFullFilePath = HBufC::New(KFilesFieldLength);
+    iFullFilePath->Des().Copy( *aCopy.iFullFilePath );
+    iFileCommand = aCopy.iFileCommand;
+    iEncrypt = aCopy.iEncrypt;
+    if ( aCopy.iPermission )
+        {
+        iPermission = CDRMPermission::NewL();
+        iPermission->DuplicateL( *aCopy.iPermission );
+        }
+    }
+CFilesParameters::~CFilesParameters()
+    {
+    LOGSTRING("Creator: CFilesParameters::~CFilesParameters");
+    delete iFullFilePath;
+    delete iPermission;
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorFiles* CCreatorFiles::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorFiles* self = CCreatorFiles::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorFiles* CCreatorFiles::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorFiles* self = new (ELeave) CCreatorFiles;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorFiles::CCreatorFiles() :
+    iFs ( CEikonEnv::Static()->FsSession() )
+    {
+    }
+
+void CCreatorFiles::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorFiles::ConstructL");
+
+    iEngine = aEngine;
+
+    iDirectoryQueriedFromUser = HBufC::New(KFilesFieldLength);
+    User::LeaveIfError( iApaLs.Connect() );
+    
+    iFilePaths = new (ELeave) CDesCArrayFlat( 4 );
+    
+    // Restore file id 
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+    User::LeaveIfNull( store );
+    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, KUidDictionaryUidFiles );
+        TRAPD( err, iFileId = in.ReadInt32L() );
+        if ( err )
+            {
+            iFileId = 1;
+            }
+        CleanupStack::PopAndDestroy(); // in
+        }
+    else
+        {
+        iFileId = 1;
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+CCreatorFiles::~CCreatorFiles()
+    {
+    LOGSTRING("Creator: CCreatorFiles::~CCreatorFiles");
+    
+    // this is done only once per file operation:
+    if ( iFilePaths && iFilePaths->Count() )
+        {
+        TRAP_IGNORE( StorePathsForDeleteL( *iFilePaths ) );
+        }
+    delete iFilePaths;
+    delete iDirectoryQueriedFromUser;
+    delete iParameters;
+    delete iUserParameters;
+    iApaLs.Close();
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorFiles::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorFiles::AskDataFromUserL");
+    
+    if ( aCommand == ECmdDeleteCreatorFiles )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all files created with Creator?") );
+        }
+    
+    delete iUserParameters;
+    iUserParameters = NULL;
+    iUserParameters = new(ELeave) CFilesParameters();
+    
+    iDirectoryQueriedFromUser->Des().Copy( KNullDesC );
+
+    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?")))
+        {
+        // set a default directory  (eg. c:\Nokia\Images\)
+        TFileName directory;
+        iEngine->SetDefaultPathForFileCommandL(aCommand, directory);
+
+        // directory query dialog
+		/*
+        CAknTextQueryDialog* textDialog = CAknTextQueryDialog::NewL(directory, CAknQueryDialog::ENoTone);
+        textDialog->SetMaxLength(256);
+		*/
+		
+        TBuf<50> promptText;
+
+        if (aCommand == ECmdCreateFileEntryEmptyFolder)
+            promptText.Copy( _L("Specify the folder path and name") );
+        else
+            promptText.Copy( _L("Specify the directory") );
+		// show directory query dialog
+        if (iEngine->GetEngineWrapper()->DirectoryQueryDialog(promptText, directory))
+            {
+	        // check that the root folder is correct
+            if (directory.Length() < 3  ||  BaflUtils::CheckFolder(iFs, directory.Left(3)) != KErrNone)
+                {
+                iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Invalid path"));
+                return EFalse;
+                }        
+            else
+                {
+                // check the directory contains a trailing backlash
+                if (directory.Right(1) != _L("\\"))
+                    directory.Append(_L("\\"));
+
+                // copy the directory name to a class member
+                iDirectoryQueriedFromUser->Des() = directory;
+                if ( aCommand == ECmdCreateFileEntryEmptyFolder ) return ETrue;
+                else return AskDRMDataFromUserL();
+                }
+            }        
+        else
+            return EFalse;
+        }
+    else 
+        return EFalse;
+
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorFiles::CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand)
+    {
+    LOGSTRING("Creator: CCreatorFiles::CreateFileEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    TFileName directoryToBeCreated;
+            
+    CFilesParameters* parameters = aParameters;
+    
+    if (!parameters)
+        {
+        if ( iUserParameters )
+            {
+            iParameters = new (ELeave) CFilesParameters( *iUserParameters );
+            // iUserParameters = NULL;
+            }
+        else
+            {
+            // random data needed if no predefined data available
+            iParameters = new (ELeave) CFilesParameters;            
+            }
+        parameters = iParameters;
+        }
+
+    TInt err = KErrNone;
+
+    // if we just create directories
+    if ( aCommand == ECmdCreateFileEntryEmptyFolder)
+        {
+        // strip the last backslash from the path
+        if( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0)
+        	directoryToBeCreated = iDirectoryQueriedFromUser->Des();
+        else if( parameters->iFullFilePath && parameters->iFullFilePath->Des().Length() > 0 )
+        	directoryToBeCreated = parameters->iFullFilePath->Des();
+        else 
+        	return err;
+        
+        _LIT(KSlash, "\\");
+        if( directoryToBeCreated.Right(1) == KSlash )
+        	directoryToBeCreated.SetLength ( directoryToBeCreated.Length() - 1 ); 
+            
+        // generate a unique file name
+        err = CApaApplication::GenerateFileName( iFs, directoryToBeCreated);
+        if (err != KErrNone)
+            return err;
+
+        // now append the backslah back
+        directoryToBeCreated.Append( _L("\\") );
+        
+        // now create the new directory
+        err = iFs.MkDirAll( directoryToBeCreated );
+        
+        // Add directoryToBeCreated to store
+        iFilePaths->AppendL( directoryToBeCreated );
+
+        LOGSTRING3("Creator: CCreatorFiles::CreateFileEntryL creating empty directory %S returns err", &directoryToBeCreated, err);
+        }
+
+    else  // files
+        {
+        LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL file id is %d", aCommand);
+
+        // get source
+        TFileName fullSourcePath;
+        switch (aCommand)
+            {
+	        case ECmdCreateFileEntryJPEG_25kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_25kB );  break; }
+	        case ECmdCreateFileEntryJPEG_200kB:     { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_200kB );  break; }
+	        case ECmdCreateFileEntryJPEG_500kB:     { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_500kB );  break; }
+	        case ECmdCreateFileEntryPNG_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EPNG_15kB );  break; }
+	        case ECmdCreateFileEntryGIF_2kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EGIF_2kB );  break; }
+	        case ECmdCreateFileEntryRNG_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERNG_1kB );  break; }
+	        case ECmdCreateFileEntryMIDI_10kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMIDI_10kB );  break; }
+	        case ECmdCreateFileEntryWAV_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWAVE_20kB );  break; }
+	        case ECmdCreateFileEntryAMR_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EAMR_20kB );  break; }
+	        case ECmdCreateFileEntryXLS_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EExcel_15kB );  break; }
+	        case ECmdCreateFileEntryDOC_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWord_20kB );  break; }
+	        case ECmdCreateFileEntryPPT_40kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EPowerPoint_40kB );  break; }
+	        case ECmdCreateFileEntryTXT_10kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EText_10kB );  break; }
+	        case ECmdCreateFileEntryTXT_70kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EText_70kB );  break; }
+	        case ECmdCreateFileEntry3GPP_70kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::E3GPP_70kB );  break; }
+	        case ECmdCreateFileEntryMP3_250kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMP3_250kB );  break; }
+	        case ECmdCreateFileEntryAAC_100kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EAAC_100kB );  break; }
+	        case ECmdCreateFileEntryRM_95kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERM_95kB );  break; }
+	        case ECmdCreateFileEntryBMP_25kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EBMP_25kB );  break; }
+	        case ECmdCreateFileEntryDeck_1kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESavedDeck_1kB );  break; }
+	        case ECmdCreateFileEntryHTML_20kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EHTML_20kB );  break; }
+	        case ECmdCreateFileEntryJAD_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJAD_1kB );  break; }
+	        case ECmdCreateFileEntryJAR_10kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJAR_10kB );  break; }
+	        case ECmdCreateFileEntryJP2_65kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJP2_65kB );  break; }
+	        case ECmdCreateFileEntryMP4_200kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMP4_200kB );  break; }
+	        case ECmdCreateFileEntryMXMF_40kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMXMF_40kB );  break; }
+	        case ECmdCreateFileEntryRAM_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERAM_1kB );  break; }
+	        case ECmdCreateFileEntrySVG_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESVG_15kB );  break; }
+	        case ECmdCreateFileEntrySWF_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESWF_15kB );  break; }
+	        case ECmdCreateFileEntryTIF_25kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ETIF_25kB );  break; }
+	        case ECmdCreateFileEntryVCF_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EVCF_1kB );  break; }
+	        case ECmdCreateFileEntryVCS_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EVCS_1kB );  break; }
+	        case ECmdCreateFileEntrySISX_10kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESISX_10kB );  break; }
+	        case ECmdCreateFileEntryWMA_50kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWMA_50kB );  break; }
+	        case ECmdCreateFileEntryWMV_200kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWMV_200kB );  break; }
+	        case ECmdCreateFileEntryEmptyFolder:    { User::Panic(_L("EmptyFolder"), 801); break; }
+	        default:                                { return KErrPathNotFound; }
+            }
+
+
+        // define the full target path
+        TFileName fullTargetPath;
+
+        if ( parameters->iFullFilePath && parameters->iFullFilePath->Des().Length() > 3 )
+            {
+            _LIT(KSlash, "\\");
+            // check the path is ok
+            fullTargetPath = parameters->iFullFilePath->Des();
+            
+            if(fullTargetPath.Right(1) == KSlash)
+                {
+                // Remove '\' from the end, because the filename check does not work with it:
+                fullTargetPath.SetLength ( fullTargetPath.Length() - 1 );
+                }
+            
+            if (!iFs.IsValidName( fullTargetPath ))
+		        User::Leave(KErrBadName);
+
+            // target path = directory + the file name from source path
+            TParse parser;
+            parser.Set(fullSourcePath, NULL, NULL);
+            
+            // Add '\' to the end:
+            fullTargetPath.Append(KSlash);            
+            // Add filename:
+            fullTargetPath.Append( parser.NameAndExt() );
+
+            LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iFullFilePath used, fullTargetPath: %S", &fullTargetPath);
+            }
+    
+        else if ( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0 )
+            {
+            // target path = directory + the file name from source path
+            TParse parser;
+            parser.Set(fullSourcePath, NULL, NULL);
+
+            fullTargetPath = iDirectoryQueriedFromUser->Des();
+            fullTargetPath.Append( parser.NameAndExt() );
+
+            LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iDirectoryQueriedFromUser used, fullTargetPath: %S", &fullTargetPath);
+            }
+
+        else
+            {   
+            LOGSTRING("Creator: CCreatorFiles::CreateFileEntryL leaving with KErrPathNotFound");
+            User::Leave(KErrPathNotFound);
+            }
+    
+        TBool encrypt = parameters->iEncrypt; 
+        if ( encrypt ) fullTargetPath.Append( KOma2DcfExtension );
+        // check the target path has a unique filename ie we won't overwrite existing files
+        // also generates any missing directories
+        if ( BaflUtils::FileExists( iFs, fullTargetPath ) )
+            {
+            GenerateFileNameL( fullTargetPath );
+            }
+        User::LeaveIfError(CApaApplication::GenerateFileName( iFs, fullTargetPath ) );
+        
+        if ( encrypt )
+            {
+            EncryptFileL( fullSourcePath, fullTargetPath, parameters );
+            }
+        else
+            {
+            // copy the file (synchronous function)
+            err = BaflUtils::CopyFile(iFs, fullSourcePath, fullTargetPath);
+            LOGSTRING4("Creator: CCreatorFiles::CreateFileEntryL copy %S to %S, err=%d", &fullSourcePath, &fullTargetPath, err);            
+            }
+        
+        if (err != KErrNone)
+            User::Leave(err);  // leave because copying failed
+
+        // Add fullTargetPath to store
+        iFilePaths->AppendL( fullTargetPath );
+        
+		// make sure that the file won't have a read only attribute
+		TEntry fileEntry;
+		iFs.Entry(fullTargetPath, fileEntry);
+		iFs.SetEntry(fullTargetPath, fileEntry.iModified, NULL, KEntryAttReadOnly);
+
+        // clear variables
+		parameters->iFullFilePath->Des().Copy ( KNullDesC );
+        }
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorFiles::EncryptFileL( const TDesC& aInFileName, const TDesC& aOutFileName, CFilesParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorFiles::EncryptFileL");
+    TBuf8<64> mime;
+    SetMimeTypeL( aInFileName, mime, aParameters );
+    CSupplier* supplier = CSupplier::NewLC();
+
+    CMetaDataArray* metaData = CMetaDataArray::NewLC();
+    
+    // Tell the agent which MIME type to use for the encrypted data
+    metaData->AddL( KOmaImportMimeTypeField, mime );
+
+    if ( aParameters && aParameters->iPermission )
+        {
+        // Combined Delivery file will be created
+        SetPermissionsL( metaData, aOutFileName, aParameters );
+        }
+    
+    supplier->SetOutputDirectoryL( *iDirectoryQueriedFromUser );
+    
+    // The KOmaImportContentType is a OMA DRM agent specific MIME type which
+    // indicates that plain content is to be encrypted
+    CImportFile* importFile = supplier->ImportFileL( KOmaImportContentType,
+                                                     *metaData,
+                                                     aOutFileName );
+    CleanupStack::PushL( importFile );
+    
+    // Peek the source file size:
+    TInt fileLen( 0 );
+    RFile file;
+    User::LeaveIfError( file.Open( iFs, aInFileName, EFileRead ) );
+    CleanupClosePushL( file );
+    User::LeaveIfError( file.Size( fileLen ) );
+    CleanupStack::PopAndDestroy( &file );
+    
+    // Read the source file to inmemory buffer
+    RFileReadStream rs;    
+    User::LeaveIfError( rs.Open( iFs,
+                                 aInFileName,
+                                 EFileStream | EFileRead ) ); 
+    CleanupClosePushL( rs );
+    HBufC8* fileBuf = HBufC8::NewLC( fileLen );
+    TPtr8 p = fileBuf->Des();
+    rs.ReadL( p, fileLen );
+    
+    // Start encryption
+    TInt err = importFile->WriteData( p );
+    if ( err == KErrCANewFileHandleRequired )
+        {
+        RFile file;
+        User::LeaveIfError( file.Create( iFs, aOutFileName, EFileWrite ) );
+        CleanupClosePushL( file );
+        importFile->ContinueWithNewOutputFile( file, aOutFileName );
+        CleanupStack::PopAndDestroy( &file );
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        }
+    User::LeaveIfError( importFile->WriteDataComplete() );
+    CleanupStack::PopAndDestroy( fileBuf );
+    CleanupStack::PopAndDestroy( &rs );    
+    CleanupStack::PopAndDestroy( importFile );
+    CleanupStack::PopAndDestroy( metaData );
+    CleanupStack::PopAndDestroy( supplier );
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorFiles::SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorFiles::SetPermissionsL");
+    CDRMRights* rights = CDRMRights::NewL();
+    CleanupStack::PushL( rights );
+    
+    HBufC8* cnturi = HBufC8::NewL( KMaxFileName );
+    cnturi->Des().Copy( aOutFileName );
+    
+    CDRMAsset* asset = CDRMAsset::NewLC();
+    asset->iUid = cnturi;
+    // Set the asset to the rights class, it will duplicate the asset
+    rights->SetAssetL( *asset );
+    CleanupStack::PopAndDestroy( asset );
+    
+    rights->SetPermissionL( *aParameters->iPermission );
+    
+    // Construct externalized presentation of the rights object
+    TInt rightsSize = 1024 *100;
+    HBufC8* rightBuf = HBufC8::NewLC( rightsSize ); 
+    TPtr8 bptr = rightBuf->Des();
+    bptr.SetLength( rightsSize );
+    RMemWriteStream iWriteStream;
+    iWriteStream.Open( (TAny*)(rightBuf->Ptr() ), rightsSize );
+    CleanupClosePushL( iWriteStream );
+    iWriteStream << *rights;
+    iWriteStream.CommitL();
+    TPtr8 rp = rightBuf->Des();
+    
+    // Add rights to metadata
+    aMetaData->AddL( KOmaImportRightsField, rp );
+    CleanupStack::PopAndDestroy( &iWriteStream );
+    CleanupStack::PopAndDestroy( rightBuf );
+    CleanupStack::PopAndDestroy( rights );
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorFiles::SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters )
+    {
+    LOGSTRING("Creator: CCreatorFiles::SetMimeTypeL");
+    TUid appUid;
+    TDataType dataType;
+    User::LeaveIfError( iApaLs.AppForDocument( aFileName, appUid, dataType ) );
+    if ( dataType.Des().Length() )
+        {
+        aMime.Copy( dataType.Des() );    
+        }
+    else
+        {
+        // set default mime, because it was not recognized by iApaLs
+        aMime.Copy( _L("text/plain") );
+        }
+
+    // set DRM permissions according the type of the file
+    if ( aParameters->iPermission )
+        {
+        if ( dataType.Des().FindF( _L("image") ) > KErrNotFound )
+            {
+            aParameters->iPermission->iAvailableRights = ERightsDisplay | ERightsPrint;
+            }
+        else if ( dataType.Des().FindF( _L("audio") ) > KErrNotFound ||
+                  dataType.Des().FindF( _L("video") ) > KErrNotFound ||
+                  dataType.Des().FindF( _L("tone") ) > KErrNotFound || // e.g. application/vnd.nokia.ringing-tone
+                  dataType.Des().FindF( _L("realmedia") ) > KErrNotFound )
+            {
+            // media files
+            aParameters->iPermission->iAvailableRights = ERightsPlay;
+            }
+        else if ( dataType.Des().FindF( _L("archive") ) > KErrNotFound ||
+                  dataType.Des().FindF( _L("x-sis") ) > KErrNotFound )
+            {
+            // application/java-archive
+            // x-epoc/x-sisx-app
+            aParameters->iPermission->iAvailableRights = ERightsExecute;
+            }
+        else if ( dataType.Des().FindF( _L("application") ) > KErrNotFound ||
+                  dataType.Des().FindF( _L("text") ) > KErrNotFound )
+            {
+            // application/msexcel
+            // application/msword
+            // text/plain
+            // etc.
+            aParameters->iPermission->iAvailableRights = ERightsDisplay | ERightsPrint;
+            }
+        else
+            {
+            // other filetype
+            aParameters->iPermission->iAvailableRights = ERightsDisplay;
+            }
+        }
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorFiles::AskDRMDataFromUserL()
+    {
+    LOGSTRING("Creator: CCreatorFiles::AskDRMDataFromUserL");
+    // Encryption -dialog
+    TInt encIndex( 0 );
+	
+
+    //CAknListQueryDialog* encDlg = new (ELeave) CAknListQueryDialog( &encIndex );
+    //encDlg->PrepareLC( R_ENCRYPTION_DIALOG );
+    //Create flat array from which list is built.
+    CDesCArrayFlat* items = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL(items);
+
+    // Add entires to list
+    items->AppendL( _L("None") );
+    items->AppendL( _L("DRM Forward Lock") );
+    items->AppendL( _L("DRM Combined Delivery") );
+
+    // Add items into main list
+    //encDlg->SetOwnershipType( ELbmOwnsItemArray );
+    //encDlg->SetItemTextArray( items );
+    CleanupStack::Pop( items );
+    //encDlg->ListBox()->SetCurrentItemIndexAndDraw( 0 );
+
+	// create a popup list
+    if ( iEngine->GetEngineWrapper()->PopupListDialog(_L("Encryption"), items, encIndex) )
+        {
+        if ( encIndex > 0 )
+            {
+            iUserParameters->iEncrypt = ETrue;
+            }
+        if ( encIndex == 2 )
+            {
+            iUserParameters->iPermission = CDRMPermission::NewL();
+            CDRMPermission* perm = iUserParameters->iPermission; 
+            perm->iTopLevel->iActiveConstraints = EConstraintNone;
+            perm->iPlay->iActiveConstraints = EConstraintNone;
+            perm->iDisplay->iActiveConstraints = EConstraintNone;
+            perm->iPrint->iActiveConstraints = EConstraintNone;
+            perm->iExecute->iActiveConstraints = EConstraintNone;
+            perm->iUniqueID = 0;
+            // DRM Combined Delivery
+            return AskDRMCDDataFromUserL();
+            }
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        } 
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorFiles::AskDRMCDDataFromUserL()
+    {
+    LOGSTRING("Creator: CCreatorFiles::AskDRMCDDataFromUserL");
+    TInt count( 0 );
+    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( count, _L("How many counts\r\n(0=unlimited)?"), ETrue ) )
+        {
+        if ( count > 0 )
+            {
+            CDRMPermission* perm = iUserParameters->iPermission;
+            // apply constraints to all permission types
+            // applied type will be selected by setting iAvailableRights
+            // when determining the file type
+            perm->iDisplay->iActiveConstraints |= EConstraintCounter;
+            perm->iDisplay->iCounter = count;
+            perm->iDisplay->iOriginalCounter = count;
+
+            perm->iPlay->iActiveConstraints |= EConstraintCounter;
+            perm->iPlay->iCounter = count;
+            perm->iPlay->iOriginalCounter = count;
+
+            perm->iPrint->iActiveConstraints |= EConstraintCounter;
+            perm->iPrint->iCounter = count;
+            perm->iPrint->iOriginalCounter = count;
+            
+            perm->iExecute->iActiveConstraints |= EConstraintCounter;
+            perm->iExecute->iCounter = count;
+            perm->iExecute->iOriginalCounter = count;
+            }
+        }
+    else
+        {
+        return EFalse;
+        }
+    /*
+    TInt seconds( 0 );
+    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( seconds, _L("How many accumulated seconds until expire (0=unlimited)?"), ETrue ) )
+        {
+        if ( seconds > 0 )
+            {
+            CDRMPermission* perm = iUserParameters->iPermission;            
+            // apply constraints to all permission types
+            // applied type will be selected by setting iAvailableRights
+            // when determining the file type            
+            perm->iDisplay->iActiveConstraints |= EConstraintAccumulated;
+            perm->iDisplay->iEndTime = Time::MaxTTime();
+            perm->iDisplay->iStartTime = Time::MinTTime();;
+            perm->iDisplay->iAccumulatedTime = seconds;
+            
+            perm->iPlay->iActiveConstraints |= EConstraintAccumulated;
+            perm->iPlay->iEndTime = Time::MaxTTime();
+            perm->iPlay->iStartTime = Time::MinTTime();;
+            perm->iPlay->iAccumulatedTime = seconds;
+
+            perm->iPrint->iActiveConstraints |= EConstraintAccumulated;
+            perm->iPrint->iEndTime = Time::MaxTTime();
+            perm->iPrint->iStartTime = Time::MinTTime();;
+            perm->iPrint->iAccumulatedTime = seconds;
+
+            perm->iExecute->iActiveConstraints |= EConstraintAccumulated;
+            perm->iExecute->iEndTime = Time::MaxTTime();
+            perm->iExecute->iStartTime = Time::MinTTime();;
+            perm->iExecute->iAccumulatedTime = seconds;
+            }
+        }
+    else
+        {
+        return EFalse;
+        }
+    */
+    
+    TInt minutes( 0 );
+    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( minutes, _L("How many minutes until expire (0=unlimited)?"), ETrue ) )
+        {
+        if ( minutes > 0 )
+            {
+            CDRMPermission* perm = iUserParameters->iPermission;            
+            // apply constraints to all permission types
+            // applied type will be selected by setting iAvailableRights
+            // when determining the file type            
+            perm->iDisplay->iActiveConstraints |= EConstraintInterval;
+            perm->iDisplay->iInterval = TTimeIntervalSeconds( 60 * minutes );
+            perm->iDisplay->iIntervalStart = Time::NullTTime();
+            
+            perm->iPlay->iActiveConstraints |= EConstraintInterval;
+            perm->iPlay->iInterval = TTimeIntervalSeconds( 60 * minutes );
+            perm->iPlay->iIntervalStart = Time::NullTTime();
+
+            perm->iPrint->iActiveConstraints |= EConstraintInterval;
+            perm->iPrint->iInterval = TTimeIntervalSeconds( 60 * minutes );
+            perm->iPrint->iIntervalStart = Time::NullTTime();
+
+            perm->iExecute->iActiveConstraints |= EConstraintInterval;
+            perm->iExecute->iInterval = TTimeIntervalSeconds( 60 * minutes );
+            perm->iExecute->iIntervalStart = Time::NullTTime();
+            }
+        }
+    else
+        {
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorFiles::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorFiles::DeleteAllL");
+    User::Leave( KErrNotSupported ); // will not be supported
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorFiles::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorFiles::DeleteAllCreatedByCreatorL");
+    iFileId = 1;
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+    User::LeaveIfNull( store );
+        
+    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, KUidDictionaryUidFiles );
+        CFileMan* fileMan = CFileMan::NewL( iFs );
+        CleanupStack::PushL( fileMan );
+        TFileName fullPath;
+        // ignore return value, don't update iFileId here:
+        TRAPD( err, in.ReadInt32L() );
+        while ( !err )
+            {
+            TInt len( KErrNotFound );
+            TRAP( err, len = in.ReadInt8L() );  // will leave with KErrEof
+            if ( !err )
+                {
+                TRAP( err, in.ReadL( fullPath, len ) );                    
+                }
+            if ( !err )
+                {
+                TEntry fileEntry;
+                iFs.Entry( fullPath, fileEntry );
+                if ( fileEntry.IsDir() )
+                    {
+                    fileMan->RmDir( fullPath ); // ignore return value
+                    }
+                else
+                    {
+                    iFs.Delete( fullPath ); // ignore return value    
+                    }                    
+                }
+            }
+        CleanupStack::PopAndDestroy( fileMan );
+        CleanupStack::PopAndDestroy( &in );
+        
+        // files deleted, remove the Creator internal file registry
+        store->Remove( KUidDictionaryUidFiles );
+        store->CommitL();
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorFiles::StorePathsForDeleteL( CDesCArray& aPaths )
+    {
+    LOGSTRING("Creator: CCreatorFiles::StorePathsForDeleteL");
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+    User::LeaveIfNull( store );
+    
+    // backup previous filepaths from store
+    // otherwise they would be overwritten when calling out.WriteL
+    CDesCArray* previousPaths = new (ELeave) CDesCArrayFlat( 4 );
+    CleanupStack::PushL( previousPaths );
+    
+    TFileName fullPath;
+    
+    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, KUidDictionaryUidFiles );
+        // ignore return value, don't update iFileId here:
+        TRAPD( err, in.ReadInt32L() );
+        while ( !err ) 
+            {
+            TRAP( err,
+                TInt len = in.ReadInt8L(); // will leave with KErrEof
+                in.ReadL( fullPath, len );
+                previousPaths->AppendL( fullPath );
+                );
+            }
+        CleanupStack::PopAndDestroy(); // in
+        }
+    
+    RDictionaryWriteStream out;       
+    out.AssignLC( *store, KUidDictionaryUidFiles );
+    
+    // write latest file id to store
+    out.WriteInt32L( iFileId );
+    
+    // restore previous paths to store
+    for ( TInt i = 0; i < previousPaths->Count(); i++ )
+        {
+        out.WriteInt8L( (*previousPaths)[i].Length() );
+        out.WriteL( (*previousPaths)[i] );            
+        }
+
+    // write new paths to store
+    for ( TInt i = 0; i < aPaths.Count(); i++ )
+        {
+        out.WriteInt8L( aPaths[i].Length() );
+        out.WriteL( aPaths[i] );            
+        }
+    
+    out.CommitL();
+    CleanupStack::PopAndDestroy(); // out
+    
+    store->CommitL();
+    CleanupStack::PopAndDestroy( previousPaths );
+    CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorFiles::GenerateFileNameL( TFileName& aRootName )
+    {
+    LOGSTRING("Creator: CCreatorFiles::GenerateFileNameL");
+    if ( iFileId )
+        {
+        TBuf<16> extension;
+        if ( iFileId < 10 )
+            {
+            extension.Format( _L("(0%d)"), iFileId );     
+            }
+        else
+            {
+            extension.Format( _L("(%d)"), iFileId );
+            }
+        aRootName.Insert( aRootName.Locate( '.' ), extension );
+        }
+    iFileId++;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_fileelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,316 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_fileelement.h"
+#include <drmpermission.h>
+#include <drmconstraint.h>
+#include "creator_traces.h"
+#include "creator_file.h"
+
+using namespace creatorfile;
+
+// 15 minutes per time zone, 60 seconds per minute
+const TInt KSecondsPerTimeZone = 900;
+const TInt KMinuteInMicroseconds = 60000000;
+const TInt KTimeZoneIncrement = 15;
+
+/*
+ * 
+ */
+CCreatorFileElement* CCreatorFileElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorFileElement* self = new (ELeave) CCreatorFileElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorFileElement::CCreatorFileElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+
+    TTime currUniversal;
+    TTime currLocal;
+    TInt64 result( 0 );
+    currUniversal.UniversalTime();
+    currLocal.HomeTime();
+    result = currLocal.Int64() - currUniversal.Int64();
+    result /= KMinuteInMicroseconds;
+    result /= KTimeZoneIncrement;
+    iTimeZone = I64INT( result );
+    }
+/*
+ * 
+ */
+void CCreatorFileElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    TInt fileAmount = 1;    
+    if( amountAttr )
+        {
+        fileAmount = ConvertStrToIntL(amountAttr->Value());
+        }
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
+        // Create files, the amount of files is defined by fileAmount:
+        for( TInt cI = 0; cI < fileAmount; ++cI )
+            {
+            CFilesParameters* param = new (ELeave) CFilesParameters;
+            CleanupStack::PushL( param );
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+
+                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName( KRandomLength );
+                
+                if( elemName == KType )
+                    {
+                    param->iFileCommand = GetFileCommandL(elemContent, randomAttr || elemContent.Length() == 0);
+                    }
+                else if( elemName == KDirectory )
+                    {
+                    delete param->iFullFilePath;
+                    param->iFullFilePath = 0;
+                    if( randomAttr == 0 && elemContent.Length() > 0 )
+                    	{
+                    	param->iFullFilePath = elemContent.AllocL();
+                    	}
+                    else
+                        {
+                        TFileName defaultPath;
+                        iEngine->SetDefaultPathForFileCommandL( param->iFileCommand, defaultPath );
+                        param->iFullFilePath = defaultPath.AllocL();
+                        }
+                    }
+                else if ( elemName == KEncryption )
+                    {
+                    ParseDRMElementsL( field, param );
+                    }
+                }
+
+            if ( !param->iFileCommand )
+                {
+                param->iFileCommand = ECmdCreateFileEntryEmptyFolder;
+                }
+            iEngine->AppendToCommandArrayL( param->iFileCommand, param);
+            CleanupStack::Pop( param );
+            }
+        }
+    else
+    	{
+    	_LIT(KDummy, "");
+    	for( TInt cI = 0; cI < fileAmount; ++cI )
+    		{
+    		CFilesParameters* param = new (ELeave) CFilesParameters;
+    		CleanupStack::PushL(param);
+    		delete param->iFullFilePath;
+    		param->iFullFilePath = 0;
+    		TFileName defaultPath;
+    		param->iFileCommand = GetFileCommandL(KDummy, ETrue);
+    		iEngine->SetDefaultPathForFileCommandL(param->iFileCommand, defaultPath);                
+    		param->iFullFilePath = defaultPath.AllocL();
+    		
+    		iEngine->AppendToCommandArrayL(param->iFileCommand, param);
+    		CleanupStack::Pop(param);
+    		}
+    	}
+    }
+
+TInt CCreatorFileElement::GetFileCommandL( const TDesC& aFileIdStr, TBool aRandom ) const
+    {
+    TInt mapCount = sizeof(FileMap) / sizeof(FileMapping);
+    
+    if( aRandom )
+        {
+        return FileMap[iEngine->RandomNumber(0, mapCount-1)].CommandId();
+        }
+    
+    for( TInt i = 0; i < mapCount; ++i )
+        {
+        if( CompareIgnoreCase(FileMap[i].FileName(), aFileIdStr) == 0 )
+            return FileMap[i].CommandId();
+        }
+    LOGSTRING2("CCreatorFileElement::GetFileCommandL: Unknown file id: %S", &aFileIdStr);
+    User::Leave(KErrGeneral);
+    return 0; // Not reached, but disables compiler warning...
+    }
+
+void CCreatorFileElement::ParseDRMElementsL( CCreatorScriptElement* aField, CFilesParameters* aParam )
+    {
+    const CCreatorScriptAttribute* encryptionTypeAttr = aField->FindAttributeByName( KType );
+    if ( encryptionTypeAttr && encryptionTypeAttr->Value().Length() > 0 )
+        {
+        aParam->iEncrypt = ETrue;
+        if ( encryptionTypeAttr->Value() == KDRMCD ) 
+            {
+            delete aParam->iPermission;
+            aParam->iPermission = NULL;
+            // ownership transferred:
+            aParam->iPermission = CDRMPermission::NewL();
+            }
+        else if ( encryptionTypeAttr->Value() != KDRMFL )
+            {
+            // must be either KDRMCD or KDRMFL
+            User::Leave( KErrArgument );
+            }
+        }
+    else
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    const RPointerArray<CCreatorScriptElement>& rights = aField->SubElements();
+    
+    if ( encryptionTypeAttr->Value() == KDRMFL && rights.Count() )
+        {
+        // Right definitions not allowed with DRM Forward Lock
+        // User::Leave( KErrArgument ); // Do not leave here
+        return; // Just omit rights definitions
+        }
+    
+    // parse right elements
+    CDRMPermission* drmPermission = aParam->iPermission;
+    for ( TInt r = 0; r < rights.Count(); r++ )
+        {
+        const CCreatorScriptAttribute* rightAttr = rights[r]->FindAttributeByName( KType );
+        if ( rightAttr->Value() == KDRMPlayRight &&
+             !( drmPermission->iAvailableRights & ERightsPlay ) )
+            {
+            drmPermission->iAvailableRights |= ERightsPlay;
+            ParseDRMConstraintsL( rights[r], drmPermission->iPlay );
+            }
+        else if ( rightAttr->Value() == KDRMDisplayRight  &&
+                !( drmPermission->iAvailableRights & ERightsDisplay ))
+            {
+            drmPermission->iAvailableRights |= ERightsDisplay;
+            ParseDRMConstraintsL( rights[r], drmPermission->iDisplay );
+            }
+        else if ( rightAttr->Value() == KDRMPrintRight  &&
+                !( drmPermission->iAvailableRights & ERightsPrint ) )
+            {
+            drmPermission->iAvailableRights |= ERightsPrint;
+            ParseDRMConstraintsL( rights[r], drmPermission->iPrint );
+            }
+        else if ( rightAttr->Value() == KDRMExecuteRight  &&
+                !( drmPermission->iAvailableRights & ERightsExecute ) )
+            {
+            drmPermission->iAvailableRights |= ERightsExecute;
+            ParseDRMConstraintsL( rights[r], drmPermission->iExecute );
+            }
+        }
+    }
+
+void CCreatorFileElement::ParseDRMConstraintsL( CCreatorScriptElement* aRight, CDRMConstraint* aConstraint )
+    {
+    const RPointerArray<CCreatorScriptElement>& constraints = aRight->SubElements();
+    for ( TInt c = 0; c < constraints.Count(); c++ )
+        {
+        TPtrC elemName = constraints[c]->Name();
+        TPtrC elemContent = constraints[c]->Content();
+        if ( elemName == KDRMCount )
+            {
+            TInt count = ConvertStrToIntL( elemContent );
+            // apply count constraint
+            aConstraint->iActiveConstraints |= EConstraintCounter;
+            aConstraint->iCounter = count;
+            aConstraint->iOriginalCounter = count;
+            }
+        else if ( elemName == KDRMInterval )
+            {
+            // apply interval constraint           
+            aConstraint->iActiveConstraints |= EConstraintInterval;
+            aConstraint->iInterval = ParseTimeInterval( elemContent );
+            aConstraint->iIntervalStart = Time::NullTTime();
+            }
+        else if ( elemName == KDRMStartTime )
+            {
+            // apply start time constraint           
+            aConstraint->iActiveConstraints |= EConstraintStartTime;
+            TTimeIntervalSeconds offset( iTimeZone * KSecondsPerTimeZone );
+            aConstraint->iStartTime = ConvertToDateTimeL( elemContent ) - offset;
+            }
+        else if ( elemName == KDRMEndTime )
+            {
+            // apply end time constraint
+            aConstraint->iActiveConstraints |= EConstraintEndTime;
+            TTimeIntervalSeconds offset( iTimeZone * KSecondsPerTimeZone );
+            aConstraint->iEndTime = ConvertToDateTimeL( elemContent ) - offset;
+            }
+        else if ( elemName == KDRMAccumulated )
+            {
+            // apply accumulated time constraint
+            aConstraint->iActiveConstraints |= EConstraintAccumulated;
+            if ( aConstraint->iEndTime == Time::NullTTime() )
+                {
+                aConstraint->iEndTime = Time::MaxTTime();
+                }
+            if ( aConstraint->iStartTime == Time::NullTTime() )
+                {
+                aConstraint->iStartTime = Time::MinTTime();
+                }
+            aConstraint->iAccumulatedTime = ParseTimeInterval( elemContent );
+            }
+        }
+    }
+
+TTimeIntervalSeconds CCreatorFileElement::ParseTimeInterval( TDesC& aTimeString )
+    {
+    // Iso8601 format (P1Y2M3DT4H5M6S) to TimeIntervalSeconds
+    TLex lex;
+    TInt year = 0;
+    TInt month = 0;
+    TInt day = 0;
+    TInt hour = 0;
+    TInt minute = 0;
+    TInt second = 0;
+
+    if (aTimeString.Length() > 0)
+        {    
+        lex = aTimeString;
+        lex.Inc(); // skip 'P'
+        lex.Val(year);
+        lex.Inc();
+        lex.Val(month);
+        lex.Inc();
+        lex.Val(day);
+        lex.Inc(2);
+        lex.Val(hour);
+        lex.Inc();
+        lex.Val(minute);
+        lex.Inc();
+        lex.Val(second);
+        }
+    TTimeIntervalSeconds result( ( ( ( year * 365 + month * 30 + day ) * 24 + hour )
+                * 60 + minute ) * 60 + second );
+    return result;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_landmark.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,499 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <epos_cposlandmarkdatabase.h>
+#include <epos_cposlmcategorymanager.h>
+#include <lbsposition.h>
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_landmark.h" 
+#include "creator_traces.h"
+
+_LIT(KAccommodation, "accommodation");
+_LIT(KBusiness, "business");
+_LIT(KCommunication, "communication");
+_LIT(KEducational, "educational");
+_LIT(KEntertainment, "entertainment");
+_LIT(KFoodAndBeverage, "food");
+_LIT(KGeographical, "geographical");
+_LIT(KOutdoor, "outdoor");
+_LIT(KPeople, "people");
+_LIT(KPublic, "public");
+_LIT(KReligious, "religious");
+_LIT(KShopping, "shopping");
+_LIT(KSightseeing, "sightseeing");
+_LIT(KSports, "sports");
+_LIT(KTransport, "transport");
+
+
+/**
+ * Class mapping the strings to global landmark categories
+ */
+class CategoryMapping
+{
+public:
+    CategoryMapping(TUint aId, const TDesC& aCategoryStr)
+    : 
+    iGlobalId(aId),
+    iStr(aCategoryStr)
+    {}
+
+    TPosLmGlobalCategory iGlobalId;
+    const TDesC& iStr;
+};
+
+/**
+ * Global landmark categories
+ */
+CategoryMapping LandmarkCategories[] =    {
+        CategoryMapping(3000, KAccommodation), // Accommodation
+        CategoryMapping(6000, KBusiness), // Business
+        CategoryMapping(9000, KCommunication), // Communication
+        CategoryMapping(12000, KEducational), // Educational institute
+        CategoryMapping(15000, KEntertainment), // Entertainment
+        CategoryMapping(18000, KFoodAndBeverage), // Food & Beverage
+        CategoryMapping(21000, KGeographical), // Geographical area
+        CategoryMapping(24000, KOutdoor), // Outdoor activities        
+        CategoryMapping(27000, KPeople), // People
+        CategoryMapping(30000, KPublic), // Public service
+        CategoryMapping(33000, KReligious), // Religious places
+        CategoryMapping(36000, KShopping), // Shopping
+        CategoryMapping(39000, KSightseeing), // Sightseeing
+        CategoryMapping(42000, KSports), // Sports
+        CategoryMapping(45000, KTransport)  // Transport
+};
+
+/**
+ * Return landmark global id
+ */ 
+TPosLmGlobalCategory CCreatorLandmarks::GetCategoryIdL(const TDesC& aCategoryStr)
+    {
+    TUint numOfCategories = sizeof(LandmarkCategories)/sizeof(CategoryMapping);
+    for( TUint i = 0; i < numOfCategories; ++i )
+        {
+        if( LandmarkCategories[i].iStr == aCategoryStr )
+            return LandmarkCategories[i].iGlobalId;
+        }
+    
+    return 0;
+    }
+
+/**
+ *
+ */ 
+CLandmarkParameters::CLandmarkParameters()
+    {
+    LOGSTRING("Creator: CLandmarkParameters::CLandmarkParameters");
+    }
+
+/**
+ *
+ */
+CLandmarkParameters::~CLandmarkParameters()
+    {
+    LOGSTRING("Creator: CLandmarkParameters::~CLandmarkParameters");
+    delete iName;    
+    delete iStreet;
+    delete iCity;    
+    delete iState;
+    delete iCountry;
+    delete iPostCode;    
+    delete iDescription;
+    delete iPhonenumber;
+    delete iUrl;
+    iCategories.Close();
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomNameL(CCreatorEngine& aEngine)
+    {    
+    TPtrC name(aEngine.RandomString(CCreatorEngine::ELandmarkName));
+    delete iName;
+    iName = 0;
+    iName = HBufC::NewL(name.Length());
+    iName->Des().Copy(name);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomUrlL(CCreatorEngine& aEngine)
+    {
+    _LIT(KUrlPrefix, "http://www.");
+    _LIT(KUrlPostfix, ".com");
+    TPtrC company(aEngine.RandomString(CCreatorEngine::ECompany));
+    delete iUrl;
+    iUrl = 0;
+    iUrl = HBufC::NewL(KUrlPrefix().Length()+company.Length()+KUrlPostfix().Length());
+    iUrl->Des() = KUrlPrefix;
+    iUrl->Des().Append( company );
+    iUrl->Des().Append( KUrlPostfix );
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::AddRandomCategoryL(CCreatorEngine& aEngine)
+    {
+    TUint numOfCategories = sizeof(LandmarkCategories)/sizeof(CategoryMapping);
+    iCategories.AppendL(LandmarkCategories[aEngine.RandomNumber(0, numOfCategories-1)].iGlobalId);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomStreetL(CCreatorEngine& aEngine)
+    {
+    TPtrC street(aEngine.RandomString(CCreatorEngine::EAddress));
+    delete iStreet;
+    iStreet = 0;
+    iStreet = HBufC::NewL(street.Length());
+    iStreet->Des().Copy(street);
+    }
+ 
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomCityL(CCreatorEngine& aEngine)
+    {
+    TPtrC city(aEngine.RandomString(CCreatorEngine::ECity));
+    delete iCity;
+    iCity = 0;
+    iCity = HBufC::NewL(city.Length());
+    iCity->Des().Copy(city);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomStateL(CCreatorEngine& aEngine)
+    {
+    TPtrC state(aEngine.RandomString(CCreatorEngine::EState));
+    delete iState;
+    iState = 0;
+    iState = HBufC::NewL(state.Length());
+    iState->Des().Copy(state);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomCountryL(CCreatorEngine& aEngine)
+    {
+    TPtrC country(aEngine.RandomString(CCreatorEngine::ECountry));
+    delete iCountry;
+    iCountry = 0;
+    iCountry = HBufC::NewL(country.Length());
+    iCountry->Des().Copy(country);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomPostCodeL(CCreatorEngine& aEngine)
+    {
+    TPtrC po(aEngine.RandomString(CCreatorEngine::EPostcode));
+    delete iPostCode;
+    iPostCode = 0;
+    iPostCode = HBufC::NewL(po.Length());
+    iPostCode->Des().Copy(po);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomLatitudeL(CCreatorEngine& aEngine)
+    {
+    iLatitude = aEngine.RandomNumber(-89, 89); // Degrees
+    TReal64 random = aEngine.RandomNumber(0, 9999); // Desimals 
+    iLatitude +=  random / 10000.0;
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomLongitudeL(CCreatorEngine& aEngine)
+    {
+    TInt minDegrees = -179;
+    TInt maxDegrees = 179;
+    TInt minDecimal = 0;
+    TInt maxDecimal = 9999;
+    TReal64 divider = 10000.0;
+    iLongitude = aEngine.RandomNumber(minDegrees, maxDegrees); // Degrees
+    TReal64 random = aEngine.RandomNumber(minDecimal, maxDecimal); 
+    iLongitude += random  / divider;
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomPositionAccuracyL(CCreatorEngine& aEngine)
+    {
+    this->iPositionAccuracy = aEngine.RandomNumber(0,5);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomAltitudeL(CCreatorEngine& aEngine)
+    {
+    this->iAltitude = aEngine.RandomNumber(0,120);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine)
+    {
+    this->iAltitudeAccuracy = aEngine.RandomNumber(0,5);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomDescriptionL(CCreatorEngine& aEngine)
+    {
+    delete iDescription;
+    iDescription = 0;
+    TPtrC desc(aEngine.RandomString(CCreatorEngine::ELandmarkDescription));
+    iDescription = HBufC::NewL(desc.Length());
+    iDescription->Des().Copy(desc);
+    }
+
+/**
+ *
+ */
+void CLandmarkParameters::SetRandomPhoneNumberL(CCreatorEngine& aEngine)
+    {
+    delete iPhonenumber;
+    iPhonenumber = 0;
+    TPtrC phone(aEngine.RandomString(CCreatorEngine::EPhoneNumber));
+    iPhonenumber = HBufC::NewL(phone.Length());
+    iPhonenumber->Des().Copy(phone);
+    }
+
+/**
+ *
+ */
+CCreatorLandmarks::CCreatorLandmarks()
+    {
+    }
+
+/**
+ *
+ */
+CCreatorLandmarks* CCreatorLandmarks::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorLandmarks* self = CCreatorLandmarks::NewLC(aEngine);
+    CleanupStack::Pop(); // self
+    return self;
+    }
+
+/**
+ *
+ */
+CCreatorLandmarks* CCreatorLandmarks::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorLandmarks* self = new (ELeave) CCreatorLandmarks;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+/**
+ *
+ */
+void CCreatorLandmarks::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::ConstructL");
+    iEngine = aEngine;
+    iLandmarkDb = CPosLandmarkDatabase::OpenL();
+    if( iLandmarkDb->IsInitializingNeeded() )
+        {
+        ExecuteAndDeleteLD(iLandmarkDb->InitializeL());
+        }
+    }
+
+/**
+ *
+ */
+CCreatorLandmarks::~CCreatorLandmarks()
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::~CCreatorLandmarks");
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidLandmarks ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    delete iLandmarkDb;
+    delete iLmOperation;
+    delete iParameters;
+    }
+
+/**
+ *
+ */
+TBool CCreatorLandmarks::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::AskDataFromUserL");
+    if ( aCommand == ECmdDeleteLandmarks )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Landmarks?") );
+        }
+    else if ( aCommand ==  ECmdDeleteCreatorLandmarks )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Landmarks created with Creator?") );
+        }
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many landmarks to create?"));    
+    }
+
+/**
+ * Convert global category id to local category id
+ */
+TPosLmItemId CCreatorLandmarks::GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID )
+{
+    CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL( *iLandmarkDb );
+    CleanupStack::PushL( categoryManager );
+
+    // Find ID of the given global category in given database
+    TPosLmItemId id = categoryManager->GetGlobalCategoryL( aGlobalCategoryID );
+    CleanupStack::PopAndDestroy(); // categoryManager
+    return id;
+}
+
+/**
+ *
+ */
+TInt CCreatorLandmarks::CreateLandmarkEntryL(CLandmarkParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::CreateLandmarkEntryL");
+    TInt err = KErrNone;
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+        
+    CLandmarkParameters* parameters = aParameters;
+        
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CLandmarkParameters;
+        parameters = iParameters;
+            
+        TBuf<160> company = iEngine->RandomString(CCreatorEngine::ECompany);
+
+        parameters->SetRandomNameL(*iEngine);
+        parameters->SetRandomUrlL(*iEngine);
+        parameters->AddRandomCategoryL(*iEngine);
+        parameters->SetRandomStreetL(*iEngine);
+        parameters->SetRandomCityL(*iEngine);
+        parameters->SetRandomStateL(*iEngine);
+        parameters->SetRandomCountryL(*iEngine);
+        parameters->SetRandomPostCodeL(*iEngine);
+        parameters->SetRandomLatitudeL(*iEngine);
+        parameters->SetRandomLongitudeL(*iEngine);
+        parameters->SetRandomPositionAccuracyL(*iEngine);
+        parameters->SetRandomAltitudeL(*iEngine);
+        parameters->SetRandomAltitudeAccuracyL(*iEngine);
+        parameters->SetRandomDescriptionL(*iEngine);
+        parameters->SetRandomPhoneNumberL(*iEngine);
+        }
+    
+    CPosLandmark* newLandmark = CPosLandmark::NewLC();        
+    TCoordinate crd(parameters->iLatitude, parameters->iLongitude, parameters->iAltitude);
+    TLocality loc(crd, parameters->iPositionAccuracy, parameters->iAltitudeAccuracy);
+    newLandmark->SetPositionL(loc);
+    
+    // Add categories
+    for( TInt i = 0; i < parameters->iCategories.Count(); ++i )
+        {
+        newLandmark->AddCategoryL(GetCategoryIdL(parameters->iCategories[i]));
+        }
+    if( parameters->iName )    
+        newLandmark->SetLandmarkNameL(parameters->iName->Des());    
+    if( parameters->iCountry )
+        newLandmark->SetPositionFieldL(EPositionFieldCountry, parameters->iCountry->Des());
+    if( parameters->iCity )
+        newLandmark->SetPositionFieldL(EPositionFieldCity, parameters->iCity->Des());
+    if( parameters->iPostCode )
+        newLandmark->SetPositionFieldL(EPositionFieldPostalCode, parameters->iPostCode->Des());
+    if( parameters->iState )
+        newLandmark->SetPositionFieldL(EPositionFieldState, parameters->iState->Des());
+    if( parameters->iStreet )
+        newLandmark->SetPositionFieldL(EPositionFieldStreet, parameters->iStreet->Des());
+    if( parameters->iPhonenumber )
+        newLandmark->SetPositionFieldL(EPositionFieldBuildingTelephone, parameters->iPhonenumber->Des());
+    if( parameters->iDescription )
+        newLandmark->SetLandmarkDescriptionL(parameters->iDescription->Des());    
+    if( parameters->iUrl )
+        newLandmark->SetPositionFieldL(EPositionFieldMediaLinksStart, parameters->iUrl->Des());
+    
+    TRAP(err, iLandmarkDb->AddLandmarkL(*newLandmark));
+    
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( newLandmark->LandmarkId() );
+
+    ExecuteAndDeleteLD(iLandmarkDb->CompactL());
+    
+    CleanupStack::PopAndDestroy(newLandmark);
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorLandmarks::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::DeleteAllL");
+    ExecuteAndDeleteLD( iLandmarkDb->RemoveAllLandmarksL() );
+    ExecuteAndDeleteLD( iLandmarkDb->CompactL() );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Landmarks related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidLandmarks );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorLandmarks::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorLandmarks::DeleteAllCreatedByCreatorL");
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidLandmarks );
+    
+    // delete entries
+    TRAP_IGNORE(
+        ExecuteAndDeleteLD( iLandmarkDb->RemoveLandmarksL( iEntryIds ) );
+        ExecuteAndDeleteLD( iLandmarkDb->CompactL() );
+        );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Landmarks related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidLandmarks );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_landmarkelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_landmarkelement.h"
+#include "creator_traces.h"
+#include "creator_landmark.h"
+
+using namespace creatorlandmark;
+
+/*
+ * 
+ */
+CCreatorLandmarkElement* CCreatorLandmarkElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorLandmarkElement* self = new (ELeave) CCreatorLandmarkElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorLandmarkElement::CCreatorLandmarkElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+
+void CCreatorLandmarkElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    TInt lmAmount = 1;    
+    if( amountAttr )
+        {
+        lmAmount = ConvertStrToIntL(amountAttr->Value());
+        }
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
+        // Create note entries, the amount of entries is defined by noteAmount:
+        for( TInt cI = 0; cI < lmAmount; ++cI )
+            {            
+            CLandmarkParameters* param = new (ELeave) CLandmarkParameters;
+            CleanupStack::PushL(param);
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+                TBool useRandom = EFalse;
+                if( randomAttr || elemContent.Length() == 0 )
+                    {
+                    useRandom = ETrue;
+                    }
+                
+                if( elemName == KName )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomNameL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iName, elemContent);
+                        }
+                    }
+                else if( elemName == KCategory )
+                    {
+                    if( useRandom )
+                        {
+                        param->AddRandomCategoryL(*iEngine);
+                        }                    
+                    else
+                        {
+                        TPosLmItemId categoryId = CCreatorLandmarks::GetCategoryIdL(elemContent);
+                        if( categoryId > 0 )
+                            {
+                            param->iCategories.AppendL(categoryId);
+                            }
+                        }
+                    }
+                else if( elemName == KDescription )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomDescriptionL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iDescription, elemContent);
+                        }
+                    }
+                else if( elemName == KStreet )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomStreetL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iStreet, elemContent);
+                        }
+                    }
+                else if( elemName == KPostalcode )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomPostCodeL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iPostCode, elemContent);
+                        }
+                    }
+                else if( elemName == KCity )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomCityL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iCity, elemContent);
+                        }
+                    }
+                else if( elemName == KState )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomStateL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iState, elemContent);
+                        }
+                    }
+                else if( elemName == KCountry )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomCountryL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iCountry, elemContent);
+                        }
+                    }
+                else if( elemName == KPhonenumber )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomPhoneNumberL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iPhonenumber, elemContent);
+                        }
+                    }
+                else if( elemName == KUrl )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomUrlL(*iEngine);
+                        }                    
+                    else
+                        {
+                        SetContentToTextParamL(param->iUrl, elemContent);
+                        }
+                    }
+                else if( elemName == KLatitude )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomLatitudeL(*iEngine);
+                        }                    
+                    else
+                        {
+                        ConvertStrToReal64L(elemContent, param->iLatitude);
+                        }
+                    }
+                else if( elemName == KLongitude )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomLongitudeL(*iEngine);
+                        }                    
+                    else
+                        {
+                        ConvertStrToReal64L(elemContent, param->iLongitude);
+                        }
+                    }
+                else if( elemName == KPositionaccuracy )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomPositionAccuracyL(*iEngine);
+                        }                    
+                    else
+                        {
+                        param->iPositionAccuracy = ConvertStrToIntL(elemContent);
+                        }
+                    }
+                else if( elemName == KAltitude )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomAltitudeL(*iEngine);
+                        }                    
+                    else
+                        {
+                        ConvertStrToReal32L(elemContent, param->iAltitude);
+                        }
+                    }
+                else if( elemName == KAltitudeaccuracy )
+                    {
+                    if( useRandom )
+                        {
+                        param->SetRandomAltitudeAccuracyL(*iEngine);
+                        }                    
+                    else
+                        {
+                        param->iAltitudeAccuracy = ConvertStrToIntL(elemContent);
+                        }
+                    }
+                }
+            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryLandmarks, param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryLandmarks, 0, lmAmount);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_log.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <cntdef.h>
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_log.h" 
+#include "creator_traces.h"
+
+static const TInt KLogsFieldLength = 256;
+
+//_LIT(KCreatorLogsPrefixName, "CR_");
+
+//----------------------------------------------------------------------------
+
+CLogsParameters::CLogsParameters()
+    {
+    LOGSTRING("Creator: CLogsParameters::CLogsParameters");
+
+    iPhoneNumber = HBufC::New(KLogsFieldLength);
+    /*iMissedCallPhoneNumber = HBufC::New(KLogsFieldLength);
+    iReceivedCallPhoneNumber = HBufC::New(KLogsFieldLength);
+    iDialledNumberPhoneNumber = HBufC::New(KLogsFieldLength);*/
+    }
+
+CLogsParameters::~CLogsParameters()
+    {
+    LOGSTRING("Creator: CLogsParameters::~CLogsParameters");
+
+    delete iPhoneNumber;
+    /*delete iDialledNumberPhoneNumber;
+    delete iReceivedCallPhoneNumber;
+    delete iMissedCallPhoneNumber;*/
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorLogs* CCreatorLogs::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorLogs* self = CCreatorLogs::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorLogs* CCreatorLogs::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorLogs* self = new (ELeave) CCreatorLogs;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorLogs::CCreatorLogs() : CActive(0)
+    {
+    }
+
+void CCreatorLogs::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorLogs::ConstructL");
+
+    iEngine = aEngine;
+
+    iLogClient = CLogClient::NewL(CEikonEnv::Static()->FsSession());
+    iLogEvent = CLogEvent::NewL();
+
+	CActiveScheduler::Add(this); // needed by CActive
+    }
+
+CCreatorLogs::~CCreatorLogs()
+    {
+    LOGSTRING("Creator: CCreatorLogs::~CCreatorLogs");
+
+    Cancel(); //from CActive
+
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidLogs ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    delete iLogEvent;
+    delete iLogClient;
+
+    if (iParameters)
+        delete iParameters;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorLogs::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
+    if ( aCommand == ECmdDeleteLogs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?") );
+        }
+    else if ( aCommand ==  ECmdDeleteCreatorLogs )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?") );
+        }
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog( aNumberOfEntries, _L("How many entries to create?") );
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorLogs::RunL()
+	{
+    LOGSTRING("Creator: CCreatorLogs::RunL");
+
+    // log writing finished, stop the async waiting
+    iLogWriteWait.AsyncStop();
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorLogs::DoCancel()
+	{
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorLogs::CreateMissedCallEntryL(CLogsParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorLogs::CreateMissedCallEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CLogsParameters* parameters = aParameters;
+    
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CLogsParameters;
+        parameters = iParameters;
+
+        /*iParameters->iMissedCallPhoneNumber->Des().Zero();
+        iParameters->iMissedCallPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+
+        iParameters->iMissedCallEventTime.UniversalTime();
+        iParameters->iMissedCallEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );*/
+        parameters->iPhoneNumber->Des().Zero();
+        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+        
+        parameters->iEventTime.UniversalTime();
+        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
+
+        }
+    
+    // defaults
+    iLogEvent->SetId( KLogNullId );
+    iLogEvent->SetEventType( KNullUid );
+    iLogEvent->SetRemoteParty( KNullDesC );
+    iLogEvent->SetDirection( KNullDesC );
+    iLogEvent->SetTime( Time::NullTTime() );
+    iLogEvent->SetDurationType( KLogNullDurationType );
+    iLogEvent->SetDuration( KLogNullDuration );
+    iLogEvent->SetStatus( KNullDesC );
+    iLogEvent->SetSubject( KNullDesC );
+    iLogEvent->SetNumber( KNullDesC );
+    iLogEvent->SetContact( KNullContactId );
+    iLogEvent->SetLink( KLogNullLink );
+    iLogEvent->SetDescription( KNullDesC );
+    iLogEvent->SetFlags( KLogNullFlags );
+    iLogEvent->SetEventType(KLogCallEventTypeUid);
+    iLogEvent->SetSubject(_L("A"));
+
+    // set direction
+    TLogString missed;
+    iLogClient->GetString(missed, R_LOG_DIR_MISSED);
+    iLogEvent->SetDirection(missed);
+
+    // set duration
+    iLogEvent->SetDurationType( KLogDurationNone );
+    TLogDuration duration = 0;
+    iLogEvent->SetDuration(duration);
+
+    // set the phone number
+    //iLogEvent->SetNumber( iParameters->iMissedCallPhoneNumber->Des() );
+    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
+
+    // set event time
+    //iLogEvent->SetTime( iParameters->iMissedCallEventTime );
+    iLogEvent->SetTime( parameters->iEventTime );
+
+    // start writing
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 150));
+	iLogClient->AddEvent(*iLogEvent, iStatus);
+	SetActive();
+
+    // wait till adding has finished
+    iLogWriteWait.Start();
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( iLogEvent->Id() );
+
+    return iStatus.Int();  // should be KErrNone if writing was succesful
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorLogs::CreateReceivedCallEntryL(CLogsParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorLogs::CreateReceivedCallEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CLogsParameters* parameters = aParameters;
+        
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CLogsParameters;
+        parameters = iParameters;
+
+        /*iParameters->iReceivedCallPhoneNumber->Des().Zero();
+        iParameters->iReceivedCallPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+
+        iParameters->iReceivedCallEventTime.UniversalTime();
+        iParameters->iReceivedCallEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
+
+        iParameters->iReceivedCallDuration = iEngine->RandomNumber(7200);*/
+        parameters->iPhoneNumber->Des().Zero();
+        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+        
+        parameters->iEventTime.UniversalTime();
+        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
+        
+        parameters->iDuration = iEngine->RandomNumber(7200);
+        }
+   
+    // defaults
+    iLogEvent->SetId( KLogNullId );
+    iLogEvent->SetEventType( KNullUid );
+    iLogEvent->SetRemoteParty( KNullDesC );
+    iLogEvent->SetDirection( KNullDesC );
+    iLogEvent->SetTime( Time::NullTTime() );
+    iLogEvent->SetDurationType( KLogNullDurationType );
+    iLogEvent->SetDuration( KLogNullDuration );
+    iLogEvent->SetStatus( KNullDesC );
+    iLogEvent->SetSubject( KNullDesC );
+    iLogEvent->SetNumber( KNullDesC );
+    iLogEvent->SetContact( KNullContactId );
+    iLogEvent->SetLink( KLogNullLink );
+    iLogEvent->SetDescription( KNullDesC );
+    iLogEvent->SetFlags( KLogNullFlags );
+    iLogEvent->SetEventType(KLogCallEventTypeUid);
+    iLogEvent->SetSubject(_L("A"));
+
+    // set direction
+    TLogString incoming;
+    iLogClient->GetString(incoming, R_LOG_DIR_IN);
+    iLogEvent->SetDirection(incoming);
+
+    // set duration
+    iLogEvent->SetDurationType( KLogDurationValid );
+    //iLogEvent->SetDuration( iParameters->iReceivedCallDuration );
+    iLogEvent->SetDuration( parameters->iDuration );
+
+    // set the phone number
+    //iLogEvent->SetNumber( iParameters->iReceivedCallPhoneNumber->Des() );
+    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
+
+    // set event time
+    //iLogEvent->SetTime( iParameters->iReceivedCallEventTime );
+    iLogEvent->SetTime( parameters->iEventTime );
+
+    // start writing
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 151));
+	iLogClient->AddEvent(*iLogEvent, iStatus);
+	SetActive();
+
+    // wait till adding has finished
+    iLogWriteWait.Start();
+
+    // id has been generated, store it for being able to delete
+    // entries created only with Creator
+    iEntryIds.Append( iLogEvent->Id() );
+
+    return iStatus.Int();  // should be KErrNone if writing was succesful
+    }
+
+//----------------------------------------------------------------------------
+
+
+TInt CCreatorLogs::CreateDialledNumberEntryL(CLogsParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorLogs::CreateDialledNumberEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CLogsParameters* parameters = aParameters; 
+        
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CLogsParameters;
+        parameters = iParameters;
+
+        /*iParameters->iDialledNumberPhoneNumber->Des().Zero();
+        iParameters->iDialledNumberPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+
+        iParameters->iDialledNumberEventTime.UniversalTime();
+        iParameters->iDialledNumberEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
+
+        iParameters->iDialledNumberDuration = iEngine->RandomNumber(7200);*/
+        parameters->iPhoneNumber->Des().Zero();
+        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
+
+        parameters->iEventTime.UniversalTime();
+        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
+
+        parameters->iDuration = iEngine->RandomNumber(7200);
+
+        }
+   
+    // defaults
+    iLogEvent->SetId( KLogNullId );
+    iLogEvent->SetEventType( KNullUid );
+    iLogEvent->SetRemoteParty( KNullDesC );
+    iLogEvent->SetDirection( KNullDesC );
+    iLogEvent->SetTime( Time::NullTTime() );
+    iLogEvent->SetDurationType( KLogNullDurationType );
+    iLogEvent->SetDuration( KLogNullDuration );
+    iLogEvent->SetStatus( KNullDesC );
+    iLogEvent->SetSubject( KNullDesC );
+    iLogEvent->SetNumber( KNullDesC );
+    iLogEvent->SetContact( KNullContactId );
+    iLogEvent->SetLink( KLogNullLink );
+    iLogEvent->SetDescription( KNullDesC );
+    iLogEvent->SetFlags( KLogNullFlags );
+    iLogEvent->SetEventType(KLogCallEventTypeUid);
+    iLogEvent->SetSubject(_L("A"));
+
+    // set direction
+    TLogString outgoing;
+    iLogClient->GetString(outgoing, R_LOG_DIR_OUT);
+    iLogEvent->SetDirection(outgoing);
+
+    // set duration
+    iLogEvent->SetDurationType( KLogDurationValid );
+    //iLogEvent->SetDuration( iParameters->iDialledNumberDuration );
+    iLogEvent->SetDuration( parameters->iDuration );
+
+    // set the phone number
+    //iLogEvent->SetNumber( iParameters->iDialledNumberPhoneNumber->Des() );
+    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
+
+    // set event time
+    //iLogEvent->SetTime( iParameters->iDialledNumberEventTime );
+    iLogEvent->SetTime( parameters->iEventTime );
+
+    // start writing
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 152));
+	iLogClient->AddEvent(*iLogEvent, iStatus);
+	SetActive();
+
+    // wait till adding has finished
+    iLogWriteWait.Start();
+
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( iLogEvent->Id() );
+    
+    return iStatus.Int();  // should be KErrNone if writing was succesful
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorLogs::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorLogs::DeleteAllL");
+    iLogClient->ClearLog( TTime( Time::MaxTTime() ), iStatus ); 
+    SetActive();
+    
+    // wait till delete has finished
+    iLogWriteWait.Start();
+    User::LeaveIfError( iStatus.Int() );
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Logs related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidLogs );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorLogs::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorLogs::DeleteAllCreatedByCreatorL");
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidLogs );
+    
+    // delete entries
+    for ( TInt i = 0; i < iEntryIds.Count(); i++ )
+        {
+        // This could be implemented with while loop
+        // with additional cancel flag. That would enable 
+        // using CancelOp() and cancelling would be bit smoother.
+        // With this for loop implementation all entries will be
+        // deleted whether or not user cancels during logs operation.
+
+        iLogClient->DeleteEvent( iEntryIds[i], iStatus );
+        SetActive();        
+        // wait till delete has finished
+        iLogWriteWait.Start();
+        }
+    
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Logs related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidLogs );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_logelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_logelement.h"
+#include "creator_traces.h"
+#include "creator_log.h"
+
+using namespace creatorlog;
+
+/*
+ * 
+ */
+CCreatorLogElement* CCreatorLogElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorLogElement* self = new (ELeave) CCreatorLogElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorLogElement::CCreatorLogElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+/*
+ * 
+ */
+void CCreatorLogElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    TInt logAmount = 1;    
+    if( amountAttr )
+        {
+        logAmount = ConvertStrToIntL(amountAttr->Value());
+        }
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
+        // Create log entries, the amount of entries is defined by logAmount:
+        for( TInt cI = 0; cI < logAmount; ++cI )
+            {
+            TInt direction = -1;
+            CLogsParameters* param = new (ELeave) CLogsParameters;
+            CleanupStack::PushL(param);
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName(KRandomLength);
+                const CCreatorScriptAttribute* increaseAttr = field->FindAttributeByName(KIncrease);
+                TBool increase( EFalse );
+                if ( increaseAttr )
+                    {
+                    increase = ConvertStrToBooleanL( increaseAttr->Value() );
+                    }
+                
+                if( elemName == KDirection )
+                    {
+                    direction = GetLogCommandL(elemContent, randomAttr || elemContent.Length() == 0); 
+                    }
+                else if( elemName == KDuration )
+                    {
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        param->iDuration = iEngine->RandomNumber(7200);
+                        }
+                    else
+                        {
+                        param->iDuration = ConvertStrToIntL(elemContent);
+                        }
+                    }
+                else if( elemName == KPhonenumber )
+                    {
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        SetContentToTextParamL(param->iPhoneNumber, iEngine->RandomString(CCreatorEngine::EPhoneNumber));
+                        }
+                    else
+                        {
+                        if ( increase )
+                            {
+                            delete param->iPhoneNumber;
+                            param->iPhoneNumber = NULL;
+                            param->iPhoneNumber = HBufC::NewL( elemContent.Length() + 3 );
+                            IncreasePhoneNumL( elemContent, cI, param->iPhoneNumber );
+                            }
+                        else
+                            {
+                            SetContentToTextParamL(param->iPhoneNumber, elemContent);
+                            }
+                        }                    
+                    }
+                else if( elemName == KDatetime )
+                    {
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        param->iEventTime = iEngine->RandomTime(iEngine->RandomDate(CCreatorEngine::EDatePast), CCreatorEngine::EDatePast); 
+                        }
+                    else
+                        {
+                        param->iEventTime = ConvertToDateTimeL(elemContent);
+                        }
+                    }
+                }
+            
+            if( direction == -1 )
+                {
+                direction = GetLogCommandL(KEmpty, ETrue); 
+                }
+            iEngine->AppendToCommandArrayL(direction, param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	for(TInt i = 0; i < logAmount; ++i )
+    		{
+    		iEngine->AppendToCommandArrayL(GetLogCommandL(KEmpty, ETrue), 0, 1);
+    		}
+    	}
+    }
+
+TInt CCreatorLogElement::GetLogCommandL( const TDesC& aLogCmdStr, TBool aRandom ) const
+    {      
+    if( aRandom )
+        {
+        TInt commandArray[] = {
+                    ECmdCreateLogEntryMissedCalls,
+                    ECmdCreateLogEntryReceivedCalls,
+                    ECmdCreateLogEntryDialledNumbers
+            };
+        return commandArray[iEngine->RandomNumber(0, 2)];
+        }
+    
+    if( CompareIgnoreCase(aLogCmdStr, KMissed) == 0 )
+        return ECmdCreateLogEntryMissedCalls;
+    else if( CompareIgnoreCase(aLogCmdStr, KIn) == 0 )
+        return ECmdCreateLogEntryReceivedCalls;
+    else if( CompareIgnoreCase(aLogCmdStr, KOut) == 0 )
+        return ECmdCreateLogEntryDialledNumbers;
+    
+    LOGSTRING2("CCreatorLogElement::GetLogCommandL: Unknown log direction: %S", &aLogCmdStr);
+    User::Leave(KErrNotFound);
+    return -1; // Not reached, but disables compiler warning...
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_mailbox.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,794 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <etelmm.h>
+#include <msvapi.h>
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_mailbox.h" 
+#include "creator_traces.h"
+
+static const TInt KMailboxesFieldLength = 160;
+
+_LIT(KCreatorMailboxesPrefixName, "CR_");
+
+_LIT(KDefaultIncomingServer, "mail.example.com");
+_LIT(KDefaultOutgoingServer, "smtp.example.com");
+_LIT(KInternet, "internet");
+
+
+//----------------------------------------------------------------------------
+
+CMailboxesParameters::CMailboxesParameters()
+    {
+    LOGSTRING("Creator: CMailboxesParameters::CMailboxesParameters");
+
+    iIncomingPort = KUndef;
+    iOutgoingPort = KUndef;
+    iMaxEmailSize = KUndef;
+    iSyncRate = KUndef;
+    iAttachmentFetchSize = KUndef;
+    iAttachmentSizeLimit = KUndef;
+    iBodyTextSizeLimit = KUndef;
+    iAttachmentFetchSize = KUndef;
+    iInboxSyncLimit = -1; // -1 = All
+    iMailboxSyncLimit = -1; // -1 = All    
+    iToCCIncludeLimit = KUndef;
+    iImapIdleTimeout = KUndef;
+    
+    /*iMailboxName = HBufC::New(KMailboxesFieldLength);
+    iAccessPoint = HBufC::New(KMailboxesFieldLength);
+    iMyMailAddress = HBufC::New(KMailboxesFieldLength);
+    iOutgoingMailServer = HBufC::New(KMailboxesFieldLength);
+    iUserName = HBufC::New(KMailboxesFieldLength);
+    iPassword = HBufC::New(KMailboxesFieldLength);
+    iIncomingMailServer = HBufC::New(KMailboxesFieldLength);*/
+    }
+
+CMailboxesParameters::~CMailboxesParameters()
+    {
+    LOGSTRING("Creator: CMailboxesParameters::~CMailboxesParameters");
+
+    /*delete iIncomingMailServer;
+    delete iPassword;
+    delete iUserName;
+    delete iOutgoingMailServer;
+    delete iMyMailAddress;
+    delete iAccessPoint;
+    delete iMailboxName;*/
+    
+    delete iMailboxName;
+    delete iIncomingLoginName;
+    delete iIncomingPassword;
+    delete iIncomingServerName;
+    delete iIncomingConnectionMethod;
+    delete iIncomingFolderPath;
+    delete iPathSeparator;
+    delete iOutgoingLoginName;
+    delete iOutgoingPassword;
+    delete iOutgoingServerName;
+    delete iOutgoingConnectionMethod;
+    delete iOwnEmailAddress;
+    delete iOwnEmailAlias;
+    delete iReceiptAddress;
+    delete iReplyToAddress;
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorMailboxes* CCreatorMailboxes::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorMailboxes* self = CCreatorMailboxes::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorMailboxes* CCreatorMailboxes::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorMailboxes* self = new (ELeave) CCreatorMailboxes;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorMailboxes::CCreatorMailboxes()
+    {    
+    }
+
+void CCreatorMailboxes::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::ConstructL");
+
+    iEngine = aEngine;
+    }
+
+CCreatorMailboxes::~CCreatorMailboxes()
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::~CCreatorMailboxes");
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidMailbox ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    if (iParameters)
+        delete iParameters;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorMailboxes::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::AskDataFromUserL");
+    if ( aCommand == ECmdDeleteMailboxes )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all mailboxes?") );
+        }
+    else if ( aCommand ==  ECmdDeleteCreatorMailboxes )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all mailboxes created with Creator?") );
+        }
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"));
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMailboxes::CreateMailboxEntryL(CMailboxesParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::CreateMailboxEntryL");
+
+      // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CMailboxesParameters* parameters = aParameters;
+    
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CMailboxesParameters;
+        parameters = iParameters;
+
+        TPtrC company(iEngine->RandomString(CCreatorEngine::ECompany));
+        TPtrC firstName(iEngine->RandomString(CCreatorEngine::EFirstName));
+        
+        delete parameters->iMailboxName;
+        parameters->iMailboxName = 0;
+        parameters->iMailboxName = HBufC::NewL(KMailboxesFieldLength);
+        parameters->iMailboxName->Des() = KCreatorMailboxesPrefixName;
+        parameters->iMailboxName->Des().Append( company );
+        parameters->iMailboxName->Des().Append(_L(" #"));
+        parameters->iMailboxName->Des().AppendNum(iEngine->RandomNumber(1, 100));
+        
+        delete parameters->iIncomingLoginName;
+        parameters->iIncomingLoginName = 0;
+        parameters->iIncomingLoginName = HBufC::NewL(KMailboxesFieldLength); 
+        delete parameters->iOutgoingLoginName;
+        parameters->iOutgoingLoginName = 0;
+        parameters->iOutgoingLoginName = HBufC::NewL(KMailboxesFieldLength); 
+        parameters->iIncomingLoginName->Des() = iEngine->RandomString(CCreatorEngine::EFirstName);
+        parameters->iIncomingLoginName->Des().LowerCase();
+        parameters->iOutgoingLoginName->Des().Copy(parameters->iIncomingLoginName->Des());
+        
+        delete parameters->iIncomingPassword;
+        parameters->iIncomingPassword = 0;
+        parameters->iIncomingPassword = HBufC::NewL(KMailboxesFieldLength); 
+        delete parameters->iOutgoingPassword;
+        parameters->iOutgoingPassword = 0;
+        parameters->iOutgoingPassword = HBufC::NewL(KMailboxesFieldLength); 
+        parameters->iIncomingPassword->Des() = iEngine->RandomString(CCreatorEngine::ESurname);
+        parameters->iIncomingPassword->Des().LowerCase();
+        parameters->iOutgoingPassword->Des().Copy(parameters->iIncomingPassword->Des());
+        
+        delete parameters->iIncomingServerName;
+        parameters->iIncomingServerName = 0;
+        parameters->iIncomingServerName = HBufC::NewL(KMailboxesFieldLength); 
+        parameters->iIncomingServerName->Des() = _L("incoming.");
+        parameters->iIncomingServerName->Des().Append(company);
+        parameters->iIncomingServerName->Des().Append(_L(".com"));
+        parameters->iIncomingServerName->Des().LowerCase();
+                
+        delete parameters->iIncomingConnectionMethod;
+        parameters->iIncomingConnectionMethod = 0;
+        parameters->iIncomingConnectionMethod = HBufC::NewL(KInternet().Length());
+        parameters->iIncomingConnectionMethod->Des() = KInternet;  // use always this one, if it's not found, default will be used instead
+        
+        delete parameters->iOutgoingServerName;
+        parameters->iOutgoingServerName = 0;
+        parameters->iOutgoingServerName = HBufC::NewL(KMailboxesFieldLength); 
+        parameters->iOutgoingServerName->Des() = _L("smtp.");
+        parameters->iOutgoingServerName->Des().Append(company);
+        parameters->iOutgoingServerName->Des().Append(_L(".com"));
+        parameters->iOutgoingServerName->Des().LowerCase();
+        
+        delete parameters->iOutgoingConnectionMethod;
+        parameters->iOutgoingConnectionMethod = 0;
+        parameters->iOutgoingConnectionMethod = HBufC::NewL(KInternet().Length());
+        parameters->iOutgoingConnectionMethod->Des() = KInternet;  // use always this one, if it's not found, default will be used instead
+
+        delete parameters->iOwnEmailAddress;
+        parameters->iOwnEmailAddress = 0;
+        parameters->iOwnEmailAddress = iEngine->CreateEmailAddressLC();
+        parameters->iOwnEmailAddress->Des().LowerCase();
+        CleanupStack::Pop(); // parameters->iOwnEmailAddress
+        
+        delete parameters->iOwnEmailAlias;
+        parameters->iOwnEmailAlias = 0;
+        parameters->iOwnEmailAlias = HBufC::NewL(firstName.Length());        
+        parameters->iOwnEmailAlias->Des().Copy(firstName);       
+
+        delete parameters->iReceiptAddress;
+        parameters->iReceiptAddress = 0;
+        parameters->iReceiptAddress = iEngine->CreateEmailAddressLC();
+        parameters->iReceiptAddress->Des().LowerCase();
+        CleanupStack::Pop(); // parameters->iReceiptAddress
+        
+        delete parameters->iReplyToAddress;
+        parameters->iReplyToAddress = 0;
+        parameters->iReplyToAddress = iEngine->CreateEmailAddressLC();
+        parameters->iReplyToAddress->Des().LowerCase();
+        CleanupStack::Pop(); // parameters->iReplyToAddress
+        
+        parameters->iIncomingSSLWrapper = iEngine->RandomNumber(0, 1);
+        parameters->iIncomingSecureSockets = iEngine->RandomNumber(0, 1);        
+        parameters->iAcknowledgeReceipts = iEngine->RandomNumber(0, 1);
+        parameters->iAutoSendOnConnect = iEngine->RandomNumber(0, 1);
+        parameters->iDeleteEmailsAtDisconnect = iEngine->RandomNumber(0, 1);
+        parameters->iImapIdleCommand = iEngine->RandomNumber(0, 1);
+        parameters->iMarkSeenInSync = iEngine->RandomNumber(0, 1);
+        parameters->iEnableExpungeMode = iEngine->RandomNumber(0, 1);
+        parameters->iUseApop = iEngine->RandomNumber(0, 1);
+        parameters->iDisconnectedUserMode = iEngine->RandomNumber(0, 1);                
+        parameters->iOutgoingSSLWrapper = iEngine->RandomNumber(0, 1);
+        parameters->iOutgoingSecureSockets = iEngine->RandomNumber(0, 1);
+        parameters->iIncludeSignature = EFalse;
+        parameters->iAddVCard = EFalse;
+        parameters->iRequestReceipts = iEngine->RandomNumber(0, 1);
+        parameters->iSmtpAuth = iEngine->RandomNumber(0, 1);
+        
+        parameters->iIncomingPort = iEngine->RandomNumber(25, 500);
+        parameters->iAttachmentSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
+        parameters->iBodyTextSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
+        parameters->iAttachmentFetchSize = iEngine->RandomNumber(1, 40960);
+        parameters->iImapIdleTimeout = iEngine->RandomNumber(10, 2000);
+        parameters->iMaxEmailSize = iEngine->RandomNumber(1024, KMaxTInt);
+        parameters->iSyncRate = iEngine->RandomNumber(10, 500);        
+        parameters->iInboxSyncLimit = iEngine->RandomNumber(-1, 256);
+        parameters->iMailboxSyncLimit = iEngine->RandomNumber(-1, 256);
+        parameters->iOutgoingPort = KDefaultSmtpPort;
+        parameters->iToCCIncludeLimit = iEngine->RandomNumber(0, 30);                      
+        
+        parameters->iGetEmailOptions = (CMailboxesParameters::TGetEmailOption) iEngine->RandomNumber(CMailboxesParameters::EUndef, CMailboxesParameters::EGetEmailOptionLast-1);
+        parameters->iSubscribeType = (TFolderSubscribeType) iEngine->RandomNumber(EUpdateNeither, EUpdateBoth);
+        parameters->iSyncType = (TFolderSyncType) iEngine->RandomNumber(EUseCombination, EUseRemote);
+        parameters->iSendCopyToSelf = (TImSMTPSendCopyToSelf) iEngine->RandomNumber(ESendNoCopy, ESendCopyAsBccRecipient);
+        parameters->iSendOption = (TImSMTPSendMessageOption) iEngine->RandomNumber(ESendMessageImmediately, ESendMessageOnRequest);
+        parameters->iMailboxType = (TMailboxType) iEngine->RandomNumber(EMailboxPOP3, EMailboxIMAP4);
+        }
+   
+    TInt err = KErrNone;
+    
+    // make sure we have some IMEI stored
+    if (iIMEI.Length() == 0)
+        {
+        TRAP(err, GetIMEIFromThePhoneL());
+        }
+
+    // init 
+    CImImap4Settings* imap4Set = new(ELeave) CImImap4Settings;
+    CleanupStack::PushL(imap4Set);
+    CImPop3Settings* pop3Set = new(ELeave) CImPop3Settings;
+    CleanupStack::PushL(pop3Set);
+    CImSmtpSettings* smtpSet = new(ELeave) CImSmtpSettings;
+    CleanupStack::PushL(smtpSet);
+    CImIAPPreferences* outgoingIAPSet = CImIAPPreferences::NewLC();
+    CImIAPPreferences* incomingIAPSet = CImIAPPreferences::NewLC();
+    CEmailAccounts* account = CEmailAccounts::NewLC();
+  
+    // Get SMTP settings:
+    PopulateSmtpSettingsL(*account, *smtpSet, *outgoingIAPSet, *parameters);
+  
+    // appending mailbox type to array to be able to use
+    // correct type when deleting mailboxes
+    iEntryIds.Append( parameters->iMailboxType );
+    
+    if (parameters->iMailboxType == EMailboxIMAP4)
+        {
+        // Get IMAP settings:
+        PopulateImapSettingsL(*account, *imap4Set, *incomingIAPSet, *parameters);
+        TImapAccount imapAccountId = account->CreateImapAccountL(parameters->iMailboxName->Des(), *imap4Set, *incomingIAPSet, EFalse);
+        TSmtpAccount smtpAccountId = account->CreateSmtpAccountL(imapAccountId, *smtpSet, *outgoingIAPSet, EFalse);
+        account->SetDefaultSmtpAccountL(smtpAccountId);
+
+        iEntryIds.Append( imapAccountId.iImapAccountId );
+        iEntryIds.Append( imapAccountId.iImapService );
+        iEntryIds.Append( imapAccountId.iSmtpService );      
+        iEntryIds.Append( smtpAccountId.iSmtpAccountId );
+        iEntryIds.Append( smtpAccountId.iSmtpService );
+        iEntryIds.Append( smtpAccountId.iRelatedService );
+        
+        StoreIMEIToEntryL( imapAccountId.iImapService );
+        StoreIMEIToEntryL( smtpAccountId.iSmtpService );
+        }
+    else
+        {
+        // Get POP settings:
+        PopulatePopSettingsL(*account, *pop3Set, *incomingIAPSet, *parameters);
+        TPopAccount popAccountId = account->CreatePopAccountL(parameters->iMailboxName->Des(), *pop3Set, *incomingIAPSet, EFalse);
+        TSmtpAccount smtpAccountId = account->CreateSmtpAccountL(popAccountId, *smtpSet, *outgoingIAPSet, EFalse);     
+        account->SetDefaultSmtpAccountL(smtpAccountId);
+        
+        iEntryIds.Append( popAccountId.iPopAccountId );
+        iEntryIds.Append( popAccountId.iPopService );
+        iEntryIds.Append( popAccountId.iSmtpService );
+        iEntryIds.Append( smtpAccountId.iSmtpAccountId );
+        iEntryIds.Append( smtpAccountId.iSmtpService );
+        iEntryIds.Append( smtpAccountId.iRelatedService );
+
+        StoreIMEIToEntryL( popAccountId.iPopService );
+        StoreIMEIToEntryL( smtpAccountId.iSmtpService );
+        }  
+    CleanupStack::PopAndDestroy(6); //imap4Set, pop3Set, smtpSet, outgoingIAPSet, incomingIAPSet, account 
+        
+    return err;
+    }
+
+void CCreatorMailboxes::PopulateImapSettingsL( 
+            CEmailAccounts& aEmailAccount, 
+            CImImap4Settings& aImapSettings, 
+            CImIAPPreferences& aIApSettings, 
+            const CMailboxesParameters& aParameters )
+    {
+    // Get default settings first:
+    aEmailAccount.PopulateDefaultImapSettingsL(aImapSettings, aIApSettings);
+    
+    TImIAPChoice iapChoice;
+    iapChoice.iIAP = 0;
+    if( aParameters.iIncomingConnectionMethod == 0 || 
+        aParameters.iIncomingConnectionMethod->Des().Length() == 0 )
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
+        }
+    else
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iIncomingConnectionMethod->Des()));
+        }
+    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
+    aIApSettings.AddIAPL(iapChoice);
+    
+    TBuf8<256> buf8;
+    if( aParameters.iIncomingLoginName && aParameters.iIncomingLoginName->Length() > 0 )                
+        buf8.Copy(aParameters.iIncomingLoginName->Des());
+    else
+        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
+    aImapSettings.SetLoginNameL(buf8);  //8
+    
+    if( aParameters.iIncomingPassword && aParameters.iIncomingPassword->Length() > 0 )
+        buf8.Copy(aParameters.iIncomingPassword->Des());    
+    else
+        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
+    aImapSettings.SetPasswordL(buf8);  //8
+    
+    if( aParameters.iIncomingFolderPath && aParameters.iIncomingFolderPath->Length() > 0 )
+        {
+        buf8.Copy(aParameters.iIncomingFolderPath->Des());
+        aImapSettings.SetFolderPathL(buf8);
+        }
+    
+    if( aParameters.iPathSeparator && aParameters.iPathSeparator->Length() > 0 )
+        aImapSettings.SetPathSeparator(aParameters.iIncomingFolderPath->Des()[0]);
+    
+    aImapSettings.SetDisconnectedUserMode(aParameters.iDisconnectedUserMode);
+    aImapSettings.SetSynchronise(aParameters.iSyncType);
+    aImapSettings.SetSubscribe(aParameters.iSubscribeType);
+    aImapSettings.SetAutoSendOnConnect(aParameters.iAutoSendOnConnect);
+    
+    if(aParameters.iMaxEmailSize != KUndef )
+        aImapSettings.SetMaxEmailSize(aParameters.iMaxEmailSize);
+    
+    aImapSettings.SetDeleteEmailsWhenDisconnecting(aParameters.iDeleteEmailsAtDisconnect);
+    aImapSettings.SetAcknowledgeReceipts(aParameters.iAcknowledgeReceipts);
+            
+    if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyText )
+        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyText);
+    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyTextAndAttachments )
+        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetAttachments )
+        aImapSettings.SetGetMailOptions(EGetImap4EmailAttachments);
+    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyAlternativeText )
+        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyAlternativeText);
+    else
+        aImapSettings.SetGetMailOptions(EGetImap4EmailHeaders); // Default
+    
+    if( aParameters.iInboxSyncLimit != KUndef )
+        aImapSettings.SetInboxSynchronisationLimit(aParameters.iInboxSyncLimit);
+    
+    if( aParameters.iMailboxSyncLimit != KUndef )
+        aImapSettings.SetMailboxSynchronisationLimit(aParameters.iMailboxSyncLimit);
+    
+    aImapSettings.SetUpdatingSeenFlags(aParameters.iMarkSeenInSync);
+    
+    if( aParameters.iSyncRate != KUndef )
+        aImapSettings.SetSyncRateL(aParameters.iSyncRate);
+    
+    if( aParameters.iAttachmentFetchSize != KUndef )
+        aImapSettings.SetFetchSizeL(aParameters.iAttachmentFetchSize);
+    
+    aImapSettings.SetImapIdle(aParameters.iImapIdleCommand);
+    if( aParameters.iImapIdleTimeout != KUndef )
+        aImapSettings.SetImapIdleTimeoutL(aParameters.iImapIdleTimeout);
+    
+    if( aParameters.iBodyTextSizeLimit != KUndef )
+        aImapSettings.SetBodyTextSizeLimitL(aParameters.iBodyTextSizeLimit);
+    
+    if( aParameters.iAttachmentSizeLimit != KUndef )
+        aImapSettings.SetAttachmentSizeLimitL(aParameters.iAttachmentSizeLimit);
+    
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+    aImapSettings.SetUseExpunge(aParameters.iEnableExpungeMode);
+#endif
+    
+    if(aParameters.iIncomingServerName && aParameters.iIncomingServerName->Length() > 0 )
+        aImapSettings.SetServerAddressL(aParameters.iIncomingServerName->Des());
+    else
+        aImapSettings.SetServerAddressL(KDefaultIncomingServer);
+        
+    if( aParameters.iIncomingPort != KUndef )
+        aImapSettings.SetPort(aParameters.iIncomingPort);                 
+      
+    aImapSettings.SetSecureSockets(aParameters.iIncomingSecureSockets);
+    aImapSettings.SetSSLWrapper(aParameters.iIncomingSSLWrapper);
+    }
+
+void CCreatorMailboxes::PopulatePopSettingsL( 
+            CEmailAccounts& aEmailAccount, 
+            CImPop3Settings& aPopSettings, 
+            CImIAPPreferences& aIApSettings, 
+            const CMailboxesParameters& aParameters )
+    {
+    aEmailAccount.PopulateDefaultPopSettingsL(aPopSettings, aIApSettings);
+    
+    TImIAPChoice iapChoice;
+    iapChoice.iIAP = 0;
+    if( aParameters.iIncomingConnectionMethod == 0 || 
+        aParameters.iIncomingConnectionMethod->Des().Length() == 0 )
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
+        }
+    else
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iIncomingConnectionMethod->Des() ));
+        }
+    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
+    aIApSettings.AddIAPL(iapChoice);
+    
+    TBuf8<256> buf8;
+    if( aParameters.iIncomingLoginName && aParameters.iIncomingLoginName->Length() > 0 )                
+        buf8.Copy(aParameters.iIncomingLoginName->Des());
+    else
+        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
+    aPopSettings.SetLoginNameL(buf8);  //8
+        
+    if( aParameters.iIncomingPassword && aParameters.iIncomingPassword->Length() > 0 )
+        buf8.Copy(aParameters.iIncomingPassword->Des());    
+    else
+        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
+    aPopSettings.SetPasswordL(buf8);  //8
+    
+    aPopSettings.SetAutoSendOnConnect( aParameters.iAutoSendOnConnect );
+    aPopSettings.SetApop( aParameters.iUseApop );
+    aPopSettings.SetDisconnectedUserMode( aParameters.iDisconnectedUserMode );
+    aPopSettings.SetDeleteEmailsWhenDisconnecting( aParameters.iDeleteEmailsAtDisconnect );
+    aPopSettings.SetAcknowledgeReceipts( aParameters.iAcknowledgeReceipts );
+    
+    if( aParameters.iMaxEmailSize != KUndef )
+        aPopSettings.SetMaxEmailSize(aParameters.iMaxEmailSize);
+    
+    if(aParameters.iGetEmailOptions != CMailboxesParameters::EGetHeaders && 
+            aParameters.iGetEmailOptions != CMailboxesParameters::EUndef )
+        {
+        aPopSettings.SetGetMailOptions(EGetPop3EmailMessages);
+        aPopSettings.SetPopulationLimitL( -1 ); // -1 = body and attachment
+        }
+    else
+        {
+        aPopSettings.SetGetMailOptions(EGetPop3EmailHeaders); // Default
+        aPopSettings.SetPopulationLimitL( -2 ); // -2 = headers only
+        }
+    
+    if( aParameters.iInboxSyncLimit != KUndef )
+        {
+        aPopSettings.SetInboxSynchronisationLimit(aParameters.iInboxSyncLimit);
+        }
+    
+    if(aParameters.iIncomingServerName && aParameters.iIncomingServerName->Length() > 0 )
+        aPopSettings.SetServerAddressL(aParameters.iIncomingServerName->Des());
+    else
+        aPopSettings.SetServerAddressL(KDefaultIncomingServer);
+            
+    if( aParameters.iIncomingPort != KUndef )
+        aPopSettings.SetPort(aParameters.iIncomingPort);                 
+          
+    aPopSettings.SetSecureSockets(aParameters.iIncomingSecureSockets);
+    aPopSettings.SetSSLWrapper(aParameters.iIncomingSSLWrapper);    
+    }
+
+void CCreatorMailboxes::PopulateSmtpSettingsL( 
+        CEmailAccounts& aEmailAccount, 
+        CImSmtpSettings& aSmtpSettings, 
+        CImIAPPreferences& aIApSettings, 
+        const CMailboxesParameters& aParameters )
+    {    
+    // Get default settings first: 
+    aEmailAccount.PopulateDefaultSmtpSettingsL(aSmtpSettings, aIApSettings);
+    TImIAPChoice iapChoice;
+    iapChoice.iIAP = 0;
+    if( aParameters.iOutgoingConnectionMethod == 0 || 
+        aParameters.iOutgoingConnectionMethod->Des().Length() == 0 )
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
+        }
+    else
+        {
+        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iOutgoingConnectionMethod->Des() ));
+        }
+    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
+    aIApSettings.AddIAPL(iapChoice);
+    
+    // set SMTP preferences
+    if( aParameters.iOwnEmailAlias && aParameters.iOwnEmailAlias->Length() > 0 )
+        aSmtpSettings.SetEmailAliasL(aParameters.iOwnEmailAlias->Des());
+    
+    if( aParameters.iOwnEmailAddress && aParameters.iOwnEmailAddress->Length() > 0 )    
+        aSmtpSettings.SetEmailAddressL(aParameters.iOwnEmailAddress->Des());
+    
+    if( aParameters.iReplyToAddress && aParameters.iReplyToAddress->Length() > 0 )
+        aSmtpSettings.SetReplyToAddressL(aParameters.iReplyToAddress->Des());
+    
+    if( aParameters.iReceiptAddress && aParameters.iReceiptAddress->Length() > 0 )
+        aSmtpSettings.SetReceiptAddressL(aParameters.iReceiptAddress->Des());    
+    
+    aSmtpSettings.SetBodyEncoding(EMsgOutboxMIME);
+    aSmtpSettings.SetAddVCardToEmail(aParameters.iAddVCard);
+    aSmtpSettings.SetAddSignatureToEmail(aParameters.iIncludeSignature);
+    aSmtpSettings.SetRequestReceipts(aParameters.iRequestReceipts);
+    aSmtpSettings.SetSendCopyToSelf(aParameters.iSendCopyToSelf);    
+    aSmtpSettings.SetSendMessageOption(aParameters.iSendOption);        
+            
+    TBuf8<256> buf8;
+    if( aParameters.iOutgoingLoginName && aParameters.iOutgoingLoginName->Length() > 0 )
+        {
+        buf8.Copy(aParameters.iOutgoingLoginName->Des());
+        aSmtpSettings.SetLoginNameL(buf8);  //8
+        }
+    
+    if( aParameters.iOutgoingPassword && aParameters.iOutgoingPassword->Length() > 0)
+        {
+        buf8.Copy(aParameters.iOutgoingPassword->Des());
+        aSmtpSettings.SetPasswordL(buf8);  //8
+        }
+    
+    aSmtpSettings.SetSMTPAuth(aParameters.iSmtpAuth);
+    if( aParameters.iToCCIncludeLimit != KUndef )
+         aSmtpSettings.SetToCcIncludeLimitL(aParameters.iToCCIncludeLimit);
+    
+    if( aParameters.iOutgoingServerName && aParameters.iOutgoingServerName->Length() > 0 )
+        aSmtpSettings.SetServerAddressL(aParameters.iOutgoingServerName->Des());
+    else
+        aSmtpSettings.SetServerAddressL(KDefaultOutgoingServer);
+    
+    if( aParameters.iOutgoingPort != KUndef )
+        aSmtpSettings.SetPort(aParameters.iOutgoingPort);
+                
+    aSmtpSettings.SetSecureSockets(aParameters.iOutgoingSecureSockets);
+    aSmtpSettings.SetSSLWrapper(aParameters.iOutgoingSSLWrapper);
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorMailboxes::StoreIMEIToEntryL(const TMsvId aMailboxId)
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::StoreIMEIToEntryL");
+
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    
+    CMsvEntry* centry = session->GetEntryL(aMailboxId);
+    CleanupStack::PushL(centry);
+
+    TMsvEntry tentry = centry->Entry();
+    tentry.iDescription.Set(iIMEI);
+    centry->ChangeL(tentry);
+
+    CleanupStack::PopAndDestroy(2); // centry, session
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorMailboxes::GetIMEIFromThePhoneL()
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::GetIMEIFromThePhoneL");
+
+#ifndef __WINS__
+
+    RTelServer telServer;
+    User::LeaveIfError( telServer.Connect() );
+    CleanupClosePushL(telServer);
+
+    TInt numPhones = 0;
+    User::LeaveIfError( telServer.EnumeratePhones( numPhones ) );
+    if ( numPhones < 1 )
+        {
+        User::Leave( KErrNotFound );
+        }
+    RTelServer::TPhoneInfo info;
+    User::LeaveIfError( telServer.GetPhoneInfo( 0, info ) );
+    RMobilePhone mobilePhone;
+    User::LeaveIfError( mobilePhone.Open( telServer, info.iName ) );
+    CleanupClosePushL( mobilePhone );
+
+    //mobilePhone.Initialise();
+    TUint32 identityCaps;
+    User::LeaveIfError( mobilePhone.GetIdentityCaps( identityCaps ) );
+
+    if ( identityCaps & RMobilePhone::KCapsGetSerialNumber )
+        {
+        TRequestStatus status;
+        RMobilePhone::TMobilePhoneIdentityV1 mobilePhoneIdentity;
+
+        mobilePhone.GetPhoneId( status, mobilePhoneIdentity );
+
+        User::WaitForRequest( status );
+        User::LeaveIfError( status.Int() );
+
+        iIMEI.Copy( mobilePhoneIdentity.iSerialNumber );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CleanupStack::PopAndDestroy( &mobilePhone );
+    CleanupStack::PopAndDestroy( &telServer );
+
+#else
+
+    // use fixed IMEI for emulator
+    _LIT( KIMAEmulatorImei, "123456789012345" );
+    iIMEI.Copy( KIMAEmulatorImei );
+
+#endif // __WINS__
+
+    }
+    
+//----------------------------------------------------------------------------
+
+void CCreatorMailboxes::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
+    {
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMailboxes::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::DeleteAllL");
+    
+    CEmailAccounts* accountMgr = CEmailAccounts::NewLC();
+    
+    // Delete pop accounts
+    RArray<TPopAccount> popAccountsToDelete;
+    CleanupClosePushL( popAccountsToDelete );
+    accountMgr->GetPopAccountsL( popAccountsToDelete );
+    for ( TInt i = 0; i < popAccountsToDelete.Count(); i++ )
+        {
+        accountMgr->DeletePopAccountL( popAccountsToDelete[i] );
+        }
+    CleanupStack::PopAndDestroy( &popAccountsToDelete );
+    
+    // Delete imap accounts
+    RArray<TImapAccount> imapAccountsToDelete;
+    CleanupClosePushL( imapAccountsToDelete );
+    accountMgr->GetImapAccountsL( imapAccountsToDelete );
+    for ( TInt i = 0; i < imapAccountsToDelete.Count(); i++ )
+        {
+        accountMgr->DeleteImapAccountL( imapAccountsToDelete[i] );
+        }
+    CleanupStack::PopAndDestroy( &imapAccountsToDelete );
+    
+    // Delete smtp accounts
+    RArray<TSmtpAccount> smtpAccountsToDelete;
+    CleanupClosePushL( smtpAccountsToDelete );
+    accountMgr->GetSmtpAccountsL( smtpAccountsToDelete );
+    for ( TInt i = 0; i < smtpAccountsToDelete.Count(); i++ )
+        {
+        accountMgr->DeleteSmtpAccountL( smtpAccountsToDelete[i] );
+        }
+    CleanupStack::PopAndDestroy( &smtpAccountsToDelete );
+
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Mailbox related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidMailbox );
+    
+    CleanupStack::PopAndDestroy( accountMgr ); 
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMailboxes::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorMailboxes::DeleteAllCreatedByCreatorL");
+    
+    iEntryIds.Reset();
+    CEmailAccounts* accountMgr = CEmailAccounts::NewLC();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidMailbox );
+    
+    TInt i(0);
+    while ( i < iEntryIds.Count() && iEntryIds.Count() > 6 ) 
+        {
+        // there should be at least 7 items in the array:
+        // one for mailbox type
+        // 3 for imap OR pop ids
+        // 3 for smtp ids
+
+        // delete entries
+        
+        TInt type = iEntryIds[i++]; // TMailboxType
+        if ( type == EMailboxPOP3 )
+            {
+            TPopAccount popAccount;
+            popAccount.iPopAccountId = iEntryIds[i++];
+            popAccount.iPopService = iEntryIds[i++];            
+            popAccount.iSmtpService = iEntryIds[i++];
+            TRAP_IGNORE( accountMgr->DeletePopAccountL( popAccount ) );            
+            }
+        else if ( type == EMailboxIMAP4 )
+            {
+            TImapAccount imapAccount;
+            imapAccount.iImapAccountId = iEntryIds[i++];
+            imapAccount.iImapService = iEntryIds[i++];
+            imapAccount.iImapService = iEntryIds[i++];
+            TRAP_IGNORE( accountMgr->DeleteImapAccountL( imapAccount ) );
+            }
+        else 
+            {
+            // ignore unknown mailbox types
+            i +=3;
+            }
+        
+        // There should be one smtp service for each pop and imap service
+        TSmtpAccount smtpAccount;
+        smtpAccount.iSmtpAccountId = iEntryIds[i++];
+        smtpAccount.iSmtpService = iEntryIds[i++];
+        smtpAccount.iRelatedService = iEntryIds[i++];
+        TRAP_IGNORE( accountMgr->DeleteSmtpAccountL( smtpAccount ) );
+        }
+
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the mailbox related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidMailbox );
+
+    CleanupStack::PopAndDestroy( accountMgr ); 
+    }
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_mailboxelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,496 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_mailboxelement.h"
+#include "creator_traces.h"
+#include "creator_mailbox.h"
+
+using namespace creatormailbox;
+
+/*
+ * 
+ */
+CCreatorMailboxElement* CCreatorMailboxElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorMailboxElement* self = new (ELeave) CCreatorMailboxElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorMailboxElement::CCreatorMailboxElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+
+TBool CCreatorMailboxElement::SetIntegerParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
+    {    
+    _LIT( KAll, "all");
+    
+    if( aElemName == Kincomingport )
+        {
+        if( aSetRandom )
+            param->iIncomingPort = iEngine->RandomNumber(25, 500);
+        else        
+            param->iIncomingPort = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Kattachmentsizelimit )
+        {
+        if( aSetRandom )
+            param->iAttachmentSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
+        else
+            param->iAttachmentSizeLimit = ConvertStrToIntL(aElemContent);
+        }        
+    else if( aElemName == Kbodytextsizelimit )
+        {
+        if( aSetRandom )
+            param->iBodyTextSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
+        else
+            param->iBodyTextSizeLimit = ConvertStrToIntL(aElemContent);
+        }     
+    else if( aElemName == Kattachmentfetchsize )
+        {
+        if( aSetRandom )
+            param->iAttachmentFetchSize = iEngine->RandomNumber(1, 40960);
+        else            
+            param->iAttachmentFetchSize = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Kimapidletimeout )
+        {
+        if( aSetRandom )
+            param->iImapIdleTimeout = iEngine->RandomNumber(10, 2000);
+        else
+            param->iImapIdleTimeout = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Kmaxemailsize )
+        {
+        if( aSetRandom )
+            param->iMaxEmailSize =  iEngine->RandomNumber(1024, KMaxTInt);
+        else
+            param->iMaxEmailSize = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Ksyncrate )
+        {
+        if( aSetRandom )
+            param->iSyncRate = iEngine->RandomNumber(10, 500);
+        else
+            param->iSyncRate = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Kinboxsynclimit )
+        {
+        if( aSetRandom )
+            param->iInboxSyncLimit = iEngine->RandomNumber(-1, 256);
+        else if( CompareIgnoreCase(aElemContent, KAll) == 0 )
+            param->iInboxSyncLimit = -1;
+        else
+            param->iInboxSyncLimit = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Kmailboxsynclimit )
+        {
+        if( aSetRandom )
+            param->iMailboxSyncLimit = iEngine->RandomNumber(-1, 256);
+        else if( CompareIgnoreCase(aElemContent, KAll) == 0 )
+            param->iMailboxSyncLimit = -1;
+        else
+            param->iMailboxSyncLimit = ConvertStrToIntL(aElemContent);
+        }        
+    else if( aElemName == Koutgoingport )
+        {
+        if( aSetRandom )
+            param->iOutgoingPort = KDefaultSmtpPort;
+        else
+            param->iOutgoingPort = ConvertStrToIntL(aElemContent);
+        }
+    else if( aElemName == Ktoccincludelimit )
+        {
+        if( aSetRandom )
+            param->iToCCIncludeLimit = iEngine->RandomNumber(0, 30);
+        else
+            param->iToCCIncludeLimit = ConvertStrToIntL(aElemContent);
+        }
+    else
+        return EFalse;
+    
+    return ETrue;
+    }
+
+TBool CCreatorMailboxElement::GetBooleanValueL(const TDesC& aElemContent, TBool aSetRandom)
+    {
+    if( aSetRandom )
+        return iEngine->RandomNumber(0,1) == 1;
+    
+    return ConvertStrToBooleanL(aElemContent);
+    }
+
+TBool CCreatorMailboxElement::SetBooleanParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
+    {  
+    TBool val = GetBooleanValueL(aElemContent, aSetRandom);
+    if( aElemName == Kincomingsslwrapper )
+        param->iIncomingSSLWrapper = val;
+    else if( aElemName == Kincomingsecuresockets )
+        param->iIncomingSecureSockets = val;
+    else if( aElemName == Kacknowledgereceipts )
+        param->iAcknowledgeReceipts = val;
+    else if( aElemName == Kautosendonconnect )
+        param->iAutoSendOnConnect = val;
+    else if( aElemName == Kdeletemailsatdisconnect )
+        param->iDeleteEmailsAtDisconnect = val;
+    else if( aElemName == Kimapidlecommand )
+        param->iImapIdleCommand = val;
+    else if( aElemName == Kmarkseeninsync )
+        param->iMarkSeenInSync = val;
+    else if( aElemName == Kenableexpungemode )
+        param->iEnableExpungeMode = val;
+    else if( aElemName == Kuseapopsecurelogin )
+        param->iUseApop = val;
+    else if( aElemName == Kdisconnectedusermode )
+        param->iDisconnectedUserMode = val;
+    else if( aElemName == Koutgoingsslwrapper )
+        param->iOutgoingSSLWrapper = val;
+    else if( aElemName == Koutgoingsecuresockets )
+        param->iOutgoingSecureSockets = val;
+    else if( aElemName == Kincludesignature )
+        param->iIncludeSignature = val;
+    else if( aElemName == Kaddvcard )
+        param->iAddVCard = val;
+    else if( aElemName == Krequestreceipts )
+        param->iRequestReceipts = val;
+    else if( aElemName == Ksmtpauth )
+        param->iSmtpAuth = val;
+    else
+        return EFalse;
+
+    return ETrue;
+    }
+
+TBool CCreatorMailboxElement::SetTextParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
+    {   
+    _LIT(KIncomingSrvPrefix, "mail.");
+    _LIT(KOutgoingSrvPrefix, "smtp.");
+    _LIT(KSrvPostfix, ".com");
+    _LIT(KDefaultConnMethod, "internet");
+    
+    if( aElemName == Kname )
+        {
+        if( aSetRandom )
+            {
+            TPtrC company(iEngine->RandomString(CCreatorEngine::ECompany));
+            SetContentToTextParamL(param->iMailboxName, company);
+            }
+        else
+            SetContentToTextParamL(param->iMailboxName, aElemContent);
+        }
+    else if( aElemName == Kincomingloginname )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
+            SetContentToTextParamL(param->iIncomingLoginName, random);
+            param->iIncomingLoginName->Des().LowerCase();
+            }
+        else
+            SetContentToTextParamL(param->iIncomingLoginName, aElemContent);
+        }
+    else if( aElemName == Kincomingpassword )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
+            SetContentToTextParamL(param->iIncomingPassword, random);
+            param->iIncomingPassword->Des().LowerCase();
+            }
+        else
+            SetContentToTextParamL(param->iIncomingPassword, aElemContent);
+        }
+    else if( aElemName == Kincomingservername )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::ECompany));
+            HBufC* srvName = HBufC::NewLC(KIncomingSrvPrefix().Length()+random.Length()+KSrvPostfix().Length());
+            srvName->Des().Copy(KIncomingSrvPrefix);
+            srvName->Des().Append(random);
+            srvName->Des().Append(KSrvPostfix);
+            SetContentToTextParamL(param->iIncomingServerName, srvName->Des());
+            CleanupStack::PopAndDestroy(); // srvName
+            }
+        else
+            SetContentToTextParamL(param->iIncomingServerName, aElemContent);
+        }
+    else if( aElemName == Kincomingconnectionmethod )
+        {
+        if( aSetRandom )                        
+            SetContentToTextParamL(param->iIncomingConnectionMethod, KDefaultConnMethod);            
+        else
+            SetContentToTextParamL(param->iIncomingConnectionMethod, aElemContent);
+        }
+    else if( aElemName == Kincomingfolderpath )
+        SetContentToTextParamL(param->iIncomingFolderPath, aElemContent);
+    else if( aElemName == Kpathseparator )
+        SetContentToTextParamL(param->iPathSeparator, aElemContent);
+    else if( aElemName == Koutgoingloginname )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
+            SetContentToTextParamL(param->iOutgoingLoginName, random);
+            param->iOutgoingLoginName->Des().LowerCase();
+            }
+        else
+            SetContentToTextParamL(param->iOutgoingLoginName, aElemContent);
+        }
+    else if( aElemName == Koutgoingpassword )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
+            SetContentToTextParamL(param->iOutgoingPassword, random);
+            param->iOutgoingPassword->Des().LowerCase();
+            }
+        else
+            SetContentToTextParamL(param->iOutgoingPassword, aElemContent);
+        }
+    else if( aElemName == Koutgoingservername )
+        {
+        if( aSetRandom )
+            {
+            TPtrC random(iEngine->RandomString(CCreatorEngine::ECompany));
+            HBufC* srvName = HBufC::NewLC(KOutgoingSrvPrefix().Length()+random.Length()+KSrvPostfix().Length());
+            srvName->Des().Copy(KOutgoingSrvPrefix);
+            srvName->Des().Append(random);
+            srvName->Des().Append(KSrvPostfix);
+            SetContentToTextParamL(param->iOutgoingServerName, srvName->Des());
+            CleanupStack::PopAndDestroy(); // srvName
+            }
+        else
+            SetContentToTextParamL(param->iOutgoingServerName, aElemContent);
+        }
+    else if( aElemName == Koutgoingconnectionmethod )
+        {
+        if( aSetRandom )            
+            SetContentToTextParamL(param->iOutgoingConnectionMethod, KDefaultConnMethod);            
+        else
+            SetContentToTextParamL(param->iOutgoingConnectionMethod, aElemContent);
+        }
+    else if( aElemName == Kownemail )
+        {
+        if( aSetRandom )
+            {
+            TDesC* email = iEngine->CreateEmailAddressLC();
+            SetContentToTextParamL(param->iOwnEmailAddress, *email);
+            CleanupStack::PopAndDestroy(); // email
+            }
+        else
+            SetContentToTextParamL(param->iOwnEmailAddress, aElemContent);
+        }
+    else if( aElemName == Kemailalias )
+        {
+        if( aSetRandom )
+            {
+            _LIT(KSpace, " ");
+            TPtrC firstName(iEngine->RandomString(CCreatorEngine::EFirstName));
+            TPtrC lastName(iEngine->RandomString(CCreatorEngine::ESurname));
+            HBufC* alias = HBufC::NewLC(firstName.Length() + lastName.Length() + KSpace().Length());
+            alias->Des().Copy(firstName);
+            alias->Des().Append(KSpace);
+            alias->Des().Append(lastName);
+            SetContentToTextParamL(param->iOwnEmailAlias, alias->Des());
+            CleanupStack::PopAndDestroy(); // alias
+            }
+        else        
+            SetContentToTextParamL(param->iOwnEmailAlias, aElemContent);
+        }
+    else if( aElemName == Kreceiptaddress )
+        {
+        if( aSetRandom )
+            {
+            TDesC* email = iEngine->CreateEmailAddressLC();
+            SetContentToTextParamL(param->iReceiptAddress, *email);
+            CleanupStack::PopAndDestroy(); // email
+            }
+        else
+            SetContentToTextParamL(param->iReceiptAddress, aElemContent);
+        }
+    else if( aElemName == Kreplytoaddress )
+        {
+        if( aSetRandom )
+            {
+            TDesC* email = iEngine->CreateEmailAddressLC();
+            SetContentToTextParamL(param->iReceiptAddress, *email);
+            CleanupStack::PopAndDestroy(); // email
+            }
+        else
+            SetContentToTextParamL(param->iReplyToAddress, aElemContent);
+        }
+    else
+        return EFalse;
+    
+    return ETrue;
+    }
+
+TBool CCreatorMailboxElement::SetEnumParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
+    {
+    // Get email options:
+    if( aElemName == Kgetemailoptions )
+        {
+        if( aSetRandom )
+            param->iGetEmailOptions = (CMailboxesParameters::TGetEmailOption) iEngine->RandomNumber(
+                                                    CMailboxesParameters::EGetHeaders, 
+                                                    CMailboxesParameters::EGetEmailOptionLast-1);
+        else if( CompareIgnoreCase(aElemContent, Kgetheaders ) == 0 )
+            param->iGetEmailOptions = CMailboxesParameters::EGetHeaders;
+        else if( CompareIgnoreCase(aElemContent, Kgetbodytext) == 0 )
+            param->iGetEmailOptions = CMailboxesParameters::EGetBodyText;
+        else if( CompareIgnoreCase(aElemContent, Kgetbodytextandattachments) == 0 )
+            param->iGetEmailOptions = CMailboxesParameters::EGetBodyTextAndAttachments;
+        else if( CompareIgnoreCase(aElemContent, Kgetattachments) == 0 )
+            param->iGetEmailOptions = CMailboxesParameters::EGetAttachments;
+        else if( CompareIgnoreCase(aElemContent, Kgetbodyalternativetext) == 0 )
+            param->iGetEmailOptions = CMailboxesParameters::EGetBodyAlternativeText;
+        else 
+            param->iGetEmailOptions = CMailboxesParameters::EUndef;
+        }
+    
+    // Subscribe type:
+    else if( aElemName == Ksubscribetype )
+        {
+        if( aSetRandom )
+            param->iSubscribeType = (TFolderSubscribeType) iEngine->RandomNumber( EUpdateNeither, EUpdateBoth );
+        else if( CompareIgnoreCase( aElemContent, Kupdatelocal) == 0 )
+            param->iSubscribeType = EUpdateLocal;            
+        else if( CompareIgnoreCase( aElemContent, Kupdateremote) == 0 )
+            param->iSubscribeType = EUpdateRemote;
+        else if( CompareIgnoreCase( aElemContent, Kupdateboth) == 0 )
+            param->iSubscribeType = EUpdateBoth;
+        else
+            param->iSubscribeType = EUpdateNeither;
+        }
+    
+    // Folder synchronization type:
+    else if( aElemName == Kfoldersynctype)
+        {
+        if( aSetRandom )
+            param->iSyncType = (TFolderSyncType) iEngine->RandomNumber(EUseCombination, EUseRemote);
+        else if( CompareIgnoreCase( aElemContent, Kuselocal) == 0 )
+            param->iSyncType = EUseLocal;
+        else if( CompareIgnoreCase( aElemContent, Kuseremote) == 0 )
+            param->iSyncType = EUseRemote;
+        else
+            param->iSyncType = EUseCombination;
+        }
+     
+    // Send copy to self option:
+    else if( aElemName == Kcopytoself )
+        {
+        if( aSetRandom )
+            param->iSendCopyToSelf = (TImSMTPSendCopyToSelf) iEngine->RandomNumber(ESendNoCopy, ESendCopyAsBccRecipient);
+        else if( CompareIgnoreCase( aElemContent, Kto) == 0 )
+            param->iSendCopyToSelf = ESendCopyAsToRecipient;
+        else if( CompareIgnoreCase( aElemContent, Kcc) == 0 )
+            param->iSendCopyToSelf = ESendCopyAsCcRecipient;
+        else if( CompareIgnoreCase( aElemContent, Kbcc) == 0 )
+            param->iSendCopyToSelf = ESendCopyAsBccRecipient;
+        else
+            param->iSendCopyToSelf = ESendNoCopy;
+        }
+    
+    // Send option:
+    else if( aElemName == Ksendoption )
+        {
+        if( aSetRandom )
+            param->iSendOption = (TImSMTPSendMessageOption) iEngine->RandomNumber(ESendMessageImmediately, ESendMessageOnRequest);
+        else if( CompareIgnoreCase( aElemContent, Konnextconnection) == 0 )
+            param->iSendOption = ESendMessageOnNextConnection;
+        else if( CompareIgnoreCase( aElemContent, Konrequest) == 0 )
+            param->iSendOption = ESendMessageOnRequest;
+        else
+            param->iSendOption = ESendMessageImmediately;
+        }
+    else
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+
+void CCreatorMailboxElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    const CCreatorScriptAttribute* typeAttr = FindAttributeByName(KMailboxType);
+    TInt amount = 1;    
+    if( amountAttr )
+        {
+        amount = ConvertStrToIntL(amountAttr->Value());
+        }
+    
+    TMailboxType mailboxType = EMailboxPOP3;
+    
+    if( typeAttr && CompareIgnoreCase(typeAttr->Value(), Kimap4) == 0 )
+        {
+        mailboxType = EMailboxIMAP4;
+        }
+    
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
+        // Create mailbox entries, the amount of entries is defined by amount:
+        for( TInt cI = 0; cI < amount; ++cI )
+            {            
+            CMailboxesParameters* param = new (ELeave) CMailboxesParameters;
+            CleanupStack::PushL(param);
+            
+            param->iMailboxType = mailboxType;
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+                TBool useRandom = EFalse;
+                if( randomAttr || elemContent.Length() == 0 )
+                    {
+                    useRandom = ETrue;
+                    }
+                
+                if( SetTextParamL(elemName, elemContent, param, useRandom ) == EFalse &&
+                    SetBooleanParamL(elemName, elemContent, param, useRandom ) == EFalse &&
+                    SetIntegerParamL(elemName, elemContent, param, useRandom ) == EFalse &&
+                    SetEnumParamL(elemName, elemContent, param, useRandom ) )
+                    {
+                    LOGSTRING2("CCreatorMailboxElement::ExecuteCommandL: Unknown mailbox field: %S", &elemName);
+                    }
+                }
+            iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMailboxes, param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMailboxes, 0, amount);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_message.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1856 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+
+#include "creator_message.h" 
+#include "creator_traces.h"
+#include "creator_contactsetcache.h"
+#include <apgcli.h>
+#include <MuiuServiceUtilities.h>
+
+#include <mmf/common/mmfcontrollerpluginresolver.h> // for CleanupResetAndDestroyPushL
+
+//static const TInt KMessagesFieldLength = 1024;
+
+//_LIT(KCreatorMessagesPrefixName, "CR_");
+//_LIT(KCreatorMessagesPrefixFolderName, "CR_FLDR_");
+
+
+const TUid KUidBIOBusinessCardMsg =  {0x10005531}; 
+_LIT(KEmpty, "");
+
+//----------------------------------------------------------------------------
+
+CMessagesParameters::CMessagesParameters()
+    {
+    LOGSTRING("Creator: CMessagesParameters::CMessagesParameters");
+
+    iSenderAddress = HBufC::New(128);
+    iRecipientAddress = HBufC::New(128);
+    iMessageSubject = HBufC::New(128);
+    iMessageBodyText = HBufC::New(10240);
+    TRAP_IGNORE(iAttachments = new(ELeave) CArrayFixFlat<TInt>(64));
+    iCreateAsUnread = ETrue;
+    }
+
+CMessagesParameters::~CMessagesParameters()
+    {
+    LOGSTRING("Creator: CMessagesParameters::~CMessagesParameters");
+
+
+    delete iMessageBodyText;
+    delete iMessageSubject;
+    delete iRecipientAddress;
+    delete iSenderAddress;
+    delete iAttachments;
+    iAttachmentPaths.ResetAndDestroy();
+    iAttachmentPaths.Close(); 
+    iRecipientAddressArray.ResetAndDestroy();
+    iRecipientAddressArray.Close();
+    iRecipientLinkIds.Close();
+    iSenderLinkIds.Close();
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorMessages* CCreatorMessages::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorMessages* self = CCreatorMessages::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorMessages* CCreatorMessages::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorMessages* self = new (ELeave) CCreatorMessages;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorMessages::CCreatorMessages()
+    {
+    }
+
+void CCreatorMessages::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorMessages::ConstructL");
+    iEngine = aEngine;
+    
+    TRAP_IGNORE(iAttachments = new(ELeave) CArrayFixFlat<TInt>(64));
+    iWaiter = CAsyncWaiter::NewL();
+    }
+
+CCreatorMessages::~CCreatorMessages()
+    {
+    LOGSTRING("Creator: CCreatorMessages::~CCreatorMessages");
+
+    if ( iEngine && iEntryIds.Count() )
+        {
+        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidMessages ) );
+        }
+    iEntryIds.Reset();
+    iEntryIds.Close();
+    
+    delete iParameters;
+    delete iWaiter;
+    delete iTmpPhoneNumber;
+    delete iTmpEmail;
+    delete iAttachments;
+
+    iRecipientArray.ResetAndDestroy();
+    iRecipientArray.Close();
+    iSenderArray.ResetAndDestroy();
+    iSenderArray.Close();
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorMessages::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorMessages::AskDataFromUserL");
+
+    if ( aCommand == ECmdDeleteMessages )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all messages?") );
+        }
+    else if ( aCommand ==  ECmdDeleteCreatorMessages )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all messages created with Creator?") );
+        }
+
+    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?")))
+        {
+        
+        // message type query
+        if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Message type"), R_MESSAGE_TYPE_QUERY, (TInt&) iMessageType))
+            {
+			if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Folder type"), R_FOLDER_TYPE_QUERY, (TInt&) iFolderType))
+                {
+                /*
+                if (iFolderType == EMailbox)
+                    {
+                    // array to hold mailbox names
+                    CDesCArray* names = new (ELeave) CDesCArrayFlat(16);
+                    CleanupStack::PushL(names);                    
+                    
+                    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+                    CleanupStack::PushL(session);
+    
+                    // generate list of mailboxes
+                    CMsvEntrySelection* entrySelection = MsvUiServiceUtilities::GetListOfAccountsWithMTML(*session, KUidMsgTypeSMTP, ETrue);
+                    CleanupStack::PushL(entrySelection);
+
+                    TBool doReturn(EFalse);
+                    
+                    if (entrySelection->Count() == 0)
+                        {
+                        CAknInformationNote* note = new(ELeave) CAknInformationNote;
+                        note->ExecuteLD(_L("No mailboxes found"));
+
+                        doReturn = ETrue;
+                        }
+                    else
+                        {
+                        // get mailbox names
+                        for (TInt i=0; i<entrySelection->Count(); i++)
+                            {
+                            CMsvEntry* centry = session->GetEntryL(entrySelection->At(i));
+                            CleanupStack::PushL(centry);
+
+                            TMsvEntry tentry = centry->Entry();
+                            names->AppendL(tentry.iDetails);
+                            CleanupStack::PopAndDestroy(); //centry
+                            }
+                        
+                        // show query
+                        TInt index(0);
+                        CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
+                        dlg->PrepareLC(R_MAILBOX_SELECTION_QUERY);
+                        dlg->SetItemTextArray(names);
+                        dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
+
+                        if(dlg->RunLD())
+                            {
+                            iUserSelectedMailbox = entrySelection->At(index);
+
+                            doReturn = EFalse;
+                            }
+                        else
+                            {
+                            doReturn = ETrue;
+                            }    
+                        
+                        }
+                    
+                    CleanupStack::PopAndDestroy(3); // names, session, entrySelection
+                    
+                    if (doReturn)
+                        return EFalse;                    
+                    }
+                */
+
+                // query create as unread
+                if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Message status"), R_UNREAD_QUERY, (TInt&)iCreateAsUnread))
+                    {                
+                    // query number of characters in msg body
+                    switch (iMessageType)
+                        {
+                        case ESMS:
+                        case EMMS:
+                        case EEmail:
+                            {
+                            iDefinedMessageLength = 100;
+                            if (iEngine->GetEngineWrapper()->EntriesQueryDialog(iDefinedMessageLength, _L("Amount of characters in message body?"), ETrue))
+                                {
+                                ;
+                                }
+                            else
+                                return EFalse;
+
+                            break;
+                            }
+                        case EAMS:
+                        	{
+                        	iDefinedMessageLength = 0;
+                        	break;
+                        	}
+                        default: break;
+                        }
+
+                    // query attachments
+                    iAttachments->Reset();
+              
+                    switch (iMessageType)
+                        {
+                        case EMMS:
+                        case EEmail:
+                            {
+                            if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_ATTACHMENT_MULTI_SELECTION_QUERY, iAttachments))
+                                {
+                                // "none" is selected
+                                if (iAttachments->At(0) == 0)
+                                    iAttachments->Reset();
+                                else  // otherwise fix indexes
+                                    {
+                                    for (TInt i=0; i<iAttachments->Count(); i++)
+                                        iAttachments->At(i)--;  // decrease value by one 
+
+                                    }
+                                }
+                            else
+                                return EFalse;
+                            
+                            break;
+                            }
+                        case EAMS:
+                        	{
+                            iAttachments->AppendL( TInt(0) );
+                            if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_AMS_ATTACHMENT_SINGLE_SELECTION_QUERY, iAttachments->At(0)))
+                                {
+                                ;
+                                }
+                            else
+                                return EFalse;                        
+
+                            break;
+                        	}
+                            
+                        case EIrMessage:
+                        case EBTMessage:
+                            {
+                            iAttachments->AppendL( TInt(0) );
+                            if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_ATTACHMENT_SINGLE_SELECTION_QUERY, iAttachments->At(0)))
+                                {
+                                ;
+                                }
+                            else
+                                return EFalse;                        
+
+                            break;
+                            }
+                        default: break;
+                        }
+                    
+                    return ETrue;  // all queries accepted
+
+                    }
+                else
+                    return EFalse;
+                }
+            else
+                return EFalse;
+            }
+        else
+            return EFalse;
+			
+        }
+    // else
+        return EFalse;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateRandomMessageEntryL(TInt aCommand)
+    {
+    LOGSTRING2("Creator: CCreatorMessages::CreateRandomMessageEntryL - Command: %d", aCommand);
+
+    TInt err = KErrNone;
+    
+    iDefinedMessageLength = iEngine->RandomNumber(100, 300);
+
+
+    switch (aCommand)
+        {
+	    case ECmdCreateRandomEntrySMSInbox:     { iMessageType=ESMS; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntrySMSDrafts:    { iMessageType=ESMS; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntrySMSOutbox:    { iMessageType=ESMS; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntrySMSSent:      { iMessageType=ESMS; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
+	    
+        case ECmdCreateRandomEntryMMSInbox:     { iMessageType=EMMS; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryMMSDrafts:    { iMessageType=EMMS; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryMMSOutbox:    { iMessageType=EMMS; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}    
+	    case ECmdCreateRandomEntryMMSSent:      { iMessageType=EMMS; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
+	    
+        case ECmdCreateRandomEntryEmailInbox:   { iMessageType=EEmail; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryEmailDrafts:  { iMessageType=EEmail; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryEmailOutbox:  { iMessageType=EEmail; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryEmailSent:    { iMessageType=EEmail; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
+	    
+        case ECmdCreateRandomEntryBIOInbox:     { iMessageType=ESmartMessage; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBIODrafts:    { iMessageType=ESmartMessage; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBIOOutbox:    { iMessageType=ESmartMessage; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBIOSent:      { iMessageType=ESmartMessage; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
+	    
+        case ECmdCreateRandomEntryIRInbox:      { iMessageType=EIrMessage; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryIRDrafts:     { iMessageType=EIrMessage; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryIROutbox:     { iMessageType=EIrMessage; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryIRSent:       { iMessageType=EIrMessage; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    
+        case ECmdCreateRandomEntryBTInbox:      { iMessageType=EBTMessage; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBTDrafts:     { iMessageType=EBTMessage; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBTOutbox:     { iMessageType=EBTMessage; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryBTSent:       { iMessageType=EBTMessage; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
+        
+	    case ECmdCreateRandomEntryAMSInbox:     { iMessageType=EAMS; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryAMSDrafts:     { iMessageType=EAMS; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryAMSOutbox:     { iMessageType=EAMS; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
+	    case ECmdCreateRandomEntryAMSSent:     { iMessageType=EAMS; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
+
+	    default: { User::Panic(_L("MessageCommand"), 901);  break;}
+        }
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateMessageEntryL(CMessagesParameters *aParameters, TBool /*aTakeUserGivenParameters*/)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateMessageEntryL");
+    
+    delete iParameters;
+    iParameters = 0;   
+    
+    CMessagesParameters* parameters = aParameters;
+           
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CMessagesParameters;
+        parameters = iParameters;
+        // check if values from ui needed
+        //if (aTakeUserGivenParameters)
+        //    {            
+            parameters->iMessageType = iMessageType;
+            parameters->iFolderType = iFolderType;
+            parameters->iDefinedMessageLength = iDefinedMessageLength;
+            parameters->iCreateAsUnread = iCreateAsUnread;
+
+            for (TInt i=0; i<iAttachments->Count(); i++)
+                parameters->iAttachments->AppendL(iAttachments->At(i)); 
+        //    }
+        //else
+        //    {
+            // message length
+        //    parameters->iDefinedMessageLength = iEngine->RandomNumber(100, 300);
+        //    }    
+
+        if (parameters->iMessageType == EEmail)
+            {
+            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
+            parameters->iSenderAddress->Des().Append( _L("@") );
+            parameters->iSenderAddress->Des().Append( iEngine->RandomString(CCreatorEngine::ECompany) );
+            parameters->iSenderAddress->Des().Append( _L(".com") );
+
+            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
+            parameters->iRecipientAddress->Des().Append( _L("@") );
+            parameters->iRecipientAddress->Des().Append( iEngine->RandomString(CCreatorEngine::ECompany) );
+            parameters->iRecipientAddress->Des().Append( _L(".net") );
+            }
+        else if (parameters->iMessageType == EIrMessage || parameters->iMessageType == EBTMessage)
+            {
+            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
+            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
+            }
+        else
+            {
+            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EPhoneNumber) );
+            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EPhoneNumber) );
+            }
+
+        // subject
+        parameters->iMessageSubject->Des() = iEngine->RandomString(CCreatorEngine::EMessageSubject);
+
+        // message body
+        parameters->iMessageBodyText->Des().Copy(_L(""));
+        TPtrC randText = iEngine->RandomString(CCreatorEngine::EMessageText);
+        for (TInt i=0; i<parameters->iDefinedMessageLength / randText.Length() +1; i++)
+            {
+            parameters->iMessageBodyText->Des().Append( randText );
+            parameters->iMessageBodyText->Des().Append( _L(" ") );
+            }
+        parameters->iMessageBodyText->Des() = parameters->iMessageBodyText->Des().Left(parameters->iDefinedMessageLength);
+
+        // BIO message type (from bitsids.h)  // TO-DO: add support for all BIO message types...
+        parameters->iBIOMessageType = KUidBIOBusinessCardMsg;
+        }
+    
+    
+
+    TInt err = KErrNone;
+
+    switch (parameters->iMessageType)
+        {
+        case ESMS:          { err = CreateSMSEntryL(*parameters);  break; }
+        case EMMS:          { err = CreateMMSEntryL(*parameters);  break; }
+        case EAMS:          { err = CreateAMSEntryL(*parameters);  break; }
+        case EEmail:        { err = CreateEmailEntryL(*parameters);  break; }
+        case ESmartMessage: { err = CreateSmartMessageEntryL(*parameters);  break; }
+        case EIrMessage:    { err = CreateObexEntryL( TUid::Uid(KUidMsgTypeIrTInt32), *parameters );  break; }    
+        case EBTMessage:    { err = CreateObexEntryL( TUid::Uid(KUidMsgTypeBtTInt32), *parameters );  break; }
+        default:            { User::Panic(_L("MsgType"), 851);  break;}
+
+        }
+
+    iSenderArray.ResetAndDestroy();
+    iRecipientArray.ResetAndDestroy();
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateSMSEntryL(const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateSMSEntryL");
+
+    TInt err = KErrNone;
+
+               
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+
+    // get the client mtm and return if it isn't supported in the system        
+    CSmsClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CSmsClientMtm*>(registry->NewMtmL(KUidMsgTypeSMS)));
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("SMS: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // get default service
+    TMsvId defaultServiceId = 0;
+    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
+    if (err)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("SMS: Define a SMS centre first"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        } 
+    
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry);    
+    
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+    // set the from field to sms header
+    if (parameters.iFolderType == EInbox)
+        {
+        CSmsHeader* smsHeader = &clientMtm->SmsHeader();
+        delete smsHeader;
+        smsHeader = NULL;
+        smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, clientMtm->Body());        
+        if( parameters.iSenderAddress )
+            {
+            smsHeader->SetFromAddressL( parameters.iSenderAddress->Des() );
+            }
+        else
+            {
+            smsHeader->SetFromAddressL(KEmpty);
+            }
+        }       
+
+    // set body
+    clientMtm->Body().Reset();
+    clientMtm->Body().InsertL(0, parameters.iMessageBodyText->Des());        
+
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();
+
+    // set the details field
+    if (parameters.iFolderType == EInbox)
+        {
+        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        }
+    else
+        {
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        // Add all recipients to clientMtm
+        // iRecipientArray is up-to-date so don't call AddRecipientsL here 
+        for( TInt i = 0; i < iRecipientArray.Count(); i++ )
+            {
+            clientMtm->AddAddresseeL( iRecipientArray[i]->Des() );
+            }
+        }
+
+    // set the sending state for outbox message
+    // to avoid SMSMtmUI:15 panic in messages application
+    if (parameters.iFolderType == EOutbox )
+        {
+        messageEntry.SetSendingState( KMsvSendStateWaiting );
+        }
+
+    // set the description field same as the first part of the message body
+    messageEntry.iDescription.Set( parameters.iMessageBodyText->Des().Left(KSmsDescriptionLength) );
+
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);
+
+    // save the message     
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+    messageEntry.SetAttachment(EFalse);
+    messageEntry.iDate.HomeTime();
+    messageEntry.SetVisible(ETrue);
+    messageEntry.SetInPreparation(EFalse);
+   
+    if (parameters.iCreateAsUnread)
+        {
+        messageEntry.SetUnread(ETrue);
+        messageEntry.SetNew(ETrue);
+        }
+    else
+        {
+        messageEntry.SetUnread(EFalse);
+        messageEntry.SetNew(EFalse);
+        }
+    
+    messageEntry.SetComplete(ETrue);
+    messageEntry.iServiceId = defaultServiceId;
+    messageEntry.iRelatedId = 0;
+    clientMtm->Entry().ChangeL(messageEntry);
+
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm
+        
+    return err;
+
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateMMSEntryL(const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateMMSEntryL");
+
+    TInt err = KErrNone;
+        
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+
+    // get the client mtm and return if it isn't supported in the system        
+    CMmsClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CMmsClientMtm*>(registry->NewMtmL(KUidMsgTypeMultimedia)));
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("MMS: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // get default service
+    TMsvId defaultServiceId = 0;
+    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
+    if (err)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("MMS: Define MMS settings first"));
+        CleanupStack::PopAndDestroy(4);
+        User::Leave(KErrNotFound);
+        } 
+    
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry);    
+    
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+    // set subject
+    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
+            
+    // set some mms defaults
+    clientMtm->SetMessageClass(EMmsClassPersonal);
+    clientMtm->SetExpiryInterval(86400);
+    clientMtm->SetDeliveryTimeInterval(3600);
+    clientMtm->SetMessagePriority(EMmsPriorityLow);
+    clientMtm->SetSenderVisibility(EMmsMaximumSenderVisibility);
+    clientMtm->SetDeliveryReport(EMmsDeliveryReportYes);
+    clientMtm->SetReadReply(EMmsReadReplyYes);        
+    
+    // set the sender / addressee field
+    if (parameters.iFolderType == EInbox)
+        {        
+        AddMtmSenderL(*clientMtm, parameters, EFalse);                
+        }
+    
+    // Add all recipients to clientMtm
+    AddRecipientsL( *clientMtm, parameters, EFalse );  
+        
+    // get an access to the message store
+    CMsvStore* store = msvEntry->EditStoreL();
+    CleanupStack::PushL(store);                  
+   
+
+    // set body as an attachment
+    CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
+    CleanupStack::PushL(mimeHeaders);
+    mimeHeaders->SetContentTypeL( _L8("text") );
+    mimeHeaders->SetContentSubTypeL( _L8("plain") );
+    mimeHeaders->SetMimeCharset( KMmsUtf8 );
+    mimeHeaders->SetSuggestedFilenameL( _L("body.txt") );
+    
+    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
+    CleanupStack::PushL(attachmentInfo);
+    attachmentInfo->SetAttachmentNameL( _L("body.txt") );
+    attachmentInfo->SetMimeTypeL( _L8("text/plain") );
+    mimeHeaders->StoreL( *attachmentInfo );
+    
+    RFile textFile;
+
+    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+    attachMan.CreateAttachmentL(_L("body.txt"), textFile, attachmentInfo, waiter->iStatus );
+    CleanupStack::Pop(); // waiter
+    CleanupStack::Pop(); // attachmentInfo
+    CleanupStack::PushL(waiter);
+    waiter->StartAndWait();
+    CleanupStack::PopAndDestroy(waiter);        
+   
+    HBufC8* tempBuf = HBufC8::NewLC( parameters.iMessageBodyText->Des().Length() );
+    tempBuf->Des().Copy( parameters.iMessageBodyText->Des() );
+    textFile.Write( tempBuf->Des() );        
+    textFile.Close();
+    CleanupStack::PopAndDestroy(); //tempBuf
+    
+    CleanupStack::PopAndDestroy(); //mimeHeaders
+
+    
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();        
+    
+    // set the details field
+    if (parameters.iFolderType == EInbox)
+        {
+        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        }
+    else
+        {
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        }    
+
+    // set the description field same as the message subject
+    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
+
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);        
+    
+
+      // save the attachments
+    HandleAttachementsL(parameters, store, err );
+//    for (TInt i=0; i<parameters.iAttachments->Count(); i++)
+//        {
+//        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
+//
+//        TParse parser;
+//        parser.Set(sourceFileName, NULL, NULL);
+//        TFileName shortFileName = parser.NameAndExt();
+//
+//        // get the mime type
+//        RApaLsSession ls;
+//        User::LeaveIfError(ls.Connect());
+//        CleanupClosePushL<RApaLsSession>(ls);
+//        TUid appUid;
+//        TDataType dataType;
+//        ls.AppForDocument(sourceFileName, appUid, dataType);
+//        CleanupStack::PopAndDestroy(); //ls
+//        TPtrC8 mimeType = dataType.Des8();
+//        
+//        // attachment settings
+//        MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+//        CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
+//        attachmentInfo->SetAttachmentNameL( shortFileName );        
+//        attachmentInfo->SetMimeTypeL( mimeType );        
+//
+//        // save
+//        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+//        
+//        TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
+//        if (err == KErrNone)
+//            waiter->StartAndWait();
+//        else
+//            LOGSTRING2("Creator: CCreatorMessages::CreateMMSEntryL failed to attach %S", &sourceFileName);
+//
+//        CleanupStack::PopAndDestroy(waiter);  
+//        }
+
+    // save the changes made to the message store
+    store->CommitL();
+    CleanupStack::PopAndDestroy(store);   
+           
+    
+    // save the message      
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+	messageEntry.SetAttachment(ETrue);
+    messageEntry.iDate.HomeTime();
+    messageEntry.SetVisible(ETrue);
+    messageEntry.SetInPreparation(EFalse);
+    if (parameters.iCreateAsUnread)
+        {
+        messageEntry.SetUnread(ETrue);
+        messageEntry.SetNew(ETrue);
+        }
+    else
+        {
+        messageEntry.SetUnread(EFalse);
+        messageEntry.SetNew(EFalse);
+        }
+    messageEntry.SetComplete(ETrue);
+    messageEntry.iServiceId = defaultServiceId;
+    messageEntry.iRelatedId = 0;
+    
+    if (parameters.iFolderType == EDrafts) 
+        messageEntry.SetReadOnly(EFalse);
+    else
+        messageEntry.SetReadOnly(ETrue);
+
+	messageEntry.iMtmData1 = KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated;
+	
+    clientMtm->Entry().ChangeL(messageEntry);
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm        
+        
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::HandleAttachementsL(const CMessagesParameters& parameters, CMsvStore* store, TInt err )
+    {
+    // save the attachments (added with id's)
+  for (TInt i=0; i<parameters.iAttachments->Count(); i++)
+      {
+      TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
+      HandleAttachementL(store, err, sourceFileName );
+
+      }    
+  //Adding attachmentpaths
+  for (TInt i=0; i<parameters.iAttachmentPaths.Count(); i++)
+      {
+      HBufC* point = parameters.iAttachmentPaths[i];
+      TFileName sourceFileName(point->Des());      
+      HandleAttachementL(store, err, sourceFileName );
+      }
+    }
+//----------------------------------------------------------------------------
+
+void CCreatorMessages::HandleAttachementL(CMsvStore* store, TInt err, TFileName& sourceFileName )
+    {
+    TParse parser;
+    parser.Set(sourceFileName, NULL, NULL);
+    TFileName shortFileName = parser.NameAndExt();
+
+    // get the mime type
+    RApaLsSession ls;
+    User::LeaveIfError(ls.Connect());
+    CleanupClosePushL<RApaLsSession>(ls);
+    TUid appUid;
+    TDataType dataType;
+    ls.AppForDocument(sourceFileName, appUid, dataType);
+    CleanupStack::PopAndDestroy(); //ls
+    TPtrC8 mimeType = dataType.Des8();
+    
+    // attachment settings
+    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
+    CleanupStack::PushL(attachmentInfo);
+    attachmentInfo->SetAttachmentNameL( shortFileName );        
+    attachmentInfo->SetMimeTypeL( mimeType );
+    
+    if ( mimeType == _L8("text/plain") )
+        {
+        // CMsvMimeHeaders needs to be stored in case of text file 
+        CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
+        CleanupStack::PushL(mimeHeaders);
+        mimeHeaders->SetContentTypeL( _L8("text") );
+        mimeHeaders->SetContentSubTypeL( _L8("plain") );
+        mimeHeaders->SetMimeCharset( KMmsUtf8 );
+        mimeHeaders->StoreL( *attachmentInfo );
+        CleanupStack::PopAndDestroy( mimeHeaders );
+        }
+
+    // save
+    
+    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+    TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
+    if (err == KErrNone)
+    	{
+        waiter->StartAndWait();
+        CleanupStack::PopAndDestroy(waiter);
+        CleanupStack::Pop(); // attachmentInfo, the ownership is transferred
+    	}
+    else
+    	{
+    	CleanupStack::PopAndDestroy(waiter);
+    	CleanupStack::PopAndDestroy(); // attachmentInfo, ownership is not transferred (leave occurs)
+        LOGSTRING2("Creator: CCreatorMessages::HandleAttachementsL failed to attach %S", &sourceFileName);
+    	}
+    }
+      //----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateAMSEntryL(const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateAMSEntryL");
+
+    TInt err = KErrNone;
+
+        
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+
+    // get the client mtm and return if it isn't supported in the system        
+    CMmsClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CMmsClientMtm*>(registry->NewMtmL(KUidMsgTypeMultimedia)));
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("MMS: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // get default service
+    TMsvId defaultServiceId = 0;
+    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
+    if (err)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("MMS: Define MMS settings first"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        } 
+    
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry);    
+    
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+    // set subject
+    clientMtm->SetSubjectL(parameters.iMessageSubject->Des() );
+            
+    // set some mms defaults
+    clientMtm->SetMessageClass(EMmsClassPersonal);
+    clientMtm->SetExpiryInterval(86400);
+    clientMtm->SetDeliveryTimeInterval(3600);
+    clientMtm->SetMessagePriority(EMmsPriorityLow);
+    clientMtm->SetSenderVisibility(EMmsMaximumSenderVisibility);
+    clientMtm->SetDeliveryReport(EMmsDeliveryReportYes);
+    clientMtm->SetReadReply(EMmsReadReplyYes);        
+    
+    // set the sender / addressee field
+    if (parameters.iFolderType == EInbox)
+        {
+        AddMtmSenderL(*clientMtm, parameters, EFalse);                
+        }
+
+    // Add all recipients to clientMtm
+    AddRecipientsL( *clientMtm, parameters, EFalse );
+    
+        
+    // get an access to the message store
+    CMsvStore* store = msvEntry->EditStoreL();
+    CleanupStack::PushL(store);                  
+   
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();        
+    
+    // set the details field
+    if (parameters.iFolderType == EInbox)
+        {
+        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        }  
+    else
+        {
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        }
+
+    // set the description field same as the message subject
+    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
+    messageEntry.iBioType = KUidMsgSubTypeMmsAudioMsg.iUid;
+    
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);        
+    
+
+    TFileName sourceFileName = iEngine->TestDataPathL( CCreatorEngine::EAMR_20kB );
+    TParse parser;
+    parser.Set(sourceFileName, NULL, NULL);
+    TFileName shortFileName = parser.NameAndExt();
+
+    // get the mime type
+    RApaLsSession ls;
+    User::LeaveIfError(ls.Connect());
+    CleanupClosePushL<RApaLsSession>(ls);
+    TUid appUid;
+    TDataType dataType;
+    ls.AppForDocument(sourceFileName, appUid, dataType);
+    CleanupStack::PopAndDestroy(); //ls
+    TPtrC8 mimeType = dataType.Des8();
+        
+    // attachment settings
+    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
+    attachmentInfo->SetAttachmentNameL( shortFileName );        
+    attachmentInfo->SetMimeTypeL( mimeType );        
+
+    // save
+    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+      
+    TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
+    if (err == KErrNone)
+        waiter->StartAndWait();
+    else
+        LOGSTRING2("Creator: CCreatorMessages::CreateAMSEntryL failed to attach %S", &sourceFileName);
+
+    CleanupStack::PopAndDestroy(waiter);  
+
+    // save the changes made to the message store
+    store->CommitL();
+    CleanupStack::PopAndDestroy(store);   
+           
+    
+    // save the message      
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+	messageEntry.SetAttachment(ETrue);
+    messageEntry.iDate.HomeTime();
+    messageEntry.SetVisible(ETrue);
+    messageEntry.SetInPreparation(EFalse);
+    if (parameters.iCreateAsUnread)
+        {
+        messageEntry.SetUnread(ETrue);
+        messageEntry.SetNew(ETrue);
+        }
+    else
+        {
+        messageEntry.SetUnread(EFalse);
+        messageEntry.SetNew(EFalse);
+        }
+    messageEntry.SetComplete(ETrue);
+    messageEntry.iServiceId = defaultServiceId;
+    messageEntry.iRelatedId = 0;
+    
+    if (parameters.iFolderType == EDrafts) 
+        messageEntry.SetReadOnly(EFalse);
+    else
+        messageEntry.SetReadOnly(ETrue);
+
+	messageEntry.iMtmData1 = KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated;
+	
+    clientMtm->Entry().ChangeL(messageEntry);
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm        
+        
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateEmailEntryL(const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateEmailEntryL");
+
+    TInt err = KErrNone;
+
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+    
+    // get the client mtm and return if it isn't supported in the system        
+    CSmtpClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CSmtpClientMtm*>(registry->NewMtmL(KUidMsgTypeSMTP)));
+    
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Email: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // get default service
+    TMsvId defaultServiceId(0);
+    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
+    if (err)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Email: Define a mailbox first"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        } 
+                
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        case EMailbox:  { msvEntry->SetEntryL(iUserSelectedMailbox);          break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry); 
+
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+    // set subject
+    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
+    
+    // set body
+    clientMtm->Body().Reset();
+    clientMtm->Body().InsertL(0, parameters.iMessageBodyText->Des()); 
+
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();
+    
+    // set the address fields
+    if (parameters.iFolderType == EInbox)
+        {
+        AddSenderToMtmAddresseeL(*clientMtm, parameters, ETrue );
+        SetSenderToEntryDetails(messageEntry, parameters, ETrue);
+        messageEntry.iMtm = KUidMsgTypeIMAP4;  // or any other than KUidMsgTypeSMTP to display 'from' field instead of 'to' field 
+        }
+    else
+        {
+        // Add all recipients to clientMtm
+        AddRecipientsL( *clientMtm, parameters, ETrue );
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);        
+        }
+
+    // set the description field same as the message subject
+    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
+
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);
+    
+    // get an access to the message store
+    CMsvStore* store = msvEntry->EditStoreL();
+    CleanupStack::PushL(store); 
+    
+    // save the attachments
+    HandleAttachementsL(parameters, store, err);
+//    for (TInt i=0; i<parameters.iAttachments->Count(); i++)
+//        {
+//        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
+//
+//        TParse parser;
+//        parser.Set(sourceFileName, NULL, NULL);
+//        TFileName shortFileName = parser.NameAndExt();
+//
+//        // get the mime type
+//        RApaLsSession ls;
+//        User::LeaveIfError(ls.Connect());
+//        CleanupClosePushL<RApaLsSession>(ls);
+//        TUid appUid;
+//        TDataType dataType;
+//        ls.AppForDocument(sourceFileName, appUid, dataType);
+//        CleanupStack::PopAndDestroy(); //ls
+//        TPtrC8 mimeType = dataType.Des8();
+//        
+//        // attachment settings
+//        MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+//        CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
+//        attachmentInfo->SetAttachmentNameL( shortFileName );        
+//        attachmentInfo->SetMimeTypeL( mimeType );        
+//
+//        // save
+//        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+//
+//        TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
+//        if (err == KErrNone)
+//            waiter->StartAndWait();
+//        else
+//            LOGSTRING2("Creator: CCreatorMessages::CreateEmailEntryL failed to attach %S", &sourceFileName);
+//
+//        CleanupStack::PopAndDestroy(waiter);  
+//        }
+
+    // save the changes made to the message store
+    store->CommitL();
+    CleanupStack::PopAndDestroy(store); 
+            
+    // save the message      
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+	TMsvEmailEntry temailEntry = static_cast<TMsvEmailEntry>(messageEntry);
+    temailEntry.SetMessageFolderType(EFolderTypeUnknown);
+    temailEntry.SetDisconnectedOperation(ENoDisconnectedOperations);
+    temailEntry.SetEncrypted(EFalse);
+    temailEntry.SetSigned(EFalse);
+    temailEntry.SetVCard(EFalse);
+    temailEntry.SetVCalendar(EFalse);
+    temailEntry.SetReceipt(EFalse);
+    temailEntry.SetMHTMLEmail(EFalse);
+    temailEntry.SetBodyTextComplete(ETrue);
+    
+	if (parameters.iAttachments->Count() > 0)
+        temailEntry.SetAttachment(ETrue);
+    else
+        temailEntry.SetAttachment(EFalse);
+	
+    temailEntry.iDate.HomeTime();
+    temailEntry.SetVisible(ETrue);
+    temailEntry.SetInPreparation(EFalse);
+    if (parameters.iCreateAsUnread)
+        {
+        temailEntry.SetUnread(ETrue);
+        temailEntry.SetNew(ETrue);
+        }
+    else
+        {
+        temailEntry.SetUnread(EFalse);
+        temailEntry.SetNew(EFalse);
+        }
+    temailEntry.SetComplete(ETrue);
+    temailEntry.iServiceId = defaultServiceId;
+    temailEntry.iRelatedId = 0;
+    
+    clientMtm->Entry().ChangeL(temailEntry);
+
+    // reset email headers
+    CImHeader* header = CImHeader::NewLC();
+    CMsvStore* msvStore = msvEntry->EditStoreL();
+    CleanupStack::PushL(msvStore);
+    header->RestoreL(*msvStore);
+    header->SetSubjectL( parameters.iMessageSubject->Des() );
+    if( iSenderArray.Count() == 0 )
+        {
+        GetSendersL(iSenderArray, parameters, ETrue, 1 );
+        }
+    
+    if( iSenderArray.Count() > 0 )
+        {
+        header->SetFromL(iSenderArray[0]->Des());
+        }
+    else
+        {
+        header->SetFromL( parameters.iSenderAddress->Des() );
+        }
+    if( parameters.iRecipientAddress->Length() > 0 )
+        {
+        header->SetReceiptAddressL( parameters.iRecipientAddress->Des() );
+        }
+    else if( parameters.iRecipientAddressArray.Count() > 0 )
+        {
+        header->SetReceiptAddressL( parameters.iRecipientAddressArray[0]->Des());
+        }
+    
+    header->StoreL( *msvStore );
+    msvStore->CommitL();
+    CleanupStack::PopAndDestroy(2); // msvStore, header
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm 
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateSmartMessageEntryL(const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateSmartMessageEntryL");
+
+    TInt err = KErrNone;
+
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+
+    // get the client mtm and return if it isn't supported in the system        
+    CSmsClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CSmsClientMtm*>(registry->NewMtmL(KUidMsgTypeSMS)));
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("BIO: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // get default service
+    TMsvId defaultServiceId = 0;
+    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
+    if (err)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("SMS: Define a SMS centre first"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        } 
+    
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry);    
+    
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+     // set the from field to sms header
+    if (parameters.iFolderType == EInbox)
+        {
+        CSmsHeader* smsHeader = &clientMtm->SmsHeader();
+        delete smsHeader;
+        smsHeader = NULL;
+        smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, clientMtm->Body());
+        if( parameters.iSenderAddress )
+            {
+            smsHeader->SetFromAddressL( parameters.iSenderAddress->Des() );
+            }
+        else
+            {
+            smsHeader->SetFromAddressL(KEmpty);
+            }
+        }       
+
+    // set body, the BIO message itself
+    clientMtm->Body().Reset();
+    clientMtm->Body().InsertL(0, _L("Business Card\nTester Mike\nThe Company Ltd.\nSoftware Engineer\ntel +358 66 1234567\n")); 
+
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();
+
+    // TO-DO: Add support for all BIO messages, currently just insert a business card message ... :
+    // set the message type
+    // parameters.iBIOMessageType ...
+    clientMtm->BioTypeChangedL(KUidBIOBusinessCardMsg);
+    messageEntry.iBioType = KUidBIOBusinessCardMsg.iUid;
+
+    // set the details field
+    if (parameters.iFolderType == EInbox)
+        {
+        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        }        
+    else
+        {
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        }
+
+    // set the subject line
+    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
+
+    // set correct MTM type
+    messageEntry.iMtm= KUidBIOMessageTypeMtm;
+
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);
+
+    // save the message     
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+    messageEntry.SetAttachment(EFalse);
+    messageEntry.iDate.HomeTime();
+    messageEntry.SetVisible(ETrue);
+    messageEntry.SetInPreparation(EFalse);
+    if (parameters.iCreateAsUnread)
+        {
+        messageEntry.SetUnread(ETrue);
+        messageEntry.SetNew(ETrue);
+        }
+    else
+        {
+        messageEntry.SetUnread(EFalse);
+        messageEntry.SetNew(EFalse);
+        }
+    messageEntry.SetComplete(ETrue);
+    messageEntry.iServiceId = defaultServiceId;
+    messageEntry.iRelatedId = 0;
+    clientMtm->Entry().ChangeL(messageEntry);
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm
+        
+    
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorMessages::CreateObexEntryL(TUid aMtm, const CMessagesParameters& parameters)
+    {
+    LOGSTRING("Creator: CCreatorMessages::CreateObexEntryL");
+
+    TInt err = KErrNone;
+
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL(registry);
+
+    // get the client mtm and return if it isn't supported in the system        
+    CObexClientMtm* clientMtm = NULL;
+    TRAP(err, clientMtm = static_cast<CObexClientMtm*>(registry->NewMtmL(aMtm)));
+    if (err || !clientMtm)
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Obex: Message type module not found"));
+        CleanupStack::PopAndDestroy(2);
+        User::Leave(KErrNotFound);
+        }  
+    CleanupStack::PushL(clientMtm);   
+
+    // create a new object to access an existing entry
+    CMsvEntry* msvEntry = CMsvEntry::NewL(*session, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
+    CleanupStack::PushL(msvEntry);
+  
+    // define default service
+    TMsvId defaultServiceId = 0;
+    
+    // set folder type
+    switch (parameters.iFolderType)
+        {
+        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
+        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
+        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
+        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
+        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
+        }
+        
+    // mtm takes ownership of entry context	
+    CleanupStack::Pop(msvEntry);
+    clientMtm->SetCurrentEntryL(msvEntry);    
+    
+    // create a new message
+    clientMtm->CreateMessageL(defaultServiceId);
+
+    // get the entry of the message
+    TMsvEntry messageEntry = clientMtm->Entry().Entry();
+
+    // set subject
+    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
+    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
+
+    // set body, must be empty for obex messages
+    clientMtm->Body().Reset();
+
+    // set the details field and
+    if (parameters.iFolderType == EInbox)
+        {
+        SetSenderToEntryDetails(messageEntry, parameters, EFalse);
+        }        
+    else
+        {
+        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        }
+    
+    // set mtm
+    messageEntry.iMtm = aMtm;
+    messageEntry.iType = KUidMsvMessageEntry;
+    messageEntry.iServiceId = KMsvUnknownServiceIndexEntryId;
+
+    // save the changes done above
+    clientMtm->Entry().ChangeL(messageEntry);
+
+    // save the message      
+    clientMtm->SaveMessageL();
+    	
+	// final fine tuning
+    messageEntry.iDate.HomeTime();
+    messageEntry.SetVisible(ETrue);
+    messageEntry.SetInPreparation(EFalse);
+    if (parameters.iCreateAsUnread)
+        {
+        messageEntry.SetUnread(ETrue);
+        messageEntry.SetNew(ETrue);
+        }
+    else
+        {
+        messageEntry.SetUnread(EFalse);
+        messageEntry.SetNew(EFalse);
+        }
+    messageEntry.SetComplete(ETrue);
+    clientMtm->Entry().ChangeL(messageEntry);
+    
+    // save the attachment
+    if (parameters.iAttachments->Count() >= 1)
+        {
+        // create a new entry for the attachment
+        TMsvEntry attachTEntry;
+        attachTEntry.iType      = KUidMsvAttachmentEntry;
+        attachTEntry.iServiceId = KMsvUnknownServiceIndexEntryId;   
+        attachTEntry.iMtm       = KUidMsgTypeBt; //save as bt message
+        
+        msvEntry->CreateL(attachTEntry);
+        
+        CMsvEntry* attachEntry = session->GetEntryL(attachTEntry.Id());
+        clientMtm->SetCurrentEntryL(attachEntry);
+                
+        // get source file
+        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(0) );
+
+        // get the mime type
+        RApaLsSession ls;
+        User::LeaveIfError(ls.Connect());
+        CleanupClosePushL<RApaLsSession>(ls);
+        TUid appUid;
+        TDataType mimeType;
+        ls.AppForDocument(sourceFileName, appUid, mimeType);
+        CleanupStack::PopAndDestroy(); //ls
+        
+        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+
+        // add an attachment to the current message entry
+        TRAP(err, clientMtm->AddAttachmentL( sourceFileName, mimeType.Des8(), 0, waiter->iStatus ));
+        if (err == KErrNone)
+            waiter->StartAndWait();
+        else
+            LOGSTRING2("Creator: CCreatorMessages::CreateObexEntryL failed to attach %S", &sourceFileName);
+        
+        CleanupStack::PopAndDestroy(waiter);
+        }
+    
+    // id has been generated, store it for being able to delete
+    // only entries created with Creator
+    iEntryIds.Append( messageEntry.Id() );
+    
+    CleanupStack::PopAndDestroy(3); //session, registry, clientMtm 
+
+
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorMessages::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
+    {
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
+    {        
+    // Only one sender allowed:
+    if( iSenderArray.Count() == 0 )
+        {
+        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
+        }
+    if( iSenderArray.Count() > 0 )
+        {        
+        aMsgEntry.iDetails.Set( iSenderArray[0]->Des() );        
+        }
+    else
+        {
+        aMsgEntry.iDetails.Set(KEmpty);
+        }        
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
+    {        
+    // Only one sender allowed:
+    GetAllRecipientsL(iRecipientArray, aParameters, aUseEmailAddress);
+    if( iRecipientArray.Count() > 0 )
+        {
+        const TDesC& temp = iRecipientArray[0]->Des();
+        aMsgEntry.iDetails.Set( temp );
+        }
+    else
+        {
+        aMsgEntry.iDetails.Set(KEmpty);
+        }        
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::AddSenderToMtmAddresseeL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
+    {    
+    // Only one sender allowed:
+    if( iSenderArray.Count() == 0 )
+        {
+        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
+        }
+    
+    for( TInt i = 0; i < iSenderArray.Count(); ++i )
+        {
+        aMtm.AddAddresseeL( iSenderArray[i]->Des() );        
+        }    
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::AddMtmSenderL(CMmsClientMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
+    {    
+    // Only one sender allowed:
+    if( iSenderArray.Count() == 0 )
+        {
+        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
+        }
+    
+    if( iSenderArray.Count() > 0 )
+        {
+        aMtm.SetSenderL( iSenderArray[0]->Des() );        
+        }    
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::GetSendersL(RPointerArray<HBufC>& aSenderArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress, TInt aMaxNum )
+    {
+    TInt counter = 0;
+    
+    if( counter < aMaxNum || aMaxNum == KUndef )
+        {
+        if( aParameters.iSenderAddress && aParameters.iSenderAddress->Length() > 0 )
+            {
+            HBufC* temp = HBufC::NewL(aParameters.iSenderAddress->Length());
+            CleanupStack::PushL(temp);
+            temp->Des().Copy(aParameters.iSenderAddress->Des());
+            aSenderArray.AppendL( temp );
+            CleanupStack::Pop(); // temp
+            ++counter;
+            }
+        }
+            
+    if( counter < aMaxNum || aMaxNum == KUndef )
+        {
+        RPointerArray<HBufC> tempArray;
+        CleanupResetAndDestroyPushL( tempArray );
+        GetLinkedAddressesL(tempArray, aParameters.iSenderLinkIds, aUseEmailAddress, aParameters.iNumberOfExistingSenders);
+        for( TInt i = 0; i < tempArray.Count() && (counter < aMaxNum || aMaxNum == KUndef); ++i )
+            {
+            HBufC* temp = tempArray[i]->AllocLC();
+            aSenderArray.AppendL(temp);
+            CleanupStack::Pop(); // temp
+            ++counter;
+            }
+        CleanupStack::PopAndDestroy(); // tempArray
+        }    
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::AddRecipientsL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
+    {
+    GetAllRecipientsL(iRecipientArray, aParameters, aUseEmailAddress);
+    for( TInt i = 0; i < iRecipientArray.Count(); ++i )
+        {
+        aMtm.AddAddresseeL( iRecipientArray[i]->Des() );        
+        }    
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::GetAllRecipientsL(RPointerArray<HBufC>& aRecipientArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
+    {
+    
+    // If iRecipientAddress is given, add it to the array:
+    if( aParameters.iRecipientAddress && aParameters.iRecipientAddress->Length() > 0 )
+        {
+        HBufC* temp = HBufC::NewL(aParameters.iRecipientAddress->Length());
+        CleanupStack::PushL(temp);
+        temp->Des().Copy(aParameters.iRecipientAddress->Des());
+        aRecipientArray.AppendL( temp );
+        CleanupStack::Pop(); // temp
+        }
+    
+    // Add all recipients listed in iRecipientAddressArray:
+    for( TInt i = 0; i < aParameters.iRecipientAddressArray.Count(); ++i )
+        {
+        HBufC* temp = HBufC::NewL(aParameters.iRecipientAddressArray[i]->Length());
+        CleanupStack::PushL(temp);
+        temp->Des().Copy(aParameters.iRecipientAddressArray[i]->Des());
+        aRecipientArray.AppendL( temp );
+        CleanupStack::Pop(); // temp        
+        }
+    
+    // Get all linked addresses. 
+    GetLinkedAddressesL(aRecipientArray, aParameters.iRecipientLinkIds, aUseEmailAddress, aParameters.iNumberOfExistingRecipients);
+    }
+
+/*
+ * Get all linked addresses. This method gets addresses that are linked with contact-set id and 
+ * existing addresses from the contact database, if required.
+ */
+void CCreatorMessages::GetLinkedAddressesL(
+        RPointerArray<HBufC>& aAddressArray, 
+        const RArray<TLinkIdParam>& aLinkIds, 
+        TBool aUseEmailAddress,
+        TInt aNumOfExistingAddresses )
+    {
+}
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorMessages::DeleteAllL");
+    DeleteAllMessagesL( EFalse );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::DeleteAllMessagesL( TBool aOnlyCreatedWithCreator )
+    {
+    LOGSTRING("Creator: CCreatorMessages::DeleteAllMessagesL");
+    TInt err( KErrNone );
+    
+    // init
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL( session );
+    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*session);
+    CleanupStack::PushL( registry );
+
+    // get the client mtm and return if it isn't supported in the system        
+    CSmsClientMtm* clientMtm( NULL );
+    TRAP( err, clientMtm = static_cast<CSmsClientMtm*>( registry->NewMtmL( KUidMsgTypeSMS ) ) );
+    if ( err || !clientMtm )
+        {
+        iEngine->GetEngineWrapper()->ShowErrorMessage( _L( "SMS: Message type module not found" ) );
+        CleanupStack::PopAndDestroy( 2 );
+        User::Leave( KErrNotFound );
+        }
+    CleanupStack::PushL( clientMtm );
+    
+    TRAP_IGNORE( DeleteAllFromFolderL( KMsvGlobalInBoxIndexEntryId, session, clientMtm, aOnlyCreatedWithCreator ) );
+    TRAP_IGNORE( DeleteAllFromFolderL( KMsvDraftEntryId, session, clientMtm, aOnlyCreatedWithCreator ) );
+    TRAP_IGNORE( DeleteAllFromFolderL( KMsvGlobalOutBoxIndexEntryId, session, clientMtm, aOnlyCreatedWithCreator ) );
+    TRAP_IGNORE( DeleteAllFromFolderL( KMsvSentEntryId, session, clientMtm, aOnlyCreatedWithCreator ) );
+    
+    // reset must be done here, because iEntryIds is stored in destructor
+    iEntryIds.Reset();
+    
+    // all entries deleted, remove the Messages related registry
+    iEngine->RemoveStoreL( KUidDictionaryUidMessages );
+
+    CleanupStack::PopAndDestroy( clientMtm );
+    CleanupStack::PopAndDestroy( registry );
+    CleanupStack::PopAndDestroy( session );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::DeleteAllFromFolderL( const TMsvId aContext, 
+                                             CMsvSession* aSession,
+                                             CSmsClientMtm* aClientMtm,
+                                             TBool aOnlyCreatedWithCreator )
+    {
+    LOGSTRING("Creator: CCreatorMessages::DeleteAllFromFolderL");
+    
+    TMsvSelectionOrdering sort;
+    sort.SetShowInvisibleEntries( ETrue );
+
+    CMsvEntry* inboxContext = CMsvEntry::NewL( *aSession, aContext, sort );
+    CleanupStack::PushL( inboxContext );
+
+    CMsvEntrySelection* entries = inboxContext->ChildrenL();
+    CleanupStack::PushL( entries );
+
+    TInt msgCount = entries->Count();
+    for ( TInt i = 0; i < entries->Count(); i++)
+        {
+        TMsvId entryID = entries->At(i);
+        aClientMtm->SwitchCurrentEntryL( entryID );
+
+        if ( !aOnlyCreatedWithCreator || iEntryIds.Find( entryID ) != KErrNotFound )
+            {
+            CMsvEntry* entry = aSession->GetEntryL( (*entries)[i] );
+            CleanupStack::PushL( entry );
+
+            entry->DeleteL( entries->At(i) );
+            CleanupStack::PopAndDestroy( entry );            
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( entries );
+    CleanupStack::PopAndDestroy( inboxContext );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorMessages::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorMessages::DeleteAllCreatedByCreatorL");
+    
+    iEntryIds.Reset();
+    
+    // fetch ids of entries created by Creator
+    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidMessages );
+    
+    // delete them
+    DeleteAllMessagesL( ETrue );
+    }
+
+CRecipientInfo::CRecipientInfo() 
+    {
+    
+    }
+
+CRecipientInfo::~CRecipientInfo()
+    {
+    delete iPhoneNumber;
+    delete iEmailAddress;
+    }
+
+void CRecipientInfo::SetPhoneNumber(HBufC* aPhone)
+    {
+    delete iPhoneNumber;    
+    iPhoneNumber = aPhone;    
+    }
+
+void CRecipientInfo::SetEmailAddress(HBufC* aEmail)
+    {
+    delete iEmailAddress;    
+    iEmailAddress = aEmail;    
+    }
+
+const HBufC* CRecipientInfo::PhoneNumber() const
+    {
+    return iPhoneNumber;
+    }
+
+const HBufC* CRecipientInfo::EmailAddress() const
+    {
+    return iEmailAddress;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_messageelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,475 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_messageelement.h"
+#include "creator_traces.h"
+#include "creator_message.h"
+
+using namespace creatormsg;
+
+/*
+ * 
+ */
+CCreatorMessageElement* CCreatorMessageElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorMessageElement* self = new (ELeave) CCreatorMessageElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorMessageElement::CCreatorMessageElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+/*
+ * Sets message type
+ */
+void CCreatorMessageElement::SetMessageTypeL(CMessagesParameters& aParameters, const TDesC& aMsgTypeStr ) const
+    {
+    if( CompareIgnoreCase(aMsgTypeStr, KSms) == 0 )
+        {
+        aParameters.iMessageType = ESMS;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KMms) == 0 )
+        {
+        aParameters.iMessageType = EMMS;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KAms) == 0 )
+        {
+        aParameters.iMessageType = EAMS;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KEmail) == 0 )
+        {
+        aParameters.iMessageType = EEmail;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KSmart) == 0 )
+        {
+        aParameters.iMessageType = ESmartMessage;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KIr) == 0 )
+        {
+        aParameters.iMessageType = EIrMessage;
+        }
+    else if( CompareIgnoreCase(aMsgTypeStr, KBt) == 0 )
+        {
+        aParameters.iMessageType = EBTMessage;
+        }
+    else
+        {
+        LOGSTRING2("ERROR in CCreatorMessageElement::SetMessageTypeL: Unknown message type: %S", &aMsgTypeStr);
+        User::Leave(KErrGeneral);
+        }
+    }
+/*
+ * Returns maximum length of the body text, when randomlength=max is used.
+ */
+TInt CCreatorMessageElement::GetMaxBodyLength( const TDesC& aMsgType ) const
+    {
+    TInt len = 0;
+    if( CompareIgnoreCase(aMsgType, KSms) == 0 )
+        {
+        len = 160;
+        }
+    else if( CompareIgnoreCase(aMsgType, KMms) == 0 )
+        {
+        len = 160;
+        }    
+    else if( CompareIgnoreCase(aMsgType, KEmail) == 0 )
+        {
+        len = 1024;
+        }
+    else
+        {
+        len = KUndef;
+        }
+    return len;
+    }
+/*
+ * Returns random body text length
+ */
+TInt CCreatorMessageElement::GetRandomBodyLengthL(const TDesC& aRandomLenStr, const TDesC& aMsgType ) const
+    {
+    TInt len = 0;
+    if( aRandomLenStr == KMax )
+        {
+        len = GetMaxBodyLength(aMsgType);
+        }
+    else if( aRandomLenStr == KDefault )
+        {
+        len = KUndef;        
+        }
+    else
+        {
+        len = ConvertStrToIntL(aRandomLenStr);
+        }
+    return len;
+    }
+
+/*
+ * Creates random message address (To/From)
+ * Returns phone number for SMS, MMS, AMS and Smart messages.
+ * Email address for others
+ */
+HBufC* CCreatorMessageElement::CreateMessageAddressLC(const TDesC& msgType)
+    {
+    HBufC* toAddr;
+    if( CompareIgnoreCase(msgType, KSms) == 0 || 
+        CompareIgnoreCase(msgType, KMms) == 0 || 
+        CompareIgnoreCase(msgType, KAms) == 0 || 
+        CompareIgnoreCase(msgType, KSmart) == 0)
+        {
+        TPtrC temp = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
+        toAddr = HBufC::NewL(temp.Length());
+        CleanupStack::PushL(toAddr);
+        toAddr->Des().Copy(temp);
+        }
+    else
+        {
+        toAddr = iEngine->CreateEmailAddressLC();
+        }
+    return toAddr;
+    }
+
+/*
+ *
+ */
+void CCreatorMessageElement::ExecuteCommandL()
+    {
+    LOGSTRING("Creator: CCreatorMessageElement::ExecuteCommandL");
+    
+    // Find out the message type:
+    const CCreatorScriptAttribute* msgTypeAttr = this->FindAttributeByName(KType);
+    TPtrC msgType;
+    if( msgTypeAttr )
+        {
+        msgType.Set(msgTypeAttr->Value());
+        }
+    else
+        {
+        LOGSTRING("ERROR in CCreatorMessageElement::ExecuteCommandL: Type attribute is missing.");
+        User::Leave(KErrGeneral); // type is required attribute
+        }
+    
+    // Find out the amount of calendar entries:
+    const CCreatorScriptAttribute* msgAmountAttr = this->FindAttributeByName(KAmount);
+    TInt msgAmount = 1;    
+    if( msgAmountAttr )
+        {
+        msgAmount = ConvertStrToIntL(msgAmountAttr->Value());
+        }    
+    
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
+        {
+        // Get sub-elements (i.e the message field elements)
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
+        
+        // Create message entries, the amount of entries is defined by msgAmount:
+        for( TInt cI = 0; cI < msgAmount; ++cI )
+            {
+            CMessagesParameters* param = new (ELeave) CMessagesParameters;
+            CleanupStack::PushL(param);
+            
+            // Message type:
+            if( msgTypeAttr )
+                {
+                SetMessageTypeL(*param, msgTypeAttr->Value());
+                }           
+            
+            // Loop all the message field elements:
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+                const RPointerArray<CCreatorScriptElement>& contactReferences = field->SubElements();
+                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName(KRandomLength);
+                const CCreatorScriptAttribute* amountAttr = field->FindAttributeByName(KAmount);
+                const CCreatorScriptAttribute* increaseAttr = field->FindAttributeByName(KIncrease);
+                TBool increase( EFalse );
+                if ( increaseAttr )
+                    {
+                    increase = ConvertStrToBooleanL( increaseAttr->Value() );
+                    }
+                TInt fieldAmount = 1;
+                if( amountAttr )
+                    {
+                    fieldAmount = ConvertStrToIntL(amountAttr->Value());
+                    }               
+                
+                if( elemName == KTo )
+                    {
+                    // Recipient ('to'-field)
+                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
+                        {
+                        if( (randomAttr || elemContent.Length() == 0 ) && contactReferences.Count() == 0 )
+                            {                        
+                            // Random content
+                            HBufC* toAddr = CreateMessageAddressLC(msgType);
+                            if( toAddr )
+                                {
+                                param->iRecipientAddressArray.AppendL(toAddr);
+                                CleanupStack::Pop(); // toAddr
+                                }
+                            }
+                        else
+                            {                            
+                            if( elemContent.Length() > 0 && contactReferences.Count() == 0)
+                                {
+                                // Explicit recipient given
+                                HBufC* recipient = HBufC::NewL( elemContent.Length() + 3 );
+                                CleanupStack::PushL(recipient);
+                                if ( increase )
+                                    {
+                                    IncreasePhoneNumL( elemContent, cI, recipient );
+                                    }
+                                else
+                                    {
+                                    recipient->Des().Copy(elemContent);
+                                    }
+                                param->iRecipientAddressArray.AppendL(recipient);
+                                CleanupStack::Pop(); // recipient
+                                }
+                            else
+                                {
+                                // Recipients specified with contact-set-references (if any)
+                                for( TInt csI = 0; csI < contactReferences.Count(); ++csI )
+                                    {                            
+                                    CCreatorScriptElement* contactSetRef = contactReferences[csI];
+                                    AppendContactSetReferenceL(*contactSetRef, param->iRecipientLinkIds);                                
+                                    }
+                                }
+                            }
+                        }
+                    }
+                else if( elemName == KFrom )
+                    {
+                    // Sender ('from'-field)
+                    // Amount attribute for sender is ignored, because there can be only one sender                 
+                    delete param->iSenderAddress;
+                    param->iSenderAddress = 0;
+                    if( (randomAttr || elemContent.Length() == 0 ) && contactReferences.Count() == 0 )
+                        {
+                        // Get random address
+                        param->iSenderAddress = CreateMessageAddressLC(msgType);
+                        CleanupStack::Pop(); // param->iSenderAddress
+                        }
+                    else
+                        {                        
+                        if( elemContent.Length() > 0 && contactReferences.Count() == 0)
+                            {
+                            // Explicit sender address given
+                            param->iSenderAddress = HBufC::NewL(elemContent.Length());
+                            if ( increase )
+                                {
+                                IncreasePhoneNumL( elemContent, cI, param->iSenderAddress );
+                                }
+                            else
+                                {
+                                param->iSenderAddress->Des().Copy(elemContent);
+                                }
+                            }
+                        else
+                            {
+                            // Senders specified with contact-set-references (if any)
+                            for( TInt csI = 0; csI < contactReferences.Count(); ++csI )
+                                {                            
+                                CCreatorScriptElement* contactSetRef = contactReferences[csI];
+                                AppendContactSetReferenceL(*contactSetRef, param->iSenderLinkIds);                                
+                                }
+                            }                           
+                        }
+                    }
+                else if( elemName == KFolder )              
+                    {
+                    // Folder type
+                    if( CompareIgnoreCase(elemContent, KSent) == 0 )
+                        {
+                        param->iFolderType = ESent;
+                        }
+                    else if( CompareIgnoreCase(elemContent, KInbox) == 0 )
+                        {
+                        param->iFolderType = EInbox;
+                        }
+                    else if( CompareIgnoreCase(elemContent, KOutbox) == 0 )
+                        {
+                        param->iFolderType = EOutbox;
+                        }
+                    else if( CompareIgnoreCase(elemContent, KDraft) == 0 )
+                        {
+                        param->iFolderType = EDrafts;
+                        }                        
+                    }
+                else if( elemName == KSubject )
+                    {
+                    // Message subject
+                    delete param->iMessageSubject;
+                    param->iMessageSubject = 0;
+                    
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        // Random data should be used
+                        TPtrC temp = iEngine->RandomString(CCreatorEngine::EMessageSubject);
+                        param->iMessageSubject = HBufC::NewL(temp.Length());
+                        param->iMessageSubject->Des().Copy(temp);
+                        }
+                    else
+                        {                        
+                        param->iMessageSubject = HBufC::NewL(elemContent.Length());
+                        param->iMessageSubject->Des().Copy(elemContent);
+                        }
+                    }
+                else if( elemName == KText )
+                    {
+                    // Body text
+                    delete param->iMessageBodyText;
+                    param->iMessageBodyText = 0;
+                    
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        // Put random text:
+                        if( randomAttr && randomAttr->Value() != KDefault )
+                            {
+                            // Get the random length
+                            TInt len = GetRandomBodyLengthL(randomAttr->Value(), msgTypeAttr->Value());
+                            if( len != KUndef )
+                                {
+                                param->iMessageBodyText = iEngine->CreateRandomStringLC(len);
+                                CleanupStack::Pop(); // param->iMessageBodyText
+                                }
+                            }
+                        else
+                            {
+                            // Use default random data
+                            TPtrC temp = iEngine->RandomString(CCreatorEngine::EMessageText);
+                            param->iMessageBodyText = HBufC::NewL(temp.Length());
+                            param->iMessageBodyText->Des().Copy(temp);
+                            }
+                        }
+                    else
+                        {
+                        param->iMessageBodyText = HBufC::NewL(elemContent.Length());
+                        param->iMessageBodyText->Des().Copy(elemContent);
+                        }
+                    }
+                else if( elemName == KAttachmentId )
+                    {
+                    // Attachment file id
+                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
+                        {                        
+                        if( randomAttr  || elemContent.Length() == 0)
+                            {
+                            //When type is AMS, attachement will be audio
+                            if(param->iMessageType == EAMS)
+                                {
+                                param->iAttachments->AppendL(CCreatorEngine::EMP3_250kB);
+                                }
+                            //Otherwise attachement can be any file
+                            else
+                                {
+                                //EJPEG_25kB is first (0) in the enum and LAST_FILE_ID is last in the enum, so real last item id is one before LAST_FILE_ID
+                                param->iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) );                                
+                                }
+                            }
+                        else
+                            {
+                            //When user has been set attechment by it self, we trust user selection (not validating value, e.g. if message is SMS and there is attachement)
+                            TInt id = iEngine->GetAttachmentIdL(elemContent);
+                            if( id != KUndef )
+                                {
+                                param->iAttachments->AppendL( id );
+                                }
+                            }
+                        }
+                    }
+                // Attachment file path handling 
+                //E.g. C:\data\others\DOC-20kB.doc
+                else if( elemName == KAttachmentPath )
+                    {
+                    // Attachment file id
+                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
+                        {
+                        //Path is random, getting one of the files (not even using path attribute, but id with random)
+                        if( randomAttr  || elemContent.Length() == 0)
+                            {
+                            //EJPEG_25kB is first (0) in the enum and LAST_FILE_ID is last in the enum, so real last item id is one before LAST_FILE_ID
+                            param->iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID -1) );
+                            }
+                        //Otherwise adding attachement path as it is to paths.
+                        else
+                            {
+                            //Adding Attachement file path
+                            HBufC* elemData = elemContent.AllocLC();
+                            param->iAttachmentPaths.AppendL( elemData );     
+                            CleanupStack::Pop(elemData);
+                            }
+                        }
+                    }
+                else if ( elemName == KStatus )
+                    {
+                    if( CompareIgnoreCase( elemContent, KNew ) == 0 )
+                        {
+                        param->iCreateAsUnread = ETrue;
+                        }
+                    else if( CompareIgnoreCase( elemContent, KRead ) == 0 )
+                        {
+                        param->iCreateAsUnread = EFalse;
+                        }
+                    }
+                }
+            iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMessagesViaScript, param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	for( TInt i = 0; i < msgAmount; ++i )
+    		{
+    		TInt randMsg = 0;
+    		if( msgType == KSms )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntrySMSInbox, ECmdCreateRandomEntrySMSSent);
+    		else if( msgType == KMms )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryMMSInbox, ECmdCreateRandomEntryMMSSent);
+    		else if( msgType == KAms )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryAMSInbox, ECmdCreateRandomEntryAMSSent);
+    		else if( msgType == KEmail )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryEmailInbox, ECmdCreateRandomEntryEmailSent);
+    		else if( msgType == KSmart )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryBIOInbox, ECmdCreateRandomEntryBIOSent);
+    		else if( msgType == KBt )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryBTInbox, ECmdCreateRandomEntryBTSent);
+    		else if( msgType == KIr )
+    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryIRInbox, ECmdCreateRandomEntryIRSent);
+    			
+    		if( randMsg > 0 )
+    			{
+    			iEngine->AppendToCommandArrayL(randMsg, 0, 1);
+    			}
+    		}
+    	}
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_note.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+
+#include "creator_note.h" 
+#include "creator_traces.h"
+
+const TInt KCreatorDiskSpaceNeededForSingleDeletion( 8192 );
+_LIT( KCreatorNotepadFile, "c:Notepad.dat" );
+
+// @see \s60\app\organizer\notepad\notepad1\LibSrc\NpdCoreModel.cpp KSecureUid.Name()
+_LIT( KCreatorNotepadFormat, "SECURE[101F8878]" ); 
+_LIT( KCreatorNotepadDeleteAllSQL, "DELETE FROM Table1");
+
+//----------------------------------------------------------------------------
+
+CNotepadParameters::CNotepadParameters()
+    {
+    LOGSTRING("Creator: CNotepadParameters::CNotepadParameters");
+
+    iNoteText = HBufC::New(KNotepadFieldLength);
+    }
+
+CNotepadParameters::~CNotepadParameters()
+    {
+    LOGSTRING("Creator: CNotepadParameters::~CNotepadParameters");
+
+    delete iNoteText;
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorNotepad* CCreatorNotepad::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorNotepad* self = CCreatorNotepad::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorNotepad* CCreatorNotepad::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorNotepad* self = new (ELeave) CCreatorNotepad;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorNotepad::CCreatorNotepad() : iFs ( CEikonEnv::Static()->FsSession() )
+    {
+    }
+
+void CCreatorNotepad::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorNotepad::ConstructL");
+
+    iEngine = aEngine;
+
+    iNotepadApi = new NotesEditor();
+    //iNotepadApi = CNotepadApi::NewL();
+    }
+
+CCreatorNotepad::~CCreatorNotepad()
+    {
+    LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
+    
+    delete iNotepadApi;
+    
+    if (iParameters)
+        delete iParameters;
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorNotepad::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorNotepad::AskDataFromUserL");
+
+    if ( aCommand == ECmdDeleteNotes )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Notes?") );
+        }
+    
+    // By Creator not supported because 
+    // note id is not available via Notepad API
+
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"));
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorNotepad::CreateNoteEntryL(CNotepadParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorNotepad::CreateNoteEntryL");
+
+    // clear any existing parameter definations
+    delete iParameters;
+    iParameters = NULL;
+    
+    CNotepadParameters* parameters = aParameters;
+    
+    // random data needed if no predefined data available
+    if (!parameters)
+        {
+        iParameters = new(ELeave) CNotepadParameters;
+        parameters = iParameters;
+        parameters->iNoteText->Des() = iEngine->RandomString(CCreatorEngine::EMessageText);
+        }
+    
+    TInt err = KErrNone;
+
+    //iNotepadApi->AddContentL(parameters->iNoteText->Des());
+    QString textNote = QString::fromUtf16(parameters->iNoteText->Ptr(),parameters->iNoteText->Length());
+    iNotepadApi->edit(textNote);
+    iNotepadApi->close(NotesEditor::CloseWithSave);
+    
+    return err;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorNotepad::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorNotepad::DeleteAllL");
+    QList<AgendaEntry> ael;
+    AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
+
+    iAgendaUtil = new AgendaUtil();
+    ael = iAgendaUtil->fetchAllEntries(filter);
+    for(int i=0 ; i<ael.count() ; i++)
+    	{
+        iAgendaUtil->deleteEntry(ael[i].id());
+    	}
+    delete iAgendaUtil;
+    // Open Notes db
+ /*   RDbs dbs;
+    User::LeaveIfError( dbs.Connect() );
+    CleanupClosePushL( dbs );
+    RDbNamedDatabase db;
+    TInt openErr( db.Open( dbs, KCreatorNotepadFile, KCreatorNotepadFormat ) );
+    CleanupClosePushL( db );
+    
+    if ( openErr && openErr !=  KErrNotFound )
+        {
+        User::Leave( openErr );
+        }
+    
+    // do not leave if openErr == KErrNotFound, 
+    // it means there is no notes (file) created -> no need to delete
+    
+    if ( openErr !=  KErrNotFound )
+        {
+        TInt retval = iFs.ReserveDriveSpace( KDefaultDrive, KCreatorDiskSpaceNeededForSingleDeletion );
+        if ( retval == KErrNone )
+            {
+            retval = iFs.GetReserveAccess( KDefaultDrive );
+            }
+
+        // Delete all Notes. Ignore rowCount returnvalue
+        db.Execute( KCreatorNotepadDeleteAllSQL );            
+        
+        User::LeaveIfError( db.Compact() );
+        
+        if ( retval == KErrNone )
+            {
+            retval = iFs.ReleaseReserveAccess( KDefaultDrive );
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( &db );
+    CleanupStack::PopAndDestroy( &dbs );*/
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorNotepad::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorNotepad::DeleteAllCreatedByCreatorL");
+    // Not supported because note id is not available via Notepad API
+    User::Leave( KErrNotSupported );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_noteelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_noteelement.h"
+#include "creator_traces.h"
+#include "creator_note.h"
+
+using namespace creatornote;
+
+/*
+ * 
+ */
+CCreatorNoteElement* CCreatorNoteElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
+    {
+    CCreatorNoteElement* self = new (ELeave) CCreatorNoteElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop(self);
+    return self;
+    }
+/*
+ * 
+ */
+CCreatorNoteElement::CCreatorNoteElement(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    {
+    iIsCommandElement = ETrue;
+    }
+
+void CCreatorNoteElement::ExecuteCommandL()
+    {
+    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
+    TInt noteAmount = 1;    
+    if( amountAttr )
+        {
+        noteAmount = ConvertStrToIntL(amountAttr->Value());
+        }
+    // Get 'fields' element 
+    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
+    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
+        {
+        // Get sub-elements
+        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
+        // Create note entries, the amount of entries is defined by noteAmount:
+        for( TInt cI = 0; cI < noteAmount; ++cI )
+            {            
+            CNotepadParameters* param = new (ELeave) CNotepadParameters;
+            CleanupStack::PushL(param);
+            
+            for( TInt i = 0; i < fields.Count(); ++i )
+                {
+                CCreatorScriptElement* field = fields[i];
+                TPtrC elemName = field->Name();
+                TPtrC elemContent = field->Content();
+                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
+                TBool useMax = EFalse;
+                if( randomAttr && randomAttr->Value() == KMax )
+                    {
+                    useMax = ETrue;
+                    }
+                
+                if( elemName == KText )
+                    {
+                    if( randomAttr || elemContent.Length() == 0 )
+                        {
+                        if( useMax )
+                            {
+                            TDesC* temp = iEngine->CreateRandomStringLC(KNotepadFieldLength);                            
+                            SetContentToTextParamL(param->iNoteText, *temp);
+                            CleanupStack::PopAndDestroy(); // temp
+                            }
+                        else
+                            {
+                            SetContentToTextParamL(param->iNoteText, iEngine->RandomString(CCreatorEngine::EMessageText));
+                            }
+                        }
+                    else
+                        {
+                        SetContentToTextParamL(param->iNoteText, elemContent);
+                        }
+                    }
+                }
+            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryNotes, param);
+            CleanupStack::Pop(); // param
+            }
+        }
+    else
+    	{
+    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryNotes, 0, noteAmount);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_phonebook.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1055 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+
+#include "creator_phonebook.h" 
+#include "creator_traces.h"
+
+#include <bautils.h> 
+#include <qpixmap>
+
+//#include <QDebug>
+_LIT(KTempPath, "C:\\Data\\Creator\\");
+
+
+typedef struct {
+QString iDetail;
+QString iFieldContext;
+QString iFieldString;
+TInt iRandomType;
+} DetailFieldInfo;
+static const TInt RND_TYPE_UNDEF = -99;
+DetailFieldInfo CreatorPbkMiscTextFields[] = {        
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldFirstName).operator QString(), (TInt) CCreatorEngine::EFirstName},
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldLastName).operator QString(), (TInt) CCreatorEngine::ESurname},
+        { (QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldName).operator QString(), (TInt) CCreatorEngine::ECompany},
+        { (QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldTitle).operator QString(), (TInt) CCreatorEngine::EJobTitle},
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldPrefix).operator QString(), (TInt) CCreatorEngine::EPrefix},
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldSuffix).operator QString(), (TInt) CCreatorEngine::ESuffix},
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldMiddleName).operator QString(), (TInt) CCreatorEngine::EFirstName},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldStreet).operator QString(), (TInt) CCreatorEngine::EAddress},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldLocality).operator QString(), (TInt) CCreatorEngine::ECity},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldRegion).operator QString(), (TInt) CCreatorEngine::EState},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldPostcode).operator QString(), (TInt) CCreatorEngine::EPostcode},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldCountry).operator QString(), (TInt) CCreatorEngine::ECountry},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldStreet).operator QString(), (TInt) CCreatorEngine::EAddress},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldLocality).operator QString(), (TInt) CCreatorEngine::ECity},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldRegion).operator QString(), (TInt) CCreatorEngine::EState},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldPostcode).operator QString(), (TInt) CCreatorEngine::EPostcode},
+        { (QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldCountry).operator QString(), (TInt) CCreatorEngine::ECountry},
+        { (QContactPhoneNumber::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactPhoneNumber::SubTypeMobile).operator QString(), (TInt) CCreatorEngine::EPhoneNumber},
+        { (QContactPhoneNumber::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactPhoneNumber::SubTypeLandline).operator QString(), (TInt) CCreatorEngine::EPhoneNumber},
+        { (QContactNote::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactNote::FieldNote).operator QString(), (TInt)  CCreatorEngine::EMemoText},
+        { (QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldDepartment).operator QString(), (TInt) CCreatorEngine::ECompany},
+        { (QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldAssistantName).operator QString(), (TInt) CCreatorEngine::ECompany},
+        { (QContactFamily::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactFamily::FieldSpouse).operator QString(), (TInt) CCreatorEngine::EFirstName},
+        { (QContactFamily::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactFamily::FieldChildren).operator QString(), (TInt) CCreatorEngine::EFirstName},
+        { (QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(),  (QContactName::FieldCustomLabel).operator QString(), (TInt) CCreatorEngine::EFirstName}
+        };
+                  
+/*TInt CreatorVPbkBinaryFields[] = {
+        R_VPBK_FIELD_TYPE_CALLEROBJIMG//,
+        //R_VPBK_FIELD_TYPE_THUMBNAILPATH
+        };*/
+
+/*QString CreatorPbkDateTimeFields[] = {
+        QContactAnniversary::DefinitionName//R_VPBK_FIELD_TYPE_ANNIVERSARY
+        };*/
+
+//----------------------------------------------------------------------------
+
+/*
+typedef struct{
+QString iFieldContext;
+QString iFieldString;
+}PhoneNumInfo;
+PhoneNumInfo CreatorPhoneNumberFields[] =
+    {
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeLandline},
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeLandline},                        
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeMobile},
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeMobile},
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeFacsimile},
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeFacsimile},
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypePager },           
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeVideo },
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeVideo },
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeVoice },
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeVoice },
+    { QContactPhoneNumber::ContextWork, QContactPhoneNumber::SubTypeAssistant },
+    { QContactPhoneNumber::ContextHome, QContactPhoneNumber::SubTypeCar }
+    };
+
+*/
+typedef struct{
+QString iFieldContext;
+QString iFieldString;
+}PhoneNumInfo;
+PhoneNumInfo CreatorPhoneNumberFields[] =
+    {
+    { "Home", "Landline"},
+    { "Work", "Landline"},                        
+    { "Home","Mobile"},
+    { "Work", "Mobile"},
+    { "Home", "Facsimile"},
+    { "Work", "Facsimile"},
+    { "Work", "Pager"},
+    { "Home", "Video"},
+    { "Work", "Video"},   //{ "Home", "Voice" },//{ "Work", "Voice" },
+    { "Work", "Assistant" },
+    { "Home",  "Car" }
+    };
+
+
+/*QString CCreatorPhonebook::iPhoneNumberFields[] =
+    {
+    {QContactPhoneNumber::SubTypeLandline},
+    {QContactPhoneNumber::SubTypeMobile},
+    {QContactPhoneNumber::SubTypeFacsimile},
+    {QContactPhoneNumber::SubTypePager},           
+    {QContactPhoneNumber::SubTypeVideo},
+    {QContactPhoneNumber::SubTypeVoice} ,
+    {QContactPhoneNumber::SubTypeAssistant},
+    {QContactPhoneNumber::SubTypeCar} 
+    };
+*/
+/*
+QStringList CreatorPbkContextFields =
+    {
+    QContactDetail::ContextHome,
+    QContactDetail::ContextWork
+    };
+*/
+QString CreatorPbkEmailFields[] =
+    {
+    //R_VPBK_FIELD_TYPE_EMAILGEN,
+    (QContactDetail::ContextHome).operator QString(),//"Home",//R_VPBK_FIELD_TYPE_EMAILHOME,
+    (QContactDetail::ContextWork).operator QString()//R_VPBK_FIELD_TYPE_EMAILWORK
+    };
+
+
+CPhonebookParameters::CPhonebookParameters()
+    {
+    LOGSTRING("Creator: CVirtualPhonebookParameters::CVirtualPhonebookParameters");
+    //iGroupName = HBufC::New(KPhonebookFieldLength);  
+    }
+
+CPhonebookParameters::~CPhonebookParameters()
+    {
+    LOGSTRING("Creator: CVirtualPhonebookParameters::~CVirtualPhonebookParameters");
+
+    //delete iGroupName;   
+    //iContactFields.ResetAndDestroy();
+    //iContactFields.Close();
+    
+    //iLinkIds.clear();
+    iLinkIds.Reset();
+    iLinkIds.Close();
+    }
+
+void CPhonebookParameters::ParseL(CCommandParser* /*parser*/, TParseParams /*aCase = 0*/)
+	{
+	}
+
+TInt CPhonebookParameters::ScriptLinkId() const
+    {
+    return iLinkId;
+    }
+
+void CPhonebookParameters::SetScriptLinkId(TInt aLinkId)
+    {
+    iLinkId = aLinkId;
+    }
+
+
+//----------------------------------------------------------------------------
+
+CCreatorPhonebook* CCreatorPhonebook::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorPhonebook* self = CCreatorPhonebook::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorPhonebook* CCreatorPhonebook::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorPhonebook* self = new (ELeave) CCreatorPhonebook();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+
+CCreatorPhonebook::CCreatorPhonebook() 
+    {
+    iAddAllFields = EFalse;
+    }
+
+void CCreatorPhonebook::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::ConstructL");
+	
+	iEngine = aEngine;
+	
+	iContactMngr = new QContactManager("symbian");
+
+	SetDefaultParameters();
+    }
+	
+
+CCreatorPhonebook::~CCreatorPhonebook()
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::~CCreatorPhonebook");
+ 
+    if ( iContactsToDelete.Count() )
+    	{
+        TRAP_IGNORE( StoreLinksForDeleteL( iContactsToDelete, KUidDictionaryUidContacts ) );
+        }
+    if ( iContactGroupsToDelete.Count() )
+    	{
+        TRAP_IGNORE( StoreLinksForDeleteL( iContactGroupsToDelete, KUidDictionaryUidContactGroups ) );
+        }
+    
+	if( iContactMngr )
+		{
+		delete iContactMngr;
+		}
+    
+    if (iParameters)
+    	{
+        delete iParameters;
+    	}
+    }
+
+//----------------------------------------------------------------------------
+
+TBool CCreatorPhonebook::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::AskDataFromUserL");
+
+    TBool ret = CCreatorPhonebookBase::AskDataFromUserL(aCommand, aNumberOfEntries);
+   
+    if(ret && aCommand == ECmdCreatePhoneBookEntryContacts && !iDefaultFieldsSelected)    
+        {
+        iAddAllFields = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add all the other fields to contacts?"));
+        }
+    return ret;
+    }
+
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorPhonebook::CreateContactEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+	TInt err=0;	
+
+	InitializeContactParamsL();
+	bool success = false;
+	// create a new contact item
+	//iStore = new QContact();
+	
+	QContact iStore;
+	
+	int numberOfFields = iParameters->iContactFields.count();
+	QString phone;
+	for(int i=0; i< numberOfFields; i++ )
+		{
+		QContactDetail* cntdet = new QContactDetail(iParameters->iContactFields.at(i));
+		success = iStore.saveDetail( cntdet );
+		delete cntdet;		
+		}
+	
+	iContactMngr->saveContact( &iStore );
+	
+	iContactsToDelete.Append( (TUint32)iStore.localId() );
+	//delete iStore;
+    return err;
+    }
+
+
+//----------------------------------------------------------------------------
+
+
+
+//----------------------------------------------------------------------------
+
+void CCreatorPhonebook::DeleteAllL()
+    {
+	QList<QContactLocalId> contacts = iContactMngr->contactIds();
+	DeleteContactsL( contacts );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllCreatedByCreatorL");
+    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContacts );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DeleteAllGroupsL()
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsL");
+    
+    QList<QContactLocalId> contacts = iContactMngr->contactIds();
+    QList<QContactLocalId> groups;
+    for(int i = 0; i < contacts.count(); i++)
+    	{
+		QContact group = iContactMngr->contact( contacts.at(i) );
+		if( group.type() == QContactType::TypeGroup )
+			{
+			groups.append( group.localId() );
+			}
+    	}
+    DeleteContactsL( groups );
+/*  
+    User::LeaveIfNull( iStore );
+    MVPbkContactLinkArray* groups = iStore->ContactGroupsLC();
+    DeleteContactsL( groups, ETrue );
+    CleanupStack::PopAndDestroy(); // cannot use groups as parameter
+    */
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL");
+    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContactGroups );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DeleteContactsL( QList<QContactLocalId>& aContacts /*MVPbkContactLinkArray* aContacts, TBool aGroup*/ )
+    {
+	//QList<QContactLocalId> contacts = iContactMngr->contactIds();
+    QMap<int, QContactManager::Error> errorMap;
+	iContactMngr->removeContacts( &aContacts, &errorMap );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DeleteItemsCreatedWithCreatorL( TUid aStoreUid )
+    {
+	CDictionaryFileStore* store = iEngine->FileStoreLC();
+	       User::LeaveIfNull( store );
+	       
+	       QList<QContactLocalId> contacts;
+	       // backup previous contact links from store
+	       // otherwise they would be overwritten when calling out.WriteL
+	       TUint32 creatorLink;
+	       if ( store->IsPresentL( aStoreUid ) )
+	           {
+	           RDictionaryReadStream in;
+	           in.OpenLC( *store, aStoreUid );
+	           TRAP_IGNORE( 
+	               do{ 
+	                   creatorLink = in.ReadUint32L();
+	                   QContact contact = iContactMngr->contact( creatorLink );
+	                   if( (contact.type() == QContactType::TypeGroup && aStoreUid == KUidDictionaryUidContactGroups ) ||  (contact.type() != QContactType::TypeGroup && aStoreUid != KUidDictionaryUidContactGroups) )
+	                	   {
+						   contacts.append( creatorLink );
+	                	   }
+	               }while( creatorLink );)
+	           
+	           CleanupStack::PopAndDestroy(); // in
+	           }
+	       
+	       
+	       DeleteContactsL( contacts );
+	       
+	       store->Remove( aStoreUid );
+	       store->CommitL();
+	       
+	       CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore )
+    {
+    
+    }
+
+//----------------------------------------------------------------------------
+TBool CCreatorPhonebook::HasOtherThanGroupsL( /*MVPbkContactLinkArray* aContacts */)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::HasOtherThanGroupsL");
+    TBool result( EFalse );
+    return result;
+    }
+
+QContactDetail CCreatorPhonebook::CreateContactDetail(QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand )
+	{
+	QContactDetail contactDetail;
+	TPtrC contentData;
+	if( aDetail == QContactPhoneNumber::DefinitionName)
+		{
+		QContactPhoneNumber phoneNumber;// = contactDetail;
+		phoneNumber.setContexts(aFieldContext);
+		phoneNumber.setSubTypes(aFieldString);
+		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+		QString number = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+		phoneNumber.setNumber(number);
+		return phoneNumber;
+		}
+	else if( aDetail == QContactName::DefinitionName )			//--Contact NAME-----------------------------
+		{
+		QContactName contactName;
+		for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
+			{
+			if(iParameters->iContactFields.at(i).definitionName() == QContactName::DefinitionName )
+				{
+				contactName = iParameters->iContactFields.at(i);
+				}
+			}
+		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+		QString name = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+		if(aFieldString == QContactName::FieldFirstName)
+			{
+			if(contactName.firstName().isEmpty())
+				{
+				contactName.setFirstName( name );
+				}
+			}
+		else if(aFieldString == QContactName::FieldLastName)
+			{
+			if(contactName.lastName().isEmpty())
+				{
+				contactName.setLastName( name );
+				}
+			}
+		else if(aFieldString == QContactName::FieldMiddleName)
+			{
+			if(contactName.middleName().isEmpty())
+				{
+				contactName.setMiddleName( name );
+				}
+			}
+		else if(aFieldString == QContactName::FieldPrefix)
+			{
+			if(contactName.prefix().isEmpty())
+				{
+				contactName.setPrefix( name );
+				}
+			}
+		else if(aFieldString == QContactName::FieldSuffix)
+			{
+			if(contactName.suffix().isEmpty())
+				{
+				contactName.setSuffix( name );
+				}
+			}
+		else		//QContactName::FieldCustomLabel:
+			{
+			if(contactName.customLabel().isEmpty())
+				{
+				contactName.setCustomLabel( name );
+				}
+			}
+		return contactName;
+		}
+	else if( aDetail == QContactOrganization::DefinitionName )			//--Contact Company-----------------------------
+		{
+		QContactOrganization contactCompany;
+		
+		for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
+			{
+			if(iParameters->iContactFields.at(i).definitionName() == QContactOrganization::DefinitionName )
+				{
+				contactCompany = iParameters->iContactFields.at(i);
+				}
+			}
+		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+		QString company = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+		if(aFieldString == QContactOrganization::FieldName)
+			{
+			if(contactCompany.name().isEmpty())
+				{
+				contactCompany.setName( company );
+				}
+			}
+		if(aFieldString == QContactOrganization::FieldTitle)
+			{
+			if(contactCompany.title().isEmpty())
+				{
+				contactCompany.setTitle( company );
+				}
+			}
+		if(aFieldString == QContactOrganization::FieldDepartment)
+			{
+			//if(contactCompany.department().isEmpty())
+				//{
+				QStringList depList = contactCompany.department();
+				depList.append(company);
+				contactCompany.setDepartment(depList);
+				//}
+			}
+		if(aFieldString == QContactOrganization::FieldAssistantName)
+			{
+			if(contactCompany.assistantName().isEmpty())
+				{
+				contactCompany.setAssistantName( company );
+				}
+			}
+		return contactCompany;
+		}
+	else if( aDetail == QContactAddress::DefinitionName )			//--Contact Address-----------------------------
+			{
+			QContactAddress contactAddress;
+			
+			for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
+				{
+				if(iParameters->iContactFields.at(i).definitionName() == QContactAddress::DefinitionName && iParameters->iContactFields.at(i).value(QContactDetail::FieldContext) == aFieldContext )
+					{
+					contactAddress = iParameters->iContactFields.at(i);
+					}
+				}
+			
+			contactAddress.setContexts( aFieldContext );
+			
+			contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+			QString address = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+			if(aFieldString == QContactAddress::FieldStreet )
+				{
+				if( contactAddress.street().isEmpty() )
+					{
+					contactAddress.setStreet( address );
+					}
+				}
+			else if(aFieldString == QContactAddress::FieldLocality )
+				{
+				if( contactAddress.locality().isEmpty() )
+					{
+					contactAddress.setLocality( address );
+					}
+				}
+			else if(aFieldString == QContactAddress::FieldRegion )
+				{
+				if( contactAddress.region().isEmpty() )
+					{
+					contactAddress.setRegion( address );
+					}
+				}
+			else if(aFieldString == QContactAddress::FieldPostcode )
+				{
+				if( contactAddress.postcode().isEmpty() )
+					{
+					contactAddress.setPostcode( address );
+					}
+				}
+			else if(aFieldString == QContactAddress::FieldCountry )
+				{
+				if( contactAddress.country().isEmpty() )
+					{
+					contactAddress.setCountry( address );
+					}
+				}
+			else 
+				{
+				return contactDetail;
+				}
+			return contactAddress;
+			}
+	else if( aDetail == QContactNote::DefinitionName )			//--Contact Note-----------------------------
+				{
+				QContactNote contactNote;
+				contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+				QString note = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+				contactNote.setNote(note);
+				return contactNote;
+				}
+	else if( aDetail == QContactFamily::DefinitionName )			//--Contact Family-----------------------------
+				{
+				QContactFamily contactFamily;
+				
+				for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
+					{
+					if(iParameters->iContactFields.at(i).definitionName() == QContactFamily::DefinitionName && iParameters->iContactFields.at(i).value(QContactDetail::FieldContext) == aFieldContext )
+						{
+						contactFamily = iParameters->iContactFields.at(i);
+						}
+					}
+				contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
+				QString familyData = QString::fromUtf16(contentData.Ptr(),contentData.Length());
+				if(aFieldString == QContactFamily::FieldSpouse )
+					{
+					if( contactFamily.spouse().isEmpty() )
+						{
+						contactFamily.setSpouse( familyData );
+						}
+					}
+				if(aFieldString == QContactFamily::FieldChildren )
+					{
+						QStringList children = contactFamily.children();
+						children.append( familyData );
+						contactFamily.setChildren( children );
+					}
+				
+				return contactFamily;
+				}
+	
+	if( aDetail == QContactAvatar::DefinitionName)						//--Contact Picture-----------------------------
+			{
+			RFs& fs = CCoeEnv::Static()->FsSession();
+			QContactAvatar contactAvatar;
+			TBuf<KMaxFileName> srcPath;
+			iEngine->RandomPictureFileL(srcPath);
+			TBuf<KMaxFileName> destPath(KTempPath);
+						
+			if(!BaflUtils::FolderExists( fs, destPath ))
+				{
+				BaflUtils::EnsurePathExistsL( fs, destPath );
+				}
+			
+			TInt err=BaflUtils::CopyFile( fs, srcPath, destPath );
+
+			TParse temp;
+			temp.Set( srcPath,NULL,NULL );
+			destPath.Append(temp.NameAndExt());
+			
+			QString avatarFile = QString::fromUtf16( destPath.Ptr(),destPath.Length() );
+			
+			QPixmap avatarPix(avatarFile);
+
+			contactAvatar.setAvatar(avatarFile);
+            contactAvatar.setPixmap(avatarPix);
+
+			return contactAvatar;
+			}
+	if( aDetail == QContactAnniversary::DefinitionName)
+			{
+			QContactAnniversary contactAnniversary;
+			QDate date;
+			TTime datetime = iEngine->RandomDate( CCreatorEngine::EDateFuture );
+			date.setDate( datetime.DateTime().Year(),(int) (datetime.DateTime().Month()+1), datetime.DateTime().Day() );
+			//contactAnniversary.setEvent(QContactAnniversary::);
+			contactAnniversary.setOriginalDate( date );
+			return contactAnniversary;
+			}
+			
+
+
+	
+	
+	return contactDetail;
+	}
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+void CCreatorPhonebook::StoreLinksForDeleteL( RArray<TUint32>& aLinks, TUid aStoreUid )
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::StoreLinksForDeleteL");
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+       User::LeaveIfNull( store );
+       
+       // backup previous contact links from store
+       // otherwise they would be overwritten when calling out.WriteL
+       TUint32 previousLink;
+       if ( store->IsPresentL( aStoreUid ) )
+           {
+           RDictionaryReadStream in;
+           in.OpenLC( *store, aStoreUid );
+           bool r = false;
+           TRAP_IGNORE( 
+               do{ //iContactMngr->CreateLinksLC( in )) != NULL ) // will leave with KErrEof
+                   previousLink = in.ReadUint32L();
+                   iPreviousDeleteLinks.Append( previousLink );
+                   if(previousLink)
+                	   {
+					   r=true;
+                	   }
+                   else
+                	   {
+					   r=false;
+                	   }
+               }while(r==true); );
+           
+           CleanupStack::PopAndDestroy(); // in
+           }
+
+       RDictionaryWriteStream out;       
+       out.AssignLC( *store, aStoreUid );
+       
+       // restore previous links
+       for ( TInt i = 0; i < iPreviousDeleteLinks.Count(); i++ )
+           {
+           out.WriteUint32L( iPreviousDeleteLinks[i] );
+           //CleanupStack::PopAndDestroy(); // PackLC            
+           }
+       
+       // write new links
+       for(int i=0; i < aLinks.Count(); i++)
+    	   {
+		   //TUint32 localId = (TUint32) aLinks[i];
+		   //out.WriteUint32L( aLinks[i] );
+		   out.WriteUint32L( aLinks[i] );
+    	   }
+       out.CommitL();
+       //CleanupStack::PopAndDestroy(); // aLinks.PackLC
+       CleanupStack::PopAndDestroy(); // out
+       
+       store->CommitL();
+
+       CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+       
+//----------------------------------------------------------------------------
+/*TInt CCreatorPhonebook::iPhoneNumberFields[] =
+    {
+    R_VPBK_FIELD_TYPE_LANDPHONEGEN,
+    R_VPBK_FIELD_TYPE_LANDPHONEHOME,
+    R_VPBK_FIELD_TYPE_LANDPHONEWORK,                        
+    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEHOME,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEWORK,
+    R_VPBK_FIELD_TYPE_FAXNUMBERGEN,
+    R_VPBK_FIELD_TYPE_FAXNUMBERHOME,
+    R_VPBK_FIELD_TYPE_FAXNUMBERWORK,
+    R_VPBK_FIELD_TYPE_PAGERNUMBER,           
+    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERHOME,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERWORK,
+    R_VPBK_FIELD_TYPE_VOIPGEN,
+    R_VPBK_FIELD_TYPE_VOIPHOME,
+    R_VPBK_FIELD_TYPE_VOIPWORK,
+    R_VPBK_FIELD_TYPE_ASSTPHONE,
+    R_VPBK_FIELD_TYPE_CARPHONE
+    };*/
+
+/*TInt CCreatorPhonebook::iUrlFields[] =
+    {
+    R_VPBK_FIELD_TYPE_URLGEN,
+    R_VPBK_FIELD_TYPE_URLHOME,
+    R_VPBK_FIELD_TYPE_URLWORK
+    };*/
+
+/*TInt CCreatorPhonebook::iEmailFields[] =
+    {
+    R_VPBK_FIELD_TYPE_EMAILGEN,
+    R_VPBK_FIELD_TYPE_EMAILHOME,
+    R_VPBK_FIELD_TYPE_EMAILWORK
+    };*/
+
+void CCreatorPhonebook::InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::InitializeContactParamsL");        
+ 
+    iParameters = new (ELeave) CPhonebookParameters;
+           
+    iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
+    iParameters->iNumberOfURLFields = iNumberOfURLFields;
+    iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;       
+    
+        
+    QContactName name;
+    
+    TPtrC fname = iEngine->RandomString(CCreatorEngine::EFirstName);
+    TPtrC lname = iEngine->RandomString(CCreatorEngine::ESurname);
+    QString firstname = QString::fromUtf16( fname.Ptr(), fname.Length() ); 
+    QString lastname  = QString::fromUtf16( lname.Ptr(), lname.Length() );               
+    
+    name.setFirstName(firstname);
+    name.setLastName(lastname);
+    
+    if( iAddAllFields )
+        {
+		TInt textFieldCount = sizeof(CreatorPbkMiscTextFields) / sizeof(DetailFieldInfo);
+		for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
+                    { 
+    				QContactDetail field = CreateContactDetail( CreatorPbkMiscTextFields[tfIndex].iDetail, CreatorPbkMiscTextFields[tfIndex].iFieldContext, CreatorPbkMiscTextFields[tfIndex].iFieldString, CreatorPbkMiscTextFields[tfIndex].iRandomType );
+    				bool replace = false;
+                    for(int i = 0 ; i< iParameters->iContactFields.count() ; i++)
+                    	{
+						if( !field.isEmpty() && field.definitionName() == iParameters->iContactFields.at(i).definitionName() )
+							{
+							QString context = field.value(QContactDetail::FieldContext);
+							bool isContextEmpty = context.isEmpty();
+							if(  isContextEmpty ||  ( field.value(QContactDetail::FieldContext) == iParameters->iContactFields.at(i).value(QContactDetail::FieldContext)) )
+								{
+								//replace
+								iParameters->iContactFields.replace(i,field);
+								replace = true;
+								}
+							}
+                    	}
+						if(!replace)
+							{
+							if(!field.isEmpty())
+								{
+								iParameters->iContactFields.append(field);
+								}
+							}
+                    }
+		// Add binary fields:
+		QContactDetail field = CreateContactDetail(QContactAvatar::DefinitionName,"","",0);
+		iParameters->iContactFields.append(field);
+		
+		// Add date-time fields:
+		QContactDetail fieldAnniv = CreateContactDetail(QContactAnniversary::DefinitionName,"","",0);
+		iParameters->iContactFields.append(fieldAnniv);
+    //***************************************************************************
+    // Add text fields:
+ /*           TInt textFieldCount = sizeof(CreatorVPbkMiscTextFields) / sizeof(FieldInfo);
+            for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
+                { 
+				//QContactDetail field;
+                CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkMiscTextFields[tfIndex].iFieldCode, KNullDesC);
+                CleanupStack::PushL(field);
+                field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+                iParameters->iContactFields.AppendL(field);
+                CleanupStack::Pop(field);
+                }
+                
+            // Add binary fields:
+            TInt binFieldCount = sizeof(CreatorVPbkBinaryFields) / sizeof(TInt);
+            for( TInt bfIndex = 0; bfIndex < binFieldCount; ++bfIndex )
+                {                
+                CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkBinaryFields[bfIndex], KNullDesC8);
+                CleanupStack::PushL(field);
+                field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+                iParameters->iContactFields.AppendL(field);
+                CleanupStack::Pop(field);
+                }
+                
+            // Add date-time fields:
+            TInt dtFieldCount = sizeof(CreatorVPbkDateTimeFields) / sizeof(TInt);
+            for( TInt dtIndex = 0; dtIndex < dtFieldCount; ++dtIndex )
+                {
+                AddFieldToParamsL(CreatorVPbkDateTimeFields[dtIndex], iEngine->RandomDate(CCreatorEngine::EDateFuture));
+                }
+
+            AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJIMG, KNullDesC8);        
+            AddFieldToParamsL(R_VPBK_FIELD_TYPE_THUMBNAILPIC, KNullDesC8);        
+            AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJTEXT, firstname);*/
+    //***************************************************************************
+    
+		//iParameters->iContactFields.append( name );
+        }
+    else
+        {    
+		iParameters->iContactFields.append( name );
+        }
+                        
+      // Phone numbers:
+    TInt phoneFieldCount = sizeof(CreatorPhoneNumberFields) / sizeof(PhoneNumInfo);
+    
+    TInt inc=0;
+    for( int i=0; i<iNumberOfPhoneNumberFields; i++ )
+    	{
+    
+		if(inc >= phoneFieldCount )
+        	{
+    		inc = 0;
+        	}
+    
+		QContactPhoneNumber phoneNum;
+		TPtrC phoneNumber = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
+		QString phone = QString::fromUtf16( phoneNumber.Ptr(), phoneNumber.Length() );
+		
+		phoneNum.setContexts(CreatorPhoneNumberFields[inc].iFieldContext);
+		phoneNum.setSubTypes(CreatorPhoneNumberFields[inc].iFieldString);
+		
+
+		phoneNum.setNumber( phone );
+
+		iParameters->iContactFields.append( phoneNum );
+		inc++;
+    	}
+    
+    
+    
+    // URLs:
+    for( int i=0; i<iNumberOfURLFields; i++ )
+          	{
+			QContactUrl contactUrl;
+			HBufC16* url = iEngine->CreateHTTPUrlLC();
+			QString urlAddress = QString::fromUtf16(url->Ptr(), url->Length() );
+			contactUrl.setUrl( urlAddress );
+			iParameters->iContactFields.append( contactUrl );
+			CleanupStack::PopAndDestroy(url);
+          	}
+
+    // EMail addresses:
+    for( int i=0; i<iNumberOfEmailAddressFields; i++ )
+        	{
+			QContactEmailAddress emailAddr;
+			HBufC16* addr= iEngine->CreateEmailAddressLC();;
+			/*TPtrC comp = iEngine->RandomString(CCreatorEngine::ECompany);
+			QString company = QString::fromUtf16( comp.Ptr(), comp.Length() );
+    		QString address = firstname+"@"+company+".com";*/
+			//CreatorPbkEmailFields
+			QString address = QString::fromUtf16(addr->Ptr(), addr->Length() );
+    		emailAddr.setEmailAddress( address );
+    		emailAddr.setContexts(CreatorPbkEmailFields[i%2]);
+    		iParameters->iContactFields.append( emailAddr );
+    		CleanupStack::PopAndDestroy(addr);
+        	}
+    
+    }
+
+
+
+// Checks if the link is a group or not
+TBool CCreatorPhonebook::IsContactGroupL()
+	{
+	return EFalse;
+	}
+
+TInt CCreatorPhonebook::CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+	 LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateGroupEntryL");
+	    delete iParameters;
+	    iParameters = 0;
+	    
+	    CPhonebookParameters* parameters = (CPhonebookParameters*) aParameters;
+	    
+	    if( !parameters )
+	        {
+	        iParameters = new (ELeave) CPhonebookParameters;
+	        iParameters->iContactsInGroup = iContactsInGroup;
+	        TPtrC gname = iEngine->RandomString(CCreatorEngine::EGroupName);
+	        iParameters->iGroupName = QString::fromUtf16( gname.Ptr(),gname.Length() );
+	        iParameters->iGroupName += " #";
+	        int rnd = iEngine->RandomNumber(1000, 9999);
+	        iParameters->iGroupName += QString::number( rnd, 10 );
+	        parameters = iParameters;
+	        }
+
+	    TInt err = KErrNone;
+	 
+	    // create a new contact group
+	    QContact newGroup;
+	    newGroup.setType(QContactType::TypeGroup);
+        QContactName newGroupName;
+        newGroupName.setCustomLabel( iParameters->iGroupName );
+        newGroup.saveDetail(&newGroupName);
+        iContactMngr->saveContact(&newGroup);
+        QContactLocalId newGroupId = newGroup.localId();
+
+	        
+	    // define amounts of contacts to be added to the group
+	    TInt amountOfContactsToBeAdded = 0;
+	    if (parameters->iContactsInGroup == KCreateRandomAmountOfGroups)
+	    	{
+	        amountOfContactsToBeAdded = iEngine->RandomNumber(30);
+	    	}
+	    else 
+	    	{
+	        amountOfContactsToBeAdded = parameters->iContactsInGroup;
+	    	}
+	    
+	    if( parameters->iLinkIds.Count() > 0 )
+	        {
+	        for( TInt i = 0; i < parameters->iLinkIds.Count(); ++i )
+	            {/*
+	            const CCreatorContactSet& set = ContactLinkCache::Instance()->ContactSet(parameters->iLinkIds[i].iLinkId);
+	          
+	            const RPointerArray<MVPbkContactLink>& links = set.ContactLinks();
+	            TInt numberOfExplicitLinks = links.Count(); // Number of defined contacts in contact-set
+	            TInt numberOfExistingContacts = set.NumberOfExistingContacts(); // Number of existing contacts in contact-set
+	            TInt maxAmount = numberOfExplicitLinks + numberOfExistingContacts;
+	            
+	            if( parameters->iLinkIds[i].iLinkAmount > 0 )
+	                maxAmount = parameters->iLinkIds[i].iLinkAmount; // Max amount is limited
+	            
+	            TInt addedMembers = 0;
+	            
+	            for( TInt j = 0; j < links.Count() && addedMembers < maxAmount; ++j )
+	                {
+	                MVPbkContactLink* link = links[j]; 
+	                if( link && IsContactGroupL(*link) == EFalse )
+	                    {
+	                    TRAPD(err, newGroup->AddContactL(*link));
+	                    if( err != KErrAlreadyExists )
+	                    	{
+	                    	// Ignore "allready exists" -error
+	                    	User::LeaveIfError(err);
+	                    	++addedMembers;
+	                    	}                    
+	                    }
+	                }
+	            if( addedMembers < maxAmount )
+	            	{
+	            	// Add existing contacts, withing the limits set by maxAmount:
+	            	amountOfContactsToBeAdded += maxAmount - addedMembers;
+	            	}*/
+	            }
+	        }
+	    if( amountOfContactsToBeAdded > 0 )
+	        {
+			QList<QContactLocalId> contacts = iContactMngr->contactIds();
+			QContactRelationshipFilter rFilter;
+			rFilter.setRelationshipType(QContactRelationship::HasMember);
+			rFilter.setRelatedContactRole(QContactRelationshipFilter::First);
+			rFilter.setRelatedContactId( newGroup.id() );
+			
+			int cnt = 0;
+			for(int i=0; cnt < amountOfContactsToBeAdded && i < contacts.count() ; i++ )
+				{
+				QContact contact = iContactMngr->contact( iContactMngr->contactIds().at(i) );
+				if( iContactMngr->error() == QContactManager::DoesNotExistError )
+					{
+				
+					}
+				else
+					{
+					QList<QContactRelationship> relationships = contact.relationships(QContactRelationship::HasMember);
+					if(!relationships.count() && contact.type() == QContactType::TypeContact ) //just for contacts that are not in relationship - not in group yet
+						{
+						QContactRelationship* contactRel = new QContactRelationship();
+						contactRel->setRelationshipType(QContactRelationship::HasMember);
+						contactRel->setFirst(newGroup.id());
+						contactRel->setSecond(contact.id());
+						iContactMngr->saveRelationship( contactRel );
+						delete contactRel;
+						cnt++;
+						}
+					}
+				}
+			
+	       // group members and their count
+			QList<QContactLocalId> groupMemberIds = iContactMngr->contactIds( rFilter );
+			int testcnt = groupMemberIds.count(); 
+	    
+	   
+	        }
+	    
+	    // store the link to contact, so that Creator is able to delete
+	    // it when user requests deletion of contacts that were created with Creator 
+	    iContactGroupsToDelete.Append( (TUint32)newGroupId );
+	    
+	    return err;
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorPhonebook::CreateSubscribedContactEntryL(CCreatorModuleBaseParameters* /*aParameters*/)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::CreateSubscribedContactEntryL");
+
+    return KErrNotSupported;
+    }
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_phonebookbase.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_phonebookbase.h"
+#include "creator_traces.h"
+
+TBool CCreatorPhonebookBase::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::AskDataFromUserL");
+    
+    if( aCommand == ECmdDeleteContacts )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contacts?") );
+        }
+    if( aCommand == ECmdDeleteCreatorContacts )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contacts created with Creator?") ); 
+        }
+    if( aCommand == ECmdDeleteContactGroups )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contact groups?") );
+        }
+    if( aCommand == ECmdDeleteCreatorContactGroups )
+        {
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contact groups created with Creator?") ); 
+        }    
+    // display queries
+    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(aNumberOfEntries, _L("How many entries to create?"))) // ask number of entries to create
+        {
+        if (aCommand == ECmdCreatePhoneBookEntryContacts)
+            {
+            TInt index = 0;
+
+            //CAknListQueryDialog* dlg1 = new(ELeave) CAknListQueryDialog(&index);
+            if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Fields in contact"), R_CONTACT_CREATION_TYPE_QUERY, index))
+                {
+                if (index == 0) //first item
+                    {
+                    iDefaultFieldsSelected = ETrue;
+                    return ETrue;    
+                    }
+                else  // detailed mode selected
+                    {
+                    iDefaultFieldsSelected = EFalse;
+                    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(iNumberOfPhoneNumberFields, _L("Amount of phone number fields in one contact?"), ETrue))
+                        {
+                        if (iEngine->GetEngineWrapper()->EntriesQueryDialog(iNumberOfURLFields, _L("Amount of URL fields in one contact?"), ETrue))
+                            {
+                            if (iEngine->GetEngineWrapper()->EntriesQueryDialog(iNumberOfEmailAddressFields, _L("Amount of email fields in one contact?"), ETrue))
+                                {                                
+                                return ETrue;
+                                }
+                            else
+                                return EFalse;
+                            }
+                            else
+                                return EFalse;
+                        }
+                    else
+                        return EFalse;
+                    }
+                }
+            else
+                return EFalse;
+            }
+        else if (aCommand == ECmdCreatePhoneBookEntryGroups)
+            {
+            TInt index = 0;
+            //CAknListQueryDialog* dlg1 = new(ELeave) CAknListQueryDialog(&index);
+            if (iEngine->GetEngineWrapper()->ListQueryDialog(_L("Fields in contact"), R_GROUP_CREATION_TYPE_QUERY, index))
+                {
+                if (index == 0) //first item
+                    {
+                    iContactsInGroup = KCreateRandomAmountOfGroups;
+                    return ETrue;
+                    }
+                else
+                    {
+                    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(iContactsInGroup, _L("Amount of contacts in one group?"), ETrue))
+                        {
+                        return ETrue;
+                        }
+                    else
+                        return EFalse;
+                    }
+                }
+            else
+                return EFalse;
+            }
+        else 
+            return ETrue; 
+        }
+    else
+        return EFalse;
+    }
+
+
+void CCreatorPhonebookBase::SetDefaultParameters()
+    {
+    iNumberOfPhoneNumberFields = 1;
+    iNumberOfURLFields = 0;
+    iNumberOfEmailAddressFields = 0;
+    iContactsInGroup = 50;
+    iDefaultFieldsSelected = EFalse;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_randomdataparser.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <f32file.h>
+#include <utf.h>
+#include <xml/documentparameters.h>
+#include "creator_randomdataparser.h"
+#include "creator_traces.h"
+
+// XML element names
+_LIT(KRootElement, "creatordata");
+_LIT(KFirstName, "firstname");
+_LIT(KSurname, "surname");
+_LIT(KCompany, "company");
+_LIT(KAddress, "address");
+_LIT(KJobTitle, "jobtitle");
+_LIT(KPhoneNumber, "phonenumber");
+_LIT(KGroupName, "groupname");
+_LIT(KMeetingReason, "meetingreason");
+_LIT(KMeetingPlace, "meetingplace");
+_LIT(KMemoText, "memo");
+_LIT(KAnniversaryReason, "anniversary");
+_LIT(KToDoText, "todo");
+_LIT(KReminderText, "reminder");
+_LIT(KMessageSubject, "messagesubject");
+_LIT(KMessageText, "messagetext");
+_LIT(KCity, "city");
+_LIT(KCountry, "country");
+_LIT(KPostcode, "postcode");
+_LIT(KState, "state");
+_LIT(KPobox, "pobox");
+_LIT(KPrefix, "prefix");
+_LIT(KSuffix, "suffix");
+_LIT(KLandmarkName, "landmarkname");
+_LIT(KLandmarkDescription, "landmarkdescription");
+
+using namespace Xml;
+
+CCreatorRandomDataParser::CCreatorRandomDataParser() 
+    {        
+    }
+
+void CCreatorRandomDataParser::ConstructL()
+    {
+    LOGSTRING("Creator: CCreatorRandomDataParser::ConstructL");
+	iElementNameArray = new (ELeave) CDesCArrayFlat(32);
+	iElementNameArray->InsertL(EFirstName, KFirstName);
+	iElementNameArray->InsertL(ESurname, KSurname);
+	iElementNameArray->InsertL(ECompany, KCompany);
+	iElementNameArray->InsertL(EAddress, KAddress);
+	iElementNameArray->InsertL(EJobTitle, KJobTitle);
+	iElementNameArray->InsertL(EPhoneNumber, KPhoneNumber);
+	iElementNameArray->InsertL(EGroupName, KGroupName);
+	iElementNameArray->InsertL(EMeetingReason, KMeetingReason);
+	iElementNameArray->InsertL(EMeetingPlace, KMeetingPlace);
+	iElementNameArray->InsertL(EMemoText, KMemoText);
+	iElementNameArray->InsertL(EAnniversaryReason, KAnniversaryReason);
+	iElementNameArray->InsertL(EToDoText, KToDoText);
+	iElementNameArray->InsertL(EReminderText, KReminderText);
+	iElementNameArray->InsertL(EMessageSubject, KMessageSubject);
+	iElementNameArray->InsertL(EMessageText, KMessageText);
+	iElementNameArray->InsertL(ECity, KCity);
+	iElementNameArray->InsertL(ECountry, KCountry);
+	iElementNameArray->InsertL(EPostcode, KPostcode);
+	iElementNameArray->InsertL(EState, KState);
+	iElementNameArray->InsertL(EPobox, KPobox);
+	iElementNameArray->InsertL(EPrefix, KPrefix);
+	iElementNameArray->InsertL(ESuffix, KSuffix);
+	iElementNameArray->InsertL(ELandmarkName, KLandmarkName);
+	iElementNameArray->InsertL(ELandmarkDescription, KLandmarkDescription);
+	iContentData = HBufC::NewL(16);
+    iResultArray = new (ELeave) CDesCArrayFlat(16);
+    }
+
+CCreatorRandomDataParser* CCreatorRandomDataParser::NewL()
+    {
+    LOGSTRING("Creator: CCreatorRandomDataParser::NewL");
+    CCreatorRandomDataParser* self = CCreatorRandomDataParser::NewLC();    
+    CleanupStack::Pop();
+    return self;
+    }
+
+CCreatorRandomDataParser* CCreatorRandomDataParser::NewLC()
+    {
+    LOGSTRING("Creator: CCreatorRandomDataParser::NewLC");
+    CCreatorRandomDataParser* self = new (ELeave) CCreatorRandomDataParser;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CCreatorRandomDataParser::~CCreatorRandomDataParser()
+    {
+    delete iParser;
+    delete iResultArray;
+    delete iContentData;
+    delete iElementNameArray;
+    }
+
+void CCreatorRandomDataParser::GetTextFileMode(RFile& aFile, TInt& aFileSize) 
+    { 
+    LOGSTRING("Creator: CCreatorRandomDataParser::GetTextFileMode");
+    iScriptTextFormat = EFormatANSIASCII; 
+
+    // if we are working with text files, check the type first   
+    TBuf8<4> BOM; 
+
+    // first check for UTF-16 
+    if (aFileSize >= 2 && aFile.Read(0, BOM, 2) == KErrNone) 
+        { 
+        if (BOM.Length()==2 && BOM[0]==0xFF && BOM[1]==0xFE) 
+            { 
+            iScriptTextFormat = EFormatUTF16LE; 
+            aFileSize -= 2; 
+            return; 
+            } 
+        else if (BOM.Length()==2 && BOM[0]==0xFE && BOM[1]==0xFF) 
+            { 
+            iScriptTextFormat = EFormatUTF16BE; 
+            aFileSize -= 2; 
+            return;                 
+            }       
+        }
+        // then check for UTF-8 
+    if (aFileSize >= 3 && aFile.Read(0, BOM, 3) == KErrNone) 
+        { 
+        if (BOM.Length()==3 && BOM[0]==0xEF && BOM[1]==0xBB && BOM[2]==0xBF) 
+            { 
+            iScriptTextFormat = EFormatUTF8; 
+            aFileSize -= 3; 
+            return; 
+            } 
+        }
+        
+    // none of those, seek back to beginning 
+    TInt pos(0); 
+    aFile.Seek(ESeekStart, pos); 
+    }    
+ 
+
+
+CDesCArrayFlat* CCreatorRandomDataParser::ParseL(const TDesC& aFileName, const TRandomDataType aDataType)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::ParseL: %S", &aFileName);
+    
+    iDataType = aDataType;
+    
+    // Create and start XML-parser
+    if( iParser == 0)
+        {
+        _LIT8(KXmlMimeType, "text/xml");
+        iParser = CParser::NewL(KXmlMimeType, *this);        
+        }
+
+    RFs filesession;
+    CleanupClosePushL(filesession);
+    User::LeaveIfError( filesession.Connect() );
+    
+    iResultArray->Reset();
+    
+    Xml::ParseL(*iParser, filesession, aFileName);
+    
+    CleanupStack::PopAndDestroy(&filesession); // filesession 
+    
+    CDesCArrayFlat* tempArray = new (ELeave) CDesCArrayFlat(8);
+    CleanupStack::PushL(tempArray);
+    for (TInt i = 0; i < iResultArray->MdcaCount(); i++)
+    	{
+    	tempArray->AppendL(iResultArray->MdcaPoint(i));
+    	}
+    CleanupStack::Pop(tempArray);
+    return tempArray;
+    }
+
+void CCreatorRandomDataParser::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartDocumentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);    
+    iInsideRootElement = EFalse;
+	iContentParsingActive = EFalse;
+    }
+
+void CCreatorRandomDataParser::OnEndDocumentL(TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndDocumentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnStartPrefixMappingL(const RString& /*aPrefix*/, 
+                                                     const RString& /*aUri*/, 
+                                                     TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnProcessingInstructionL(const TDesC8& /*aTarget*/, 
+                                                        const TDesC8& /*aData*/, 
+                                                        TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorRandomDataParser::OnError(TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnError: %d", aErrorCode);
+    
+    iLastError = aErrorCode;
+    }
+
+TAny* CCreatorRandomDataParser::GetExtendedInterface(const TInt32 aUid)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::GetExtendedInterface (UID: %d)", aUid);
+    return this;
+    }
+
+void CCreatorRandomDataParser::OnStartElementL(const Xml::RTagInfo& aElement,
+                                               const Xml::RAttributeArray& /*aAttributes*/,
+                                               TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartElementL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+
+    const TDesC8& elementName8 = aElement.LocalName().DesC();        
+    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
+    if (iInsideRootElement || (elementName16->Des() == KRootElement))
+    	{
+    	iInsideRootElement = ETrue;
+    	}
+    if (iInsideRootElement && (elementName16->Des() == iElementNameArray->MdcaPoint(iDataType)))
+    	{
+        iContentParsingActive = ETrue;
+        iContentData->Des().Zero();
+    	}
+    CleanupStack::PopAndDestroy(elementName16);
+    }
+
+void CCreatorRandomDataParser::OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndElementL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+
+    const TDesC8& elementName8 = aElement.LocalName().DesC();
+    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
+    if (!iInsideRootElement || (elementName16->Des() == KRootElement))
+    	{
+    	iInsideRootElement = EFalse;
+    	}
+    CleanupStack::PopAndDestroy(elementName16);
+
+    if (iContentParsingActive)
+		{
+	    if (iContentData->Des().Length() > 0)
+	    	{
+	    	iResultArray->AppendL(*iContentData);
+	    	}
+        iContentParsingActive = EFalse;
+		}
+    }
+
+void CCreatorRandomDataParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorRandomDataParser::OnContentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    
+    if (iContentParsingActive)
+    	{
+        HBufC* data16 = Convert8BitTo16BitLC(aBytes);
+        TInt newLen = iContentData->Des().Length() + data16->Des().Length();
+        iContentData = iContentData->ReAllocL(newLen);
+        iContentData->Des().Append(*data16);
+        CleanupStack::PopAndDestroy(data16);
+    	}
+    }
+
+HBufC16* CCreatorRandomDataParser::Convert8BitTo16BitLC(const TDesC8& aInput) 
+    {     
+    LOGSTRING("Creator: CCreatorRandomDataParser::Convert8BitTo16BitLC");
+    HBufC16* output = NULL;
+    
+    output = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aInput);
+    
+    CleanupStack::PushL(output);
+    return output;          
+    } 
+
+TInt CCreatorRandomDataParser::GetError() const 
+	{
+    return iLastError;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_scriptelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,722 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_traces.h"
+#include "creator_scriptelement.h"
+#include <xml/documentparameters.h>
+#include <collate.h>
+#include <etel3rdparty.h> // KMaxTelNumberSize
+
+using namespace Xml;
+
+CCreatorScriptElementCache* CCreatorScriptElementCache::NewL()
+{
+    CCreatorScriptElementCache* self = new (ELeave) CCreatorScriptElementCache;
+    CleanupStack::PushL(self);
+    
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+CCreatorScriptElementCache::CCreatorScriptElementCache()
+    {
+    
+    }
+
+void CCreatorScriptElementCache::ConstructL()
+    {
+    
+    }
+ 
+CCreatorScriptElementCache::~CCreatorScriptElementCache()
+    {
+    iElementCache.Reset();
+    iElementCache.Close();
+    }
+    
+void CCreatorScriptElementCache::RemoveElements()
+    {
+    iElementCache.Reset();
+    }
+
+        
+void CCreatorScriptElementCache::AddElementL(CCreatorScriptElement* aElement)
+    {
+    iElementCache.AppendL(aElement);
+    }
+
+/**
+ * 
+ */
+CCreatorScriptAttribute* CCreatorScriptAttribute::NewLC(const TDesC& aName, const TDesC& aValue)
+    {
+    CCreatorScriptAttribute* self = new(ELeave) CCreatorScriptAttribute();
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aValue);
+    return self;
+    }
+
+CCreatorScriptAttribute* CCreatorScriptAttribute::NewL(const TDesC& aName, const TDesC& aValue)
+    {
+    CCreatorScriptAttribute* self = CCreatorScriptAttribute::NewLC(aName, aValue);
+    CleanupStack::Pop(); // self    
+    return self;
+    }
+
+CCreatorScriptAttribute::~CCreatorScriptAttribute()
+    {
+    delete iName;
+    delete iValue;
+    }
+    
+TPtrC CCreatorScriptAttribute::Name() const
+    {
+    return iName->Des();
+    }
+
+void CCreatorScriptAttribute::SetNameL(const TDesC& aName) 
+    {
+    if( iName )
+        {
+        delete iName;
+        iName = 0;
+        }    
+    iName = HBufC::NewL(aName.Length());
+    iName->Des() = aName; 
+    }       
+    
+TPtrC CCreatorScriptAttribute::Value() const
+    {
+    return iValue->Des();
+    }
+
+void CCreatorScriptAttribute::SetValueL(const TDesC& aValue)
+    {
+    if( iValue )
+        {
+        delete iValue;
+        iValue = 0;
+        }
+    iValue = HBufC::NewL(aValue.Length());
+    iValue->Des() = aValue; 
+    }   
+
+CCreatorScriptAttribute::CCreatorScriptAttribute()
+    {    
+    }
+
+void CCreatorScriptAttribute::ConstructL(const TDesC& aName, const TDesC& aValue)
+    {
+    SetNameL(aName);
+    SetValueL(aValue);
+    }
+
+/**
+ * CCreatorScriptElement
+ */
+
+CCreatorScriptElement* CCreatorScriptElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    CCreatorScriptElement* self = new (ELeave) CCreatorScriptElement(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+
+CCreatorScriptElement::~CCreatorScriptElement()
+    {
+    LOGSTRING("Creator: CCreatorScriptElement::~CCreatorScriptElement");
+    iSubElements.ResetAndDestroy();
+    iAttributes.ResetAndDestroy();
+    iSubElements.Close();
+    iAttributes.Close();
+    iParameters.Reset();
+    iParameters.Close();
+    delete iName;
+    delete iContent;
+    delete iContext;
+    }
+
+RPointerArray<CCreatorScriptElement> const& CCreatorScriptElement::SubElements() const
+    {
+    return iSubElements;
+    }
+
+RPointerArray<CCreatorScriptElement>& CCreatorScriptElement::SubElements()
+    {
+    return iSubElements;
+    }
+    
+CCreatorScriptElement* CCreatorScriptElement::SubElement(TInt aIndex)
+    {
+    return iSubElements[aIndex];
+    }
+
+CCreatorScriptElement* CCreatorScriptElement::FindSubElement(const TDesC& aName)
+    {
+    for( TInt i = 0; i < iSubElements.Count(); ++i )
+        {
+        if( iSubElements[i]->Name() == aName )
+            {
+            return iSubElements[i];
+            }            
+        }
+    return 0;
+    }
+    
+void CCreatorScriptElement::RemoveSubElements()
+    {
+    iSubElements.ResetAndDestroy();
+    }
+    
+void CCreatorScriptElement::RemoveSubElementL(TInt aIndex)
+    {
+    if( aIndex < iSubElements.Count())
+        {
+        delete iSubElements[aIndex];
+        iSubElements.Remove(aIndex);
+        }
+    else
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+    
+void CCreatorScriptElement::AddSubElementL(CCreatorScriptElement* aElem, TInt aIndex )
+    {
+    if( aIndex == -1 || aIndex == iSubElements.Count() )
+        {
+        iSubElements.AppendL(aElem);
+        }
+    else if( aIndex < iSubElements.Count())
+        {
+        iSubElements.Insert(aElem, aIndex);
+        }
+    else
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+  
+RPointerArray<CCreatorScriptAttribute> const& CCreatorScriptElement::Attributes() const
+    {
+    return iAttributes;
+    }
+
+        
+ CCreatorScriptAttribute* CCreatorScriptElement::Attribute(TInt aIndex)
+     {
+     return iAttributes[aIndex];
+     }
+    
+void CCreatorScriptElement::RemoveAttributes()
+    {
+    iAttributes.ResetAndDestroy();
+    }
+    
+ 
+void CCreatorScriptElement::RemoveAttributeL(TInt aIndex)
+    {
+    if( aIndex < iAttributes.Count())
+        {
+        delete iAttributes[aIndex];
+        iAttributes.Remove(aIndex);
+        }
+    else
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+ 
+void CCreatorScriptElement::AddAttributeL(CCreatorScriptAttribute* aAttribute, TInt aIndex )
+    {
+    if( aIndex == -1 || aIndex == iAttributes.Count() )
+        {
+        iAttributes.AppendL(aAttribute);
+        }
+    else if( aIndex < iAttributes.Count())
+        {
+        iAttributes.Insert(aAttribute, aIndex);        
+        }
+    else
+        {
+        User::Leave(KErrArgument);
+        }
+    }
+
+TPtrC CCreatorScriptElement::Name() const
+    {
+    if( iName )
+        return iName->Des();
+    return TPtrC();
+    }
+
+void CCreatorScriptElement::SetNameL(const TDesC& aName)
+    {
+    if( iName )
+        {
+        delete iName;
+        iName = 0;
+        }    
+    iName = HBufC::NewL(aName.Length());
+    iName->Des() = aName; 
+    }
+
+ 
+TPtrC CCreatorScriptElement::Content() const
+    {
+    if (iContent)
+        return iContent->Des();
+    return TPtrC();
+    }
+    
+void CCreatorScriptElement::SetContentL(const TDesC& aContent)
+    {
+    if( iContent )
+        {
+        delete iContent;
+        iContent = 0;
+        }    
+    iContent = HBufC::NewL(aContent.Length());
+    iContent->Des() = aContent;
+    }
+
+void CCreatorScriptElement::AppendContentL(const TDesC& aContent)
+    {
+    if( iContent == 0 )
+        {
+        SetContentL(aContent);
+        return;
+        }
+            
+    iContent = iContent->ReAllocL(iContent->Length() + aContent.Length() );
+    
+    TPtr ptr(iContent->Des());
+    ptr += aContent;
+    }
+
+TPtrC CCreatorScriptElement::Context() const
+    {
+    if( iContext )
+        return iContext->Des();
+    return TPtrC();
+    }
+    
+void CCreatorScriptElement::SetContextL(const TDesC& aContext)
+    {
+    if( iContext )
+        {
+        delete iContext;
+        iContext = 0;
+        }    
+    iContext = HBufC::NewL(aContext.Length());
+    iContext->Des() = aContext;
+    }
+
+const CCreatorScriptAttribute* CCreatorScriptElement::FindAttributeByName(const TDesC& aName) const
+    {
+    for( TInt i = 0; i < iAttributes.Count(); ++i )
+        {
+        CCreatorScriptAttribute* attr = iAttributes[i];
+        if( attr->Name() == aName )
+            {
+            return attr;
+            }
+        }
+    return 0;
+    }
+
+CCreatorScriptAttribute* CCreatorScriptElement::FindAttributeByName(const TDesC& aName)
+    {    
+    for( TInt i = 0; i < iAttributes.Count(); ++i )
+        {
+        CCreatorScriptAttribute* attr = iAttributes[i];
+        if( attr->Name() == aName )
+            {
+            return attr;
+            }
+        }
+    return 0;
+    }
+
+TBool CCreatorScriptElement::IsCacheNeeded()
+    {
+    _LIT(KIDAttrName, "id");
+    const CCreatorScriptAttribute* attr = FindAttributeByName(KIDAttrName);
+    return attr != 0;
+    }
+
+void CCreatorScriptElement::AddToCacheL(CCreatorScriptElementCache& aCache)
+    {
+    aCache.AddElementL(this);
+    }
+
+RPointerArray<CCreatorModuleBaseParameters>& CCreatorScriptElement::CommandParameters()
+    {
+    return iParameters;
+    }
+
+const RPointerArray<CCreatorModuleBaseParameters>& CCreatorScriptElement::CommandParameters() const
+    {
+    return iParameters;
+    }
+
+void CCreatorScriptElement::AddToCacheL()
+    {    
+    }
+
+TBool CCreatorScriptElement::IsCommandElement() const
+    {
+    return iIsCommandElement;
+    }
+
+void CCreatorScriptElement::ExecuteCommandL()
+    {
+    
+    }
+   
+TBool CCreatorScriptElement::IsRoot() const
+    {
+    _LIT(KRootName, "creatorscript");
+    if(iName->Des() == KRootName)
+        return ETrue;
+    return EFalse;
+    }
+
+CCreatorScriptElement::CCreatorScriptElement(CCreatorEngine* aEngine)
+: 
+iIsCommandElement(EFalse),
+iIsRoot(EFalse),
+iEngine(aEngine)
+    {}
+    
+void CCreatorScriptElement::ConstructL(const TDesC& aName, const TDesC& aContext)
+    {
+    SetNameL(aName);
+    SetContextL(aContext);
+    }
+    
+TBool CCreatorScriptElement::IsSubElementSupported(const CCreatorScriptElement& /*aElem*/) const
+    {
+    return ETrue;
+    }
+
+TBool CCreatorScriptElement::ConvertStrToBooleanL(const TDesC& aStr) const
+    {
+    TBool boolVal = EFalse;
+    _LIT(KYes, "yes");
+    _LIT(KTrue, "true");
+    if( CompareIgnoreCase(aStr, KYes) == 0 ||
+        CompareIgnoreCase(aStr, KTrue) == 0 )
+        {
+        boolVal = ETrue;
+        }    
+    return boolVal;
+    }
+
+TInt CCreatorScriptElement::ConvertStrToIntL(const TDesC& aStr) const
+    {
+    TInt intVal = 0;
+    TLex lex(aStr);
+    TInt errorCode=lex.Val(intVal);
+    User::LeaveIfError(errorCode);
+    return intVal;
+    }
+
+TUint CCreatorScriptElement::ConvertStrToUintL(const TDesC& aStr) const
+	{
+	TUint uintVal = 0;
+	TLex lex(aStr);
+	TInt errorCode=lex.Val(uintVal);
+	User::LeaveIfError(errorCode);
+	return uintVal;
+	}
+void CCreatorScriptElement::ConvertStrToReal64L(const TDesC& aStr, TReal64& aVal) const
+    {    
+    TLex lex(aStr);
+    TInt errorCode=lex.Val(aVal);
+    User::LeaveIfError(errorCode);    
+    }
+
+void CCreatorScriptElement::ConvertStrToReal32L(const TDesC& aStr, TReal32& aVal) const
+    {    
+    TLex lex(aStr);
+    TInt errorCode=lex.Val(aVal);
+    User::LeaveIfError(errorCode);    
+    }
+
+MCreatorRandomDataField::TRandomLengthType CCreatorScriptElement::ResolveRandomDataTypeL(const CCreatorScriptAttribute& aAttr, TInt& aRandomLen) const
+    {    
+    TPtrC attrVal = aAttr.Value();
+    if(attrVal == KMax )
+        return MCreatorRandomDataField::ERandomLengthMax;
+    if(attrVal == KDefault)
+        return MCreatorRandomDataField::ERandomLengthDefault;
+    
+    // Let's see if the value is numeric:
+    TInt val = 0;
+    TLex lex(attrVal);
+    TInt errorCode=lex.Val(val);
+    if( errorCode == KErrNone )   
+        {
+        aRandomLen = val;
+        return MCreatorRandomDataField::ERandomLengthExplicit;
+        }
+    return MCreatorRandomDataField::ERandomLengthUndefined;
+    }
+
+void CCreatorScriptElement::AppendContactSetReferenceL(
+        const CCreatorScriptElement& aContactSetRefElem, 
+        RArray<TLinkIdParam>& aLinkArray ) const
+        {
+        const TDesC& eName = aContactSetRefElem.Name();
+        if( eName != KContactSetRef )
+            return;
+        
+        const CCreatorScriptAttribute* linkIdAttr = aContactSetRefElem.FindAttributeByName(KId);
+        if( linkIdAttr )
+            {
+            TInt linkId = ConvertStrToIntL(linkIdAttr->Value());
+            if( linkId > 0 )
+                {
+                TLinkIdParam linkParams;
+                // Add contact-set-reference id to links
+                linkParams.iLinkId = linkId;
+                linkParams.iLinkAmount = KUndef; // undefined
+                // Resolve maxamount:
+                const CCreatorScriptAttribute* maxAmount = aContactSetRefElem.FindAttributeByName(KMaxAmount);
+                if( maxAmount )
+                    {                                
+                    TInt maxAmountVal = ConvertStrToIntL(maxAmount->Value());
+                    if( maxAmountVal > 0 )
+                        {
+                        linkParams.iLinkAmount = maxAmountVal;
+                        }
+                    }
+                aLinkArray.AppendL(linkParams);
+                }
+            }
+        }       
+
+TTime CCreatorScriptElement::ConvertToDateTimeL(const TDesC& aDtStr) const
+    {
+    _LIT(KDateFieldSeparator, "-");
+    _LIT(KTimeFieldSeparator, ":");    
+    _LIT(KDateTimeSeparator, "T");    
+    _LIT(KTimeSuffix, ".");
+    _LIT(KDateSuffix, ":");
+    // Format date-time string:
+    HBufC* formatted = HBufC::NewLC(aDtStr.Length());
+    formatted->Des().Copy(aDtStr);
+    
+    TBool hasTimePart = EFalse; 
+    TBool hasDateTimeSeparator = EFalse;
+    TInt pos = 0;
+    
+    // Date and month numbering starts from 0 in Symbian, so first
+    // we need to decrease the date and month by one. Script format is following:
+    // yyyy-mm-ddThh:mm:ss
+    // Remove also date field separators ('-')
+    while( (pos = formatted->Find(KDateFieldSeparator)) != KErrNotFound )
+        {
+        // decrease month or date by one
+        
+        // First char. Can be zero also:
+        TInt newValue = 0;
+        const TPtrC& char1 = formatted->Des().Mid(pos+1).Left(1);
+        newValue = 10 * ConvertStrToIntL(char1);
+        // Next char:
+        const TPtrC& char2 = formatted->Des().Mid(pos+2).Left(1);
+        newValue += ConvertStrToIntL(char2);
+       
+        if( newValue > 0 )
+            {
+            --newValue;
+            }
+        
+        _LIT(KTemp, "%d");
+        HBufC* formatBuf = KTemp().AllocLC();
+        HBufC* buf = 0;
+        if( newValue < 10 )
+            buf = HBufC::NewLC(1);            
+        else
+            buf = HBufC::NewLC(2);
+                        
+        TPtr temp(buf->Des());
+        temp.Format(*formatBuf, newValue);
+        if( newValue < 10 )
+            {
+            formatted->Des()[pos+1] = TChar('0');
+            formatted->Des()[pos+2] = buf->Des()[0];
+            }
+        else
+            {
+            formatted->Des()[pos+1] = buf->Des()[0];
+            formatted->Des()[pos+2] = buf->Des()[1];
+            }
+        // Finally, delete the '-' separator:
+        formatted->Des().Delete(pos, 1);        
+        CleanupStack::PopAndDestroy(2);
+        }
+    
+    while( (pos = formatted->Find(KTimeFieldSeparator)) != KErrNotFound )
+        {
+        formatted->Des().Delete(pos, 1);
+        hasTimePart = ETrue;
+        }
+    
+    // Replace 'T' with ':':
+    if( (pos = formatted->Find(KDateTimeSeparator)) != KErrNotFound )
+        {
+        formatted->Des().Replace(pos, 1, KDateSuffix);
+        hasDateTimeSeparator = ETrue;
+        }
+    
+    if( hasTimePart )
+        formatted->Des().Append(KTimeSuffix);
+    else if( !hasDateTimeSeparator )
+        formatted->Des().Append(KDateSuffix);
+    
+    
+    TTime ret;
+    ret.Set(*formatted);    
+    CleanupStack::PopAndDestroy(); // formatted
+    return ret;
+    }
+
+TInt CCreatorScriptElement::CompareIgnoreCase(const TDesC& aStr1, const TDesC& aStr2 ) const
+    {
+    // Get default collation method:
+    TCollationMethod defaultCollationMethod = *Mem::CollationMethodByIndex(0); 
+    
+    // Add ignore case flag:
+    defaultCollationMethod.iFlags |= TCollationMethod::EFoldCase;
+    
+    return aStr1.CompareF(aStr2);
+    }
+
+void CCreatorScriptElement::SetContentToTextParamL(HBufC*& aPtr, const TDesC& aContent )
+    {
+    delete aPtr;
+    aPtr = 0;
+    aPtr = HBufC::NewL(aContent.Length());
+    aPtr->Des().Copy(aContent);
+    }
+
+/**
+ * Increases phonenumber by aDelta.
+ */
+void CCreatorScriptElement::IncreasePhoneNumL( const TDesC& aOriginal, TInt aDelta, HBufC* aIncreased ) const
+    {
+    LOGSTRING("Creator: CCreatorMessageElement::IncreasePhoneNumL");
+    __ASSERT_ALWAYS( aDelta >= 0, User::Panic( _L("IncreasePhoneNumL"), KErrArgument ) );
+    
+    // special cases, that are handled:
+    // +9          -> +9, +10, +11...
+    // +3584098#99 -> +3584098#99, +3584098#100, +3584098#101...
+    // #           -> #0, #1, #2...
+    // 123#        -> 123#0, 123#1, 123#2... 
+    // 099         -> 099, 100, 101...
+    
+    // find out if there are any special characters, like # p or *, in the original number
+    TInt startIndex( aOriginal.Length() -1 );
+    while ( startIndex >= 0 && 
+            aOriginal[startIndex] >= '0' &&
+            aOriginal[startIndex] <= '9' )
+        {
+        startIndex--;
+        }
+    startIndex++;
+    
+    // append original head that may contain any non number characters 
+    aIncreased->Des().Append( aOriginal.Left( startIndex ) );
+    
+    TBuf<CTelephony::KMaxTelNumberSize> tailBuf;
+    if ( aOriginal.Length() > startIndex )
+        {
+        tailBuf.Copy( aOriginal.Right( aOriginal.Length() -startIndex ) );
+        }
+    
+    // parse the tail part of the original number
+    TInt64 intVal = 0;
+    if ( aOriginal.Length() > startIndex )
+        {
+        TLex lex( tailBuf );
+        User::LeaveIfError( lex.Val( intVal ) ); // this loses leading zeros
+        }
+    
+    // increase
+    intVal += aDelta;
+    
+    // restore leading zeros to tail, if any
+    TBuf<CTelephony::KMaxTelNumberSize> resultTailNoZeros;
+    resultTailNoZeros.AppendNum( intVal );
+    TInt tailLeadingZerosToRestore = tailBuf.Length() - resultTailNoZeros.Length();
+    for ( TInt i = 0; i < tailLeadingZerosToRestore; i++ )
+        {
+        aIncreased->Des().AppendNum( 0 );
+        }
+
+    // and finally, append the increased value as tail part of the result
+    aIncreased->Des().Append( resultTailNoZeros );    
+    }
+
+CCreatorScriptRoot* CCreatorScriptRoot::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    CCreatorScriptRoot* self = new (ELeave) CCreatorScriptRoot(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorScriptRoot::CCreatorScriptRoot(CCreatorEngine* aEngine)
+:
+CCreatorScriptElement(aEngine)
+    {
+    iIsRoot=ETrue;
+    }
+
+
+CCreatorCalendarElementBase* CCreatorCalendarElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    CCreatorCalendarElementBase* self = new (ELeave) CCreatorCalendarElementBase(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorCalendarElementBase::CCreatorCalendarElementBase(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    { }
+
+CCreatorMessageElementBase* CCreatorMessageElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
+    {
+    CCreatorMessageElementBase* self = new (ELeave) CCreatorMessageElementBase(aEngine);
+    CleanupStack::PushL(self);
+    self->ConstructL(aName, aContext);
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorMessageElementBase::CCreatorMessageElementBase(CCreatorEngine* aEngine) 
+: 
+CCreatorScriptElement(aEngine)
+    { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_scriptelementfactory.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_traces.h"
+#include "creator_scriptelementfactory.h"
+#include "creator_contactelement.h"
+#include "creator_calendarelement.h"
+#include "creator_messageelement.h"
+#include "creator_fileelement.h"
+#include "creator_browserelement.h"
+#include "creator_logelement.h"
+//#include "creator_noteelement.h"
+//#include "creator_impselement.h"
+#include "creator_landmarkelement.h"
+#include "creator_mailboxelement.h"
+#include "creator_connectionmethodelement.h"
+
+CCreatorScriptElement* TCreatorScriptElementFactory::CreateElementL(CCreatorEngine* aEngine, const TDesC& aElementName, const TDesC& aContext )
+    {   
+    LOGSTRING2("TCreatorScriptElementFactory::CreateElementL: %S", &aElementName);
+    
+    if( aContext.Length() >= KFields().Length() && 
+    	aContext.Right(KFields().Length()) == KFields)
+    	{
+    	// This is a field element under 'fields'.
+    	return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
+    	}    
+    else if( aElementName == creatorcontact::KContact )
+        {
+        return CCreatorContactElement::NewL(aEngine, aElementName, aContext);  
+        }
+    else if( aElementName == creatorcontact::KContactSet)
+        {
+        return CCreatorContactSetElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorcontact::KContactGroup )
+        {
+        return CCreatorContactGroupElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == KFields)
+        {
+        return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == KScript )
+        {
+        return CCreatorScriptRoot::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorcalendar::KCalendar )
+        {
+        return CCreatorCalendarElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatormsg::KMessage )
+        {
+        return CCreatorMessageElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorfile::KFile )
+        {
+        return CCreatorFileElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorbrowser::KBookmark ||
+            aElementName == creatorbrowser::KBookmarkFolder ||
+            aElementName == creatorbrowser::KSavedPage ||
+            aElementName == creatorbrowser::KSavedPageFolder )
+        {
+        return CCreatorBrowserElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorlog::KLog )
+        {
+        return CCreatorLogElement::NewL(aEngine, aElementName, aContext);
+        }
+/*
+    else if( aElementName == creatornote::KNote )
+        {
+        return CCreatorNoteElement::NewL(aEngine, aElementName, aContext);
+        }
+*/
+/*
+	#ifdef __PRESENCE
+    else if( aElementName == creatorimps::KImpsServer )
+        {
+        return CCreatorImpsServerElement::NewL(aEngine, aElementName, aContext);
+        }
+	#endif // __PRESENCE
+*/
+    else if( aElementName == creatorlandmark::KLandmark )
+        {
+        return CCreatorLandmarkElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatormailbox::Kmailbox )
+        {
+        return CCreatorMailboxElement::NewL(aEngine, aElementName, aContext);
+        }
+    else if( aElementName == creatorconnectionmethod::KCm )
+    	{
+    	return CCreatorConnectionMethodElement::NewL(aEngine, aElementName, aContext);
+    	}
+    else
+        {
+        return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
+        }       
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_scriptentry.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,736 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <aknlists.h> 
+#include <aknsskininstance.h>
+#include <data_caging_path_literals.hrh>
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_traces.h"
+#include "creator_factory.h"
+
+
+
+const TInt KReadBufSize = 8192;
+
+// Creator random data file filter
+_LIT(KRandomDataFileFilter, "*.creatordataxml");
+
+// ---------------------------------------------------------------------------
+
+
+CCommandParser* CCommandParser::NewL(CCreatorEngine* aEngine)
+    {
+    CCommandParser* self = CCommandParser::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCommandParser* CCommandParser::NewLC(CCreatorEngine* aEngine)
+    {
+    CCommandParser* self = new (ELeave) CCommandParser;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCommandParser::CCommandParser()
+	{
+	}
+
+void CCommandParser::ConstructL(CCreatorEngine* aEngine)
+	{
+    LOGSTRING("Creator: CCommandParser::ConstructL");
+
+    iEngine = aEngine;
+
+    iReadBuf = HBufC8::NewL(KReadBufSize);
+	}
+
+CCommandParser::~CCommandParser()
+	{
+    LOGSTRING("Creator: CCommandParser::~CCommandParser");
+
+    if (iSearchArray)
+        delete iSearchArray;
+
+    if (iReadBuf)
+        delete iReadBuf;
+	}
+
+
+// ---------------------------------------------------------------------------
+//#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+void CCommandParser::OpenScriptL() {}
+TBool CCommandParser::OpenScriptL(RFile& aScriptFile)
+    {    
+    LOGSTRING("Creator: CCommandParser::OpenScriptL");
+    TBool ret = EFalse;
+
+    // init the search array
+    iSearchArray = new(ELeave) CDesCArrayFlat(500);
+
+    // wait dialog
+	// TODO
+    //CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+    //waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
+    //TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
+
+
+    // search all the .creator files from the phone
+    TInt err;
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\")));
+
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\system\\apps\\Creator\\")));
+
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\data\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\data\\")));
+    
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\documents\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\documents\\")));
+
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\creator\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\creator\\")));
+    
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\scripts\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\scripts\\")));
+    
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\temp\\")));
+    
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\system\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\system\\temp\\")));
+
+    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\private\\20011383\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\private\\20011383\\")));
+
+    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\private\\1000484b\\")));
+
+
+    // remove the wait dialog
+	// TODO
+    //waitDialog->CancelNoteL(dialogId);
+    //CleanupStack::PopAndDestroy(); //waitDialog;
+
+
+    if ( iSearchArray->MdcaCount() > 0)
+        {
+        // create a file name array based on the iSearchArray
+        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount());
+        CleanupStack::PushL(fileNameArray);
+        
+        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
+            {
+            
+            TParse filename; // file name parser
+            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
+
+            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
+                {
+                TFileName nameMMC;
+                nameMMC.Append(filename.Name());
+                nameMMC.Append(_L("\t0"));        // MMC icon
+                fileNameArray->AppendL(nameMMC);
+                }
+            else
+                {
+                fileNameArray->AppendL(filename.Name());
+                }
+            }
+        CleanupStack::Pop(fileNameArray);
+
+
+		// create a popup list
+		int index = 0;
+		TBool result = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select script"), fileNameArray, index);
+        //CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
+        //CleanupStack::PushL(listBox);
+		
+        //CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
+        //CleanupStack::PushL(popupList);
+        //popupList->SetTitleL(_L("Select script"));
+        //listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
+        //listBox->CreateScrollBarFrameL( ETrue );
+        //listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+        //listBox->Model()->SetItemTextArray( fileNameArray );
+        //listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
+        //listBox->HandleItemAdditionL();
+
+
+        // define MMC icon 
+        //MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        //_LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
+        //CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
+        //listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
+
+        //TParse* fp = new(ELeave) TParse();
+        //fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
+        //TFileName resourceFileName( fp->FullName() );
+        //delete fp;
+
+        //CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
+        //    resourceFileName,
+        //    EMbmAknmemorycarduiQgn_indi_mmc_add,
+        //    EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
+        //CleanupStack::PushL( icon );
+        //iconArray->AppendL( icon );
+        //CleanupStack::Pop( icon );
+
+        // execute dialog
+        //TBool result; // = popupList->ExecuteLD();
+        //CleanupStack::Pop();  // popupList
+
+        if ( result ) 
+            {
+            // open the file for reading
+            //RFile file;
+			TRAPD(err, aScriptFile.Open(CEikonEnv::Static()->FsSession(), iSearchArray->MdcaPoint(index), EFileRead));
+            if( err != KErrNone)
+                {
+                aScriptFile.Close();
+                User::Leave(err);
+                }
+            ret = ETrue;
+            }
+        //CleanupStack::PopAndDestroy();  //listBox
+        }
+    else  // no scripts found from the search paths
+        {
+        iEngine->GetEngineWrapper()->ShowNote(_L("No scripts found"));
+        }
+
+    delete iSearchArray;
+    iSearchArray = NULL;
+    return ret;
+    }
+/*
+#else
+// ---------------------------------------------------------------------------
+void CCommandParser::OpenScriptL()
+    {
+    LOGSTRING("Creator: CCommandParser::OpenScriptL");
+
+    // init the search array
+    iSearchArray = new(ELeave) CDesCArrayFlat(500);
+
+    // wait dialog
+    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
+    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
+
+
+    // search all the .creator files from the phone
+    TInt err;
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\")));
+
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\system\\apps\\Creator\\")));
+
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\data\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\data\\")));
+    
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\documents\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\documents\\")));
+
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\creator\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\creator\\")));
+    
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\scripts\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\scripts\\")));
+    
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\temp\\")));
+    
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\system\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\system\\temp\\")));
+
+    TRAP(err, FindFiles(_L("*.creator"), _L("\\private\\101FA751\\")));
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\private\\101FA751\\")));
+
+    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\private\\1000484b\\")));
+
+
+    // remove the wait dialog
+    waitDialog->CancelNoteL(dialogId);
+    CleanupStack::PopAndDestroy(); //waitDialog;
+
+
+    if ( iSearchArray->MdcaCount() > 0)
+        {
+        // create a file name array based on the iSearchArray
+        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount());
+        CleanupStack::PushL(fileNameArray);
+        
+        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
+            {
+            
+            TParse filename; // file name parser
+            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
+
+            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
+                {
+                TFileName nameMMC;
+                nameMMC.Append(filename.Name());
+                nameMMC.Append(_L("\t0"));        // MMC icon
+                fileNameArray->AppendL(nameMMC);
+                }
+            else
+                {
+                fileNameArray->AppendL(filename.Name());
+                }
+            }
+        CleanupStack::Pop(fileNameArray);
+
+
+        // create a popup list
+        CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
+        CleanupStack::PushL(listBox);
+        CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
+        CleanupStack::PushL(popupList);
+        popupList->SetTitleL(_L("Select script"));
+        listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
+        listBox->CreateScrollBarFrameL( ETrue );
+        listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+        listBox->Model()->SetItemTextArray( fileNameArray );
+        listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
+        listBox->HandleItemAdditionL();
+
+
+        // define MMC icon 
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
+        CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
+        listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
+
+        TParse* fp = new(ELeave) TParse();
+        fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
+        TFileName resourceFileName( fp->FullName() );
+        delete fp;
+
+        CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
+            resourceFileName,
+            EMbmAknmemorycarduiQgn_indi_mmc_add,
+            EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
+        CleanupStack::PushL( icon );
+        iconArray->AppendL( icon );
+        CleanupStack::Pop( icon );
+
+
+        // execute dialog
+        TBool result = popupList->ExecuteLD();
+        CleanupStack::Pop();  // popupList
+
+        if ( result ) 
+            {
+            // open the file for reading
+            RFile file;
+            User::LeaveIfError(file.Open(CEikonEnv::Static()->FsSession(), iSearchArray->MdcaPoint(listBox->CurrentItemIndex()), EFileRead));
+            while (ReadLineFromFileL(file) == KErrNone)
+                {
+                iReadBuf->Des().Trim();  // delete leading and trailing white space
+
+                if (iReadBuf->Length() < 5)  // command too short, ignoring...
+                    {
+                    //CEikonEnv::Static()->InfoMsg(_L("Corrupted line"));
+                    }
+        
+                // check it's a valid line: first char is A-Z and the line ends to ';'
+                else if (iReadBuf->Des()[0] >= 'A' && iReadBuf->Des()[0] <= 'Z' && iReadBuf->Des()[iReadBuf->Length()-1] == ';')
+                    {
+                    // this line is valid -> parse the command
+                    ParseCommandFromDescriptorL();
+                    }
+                else
+                    {
+                    //CEikonEnv::Static()->InfoMsg(_L("Not a valid line"));
+                    }
+
+                }
+
+            file.Close();
+
+            // show a note if there were no valid commands in the script
+            if (iEngine->CommandArrayCount() == 0)
+                {
+                CAknInformationNote* note = new(ELeave) CAknInformationNote;
+                note->ExecuteLD(_L("No valid commands in this script"));
+                }
+
+            }
+
+        CleanupStack::PopAndDestroy();  //listBox
+        }
+    
+    else  // no scripts found from the search paths
+        {
+        CAknInformationNote* note = new (ELeave) CAknInformationNote;
+        note->ExecuteLD(_L("No scripts found"));
+        }
+
+
+    delete iSearchArray;
+    iSearchArray = NULL;
+
+    }
+#endif
+*/
+
+TBool CCommandParser::GetRandomDataFilenameL(TDes& aFilename)
+    {    
+    LOGSTRING("Creator: CCommandParser::GetRandomDataFilenameL");
+    TBool ret = EFalse;
+
+    // init the search array
+    if (iSearchArray)
+    	{
+    	delete iSearchArray;
+    	iSearchArray = NULL;
+    	}
+    iSearchArray = new(ELeave) CDesCArrayFlat(500);
+
+	/* TODO:
+    // wait dialog
+    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
+    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
+	*/
+
+
+    // search all the creator random data files from the phone
+    TInt err;
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\")));
+
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\system\\apps\\Creator\\")));
+
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\data\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\data\\")));
+    
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\documents\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\documents\\")));
+
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\creator\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\creator\\")));
+    
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\scripts\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\scripts\\")));
+    
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\temp\\")));
+    
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\system\\temp\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\system\\temp\\")));
+
+    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\private\\20011383\\")));
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\private\\20011383\\")));
+
+    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\private\\1000484b\\")));
+
+
+    // remove the wait dialog
+	// TODO
+    //waitDialog->CancelNoteL(dialogId);
+    //CleanupStack::PopAndDestroy(); //waitDialog;
+
+
+    if (iSearchArray->MdcaCount() > 0)
+        {
+        // create a file name array based on the iSearchArray
+        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount() + 1);
+        CleanupStack::PushL(fileNameArray);
+
+        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
+            {
+            
+            TParse filename; // file name parser
+            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
+
+            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
+                {
+                TFileName nameMMC;
+                nameMMC.Append(filename.Name());
+                nameMMC.Append(_L("\t0"));        // MMC icon
+                fileNameArray->AppendL(nameMMC);
+                }
+            else
+                {
+                fileNameArray->AppendL(filename.Name());
+                }
+            }
+
+        // add "default" (resource file) to list
+        fileNameArray->AppendL(_L("Default"));
+
+        CleanupStack::Pop(fileNameArray);
+
+        // create a popup list
+		int index = 0;
+		TBool result = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, index);
+        /*
+		CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
+        CleanupStack::PushL(listBox);
+        CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
+        CleanupStack::PushL(popupList);
+        popupList->SetTitleL(_L("Select random data file"));
+        listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
+        listBox->CreateScrollBarFrameL( ETrue );
+        listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+        listBox->Model()->SetItemTextArray( fileNameArray );
+        listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
+        listBox->HandleItemAdditionL();
+
+
+        // define MMC icon 
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
+        CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
+        listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
+
+        TParse* fp = new(ELeave) TParse();
+        fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
+        TFileName resourceFileName( fp->FullName() );
+        delete fp;
+
+        CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
+            resourceFileName,
+            EMbmAknmemorycarduiQgn_indi_mmc_add,
+            EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
+        CleanupStack::PushL( icon );
+        iconArray->AppendL( icon );
+        CleanupStack::Pop( icon );
+
+
+        // execute dialog
+        TBool result = popupList->ExecuteLD();
+        CleanupStack::Pop();  // popupList
+		*/
+        if ( result ) 
+            {
+            if (index == (fileNameArray->Count() - 1))
+            	{
+            	// "default" (resource file) selected
+            	aFilename.Copy(KNullDesC);
+            	}
+            else
+            	{
+            	// xml file selected
+            	aFilename.Copy(iSearchArray->MdcaPoint(index));
+            	}
+            ret = ETrue;
+            }
+        // CleanupStack::PopAndDestroy();  //listBox
+        }
+    else  // no random data files found from the search paths
+        {
+        iEngine->GetEngineWrapper()->ShowNote(_L("No random data files found"));
+        }
+
+    delete iSearchArray;
+    iSearchArray = NULL;
+    return ret;
+    }
+
+TInt CCommandParser::FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
+    {
+    return CreatorFileUtils::FindFilesRecursiveL(iSearchArray, aFileName, aPath);
+    }
+TInt CreatorFileUtils::FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath)
+	{
+    TInt err = KErrNone;
+    CDirScan* scan = CDirScan::NewLC(CEikonEnv::Static()->FsSession());
+    scan->SetScanDataL(aPath, KEntryAttDir, ESortNone);
+    CDir* dirEntries = NULL;
+
+    for(;;)
+        {
+        TRAP(err, scan->NextL(dirEntries));
+        if (!dirEntries  || (err!=KErrNone))
+            break;
+
+        for (TInt i=0; i<dirEntries->Count(); i++) 
+            {
+            TFileName path(scan->FullPath());
+            path.Append((*dirEntries)[i].iName);
+            path.Append(_L("\\"));
+            FindFiles(aFileArray, aFileName, path);
+            }
+        delete(dirEntries);
+        }
+
+    CleanupStack::PopAndDestroy(scan);
+    return err;
+    }
+
+TInt CreatorFileUtils::FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath)
+    {
+    TFindFile fileFinder(CEikonEnv::Static()->FsSession());
+    CDir* fileList; 
+    TInt err = fileFinder.FindWildByDir(aFileName, aPath, fileList);
+
+    while (err == KErrNone)
+        {
+        for (TInt i=0; i<fileList->Count(); i++)
+            {
+            TParse fullentry;
+            fullentry.Set((*fileList)[i].iName, &fileFinder.File(), NULL);
+            
+            TRAP(err, aFileArray->AppendL(fullentry.FullName())); 
+            }
+
+        delete fileList;
+        err = fileFinder.FindWild(fileList);
+        }
+    return err;
+    }
+// ---------------------------------------------------------------------------
+
+TInt CCommandParser::FindFiles(const TDesC& aFileName, const TDesC& aPath)
+    {
+    return CreatorFileUtils::FindFiles(iSearchArray, aFileName, aPath);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CCommandParser::ReadLineFromFileL(RFile& aInputFile)
+    {
+    LOGSTRING("Creator: CCommandParser::ReadLineFromFile");
+
+	_LIT8(KImcvCRLF, "\r\n");
+
+    TInt err = KErrNone;
+
+    //  Read into the buffer
+    HBufC8* tempLine = HBufC8::NewLC(KReadBufSize);
+    TPtr8 buffer = tempLine->Des();
+
+    // clear the targer
+    iReadBuf->Des().Copy(_L(""));
+
+    //  Get the current file position
+    TInt filePos = 0;
+    aInputFile.Seek(ESeekCurrent, filePos);
+
+    //  Read the buffer
+    err = aInputFile.Read(buffer);
+
+    //end of file?
+    TInt s = buffer.Length();
+    if  ( s == 0)
+        err = KErrEof;
+
+    if  (err == KErrNone)
+        {
+        //  Copy to the lfcr and then set the file pointer to the point after that
+        TInt pos = buffer.Find(KImcvCRLF);
+        if      ( pos != -1)
+            {
+            iReadBuf->Des().Justify(buffer, pos, ELeft, ' ');
+            filePos += (pos+2);
+
+            //  Set the file pointer back to after the lfcr
+            aInputFile.Seek(ESeekStart, filePos);
+            }
+        //  Else fill the whole buffer
+        else
+            {
+            iReadBuf->Des().Copy(buffer);
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // tempLine
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCommandParser::StrParserL(HBufC*& aDestinationBuf, TUint aToken)
+    {
+    // store old position
+	iParserOldPosition = iParserPosition;
+
+    // make sure we are not reading outside of buffer
+    if (iParserPosition >= iReadBuf->Length() - 1)
+        return;
+    
+    // read until asked token
+	do
+	    {
+	    iParserPosition++;
+	    }
+	while (iReadBuf->Des()[iParserPosition] != aToken && iParserPosition < iReadBuf->Des().Length()-1);
+	
+	// calculate length of the destination buffer
+	TInt bufferLength = iParserPosition-iParserOldPosition-1;
+	
+	// reset the destination buffer
+	if (aDestinationBuf)
+	    {
+        delete aDestinationBuf;
+        aDestinationBuf = NULL;
+	    }
+
+    // allocate memory for the destination buffer
+	aDestinationBuf = HBufC::NewL(bufferLength);
+
+	// copy data from the read buffer to the destination buffer
+    aDestinationBuf->Des().Copy(iReadBuf->Des().Mid(iParserOldPosition+1, bufferLength));
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCommandParser::StrParserL(HBufC8*& aDestinationBuf, TUint aToken)
+    {
+    // store old position
+	iParserOldPosition = iParserPosition;
+
+    // make sure we are not reading outside of buffer
+    if (iParserPosition >= iReadBuf->Length() - 1)
+        return;
+    
+    // read until asked token
+	do
+	    {
+	    iParserPosition++;
+	    }
+	while (iReadBuf->Des()[iParserPosition] != aToken && iParserPosition < iReadBuf->Des().Length()-1);
+	
+	// calculate length of the destination buffer
+	TInt bufferLength = iParserPosition-iParserOldPosition-1;
+	
+	// reset the destination buffer
+	if (aDestinationBuf)
+	    {
+        delete aDestinationBuf;
+        aDestinationBuf = NULL;
+	    }
+
+    // allocate memory for the destination buffer
+	aDestinationBuf = HBufC8::NewL(bufferLength);
+
+	// copy data from the read buffer to the destination buffer
+    aDestinationBuf->Des().Copy(iReadBuf->Des().Mid(iParserOldPosition+1, bufferLength));
+    }
+
+//----------------------------------------------------------------------------
+
+void CCommandParser::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
+    {
+    }
+
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_scriptparser.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <f32file.h>
+#include <utf.h>
+#include <xml/documentparameters.h>
+#include "creator_scriptparser.h"
+#include "creator_scriptelementfactory.h"
+#include "creator_traces.h"
+
+using namespace Xml;
+
+CCreatorScriptParser::CCreatorScriptParser() 
+: iDefaultElement(TCreatorScriptElementInfo(TCreatorScriptElementInfo::EStatusUndefined, 0))
+    {        
+    }
+void CCreatorScriptParser::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorScriptParser::ConstructL");
+    iEngine = aEngine;
+    }
+
+CCreatorScriptParser* CCreatorScriptParser::NewL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorScriptParser::NewL");
+    CCreatorScriptParser* self = CCreatorScriptParser::NewLC(aEngine);    
+    CleanupStack::Pop();
+    return self;
+    }
+CCreatorScriptParser* CCreatorScriptParser::NewLC(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorScriptParser::NewLC");
+    CCreatorScriptParser* self = new (ELeave) CCreatorScriptParser;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorScriptParser::~CCreatorScriptParser()
+    {
+    delete iParser;
+    if( iElementStack.Count() > 0 )
+        {
+        delete iElementStack[0].iElement;        
+        }
+    iElementStack.Reset();
+    iElementStack.Close();
+    }
+
+void CCreatorScriptParser::GetTextFileMode(RFile& aFile, TInt& aFileSize) 
+    { 
+    LOGSTRING("Creator: CCreatorScriptParser::GetTextFileMode");
+    iScriptTextFormat = EFormatANSIASCII; 
+
+    // if we are working with text files, check the type first   
+    TBuf8<4> BOM; 
+
+    // first check for UTF-16 
+    if (aFileSize >= 2 && aFile.Read(0, BOM, 2) == KErrNone) 
+        { 
+        if (BOM.Length()==2 && BOM[0]==0xFF && BOM[1]==0xFE) 
+            { 
+            iScriptTextFormat = EFormatUTF16LE; 
+            aFileSize -= 2; 
+            return; 
+            } 
+        else if (BOM.Length()==2 && BOM[0]==0xFE && BOM[1]==0xFF) 
+            { 
+            iScriptTextFormat = EFormatUTF16BE; 
+            aFileSize -= 2; 
+            return;                 
+            }       
+        }
+        // then check for UTF-8 
+    if (aFileSize >= 3 && aFile.Read(0, BOM, 3) == KErrNone) 
+        { 
+        if (BOM.Length()==3 && BOM[0]==0xEF && BOM[1]==0xBB && BOM[2]==0xBF) 
+            { 
+            iScriptTextFormat = EFormatUTF8; 
+            aFileSize -= 3; 
+            return; 
+            } 
+        }
+        
+    // none of those, seek back to beginning 
+    TInt pos(0); 
+    aFile.Seek(ESeekStart, pos); 
+    }    
+ 
+
+
+void CCreatorScriptParser::ParseL(const TDesC& aFileName)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::ParseL: %S", &aFileName);
+    // Create and start XML-parser
+    if( iParser == 0)
+        {
+        _LIT8(KXmlMimeType, "text/xml");
+        iParser = CParser::NewL(KXmlMimeType, *this);        
+        }
+
+    RFs filesession;
+    CleanupClosePushL(filesession);
+    User::LeaveIfError( filesession.Connect() );
+    Xml::ParseL(*iParser, filesession, aFileName);
+    
+    CleanupStack::PopAndDestroy(&filesession); // filesession    
+    }
+
+void CCreatorScriptParser::ParseL(RFile& aFile)
+    {
+    LOGSTRING("Creator: CCreatorScriptParser::ParseL");
+    TInt filesize = 0;
+    aFile.Size(filesize);
+    GetTextFileMode(aFile, filesize);
+    // Create and start XML-parser    
+    if( iParser == 0)
+        {
+        _LIT8(KXmlMimeType, "text/xml");
+        iParser = CParser::NewL(KXmlMimeType, *this);        
+        }
+    Xml::ParseL(*iParser, aFile);
+    }
+
+void CCreatorScriptParser::OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnStartDocumentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);    
+    const TDesC8& charSet = aDocParam.CharacterSetName().DesC();
+    }
+
+void CCreatorScriptParser::OnEndDocumentL(TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnEndDocumentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorScriptParser::OnStartPrefixMappingL(   const RString& /*aPrefix*/, 
+                                                    const RString& /*aUri*/, 
+                                                    TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+
+void CCreatorScriptParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+void CCreatorScriptParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+void CCreatorScriptParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+void CCreatorScriptParser::OnProcessingInstructionL(  const TDesC8& /*aTarget*/, 
+                                    const TDesC8& /*aData*/, 
+                                    TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    }
+void CCreatorScriptParser::OnError(TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnError: %d", aErrorCode);
+    
+    iLastError = aErrorCode;
+    
+    // Delete all elements from the stack:
+    while(iElementStack.Count() > 0 )
+        {
+        TCreatorScriptElementInfo previousElem = LastElementInfo();    
+        delete previousElem.iElement;
+        previousElem.iElement = 0;
+        iElementStack.Remove(iElementStack.Count()-1);
+        }
+    }
+TAny* CCreatorScriptParser::GetExtendedInterface(const TInt32 aUid)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::GetExtendedInterface (UID: %d)", aUid);
+    return this;
+    }
+
+const TCreatorScriptElementInfo& CCreatorScriptParser::LastElementInfo() const
+{
+    LOGSTRING("Creator: CCreatorScriptParser::LastElementInfo");
+    if(iElementStack.Count() > 0)
+        {
+        return iElementStack[iElementStack.Count()-1];
+        }
+    return iDefaultElement;
+}
+
+/**
+ * Create an element and add attributes to it.
+ */
+void CCreatorScriptParser::OnStartElementL(  const RTagInfo& aElement,
+                                            const RAttributeArray& aAttributes,
+                                            TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnStartElementL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    const TDesC8& elementName8 = aElement.LocalName().DesC();        
+    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
+        
+    const TCreatorScriptElementInfo& context = LastElementInfo();
+    
+    CCreatorScriptElement* element = 0;
+    if( context.iElement )
+        {
+        HBufC* fullContext = HBufC::NewL(
+                context.iElement->Context().Length() + 
+                context.iElement->Name().Length() + 
+                2);        
+        CleanupStack::PushL(fullContext);
+        if(context.iElement->Context() != KNullDesC && 
+           context.iElement->Context().Length() > 0 )
+            {
+            fullContext->Des().Copy(context.iElement->Context());
+            _LIT(KContextSeparator, "::");
+            fullContext->Des().Append(TPtrC(KContextSeparator));
+            }
+        const TDesC& parentName = context.iElement->Name();
+        if(parentName.Length() > 0 )
+            {            
+            fullContext->Des().Append(parentName);
+            }
+        element = TCreatorScriptElementFactory::CreateElementL( iEngine,
+                                                                elementName16->Des(), 
+                                                                fullContext->Des());
+        CleanupStack::PopAndDestroy(fullContext); // fullContext        
+        }
+    else
+        {
+        element = TCreatorScriptElementFactory::CreateElementL(iEngine, elementName16->Des());        
+        }
+        
+    CleanupStack::PopAndDestroy(elementName16);
+    CleanupStack::PushL(element);
+    
+    if( element == 0 )
+        {
+        // Add NULL pointer to stack. Otherwise the stack would go out of sync. in ::OnEndElement().
+        TCreatorScriptElementInfo info(TCreatorScriptElementInfo::EStatusParsing, element);
+        iElementStack.AppendL(info);   
+        CleanupStack::Pop(element);
+        return;        
+        }
+        
+    // Add attributes to the element:
+    TInt attrCount = aAttributes.Count();
+    for(TInt i = 0; i < attrCount; ++i)
+        {
+        const RAttribute& attribute = aAttributes[i];
+        const RTagInfo& nameInfo = attribute.Attribute();
+        const TDesC8& attrName8 = nameInfo.LocalName().DesC();
+        const TDesC8& value8 = attribute.Value().DesC();
+        // Convert data to 16 bit:
+        HBufC* attrName16 = Convert8BitTo16BitLC(attrName8);
+        HBufC* value16 = Convert8BitTo16BitLC(value8);
+        CCreatorScriptAttribute* scriptAttr = CCreatorScriptAttribute::NewLC(attrName16->Des(), value16->Des());
+        element->AddAttributeL(scriptAttr);
+        CleanupStack::Pop(scriptAttr);
+        CleanupStack::PopAndDestroy(value16);
+        CleanupStack::PopAndDestroy(attrName16);
+        }
+    
+    // Save element to the stack:
+    TCreatorScriptElementInfo info(TCreatorScriptElementInfo::EStatusParsing, element);
+    iElementStack.AppendL(info);
+    CleanupStack::Pop(element);
+    }
+
+/**
+ * Executes the command if needed. Also caches the element for future use, if needed.
+ */
+void CCreatorScriptParser::OnEndElementL(const RTagInfo& /*aElement*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnEndElementL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+     
+    if( iElementStack.Count() == 0 )
+        {
+        return;
+        }
+    // Get element from the stack:    
+    TCreatorScriptElementInfo elementInfo = LastElementInfo();
+    
+    if( elementInfo.iElement == 0 )
+        {
+        // Remove element from the stack:        
+        iElementStack.Remove(iElementStack.Count()-1);
+        return;
+        }
+        
+    // Execute the command if this is a command element:
+    if( elementInfo.iElement->IsCommandElement() )
+        {
+        elementInfo.iElement->ExecuteCommandL();
+        }
+    
+    // Remove element from the stack:
+    iElementStack.Remove(iElementStack.Count()-1);
+    
+    // Get the previous element from the stack:
+    if( iElementStack.Count() > 0 )
+        {
+        TCreatorScriptElementInfo previousElem = LastElementInfo();
+        
+        if( previousElem.iElement->IsRoot() )
+            {
+            // This element is not a sub-element (except of the root element, of course).        
+            if( elementInfo.iElement->IsCacheNeeded() )
+                {
+                // Add element to the cache, since it will be needed in future.            
+                elementInfo.iElement->AddToCacheL();
+                }
+            //else
+            //    {
+                // Not needed anymore, so element can be deleted:
+                delete elementInfo.iElement;
+                elementInfo.iElement = 0;
+           //     }
+            }
+        else
+            {
+            // There is a parent element (other than root), so we add this element
+            // as a sub-element fot it.
+            previousElem.iElement->AddSubElementL(elementInfo.iElement);
+            }
+        }
+    else
+        {
+        // Delete root element, which will delete recursively all sub-elements:
+        delete elementInfo.iElement;
+        elementInfo.iElement = 0;
+        }
+    }
+
+/**
+ * Add content to element.
+ */
+void CCreatorScriptParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
+    {
+    LOGSTRING2("Creator: CCreatorScriptParser::OnContentL (Error code: %d)", aErrorCode);
+    User::LeaveIfError(aErrorCode);
+    if( iElementStack.Count() > 0 )
+        {
+        HBufC* contentData = Convert8BitTo16BitLC(aBytes);
+        TCreatorScriptElementInfo elementInfo = iElementStack[iElementStack.Count()-1];
+        if( elementInfo.iElement )
+            {
+            elementInfo.iElement->AppendContentL(*contentData);
+            }
+        CleanupStack::PopAndDestroy(contentData);
+        }
+    }
+
+HBufC16* CCreatorScriptParser::Convert8BitTo16BitLC(const TDesC8& aInput) 
+    {     
+    LOGSTRING("Creator: CCreatorScriptParser::Convert8BitTo16BitLC");
+    HBufC16* output = NULL;
+    
+    output = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aInput);
+    
+    CleanupStack::PushL(output);
+    return output;          
+    } 
+
+TInt CCreatorScriptParser::GetError() const 
+{
+    return iLastError;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_virtualphonebook.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1790 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "engine.h"
+#include "enginewrapper.h"
+#include "creator_virtualphonebook.h" 
+#include "creator_traces.h"
+#include "creator_contactsetcache.h"
+
+#include <cvpbkcontactstoreuriarray.h>
+#include <vpbkcontactstoreuris.h>
+#include <tvpbkcontactstoreuriptr.h>
+#include <mvpbkcontactgroup.h>
+#include <mvpbkcontactstore.h>
+#include <cvpbkcontactmanager.h>
+#include <mvpbkcontactstorelist.h>
+#include <mvpbkcontactstorelistobserver.h>
+#include <mvpbkcontactoperationbase.h>
+#include <mvpbkstorecontact.h>
+#include <mvpbkcontactstoreproperties.h>
+#include <mvpbkcontactfielddata.h>
+#include <mvpbkfieldtype.h>
+#include <mvpbkcontactfieldtextdata.h>
+#include <mvpbkcontactfieldbinarydata.h>
+#include <mvpbkcontactfielddatetimedata.h>
+#include <CVPbkContactViewDefinition.h>
+#include <mvpbkcontactview.h>
+
+#include <vpbkcontactview.hrh>
+#include <vpbkeng.rsg>
+
+typedef struct {
+TInt iFieldCode;
+TInt iRandomType;
+} FieldInfo;
+static const TInt RND_TYPE_UNDEF = -99;
+FieldInfo CreatorVPbkMiscTextFields[] = {        
+        {R_VPBK_FIELD_TYPE_FIRSTNAME, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_FIRSTNAMEREADING, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_LASTNAME, (TInt) CCreatorEngine::ESurname},
+        {R_VPBK_FIELD_TYPE_LASTNAMEREADING, (TInt) CCreatorEngine::ESurname},
+        {R_VPBK_FIELD_TYPE_COMPANYNAME, (TInt) CCreatorEngine::ECompany},
+        {R_VPBK_FIELD_TYPE_JOBTITLE, (TInt) CCreatorEngine::EJobTitle},
+        {R_VPBK_FIELD_TYPE_PREFIX, (TInt) CCreatorEngine::EPrefix},
+        {R_VPBK_FIELD_TYPE_SUFFIX, (TInt) CCreatorEngine::ESuffix},
+        {R_VPBK_FIELD_TYPE_SECONDNAME, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_ADDRLABELGEN, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRPOGEN, (TInt) CCreatorEngine::EPobox},
+        {R_VPBK_FIELD_TYPE_ADDREXTGEN, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRSTREETGEN, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRLOCALGEN, (TInt) CCreatorEngine::ECity},
+        {R_VPBK_FIELD_TYPE_ADDRREGIONGEN, (TInt) CCreatorEngine::EState},
+        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEGEN, (TInt) CCreatorEngine::EPostcode},
+        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYGEN, (TInt) CCreatorEngine::ECountry},
+        {R_VPBK_FIELD_TYPE_ADDRLABELHOME, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRPOHOME, (TInt) CCreatorEngine::EPobox},
+        {R_VPBK_FIELD_TYPE_ADDREXTHOME, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRSTREETHOME, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRLOCALHOME, (TInt) CCreatorEngine::ECity},
+        {R_VPBK_FIELD_TYPE_ADDRREGIONHOME, (TInt) CCreatorEngine::EState},
+        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEHOME, (TInt) CCreatorEngine::EPostcode},
+        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYHOME, (TInt) CCreatorEngine::ECountry},
+        {R_VPBK_FIELD_TYPE_ADDRLABELWORK, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRPOWORK, (TInt) CCreatorEngine::EPobox},
+        {R_VPBK_FIELD_TYPE_ADDREXTWORK, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRSTREETWORK, (TInt) CCreatorEngine::EAddress},
+        {R_VPBK_FIELD_TYPE_ADDRLOCALWORK, (TInt) CCreatorEngine::ECity},
+        {R_VPBK_FIELD_TYPE_ADDRREGIONWORK, (TInt) CCreatorEngine::EState},
+        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEWORK, (TInt) CCreatorEngine::EPostcode},
+        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYWORK, (TInt) CCreatorEngine::ECountry},
+        {R_VPBK_FIELD_TYPE_POC, (TInt) CCreatorEngine::EPhoneNumber},
+        {R_VPBK_FIELD_TYPE_SWIS, (TInt) CCreatorEngine::EPhoneNumber},
+        {R_VPBK_FIELD_TYPE_SIP, (TInt) CCreatorEngine::EPhoneNumber},
+        {R_VPBK_FIELD_TYPE_DTMFSTRING, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_NOTE,(TInt)  CCreatorEngine::EMemoText},
+        {R_VPBK_FIELD_TYPE_MIDDLENAME, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_DEPARTMENT, (TInt) CCreatorEngine::ECompany},
+        {R_VPBK_FIELD_TYPE_ASSTNAME, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_SPOUSE, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_CHILDREN, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_SYNCCLASS, RND_TYPE_UNDEF},
+        {R_VPBK_FIELD_TYPE_LOCPRIVACY, RND_TYPE_UNDEF},
+        {R_VPBK_FIELD_TYPE_GENLABEL, (TInt) CCreatorEngine::EFirstName},
+        {R_VPBK_FIELD_TYPE_WVADDRESS, (TInt) CCreatorEngine::EPhoneNumber},
+        {R_VPBK_FIELD_TYPE_RINGTONE, RND_TYPE_UNDEF},
+        {R_VPBK_FIELD_TYPE_THUMBNAILPIC, RND_TYPE_UNDEF},
+        {R_VPBK_FIELD_TYPE_CALLEROBJTEXT, (TInt) CCreatorEngine::EFirstName}
+        };
+                    
+TInt CreatorVPbkBinaryFields[] = {
+        R_VPBK_FIELD_TYPE_CALLEROBJIMG//,
+        //R_VPBK_FIELD_TYPE_THUMBNAILPATH
+        };
+
+TInt CreatorVPbkDateTimeFields[] = {
+        R_VPBK_FIELD_TYPE_ANNIVERSARY
+        };
+
+//----------------------------------------------------------------------------
+TInt CreatorVPbkPhoneNumberFields[] =
+    {
+    R_VPBK_FIELD_TYPE_LANDPHONEGEN,
+    R_VPBK_FIELD_TYPE_LANDPHONEHOME,
+    R_VPBK_FIELD_TYPE_LANDPHONEWORK,                        
+    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEHOME,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEWORK,
+    R_VPBK_FIELD_TYPE_FAXNUMBERGEN,
+    R_VPBK_FIELD_TYPE_FAXNUMBERHOME,
+    R_VPBK_FIELD_TYPE_FAXNUMBERWORK,
+    R_VPBK_FIELD_TYPE_PAGERNUMBER,           
+    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERHOME,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERWORK,
+    R_VPBK_FIELD_TYPE_VOIPGEN,
+    R_VPBK_FIELD_TYPE_VOIPHOME,
+    R_VPBK_FIELD_TYPE_VOIPWORK,
+    R_VPBK_FIELD_TYPE_ASSTPHONE,
+    R_VPBK_FIELD_TYPE_CARPHONE
+    };
+
+TInt CreatorVPbkUrlFields[] =
+    {
+    R_VPBK_FIELD_TYPE_URLGEN,
+    R_VPBK_FIELD_TYPE_URLHOME,
+    R_VPBK_FIELD_TYPE_URLWORK
+    };
+
+TInt CreatorVPbkEmailFields[] =
+    {
+    R_VPBK_FIELD_TYPE_EMAILGEN,
+    R_VPBK_FIELD_TYPE_EMAILHOME,
+    R_VPBK_FIELD_TYPE_EMAILWORK
+    };
+
+//----------------------------------------------------------------------------
+
+CVirtualPhonebookParameters::CVirtualPhonebookParameters()
+    {
+    LOGSTRING("Creator: CVirtualPhonebookParameters::CVirtualPhonebookParameters");
+    iGroupName = HBufC::New(KPhonebookFieldLength);  
+    }
+
+CVirtualPhonebookParameters::~CVirtualPhonebookParameters()
+    {
+    LOGSTRING("Creator: CVirtualPhonebookParameters::~CVirtualPhonebookParameters");
+
+    delete iGroupName;   
+    iContactFields.ResetAndDestroy();
+    iContactFields.Close();
+    iLinkIds.Reset();
+    iLinkIds.Close();
+    }
+
+void CVirtualPhonebookParameters::ParseL(CCommandParser* /*parser*/, TParseParams /*aCase = 0*/)
+	{
+	}
+
+TInt CVirtualPhonebookParameters::ScriptLinkId() const
+    {
+    return iLinkId;
+    }
+
+void CVirtualPhonebookParameters::SetScriptLinkId(TInt aLinkId)
+    {
+    iLinkId = aLinkId;
+    }
+
+//----------------------------------------------------------------------------
+
+CCreatorVirtualPhonebook* CCreatorVirtualPhonebook::NewL(CCreatorEngine* aEngine)
+    {
+    CCreatorVirtualPhonebook* self = CCreatorVirtualPhonebook::NewLC(aEngine);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorVirtualPhonebook* CCreatorVirtualPhonebook::NewLC(CCreatorEngine* aEngine)
+    {
+    CCreatorVirtualPhonebook* self = new (ELeave) CCreatorVirtualPhonebook;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngine);
+    return self;
+    }
+
+CCreatorVirtualPhonebook::CCreatorVirtualPhonebook()
+    {    
+    iAddAllFields = EFalse;
+    }
+
+void CCreatorVirtualPhonebook::ConstructL(CCreatorEngine* aEngine)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::ConstructL");
+
+    iContactLinkArray = CVPbkContactLinkArray::NewL();
+    iContactsToDelete = CVPbkContactLinkArray::NewL();
+    iContactGroupsToDelete = CVPbkContactLinkArray::NewL();
+    
+    iEngine = aEngine;
+    SetDefaultParameters();
+    
+    // initialize virtual phonebook
+    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
+    uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
+    iContactManager = CVPbkContactManager::NewL( *uriArray, &CCoeEnv::Static()->FsSession());
+    CleanupStack::PopAndDestroy(uriArray);
+    
+    //When the contact manager is created, the stores is opened
+    MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
+    
+    iWaiter = CAsyncWaiter::NewL();
+
+    //MVPbkContactStoreListObserver must give as parameter    
+    storeList.OpenAllL(*this);
+    // wait for OpenComplete() callback
+    iWaiter->StartAndWait();
+    
+    _LIT(dbUri, "cntdb://c:contacts.cdb");
+    const TVPbkContactStoreUriPtr uri = TVPbkContactStoreUriPtr(dbUri);
+       
+    iStore = storeList.Find(uri);    
+    iOpCounter = 0;    
+    }
+
+TBool CCreatorVirtualPhonebook::IsActive()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::IsActive");
+    return iOperation != NULL;
+    }
+
+void CCreatorVirtualPhonebook::CancelOperation()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::CancelOperation");
+    iCancelCbRequested = ETrue;    
+    }
+
+CCreatorVirtualPhonebook::~CCreatorVirtualPhonebook()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::~CCreatorVirtualPhonebook");
+    
+    // this is done only once per phonebook operation
+    if ( iContactsToDelete && iContactsToDelete->Count() )
+        {
+        TRAP_IGNORE( StoreLinksForDeleteL( *iContactsToDelete, KUidDictionaryUidContacts ) );
+        }
+    delete iContactsToDelete;
+    if ( iContactGroupsToDelete && iContactGroupsToDelete->Count() )
+        {
+        TRAP_IGNORE( StoreLinksForDeleteL( *iContactGroupsToDelete, KUidDictionaryUidContactGroups ) );
+        }
+    delete iContactGroupsToDelete;
+    
+    iPreviousDeleteLinks.ResetAndDestroy();
+    
+    delete iOperation;
+    
+    TInt err = 0;
+    TRAP(err, CompactPbkDatabaseL( ETrue ));
+
+    if(iContactResults)
+    	{
+    	delete iContactResults;
+    	}
+    
+    delete iContactLinkArray;
+    delete iContactGroupsInStore;
+    
+    if(iContactManager)
+    	{
+    	TRAP(err, iContactManager->ContactStoresL().CloseAll(*this));
+    	delete iContactManager;
+    	}
+    if(iWaiter)
+    	{
+    	delete iWaiter;    
+    	}
+    if (iParameters)
+    	{
+        delete iParameters;
+    	}
+    }
+
+//----------------------------------------------------------------------------
+TBool CCreatorVirtualPhonebook::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AskDataFromUserL");
+    TBool ret = CCreatorPhonebookBase::AskDataFromUserL(aCommand, aNumberOfEntries);
+   
+    if(ret && aCommand == ECmdCreatePhoneBookEntryContacts && !iDefaultFieldsSelected)    
+        {
+        iAddAllFields = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add all the other fields to contacts?"));
+        }
+    return ret;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteAllL()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllL");
+    
+    // Delete all contacts, not contact groups
+    
+    //get field types
+    const MVPbkFieldTypeList& fieldList = iStore->StoreProperties().SupportedFields();
+        
+    // get all contact links, results will be set to iContactResults
+    MVPbkContactOperationBase* operation = iContactManager->FindL( _L(""), fieldList , *this );
+    if ( operation )
+        {
+        iWaiter->StartAndWait(); //Making asynchronous FindL to synchronous
+        delete operation;
+        }
+    
+    while( iContactResults->Count() && 
+           !iCancelCbRequested &&
+           HasOtherThanGroupsL( iContactResults ) )
+        {
+        // delete all found contacts
+        DeleteContactsL( iContactResults, EFalse );
+        
+        if ( !iCancelCbRequested )
+            {
+            // find next set of contacts to delete
+            MVPbkContactOperationBase* operation = iContactManager->FindL( _L(""), fieldList , *this );
+            if ( operation )
+                {
+                iWaiter->StartAndWait(); //Making asynchronous FindL to synchronous
+                delete operation;
+                }
+            }
+        }
+    
+    if ( iCancelCbRequested && iEngine )
+        {
+        // User cancelled, must callback to finish terminatio sequence
+        iEngine->CancelComplete();
+        }
+    else
+        {
+        // contacts deleted, remove the Creator internal contact registry
+        // (no callback required)
+        CDictionaryFileStore* store = iEngine->FileStoreLC();
+        if ( store )
+            {
+            store->Remove( KUidDictionaryUidContacts );
+            store->CommitL();        
+            }
+        CleanupStack::PopAndDestroy( store );
+        }    
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteAllCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllCreatedByCreatorL");
+    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContacts );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteAllGroupsL()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllGroupsL");
+    User::LeaveIfNull( iStore );
+    MVPbkContactLinkArray* groups = iStore->ContactGroupsLC();
+    DeleteContactsL( groups, ETrue );
+    CleanupStack::PopAndDestroy(); // cannot use groups as parameter
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteAllGroupsCreatedByCreatorL()
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllGroupsCreatedByCreatorL");
+    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContactGroups );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteContactsL( MVPbkContactLinkArray* aContacts, TBool aGroup )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteContactsL");
+    const MVPbkContactLink* link( NULL );
+    delete iOperation;
+    iOperation = NULL;
+    TInt i(0);
+    while ( aContacts && i < aContacts->Count() && !iCancelCbRequested )
+        {
+        link = &aContacts->At( i++ );
+        if ( aGroup == IsContactGroupL( *link ) )
+            {
+            iOperation = iContactManager->RetrieveContactL( *link, *this );
+            // see VPbkSingleContactOperationComplete
+            if ( iOperation )
+                {
+                iWaiter->StartAndWait();
+                delete iOperation;
+                iOperation = NULL;
+                }            
+            }
+        link = NULL;
+        }
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DeleteItemsCreatedWithCreatorL( TUid aStoreUid )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteItemsCreatedWithCreatorL");
+    __ASSERT_ALWAYS( aStoreUid == KUidDictionaryUidContacts || 
+                     aStoreUid == KUidDictionaryUidContactGroups,
+                     User::Panic( _L("CCreatorVPb"), KErrArgument ) );
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+    User::LeaveIfNull( store );
+    if ( store->IsPresentL( aStoreUid ) )
+        {
+        TRAP_IGNORE( DoDeleteItemsCreatedWithCreatorL( aStoreUid, store ) );
+
+        if ( iCancelCbRequested && iEngine )
+            {
+            iEngine->CancelComplete();
+            }
+        else
+            {
+            // contacts deleted, remove the Creator internal contact registry
+            store->Remove( aStoreUid );
+            store->CommitL();            
+            }
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::DoDeleteItemsCreatedWithCreatorL");
+    RDictionaryReadStream in;
+    in.OpenLC( *aStore, aStoreUid );
+    MVPbkContactLinkArray* contactsToDelete = NULL;
+    // fetch contact links from store
+    while ( ( contactsToDelete = iContactManager->CreateLinksLC( in ) ) != NULL && // will leave with KErrEof
+            !iCancelCbRequested ) 
+        {
+        DeleteContactsL( contactsToDelete, aStoreUid == KUidDictionaryUidContactGroups );
+        // PopAndDestroy for contactsToDelete causes E32USER-CBase:90
+        // however there is no mem-leak even if not deleting contactsToDelete object
+        }
+    CleanupStack::PopAndDestroy(); // in
+    }
+
+//----------------------------------------------------------------------------
+TBool CCreatorVirtualPhonebook::HasOtherThanGroupsL( MVPbkContactLinkArray* aContacts )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::HasOtherThanGroupsL");
+    TBool result( EFalse );
+    TInt i(0);
+    while ( aContacts && i < aContacts->Count() && !iCancelCbRequested && !result )
+        {
+        if ( !IsContactGroupL( aContacts->At( i++ ) ) )
+            {
+            result = ETrue;
+            }
+        }
+    return result;
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::VPbkSingleContactOperationComplete(
+                MVPbkContactOperationBase& /*aOperation*/,
+                MVPbkStoreContact* aContact )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::VPbkSingleContactOperationComplete");
+    
+    // This callback is currently used only for deleting a contact
+    // See DeleteContactsL
+    
+    TRAP_IGNORE( 
+            aContact->PushL();
+            aContact->DeleteL( *this );
+            CleanupStack::PopAndDestroy( aContact );
+        );
+    }
+
+void CCreatorVirtualPhonebook::VPbkSingleContactOperationFailed(
+                MVPbkContactOperationBase& /*aOperation*/, 
+                TInt /*aError*/ )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::VPbkSingleContactOperationFailed");
+    iWaiter->Cancel();
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::StoreLinksForDeleteL( MVPbkContactLinkArray& aLinks, TUid aStoreUid )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreLinksForDeleteL");
+    CDictionaryFileStore* store = iEngine->FileStoreLC();
+    User::LeaveIfNull( store );
+    
+    // backup previous contact links from store
+    // otherwise they would be overwritten when calling out.WriteL
+    MVPbkContactLinkArray* previousLinks( NULL );
+    if ( store->IsPresentL( aStoreUid ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, aStoreUid );        
+        TRAP_IGNORE( 
+            while ( ( previousLinks = iContactManager->CreateLinksLC( in )) != NULL ) // will leave with KErrEof
+                {
+                CleanupStack::Pop(); // previousLinks
+                iPreviousDeleteLinks.Append( previousLinks );
+                previousLinks = NULL;
+                }
+            );
+        CleanupStack::PopAndDestroy(); // in
+        }
+
+    RDictionaryWriteStream out;       
+    out.AssignLC( *store, aStoreUid );
+    
+    // restore previous links
+    for ( TInt i = 0; i < iPreviousDeleteLinks.Count(); i++ )
+        {
+        out.WriteL( *iPreviousDeleteLinks[i]->PackLC() );
+        CleanupStack::PopAndDestroy(); // PackLC            
+        }
+    iPreviousDeleteLinks.ResetAndDestroy();
+    
+    // write new links
+    out.WriteL( *aLinks.PackLC() );
+    out.CommitL();
+    CleanupStack::PopAndDestroy(); // aLinks.PackLC
+    CleanupStack::PopAndDestroy(); // out
+    
+    store->CommitL();
+    CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC& aData)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC& aData)");
+    if(iParameters == 0)
+        return;
+    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
+    CleanupStack::PushL(field);
+    iParameters->iContactFields.AppendL(field);
+    CleanupStack::Pop();
+    }
+
+void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC8& aData)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC8& aData)");
+    if(iParameters == 0)
+        return;
+    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
+    CleanupStack::PushL(field);
+    iParameters->iContactFields.AppendL(field);
+    CleanupStack::Pop();
+    }
+
+void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TTime& aData)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TTime& aData)");
+    if(iParameters == 0)
+        return;
+    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
+    CleanupStack::PushL(field);
+    iParameters->iContactFields.AppendL(field);
+    CleanupStack::Pop();
+    }
+       
+//----------------------------------------------------------------------------
+TInt CCreatorVirtualPhonebook::iPhoneNumberFields[] =
+    {
+    R_VPBK_FIELD_TYPE_LANDPHONEGEN,
+    R_VPBK_FIELD_TYPE_LANDPHONEHOME,
+    R_VPBK_FIELD_TYPE_LANDPHONEWORK,                        
+    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEHOME,
+    R_VPBK_FIELD_TYPE_MOBILEPHONEWORK,
+    R_VPBK_FIELD_TYPE_FAXNUMBERGEN,
+    R_VPBK_FIELD_TYPE_FAXNUMBERHOME,
+    R_VPBK_FIELD_TYPE_FAXNUMBERWORK,
+    R_VPBK_FIELD_TYPE_PAGERNUMBER,           
+    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERHOME,
+    R_VPBK_FIELD_TYPE_VIDEONUMBERWORK,
+    R_VPBK_FIELD_TYPE_VOIPGEN,
+    R_VPBK_FIELD_TYPE_VOIPHOME,
+    R_VPBK_FIELD_TYPE_VOIPWORK,
+    R_VPBK_FIELD_TYPE_ASSTPHONE,
+    R_VPBK_FIELD_TYPE_CARPHONE
+    };
+
+TInt CCreatorVirtualPhonebook::iUrlFields[] =
+    {
+    R_VPBK_FIELD_TYPE_URLGEN,
+    R_VPBK_FIELD_TYPE_URLHOME,
+    R_VPBK_FIELD_TYPE_URLWORK
+    };
+
+TInt CCreatorVirtualPhonebook::iEmailFields[] =
+    {
+    R_VPBK_FIELD_TYPE_EMAILGEN,
+    R_VPBK_FIELD_TYPE_EMAILHOME,
+    R_VPBK_FIELD_TYPE_EMAILWORK
+    };
+
+void CCreatorVirtualPhonebook::InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::InitializeContactParamsL");        
+    iParameters = new (ELeave) CVirtualPhonebookParameters;
+        
+    iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
+    iParameters->iNumberOfURLFields = iNumberOfURLFields;
+    iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;       
+        
+    TPtrC firstname = iEngine->RandomString(CCreatorEngine::EFirstName);
+    TPtrC lastname  = iEngine->RandomString(CCreatorEngine::ESurname);               
+                    
+    if( iAddAllFields )
+        {
+        // Add text fields:
+        TInt textFieldCount = sizeof(CreatorVPbkMiscTextFields) / sizeof(FieldInfo);
+        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
+            {                
+            CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkMiscTextFields[tfIndex].iFieldCode, KNullDesC);
+            CleanupStack::PushL(field);
+            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+            iParameters->iContactFields.AppendL(field);
+            CleanupStack::Pop(field);
+            }
+            
+        // Add binary fields:
+        TInt binFieldCount = sizeof(CreatorVPbkBinaryFields) / sizeof(TInt);
+        for( TInt bfIndex = 0; bfIndex < binFieldCount; ++bfIndex )
+            {                
+            CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkBinaryFields[bfIndex], KNullDesC8);
+            CleanupStack::PushL(field);
+            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+            iParameters->iContactFields.AppendL(field);
+            CleanupStack::Pop(field);
+            }
+            
+        // Add date-time fields:
+        TInt dtFieldCount = sizeof(CreatorVPbkDateTimeFields) / sizeof(TInt);
+        for( TInt dtIndex = 0; dtIndex < dtFieldCount; ++dtIndex )
+            {
+            AddFieldToParamsL(CreatorVPbkDateTimeFields[dtIndex], iEngine->RandomDate(CCreatorEngine::EDateFuture));
+            }
+
+        AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJIMG, KNullDesC8);        
+        AddFieldToParamsL(R_VPBK_FIELD_TYPE_THUMBNAILPIC, KNullDesC8);        
+        AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJTEXT, firstname);
+        }
+    else
+        {                      
+        AddFieldToParamsL(R_VPBK_FIELD_TYPE_FIRSTNAME, firstname);            
+        AddFieldToParamsL(R_VPBK_FIELD_TYPE_LASTNAME, lastname);            
+        }
+                    
+    // Phone numbers:
+    TInt arraySize = sizeof(iPhoneNumberFields)/sizeof(TInt);
+    TInt index = 0;
+    for (TInt i=0; i<iParameters->iNumberOfPhoneNumberFields; i++ )
+        {            
+        if( index >= arraySize )
+            {
+            index = 0;
+            }
+        if( arraySize > 0  )
+            {
+            CCreatorContactField* field = CCreatorContactField::NewL(iPhoneNumberFields[index], KNullDesC);
+            CleanupStack::PushL(field);
+            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+            iParameters->iContactFields.AppendL(field);
+            CleanupStack::Pop(field);
+            }
+        ++index;
+        }
+            
+       
+    // URLs:
+    arraySize = sizeof(iUrlFields)/sizeof(TInt);
+    index = 0;
+    for( TInt i = 0; i < iParameters->iNumberOfURLFields; ++i)
+        {
+        if( index >= arraySize )
+            {
+            index = 0;
+            }
+        if( arraySize > 0  )
+            {
+            CCreatorContactField* field = CCreatorContactField::NewL(iUrlFields[index], KNullDesC);
+            CleanupStack::PushL(field);
+            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+            iParameters->iContactFields.AppendL(field);
+            CleanupStack::Pop(field);            
+            }
+        ++index;
+        }
+                    
+    // EMail addresses:
+    arraySize = sizeof(iEmailFields)/sizeof(TInt);
+    index = 0;
+    for( TInt i = 0; i < iParameters->iNumberOfEmailAddressFields; ++i)
+        {
+        if( index >= arraySize )
+            {
+            index = 0;
+            }
+        if( arraySize > 0  )
+            {
+            CCreatorContactField* field = CCreatorContactField::NewL(iEmailFields[index], KNullDesC);
+            CleanupStack::PushL(field);
+            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
+            iParameters->iContactFields.AppendL(field);
+            CleanupStack::Pop(field);               
+            }
+        ++index;
+        }
+    }
+
+TInt CCreatorVirtualPhonebook::CreateContactEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateContactEntryL");
+    
+    delete iParameters;
+    iParameters = 0;
+    CVirtualPhonebookParameters* parameters = 0;
+    
+    if( aParameters == 0 )
+        {
+        InitializeContactParamsL();
+        parameters = iParameters;
+        }
+    else
+        {
+        parameters = (CVirtualPhonebookParameters*) aParameters;
+        }
+    
+    TInt err = KErrNone;
+
+    // create a new contact item
+    MVPbkStoreContact* newContact = iStore->CreateNewContactLC();
+    for( TInt i = 0; i < parameters->iContactFields.Count(); ++i )
+        {
+        CCreatorContactField* cField = parameters->iContactFields[i];
+        if( cField )
+            {
+            cField->AddToContactL(iEngine, *newContact, this);
+            }
+        }
+
+    RArray<MVPbkStoreContact*> contacts;
+    CleanupClosePushL( contacts );    
+    contacts.Append(newContact);        
+    
+    delete iOperation;
+    iOperation = NULL;
+    iOperation = iContactManager->CommitContactsL( contacts.Array(), *this );       
+    if ( iOperation )
+        {
+
+        iWaiter->StartAndWait();//Making asynchronous CommitContctsL to synchronous
+        delete iOperation;
+        iOperation = NULL;
+        }    
+    
+    // store the link to contact, so that Creator is able to delete
+    // it when user requests deletion of contacts that are created by Creator 
+    MVPbkContactLink* linkToContact = newContact->CreateLinkLC();
+    iContactsToDelete->AppendL( linkToContact );
+    CleanupStack::Pop(); // linkToContact
+    
+    // If this contact has a link id in script (i.e. belongs to a contact-set), we must cache the contact id:
+    if( parameters->ScriptLinkId() > 0 )
+        {                
+        RPointerArray<CCreatorContactSet>& contactsets = ContactLinkCache::Instance()->ContactSets();
+        TBool setFound(EFalse);
+        for(TInt i = 0; i < contactsets.Count(); ++i )
+            {
+            if( contactsets[i]->LinkId() == parameters->ScriptLinkId())
+                {
+                MVPbkContactLink* linkToContact = newContact->CreateLinkLC();
+                if( linkToContact )
+                    {
+                    contactsets[i]->AppendL(linkToContact);
+                    iContactLinkArray->AppendL(linkToContact);
+                    CleanupStack::Pop(); // linkToContact
+                    }
+                setFound = ETrue;
+                break;
+                }
+            }
+        if( !setFound )
+        	{
+        	LOGSTRING2("Error: Contact set id %d not found.", parameters->ScriptLinkId());
+        	}
+        }
+    
+    CleanupStack::Pop();//contacts
+    contacts.Close();
+    CompactPbkDatabaseL();
+    CleanupStack::PopAndDestroy();//newContact
+    if ( iCancelCbRequested && iEngine ) iEngine->CancelComplete();
+    return err;
+    }
+
+
+//----------------------------------------------------------------------------
+
+void CCreatorVirtualPhonebook::AddImageToContactL(MVPbkStoreContact& aContact, TInt aFieldResId, const TDesC& aFileName)
+    {
+    LOGSTRING("Creator: CCreatorPhonebook::AddImageToContactL");
+    CPbk2ImageManager* imageMgr = CPbk2ImageManager::NewL(*iContactManager);
+    CleanupStack::PushL(imageMgr);
+    const MVPbkFieldTypeList& fieldList = aContact.ParentStore().StoreProperties().SupportedFields();        
+    const MVPbkFieldType* fieldType = fieldList.Find(aFieldResId);
+    if( fieldType == 0 )
+        {
+        return;
+        }
+    MPbk2ImageOperation* imageOp = 0;
+    TRAPD(err, imageOp = imageMgr->SetImageAsyncL(aContact, *fieldType, *this, aFileName));   
+    if( err == KErrNone)
+        {
+        if (imageOp)
+            {
+            CleanupDeletePushL( imageOp );
+            iWaiter->StartAndWait(); // Making asynchronous SetImageAsyncL to synchronous
+            CleanupStack::Pop(imageOp);
+            delete imageOp;
+            }
+        }    
+    else if(err != KErrNotSupported)
+        {
+        User::Leave(err);
+        }
+    CleanupStack::PopAndDestroy(imageMgr);        
+    }
+
+// Checks if the link is a group or not
+TBool CCreatorVirtualPhonebook::IsContactGroupL(const MVPbkContactLink& aLink)
+	{
+	LOGSTRING("Creator: CCreatorPhonebook::IsContactGroupL");
+	if( iStore )
+		{
+		delete iContactGroupsInStore;
+		iContactGroupsInStore = 0;
+		// Save contact group links here
+		iContactGroupsInStore = iStore->ContactGroupsLC();
+		CleanupStack::Pop();
+		}
+		
+	if( iContactGroupsInStore )
+		{
+		// Loop all the groups and check if any of them matches to the given link.
+		for( TInt i = 0; i < iContactGroupsInStore->Count(); ++i )
+			{
+			if( (*iContactGroupsInStore)[i].IsSame(aLink) )
+				return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+TInt CCreatorVirtualPhonebook::CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateGroupEntryL");
+    delete iParameters;
+    iParameters = 0;
+    
+    CVirtualPhonebookParameters* parameters = (CVirtualPhonebookParameters*) aParameters;
+    
+    if( !parameters )
+        {
+        iParameters = new (ELeave) CVirtualPhonebookParameters;
+        iParameters->iContactsInGroup = iContactsInGroup;
+        iParameters->iGroupName->Des().Copy( iEngine->RandomString(CCreatorEngine::EGroupName) );
+        iParameters->iGroupName->Des().Append( _L(" #") );
+        iParameters->iGroupName->Des().AppendNum( iEngine->RandomNumber(1000, 9999) );
+        parameters = iParameters;
+        }
+
+    TInt err = KErrNone;
+ 
+    // create a new contact group    
+    MVPbkContactGroup* newGroup = iStore->CreateNewContactGroupLC();
+    
+    newGroup->SetGroupLabelL(parameters->iGroupName->Des());
+        
+    // define amounts of contacts to be added to the group
+    TInt amountOfContactsToBeAdded = 0;
+    if (parameters->iContactsInGroup == KCreateRandomAmountOfGroups)
+    	{
+        amountOfContactsToBeAdded = iEngine->RandomNumber(30);
+    	}
+    else 
+    	{
+        amountOfContactsToBeAdded = parameters->iContactsInGroup;
+    	}
+    
+    if( parameters->iLinkIds.Count() > 0 )
+        {
+        for( TInt i = 0; i < parameters->iLinkIds.Count(); ++i )
+            {
+            const CCreatorContactSet& set = ContactLinkCache::Instance()->ContactSet(parameters->iLinkIds[i].iLinkId);
+            
+            const RPointerArray<MVPbkContactLink>& links = set.ContactLinks();
+            TInt numberOfExplicitLinks = links.Count(); // Number of defined contacts in contact-set
+            TInt numberOfExistingContacts = set.NumberOfExistingContacts(); // Number of existing contacts in contact-set
+            TInt maxAmount = numberOfExplicitLinks + numberOfExistingContacts;
+            
+            if( parameters->iLinkIds[i].iLinkAmount > 0 )
+                maxAmount = parameters->iLinkIds[i].iLinkAmount; // Max amount is limited
+            
+            TInt addedMembers = 0;
+            
+            for( TInt j = 0; j < links.Count() && addedMembers < maxAmount; ++j )
+                {
+                MVPbkContactLink* link = links[j]; 
+                if( link && IsContactGroupL(*link) == EFalse )
+                    {
+                    TRAPD(err, newGroup->AddContactL(*link));
+                    if( err != KErrAlreadyExists )
+                    	{
+                    	// Ignore "allready exists" -error
+                    	User::LeaveIfError(err);
+                    	++addedMembers;
+                    	}                    
+                    }
+                }
+            if( addedMembers < maxAmount )
+            	{
+            	// Add existing contacts, withing the limits set by maxAmount:
+            	amountOfContactsToBeAdded += maxAmount - addedMembers;
+            	}
+            }
+        }
+    if( amountOfContactsToBeAdded > 0 )
+        {    
+        CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
+        CleanupStack::PushL( viewDef );
+        viewDef->SetType( EVPbkContactsView );
+        MVPbkContactView* contactView = iStore->CreateViewLC( 
+                *viewDef, 
+                *this, 
+                iStore->StoreProperties().SupportedFields() );
+        iWaiter->StartAndWait();//Making asynchronous CreateViewLC to synchronous
+
+        TInt cnt = 0;
+        // assign some random contacts to the group
+        for ( TInt y = 0; cnt < amountOfContactsToBeAdded && y < contactView->ContactCountL(); ++y )
+            {
+            MVPbkContactLink* link = contactView->CreateLinkLC( y );
+            TRAPD( err, newGroup->AddContactL( *link ) );
+            CleanupStack::PopAndDestroy(); // link
+            if( err != KErrAlreadyExists )
+                {
+                // Ignore "allready exists" -error
+                User::LeaveIfError( err );
+                ++cnt;
+                }
+            }
+        CleanupStack::PopAndDestroy(); // contactView
+        CleanupStack::PopAndDestroy( viewDef );
+        }
+    
+    newGroup->CommitL(*this);
+    iWaiter->StartAndWait(); //Making asynchronous CommitL to synchronous
+
+    // store the link to contact, so that Creator is able to delete
+    // it when user requests deletion of contacts that were created with Creator 
+    MVPbkContactLink* linkToContact = newGroup->CreateLinkLC();
+    iContactGroupsToDelete->AppendL( linkToContact );
+    CleanupStack::Pop(); // linkToContact
+    
+    CleanupStack::PopAndDestroy(); // newGroup
+   
+    CompactPbkDatabaseL();
+
+    return err;
+
+    }
+
+//----------------------------------------------------------------------------
+
+TInt CCreatorVirtualPhonebook::CreateSubscribedContactEntryL(CCreatorModuleBaseParameters* /*aParameters*/)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateSubscribedContactEntryL");
+
+    return KErrNotSupported;
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorVirtualPhonebook::AddFieldToContactItemL(
+		MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TDesC& aFieldText)
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
+
+    // Get field type object
+    const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();        
+    const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
+    if( fieldType == 0 )
+        return; // field type is not supported
+    
+    // Create a new field
+	MVPbkStoreContactField* newField = newContact.CreateFieldLC(*fieldType);	
+	if( !newField )
+	    {
+	    User::Leave(KErrNotSupported);
+	    }
+	
+	MVPbkContactFieldData& fieldData = newField->FieldData();
+	
+	//data type must be text in this case
+	TVPbkFieldStorageType dataType = fieldData.DataType();
+
+	if(dataType == EVPbkFieldStorageTypeText)
+	    {
+		//set text to field	
+		MVPbkContactFieldTextData& tmpData = MVPbkContactFieldTextData::Cast(fieldData);
+		tmpData.SetTextL(aFieldText);
+		//set field to contact		
+		newContact.AddFieldL(newField);//This object takes ownership of the field.
+		CleanupStack::Pop(newField);			
+	    }
+	else
+		{
+		User::Leave(KErrArgument);
+		}
+	
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorVirtualPhonebook::AddFieldToContactItemL(
+		MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TDesC8& aFieldText)
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
+
+	//get field types
+	const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();
+	
+	//get wanted field type
+	const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
+	
+	//create a new field
+	MVPbkStoreContactField* newField =
+	            newContact.CreateFieldLC(*fieldType);
+	//get field data	
+	MVPbkContactFieldData& fieldData = newField->FieldData();
+	
+	//data type must be text in this case
+	TVPbkFieldStorageType dataType = fieldData.DataType();
+
+	if(dataType == EVPbkFieldStorageTypeBinary){
+		//set bindata to field	
+		MVPbkContactFieldBinaryData& tmpData = MVPbkContactFieldBinaryData::Cast(fieldData);		
+		tmpData.SetBinaryDataL(aFieldText);
+		//set field to contact		
+		newContact.AddFieldL(newField);//This object takes ownership of the field.
+		CleanupStack::Pop(newField);			
+	}
+	else
+		{
+		CleanupStack::PopAndDestroy(newField);
+		}
+	
+    }
+
+void CCreatorVirtualPhonebook::AddFieldToContactItemL(
+        MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TTime& aFieldText)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
+    //get field types
+    const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();
+        
+    //get wanted field type
+    const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
+        
+    //create a new field
+    MVPbkStoreContactField* newField = newContact.CreateFieldLC(*fieldType);
+    //get field data    
+    MVPbkContactFieldData& fieldData = newField->FieldData();
+        
+    //data type must be datetime in this case
+    TVPbkFieldStorageType dataType = fieldData.DataType();
+
+    if(dataType == EVPbkFieldStorageTypeDateTime)
+        {
+        //set bindata to field  
+        MVPbkContactFieldDateTimeData& tmpData = MVPbkContactFieldDateTimeData::Cast(fieldData);        
+        tmpData.SetDateTime(aFieldText);
+        //set field to contact      
+        newContact.AddFieldL(newField);//This object takes ownership of the field.
+        CleanupStack::Pop(newField);            
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(newField);
+        }
+    }
+
+//----------------------------------------------------------------------------
+
+void CCreatorVirtualPhonebook::CompactPbkDatabaseL(TBool aCompressImmediately)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::CompactPbkDatabase");
+
+    iOpCounter++;
+
+    // compress the database immediately or after each 100th operation
+    if (aCompressImmediately || iOpCounter%100 == 0)
+        {
+        MVPbkContactOperationBase* operation= iContactManager->CompressStoresL(*this);
+        if (operation)
+            {
+            CleanupDeletePushL( operation );
+            iWaiter->StartAndWait();//Making asynchronous CompressStoresL to synchronous
+            CleanupStack::Pop(operation);
+            delete operation;
+            }             		 
+        }
+    }
+
+//----------------------------------------------------------------------------
+//Observer implementations for MVPbkContactStoreListObserver 
+//(and it's super class MVPbkContactStoreObserver)
+
+void CCreatorVirtualPhonebook::OpenComplete()
+	{
+	LOGSTRING("Creator: CCreatorVirtualPhonebook::OpenComplete()");
+    iWaiter->Cancel();
+	}
+
+void CCreatorVirtualPhonebook::StoreReady(MVPbkContactStore& /*aContactStore*/)
+	{
+	LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreReady()");
+	}
+
+
+void CCreatorVirtualPhonebook::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, 
+        TInt /*aReason*/)
+	{
+	LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreUnavailable()");
+	}
+
+
+void CCreatorVirtualPhonebook::HandleStoreEventL(
+        MVPbkContactStore& /*aContactStore*/, 
+        TVPbkContactStoreEvent /*aStoreEvent*/)
+	{
+	LOGSTRING("Creator: CCreatorVirtualPhonebook::HandleStoreEventL()");
+	}
+
+
+ TAny* CCreatorVirtualPhonebook::ContactStoreObserverExtension(
+		 TUid /*aExtensionUid*/) 
+        
+ { 
+ LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactStoreObserverExtension()");
+ return NULL; 
+ }
+ 
+ 
+//----------------------------------------------------------------------------
+//Observer implementation for MVPbkBatchOperationObserver
+
+void CCreatorVirtualPhonebook::StepComplete( 
+     MVPbkContactOperationBase& /*aOperation*/,
+     TInt /*aStepSize*/ )
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::StepComplete" );	
+	}
+
+
+TBool CCreatorVirtualPhonebook::StepFailed(
+     MVPbkContactOperationBase& /*aOperation*/,
+     TInt /*aStepSize*/, TInt /*aError*/ )
+{
+	LOGSTRING("Creator: CCreatorVirtualPhonebook::StepFailed" );
+	iWaiter->Cancel();
+	return EFalse;
+}
+
+
+void CCreatorVirtualPhonebook::OperationComplete( 
+     MVPbkContactOperationBase& /*aOperation*/ )
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::OperationComplete" );
+    //Canceling waiter when operation is done.
+    iWaiter->Cancel();
+	}
+
+
+TAny* CCreatorVirtualPhonebook::BatchOperationObserverExtension( 
+     TUid /*aExtensionUid*/ ) 
+     {
+     LOGSTRING("Creator: CCreatorVirtualPhonebook::BatchOperationObserverExtension" );
+     return NULL;
+     }
+
+//----------------------------------------------------------------------------
+//Observer implementation for MVPbkContactFindObserver
+void CCreatorVirtualPhonebook::FindCompleteL( MVPbkContactLinkArray* aResults )
+  	 {
+  	 LOGSTRING("Creator: CCreatorVirtualPhonebook::FindCompleteL" );
+  	 if(iContactResults)
+  		 {
+  		 delete iContactResults;
+  		 iContactResults = NULL;
+  		 }
+  	 iContactResults = aResults;
+  	 iWaiter->Cancel();
+   	 }
+
+void CCreatorVirtualPhonebook::FindFailed( TInt aError )
+ 	 {
+ 	LOGSTRING2("Creator: CCreatorVirtualPhonebook::FindFailed - Error: %d", aError );
+ 	iWaiter->Cancel();
+  	 }
+
+TAny* CCreatorVirtualPhonebook::ContactFindObserverExtension( 
+	                TUid /*aExtensionUid*/ )
+	 {
+	 LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactFindObserverExtension" );
+	 return NULL;
+	 }	                
+
+
+//Observer implementation for MVPbkContactObserver
+//----------------------------------------------------------------------------
+
+void CCreatorVirtualPhonebook::ContactOperationCompleted(TContactOpResult aResult)
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactOperationCompleted" );
+            
+	TContactOp op = aResult.iOpCode; 		 
+    switch ( op )
+        {
+        case EContactCommit:
+        case EContactDelete:
+            {
+            iWaiter->Cancel();
+            break;
+            }
+        case EContactLock:
+        default: break;
+        }
+	}
+	
+void CCreatorVirtualPhonebook::ContactOperationFailed
+			(TContactOp /*aOpCode*/, TInt aErrorCode, TBool /*aErrorNotified*/)
+	{
+    LOGSTRING2("Creator: CCreatorVirtualPhonebook::ContactOperationFailed - Error: %d", aErrorCode );
+    iWaiter->Cancel();
+	}
+	
+TAny* CCreatorVirtualPhonebook::ContactObserverExtension(TUid /*aExtensionUid*/) 
+	{
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactObserverExtension" );
+    return NULL;
+	}
+
+void CCreatorVirtualPhonebook::Pbk2ImageSetComplete(MPbk2ImageOperation& /*aOperation*/)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::Pbk2ImageSetComplete" );
+    //Canceling waiter when operation is done.
+    iWaiter->Cancel();
+    }
+
+void CCreatorVirtualPhonebook::Pbk2ImageSetFailed(MPbk2ImageOperation& /*aOperation*/, TInt /*aError*/)
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::Pbk2ImageSetFailed" );
+    //Canceling waiter when operation is done.
+    iWaiter->Cancel();
+    }
+
+
+//Observer implementation for MVPbkContactViewObserver
+//----------------------------------------------------------------------------
+void CCreatorVirtualPhonebook::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
+    {
+    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactViewReady" );
+    iWaiter->Cancel();
+    }
+
+void CCreatorVirtualPhonebook::ContactViewUnavailable(
+        MVPbkContactViewBase& /*aView*/ )
+    {
+    iWaiter->Cancel();
+    }
+
+void CCreatorVirtualPhonebook::ContactAddedToView(
+        MVPbkContactViewBase& /*aView*/, 
+        TInt /*aIndex*/, 
+        const MVPbkContactLink& /*aContactLink*/ )
+    {
+    }
+
+void CCreatorVirtualPhonebook::ContactRemovedFromView(
+        MVPbkContactViewBase& /*aView*/, 
+        TInt /*aIndex*/, 
+        const MVPbkContactLink& /*aContactLink*/ )
+    {
+    }
+        
+void CCreatorVirtualPhonebook::ContactViewError(
+        MVPbkContactViewBase& /*aView*/, 
+        TInt /*aError*/, 
+        TBool /*aErrorNotified*/ )
+    {
+    iWaiter->Cancel();
+    }
+
+/**
+ * CCreatorContactFieldImpl Base class for contact field implementations
+ */
+class CCreatorContactFieldImpl : public CBase
+    {
+public:        
+    virtual ~CCreatorContactFieldImpl() {};
+    
+    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
+    virtual void SetRandomParametersL(CCreatorContactField::TRandomLengthType aRandomLenType = CCreatorContactField::ERandomLengthDefault, TInt aRandomLen = 0 );
+    virtual void ParseL(CCommandParser* parser);
+     
+    virtual TInt FieldType();
+protected:
+    CCreatorContactFieldImpl(TInt aFieldType);    
+    TInt iFieldType;    
+    CCreatorContactField::TRandomLengthType iRandomLenType;
+    TInt iRandomLen;
+    };
+    
+void CCreatorContactFieldImpl::AddToContactL(CCreatorEngine* /*aEngine*/, MVPbkStoreContact& /*aContact*/, CCreatorVirtualPhonebook* /*aVPbk*/ )
+    {}
+
+void CCreatorContactFieldImpl::SetRandomParametersL(CCreatorContactField::TRandomLengthType aRandomLenType, TInt aRandomLen )
+    {    
+    iRandomLenType = aRandomLenType;
+    iRandomLen = aRandomLen;
+    }
+
+void CCreatorContactFieldImpl::ParseL(CCommandParser* /*parser*/)
+    {}
+    
+CCreatorContactFieldImpl::CCreatorContactFieldImpl(TInt aFieldType)
+    {
+    iFieldType = aFieldType;
+    }
+
+TInt CCreatorContactFieldImpl::FieldType()
+    {
+    return iFieldType;    
+    }
+
+
+/**
+ * CCreatorContactTextField Text field implementation
+ */
+class CCreatorContactTextField : public CCreatorContactFieldImpl
+    {
+    public:
+    static CCreatorContactTextField* NewL(TInt aFieldType, const TDesC& aData);
+    ~CCreatorContactTextField();
+    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);    
+    virtual void ParseL(CCommandParser* parser);
+    
+    protected:
+    virtual void SetDefaultRandomContentL(CCreatorEngine* aEngine);
+    virtual void SetExplicitRandomContentL(CCreatorEngine* aEngine, TInt aRandomLen);
+    
+    private:    
+    CCreatorContactTextField(TInt aFieldType);
+    void ConstructL(const TDesC& aData);
+    HBufC* iPtr;    
+    };
+    
+CCreatorContactTextField::CCreatorContactTextField(TInt aFieldType) 
+: CCreatorContactFieldImpl(aFieldType)
+    { }
+CCreatorContactTextField::~CCreatorContactTextField()
+    { 
+    delete iPtr; 
+    }
+ void CCreatorContactTextField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
+     {
+     LOGSTRING("Creator: CCreatorContactTextField::AddToContactL"); 
+     if( aVPbk == 0 )
+         User::Leave(KErrArgument);
+               
+     if( iPtr == 0 || iPtr->Length() == 0)
+         {
+         switch( iRandomLenType )
+         {
+         case CCreatorContactField::ERandomLengthDefault:
+             {
+             SetDefaultRandomContentL(aEngine);
+             break;
+             }
+         case CCreatorContactField::ERandomLengthMax:
+             {
+             const MVPbkFieldTypeList& fieldList = aContact.ParentStore().StoreProperties().SupportedFields();
+             const MVPbkFieldType* fieldType = fieldList.Find(iFieldType);
+             if( fieldType == 0 )
+                 return; // field type is not supported
+                 
+             // Create a new field
+             MVPbkStoreContactField* newField = aContact.CreateFieldLC(*fieldType);    
+             if( !newField )
+                 {
+                 User::Leave(KErrNotSupported);
+                 }
+                 
+             MVPbkContactFieldData& fieldData = newField->FieldData();  
+             //data type must be text in this case
+             TVPbkFieldStorageType dataType = fieldData.DataType();
+
+             if(dataType == EVPbkFieldStorageTypeText)
+                 {
+                 //set text to field 
+                 MVPbkContactFieldTextData& tmpData = MVPbkContactFieldTextData::Cast(fieldData);
+                 iRandomLen = tmpData.MaxLength();
+                 if( iRandomLen == KVPbkUnlimitedFieldLength )
+                     iRandomLen = 128;
+                 }
+             CleanupStack::PopAndDestroy(newField);       
+             SetExplicitRandomContentL(aEngine, iRandomLen);
+             break;
+             }
+         case CCreatorContactField::ERandomLengthExplicit:
+             {
+             SetExplicitRandomContentL(aEngine, iRandomLen);
+             break;
+             }
+         default:
+             break;
+         }
+         }
+     if( iPtr )
+         {
+         if( iFieldType == R_VPBK_FIELD_TYPE_THUMBNAILPIC )
+             {
+             if( iPtr && iPtr->Length() > 0 )
+            	 {
+            	 aVPbk->AddImageToContactL(aContact, iFieldType, iPtr->Des());
+            	 }
+             }
+         //Thumbnail id handling
+         /*else if( iFieldType == FIELD_TYPE_THUMBNAILPIC_ID )
+             {
+             if( iPtr && iPtr->Length() > 0 )
+                 {
+                 TInt id = aEngine->GetAttachmentIdL(iPtr->Des());
+                 if( id != KUndef )
+                     {
+                     //get picture path by id
+                     TFileName sourceFileName = aEngine->TestDataPathL((CCreatorEngine::TTestDataPath)id);// (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i)
+                     //set image to contact
+                     aVPbk->AddImageToContactL(aContact, R_VPBK_FIELD_TYPE_THUMBNAILPIC, sourceFileName);                     
+                     }
+                 }
+             }*/         
+         else
+             {
+             if( iPtr && iPtr->Length() > 0 )
+            	 {
+            	 aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr->Des());
+            	 }
+             }
+         }
+     }
+
+ void CCreatorContactTextField::SetDefaultRandomContentL(CCreatorEngine* aEngine)
+     {
+     LOGSTRING("Creator: CCreatorContactTextField::SetDefaultRandomContentL");
+     if( aEngine == 0 )
+         return;
+     
+     if( iPtr )
+         {
+         delete iPtr;
+         iPtr = 0;
+         }
+     TPtrC contentData;
+     
+     TInt textFieldCount = sizeof(CreatorVPbkMiscTextFields) / sizeof(FieldInfo);
+     TBool found = EFalse;
+     for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
+         {
+         if( iFieldType == CreatorVPbkMiscTextFields[tfIndex].iFieldCode )
+             {
+             found = ETrue;
+             if( CreatorVPbkMiscTextFields[tfIndex].iRandomType != RND_TYPE_UNDEF )
+                 {
+                 contentData.Set(aEngine->RandomString((CCreatorEngine::TRandomStringType) CreatorVPbkMiscTextFields[tfIndex].iRandomType));
+                 }
+             else
+                 {
+                 switch( iFieldType )
+                 {
+                 case R_VPBK_FIELD_TYPE_RINGTONE:
+                     {
+                     contentData.Set(aEngine->CreateRandomSoundFileL());
+                     break;                 
+                     }
+                 //Thumbnail (path) and thumbnailid handling with random is the same, only in script they have different handling
+                 case R_VPBK_FIELD_TYPE_THUMBNAILPIC:                 
+                     {
+                     contentData.Set(aEngine->RandomPictureFileL());
+                     break;
+                     }
+                 case R_VPBK_FIELD_TYPE_SYNCCLASS:
+                 case R_VPBK_FIELD_TYPE_LOCPRIVACY:
+                     {
+                     _LIT(KPublic, "Public");
+                     contentData.Set(KPublic);
+                     break;
+                     }
+                 default:
+                     break;
+                 }
+                 }
+             break;
+             }
+         }
+     
+     if( found == EFalse )
+         {
+         TInt phNumFieldCount = sizeof(CreatorVPbkPhoneNumberFields) / sizeof(TInt);
+         for( TInt phIndex = 0; phIndex < phNumFieldCount; ++phIndex )
+             {
+             if( iFieldType == CreatorVPbkPhoneNumberFields[phIndex] )
+                 {
+                 contentData.Set(aEngine->RandomString(CCreatorEngine::EPhoneNumber));
+                 found = ETrue;
+                 break;
+                 }
+             }
+         }
+     
+     if( found == EFalse )
+         {
+         TInt emailFieldCount = sizeof(CreatorVPbkEmailFields) / sizeof(TInt);
+         for( TInt eIndex = 0; eIndex < emailFieldCount; ++eIndex )
+             {
+             if( iFieldType == CreatorVPbkEmailFields[eIndex] )
+                 {
+                 iPtr = aEngine->CreateEmailAddressLC();
+                 CleanupStack::Pop();
+                 return;
+                 }
+             }
+         }
+     iPtr = HBufC::NewL(contentData.Length());
+     iPtr->Des().Copy(contentData);
+     }
+ 
+ void CCreatorContactTextField::SetExplicitRandomContentL(CCreatorEngine* aEngine, TInt aRandomLen)
+     {     
+     LOGSTRING("Creator: CCreatorContactTextField::SetExplicitRandomContentL");
+     if( iPtr )
+         {
+         delete iPtr;
+         iPtr = 0;
+         }
+     iPtr = aEngine->CreateRandomStringLC(aRandomLen);
+     CleanupStack::Pop(); // iPtr
+     }
+ 
+ void CCreatorContactTextField::ParseL(CCommandParser* parser)
+     {
+     parser->StrParserL(iPtr, '|');
+     }
+ 
+ void CCreatorContactTextField::ConstructL(const TDesC& aData)
+      {     
+      iPtr = HBufC::New(KPhonebookFieldLength);
+      iPtr->Des().Copy(aData);
+      }
+ 
+ CCreatorContactTextField* CCreatorContactTextField::NewL(TInt aFieldType, const TDesC& aData)
+     {
+     CCreatorContactTextField* self = new (ELeave) CCreatorContactTextField(aFieldType);
+     CleanupStack::PushL(self);
+     self->ConstructL(aData);
+     CleanupStack::Pop();
+     return self;
+     }
+ /**
+  * CCreatorContactBinaryField Binary field implementation
+  */
+ class CCreatorContactBinaryField : public CCreatorContactFieldImpl
+    {
+public:
+    static CCreatorContactBinaryField* NewL(TInt aFieldType, const TDesC8& aData);
+    ~CCreatorContactBinaryField();  
+    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
+    virtual void ParseL(CCommandParser* parser);
+    virtual void SetDefaultRandomContentL(CCreatorEngine* aEngine);
+private:
+    CCreatorContactBinaryField(TInt aFieldType);
+    void ConstructL(const TDesC8& aData);
+    HBufC8* iPtr;    
+    };
+ 
+ CCreatorContactBinaryField::CCreatorContactBinaryField(TInt aFieldType) 
+ : CCreatorContactFieldImpl(aFieldType)
+     { }
+ CCreatorContactBinaryField::~CCreatorContactBinaryField()
+     { 
+     delete iPtr; 
+     }
+   
+ void CCreatorContactBinaryField::ConstructL(const TDesC8& aData)
+     {
+     iPtr = HBufC8::New(KPhonebookFieldLength);
+     iPtr->Des() = aData;
+     }
+ 
+ CCreatorContactBinaryField* CCreatorContactBinaryField::NewL(TInt aFieldType, const TDesC8& aData)
+      {
+      CCreatorContactBinaryField* self = new (ELeave) CCreatorContactBinaryField(aFieldType);
+      CleanupStack::PushL(self);
+      self->ConstructL(aData);
+      CleanupStack::Pop();
+      return self;
+      }
+ 
+void CCreatorContactBinaryField::AddToContactL(CCreatorEngine* /*aEngine*/, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
+    {
+    LOGSTRING("Creator: CCreatorContactBinaryField::AddToContactL");
+    if( aVPbk == 0 )
+        User::Leave(KErrArgument);
+    if( iPtr )
+        {
+            aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr->Des());
+        }
+    }
+void CCreatorContactBinaryField::ParseL(CCommandParser* parser)
+     {
+     parser->StrParserL(iPtr, '&');
+     }
+
+void CCreatorContactBinaryField::SetDefaultRandomContentL(CCreatorEngine* /*aEngine*/)
+    {
+    LOGSTRING("Creator: CCreatorContactBinaryField::SetDefaultRandomContentL");
+    }
+
+/**
+ * CCreatorContactDateTimeField
+ */ 
+class CCreatorContactDateTimeField : public CCreatorContactFieldImpl
+    {
+public:
+    static CCreatorContactDateTimeField* NewL(TInt aFieldType, const TTime& aData);
+    ~CCreatorContactDateTimeField();  
+    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
+    virtual void ParseL(CCommandParser* parser);    
+private:
+CCreatorContactDateTimeField(TInt aFieldType);
+    void ConstructL(const TTime& aData);
+    TTime iPtr;    
+    };
+ 
+CCreatorContactDateTimeField::CCreatorContactDateTimeField(TInt aFieldType) 
+: CCreatorContactFieldImpl(aFieldType)
+     { }
+CCreatorContactDateTimeField::~CCreatorContactDateTimeField()
+     {
+     }
+   
+ void CCreatorContactDateTimeField::ConstructL(const TTime& aData)
+     {
+     iPtr = aData;
+     }
+ 
+ CCreatorContactDateTimeField* CCreatorContactDateTimeField::NewL(TInt aFieldType, const TTime& aData)
+      {
+      CCreatorContactDateTimeField* self = new (ELeave) CCreatorContactDateTimeField(aFieldType);
+      CleanupStack::PushL(self);
+      self->ConstructL(aData);
+      CleanupStack::Pop();
+      return self;
+      }
+ 
+void CCreatorContactDateTimeField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
+    {
+    LOGSTRING("Creator: CCreatorContactDateTimeField::AddToContactL");
+    if( aVPbk == 0 )
+        User::Leave(KErrArgument);
+    
+    //TTime undefTime();
+    if( iPtr == Time::NullTTime() )
+        {
+        iPtr = aEngine->RandomDate(CCreatorEngine::EDateFuture);
+        }
+    
+    aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr);    
+    }
+void CCreatorContactDateTimeField::ParseL(CCommandParser* /*parser*/)
+     {
+     //parser->StrParserL(iPtr, '&');
+     }
+
+/**
+ * CCreatorContactField Contact field API
+ */
+CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TDesC& aData)
+    {
+    CCreatorContactField* self = new (ELeave) CCreatorContactField();
+    CleanupStack::PushL(self);
+    self->ConstructL(aFieldType, aData);
+    CleanupStack::Pop();
+    return self;
+    }
+
+CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TDesC8& aData)
+    {
+    CCreatorContactField* self = new (ELeave) CCreatorContactField();
+    CleanupStack::PushL(self);
+    self->ConstructL(aFieldType, aData);
+    CleanupStack::Pop();
+    return self;
+    }
+
+CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TTime& aData)
+    {
+    CCreatorContactField* self = new (ELeave) CCreatorContactField();
+    CleanupStack::PushL(self);
+    self->ConstructL(aFieldType, aData);
+    CleanupStack::Pop();
+    return self;
+    }
+
+void CCreatorContactField::ConstructL(TInt aFieldType, const TDesC& aData)
+    {
+    pImpl = CCreatorContactTextField::NewL(aFieldType, aData); 
+    }
+
+void CCreatorContactField::ConstructL(TInt aFieldType, const TDesC8& aData)
+    {
+    pImpl = CCreatorContactBinaryField::NewL(aFieldType, aData);    
+    }
+
+void CCreatorContactField::ConstructL(TInt aFieldType, const TTime& aData)
+    {
+    pImpl = CCreatorContactDateTimeField::NewL(aFieldType, aData);    
+    }
+
+CCreatorContactField::CCreatorContactField()
+    {}
+CCreatorContactField::~CCreatorContactField()
+    {
+    delete pImpl;
+    }
+ 
+TInt CCreatorContactField::FieldType()
+    {
+    return pImpl->FieldType();
+    }
+void CCreatorContactField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
+    {
+    pImpl->AddToContactL(aEngine, aContact, aVPbk);
+    }
+void CCreatorContactField::ParseL(CCommandParser* parser)
+    {
+    pImpl->ParseL(parser);
+    }
+
+void CCreatorContactField::SetRandomParametersL(TRandomLengthType aRandomLenType, TInt aRandomLen )
+    {
+    pImpl->SetRandomParametersL(aRandomLenType, aRandomLen);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/engine/src/creator_wepsecuritysettings.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include "creator_traces.h"
+#include "creator_wepsecuritysettings.h"
+#include <commdb.h>
+//#include <featmgr.h>
+#include <wlancdbcols.h>
+
+//#include <commsdattypesv1_1.h>
+//#include <cmmanagertablefields.h>
+//#include <wlancontainer.h>
+
+
+
+//----------------------------------------------------------------------------
+
+CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewL()
+    {
+    CCreatorWEPSecuritySettings* self = CCreatorWEPSecuritySettings::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewLC()
+    {
+    CCreatorWEPSecuritySettings* self = new (ELeave) CCreatorWEPSecuritySettings;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+CCreatorWEPSecuritySettings::CCreatorWEPSecuritySettings()
+    {
+    }
+
+void CCreatorWEPSecuritySettings::ConstructL()
+    {
+    LOGSTRING("Creator: CCreatorWEPSecuritySettings::ConstructL");
+    }
+
+CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings()
+    {
+    LOGSTRING("Creator: CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings");
+
+    
+    }
+
+    
+
+//----------------------------------------------------------------------------
+
+
+
+// ---------------------------------------------------------
+// CWEPSecuritySettingsImpl::SaveL
+// ---------------------------------------------------------
+//
+void CCreatorWEPSecuritySettings::SaveL( TUint32 /*aIapId*/, 
+                                      CCommsDatabase& /*aCommsDb*/ ) const
+    {
+    /*
+    // Data of the key
+    TBuf8<KMaxLengthOfKeyData> iKeyData[KMaxNumberofKeys];    
+    
+    CCommsDbTableView* wLanServiceTable;
+
+    // Caller MUST initiate a transaction, WE WILL NOT.
+
+    wLanServiceTable = aCommsDb.OpenViewMatchingUintLC( 
+                    TPtrC( WLAN_SERVICE ), TPtrC( WLAN_SERVICE_ID ), aIapId );
+    TInt errorCode = wLanServiceTable->GotoFirstRecord();
+
+    if ( errorCode == KErrNone )
+        {
+        wLanServiceTable->UpdateRecord();
+        }
+    else
+        {
+        TUint32 dummyUid( 0 ); //was KUidNone
+        User::LeaveIfError( wLanServiceTable->InsertRecord( dummyUid ) );
+
+        // Save link to LAN service
+        wLanServiceTable->WriteUintL( TPtrC( WLAN_SERVICE_ID ), aIapId );
+        }
+
+    // Save index of key in use
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_INDEX ), 
+                                 ( TUint32& ) iKeyInUse );
+
+    // Save index of key in use
+    wLanServiceTable->WriteUintL( TPtrC( NU_WLAN_AUTHENTICATION_MODE ), 
+                                 ( TUint32& ) iAuthentication );
+
+    // Save first WEP key
+    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY1 ), 
+                                  iKeyData[KFirstKey] );
+
+    // Save second WEP key
+    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY2 ), 
+                                  iKeyData[KSecondKey] );
+
+    // Save third WEP key
+    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY3 ), 
+                                  iKeyData[KThirdKey] );
+
+    // Save fourth WEP key
+    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY4 ), 
+                                  iKeyData[KFourthKey] );
+
+    // Save the format of the keys
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY1_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[KFirstKey] );
+
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY2_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[KSecondKey] );
+
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY3_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[KThirdKey] );
+
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY4_FORMAT ), 
+                                 ( TUint32& ) iKeyFormat[KFourthKey] );
+
+    wLanServiceTable->PutRecordChanges();
+
+    CleanupStack::PopAndDestroy( wLanServiceTable );  // wLanServiceTable
+    */
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/files/backup_registration.xml	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <passive_backup>
+    <include_directory name="\"/>
+  </passive_backup>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- a/creator/group/ReleaseNotes_Creator.txt	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-===============================================================================
-
-RELEASE NOTES - CREATOR v5.3.5
-RELEASED 30th October 2009 
-
-SUPPORTS S60 3.0+
-
-===============================================================================
-
-Product Description:
-====================
-The Creator tool can be used to create different kinds of data into a device.
-It's useful for testing that the device works correctly when there are
-large amounts of data saved.
-
-Main Features:
-==============
-- Creating appointment, event, anniversary, todo, and reminder entries
-- Creating bookmark, bookmark folder, saved page, and saved page folder
-  entries
-- Creating different kinds of predefined file formats with or without DRM
-- Creating missed call, received call, and dialed number entries
-- Creating SMS, MMS, AMS, Email, Smart, Infrared and Bluetooth messages
-- Creating mailbox entries
-- Creating connection method, IMPS server, landmark and note entries
-- Creating contact and contact group entries
-- Entries can be created on the UI or by using scripts
-- Entries can be deleted with the UI
-
-===============================================================================
-
-What's New in v5.3.5
-====================
-- Fix: Creator crashes when creating 2000 contact entries.
-- Fix: Creator cannot create 1000 SMS messages
-
-===============================================================================
-
-Installation Notes:
-===================
-Creator is typically preinstalled on ROM. If not, it can be added to the
-ROM with the .iby file. Alternatively, a .sis file can be found under the sis-
-directory, but the user needs to sign it with their own developer certificate.
-In Nokia R&D environment, you can use directly the R&D-signed .sis file under
-the internal\sis directory.
-
-When signing with own developer certificate, the following capabilities are
-needed:
-  ReadDeviceData
-  WriteDeviceData
-  AllFiles
-  SwEvent
-  NetworkServices
-  LocalServices
-  ReadUserData
-  WriteUserData
-  Location
-  UserEnvironment
-
-===============================================================================
-
-System Requirements:
-====================
-Basic Requirements:
-- Any S60 3.x device, 5.x device or emulator environment
-
-===============================================================================
-
-Compatibility Issues:
-=====================
-Since version 5.0.0, the old .creator script files are no longer supported, 
-therefore you should use the new .creatorxml format instead. However, the script
-support is not available for S60 3.0 and 3.1 releases.
-
-When Creator has been compiled against 3.0 or 3.1, it will use the old
-phonebook and accesspoint APIs. With 3.2 and newer, new virtual phonebook and
-connection method APIs are used.
-
-===============================================================================
-
-Known Issues:
-=============
-- Generated browser saved pages cannot be opened in the browser. Currently no
-  workaround available.
-- Logs: <datetime> element is not saved into database. Event time is always
-  creation time of the event. S60 feature.
-- Deleting Notes created only with Creator is not supported
-- Deleting mailboxes is not supported
-- Deleting entries without using Creator may cause Creator to delete incorrect
-  entries when using Delete -> ... -> By Creator -command
-  
-===============================================================================
-
-Version History:
-================
-
-Version 5.3.4 - 12th October 2009
----------------------------------
-- Fix: Cannot create SMS messages in inbox with Creator
-- Fix: Softkeys are not visible immediately when progress bar is shown
-
-Version 5.3.3 - 26th August 2009
--------------------------------- 
-- Fix: Creator crashes when using scripts to create calendar appointments, 
-  which have existing contacts as attendees.
-- Fix: Destinations cannot be opened after deleting connection methods with
-  Creator.
-  
-Version 5.3.2 - 17th April 2009
-------------------------------- 
-- Fix: Creator crashes after phonebook operation
-
-Version 5.3.1 - 20th February 2009
-----------------------------------
-- Fix: Unable to create a phonebook group with more than 15 members
-
-Version 5.3.0 - 13th February 2009
-----------------------------------
-- Change: XML Schema is now available for validating Creator scripts
-- Change: Creator now deletes files created by Creator when selecting
-  Options -> Delete -> All
-- Fix: Creator crashes when creating RNG file
-- Fix: Creator crashes when creating large amount of files
-- Fix: Actual MIDI and 3GPP filenames are different from names described in
-  Creator UI
-- Fix: Text type attachment are not displayed correctly with generated messages
- 
-Version 5.2.2 - 12th December 2008
-----------------------------------
-- Change: Generated file data changed 
-
-Version 5.2.1 - 14th November 2008
-----------------------------------
-- Fix: VCS and VCF type attachments does not work with MMS in Creator scripts
-- Fix: DRM accumulated element in Creator script mixes up starttime and
-  endtime values
-- Fix: Deleting Browser Bookmark folders -> By Creator deletes all bookmark
-  folders when it should delete only those created with Creator
-
-Version 5.2.0 - 31st October 2008
----------------------------------
-- Feature: Deleting entries
-- Feature: Support for creating WMA and WMV files 
-
-Version 5.1.1 - 3rd October 2008
---------------------------------
-- Fix: Creator creates messages with invalid recepients which causes Messages
-  application to crash
-- Fix: Creator crashes when pressing cancel while creating phonebook entries
-- Feature: Script support for DRM protected files
-- Feature: "incvalueforeachcopy" attribute introduced for increasing phone
-  numbers in scripts
-  
-Version 5.1.0 - 19th September 2008
------------------------------------
-- Feature: DRM protected files can be now generated
-- Fix: Message read status does not get generated correctly from script
-- Change: Legacy version removed
-
-Version 5.0.4 - 8th August 2008
--------------------------------
-- Feature: Random string can be now specified via an external XML file if not
-  wanting to use the defaults provided by the tool
-- Fix: Crash when creating new landmark entries
-
-Version 5.0.3 - 2nd June 2008
------------------------------
-- Feature: Scripts can be now executed directly via commandline
-- Fix: With some combinations of parameters, connection method generation could
-  fail
-  
-Version 5.0.2 - 14th May 2008
------------------------------
-- Fix: Error handling in calendar entry recurrency rule improved
-- Fix: Context check for script's fields could fail
-
-Version 5.0.1 - 5th May 2008
-----------------------------
-- Fix: Calendar entry creation may crash due to incorrect status field
-- Fix: Saved deck entry creation may crash due to invalid path
-
-Version 5.0.0 - 21st April 2008
--------------------------------
-- Feature: Uses Virtual Phonebook API for S60 3.2 or newer 
-- Feature: Uses Connection Method API for S60 3.2 or newer 
-- Feature: Creation of Landmarks 
-- Feature: Completely new XML based script-format supporting all features
-- Change: Agenda API replaced with Calendar Interim API
-
-Version 4.9.0 - 1st April 2008
-------------------------------
-- Change: Modified to support coexisting with Creator 5.0.0   
-
-Version 4.8.1 - 19th March 2008
----------------------------------
-- Fix: Contact groups were created incorrectly
-
-===============================================================================
-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 "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
--- a/creator/group/backup_registration.xml	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<backup_registration>
-  <passive_backup>
-    <include_directory name="\"/>
-  </passive_backup>
-  <system_backup/>
-  <restore requires_reboot = "no"/>
-</backup_registration>
--- a/creator/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include <platform_paths.hrh>
-#include "../symbian_version.hrh"
-
-PRJ_EXPORTS
-../group/backup_registration.xml    Z:/private/20011383/backup_registration.xml
-../files/3GPP-70kB.dat              Z:/private/20011383/3GPP-70kB.3gpp
-../files/AAC-100kB.dat              Z:/private/20011383/AAC-100kB.aac
-../files/AMR-20kB.dat               Z:/private/20011383/AMR-20kB.amr
-../files/BMP-25kB.dat               Z:/private/20011383/BMP-25kB.bmp
-../files/Deck-1kB.dat               Z:/private/20011383/Deck-1kB.saveddeck
-../files/DOC-20kB.dat               Z:/private/20011383/DOC-20kB.doc
-../files/GIF-2kB.dat                Z:/private/20011383/GIF-2kB.gif
-../files/HTML-20kB.dat              Z:/private/20011383/HTML-20kB.html
-../files/JAD-1kB.dat                Z:/private/20011383/JAD-1kB.jad
-../files/JAR-10kB.dat               Z:/private/20011383/JAR-10kB.jar
-../files/JP2-65kB.dat               Z:/private/20011383/JP2-65kB.jp2
-../files/JPEG-200kB.dat             Z:/private/20011383/JPEG-200kB.jpg
-../files/JPEG-25kB.dat              Z:/private/20011383/JPEG-25kB.jpg
-../files/JPEG-500kB.dat             Z:/private/20011383/JPEG-500kB.jpg
-../files/MIDI-10kB.dat              Z:/private/20011383/MIDI-10kB.mid
-../files/MP3-250kB.dat              Z:/private/20011383/MP3-250kB.mp3
-../files/MP4-200kB.dat              Z:/private/20011383/MP4-200kB.mp4
-../files/MXMF-40kB.dat              Z:/private/20011383/MXMF-40kB.mxmf
-../files/PNG-15kB.dat               Z:/private/20011383/PNG-15kB.png
-../files/PPT-40kB.dat               Z:/private/20011383/PPT-40kB.ppt
-../files/RAM-1kB.dat                Z:/private/20011383/RAM-1kB.ram
-../files/RM-95kB.dat                Z:/private/20011383/RM-95kB.rm
-../files/RNG-1kB.dat                Z:/private/20011383/RNG-1kB.rng
-../files/SVG-15kB.dat               Z:/private/20011383/SVG-15kB.svg
-../files/SWF-15kB.dat               Z:/private/20011383/SWF-15kB.swf
-../files/TIF-25kB.dat               Z:/private/20011383/TIF-25kB.tif
-../files/TXT-10kB.dat               Z:/private/20011383/TXT-10kB.txt
-../files/TXT-70kB.dat               Z:/private/20011383/TXT-70kB.txt
-../files/VCF-1kB.dat                Z:/private/20011383/VCF-1kB.vcf
-../files/VCS-1kB.dat                Z:/private/20011383/VCS-1kB.vcs
-../files/WAV-20kB.dat               Z:/private/20011383/WAV-20kB.wav
-../files/XLS-15kB.dat               Z:/private/20011383/XLS-15kB.xls
-../files/SISX-10kB.dat              Z:/private/20011383/SISX-10kB.sisx
-../files/WMA-50kB.dat               Z:/private/20011383/WMA-50kB.wma
-../files/WMV-200kB.dat              Z:/private/20011383/WMV-200kB.wmv
-
-../scripts/creator.xsd                   +/tools/s60rndtools/creator/creator.xsd
-../scripts/browserEx.creatorxml          +/tools/s60rndtools/creator/browserEx.creatorxml
-../scripts/calendarEx.creatorxml         +/tools/s60rndtools/creator/calendarEx.creatorxml
-../scripts/connectionmethodEx.creatorxml +/tools/s60rndtools/creator/connectionmethodEx.creatorxml
-../scripts/contactEx.creatorxml          +/tools/s60rndtools/creator/contactEx.creatorxml
-../scripts/filesEx.creatorxml            +/tools/s60rndtools/creator/filesEx.creatorxml
-../scripts/impsEx.creatorxml             +/tools/s60rndtools/creator/impsEx.creatorxml
-../scripts/landmarkEx.creatorxml         +/tools/s60rndtools/creator/landmarkEx.creatorxml
-../scripts/logEx.creatorxml              +/tools/s60rndtools/creator/logEx.creatorxml
-../scripts/mailboxEx.creatorxml          +/tools/s60rndtools/creator/mailboxEx.creatorxml
-../scripts/messagesEx.creatorxml         +/tools/s60rndtools/creator/messagesEx.creatorxml
-../scripts/notepadEx.creatorxml          +/tools/s60rndtools/creator/notepadEx.creatorxml
-
-#ifdef CORE_IBY_EXPORT_PATH
-  ../rom/creator.iby CORE_IBY_EXPORT_PATH(tools,creator.iby)
-#endif
-
-
-PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
-  gnumakefile creator_icons_aif.mk
-
-  #ifdef MARM
-  gnumakefile creator_stub_sis.mk
-  #endif
-#endif
-
-creator.mmp
-
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE creator_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_creator
-  END
-
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME Creator_stub
-  END
-  #endif  
-#endif
--- a/creator/group/creator.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-#include "../symbian_version.hrh"
-
-
-TARGET            creator.exe
-TARGETTYPE        exe
-EPOCSTACKSIZE     0x5000
-EPOCHEAPSIZE      0x10000 0x2000000  // Min 64Kb, Max 32Mb
-
-UID 0x100039CE    0x20011383
-
-VENDORID          VID_DEFAULT
-CAPABILITY        CAP_APPLICATION AllFiles
-
-SMPSAFE
-
-LANG              SC
-
-
-START RESOURCE    ../data/creator.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../data/creator_reg.rss
-DEPENDS           creator.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-APP_LAYER_SYSTEMINCLUDE
-USERINCLUDE       ../inc
-SOURCEPATH        ../src
-
-
-SOURCE            creator.cpp
-SOURCE            creator_app.cpp 
-SOURCE            creator_document.cpp
-SOURCE            creator_appui.cpp
-SOURCE            creator_container.cpp
-SOURCE            creator_model.cpp
-SOURCE            creator_factory.cpp 
-SOURCE            creator_scriptentry.cpp
-SOURCE            creator_scriptparser.cpp 
-SOURCE            creator_scriptelementfactory.cpp 
-SOURCE 		      creator_scriptelement.cpp
-SOURCE            creator_calendar.cpp  
-SOURCE            creator_calendarelement.cpp 
-SOURCE            creator_message.cpp 
-SOURCE            creator_messageelement.cpp 
-SOURCE            creator_log.cpp
-SOURCE 			  creator_logelement.cpp 
-SOURCE            creator_file.cpp
-SOURCE 			  creator_fileelement.cpp 
-SOURCE            creator_browser.cpp 
-SOURCE 			  creator_browserelement.cpp 
-SOURCE            creator_mailbox.cpp
-SOURCE 			  creator_mailboxelement.cpp 
-SOURCE			  creator_landmark.cpp 
-SOURCE 			  creator_landmarkelement.cpp 
-SOURCE 			  creator_contactelement.cpp 
-SOURCE			  creator_connectionmethodelement.cpp
-SOURCE			  creator_randomdataparser.cpp
-SOURCE			  creator_contactsetcache.cpp
-
-#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
-  SOURCE			  creator_connectionmethod.cpp
-  SOURCE			  creator_accesspoint.cpp 
-#elif defined (__SERIES60_30__) || defined(__SERIES60_31__)
-  SOURCE			  creator_phonebook.cpp
-  SOURCE			  creator_accesspoint.cpp 
-#else
-  SOURCE			  creator_connectionmethod.cpp
-  SOURCE			  creator_accesspoint.cpp
-#endif  
-
-
-LIBRARY euser.lib
-LIBRARY apparc.lib
-LIBRARY cone.lib 
-LIBRARY eikcore.lib  
-LIBRARY avkon.lib 
-LIBRARY aknnotify.lib
-LIBRARY estor.lib
-LIBRARY cntmodel.lib	
-LIBRARY favouritesengine.lib
-LIBRARY msgs.lib
-LIBRARY logwrap.lib
-LIBRARY logcli.lib
-LIBRARY efsrv.lib
-LIBRARY gsmu.lib
-LIBRARY imcm.lib
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-LIBRARY npdlib.lib
-#endif
-LIBRARY bafl.lib 
-LIBRARY eikcoctl.lib 
-LIBRARY eikctl.lib
-LIBRARY commdb.lib
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-LIBRARY muiu.lib
-#endif
-LIBRARY etext.lib 
-LIBRARY commonengine.lib 
-LIBRARY commonui.lib 
-LIBRARY platformenv.lib 
-LIBRARY apgrfx.lib
-LIBRARY apmime.lib
-LIBRARY obexmtmutil.lib
-LIBRARY smcm.lib
-LIBRARY aknskins.lib
-LIBRARY aknskinsrv.lib 
-LIBRARY flogger.lib
-LIBRARY etel.lib
-LIBRARY etelmm.lib
-LIBRARY xmlframework.lib
-LIBRARY charconv.lib 
-LIBRARY senutils.lib
-LIBRARY calinterimapi.lib
-LIBRARY eposlandmarks.lib
-LIBRARY lbs.lib
-LIBRARY ecom.lib
-LIBRARY caf.lib
-LIBRARY cafutils.lib 
-LIBRARY drmrights.lib
-LIBRARY edbms.lib
-LIBRARY imageconversion.lib
-LIBRARY fbscli.lib
-LIBRARY bitmaptransforms.lib
-
-#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
-  LIBRARY apengine.lib
-  LIBRARY cmmanager.lib
-  LIBRARY cmmanagerdatabase.lib
-#elif defined (__SERIES60_30__) || defined(__SERIES60_31__) 
-  LIBRARY apengine.lib
-  LIBRARY pbkeng.lib
-#else
-	LIBRARY apengine.lib
-  LIBRARY cmmanager.lib
-  LIBRARY cmmanagerdatabase.lib
-  LIBRARY vpbkeng.lib
-  LIBRARY pbk2presentation.lib		
-#endif
-
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#ifdef __PRESENCE
-	LIBRARY wvsapsettingsstore.lib
-#endif
-#endif
--- a/creator/group/creator_icons_aif.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\creator_aif.mif
-
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN :
-	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-RESOURCE : $(ICONTARGETFILENAME)
-
-$(ICONTARGETFILENAME) : ..\icons\qgn_menu_creator.svg
-	mifconv $(ICONTARGETFILENAME) \
-		/c8,8 ..\icons\qgn_menu_creator.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/creator/group/creator_stub_sis.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-
-TARGETDIR=$(EPOCROOT)EPOC32\Data\Z\System\Install
-
-SISNAME=Creator_stub
-PKGNAME=Creator_stub
-
-$(TARGETDIR) :
-	@perl -S emkdir.pl "$(TARGETDIR)"
-
-do_nothing :
-	rem do_nothing
-
-SISFILE=$(TARGETDIR)\$(SISNAME).sis
-
-$(SISFILE) : ..\sis\$(PKGNAME).pkg
-	makesis -s $? $@ 
-
-
-
-MAKMAKE : do_nothing
-
-RESOURCE : do_nothing
-
-SAVESPACE : do_nothing
-
-BLD : do_nothing
-
-FREEZE : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-FINAL : $(TARGETDIR) $(SISFILE)
-
-CLEAN : 
-	@if exist $(SISFILE) erase $(SISFILE)
-
-RELEASABLES : 
-	@echo $(SISFILE)
--- a/creator/inc/creator.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATOR_HRH__
-#define __CREATOR_HRH__
-
-
-enum TCreatorIds
-    {
-    ECmdCreateFromFile=1,
-
-    ECmdCreateCalendarEntries,
-    ECmdCreateCalendarEntryAppointments,
-    ECmdCreateCalendarEntryEvents,
-    ECmdCreateCalendarEntryAnniversaries,
-    ECmdCreateCalendarEntryToDos,
-    ECmdCreateCalendarEntryReminders,
-
-    ECmdCreateBrowserEntries,
-    ECmdCreateBrowserBookmarkEntries,
-    ECmdCreateBrowserBookmarkFolderEntries,
-    ECmdCreateBrowserSavedPageEntries,
-    ECmdCreateBrowserSavedPageFolderEntries,
-
-    ECmdCreateFileEntries,
-    ECmdCreateFileEntryEmptyFolder,
-
-    ECmdCreateFileEntry3GPP_70kB,
-    ECmdCreateFileEntryAAC_100kB,
-    ECmdCreateFileEntryAMR_20kB,
-    ECmdCreateFileEntryBMP_25kB,
-    ECmdCreateFileEntryDeck_1kB,
-    ECmdCreateFileEntryDOC_20kB,
-    ECmdCreateFileEntryGIF_2kB,
-    ECmdCreateFileEntryHTML_20kB,
-    ECmdCreateFileEntryJAD_1kB,
-    ECmdCreateFileEntryJAR_10kB,
-    ECmdCreateFileEntryJP2_65kB,
-    ECmdCreateFileEntryJPEG_200kB,
-    ECmdCreateFileEntryJPEG_25kB,
-    ECmdCreateFileEntryJPEG_500kB,
-    ECmdCreateFileEntryMIDI_10kB,
-    ECmdCreateFileEntryMP3_250kB,
-    ECmdCreateFileEntryMP4_200kB,
-    ECmdCreateFileEntryMXMF_40kB,
-    ECmdCreateFileEntryPNG_15kB,
-    ECmdCreateFileEntryPPT_40kB,
-    ECmdCreateFileEntryRAM_1kB,
-    ECmdCreateFileEntryRM_95kB,
-    ECmdCreateFileEntryRNG_1kB,
-    ECmdCreateFileEntrySVG_15kB,
-    ECmdCreateFileEntrySWF_15kB,
-    ECmdCreateFileEntryTIF_25kB,
-    ECmdCreateFileEntryTXT_10kB,
-    ECmdCreateFileEntryTXT_70kB,
-    ECmdCreateFileEntryVCF_1kB,
-    ECmdCreateFileEntryVCS_1kB,
-    ECmdCreateFileEntryWAV_20kB,
-    ECmdCreateFileEntryXLS_15kB,
-    ECmdCreateFileEntrySISX_10kB,
-    ECmdCreateFileEntryWMA_50kB,
-    ECmdCreateFileEntryWMV_200kB,
-
-    ECmdCreateLogEntries,
-    ECmdCreateLogEntryMissedCalls,
-    ECmdCreateLogEntryReceivedCalls,
-    ECmdCreateLogEntryDialledNumbers,
-
-    ECmdCreateMessagingEntries,
-    ECmdCreateMessagingEntryCBSTopics,
-    ECmdCreateMessagingEntryDocumentsFolders,
-    ECmdCreateMessagingEntrySMSMessageCenters,
-    ECmdCreateMessagingEntryMailboxes,
-    ECmdCreateMessagingEntryMessages,
-    ECmdCreateMessagingEntryMessagesViaScript,
-    ECmdCreateMessagingEntryTemplates,
-
-    ECmdCreateRandomEntrySMSInbox,
-    ECmdCreateRandomEntrySMSDrafts,
-    ECmdCreateRandomEntrySMSOutbox,
-    ECmdCreateRandomEntrySMSSent,
-    ECmdCreateRandomEntryMMSInbox,
-    ECmdCreateRandomEntryMMSDrafts,
-    ECmdCreateRandomEntryMMSOutbox,
-    ECmdCreateRandomEntryMMSSent,
-    ECmdCreateRandomEntryAMSInbox,
-    ECmdCreateRandomEntryAMSDrafts,
-    ECmdCreateRandomEntryAMSOutbox,
-    ECmdCreateRandomEntryAMSSent,
-    ECmdCreateRandomEntryEmailInbox,
-    ECmdCreateRandomEntryEmailDrafts,
-    ECmdCreateRandomEntryEmailOutbox,
-    ECmdCreateRandomEntryEmailSent,
-    ECmdCreateRandomEntryBIOInbox,
-    ECmdCreateRandomEntryBIODrafts,
-    ECmdCreateRandomEntryBIOOutbox,
-    ECmdCreateRandomEntryBIOSent,
-    ECmdCreateRandomEntryIRInbox,
-    ECmdCreateRandomEntryIRDrafts,
-    ECmdCreateRandomEntryIROutbox,
-    ECmdCreateRandomEntryIRSent,
-    ECmdCreateRandomEntryBTInbox,
-    ECmdCreateRandomEntryBTDrafts,
-    ECmdCreateRandomEntryBTOutbox,
-    ECmdCreateRandomEntryBTSent,
-
-    ECmdCreateMiscEntries,
-    ECmdCreateMiscEntryAccessPoints,
-    ECmdCreateMiscEntryAppMenuFolders,
-    ECmdCreateMiscEntryIMPSServers,
-    ECmdCreateMiscEntryNotes,
-    ECmdCreateMiscEntrySyncSettings,
-    ECmdCreateMiscEntryLandmarks,
-
-    ECmdCreatePhoneBookEntries,
-    ECmdCreatePhoneBookEntryContacts,
-    ECmdCreatePhoneBookEntryGroups,
-    ECmdCreatePhoneBookEntrySubscribedContacts,
-
-    ECmdDeleteEntries,
-    ECmdDeleteAllEntries,
-    ECmdDeleteAllCreatorEntries,
-    ECmdDeleteContacts,
-    ECmdDeleteCreatorContacts,
-    ECmdDeleteContactGroups,
-    ECmdDeleteCreatorContactGroups,
-    ECmdDeleteCalendarEntries,
-    ECmdDeleteCreatorCalendarEntries,
-    ECmdDeleteBrowserBookmarks,
-    ECmdDeleteCreatorBrowserBookmarks,
-    ECmdDeleteBrowserBookmarkFolders,
-    ECmdDeleteCreatorBrowserBookmarkFolders,
-    ECmdDeleteBrowserSavedPages,
-    ECmdDeleteCreatorBrowserSavedPages,
-    ECmdDeleteBrowserSavedPageFolders,
-    ECmdDeleteCreatorBrowserSavedPageFolders,
-    ECmdDeleteCreatorFiles,
-    ECmdDeleteLogs,
-    ECmdDeleteCreatorLogs,
-    ECmdDeleteMessages,
-    ECmdDeleteCreatorMessages,
-    ECmdDeleteMailboxes,
-    ECmdDeleteCreatorMailboxes,
-    ECmdDeleteIAPs,
-    ECmdDeleteCreatorIAPs,
-    ECmdDeleteIMPSs,
-    ECmdDeleteCreatorIMPSs,
-    ECmdDeleteNotes,
-    // ECmdDeleteCreatorNotes, not supported
-    ECmdDeleteLandmarks,
-    ECmdDeleteCreatorLandmarks,
-
-    ECmdAboutCreator,
-
-    ECmdSelectRandomDataFile,
-
-    EProgressNote
-
-    };
-
-#endif // __CREATOR_HRH__
--- a/creator/inc/creator.pan	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATOR_PAN__
-#define __CREATOR_PAN__
-
-
-/** Creator application panic codes */
-enum TCreatorPanics 
-    {
-    ECreatorBasicUi = 1
-    // add further panics here
-    };
-
-#endif // __CREATOR_PAN__
--- a/creator/inc/creator_accesspoint.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORACCESSPOINTS_H__
-#define __CREATORACCESSPOINTS_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-#include "creator_connectionmethodbase.h"
-
-#include <e32base.h>
-#include <commdb.h>
-#include <apselect.h>
-#include <apdatahandler.h>
-#include <apaccesspointitem.h>
-#include <aputils.h>
-#include <apengineconsts.h>
-#include <msvapi.h>
-#include <mtclreg.h>
-#include <mmsclient.h>
-
-
-class CCreatorEngine;
-class CAccessPointsParameters;
-
-
-
-class CCreatorAccessPoints : public CCreatorConnectionSettingsBase, public MMsvSessionObserver
-    {
-public: 
-    static CCreatorAccessPoints* NewL(CCreatorEngine* aEngine);
-    static CCreatorAccessPoints* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorAccessPoints();
-
-private:
-    CCreatorAccessPoints();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-
-    TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters);    
-    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
-    
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CCommsDatabase* iCommsDb;
-    CApDataHandler* iApDataHandler;
-    CApUtils* iApUtils;
-    CAccessPointsParameters* iParameters;
-    RArray<TUint32> iEntryIds; // TUint32 CApDataHandler::CreateFromDataL
-
-public:
-    };
-
-
-class CAccessPointsParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*          iConnectionName; // connection name
-    TApBearerType   iBearerType; // bearer type
-    HBufC*          iWapStartPage; // WAP start page
-    TUint32         iWapWspOption; // connection type
-    HBufC*          iGprsAcessPointName; // access point name
-    HBufC*          iIspLoginName; // username
-    TBool           iSecureAuthentication; // password authentication
-    HBufC*          iIspLoginPass; // password
-    TBool           iPromptPassword; // prompt password
-    HBufC*          iWapGatewayAddress; // WAP gateway address
-    HBufC*          iIspIPAddr; // phone IP
-    HBufC*          iIspIPNameServer1;  // primary name server
-    HBufC*          iIspIPNameServer2;  // secondary name server
-    HBufC*          iIspDefaultTelNumber; // datacall number
-    TUint32         iIspBearerCallTypeIsdn; // datacall type
-    TUint32         iIspBearerSpeed;  // max connection speed
-    HBufC*          iProxyServerAddress;  // proxy address
-    TUint32         iProxyPortNumber; // proxy number
-    
-    void SetRandomCMNameL(CCreatorEngine& aEngine);
-    void SetRandomLoginNameL(CCreatorEngine& aEngine);
-    void SetRandomLoginPassL(CCreatorEngine& aEngine);
-    void SetRandomSecureAuthenticationL(CCreatorEngine& aEngine);
-    void SetRandomPromptPasswordL(CCreatorEngine& aEngine);
-    void SetRandomProxyAddressL(CCreatorEngine& aEngine);
-    void SetRandomProxyPortL(CCreatorEngine& aEngine);
-    void SetRandomStartPageL(CCreatorEngine& aEngine);
-    void SetRandomIPAddressL(CCreatorEngine& aEngine);
-    void SetRandomIP4NameServer1L(CCreatorEngine& aEngine);
-    void SetRandomIP4NameServer2L(CCreatorEngine& aEngine);
-    void SetRandomTelephoneNumberL(CCreatorEngine& aEngine);
-    void SetRandomBearerTypeIsdnL(CCreatorEngine& aEngine);
-    void SetRandomBearerSpeedL(CCreatorEngine& aEngine);
-    void SetRandomWapWspOptionL(CCreatorEngine& aEngine);
-    void SetRandomGatewayAddressL(CCreatorEngine& aEngine);
-    
-
-public:
-    CAccessPointsParameters();
-    ~CAccessPointsParameters();
-    };
-
-
-
-#endif // __CREATORACCESSPOINTS_H__
--- a/creator/inc/creator_app.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATOR_APPLICATION_H__
-#define __CREATOR_APPLICATION_H__
-
-#include <aknapp.h>
-
-static const TUid KUidCreatorApp = {0x20011383}; 
-
-/*! 
-  @class CCreatorApplication
-  
-  @discussion An instance of CCreatorApplication is the application part of the AVKON
-  application framework for the Creator example application
-  */
-class CCreatorApplication : public CAknApplication
-    {
-public:  // from CApaApplication
-
-/*! 
-  @function AppDllUid
-  
-  @discussion Returns the application DLL UID value
-  @result the UID of this Application/Dll
-  */
-    TUid AppDllUid() const;
-
-protected: // from CEikApplication
-/*! 
-  @function CreateDocumentL
-  
-  @discussion Create a CApaDocument object and return a pointer to it
-  @result a pointer to the created document
-  */
-    CApaDocument* CreateDocumentL();
-    };
-
-#endif // __CREATOR_APPLICATION_H__
--- a/creator/inc/creator_appui.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATOR_APPUI_H__
-#define __CREATOR_APPUI_H__
-
-#include "creator_model.h"
-#include <creator.rsg>
-#include <aknappui.h>
-#include <aknnotewrappers.h> 
-
-
-class CCoeEnv;
-class CCreatorEngine;
-
-class CCreatorAppView;
-
-
-
-/*! 
-  @class CCreatorAppUi
-  
-  @discussion An instance of class CCreatorAppUi is the UserInterface part of the AVKON
-  application framework for the Creator example application
-  */
-class CCreatorAppUi : public CAknAppUi, public MBeating
-    {
-public:
-/*!
-  @function ConstructL
-  
-  @discussion Perform the second phase construction of a CCreatorAppUi object
-  this needs to be public due to the way the framework constructs the AppUi 
-  */
-    void ConstructL();
-
-/*!
-  @function CCreatorAppUi
-  
-  @discussion Perform the first phase of two phase construction.
-  This needs to be public due to the way the framework constructs the AppUi 
-  */
-    CCreatorAppUi();
-
-
-/*!
-  @function ~CCreatorAppUi
-  
-  @discussion Destroy the object and release all memory objects
-  */
-    ~CCreatorAppUi();
-
-
-public: // from CEikAppUi
-/*!
-  @function HandleCommandL
-  
-  @discussion Handle user menu selections
-  @param aCommand the enumerated code for the option selected
-  */
-    void HandleCommandL(TInt aCommand);
-
-
-
-public: // from MEikMenuPaneObserver
-    
-    /*!
-     @function DynInitMenuPaneL
-
-     @discussion Initialise a menu pane before it is displayed
-     @param aMenuId id of menu
-     @param aMenuPane handle for menu pane
-     */
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-    // callback from engine when the commands from the script file have been executed
-    void RunScriptDone();
-
-    // from MBeating
-    void Beat();
-    void Synchronize();
-
-private:
-	void Tick();
-	
-protected:
-    CEikonEnv* iEnv;
-
-
-//private:
-public:
-    CCreatorAppView* iAppView;
-    CCreatorEngine* iEngine;
-
-
-
-public:
-
-private:
-	HBufC* iCommandLineScriptName;
-	HBufC* iCommandLineRandomDataFileName;
-	CHeartbeat* iTimer;
-	enum TTimerMode
-		{
-		ETimerModeNone,
-		ETimerModeStartScript,
-		ETimerModeExitAppUi
-		};
-	TTimerMode iMode;
-	TInt iTickCount;
-    };
-
-
-
-
-
-#endif // __CREATOR_APPUI_H__
-
--- a/creator/inc/creator_browser.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORBROWSER_H__
-#define __CREATORBROWSER_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-#include <e32base.h>
-#include <FavouritesItem.h>
-#include <FavouritesDb.h>
-#include <FavouritesFile.h>
-
-
-
-class CCreatorEngine;
-class CBrowserParameters;
-
-
-class CCreatorBrowser : public CBase, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorBrowser* NewL(CCreatorEngine* aEngine);
-    static CCreatorBrowser* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorBrowser();
-
-private:
-    CCreatorBrowser();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateBookmarkEntryL(CBrowserParameters *aParameters);    
-    TInt CreateBookmarkFolderEntryL(CBrowserParameters *aParameters);
-    TInt CreateSavedDeckEntryL(CBrowserParameters *aParameters); 
-    TInt CreateSavedDeckFolderEntryL(CBrowserParameters *aParameters);
-    
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    
-    void DeleteAllBookmarksL();
-    void DeleteAllBookmarksCreatedByCreatorL();
-    void DeleteAllBookmarkFoldersL();
-    void DeleteAllBookmarkFoldersCreatedByCreatorL();
-    void DeleteAllSavedPagesL();
-    void DeleteAllSavedPagesCreatedByCreatorL();
-    void DeleteAllSavedPageFoldersL();
-    void DeleteAllSavedPageFoldersCreatedByCreatorL();
-
-private:
-    void DeleteAllItemsL( const TDesC& aDbName, CFavouritesItem::TType aTypeFilter, TBool aOnlyCreatedWithCreator, RArray<TInt>& aEntryIds, const TUid aDictUid );
-    
-
-
-private:
-    CBrowserParameters* iParameters;
-    RArray<TInt> iBmEntryIds;
-    RArray<TInt> iBmFEntryIds;
-    RArray<TInt> iSpEntryIds;
-    RArray<TInt> iSpFEntryIds;
-public:
-    };
-
-
-class CBrowserParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*              iBookmarkName;
-    HBufC*              iBookmarkAddress;
-    TFavouritesWapAp    iBookmarkAccessPoint;
-    HBufC*              iBookmarkUsername;
-    HBufC*              iBookmarkPassword;    
-
-    HBufC*              iBookmarkFolderName;
-    
-    HBufC*              iSavedDeckLinkName;
-    HBufC*              iSavedDeckLocalAddress;
-            
-    HBufC*              iSavedDeckFolderName;
-
-public:
-    CBrowserParameters();
-    ~CBrowserParameters();
-    };
-
-
-
-#endif // __CREATORBROWSER_H__
--- a/creator/inc/creator_browserelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORBROWSERELEMENT_H_
-#define CREATORBROWSERELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorbrowser
-{
-_LIT(KBookmark, "bookmark");
-_LIT(KBookmarkFolder, "bookmarkfolder");
-_LIT(KSavedPage, "savedpage");
-_LIT(KSavedPageFolder, "savedpagefolder");
-
-_LIT(KName, "name");
-_LIT(KPath, "path");
-_LIT(KUsername, "username");
-_LIT(KPassword, "password");
-_LIT(KUrl, "url");
-}
-
-class CCreatorBrowserElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorBrowserElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorBrowserElement(CCreatorEngine* aEngine);    
-    TInt GetBrowserCommandL() const;
-};
-#endif /*CREATORBROWSERELEMENT_H_*/
--- a/creator/inc/creator_calendar.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORCALENDARINTERIM_H__
-#define __CREATORCALENDARINTERIM_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-#include "creator_calendarbase.h"
-
-#include <e32base.h>
-#include <e32std.h>
-
-//#include <calenlauncher.h> 
-#include <calentry.h>
-#include <calentryview.h>
-#include <caltime.h>
-#include <calsession.h>
-#include <calprogresscallback.h>
-#include <calcategory.h>
-#include <caluser.h>
-#include <calrrule.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include <MVPbkSingleContactOperationObserver.h>
-#include <MVPbkContactStoreListObserver.h>
-#include <MVPbkContactFindObserver.h>
-class CVPbkContactManager;
-#endif
-
-class CCreatorEngine;
-class CCalenderInterimParameters;
-class CAsyncWaiter;
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-class CCreatorInterimCalendar : public CCreatorCalendarBase, public MCalProgressCallBack, 
-public MVPbkSingleContactOperationObserver, public MVPbkContactStoreListObserver, public MVPbkContactFindObserver
-#else
-class CCreatorInterimCalendar : public CCreatorCalendarBase, public MCalProgressCallBack
-#endif
-    {
-public: 
-    static CCreatorInterimCalendar* NewL(CCreatorEngine* aEngine);
-    static CCreatorInterimCalendar* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorInterimCalendar();
-
-private:
-    CCreatorInterimCalendar();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-    void AddRepeatingRuleL(const TCalTime& aStartTime, CCalEntry& aCalEntry, CCalenderInterimParameters* parameters=0);
-    void SetRandomAlarmL(CCalEntry& aCalEntry);
-    void SetAlarmL(CCalEntry& aCalEntry, CCalenderInterimParameters* params);
-    void AddAttendeesL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters=0);
-    void SetPhoneOwnerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy );
-    void SetOrganizerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy);
-    void SetOrganizerL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters );
-    
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-
-    TInt CreateAppointmentEntryL(CCreatorModuleBaseParameters *aParameters);    
-    TInt CreateEventEntryL(CCreatorModuleBaseParameters *aParameters);
-    TInt CreateAnniversaryEntryL(CCreatorModuleBaseParameters *aParameters); 
-    TInt CreateTodoEntryL(CCreatorModuleBaseParameters *aParameters);
-    TInt CreateReminderEntryL(CCreatorModuleBaseParameters *aParameters);
-    
-    void GenerateRandomId(TDes8& aText);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    
-public:
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    // From MVPbkSingleContactOperationObserver:
-    virtual void VPbkSingleContactOperationComplete(
-            MVPbkContactOperationBase& aOperation,
-            MVPbkStoreContact* aContact );
-    
-    virtual void VPbkSingleContactOperationFailed(
-            MVPbkContactOperationBase& aOperation, 
-            TInt aError );
-    
-    // From MVPbkContactStoreListObserver
-    virtual void OpenComplete();
-    virtual void StoreReady(MVPbkContactStore&);
-    virtual void StoreUnavailable(MVPbkContactStore&, TInt);
-    virtual void HandleStoreEventL(MVPbkContactStore&, TVPbkContactStoreEvent);
-    
-    // From MVPbkContactFindObserver
-    virtual void FindCompleteL( MVPbkContactLinkArray* aResults );
-    virtual void FindFailed( TInt aError );
-    void HandleSingleContactResultL();
-#endif
-
-private:
-
-    CCalenderInterimParameters* iParameters;
-    TTime   iRandomModeStartTime;
-    TTime   iRandomModeEndTime;
-    TInt    iNumberRepeatingEntries;
-    TInt    iNumberOfAttendees;
-    CCalEntryView* 		iCalEntryView;
-    CCalSession* 		iCalSession;
-    TBool iSetAlarm;
-    CDesCArrayFlat* iSoundFileArray;
-    CAsyncWaiter* iWaiter;
-    HBufC* iTmpCN;
-    HBufC* iTmpEmail;
-    RArray<TUint32> iEntryIds; // TCalLocalUid ( == TUint32 ) CCalEntry::LocalUidL
-    
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    CVPbkContactManager* iContactManager;
-    MVPbkContactLinkArray* iExistingContacts;
-    MVPbkStoreContact* iTempContact;
-#endif
-public:
-
-    //Observer implementation for MCalProgressCallBack
-	void Progress(TInt aPercentageCompleted);
-	
-	void Completed(TInt aError);
-	
-	TBool NotifyProgress();
-
-    };
-
-class CCreatorCalenderAttendee : public CBase
-{
-public:
-    virtual ~CCreatorCalenderAttendee();
-    static CCreatorCalenderAttendee* NewL();
-    void SetCommonNameL(const TDesC& aName);
-    void SetEmailAddressL(const TDesC& aEmail);
-    void SetRole(CCalAttendee::TCalRole aRole);
-    void SetStatus(CCalAttendee::TCalStatus);
-    
-    const TDesC& CommonName() const;
-    const TDesC& EmailAddress() const;
-    CCalAttendee::TCalRole Role() const;
-    CCalAttendee::TCalStatus Status() const;
-    
-private:
-    CCreatorCalenderAttendee();
-    TPtrC  iDummy;
-    HBufC* iCommonName;
-    HBufC* iEmailAddress;
-    CCalAttendee::TCalRole iRole;
-    CCalAttendee::TCalStatus iStatus;
-};
-
-class CCalenderInterimParameters : public CCreatorModuleBaseParameters
-    {
-public:
-
-	void ParseL(CCommandParser* parser, TParseParams aCase);
-	TBool IsAllowedEntryStatus(CCalEntry::TType aType, CCalEntry::TStatus aStatus);
-
-	TCalRRule::TType iRecurrentFrequency;
-	TInt iRecurrentInterval;
-	TTime iRecurrentStartTime;
-	TTime iRecurrentEndTime;
-	TInt iRepeatingCount; // This is used when running a script...
-	TTime iAlarmTime; // NullTTime means no alarm
-	TBool iUseRandomAlarmTime; // ETrue if random alarm should be set. Overwrites the iAlarmTime.
-	
-	RPointerArray<CCreatorCalenderAttendee> iAttendees;
-	RArray<TLinkIdParam> iAttendeeLinkIds; // For attendees. Stores the linked contact ids.
-	HBufC* iOrganizerName;
-	HBufC* iOrganizerEmail;
-		 
-	HBufC*  iDescription;
-	HBufC*  iSummary;
-	HBufC*  iLocation;
-	TTime   iStartTime;
-	TTime   iEndTime;
-	TInt    iNumberRepeatingEntries; // This is used when user input is used...
-	TInt    iNumberOfAttendees; // Number of randomly generated attendees
-	TInt    iNumberOfExistingAttendees; // Number of attendees selected from existing contacts.
-	
-	//An appointment, which has a start time and end time.
-    TTime   iAppointmentStartTime;
-    TTime   iAppointmentEndTime;
-    HBufC*  iAppointmentLocation;
-    HBufC*  iAppointmentReason;
-
-    //An event, which has a start time and end time.
-    
-    TTime   iEventStartTime;
-    TTime   iEventEndTime;
-    HBufC*  iEventReason;
-
-    //A reminder, which has a start time only.
-    TTime   iReminderStartTime;
-    HBufC*  iReminderReason;
-    
-    //An anniversary, which has a start time and end time.
-    TTime   iAnniversaryStartTime;
-    TTime   iAnniversaryEndTime;
-    HBufC*  iAnniversaryReason;
-
-    //A to-do, which can have a start time and end time (the end time is the due date), or can be undated.
-    TTime   iTodoStartTime;//optional
-    TTime   iTodoDueTime;//also end time (optional)
-    HBufC*  iTodoTask;
-    TInt    iTodoPriority;
-
-    TTime   iRandomModeStartTime;
-    TTime   iRandomModeEndTime;
-    
-    CCalEntry::TStatus iStatus;
-    
-public:
-	CCalenderInterimParameters();
-    ~CCalenderInterimParameters();   
-    
-    };
-
-
-
-#endif // __CREATORCALENDARINTERIM_H__
--- a/creator/inc/creator_calendarbase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CCREATORCALENDARBASE_
-#define CCREATORCALENDARBASE_
-
-#include "creator_modulebase.h"
-
-class CCreatorModuleBaseParameters;
-
-class CCreatorCalendarBase : public CBase, public MCreatorModuleBase{
-public:
-
-
-    //An appointment, which has a start time and end time. EAppt.
-    virtual TInt CreateAppointmentEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    //An event, which has a start time and end time. EEvent.
-    virtual TInt CreateEventEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    //An anniversary, which has a start time and end time. EAnniv.
-    virtual TInt CreateAnniversaryEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    //A to-do, which can have a start time and end time (the end time is the due date), or can be undated. ETodo.
-    virtual TInt CreateTodoEntryL(CCreatorModuleBaseParameters *aParameters) = 0;     
-    //A reminder, which has a start time only. EReminder.
-    virtual TInt CreateReminderEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-
-};
-
-#endif /*CCREATORCALENDARBASE_*/
--- a/creator/inc/creator_calendarelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORCALENDARELEMENT_H_
-#define CREATORCALENDARELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-class CCalenderInterimParameters;
-
-// Calendar elements:
-namespace creatorcalendar
-{
-    _LIT(KCalendar, "calendar");
-
-    // Calendar entry types:
-    _LIT(KType, "type");
-    _LIT(KCalTypeAppointment, "appointment");
-    _LIT(KCalTypeEvent, "event");
-    _LIT(KCalTypeReminder, "reminder");
-    _LIT(KCalTypeAnniversary, "anniversary");
-    _LIT(KCalTypeTodo, "todo");
-
-    // Calendar entry field elements:
-    _LIT(KSummary, "summary");
-    _LIT(KDescription, "description");
-    _LIT(KLocation, "location");
-    _LIT(KStarttime, "starttime");
-    _LIT(KEndtime, "endtime");
-    _LIT(KRecurrentFreq, "recurrentfrequency");
-    _LIT(KRecurrentInterval, "recurrentinterval");
-    _LIT(KRecurrentFrom, "recurrentfrom");
-    _LIT(KRecurrentTo, "recurrentto");
-    _LIT(KRepeatingCount, "repeatingcount");
-    _LIT(KAlarmtime, "alarmtime");
-    _LIT(KSynchronization, "synchronization");
-    _LIT(KOrganizername, "organizername");
-    _LIT(KOrganizeremail, "organizeremail");
-    _LIT(KAttendees, "attendees");
-    _LIT(KAttendee, "attendee");
-    _LIT(KCommonname, "commonname");
-    _LIT(KEmail, "email");
-    _LIT(KRole, "role");
-    _LIT(KStatus, "status");
-    _LIT(KPriority, "priority");
-
-    // Recurrency frequency values:
-    _LIT(KNotRepeated, "not-repeated");
-    _LIT(KWeekly, "weekly");
-    _LIT(KDaily, "daily");
-    _LIT(KMonthly, "monthly");
-    _LIT(KYearly, "yearly");
-
-    // Attendee role values:
-    _LIT(KRoleRequired, "required");
-    _LIT(KRoleOptional, "optional");
-    _LIT(KRoleNonPart, "non-participant");
-    _LIT(KRoleChair, "chair");
-    
-    // Calendar entry status values:
-    _LIT(KCalStatusTentative, "tentative");
-    _LIT(KCalStatusConfirmed, "confirmed");
-    _LIT(KCalStatusCancelled, "cancelled");
-    _LIT(KCalStatusNeedsAction, "todoneedsaction");
-    _LIT(KCalStatusCompleted, "todocompleted");
-    _LIT(KCalStatusInProcess, "todoinprocess");
-
-    // Attendee status values:
-    _LIT(KStatusNeedsAction, "needsaction");
-    _LIT(KStatusAccepted, "accepted");
-    _LIT(KStatusTentative, "tentative");
-    _LIT(KStatusConfirmed, "confirmed");
-    _LIT(KStatusDeclined, "declined");
-    _LIT(KStatusCompleted, "completed");
-    _LIT(KStatusDelegated, "delegated");
-    _LIT(KStatusInProcess, "inprocess");
-    
-    // Priority values:
-    _LIT(KPriorityHigh, "high");
-    _LIT(KPriorityMedium, "medium");
-    _LIT(KPriorityLow, "low");
-}
-
-class CCreatorCalendarElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorCalendarElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-protected:
-    CCreatorCalendarElement(CCreatorEngine* aEngine);
-    
-    enum TEntryType {
-        EAppointment,
-        EEvent,
-        EReminder,
-        EAnniversary,
-        ETodo
-    };
-    
-    void FillEntryParamsL(TEntryType aType, const RPointerArray<CCreatorScriptElement>& fields, CCalenderInterimParameters* parameters); 
-};
-
-#endif /*CREATORCALENDARELEMENT_H_*/
--- a/creator/inc/creator_connectionmethod.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATORCONNECTIONSETTINGS_H__
-#define __CREATORCONNECTIONSETTINGS_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-#include "creator_connectionmethodbase.h"
-
-#include <e32base.h>
-#include <commdb.h>
-#include <msvapi.h>
-#include <mtclreg.h>
-#include <mmsclient.h>
-
-#include <cmconnectionmethoddef.h>
-#include <cmmanagerext.h>
-#include <cmpluginwlandef.h>
-using namespace CMManager;
-
-#include <etelpckt.h>//ETel Packet API needed for enums
-
-class CCreatorEngine;
-class CConnectionSettingsParameters;
-
-class CCreatorConnectionSettings : public CCreatorConnectionSettingsBase, public MMsvSessionObserver
-    {
-public: 
-    static CCreatorConnectionSettings* NewL(CCreatorEngine* aEngine);
-    static CCreatorConnectionSettings* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorConnectionSettings();
-
-private:
-    CCreatorConnectionSettings();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
-        
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    
-    TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters);    
-    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
-    
-    //Setting default connection method, if not set
-    void SetDefaultCML(RCmConnectionMethodExt conMethod);
-    //Set random parameters
-    void SetRandomParametersL(CConnectionSettingsParameters& parameters);
-    void SetRandomBearerTypeL(CConnectionSettingsParameters& parameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-private:
-    void DeleteAllDestinationsL( TBool aOnlyCreatedWithCreator );
-private:
-    CCommsDatabase* iCommsDb;
-    
-    RCmManagerExt iCmManagerExt;
-
-    CConnectionSettingsParameters* iParameters;
-    
-    RArray<TUint32> iEntryIds; // TUint32 RCmDestinationExt::Id()
-
-public:
-    };
-
-   
-class CConnectionSettingsParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*          iConnectionName; // connection name
-    TUint           iBearerType; // bearer type
-    HBufC*          iStartPage; // start page
-    TWapWSPOption   iWapWspOption; // Indicating whether connection-oriented  or connectionless API should be used.
-    
-    RPacketContext::TProtocolType iProtocolType; //Type of protocol EPdpTypeIPv4 or EPdpTypeIPv4
-    
-    HBufC*          iLoginName; // username
-    TBool           iSecureAuthentication; // password authentication
-    HBufC*          iLoginPass; // password
-    TBool           iPromptPassword; // prompt password
-    HBufC*          iGatewayAddress; // gateway address
-    HBufC*          iSubnetMask;  // subnet mask
-    HBufC*          iIPAddr; // phone IP
-    HBufC*          iIP4NameServer1;  // primary name server
-    HBufC*          iIP4NameServer2;  // secondary name server
-    HBufC*          iDefaultTelNumber; // datacall number
-    TUint32         iBearerCallTypeIsdn; // datacall type
-    TUint32         iBearerSpeed;  // max connection speed
-    TBool           iUseProxy; //Use proxy or not
-    HBufC*          iProxyServerAddress;  // proxy address
-    TUint32         iProxyPortNumber; // proxy number
-    HBufC*          iWLANName;//WLAN network name
-    HBufC*          iWlanIpAddr;//IP address of EPOC.
-    TWlanSecMode    iWLanSecMode;//WLAN security modes
-    TWlanNetMode    iWlanNetMode;//WLAN connection mode. Ad-hoc or infrastructure.
-
-    HBufC*          iIP6NameServer1;  // primary name server for IP v6
-    HBufC*          iIP6NameServer2;  // secondary name server for IP v6
-    TBool           iDisableTextAuth; // Disable plaintext authentication 
-    
-    CCreatorEngine* iEngine;
-    
-public:
-    CConnectionSettingsParameters();
-    ~CConnectionSettingsParameters();   
-    
-    void SetRandomCMNameL(CCreatorEngine& aEngine);
-    void SetRandomWLANNameL(CCreatorEngine& aEngine);
-    void SetRandomWLANNetModeL(CCreatorEngine& aEngine);
-    void SetRandomWLANSecurityModeL(CCreatorEngine& aEngine);
-    void SetRandomLoginNameL(CCreatorEngine& aEngine);
-    void SetRandomLoginPassL(CCreatorEngine& aEngine);
-    void SetRandomSecureAuthenticationL(CCreatorEngine& aEngine);
-    void SetRandomPromptPasswordL(CCreatorEngine& aEngine);
-    void SetRandomUseProxyL(CCreatorEngine& aEngine);
-    void SetRandomProxyAddressL(CCreatorEngine& aEngine);
-    void SetRandomProxyPortL(CCreatorEngine& aEngine);
-    void SetRandomStartPageL(CCreatorEngine& aEngine);
-    void SetRandomIPAddressL(CCreatorEngine& aEngine);
-    void SetRandomIP4NameServer1L(CCreatorEngine& aEngine);
-    void SetRandomIP4NameServer2L(CCreatorEngine& aEngine);
-    void SetRandomProtocolTypeL(CCreatorEngine& aEngine);
-    void SetRandomTelephoneNumberL(CCreatorEngine& aEngine);
-    void SetRandomBearerTypeIsdnL(CCreatorEngine& aEngine);
-    void SetRandomBearerSpeedL(CCreatorEngine& aEngine);
-    void SetRandomWapWspOptionL(CCreatorEngine& aEngine);
-    void SetRandomSubnetMaskL(CCreatorEngine& aEngine);
-    void SetRandomGatewayAddressL(CCreatorEngine& aEngine);
-    void SetRandomWlanIpAddrL(CCreatorEngine& aEngine);
-    void SetRandomIPv6NameServer1L(CCreatorEngine& aEngine);
-    void SetRandomIPv6NameServer2L(CCreatorEngine& aEngine);
-    void SetRandomDisableTextAuthL(CCreatorEngine& aEngine);
-    };
-
-
-
-#endif // __CREATORCONNECTIONSETTINGS_H__
--- a/creator/inc/creator_connectionmethodbase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CCREATORCONNECTIONSETTINGSBASE_H_
-#define __CCREATORCONNECTIONSETTINGSBASE_H_
-
-#include "creator_modulebase.h"
-
-class CCreatorModuleBaseParameters;
-
-const TUint KRandomBearerType = 0xEEEEEEEE;
-
-class CCreatorConnectionSettingsBase : public CBase, public MCreatorModuleBase
-    {
-public:
-    
-    virtual ~CCreatorConnectionSettingsBase(){};
-
-    virtual TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters) = 0;    
-    virtual TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse ) = 0;
-    virtual void DeleteAllConnectionMethodsL(){};
-    };
-
-#endif /*__CCREATORCONNECTIONSETTINGSBASE_H_*/
--- a/creator/inc/creator_connectionmethodelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORCONNECTIONMETHODELEMENT_H_
-#define CREATORCONNECTIONMETHODELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorconnectionmethod
-{
-    _LIT(KCm, "connectionmethod");
-    _LIT(Kconnectionname, "connectionname");
-    _LIT(Kbearertype, "bearertype");
-    _LIT(Kstartpage, "startpage");
-    _LIT(Kwapwspoption, "wapwspoption");
-    _LIT(Kprotocoltype, "protocoltype");
-    _LIT(Kloginname, "loginname");
-    _LIT(Ksecureauthentication, "secureauthentication");
-    _LIT(Kloginpass, "loginpass");
-    _LIT(Kpromptpassword, "promptpassword");
-    _LIT(Kgatewayaddress, "gatewayaddress");
-    _LIT(Ksubnetmask, "subnetmask");
-    _LIT(Kdeviceipaddr, "deviceipaddr");
-    _LIT(Kip4nameserver1, "ip4nameserver1");
-    _LIT(Kip4nameserver2, "ip4nameserver2");
-    _LIT(Kdatacalltelnumber, "datacalltelnumber");
-    _LIT(Kdatacalltypeisdn, "datacalltypeisdn");
-    _LIT(Kdatacalllinespeed, "datacalllinespeed");
-    _LIT(Kuseproxy, "useproxy");
-    _LIT(Kproxyserveraddress, "proxyserveraddress");
-    _LIT(Kproxyportnumber, "proxyportnumber");
-    _LIT(Kip6nameserver1, "ip6nameserver1");
-    _LIT(Kip6nameserver2, "ip6nameserver2");
-    _LIT(Kdisabletextauth, "disabletextauth");
-    _LIT(Kwlanname, "wlanname");
-    _LIT(Kwlanipaddr, "wlanipaddr");
-    _LIT(Kwlansecmode, "wlansecmode");
-    _LIT(Kwlannetmode, "wlannetmode");
-    
-    // Bearer type:
-    _LIT(Kwlan, "wlan");
-    _LIT(Kgprs, "gprs");
-    _LIT(Kdatacall, "datacall");
-    _LIT(Khsgsm, "hsgsm");
-    _LIT(Kembedded, "embedded");
-    _LIT(Kvpn, "vpn");
-    _LIT(Klan, "lan");
-    
-    // Data call type isdn:
-    _LIT(Kanalogue, "analogue");
-    _LIT(Kisdnv110, "isdnv110");
-    _LIT(Kisdnv120, "isdnv120");
-    
-    // Line speed:
-    _LIT(Kautomatic, "automatic");
-    // WAP wps options:
-    _LIT(Kconnectionless, "connectionless"); // ECmWapWspOptionConnectionless
-    _LIT(Kconnectionoriented, "connectionoriented"); // ECmWapWspOptionConnectionOriented
-    
-    // Protocol
-    _LIT(Kipv4, "ipv4");
-    _LIT(Kipv6, "ipv6");
-
-    // WLAN security mode:
-    _LIT(Kopen, "open");
-    _LIT(Kwep, "wep");
-    _LIT(Ke802_1x, "e802_1x");
-    _LIT(Kwpa, "wpa");
-    _LIT(Kwpa2, "wpa2");
-}
-
-class CCreatorConnectionMethodElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorConnectionMethodElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorConnectionMethodElement(CCreatorEngine* aEngine);
-};
-
-#endif /*CREATORCONNECTIONMETHODELEMENT_H_*/
--- a/creator/inc/creator_contactelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORCONTACTELEMENT_H_
-#define CREATORCONTACTELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorcontact
-{ 
-    _LIT(KContact, "contact");
-    _LIT(KContactSet, "contact-set");
-    _LIT(KContactGroup, "contactgroup");
-    _LIT(KMembers, "members");
-    _LIT(KName, "name");
-    
-    // Contact field elements:
-    _LIT(KFirstname, "firstname");
-    _LIT(KLastname, "lastname");
-    _LIT(KFirstnameReading, "firstnamereading");
-    _LIT(KLastnameReading, "lastnamereading");
-    _LIT(KPrefix, "prefix");
-    _LIT(KSuffix, "suffix");
-    _LIT(KSecondname, "secondname");
-    _LIT(KLandphoneHome, "landphonehome");
-    
-    _LIT(KMobilephoneHome, "mobilephonehome");
-    _LIT(KVideonumberHome, "videonumberhome");
-    _LIT(KFaxnumberHome, "faxnumberhome");
-    _LIT(KVoipHome, "voiphome");
-    _LIT(KEmailHome, "emailhome");
-    _LIT(KUrlHome, "urlhome");
-    _LIT(KAddrlabelHome, "addrlabelhome");
-    _LIT(KAddrpoHome, "addrpohome");
-    
-    _LIT(KAddrextHome, "addrexthome");
-    _LIT(KAddrstreetHome, "addrstreethome");
-    _LIT(KAddrlocalHome, "addrlocalhome");
-    _LIT(KAddrregionHome, "addrregionhome");
-    _LIT(KAddrpostcodeHome, "addrpostcodehome");
-    _LIT(KAddrcountryHome, "addrcountryhome");
-    _LIT(KJobtitle, "jobtitle");
-    _LIT(KCompanyname, "company");
-    
-    _LIT(KLandphoneWork, "landphonework");
-    _LIT(KMobilephoneWork, "mobilephonework");
-    _LIT(KVideonumberWork, "videonumberwork");
-    _LIT(KFaxnumberWork, "faxnumberwork");
-    _LIT(KVoipWork, "voipwork");
-    _LIT(KEmailWork, "emailwork");
-    _LIT(KUrlWork, "urlwork");
-    _LIT(KAddrlabelWork, "addrlabelwork");
-    
-    _LIT(KAddrpoWork, "addrpowork");
-    _LIT(KAddrextWork, "addrextwork");
-    _LIT(KAddrstreetWork, "addrstreetwork");
-    _LIT(KAddrlocalWork, "addrlocalwork");
-    _LIT(KAddrregionWork, "addrregionwork");
-    _LIT(KAddrpostcodeWork, "addrpostcodework");
-    _LIT(KAddrcountryWork, "addrcountrywork");
-    _LIT(KLandphoneGen, "landphonegen");
-    
-    _LIT(KMobilephoneGen, "mobilephonegen");
-    _LIT(KVideonumberGen, "videonumbergen");
-    _LIT(KFaxnumberGen, "faxnumbergen");
-    _LIT(KVoipGen, "voipgen");
-    _LIT(KPoc, "poc");
-    _LIT(KSwis, "swis");
-    _LIT(KSip, "sip");
-    _LIT(KEmailGen, "emailgen");
-    
-    _LIT(KUrlGen, "urlgen");
-    _LIT(KAddrlabelGen, "addrlabelgen");
-    _LIT(KAddrpoGen, "addrpogen");
-    _LIT(KAddrextGen, "addrextgen");
-    _LIT(KAddrstreetGen, "addrstreetgen");
-    _LIT(KAddrlocalGen, "addrlocalgen");
-    _LIT(KAddrregionGen, "addrregiongen");
-    _LIT(KAddrpostcodeGen, "addrpostcodegen");
-    
-    _LIT(KAddrcountryGen, "addrcountrygen");
-    _LIT(KPagerNumber, "pagernumber");
-    _LIT(KDtmfString, "dtmfstring");
-    _LIT(KWvAddress, "wvaddress");
-    _LIT(KDate, "date");
-    _LIT(KNote, "note");
-    _LIT(KThumbnailPath, "thumbnailpath");
-    _LIT(KThumbnailId, "thumbnailid");
-    _LIT(KRingTone, "ringtonepath");
-    _LIT(KRingToneId, "ringtoneid");
-    
-    _LIT(KCallerobjImg, "callerobjimg");
-    _LIT(KCallerobjText, "callerobjtext");
-    _LIT(KMiddlename, "middlename");
-    _LIT(KDepartment, "department");
-    _LIT(KAsstname, "asstname");
-    _LIT(KSpouse, "spouse");
-    _LIT(KChildren, "children");
-    _LIT(KAsstphone, "asstphone");
-    
-    _LIT(KCarphone, "caphone");
-    _LIT(KAnniversary, "anniversary");
-    _LIT(KSyncclass, "synchronization");
-    _LIT(KLocPrivacy, "locprivacy");
-    _LIT(KGenlabel, "genlabel");
-}
-/**
- * Contact elements
- */
-
-/**
- * Base class for contact elements
- */
-class CCreatorContactElementBase : public CCreatorScriptElement
-{
-public:
-    static CCreatorContactElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-protected:
-    CCreatorContactElementBase(CCreatorEngine* aEngine);
-};
-
-/**
- * Contact element
- */
-class CCreatorContactElement : public CCreatorContactElementBase
-{
-public:
-    static CCreatorContactElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-protected:
-    CCreatorContactElement(CCreatorEngine* aEngine);
-};
-
-/**
- * Contact-set element
- */
-class CCreatorContactSetElement : public CCreatorContactElementBase
-{
-public:
-    static CCreatorContactSetElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    virtual void AddToCacheL();
-protected:
-    CCreatorContactSetElement(CCreatorEngine* aEngine);
-};
-
-/**
- * Contact group element
- */
-class CCreatorContactGroupElement : public CCreatorContactElementBase
-{
-public:
-    static CCreatorContactGroupElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-protected:
-    CCreatorContactGroupElement(CCreatorEngine* aEngine);
-};
-
-/**
- * Contact field element
- */
-class CCreatorContactFieldElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorContactFieldElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-protected:
-    CCreatorContactFieldElement(CCreatorEngine* aEngine);
-};
-
-#endif /*CREATORCONTACTELEMENT_H_*/
--- a/creator/inc/creator_contactsetcache.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORCONTACTSETCACHE_H_
-#define CREATORCONTACTSETCACHE_H_
-
-#include <e32base.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include <MVPbkContactLink.h>
-#endif
-
-// Forward declarations
-class CContactLinkCacheImp;
-
-class CCreatorContactSet : public CBase
-{
-public:
-    static CCreatorContactSet* NewL(TInt aLinkId, TInt aNumOfExistingContacts);
-    virtual ~CCreatorContactSet();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)    
-    void AppendL(MVPbkContactLink*);
-    TInt NumberOfExistingContacts() const;
-    RPointerArray<MVPbkContactLink>& ContactLinks();
-    const RPointerArray<MVPbkContactLink>& ContactLinks() const;
-#endif
-    TInt LinkId() const;
-
-private:
-    CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts);    
-    //void ConstructL();
-    TInt iLinkId;
-    TInt iNumOfExistingContacts;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)    
-    RPointerArray<MVPbkContactLink> iContactLinks;
-#endif
-};
-
-class MContactLinkCache
-{
-public:
-    virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)    
-    virtual RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) = 0;
-    virtual const RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) const = 0;    
-#endif    
-    virtual RPointerArray<CCreatorContactSet>& ContactSets() = 0;
-    virtual const RPointerArray<CCreatorContactSet>& ContactSets() const = 0;
-    virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const = 0;
-    virtual CCreatorContactSet& ContactSet(TInt aLinkId) = 0;
-};
-
-class ContactLinkCache
-{
-public:
-    static void InitializeL();
-    static void DestroyL();
-    
-    static MContactLinkCache* Instance();
-    
-private:
-    ContactLinkCache(){};
-    static CContactLinkCacheImp* iImp;
-};
-
-#endif /*CREATORCONTACTSETCACHE_H_*/
--- a/creator/inc/creator_container.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORAPPVIEW_H__
-#define __CREATORAPPVIEW_H__
-
-#include <coecntrl.h>
-
-/*! 
-  @class CCreatorAppView
-  
-  @discussion An instance of the Application View object for the Creator 
-  example application
-  */
-class CCreatorAppView : public CCoeControl
-    {
-public:
-
-
-
-/*!
-  @function NewL
-   
-  @discussion Create a CCreatorAppView object, which will draw itself to aRect
-  @param aRect the rectangle this view will be drawn to
-  @result a pointer to the created instance of CCreatorAppView
-  */
-    static CCreatorAppView* NewL(const TRect& aRect);
-
-/*!
-  @function NewLC
-   
-  @discussion Create a CCreatorAppView object, which will draw itself to aRect
-  @param aRect the rectangle this view will be drawn to
-  @result a pointer to the created instance of CCreatorAppView
-  */
-    static CCreatorAppView* NewLC(const TRect& aRect);
-
-
-/*!
-  @function ~CCreatorAppView
-  
-  @discussion Destroy the object and release all memory
-  */
-     ~CCreatorAppView();
-
-/*!
-  @function UserDraw
-  
-  @discussion Draw this CHelloWorldAppView to the screen
-  @param aRect the rectangle of this view that needs updating
-  */
-    void UserDraw() const;
-
-
-public:  // from CCoeControl
-/*!
-  @function Draw
-  
-  @discussion Draw this CCreatorAppView to the screen
-  @param aRect the rectangle of this view that needs updating
-  */
-    void Draw(const TRect& aRect) const;
-  
-
-/*!
-  @function OfferKeyEventL
-  
-  @discussion Handle any user keypresses
-  @param aKeyEvent holds the data for the event that occurred
-  @param aType holds the type of key event that occured
-  @result a TKeyResponse indicating if the key was consumed or not
-  */
-    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
-/*!
-  @function InputCapabilities
-  
-  @discussion Return the capabilities of the OfferKeyEventL 
-              method for this class
-  @result a TCoeInputCapabilities indicating the capabilities 
-          for this class
-  */
-	TCoeInputCapabilities InputCapabilities() const;
-
-
-
-private:
-
-/*!
-  @function ConstructL
-  
-  @discussion  Perform the second phase construction of a CCreatorAppView object
-  @param aRect the rectangle this view will be drawn to
-  */
-    void ConstructL(const TRect& aRect);
-
-/*!
-  @function CCreatorAppView
-  
-  @discussion Perform the first phase of two phase construction 
-  */
-    CCreatorAppView();
-
-
-    TBool MMC_OK() const;
-
-public:
-    void HandleResourceChange(TInt aType);
-    };
-
-
-#endif // __CREATORAPPVIEW_H__
--- a/creator/inc/creator_document.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATOR_DOCUMENT_H__
-#define __CREATOR_DOCUMENT_H__
-
-
-#include <AknDoc.h>
-
-// Forward references
-class CCreatorAppUi;
-class CEikApplication;
-
-
-/*! 
-  @class CCreatorDocument
-  
-  @discussion An instance of class CCreatorDocument is the Document part of the AVKON
-  application framework for the Creator example application
-  */
-class CCreatorDocument : public CAknDocument
-    {
-public:
-
-/*!
-  @function NewL
-  
-  @discussion Construct a CCreatorDocument for the AVKON application aApp 
-  using two phase construction, and return a pointer to the created object
-  @param aApp application creating this document
-  @result a pointer to the created instance of CCreatorDocument
-  */
-    static CCreatorDocument* NewL(CEikApplication& aApp);
-
-/*!
-  @function NewLC
-  
-  @discussion Construct a CCreatorDocument for the AVKON application aApp 
-  using two phase construction, and return a pointer to the created object
-  @param aApp application creating this document
-  @result a pointer to the created instance of CCreatorDocument
-  */
-    static CCreatorDocument* NewLC(CEikApplication& aApp);
-
-/*!
-  @function ~CCreatorDocument
-  
-  @discussion Destroy the object and release all memory objects
-  */
-    ~CCreatorDocument();
-
-/*!
-  @function CreateAppUiL 
-  
-  @discussion Create a CCreatorAppUi object and return a pointer to it
-  @result a pointer to the created instance of the AppUi created
-  */
-    CEikAppUi* CreateAppUiL();
-private:
-
-/*!
-  @function ConstructL
-  
-  @discussion Perform the second phase construction of a CCreatorDocument object
-  */
-    void ConstructL();
-
-/*!
-  @function CCreatorDocument
-  
-  @discussion Perform the first phase of two phase construction 
-  @param aApp application creating this document
-  */
-    CCreatorDocument(CEikApplication& aApp);
-
-    };
-
-
-#endif // __CREATOR_DOCUMENT_H__
--- a/creator/inc/creator_factory.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef TCREATORFACTORY_H_
-#define TCREATORFACTORY_H_
-
-#include "creator_modulebase.h"
-
-class CCreatorEngine;
-class CCreatorPhonebookBase;
-class CCreatorConnectionSettingsBase;
-
-
-class TCreatorFactory{
-
-public: 
-	static CCreatorPhonebookBase* CreatePhoneBookL(CCreatorEngine* aEngine);
-	static CCreatorModuleBaseParameters* CreatePhoneBookParametersL();
-
-    static CCreatorConnectionSettingsBase* CreateConnectionSettingsL(CCreatorEngine* aEngine);
-    static CCreatorModuleBaseParameters* CreateConnectionSettingsParametersL();
-	
-
-};
-
-#endif /*TCREATORFACTORY_H_*/
--- a/creator/inc/creator_file.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORFiles_H__
-#define __CREATORFiles_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-#include <caf/caf.h>
-using namespace ContentAccess;
-
-#include <e32base.h>
-#include <bautils.h>
-#include <pathinfo.h>
-#include <apgcli.h> // RApaLsSession
-
-class CCreatorEngine;
-class CFilesParameters;
-class CDRMPermission;
-class CDRMConstraint;
-
-class CCreatorFiles : public CBase, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorFiles* NewL(CCreatorEngine* aEngine);
-    static CCreatorFiles* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorFiles();
-
-private:
-    CCreatorFiles();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand);    
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    
-    void EncryptFileL( const TDesC& aFileName, const TDesC& aOutFileName, CFilesParameters *aParameters );
-    void SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters );
-    void SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters );
-    TBool AskDRMDataFromUserL();
-    TBool AskDRMCDDataFromUserL();
-    void StorePathsForDeleteL( CDesCArray& aPaths );
-    void GenerateFileNameL( TFileName& aRootName );
-    
-private:
-    CFilesParameters* iParameters;
-    CFilesParameters* iUserParameters;
-    HBufC* iDirectoryQueriedFromUser;
-    RFs& iFs;
-    RApaLsSession iApaLs;
-    CDesCArray* iFilePaths;
-    TInt iFileId;
-
-public:
-    };
-
-
-class CFilesParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*          iFullFilePath;
-    TInt            iFileCommand;
-    CDRMPermission* iPermission;
-    TBool           iEncrypt;
-    
-public:
-    CFilesParameters();
-    CFilesParameters( CFilesParameters& aCopy );
-    ~CFilesParameters();
-    };
-
-
-
-#endif // __CREATORFiles_H__
--- a/creator/inc/creator_fileelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORFILEELEMENT_H_
-#define CREATORFILEELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorfile
-{
-    _LIT(KFile, "file");
-    _LIT(KType, "type");
-    _LIT(KDirectory, "directory");
-    _LIT(KDefaultDir, "c:\\data");
-    _LIT(KEncryption, "encryption");
-    _LIT(KDRMRight, "right");
-    _LIT(KDRMFL, "DRM-FL");
-    _LIT(KDRMCD, "DRM-CD");
-    _LIT(KDRMPlayRight, "play");
-    _LIT(KDRMDisplayRight, "display");
-    _LIT(KDRMPrintRight, "print");
-    _LIT(KDRMExecuteRight, "execute");
-    _LIT(KDRMCount, "count");
-    _LIT(KDRMInterval, "interval");
-    _LIT(KDRMStartTime, "starttime");
-    _LIT(KDRMEndTime, "endtime");
-    _LIT(KDRMAccumulated, "accumulated");
-}
-
-class CDRMConstraint;
-class CFilesParameters;
-
-class CCreatorFileElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorFileElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorFileElement(CCreatorEngine* aEngine);
-    TInt GetFileCommandL( const TDesC& aFileIdStr, TBool aRandom ) const;
-private:
-    void ParseDRMElementsL( CCreatorScriptElement* aField, CFilesParameters* aParam );
-    void ParseDRMConstraintsL( CCreatorScriptElement* aRight, CDRMConstraint* aConstraint );
-    TTimeIntervalSeconds ParseTimeInterval( TDesC& aTimeString );
-private: // Data
-    TInt64 iTimeZone;
-};
-
-#endif // CREATORFILEELEMENT_H_
\ No newline at end of file
--- a/creator/inc/creator_imps.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORIMPS_H__
-#define __CREATORIMPS_H__
-
-#ifdef __PRESENCE
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-#include <e32base.h>
-
-#include <cimpssapsettings.h>
-#include <cimpssapsettingsstore.h>
-
-
-class CCreatorEngine;
-class CIMPSParameters;
-
-
-class CCreatorIMPS : public CBase, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorIMPS* NewL(CCreatorEngine* aEngine);
-    static CCreatorIMPS* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorIMPS();
-
-private:
-    CCreatorIMPS();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateIMPSServerEntryL(CIMPSParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CIMPSSAPSettingsStore* iIMPSSAPSettingsStore;
-
-    CIMPSParameters* iParameters;
-    RArray<TUint32> iEntryIds; // TUint32 CIMPSSAPSettings::Uid()
-
-public:
-    };
-
-
-class CIMPSParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*              iServerName;
-    HBufC*              iServerURL;
-    HBufC*              iServerUsername;
-    HBufC*              iServerPassword;    
-    HBufC*              iServerAccessPointName;
-    
-    void SetRandomNameL(CCreatorEngine& aEngine);
-    void SetRandomUrlL(CCreatorEngine& aEngine);
-    void SetRandomUsernameL(CCreatorEngine& aEngine);
-    void SetRandomPasswordL(CCreatorEngine& aEngine);
-    void SetDefaultAccessPointL();
-
-public:
-    CIMPSParameters();
-    ~CIMPSParameters();
-    };
-
-#endif //__PRESENCE
-
-#endif // __CREATORIMPS_H__
--- a/creator/inc/creator_impselement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORIMPSSERVERELEMENT_H_
-#define CREATORIMPSSERVERELEMENT_H_
-
-#ifdef __PRESENCE
-
-#include "creator_scriptelement.h"
-
-namespace creatorimps
-{
-    _LIT(KImpsServer, "impsserver");
-    _LIT(KName, "name");
-    _LIT(KUrl, "url");
-    _LIT(KUsername, "username");
-    _LIT(KPassword, "password");
-    _LIT(KConnectionMethodName, "connectionmethodname");
-    _LIT(KDefault, "default");
-}
-
-class CCreatorImpsServerElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorImpsServerElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorImpsServerElement(CCreatorEngine* aEngine);
-};
-
-#endif // __PRESENCE
-
-#endif /*CREATORIMPSSERVERELEMENT_H_*/
--- a/creator/inc/creator_landmark.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef LANDMARKS_H_
-#define LANDMARKS_H_
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-#include <e32base.h>
-#include <EPos_Landmarks.h>
-
-class CLandmarkParameters;
-class CPosLandmarkDatabase;
-class CPosLmOperation;
-
-static const TInt KLandmarkFieldLength = 256;
-
-class CCreatorLandmarks : public CBase, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorLandmarks* NewL(CCreatorEngine* aEngine);
-    static CCreatorLandmarks* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorLandmarks();
-
-private:
-    CCreatorLandmarks();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase    
-    TPosLmItemId GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID );
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateLandmarkEntryL(CLandmarkParameters *aParameters);
-    static TPosLmGlobalCategory GetCategoryIdL(const TDesC& aCategoryStr);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CPosLandmarkDatabase* iLandmarkDb;    
-    CLandmarkParameters* iParameters;
-    CPosLmOperation* iLmOperation;
-    RArray<TPosLmItemId> iEntryIds; // TPosLmItemId (==TUint32) CPosLandmark::LandmarkId()
-public:
-    };
-
-
-class CLandmarkParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*              iName;
-    RArray<TUint>       iCategories;
-    HBufC*              iStreet;
-    HBufC*              iCity;    
-    HBufC*              iState;
-    HBufC*              iCountry;
-    HBufC*              iPostCode;    
-    HBufC*              iDescription;
-    HBufC*              iPhonenumber;
-    HBufC*              iUrl;
-    TReal64             iLatitude;
-    TReal64             iLongitude;
-    TReal32             iPositionAccuracy;
-    TReal32             iAltitude;
-    TReal32             iAltitudeAccuracy;
-    
-    void SetRandomNameL(CCreatorEngine& aEngine);
-    void SetRandomUrlL(CCreatorEngine& aEngine);
-    void AddRandomCategoryL(CCreatorEngine& aEngine);
-    void SetRandomStreetL(CCreatorEngine& aEngine);
-    void SetRandomCityL(CCreatorEngine& aEngine);
-    void SetRandomStateL(CCreatorEngine& aEngine);
-    void SetRandomCountryL(CCreatorEngine& aEngine);
-    void SetRandomPostCodeL(CCreatorEngine& aEngine);
-    void SetRandomLatitudeL(CCreatorEngine& aEngine);
-    void SetRandomLongitudeL(CCreatorEngine& aEngine);
-    void SetRandomPositionAccuracyL(CCreatorEngine& aEngine);
-    void SetRandomAltitudeL(CCreatorEngine& aEngine);
-    void SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine);
-    void SetRandomDescriptionL(CCreatorEngine& aEngine);
-    void SetRandomPhoneNumberL(CCreatorEngine& aEngine);
-    
-private:
-    
-public:
-    CLandmarkParameters();
-    ~CLandmarkParameters();
-    };
-#endif /*LANDMARKS_H_*/
--- a/creator/inc/creator_landmarkelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORLANDMARKELEMENT_H_
-#define CREATORLANDMARKELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorlandmark
-{
-    _LIT(KLandmark, "landmark");
-    _LIT(KName, "name");
-    _LIT(KCategory, "category");
-    _LIT(KDescription, "description");
-    _LIT(KStreet, "street");
-    _LIT(KPostalcode, "postalcode");
-    _LIT(KCity, "city");
-    _LIT(KState, "state");
-    _LIT(KCountry, "country");
-    _LIT(KPhonenumber, "phonenbr");
-    _LIT(KUrl, "url");
-    _LIT(KLatitude, "latitude");
-    _LIT(KLongitude, "longitude");
-    _LIT(KPositionaccuracy, "positionaccuracy");
-    _LIT(KAltitude, "altitude");
-    _LIT(KAltitudeaccuracy, "altitudeaccuracy");
-}
-
-class CCreatorLandmarkElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorLandmarkElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorLandmarkElement(CCreatorEngine* aEngine);
-};
-
-#endif /*CREATORLANDMARKELEMENT_H_*/
--- a/creator/inc/creator_log.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORLOGS_H__
-#define __CREATORLOGS_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-
-#include <e32base.h>
-#include <logwrap.h>
-#include <logcli.h>
-#include <logeng.h>
-
-
-
-class CCreatorEngine;
-class CLogsParameters;
-
-// Creator log ids:
-typedef TInt32  TLogIdCreator;
-typedef TInt8   TLogDurationTypeCreator;
-typedef TUint32 TLogDurationCreator;
-typedef TUint32 TLogLinkCreator;
-
-const TLogIdCreator KLogNullIdCreator = -1;
-const TLogLinkCreator KLogNullLinkCreator = 0;
-const TLogDurationTypeCreator KLogNullDurationTypeCreator = -1;
-const TLogDurationCreator KLogNullDurationCreator = 0;
-const TLogDurationTypeCreator KLogDurationNoneCreator = 0;
-const TLogDurationTypeCreator KLogDurationValidCreator = 1;
-const TLogDurationTypeCreator KLogDurationDataCreator = 2;
-
-
-
-
-class CCreatorLogs : public CActive, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorLogs* NewL(CCreatorEngine* aEngine);
-    static CCreatorLogs* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorLogs();
-
-private:
-    CCreatorLogs();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-    void RunL();  // from CActive
-	void DoCancel();  // from CActive
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-
-    TInt CreateMissedCallEntryL(CLogsParameters *aParameters);    
-    TInt CreateReceivedCallEntryL(CLogsParameters *aParameters);
-    TInt CreateDialledNumberEntryL(CLogsParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CLogClient* iLogClient;
-    CLogEvent* iLogEvent;
-    CActiveSchedulerWait iLogWriteWait;
-
-    CLogsParameters* iParameters;
-    RArray<TInt> iEntryIds; // TLogId ( == TInt32) CLogEvent::Id()
-
-public:
-    };
-
-
-class CLogsParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    /*HBufC*              iMissedCallPhoneNumber;
-    TTime               iMissedCallEventTime;
-	
-    HBufC*              iReceivedCallPhoneNumber;
-    TTime               iReceivedCallEventTime;
-    TLogDuration        iReceivedCallDuration;
-
-    HBufC*              iDialledNumberPhoneNumber;
-    TTime               iDialledNumberEventTime;
-    TLogDuration        iDialledNumberDuration;*/
-    HBufC*              iPhoneNumber;
-    TTime               iEventTime;
-    TLogDuration        iDuration;
-
-public:
-    CLogsParameters();
-    ~CLogsParameters();
-    };
-
-
-
-#endif // __CREATORLOGS_H__
--- a/creator/inc/creator_logelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORLOGELEMENT_H_
-#define CREATORLOGELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatorlog
-{
-    _LIT(KLog, "log");
-    _LIT(KDirection, "direction");
-    _LIT(KDuration, "duration");
-    _LIT(KPhonenumber, "phonenumber");
-    _LIT(KDatetime, "datetime");
-    _LIT(KMissed, "missed");
-    _LIT(KIn, "in");
-    _LIT(KOut, "out");
-}
-
-class CCreatorLogElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorLogElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorLogElement(CCreatorEngine* aEngine);
-    TInt GetLogCommandL( const TDesC& aFileIdStr, TBool aRandom ) const;
-};
-
-#endif /*CREATORLOGELEMENT_H_*/
--- a/creator/inc/creator_mailbox.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORMAILBOXES_H__
-#define __CREATORMAILBOXES_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-
-#include <e32base.h>
-#include <SenduiMtmUids.h>
-#include <smtpset.h>
-#include <imapset.h>
-#include <pop3set.h>
-#include <mtmuibas.h>
-#include <iapprefs.h>
-#include <cemailaccounts.h>
-
-class CCreatorEngine;
-class CMailboxesParameters;
-
-const TInt KDefaultSmtpPort = 25;
-
-enum TMailboxType
-    {
-    EMailboxPOP3,
-    EMailboxIMAP4
-    };
-
-class CCreatorMailboxes : public CBase, public MCreatorModuleBase, public MMsvSessionObserver
-    {
-public: 
-    static CCreatorMailboxes* NewL(CCreatorEngine* aEngine);
-    static CCreatorMailboxes* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorMailboxes();
-
-private:
-    CCreatorMailboxes();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
-    void StoreIMEIToEntryL(const TMsvId aMailboxId);
-    void GetIMEIFromThePhoneL();
-    
-    void PopulateSmtpSettingsL( 
-            CEmailAccounts& aEmailAccount, 
-            CImSmtpSettings& aSmtpSettings, 
-            CImIAPPreferences& aIApSettings, 
-            const CMailboxesParameters& aParameters );
-    
-    void PopulateImapSettingsL( 
-            CEmailAccounts& aEmailAccount, 
-            CImImap4Settings& aImapSettings, 
-            CImIAPPreferences& aIApSettings, 
-            const CMailboxesParameters& aParameters );
-    
-    void PopulatePopSettingsL( 
-            CEmailAccounts& aEmailAccount, 
-            CImPop3Settings& aPopSettings, 
-            CImIAPPreferences& aIApSettings, 
-            const CMailboxesParameters& aParameters );
-
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateMailboxEntryL(CMailboxesParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-
-private:
-    CMailboxesParameters* iParameters;
-    TBuf<50> iIMEI;
-    RArray<TInt> iEntryIds;
-
-public:
-    };
-
-
-class CMailboxesParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-//    HBufC*          iMailboxName;
-//    HBufC*          iAccessPoint;
-//    HBufC*          iMyMailAddress;
-//    HBufC*          iOutgoingMailServer;
-//    TBool           iSendMessageImmediately;
-//    TBool           iSendCopyToSelf;
-//    TBool           iIncludeSignature;
-//    HBufC*          iUserName;
-//    HBufC*          iPassword;
-//    HBufC*          iIncomingMailServer;
-//    TMailboxType    iMailboxType;  // IMAP4 or POP3
-//    TBool           iSecurityOn; // SecureSockets
-//    TBool           iSSLWrapper; // SSL Wrapper
-//    TBool           iAPOPSecureLogin; // POP3 only
-//    TBool           iRetrieveAttachment; // IMAP4 only
-//    TInt32          iRetrieveHeaders;  // IMAP4 only
-
-    enum TGetEmailOption
-    {
-    EUndef = 0,
-    EGetHeaders,
-    EGetBodyText,
-    EGetBodyTextAndAttachments,
-    EGetAttachments,
-    EGetBodyAlternativeText,
-    EGetEmailOptionLast
-    };
-
-    HBufC*  iMailboxName;    
-    HBufC*  iIncomingLoginName;
-    HBufC*  iIncomingPassword;
-    HBufC*  iIncomingServerName;
-    HBufC*  iIncomingConnectionMethod;
-    HBufC*  iIncomingFolderPath;
-    HBufC*  iPathSeparator;
-    HBufC*  iOutgoingLoginName;
-    HBufC*  iOutgoingPassword;
-    HBufC*  iOutgoingServerName;
-    HBufC*  iOutgoingConnectionMethod;
-    HBufC*  iOwnEmailAddress;
-    HBufC*  iOwnEmailAlias;
-    HBufC*  iReceiptAddress;
-    HBufC*  iReplyToAddress;
-    
-    TInt    iIncomingPort;
-    TInt    iAttachmentSizeLimit;
-    TInt    iBodyTextSizeLimit;
-    TInt    iAttachmentFetchSize;
-    TInt    iImapIdleTimeout;
-    TInt    iMaxEmailSize;
-    TInt    iSyncRate;
-    TInt    iInboxSyncLimit; // -1 = All
-    TInt    iMailboxSyncLimit; // -1 = All
-    TInt    iOutgoingPort;
-    TInt    iToCCIncludeLimit;
-    
-    TBool   iIncomingSSLWrapper;
-    TBool   iIncomingSecureSockets;
-    TBool   iAcknowledgeReceipts;
-    TBool   iAutoSendOnConnect;
-    TBool   iDeleteEmailsAtDisconnect;
-    TBool   iImapIdleCommand;
-    TBool   iMarkSeenInSync;
-    TBool   iEnableExpungeMode;
-    TBool   iUseApop;
-    TBool   iDisconnectedUserMode;
-    TBool   iOutgoingSSLWrapper;
-    TBool   iOutgoingSecureSockets;
-    TBool   iIncludeSignature;
-    TBool   iAddVCard;
-    TBool   iRequestReceipts;
-    TBool   iSmtpAuth;
-    
-    TGetEmailOption iGetEmailOptions;   
-    TFolderSubscribeType iSubscribeType;    
-    TFolderSyncType iSyncType;  
-    TImSMTPSendCopyToSelf iSendCopyToSelf;
-    TImSMTPSendMessageOption iSendOption;    
-    TMailboxType iMailboxType;  // IMAP4 or POP3
-    
-public:
-    CMailboxesParameters();
-    ~CMailboxesParameters();
-    };
-
-
-
-#endif // __CREATORMAILBOXES_H__
--- a/creator/inc/creator_mailboxelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORMAILBOXELEMENT_H_
-#define CREATORMAILBOXELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatormailbox
-{
-    _LIT(Kmailbox, "mailbox");
-    _LIT(Kname, "name");
-    _LIT(Kincomingport, "incomingport");
-    _LIT(Kincomingsslwrapper, "incomingsslwrapper");
-    _LIT(Kincomingsecuresockets, "incomingsecuresockets");
-    _LIT(Kincomingloginname, "incomingloginname");
-    _LIT(Kincomingpassword, "incomingpassword");
-    _LIT(Kincomingservername, "incomingservername");
-    _LIT(Kincomingconnectionmethod, "incomingconnectionmethod");
-    _LIT(Kacknowledgereceipts, "acknowledgereceipts");
-    _LIT(Kattachmentsizelimit, "attachmentsizelimit");
-    _LIT(Kautosendonconnect, "autosendonconnect");
-    _LIT(Kbodytextsizelimit, "bodytextsizelimit");
-    _LIT(Kdeletemailsatdisconnect, "deletemailsatdisconnect");
-    _LIT(Kattachmentfetchsize, "attachmentfetchsize");
-    _LIT(Kincomingfolderpath, "incomingfolderpath");
-    _LIT(Kpathseparator, "pathseparator");
-    _LIT(Kgetemailoptions, "getemailoptions");
-    _LIT(Kimapidlecommand, "imapidlecommand");
-    _LIT(Kimapidletimeout, "imapidletimeout");
-    _LIT(Kmaxemailsize, "maxemailsize");
-    _LIT(Ksubscribetype, "subscribetype");
-    _LIT(Ksyncrate, "syncrate");
-    _LIT(Kfoldersynctype, "foldersynctype");
-    _LIT(Kmarkseeninsync, "markseeninsync");
-    _LIT(Kenableexpungemode, "enableexpungemode");
-    _LIT(Kuseapopsecurelogin, "useapopsecurelogin");
-    _LIT(Kinboxsynclimit, "inboxsynclimit");
-    _LIT(Kmailboxsynclimit, "mailboxsynclimit");
-    _LIT(Kdisconnectedusermode, "disconnectedusermode");
-    _LIT(Koutgoingport, "outgoingport");
-    _LIT(Koutgoingsslwrapper, "outgoingsslwrapper");
-    _LIT(Koutgoingsecuresockets, "outgoingsecuresockets");
-    _LIT(Koutgoingloginname, "outgoingloginname");
-    _LIT(Koutgoingpassword, "outgoingpassword");
-    _LIT(Koutgoingservername, "outgoingservername");
-    _LIT(Koutgoingconnectionmethod, "outgoingconnectionmethod");
-    _LIT(Kincludesignature, "includesignature");
-    _LIT(Kaddvcard, "addvcard");
-    _LIT(Kownemail, "ownemail");
-    _LIT(Kemailalias, "emailalias");
-    _LIT(Kreceiptaddress, "receiptaddress");
-    _LIT(Kreplytoaddress, "replytoaddress");
-    _LIT(Krequestreceipts, "requestreceipts");
-    _LIT(Ksmtpauth, "smtpauth");
-    _LIT(Kcopytoself, "copytoself");
-    _LIT(Ksendoption, "sendoption");
-    _LIT(Ktoccincludelimit, "toccincludelimit");
-    
-    
-    // Get email options:
-    _LIT(Kgetheaders, "getheaders");
-    _LIT(Kgetbodytext, "getbodytext");
-    _LIT(Kgetbodytextandattachments, "getbodytextandattachments");
-    _LIT(Kgetattachments, "getattachments");
-    _LIT(Kgetbodyalternativetext, "getbodyalternativetext");
-    
-    // Subscribe types:
-    _LIT(Kupdateneither, "updateneither");
-    _LIT(Kupdatelocal, "updatelocal");
-    _LIT(Kupdateremote, "updateremote");
-    _LIT(Kupdateboth, "updateboth");
-    
-    // Folder sync. types:
-    _LIT(Kusecombination, "usecombination");
-    _LIT(Kuselocal, "uselocal");
-    _LIT(Kuseremote, "useremote");
-    
-    // Send copy to self option:
-    _LIT(Kno, "no");
-    _LIT(Kto, "to");
-    _LIT(Kcc, "cc");
-    _LIT(Kbcc, "bcc");
-    
-    // Send option:
-    _LIT(Kimmediately, "immediately");
-    _LIT(Konnextconnection, "onnextconnection");
-    _LIT(Konrequest, "onrequest");
-    
-    // Mailbox types:
-    _LIT(KMailboxType, "type");
-    _LIT(Kpop3, "pop3");
-    _LIT(Kimap4, "imap4");
-    _LIT(Ksyncml, "syncml");
-}
-
-class CCreatorMailboxElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorMailboxElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorMailboxElement(CCreatorEngine* aEngine);
-    TBool SetTextParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
-    TBool SetBooleanParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
-    TBool SetIntegerParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
-    TBool SetEnumParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* aParams, TBool aSetRandom );
-    
-    TBool GetBooleanValueL(const TDesC& aElemContent, TBool aSetRandom);
-};
-
-#endif /*CREATORMAILBOXELEMENT_H_*/
--- a/creator/inc/creator_message.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORMESSAGES_H__
-#define __CREATORMESSAGES_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-#include <e32base.h>
-#include <e32std.h>
-#include <msvapi.h>
-#include <mtclbase.h>
-#include <mtclreg.h>
-#include <smut.h>
-#include <smuthdr.h>
-#include <smsclnt.h>
-#include <miutset.h>
-#include <mmsclient.h>
-#include <ircmtm.h>
-#include <irmsgtypeuid.h>
-#include <btmsgtypeuid.h>
-#include <bif.h>
-#include <biouids.h>
-#include <miuthdr.h>
-
-#include <cmsvmimeheaders.h>
-#include <smtcmtm.h>
-#include <ircmtm.h>
-#include <btcmtm.h>
-#include <mmsvattachmentmanager.h>
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include <MVPbkSingleContactOperationObserver.h>
-#include <MVPbkContactStoreListObserver.h>
-#include <MVPbkContactFindObserver.h>
-class CVPbkContactManager;
-#endif
-
-class CCreatorEngine;
-class CMessagesParameters;
-class CAsyncWaiter; 
-
-enum TMessageType
-    {
-    ESMS = 0,
-    EMMS,
-    EAMS,
-    EEmail,
-    ESmartMessage,
-    EIrMessage,
-    EBTMessage
-    };
-
-enum TFolderType
-    {
-    EInbox = 0,
-    EDrafts,
-    EOutbox,
-    ESent,
-    EMailbox
-    };
-    
-class CRecipientInfo : public CBase
-{
-public:
-    CRecipientInfo();
-    virtual ~CRecipientInfo();
-    
-    void SetPhoneNumber(HBufC* aPhone);
-    void SetEmailAddress(HBufC* aEmail);
-    const HBufC* PhoneNumber() const;
-    const HBufC* EmailAddress() const;
-    
-private:
-    HBufC* iPhoneNumber;
-    HBufC* iEmailAddress;
-};
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-class CCreatorMessages : public CBase, public MCreatorModuleBase, public MMsvSessionObserver, 
-    public MVPbkSingleContactOperationObserver, public MVPbkContactStoreListObserver, public MVPbkContactFindObserver
-#else
-class CCreatorMessages : public CBase, public MCreatorModuleBase, public MMsvSessionObserver
-#endif
-    {
-public: 
-    static CCreatorMessages* NewL(CCreatorEngine* aEngine);
-    static CCreatorMessages* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorMessages();
-
-private:
-    CCreatorMessages();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-    TInt CreateSMSEntryL(const CMessagesParameters& parameters);
-    TInt CreateMMSEntryL(const CMessagesParameters& parameters);
-    TInt CreateAMSEntryL(const CMessagesParameters& parameters);
-    TInt CreateEmailEntryL(const CMessagesParameters& parameters);
-    TInt CreateSmartMessageEntryL(const CMessagesParameters& parameters);
-    TInt CreateObexEntryL(TUid aMtm, const CMessagesParameters& parameters);
-    void HandleAttachementsL(const CMessagesParameters& parameters, CMsvStore* store, TInt err );
-    void HandleAttachementL(CMsvStore* store, TInt err, TFileName& sourceFileName );
-
-    CMsvEntrySelection* DoGetListOfAccountsL(CMsvSession& aSession, TUid aMtm, TBool aAlwaysListHidden);
-    TMsvId DefaultServiceForMTML(CMsvSession& aSession, TUid aMtm, TBool aFindFirstServiceIfNoDefault);
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
-    
-    void AddRecipientsL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
-    void GetLinkedAddressesL(   RPointerArray<HBufC>& aAddressArray, 
-                                const RArray<TLinkIdParam>& aLinkIds, 
-                                TBool aUseEmailAddress,
-                                TInt aNumOfExistingAddresses );
-    
-    void GetAllRecipientsL(RPointerArray<HBufC>& aRecipientArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
-    void SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
-    void SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
-    void AddSenderToMtmAddresseeL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
-    void AddMtmSenderL(CMmsClientMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
-    void GetSendersL(RPointerArray<HBufC>& aSenderArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress, TInt aMaxNum );
-    void DeleteAllMessagesL( TBool aOnlyCreatedWithCreator );
-    void DeleteAllFromFolderL( const TMsvId aContext, CMsvSession* aSession, CSmsClientMtm* aClientMtm, TBool aOnlyCreatedWithCreator = EFalse );
-    
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-
-    TInt CreateMessageEntryL(CMessagesParameters *aParameters, TBool aTakeUserGivenParameters=EFalse);    
-    TInt CreateRandomMessageEntryL(TInt aCommand);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    // From MVPbkSingleContactOperationObserver:
-    virtual void VPbkSingleContactOperationComplete(
-            MVPbkContactOperationBase& aOperation,
-            MVPbkStoreContact* aContact );
-            
-    virtual void VPbkSingleContactOperationFailed(
-            MVPbkContactOperationBase& aOperation, 
-            TInt aError );
-    
-    void HandleSingleContactResultL();
-            
-    // From MVPbkContactStoreListObserver
-    virtual void OpenComplete();
-    virtual void StoreReady(MVPbkContactStore&);
-    virtual void StoreUnavailable(MVPbkContactStore&, TInt);
-    virtual void HandleStoreEventL(MVPbkContactStore&, TVPbkContactStoreEvent);
-    
-    // From MVPbkContactFindObserver
-    virtual void FindCompleteL( MVPbkContactLinkArray* aResults );
-    virtual void FindFailed( TInt aError );
-#endif
-
-private:
-    CMessagesParameters*    iParameters;
-    TMessageType            iMessageType;
-    TFolderType             iFolderType;
-    TInt                    iDefinedMessageLength;
-    CArrayFixFlat<TInt>*    iAttachments; 
-    //RPointerArray<HBufC>    iAttachmentPaths;
-    TBool                   iCreateAsUnread;
-    TMsvId                  iUserSelectedMailbox;
-    HBufC*                  iTmpPhoneNumber;
-    HBufC*                  iTmpEmail;
-    RArray<TInt>            iEntryIds; // TMsvId ( == TInt32 ) TMsvEntry::Id()
-    CMsvSession*            iSession;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    MVPbkContactLinkArray*  iExistingContacts;
-    CVPbkContactManager* iContactManager;
-    MVPbkContactStore* iStore;
-    MVPbkStoreContact* iTempContact;
-#endif
-    CAsyncWaiter* iWaiter;
-    RPointerArray<HBufC>    iSenderArray;
-    RPointerArray<HBufC>    iRecipientArray;
-public:
-    };
-
-
-class CMessagesParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    TMessageType            iMessageType;
-    TFolderType             iFolderType;
-    HBufC*                  iSenderAddress;    
-    HBufC*                  iRecipientAddress;
-    RPointerArray<HBufC>    iRecipientAddressArray;
-    HBufC*                  iMessageSubject;
-    HBufC*                  iMessageBodyText;
-    CArrayFixFlat<TInt>*    iAttachments; 
-    RPointerArray<HBufC>    iAttachmentPaths;
-    TInt                    iDefinedMessageLength;
-    TUid                    iBIOMessageType;
-    TBool                   iCreateAsUnread;
-    RArray<TLinkIdParam>    iRecipientLinkIds;
-    RArray<TLinkIdParam>    iSenderLinkIds;
-    TInt                    iNumberOfExistingRecipients;
-    TInt                    iNumberOfExistingSenders;
-
-public:
-    CMessagesParameters();
-    ~CMessagesParameters();
-    };
-
-
-
-#endif // __CREATORMESSAGES_H__
--- a/creator/inc/creator_messageelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef CREATORMESSAGEELEMENT_H_
-#define CREATORMESSAGEELEMENT_H_
-
-#include "creator_scriptelement.h"
-#include "creator_message.h"
-
-namespace creatormsg
-{
-    _LIT(KMessage, "message");
-    _LIT(KType, "type");
-    _LIT(KTo, "to");
-    _LIT(KFrom, "from");
-    _LIT(KFolder, "folder");
-    _LIT(KSubject, "subject");
-    _LIT(KText, "text");
-    _LIT(KAttachmentPath, "attachmentpath");
-    _LIT(KAttachmentId, "attachmentid");
-    _LIT(KStatus, "status");
-    _LIT(KSms, "sms");
-    _LIT(KMms, "mms");
-    _LIT(KAms, "ams");
-    _LIT(KEmail, "email");
-    _LIT(KSmart, "smart");
-    _LIT(KBt, "bt");
-    _LIT(KIr, "ir");
-    _LIT(KSent, "sent");
-    _LIT(KInbox, "inbox");
-    _LIT(KDraft, "draft");
-    _LIT(KOutbox, "outbox");
-    _LIT(KMailbox, "mailbox");
-    _LIT(KRead, "read");
-    _LIT(KNew, "new");
-}
-
-/*
- * Builds message parameters from the parsed script and adds a command to the engine 
- */
-class CCreatorMessageElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorMessageElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-protected:    
-    CCreatorMessageElement(CCreatorEngine* aEngine);
-    /*
-     * Creates message address. The address type is based on the message type.
-     * @return Phone number string for SMS, MMS, AMS and Smart messages. Email address for other types.
-     * @param msgType Message type.
-     */
-    HBufC* CreateMessageAddressLC(const TDesC& msgType);
-    /*
-     * Sets message type to parameters
-     * @param aParameters Message parameters
-     * @param aMsgTypeStr Message type string
-     */
-    void SetMessageTypeL(CMessagesParameters& aParameters, const TDesC& aMsgTypeStr ) const;
-    /*
-     * Gets length of the random data
-     * @return Length of the random data
-     * @param aRandomLenStr String defining the random length (from the script)
-     * @param aMsgType Message type string
-     */
-    TInt GetRandomBodyLengthL(const TDesC& aRandomLenStr, const TDesC& aMsgType ) const;
-    /*
-     * Gets maximum length of the body text
-     * @return Maximum length of the body text
-     * @param aMsgType Message type string
-     */
-    TInt GetMaxBodyLength( const TDesC& aMsgType ) const;
-
-};
-    
-
-#endif /*CREATORMESSAGEELEMENT_H_*/
--- a/creator/inc/creator_model.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,463 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-
-#ifndef __CREATORENGINE_H__
-#define __CREATORENGINE_H__
-
-
-#include "creator_appui.h"
-#include "creator.hrh"
-
-#include "creator_std.h"
-#include "creator_scriptentry.h"
-#include "creator_modulebase.h"
-#include "creator_browser.h"
-#include "creator_calendar.h"
-#include "creator_phonebookbase.h"
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#include "creator_note.h"
-#endif
-#include "creator_log.h"
-#include "creator_connectionmethodbase.h"
-#include "creator_mailbox.h"
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#include "creator_imps.h"
-#endif
-#include "creator_message.h"
-#include "creator_landmark.h"
-#include "creator_randomdataparser.h"
-
-#include <e32base.h>
-#include <aknenv.h>
-#include <coeutils.h>
-#include <apparc.h>
-#include <eikenv.h>
-#include <AknProgressDialog.h>
-#include <eikprogi.h>
-#include <bautils.h>
-#include <commdb.h>
-#include <imageconversion.h> //TFrameInfo
-
-class CCreatorAppUi;
-class TCommand;
-class CCreatorBrowser;
-class CCreatorCalendarBase;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-class CCreatorNotepad;
-#endif
-class CCreatorLogs;
-class CCreatorAccessPoints;
-class CCreatorMailboxes;
-class CCreatorIMPS;
-class CCreatorFiles;
-class CCreatorMessages;
-class CCreatorLandmarks;
-class CDictionaryFileStore;
-class CImageDecoder;
-class CFbsBitmap;
-class CBitmapScaler;
-
-// Common constant for undefined integer value:
-const TInt KUndef = KErrNotFound;
-
-class CCreatorEngine : public CActive, public MProgressDialogCallback 
-	{
-public:
-    
-    enum TRandomStringType
-        {
-        EFirstName = 0,
-        ESurname,
-        ECompany,
-        EAddress,
-        EJobTitle,
-        EPhoneNumber,
-        EGroupName,
-        EMeetingReason,
-        EMeetingPlace,
-        EMemoText,
-        EAnniversaryReason,
-        EToDoText,
-        EReminderText,
-        EMessageSubject,
-        EMessageText,
-        ECity,
-        ECountry,
-        EPostcode,        
-        EState,
-        EPobox,
-        EPrefix,
-        ESuffix,
-        ELandmarkName,
-        ELandmarkDescription
-        };
-
-
-// note! changing order will cause regression in other modules
-
-    enum TTestDataPath
-        {
-        EJPEG_25kB = 0,
-        EJPEG_200kB,
-        EJPEG_500kB,
-        EPNG_15kB,
-        EGIF_2kB,
-        ERNG_1kB,
-        EMIDI_10kB,
-        EWAVE_20kB,
-        EAMR_20kB,
-        EExcel_15kB,
-        EWord_20kB,
-        EPowerPoint_40kB,
-        EText_10kB,
-        EText_70kB,
-        E3GPP_70kB,
-        EMP3_250kB,
-        EAAC_100kB,
-        ERM_95kB,
-        EBMP_25kB,
-        EHTML_20kB,
-        EJAD_1kB,
-        EJAR_10kB,
-        EJP2_65kB,
-        EMP4_200kB,
-        EMXMF_40kB,
-        ERAM_1kB,
-        ESVG_15kB,
-        ESWF_15kB,
-        ETIF_25kB,
-        EVCF_1kB,
-        EVCS_1kB,
-        ESISX_10kB,
-        EWMA_50kB,
-        EWMV_200kB,
-        ESavedDeck_1kB,
-        LAST_FILE_ID//When you add new items to enum, add them before last item, so random number generations does not need to be updated also         
-        };
-        
-    enum TRandomDateType
-        {
-        EDatePast,
-        EDateFuture    
-        };
-
-public:
-    static CCreatorEngine* NewL(CCreatorAppUi* aAppUi);
-    ~CCreatorEngine();
-
-private:
-    CCreatorEngine();
-    void ConstructL(CCreatorAppUi* aAppUi);
-    void Init();
-    void RunL();
-    TInt RunError(TInt aError);
-    void DoCancel();
-
-    void ExecuteFirstCommandL(const TDesC& aText);
-    void ExecuteCommand();
-    void StartEnginesL();
-    void ShutDownEnginesL();
-    void CheckForMoreCommandsL();
-    void DialogDismissedL(TInt aButtonId);  //from MProgressDialogCallback 
-    
-    TBool IsDeleteCommand( TInt aCommand );
-    
-    TInt ReadRandomDataL(const TRandomStringType aRandomStringType,
-    		             const TInt aResourceId,
-    		             const TDesC& aFilename,
-    		             const CCreatorRandomDataParser::TRandomDataType aRandomDataType);
-    void GenerateSourceImageFileL( const TTestDataPath aFileType, const TDesC& aFileName );
-    void GenereteSourceTextFileL( const TDesC& aFileName, TInt aSize );
-
-public:
-    void ExecuteOptionsMenuCommandL(TInt aCommand);
-    void RunScriptL();
-    TInt RunScriptL(const TDesC& aScriptFile);
-
-    void AppendToCommandArrayL(TInt aCommand, CCreatorModuleBaseParameters* aParameters, TInt aNumberOfEntries = 1);
-    TInt CommandArrayCount();
-
-    TBool EntriesQueryDialogL(TInt& aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero=EFalse);
-    TBool TimeQueryDialogL(TTime& aTime, TInt aResourceId);
-    TBool YesNoQueryDialogL(const TDesC& aPrompt);
-    
-    TPtrC TestDataPathL(enum TTestDataPath aTestDataPath);
-    TPtrC RandomSoundFileL(); // Returns temporary path, which will be removed on shutdown 
-    TPtrC RandomPictureFileL();  // Returns temporary path, which will be removed on shutdown
-    TPtrC CreateRandomSoundFileL(); // Copies file to new location and returns the new path
-    TPtrC CreateSoundFileL(TTestDataPath aId); // Copies file to new location and returns the new path
-    
-    void CopyFileL(const TFileName& aSourceFile, const TFileName& aTargetFile, TBool aOverwrite = EFalse );
-    /*
-     * Gets attacment file id based on the file id string
-     * @return Attachment file id
-     * @param aAttachmentIdStr Attachment file id string
-     */
-    TInt GetAttachmentIdL( const TDesC& aAttachmentIdStr ) const;    
-
-    TUint32 GetDefaultIAPL();
-    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
-
-    TPtrC RandomString(enum TRandomStringType aRandomStringType);    
-    TInt RandomNumber(TInt aRange);
-    TInt RandomNumber(TInt aMin, TInt aMax);
-    TTime RandomDate(TRandomDateType type, TInt aMinDays = 0, TInt aMaxDays = 360 );
-    TTime RandomDate(TTime baseTime, TRandomDateType type, TInt aMinDays = 0, TInt aMaxDays = 360);  
-    TTime RandomTime(TTime baseTime, TRandomDateType type, TInt aMinHours=0, TInt aMaxHours=24, TInt aMinMinutes=0, TInt aMaxMinutes=60 );
-    CDesCArrayFlat* SoundFilesL();
-    CDesCArrayFlat* PictureFilesL();
-    
-    HBufC* CreateEmailAddressLC();
-    HBufC* CreateHTTPUrlLC();
-    HBufC* CreateRandomStringLC(TInt aStrLen);
-    
-    HBufC* CreateEmailAddressLC(
-            const TDesC& firstname,
-            const TDesC& lastname,
-            const TDesC& domain,
-            const TDesC& country ) const;
-    
-    HBufC* CreateUrlLC(
-            const TDesC& protocol,
-            const TDesC& prefix,
-            const TDesC& domain,
-            const TDesC& country) const;
-    
-    void SetDefaultPathForFileCommandL(TInt aCommand, TFileName& aPath);
-
-    TBool GetRandomDataFilenameL(TDes& aFilename);
-    TBool GetRandomDataFromFileL(const TDesC& aFilename);
-    void CancelComplete();
-    CDictionaryFileStore* FileStoreLC();
-    void ReadEntryIdsFromStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
-    void WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
-    void ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
-    void WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
-    void RemoveStoreL( const TUid aModuleUid );
-    
-private:
-    // needed by the engine itself
-    RTimer iTimer;
-    CEikonEnv* iEnv;
-    CCreatorAppUi* iAppUi;
-    TInt iCurrentEntry;
-    TInt iEntriesToBeCreated;
-    TInt iFailedCommands;
-
-    CDesCArrayFlat* iSoundFileArray;
-    CDesCArrayFlat* iPictureFileArray;
-    CCommandArray* iCommandArray;
-    RPointerArray<CCreatorModuleBaseParameters> iParameterArray;
-    // progress bar
-    CAknProgressDialog* iProgressDialog;
-    CEikProgressInfo* iProgressInfo;
-        
-    // for the random data generator
-    TInt64 iSeed;
-    
-    class TStringArrayPtr
-        {
-        public:
-        TStringArrayPtr(TRandomStringType aType, CDesCArray* aPtr)
-            {
-            iStringType = aType;
-            iArrayPtr = aPtr;
-            };
-        TRandomStringType iStringType;
-        CDesCArray* iArrayPtr;
-        }; 
-    
-    RArray<TStringArrayPtr> iStringArrays;
-    
-    // modules
-    CCreatorBrowser* iBrowser;
-    CCreatorCalendarBase* iCalendar;
-    CCreatorPhonebookBase* iPhonebook;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    CCreatorNotepad* iNotepad;
-#endif
-    CCreatorLogs* iLogs;
-    CCreatorConnectionSettingsBase* iAccessPoints;
-    CCreatorMailboxes* iMailboxes;
-    CCreatorIMPS* iIMPS;
-    CCreatorFiles* iFiles;
-    CCreatorMessages* iMessages;
-    CCreatorLandmarks* iLandmarks;
-
-    // options menu command home module
-    MCreatorModuleBase* iUsedOptionsMenuModule;
-    
-    HBufC* iTempPath;
-    
-    RPointerArray<HBufC> iAllocatedFilePaths;
-    TBool iUserCancelled;
-    
-    // For generating missing bitmaps
-    HBufC8* iBitmapData;
-    CFbsBitmap* iBitmap;
-    CFbsBitmap* iScaledBitmap;
-    CImageDecoder* iDecoder;
-    TFrameInfo iFrameinfo;
-    CImageEncoder* iEncoder;
-    CFrameImageData* iFrameImageData;
-    CBitmapScaler* iScaler;
-
-public:
-
-	};
-
-// this class contains a command which will be executed
-class TCommand
-    {
-public:
-    TInt iCommandId;
-    CCreatorModuleBaseParameters* iParameters;
-public:
-    TCommand(TInt aCommandId, CCreatorModuleBaseParameters* aParameters);
-    ~TCommand();
-
-    };
-
-
-// utility class for waiting for asychronous requests
-class CAsyncWaiter : public CActive
-	{
-public:
-	static CAsyncWaiter* NewL( TInt aPriority = EPriorityStandard );
-	static CAsyncWaiter* NewLC( TInt aPriority = EPriorityStandard );
-	~CAsyncWaiter();
-	
-	void StartAndWait();
-	TInt Result() const;
-	
-private:
-	CAsyncWaiter( TInt aPriority );
-	
-	// from CActive
-	void RunL();
-	void DoCancel();
-	
-private:
-    CActiveSchedulerWait iWait;
-	TInt iError;
-	};
-	
-	
-/*
- * Maps file id string (file name) to TTestDataPath (file id) and TCreatorIds (command id)
- */
-// File ids:
-	
-	_LIT(K3GPP_70KB, "3GPP-70kB");
-	_LIT(KAAC_100KB, "AAC-100kB");
-	_LIT(KAMR_20KB, "AMR-20kB");
-	_LIT(KXLS_15KB, "XLS-15kB");
-	_LIT(KGIF_2KB, "GIF-2kB");
-	_LIT(KJPEG_200KB, "JPEG-200kB");
-	_LIT(KJPEG_25KB, "JPEG-25kB");
-	_LIT(KJPEG_500KB, "JPEG-500kB");
-	_LIT(KMIDI_10KB, "MIDI-10kB");
-	_LIT(KMP3_250KB, "MP3-250kB");
-	_LIT(KPNG_15KB, "PNG-15kB");
-	_LIT(KPPT_40KB, "PPT-40kB");
-	_LIT(KRM_95KB, "RM-95kB");
-	_LIT(KRNG_1KB, "RNG-1kB");
-	_LIT(KTXT_10KB, "TXT-10kB");
-	_LIT(KTXT_70KB, "TXT-70kB");
-	_LIT(KWAV_20KB, "WAV-20kB");
-	_LIT(KDOC_20KB, "DOC-20kB");
-	_LIT(KSWF_15KB, "SWF-15kB");
-	_LIT(KJAD_1KB, "JAD-1kB");
-	_LIT(KJAR_10KB, "JAR-10kB");
-	_LIT(KTIF_25KB, "TIF-25kB");
-	_LIT(KMXMF_40KB, "MXMF-40kB");
-	_LIT(KBMP_25KB, "BMP-25kB");
-	_LIT(KJP2_25KB, "JP2-25kB");
-	_LIT(KSVG_15KB, "SVG-15kB");
-	_LIT(KHTML_20KB, "HTML-20kB");
-	_LIT(KVCF_1KB, "VCF-1kB");
-	_LIT(KVCS_1KB, "VCS-1kB");
-	_LIT(KMP4_200KB, "MP4-200kB");
-	_LIT(KSISX_10KB, "SISX-10kB");
-	_LIT(KRAM_1KB, "RAM-1kB");
-    _LIT(KDECK_1KB, "DECK-1kB");
-    _LIT(KWMA_50KB, "WMA-50kB");
-    _LIT(KWMV_200KB, "WMV-200kB");
-	
-class FileMapping
-    {
-	public:
-	FileMapping(const TDesC& aFileName, TInt aFileId, TInt aCommandId );
-	const TDesC& FileName() const;
-	TInt FileId() const;
-	TInt CommandId() const;
-
-	private:
-	const TDesC& iFileName;
-	TInt  iFileId;
-	TInt  iCommandId;
-	};
-	
-	/*
-	 * This table contains the string <-> TTestDataPath mappings for the file types
-	 */
-	static FileMapping FileMap[] = 
-	    {
-      
-	    FileMapping(K3GPP_70KB, CCreatorEngine::E3GPP_70kB, ECmdCreateFileEntry3GPP_70kB),
-	    FileMapping(KAAC_100KB, CCreatorEngine::EAAC_100kB, ECmdCreateFileEntryAAC_100kB),
-	    FileMapping(KAMR_20KB, CCreatorEngine::EAMR_20kB, ECmdCreateFileEntryAMR_20kB),
-	    FileMapping(KXLS_15KB, CCreatorEngine::EExcel_15kB, ECmdCreateFileEntryXLS_15kB),
-	    FileMapping(KGIF_2KB, CCreatorEngine::EGIF_2kB, ECmdCreateFileEntryGIF_2kB),
-	    FileMapping(KJPEG_200KB, CCreatorEngine::EJPEG_200kB, ECmdCreateFileEntryJPEG_200kB),
-	    FileMapping(KJPEG_25KB, CCreatorEngine::EJPEG_25kB, ECmdCreateFileEntryJPEG_25kB),
-	    FileMapping(KJPEG_500KB, CCreatorEngine::EJPEG_500kB, ECmdCreateFileEntryJPEG_500kB),
-	    FileMapping(KMIDI_10KB, CCreatorEngine::EMIDI_10kB, ECmdCreateFileEntryMIDI_10kB),
-	    FileMapping(KMP3_250KB, CCreatorEngine::EMP3_250kB, ECmdCreateFileEntryMP3_250kB),
-	    FileMapping(KPNG_15KB, CCreatorEngine::EPNG_15kB, ECmdCreateFileEntryPNG_15kB),
-	    FileMapping(KPPT_40KB, CCreatorEngine::EPowerPoint_40kB, ECmdCreateFileEntryPPT_40kB),
-	    FileMapping(KRM_95KB, CCreatorEngine::ERM_95kB, ECmdCreateFileEntryRM_95kB),
-	    FileMapping(KRNG_1KB, CCreatorEngine::ERNG_1kB, ECmdCreateFileEntryRNG_1kB),
-	    FileMapping(KTXT_10KB, CCreatorEngine::EText_10kB, ECmdCreateFileEntryTXT_10kB),
-	    FileMapping(KTXT_70KB, CCreatorEngine::EText_70kB, ECmdCreateFileEntryTXT_70kB),
-	    FileMapping(KWAV_20KB, CCreatorEngine::EWAVE_20kB, ECmdCreateFileEntryWAV_20kB),
-	    FileMapping(KDOC_20KB, CCreatorEngine::EWord_20kB, ECmdCreateFileEntryDOC_20kB),
-	    FileMapping(KBMP_25KB, CCreatorEngine::EBMP_25kB, ECmdCreateFileEntryBMP_25kB),
-	    FileMapping(KDECK_1KB, CCreatorEngine::ESavedDeck_1kB, ECmdCreateFileEntryDeck_1kB),
-	    FileMapping(KHTML_20KB, CCreatorEngine::EHTML_20kB, ECmdCreateFileEntryHTML_20kB),
-	    FileMapping(KJAD_1KB, CCreatorEngine::EJAD_1kB, ECmdCreateFileEntryJAD_1kB),
-	    FileMapping(KJAR_10KB, CCreatorEngine::EJAR_10kB, ECmdCreateFileEntryJAR_10kB),
-	    FileMapping(KJP2_25KB, CCreatorEngine::EJP2_65kB, ECmdCreateFileEntryJP2_65kB),
-	    FileMapping(KMP4_200KB, CCreatorEngine::EMP4_200kB, ECmdCreateFileEntryMP4_200kB),
-	    FileMapping(KMXMF_40KB, CCreatorEngine::EMXMF_40kB, ECmdCreateFileEntryMXMF_40kB),
-	    FileMapping(KRAM_1KB, CCreatorEngine::ERAM_1kB, ECmdCreateFileEntryRAM_1kB),
-	    FileMapping(KSVG_15KB, CCreatorEngine::ESVG_15kB, ECmdCreateFileEntrySVG_15kB),
-	    FileMapping(KSWF_15KB, CCreatorEngine::ESWF_15kB, ECmdCreateFileEntrySWF_15kB),
-	    FileMapping(KTIF_25KB, CCreatorEngine::ETIF_25kB, ECmdCreateFileEntryTIF_25kB),
-	    FileMapping(KVCF_1KB, CCreatorEngine::EVCF_1kB, ECmdCreateFileEntryVCF_1kB),
-	    FileMapping(KVCS_1KB, CCreatorEngine::EVCS_1kB, ECmdCreateFileEntryVCS_1kB),
-	    FileMapping(KSISX_10KB, CCreatorEngine::ESISX_10kB, ECmdCreateFileEntrySISX_10kB),
-	    FileMapping(KWMA_50KB, CCreatorEngine::EWMA_50kB, ECmdCreateFileEntryWMA_50kB),
-	    FileMapping(KWMV_200KB, CCreatorEngine::EWMV_200kB, ECmdCreateFileEntryWMV_200kB)
-	    };
-
-#endif // __CREATORENGINE_H__
-
--- a/creator/inc/creator_modulebase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATOR_MODULEBASE_H__
-#define __CREATOR_MODULEBASE_H__
-
-#include <e32base.h>
-
-// Dictionary uids for each Creator module.
-// Dictionaries are for storing item identifiers created by Creator.
-// Item identifiers are for enabling deletion of only items created by Creator. 
-const TUid KUidDictionaryUidContacts         = { 0x00 };
-const TUid KUidDictionaryUidContactGroups    = { 0x01 };
-const TUid KUidDictionaryUidCalendar         = { 0x02 };
-const TUid KUidDictionaryUidBrowserBookmarks = { 0x03 };
-const TUid KUidDictionaryUidFiles            = { 0x04 };
-const TUid KUidDictionaryUidLogs             = { 0x05 };
-const TUid KUidDictionaryUidMessages         = { 0x06 };
-const TUid KUidDictionaryUidMailbox          = { 0x07 };
-const TUid KUidDictionaryUidIAP              = { 0x08 };
-const TUid KUidDictionaryUidIMPS             = { 0x09 };
-const TUid KUidDictionaryUidNotes            = { 0x0A };
-const TUid KUidDictionaryUidLandmarks        = { 0x0B };
-const TUid KUidDictionaryUidBrowserSavedPg   = { 0x0C };
-const TUid KUidDictionaryUidBrowserBookmarkF = { 0x0D };
-const TUid KUidDictionaryUidBrowserSavedPgF  = { 0x0E };
-
-class CCreatorEngine;
-class MCreatorModuleBaseParameters;
-class CCommandParser;
-
-class MCreatorModuleBase
-    {
-public:
-
-private:
-    // constructs the module, add "iEngine = aEngine" and other construction stuff to the body
-    virtual void ConstructL(CCreatorEngine* aEngine) = 0;
-
-public:
-    // this one is called when user select some features directly from menu, not running a script
-    // should call CreateRandomData() function
-    // returns ETrue when success, EFalse when user has cancelled
-    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries) = 0;
-    virtual void DeleteAllL() = 0;
-    virtual void DeleteAllCreatedByCreatorL() = 0;
-
-public:
-    CCreatorEngine* iEngine;
-
-private:
-
-    };
-
-
-class MCreatorModuleBaseParameters
-    {
-    // a base class for the parameters, no default implementation
-    
-    public:
-    	enum TParseParams
-    	{
-    	EParamNone = 0,
-    	ECalendarMeeting,
-    	ECalendarMemo,
-    	ECalendarAnniv,
-    	ECalendarTodo
-    	};
-    
-public:
-	virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/) = 0;
-
-	
-    };
-    
-// Following struct represents the parameters that links for example contact groups
-// to contac-sets.
-typedef struct 
-    {
-    TInt iLinkId; // ID
-    TInt iLinkAmount; // Amount of elements in linked set 
-    } TLinkIdParam;
-
-        
-class CCreatorModuleBaseParameters : public CBase, public MCreatorModuleBaseParameters
-        {
-        public:
-        virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/){};
-        virtual TInt ScriptLinkId() const {return -1;};
-        virtual void SetScriptLinkId(TInt) {};
-        // a base class for the parameters, no default implementation
-        };
-        
-
-
-
-#endif  // __CREATOR_MODULEBASE_H__
- 
\ No newline at end of file
--- a/creator/inc/creator_note.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORNOTEPAD_H__
-#define __CREATORNOTEPAD_H__
-
-#include "creator_model.h"
-#include "creator_modulebase.h"
-
-
-#include <e32base.h>
-#include <NpdApi.h>
-
-
-static const TInt KNotepadFieldLength = 1024;
-
-class CCreatorEngine;
-class CNotepadParameters;
-
-
-class CCreatorNotepad : public CBase, public MCreatorModuleBase
-    {
-public: 
-    static CCreatorNotepad* NewL(CCreatorEngine* aEngine);
-    static CCreatorNotepad* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorNotepad();
-
-private:
-    CCreatorNotepad();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:
-    TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    TInt CreateNoteEntryL(CNotepadParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CNotepadApi *iNotepadApi;
-
-    CNotepadParameters* iParameters;
-    RFs& iFs;
-
-public:
-    };
-
-
-class CNotepadParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*              iNoteText;
-
-public:
-    CNotepadParameters();
-    ~CNotepadParameters();
-    };
-
-
-
-#endif // __CREATORNOTEPAD_H__
--- a/creator/inc/creator_noteelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef CREATORNOTEELEMENT_H_
-#define CREATORNOTEELEMENT_H_
-
-#include "creator_scriptelement.h"
-
-namespace creatornote
-{
-    _LIT(KNote, "note");
-    _LIT(KText, "text");
-}
-
-class CCreatorNoteElement : public CCreatorScriptElement
-{
-public:
-    static CCreatorNoteElement* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-    void ExecuteCommandL();
-    
-protected:
-    CCreatorNoteElement(CCreatorEngine* aEngine);
-};
-
-#endif /*CREATORNOTEELEMENT_H_*/
--- a/creator/inc/creator_phonebook.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORPHONEBOOK_H__
-#define __CREATORPHONEBOOK_H__
-
-#include "creator_model.h"
-#include "creator_phonebookbase.h"
-
-
-#include <e32base.h>
-#include <cntdef.h>
-#include <cntdb.h>
-#include <cntitem.h>
-#include <cntfldst.h>
-#include <cntview.h>
-#include <cpbkcontactengine.h>
-#include <cpbkcontactitem.h> 
-#include <cpbkfieldinfo.h> 
-#include <cpbkfieldsinfo.h> 
-#include <pbkfields.hrh>
-
-
-
-class CCreatorEngine;
-class CCreatorModuleBaseParameters;
-class CPhonebookParameters;
-
-
-class CCreatorPhonebook : public CCreatorPhonebookBase 
-    {
-public: 
-    static CCreatorPhonebook* NewL(CCreatorEngine* aEngine);
-    static CCreatorPhonebook* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorPhonebook();
-
-private:
-    CCreatorPhonebook();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:
-
-    TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters);    
-    TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters);
-    TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters);
-    TBool IsActive(){ return EFalse; };
-    void CancelOperation() {};
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    void DeleteAllGroupsL();
-    void DeleteAllGroupsCreatedByCreatorL();
-
-
-private:
-    void CompactPbkDatabase(TBool aCompressImmediately=EFalse);
-    void AddFieldToContactItemL(CPbkContactItem& aItem, TPbkFieldId aFieldId, const TDesC& aFieldText);
-    void DeleteAllItemsL( TUid aStoreUid );
-    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
-
-
-private:
-    CPbkContactEngine* iContactDBEngine;
-    TInt iOpCounter;
-    CPhonebookParameters* iParameters;
-    RArray<TInt> iContactIds;
-    RArray<TInt> iGroupIds;        // TContactItemId ( = TInt32 ) CContactItem::Id()
-    RArray<TInt> iEntriesToDelete; // TContactItemId ( = TInt32 ) CContactItem::Id()
-  
-public:
-    };
-
-
-class CPhonebookParameters : public CCreatorModuleBaseParameters
-    {
-public:
-	void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
-    HBufC*  iContactFirstName;
-    HBufC*  iContactLastName;
-    HBufC*  iContactCompanyName;
-    HBufC*  iContactJobTitle;
-    HBufC*  iContactPostalAddress;
-    HBufC*  iWvUserId;
-    HBufC*  iRingingtone;
-    HBufC*  iThumbnailImage;
-    HBufC*  iContactPhoneNumberGeneral;     TInt iNumberOfPhoneNumberFields;
-    HBufC*  iContactURL;                    TInt iNumberOfURLFields;
-    HBufC*  iContactEmailAddress;           TInt iNumberOfEmailAddressFields;
-
-    HBufC*  iGroupName;
-    TInt    iContactsInGroup;
-
-
-public:
-    CPhonebookParameters();
-    ~CPhonebookParameters();
-    };
-
-
-
-#endif // __CREATORPHONEBOOK_H__
--- a/creator/inc/creator_phonebookbase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CCREATORPHONEBOOKBASE_H_
-#define __CCREATORPHONEBOOKBASE_H_
-
-#include "creator_modulebase.h"
-
-static const TInt KPhonebookFieldLength = 128;
-static const TInt KCreateRandomAmountOfGroups = -9999;
-
-class CCreatorModuleBaseParameters;
-
-class CCreatorPhonebookBase : public CBase, public MCreatorModuleBase{
-public:
-
-    virtual TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;    
-    virtual TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    virtual TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
-    virtual TBool IsActive() = 0;
-    virtual void CancelOperation() = 0;
-    virtual void DeleteAllGroupsL() = 0;
-    virtual void DeleteAllGroupsCreatedByCreatorL() = 0;
-    
-protected:
-
-    virtual void SetDefaultParameters();    
-    TInt iNumberOfPhoneNumberFields;
-    TInt iNumberOfURLFields;
-    TInt iNumberOfEmailAddressFields;
-    TInt iContactsInGroup;    
-    TBool iDefaultFieldsSelected;
-};
-
-
-#endif /*__CCREATORPHONEBOOKBASE_H_*/
--- a/creator/inc/creator_randomdatafield.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORDATAFIELD_H_
-#define CREATORDATAFIELD_H_
-
-#include <e32base.h>
-
-class MCreatorRandomDataField
-{
-public:
-    enum TRandomLengthType
-    {
-    ERandomLengthUndefined,
-    ERandomLengthDefault, // Default length (use data from engine)
-    ERandomLengthMax,     // Maximum length
-    ERandomLengthExplicit // Explicitly defined length
-    };
-    
-    /**
-     * Set field content to random.     
-     * @param aRandomLenType Random length type
-     * @param aExplicitRandomLen Random length when ERandomLengthExplicit is used. Ignored otherwise.
-     */
-    virtual void SetRandomParametersL( TRandomLengthType aRandomLenType, TInt aRandomLen ) = 0;
-};
-
-#endif /*CREATORDATAFIELD_H_*/
--- a/creator/inc/creator_randomdataparser.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORRANDOMDATAPARSER_H_
-#define CREATORRANDOMDATAPARSER_H_
-
-#include <e32base.h>
-#include <badesca.h>
-#include <xml/contenthandler.h>
-#include <xml/parser.h>
-
-//using namespace Xml;
-
-class CCreatorRandomDataParser : public CBase, public Xml::MContentHandler
-	{
-
-public:
-    enum TRandomDataType
-    	{
-    	EFirstName,
-    	ESurname,
-    	ECompany,
-    	EAddress,
-    	EJobTitle,
-    	EPhoneNumber,
-    	EGroupName,
-    	EMeetingReason,
-    	EMeetingPlace,
-    	EMemoText,
-    	EAnniversaryReason,
-    	EToDoText,
-    	EReminderText,
-    	EMessageSubject,
-    	EMessageText,
-    	ECity,
-    	ECountry,
-    	EPostcode,
-    	EState,
-    	EPobox,
-    	EPrefix,
-    	ESuffix,
-    	ELandmarkName,
-    	ELandmarkDescription
-    	};
-
-public:
-
-    virtual ~CCreatorRandomDataParser();
-    static CCreatorRandomDataParser* NewL();
-    static CCreatorRandomDataParser* NewLC();    
-    CDesCArrayFlat* ParseL(const TDesC& aFileName, const TRandomDataType aDataType);
-    
-    TInt GetError() const;
-    
-private:
-
-    CCreatorRandomDataParser();
-    void ConstructL();
-    
-    /**
-     * Converts 8 bit descriptor to 16 bit descriptor
-     * @param aDes 8 bit descriptor to be converted
-     * @return Pointer to the new 16 bit descriptor     
-     */
-    HBufC* Convert8BitTo16BitLC(const TDesC8& aInput);
-    void GetTextFileMode(RFile& aFile, TInt& aFileSize);
-
-    
-public:
-    // From MContentHandler:    
-    void OnStartDocumentL(const Xml::RDocumentParameters &aDocParam, TInt aErrorCode);
-    void OnEndDocumentL(TInt aErrorCode);
-    void OnStartElementL(const Xml::RTagInfo& aElement, 
-                         const Xml::RAttributeArray& aAttributes, 
-                         TInt aErrorCode);
-    void OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode);
-    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnStartPrefixMappingL(const RString& aPrefix, 
-                               const RString& aUri, 
-                               TInt aErrorCode);
-    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
-    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
-    void OnProcessingInstructionL(const TDesC8& aTarget, 
-                                  const TDesC8& aData, 
-                                  TInt aErrorCode);
-    void OnError(TInt aErrorCode);
-    TAny* GetExtendedInterface(const TInt32 aUid);
-    
-private:
-	TRandomDataType iDataType;
-	CDesCArray* iElementNameArray;
-	HBufC* iContentData;
-	TBool iInsideRootElement;
-	TBool iContentParsingActive;
-
-	CDesCArrayFlat* iResultArray;
-	
-    enum TFileFormat
-        {
-        EFormatANSIASCII,
-        EFormatUTF8,
-        EFormatUTF16LE,
-        EFormatUTF16BE
-        };
-    
-    // XML parser
-    Xml::CParser* iParser;
-    
-    TFileFormat iScriptTextFormat;
-    TInt iLastError;
-};
-
-#endif /*CREATORRANDOMDATAPARSER_H_*/
--- a/creator/inc/creator_scriptelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORSCRIPTELEMENT_H_
-#define CREATORSCRIPTELEMENT_H_
-
-#include "creator_randomdatafield.h"
-#include "creator_modulebase.h"
-#include "creator_model.h"
-#include <e32base.h>
-
-class CCreatorScriptElement;
-class CCreatorEngine;
-
-_LIT(KEmpty, "");
-_LIT(KContextSep, "::");
-
-// Common attributes:
-_LIT(KAmount, "amount");
-_LIT(KRandomLength, "randomlength");
-_LIT(KId, "id");
-_LIT(KMaxAmount, "maxamount");
-
-// Common element names:
-_LIT(KScript, "creatorscript");
-_LIT(KFields, "fields");
-_LIT(KContactSetRef, "contact-set-reference");
-_LIT(KExistingContacts, "numberofexistingcontacts");
-
-// Common attribute values:
-_LIT(KMax, "max");
-_LIT(KDefault, "default");
-_LIT(KIncrease, "incvalueforeachcopy");
-
-class CCreatorScriptElementCache : public CBase
-{
-public:
-    static CCreatorScriptElementCache* CCreatorScriptElementCache::NewL();
-    virtual ~CCreatorScriptElementCache();    
-        
-    void RemoveElements();    
-    void AddElementL(CCreatorScriptElement* aElement);
-private:
-    CCreatorScriptElementCache();
-    void ConstructL();
-    RPointerArray<CCreatorScriptElement> iElementCache;
-
-};
-
-
-class CCreatorScriptAttribute : public CBase
-{
-public:
-    static CCreatorScriptAttribute* NewL(const TDesC& aName, const TDesC& aValue);
-    static CCreatorScriptAttribute* NewLC(const TDesC& aName, const TDesC& aValue);
-    virtual ~CCreatorScriptAttribute();    
-    
-    TPtrC Name() const;
-    void SetNameL(const TDesC& aName);      
-    TPtrC Value() const;
-    void SetValueL(const TDesC& aValue);
-    
-protected:
-
-    CCreatorScriptAttribute();
-    virtual void ConstructL(const TDesC& aName, const TDesC& aValue);
-    
-private:
-    HBufC* iName;
-    HBufC* iValue;    
-};
-
-/**
- * Base class for all elements
- */
-class CCreatorScriptElement : public CBase
-{
-public:
-
-    static CCreatorScriptElement* CCreatorScriptElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-
-    /**
-     * Destructor
-     */
-    virtual ~CCreatorScriptElement();
-    
-    /**
-     * Returns the array of sub-elements.
-     * @return Reference to the sub-element array.
-     */
-    virtual RPointerArray<CCreatorScriptElement> const& SubElements() const;
-    virtual RPointerArray<CCreatorScriptElement>& SubElements();
-    
-    /**
-     * Returns a sub-element.
-     * @param aIndex Sub-element array index.
-     * @return Pointer to a sub-element
-     */ 
-    virtual CCreatorScriptElement* SubElement(TInt aIndex);
-    
-    /**
-     * Finds a sub-element by a name.
-     * @param aName Name of the sub-element
-     * @return Pointer to the first matching sub-element. NULL if not found.
-     */
-    virtual CCreatorScriptElement* FindSubElement(const TDesC& aName);
-    
-    /**
-     * Removes all sub-elements.
-     */
-    virtual void RemoveSubElements();
-    
-    /**
-     * Removes a sub-element
-     * @param aIndex Index of the element to be removed
-     */
-    virtual void RemoveSubElementL(TInt aIndex);
-    
-    /**
-     * Adds an element to the sub-element list. 
-     * Leaves with error KErrNotSupported, if sub-element is illegal.
-     * Leaves with error KErrArgument, if the index in out of bounds.
-     * @param aElem Pointer to the element to be added. Takes ownership of the pointer.
-     * @param aIndex Sub-element array index where to add the element. -1 means that
-     * the element is added to the end of the array.
-     */
-    virtual void AddSubElementL(CCreatorScriptElement* aElem, TInt aIndex = -1);
-  
-    /**
-     * Returns the array of attributes.
-     * @return Reference to the attribute array.
-     */
-    virtual RPointerArray<CCreatorScriptAttribute> const& Attributes() const;
-        
-    /**
-     * Returns an attribute.
-     * @param aIndex Attribute array index.
-     * @return Pointer to a attribute
-     */ 
-    virtual CCreatorScriptAttribute* Attribute(TInt aIndex);
-    
-    /**
-     * Removes all attributes.
-     */
-    virtual void RemoveAttributes();
-    
-    /**
-     * Removes an attribute
-     * @param aIndex Index of the attribute to be removed
-     */
-    virtual void RemoveAttributeL(TInt aIndex);
-    
-    /**
-     * Adds an attribute to the attribute list. 
-     * Leaves with error KErrNotSupported, if attribute is illegal.
-     * @param aAttribute Pointer to the element to be added. Takes ownership of the pointer.
-     * @param aIndex Attribute array index where to add the attribute. -1 means that
-     * the attribute is added to the end of the array.
-     */
-    virtual void AddAttributeL(CCreatorScriptAttribute* aAttribute, TInt aIndex = -1);
-    
-    /**
-     * Finds attribute with the given name. First match is returned.
-     */
-    virtual const CCreatorScriptAttribute* FindAttributeByName(const TDesC& aName) const;
-    virtual CCreatorScriptAttribute* FindAttributeByName(const TDesC& aName);
-
-    /**
-     * Returns element name
-     * @return Element name
-     */
-    virtual TPtrC Name() const;
-    
-    /**
-     * Sets the element name.
-     * @param aName Element name
-     */
-    virtual void SetNameL(const TDesC& aName);
-    
-    /**
-     * Returns element content
-     * @return Element content
-     */
-    virtual TPtrC Content() const;
-    
-    /**
-     * Set the content of the element.
-     * @param aContenct Element content
-     */
-    virtual void SetContentL(const TDesC& aContent);
-    virtual void AppendContentL(const TDesC& aContent);
-    
-    /**
-     * Returns element context
-     * @return Element context
-     */
-    virtual TPtrC Context() const;
-        
-    /**
-     * Set the context of the element.
-     * @param aContenct Element context
-     */
-    virtual void SetContextL(const TDesC& aContext);
-    
-    /**
-     * Tells whether the element should be cached for future use.
-     * @return ETrue if the element should be cached for future use, EFalse otherwise.
-     */
-    virtual TBool IsCacheNeeded();
-    virtual void AddToCacheL(CCreatorScriptElementCache& aCache);
-    virtual void AddToCacheL();
-    virtual TBool IsCommandElement() const;
-    virtual void ExecuteCommandL();
-    //virtual void SaveCommandResultsL();
-    //virtual void DiscardCommandResultsL();
-    virtual TBool IsRoot() const;
-    virtual RPointerArray<CCreatorModuleBaseParameters>& CommandParameters();
-    virtual const RPointerArray<CCreatorModuleBaseParameters>& CommandParameters() const;
-    
-protected:
-
-    /**
-     * Constructors. 
-     */    
-    CCreatorScriptElement(CCreatorEngine* aEngine = 0);
-    
-    /**
-     * @param aName Name of the element.
-     */
-    virtual void ConstructL(const TDesC& aName, const TDesC& aContext = KNullDesC);
-    
-    /**
-     * Tells whethet the sub-element is allowed or not.
-     * @param aElem Sub-element to be tested.
-     * @return Boolean value telling whether the sub-element is allowed 
-     * to be added or not.
-     */
-    virtual TBool IsSubElementSupported(const CCreatorScriptElement& aElem) const;
-    
-    virtual MCreatorRandomDataField::TRandomLengthType ResolveRandomDataTypeL(const CCreatorScriptAttribute& aAttr, TInt& aRandomLen ) const;
-    
-    virtual TBool ConvertStrToBooleanL(const TDesC& aStr) const;
-    virtual TInt ConvertStrToIntL(const TDesC& aStr) const;
-    virtual TUint ConvertStrToUintL(const TDesC& aStr) const;
-    virtual void ConvertStrToReal64L(const TDesC& aStr, TReal64& aVal) const;
-    virtual void ConvertStrToReal32L(const TDesC& aStr, TReal32& aVal) const;
-    
-    virtual void AppendContactSetReferenceL(const CCreatorScriptElement& aContactSetRefElem, RArray<TLinkIdParam>& aLinkArray ) const;    
-    
-    virtual void SetContentToTextParamL(HBufC*& aPtr, const TDesC& aContent );
-    
-    virtual TTime ConvertToDateTimeL(const TDesC& aDtStr) const;
-    
-    virtual TInt CompareIgnoreCase(const TDesC& aStr1, const TDesC& aStr2 ) const;
-    
-    /**
-     * Increases phonenumber by aDelta.
-     * 
-     * Special cases, that are handled:
-     * +9          -> +9, +10, +11...
-     * +3584098#99 -> +3584098#99, +3584098#100, +3584098#101...
-     * #           -> #0, #1, #2...
-     * 123#        -> 123#0, 123#1, 123#2...
-     * 099         -> 099, 100, 101...
-     * 
-     * @param aOriginal original phonenumber
-     * @param aDelta number to be added to original number. Must be >= 0.
-     * @param aIncreased on return contains the increased number.
-     *        The buffer must be allocated by the caller.
-     */
-    void IncreasePhoneNumL( const TDesC& aOriginal, TInt aDelta, HBufC* aIncreased ) const;
-    
-protected:
-    
-    // Sub-element array
-    RPointerArray<CCreatorScriptElement> iSubElements;
-    // Attribute array
-    RPointerArray<CCreatorScriptAttribute> iAttributes;
-    // Element name (e.g. "contact")
-    HBufC* iName;
-    // Element content
-    HBufC* iContent;
-    // Context
-    HBufC* iContext;
-    
-    TBool iIsCommandElement;
-    TBool iIsRoot;
-    CCreatorEngine* iEngine;
-    RPointerArray<CCreatorModuleBaseParameters> iParameters;
-};
-
-/**
- * Script element
- */
-class CCreatorScriptRoot : public CCreatorScriptElement
-{
-public:
-    static CCreatorScriptRoot* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-protected:
-    CCreatorScriptRoot(CCreatorEngine* aEngine);
-};
-
-/**
- * Calendar elements
- */
-
-/**
- * Base class for calendar elements
- */
-class CCreatorCalendarElementBase : public CCreatorScriptElement
-{
-public:
-    static CCreatorCalendarElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-protected:
-    CCreatorCalendarElementBase(CCreatorEngine* aEngine);
-};
-
-/**
- * Message elements
- */
-
-/**
- * Base class for message elements
- */
-class CCreatorMessageElementBase : public CCreatorScriptElement
-{
-public:
-    static CCreatorMessageElementBase* NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext = KNullDesC);
-protected:
-    CCreatorMessageElementBase(CCreatorEngine* aEngine);
-};
-
-#endif /*CREATORSCRIPTELEMENT_H_*/
--- a/creator/inc/creator_scriptelementfactory.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORSCRIPTELEMENTFACTORY_H_
-#define CREATORSCRIPTELEMENTFACTORY_H_
-
-#include "creator_scriptelement.h"
-
-/**
- * Creates script element instance based on the element name and context.
- */
-class TCreatorScriptElementFactory
-{
-public:
-    static CCreatorScriptElement* CreateElementL(CCreatorEngine* aEngine, const TDesC& aElementName, const TDesC& aContext = KNullDesC);
-};
-
-#endif /*CREATORSCRIPTELEMENTFACTORY_H_*/
--- a/creator/inc/creator_scriptentry.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __FILEUTILS_H__
-#define __FILEUTILS_H__
-
-
-#include "creator_model.h"
-
-#include <e32base.h>
-#include <f32file.h>
-#include <badesca.h>
-#include <AknGlobalNote.h>
-#include <AknIconArray.h> 
-#include <aknmemorycardui.mbg>
-#include <msvapi.h>
-
-
-class CCreatorEngine;
-
-class CreatorFileUtils
-{
-public:
-    static TInt FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
-    static TInt FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath);
-};
-
-class CCommandParser : public CBase, public MMsvSessionObserver
-    {
-public:
-    static CCommandParser* NewL(CCreatorEngine* aEngine);
-    static CCommandParser* NewLC(CCreatorEngine* aEngine);
-    ~CCommandParser();
-    
-    void StrParserL(HBufC*& aDestinationBuf, TUint aToken);
-    void StrParserL(HBufC8*& aDestinationBuf, TUint aToken);
-
-private:
-    CCommandParser();
-    void ConstructL(CCreatorEngine* aEngine);
-
-    TInt FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
-    TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
-    TInt ReadLineFromFileL(RFile& aInputFile);    
-    //void ParseCommandFromDescriptorL();
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
-
-public:
-    void OpenScriptL();
-    TBool OpenScriptL(RFile& aScriptFile);
-    TBool GetRandomDataFilenameL(TDes& aFilename);
-
-private:
-    CCreatorEngine* iEngine;
-    CDesCArrayFlat* iSearchArray;
-
-    TInt iParserPosition;
-    TInt iParserOldPosition;
-
-    HBufC8* iReadBuf;
-
-    };
-
-
-
-#endif // __FILEUTILS_H__
-
--- a/creator/inc/creator_scriptparser.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORSCRIPTPARSER_H_
-#define CREATORSCRIPTPARSER_H_
-
-#include <e32base.h>
-#include <xml/contenthandler.h>
-#include <xml/parser.h>
-
-using namespace Xml;
-
-class CCreatorScriptElement;
-class CCreatorEngine;
-class CCreatorScriptElementCache;
-
-class TCreatorScriptElementInfo
-{
-public:
-    enum TElementStatus
-    {
-    EStatusUndefined,   // undefined
-    EStatusParsing,     // currently being parsed
-    EStatusParsed       // parsed
-    };
-    TCreatorScriptElementInfo()
-        {
-        iStatus = EStatusUndefined;
-        iElement = 0;
-        }
-    TCreatorScriptElementInfo(TElementStatus aStatus, CCreatorScriptElement* aElement)
-        {
-        iStatus = aStatus;
-        iElement = aElement;
-        };
-    
-    TElementStatus iStatus;    
-    CCreatorScriptElement* iElement;
-};
-
-class CCreatorScriptParser : public CBase, public MContentHandler
-{
-public:
-
-    virtual ~CCreatorScriptParser();
-    static CCreatorScriptParser* NewL(CCreatorEngine* aEngine);
-    static CCreatorScriptParser* NewLC(CCreatorEngine* aEngine);    
-    void ParseL(const TDesC& aFileName);
-    void ParseL(RFile& aFile);
-    
-    TInt GetError() const;
-    
-private:
-
-    CCreatorScriptParser();
-    void ConstructL(CCreatorEngine* aEngine);
-    
-    /**
-     * Converts 8 bit descriptor to 16 bit descriptor
-     * @param aDes 8 bit descriptor to be converted
-     * @return Pointer to the new 16 bit descriptor     
-     */
-    HBufC* Convert8BitTo16BitLC(const TDesC8& aInput);
-    const TCreatorScriptElementInfo& LastElementInfo() const;
-    void GetTextFileMode(RFile& aFile, TInt& aFileSize);
-
-    
-public:
-    // From MContentHandler:    
-    void OnStartDocumentL(const RDocumentParameters &aDocParam, TInt aErrorCode);
-    void OnEndDocumentL(TInt aErrorCode);
-    void OnStartElementL(   const RTagInfo& aElement, 
-                            const RAttributeArray& aAttributes, 
-                            TInt aErrorCode);
-    void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
-    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnStartPrefixMappingL( const RString& aPrefix, 
-                                const RString& aUri, 
-                                TInt aErrorCode);
-    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
-    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
-    void OnProcessingInstructionL(  const TDesC8& aTarget, 
-                                    const TDesC8& aData, 
-                                    TInt aErrorCode);
-    void OnError(TInt aErrorCode);
-    TAny* GetExtendedInterface(const TInt32 aUid);
-    
-private:
-
-    enum TFileFormat
-        {
-        EFormatANSIASCII,
-        EFormatUTF8,
-        EFormatUTF16LE,
-        EFormatUTF16BE
-        };
-    // XML parser
-    CParser* iParser;
-    
-    /**
-     * Element stack holding the elements that are currently being parsed.
-     */
-    RArray<TCreatorScriptElementInfo> iElementStack;
-    
-    /**
-     * Cache object containig the elements that are referred in future and thus should
-     * not be deleted after parsing.
-     */
-    CCreatorScriptElementCache* iElementCache;
-    
-    /**
-     * Pointer to the engine
-     */
-    CCreatorEngine* iEngine;
-    
-    TCreatorScriptElementInfo iDefaultElement;
-    
-    TFileFormat iScriptTextFormat;
-    TInt iLastError;
-};
-
-#endif /*CREATORSCRIPTPARSER_H_*/
--- a/creator/inc/creator_std.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __CREATOR_STD_H__
-#define __CREATOR_STD_H__
-
-#include <e32base.h>
-
-class TCommand;
-typedef CArrayFixSeg<TCommand> CCommandArray;
-
-
-#endif // __CREATOR_STD_H__
--- a/creator/inc/creator_traces.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATOR_TRACES_H__
-#define __CREATOR_TRACES_H__
-
-#include <e32def.h>
-
-
-// ---------------------------------------------------------------------------
-// You change these logging method values below! Recompile the application to take changes effect.
-
-    // logging methods
-    // 0 = No logging
-    // 1 = Flogger
-    // 2 = RDebug
-    // 3 = Flogger and RDebug
-    
-    #ifndef _DEBUG
-        
-        // Logging method for UREL builds:
-        #define CREATOR_LOGGING_METHOD  3
-
-    #else
-
-        // Logging method for UDEB builds:
-        #define CREATOR_LOGGING_METHOD  3
-
-    #endif    
-    
-
-
-// ---------------------------------------------------------------------------
-// Do not make any changes to lines below...
-
-    #if CREATOR_LOGGING_METHOD == 1 || CREATOR_LOGGING_METHOD == 3
-
-        #include <flogger.h>
-        _LIT(KLogFolder,"Creator");
-        _LIT(KLogFile,"Creator_Trace.txt");
-
-    #endif
-
-    #if CREATOR_LOGGING_METHOD == 2 || CREATOR_LOGGING_METHOD == 3
-
-        #include <e32debug.h>
-
-    #endif
-
-
-    #if CREATOR_LOGGING_METHOD == 0
-    
-        #define LOGTEXT(AAA)
-        #define LOGSTRING(AAA)
-        #define LOGSTRING2(AAA,BBB)
-        #define LOGSTRING3(AAA,BBB,CCC)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD)
-    
-    
-    #elif CREATOR_LOGGING_METHOD == 1
-    
-        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-   
-    #elif CREATOR_LOGGING_METHOD == 2
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
-    
-    #elif CREATOR_LOGGING_METHOD == 3
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-
-    #endif
-
-// ---------------------------------------------------------------------------
-
-#endif // __LAUNCHER_TRACES_H__
-
--- a/creator/inc/creator_virtualphonebook.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __CREATORVIRTUALPHONEBOOK_H__
-#define __CREATORVIRTUALPHONEBOOK_H__
-
-#include "creator_model.h"
-#include "creator_phonebookbase.h"
-#include "creator_randomdatafield.h"
-
-#include <e32base.h>
-#include <cntdef.h>
-#include <cntdb.h>
-#include <cntitem.h>
-#include <cntfldst.h>
-#include <cntview.h>
-#include <CVPbkContactManager.h>
-#include <PbkFields.hrh>
-#include <CPbk2ImageManager.h>
-#include <MVPbkContactStoreListObserver.h>
-#include <MVPbkBatchOperationObserver.h>
-#include <MVPbkContactFindObserver.h>
-#include <MVPbkContactObserver.h>
-#include <MPbk2ImageOperationObservers.h>
-#include <VPbkEng.rsg>
-#include <CVPbkContactLinkArray.h>
-#include <MVPbkContactViewObserver.h>
-
-class CCreatorEngine;
-class CCreatorModuleBaseParameters;
-
-class MVPbkStoreContact;
-class MVPbkContactStore;
-class CAsyncWaiter;
-class CContactDatabase;
-class MVPbkContactLinkArray;
-class CVirtualPhonebookParameters;
-
-
-class CCreatorVirtualPhonebook : public CCreatorPhonebookBase,  
-	public MVPbkContactStoreListObserver, public MVPbkBatchOperationObserver,
-	public MVPbkContactFindObserver, public MVPbkContactObserver, public MPbk2ImageSetObserver,
-	public MVPbkSingleContactOperationObserver, public MVPbkContactViewObserver
-    {
-public: 
-    static CCreatorVirtualPhonebook* NewL(CCreatorEngine* aEngine);
-    static CCreatorVirtualPhonebook* NewLC(CCreatorEngine* aEngine);
-    ~CCreatorVirtualPhonebook();
-
-private:
-    CCreatorVirtualPhonebook();
-    void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
-
-public:  
-    virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries);
-    TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters);    
-    TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters);
-    TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters); 
-
-    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TDesC& aFieldText);
-    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TDesC8& aFieldText);
-    void AddFieldToContactItemL(MVPbkStoreContact& aItem, TPbkFieldId aFieldId, const TTime& aFieldText);
-    
-    void AddImageToContactL(MVPbkStoreContact& aContact, TInt aFieldResId, const TDesC& aFileName);
-    TBool IsActive();
-    void CancelOperation();
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    void DeleteAllGroupsL();
-    void DeleteAllGroupsCreatedByCreatorL();
-    
-private:
-    void CompactPbkDatabaseL(TBool aCompressImmediately=EFalse);    
-    void AddFieldToParamsL(TInt aFieldType, const TDesC& aData);
-    void AddFieldToParamsL(TInt aFieldType, const TDesC8& aData);
-    void AddFieldToParamsL(TInt aFieldType, const TTime& aData);    
-    void InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/);
-    TBool IsContactGroupL(const MVPbkContactLink& aLink);
-    void StoreLinksForDeleteL( MVPbkContactLinkArray& aLinks, TUid aStoreUid );
-    void DeleteContactsL( MVPbkContactLinkArray* aContacts, TBool aGroup );
-    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
-    void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
-    TBool HasOtherThanGroupsL( MVPbkContactLinkArray* aContacts );
-
-public: // MVPbkSingleContactOperationObserver
-    
-    void VPbkSingleContactOperationComplete(
-                    MVPbkContactOperationBase& aOperation,
-                    MVPbkStoreContact* aContact );
-    void VPbkSingleContactOperationFailed(
-                    MVPbkContactOperationBase& aOperation, 
-                    TInt aError );
-
-private: // MVPbkContactViewObserver
-    
-    void ContactViewReady( MVPbkContactViewBase& aView );
-    void ContactViewUnavailable(
-            MVPbkContactViewBase& aView );
-    void ContactAddedToView(
-            MVPbkContactViewBase& aView, 
-            TInt aIndex, 
-            const MVPbkContactLink& aContactLink );
-    void ContactRemovedFromView(
-            MVPbkContactViewBase& aView, 
-            TInt aIndex, 
-            const MVPbkContactLink& aContactLink );
-    void ContactViewError(
-            MVPbkContactViewBase& aView, 
-            TInt aError, 
-            TBool aErrorNotified );
-
-private:
-	CVPbkContactManager* iContactManager;
-    TInt iOpCounter;
-
-    CVirtualPhonebookParameters* iParameters;
-    
-    static TInt iPhoneNumberFields[];
-    static TInt iUrlFields[];
-    static TInt iEmailFields[];
-    TBool iAddAllFields;
-    CVPbkContactLinkArray* iContactLinkArray;
-    CVPbkContactLinkArray* iContactsToDelete;
-    CVPbkContactLinkArray* iContactGroupsToDelete;
-    RPointerArray<MVPbkContactLinkArray> iPreviousDeleteLinks;   
-    
-private:
-	//new variables
-	/// Ref: the target of the copy
-	MVPbkContactStore* iStore;
-    
-    CAsyncWaiter* iWaiter;	
-    
-    /// Own: Contact database for this store
-    CContactDatabase* iContactDb;    
-    
-    //Contacts found in contacts db.
-    MVPbkContactLinkArray* iContactResults;
-    // Contact groups that are found in the store. These are used in filtering
-    // the groups from the find results.
-    MVPbkContactLinkArray* iContactGroupsInStore;
-    
-    // Phonebook asynchronous operation
-    MVPbkContactOperationBase* iOperation;
-    
-    // Flag to indicate whether it is required to notify
-    // iEngine after operation is complete. This happens
-    // when user has cancelled the operation during 
-    // iOperation exists.
-    TBool iCancelCbRequested;
-    
-    TInt iLastError;
-
-public:
-	//Observer implentation from MVPbkContactStoreListObserver
-	void OpenComplete();
-
-	//observer implentation from MVPbkContactStoreObserver
-
-	void StoreReady(MVPbkContactStore& aContactStore);
-
-	void StoreUnavailable(MVPbkContactStore& aContactStore, 
-	        TInt aReason);
-
-	void HandleStoreEventL(
-	        MVPbkContactStore& aContactStore, 
-	        TVPbkContactStoreEvent aStoreEvent);
-
-	 TAny* ContactStoreObserverExtension(TUid aExtensionUid); 
-	        	
-	
-
-    
-    
-public:
-	//Observer implementation for MVPbkBatchOperationObserver
-
-	void StepComplete( 
-	        MVPbkContactOperationBase& aOperation,
-	        TInt aStepSize );
-	
-	TBool StepFailed(
-	        MVPbkContactOperationBase& aOperation,
-	        TInt aStepSize, TInt aError );
-	
-	void OperationComplete( 
-	        MVPbkContactOperationBase& aOperation );
-	
-	TAny* BatchOperationObserverExtension( 
-	        TUid aExtensionUid ) ;
-
-	
-	//--------------------------------------------
-	//Observer implementation for MVPbkContactFindObserver
-	public: // Interface
-
-	        void FindCompleteL( MVPbkContactLinkArray* aResults );
-
-	        void FindFailed( TInt aError );
-
-	        TAny* ContactFindObserverExtension( 
-	                TUid aExtensionUid );	
-	
-	
-	
-   	//--------------------------------------------
-   	//Observer implementation for MVPbkContactObserver
-
-	public:
-		void ContactOperationCompleted(TContactOpResult aResult);
-	
-		void ContactOperationFailed
-			(TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified);
-	
-	    TAny* ContactObserverExtension(TUid aExtensionUid) ;
-	     //~MVPbkContactObserver();	        
-	        
-	//--------------------------------------------
-	// Implementation of MPbk2ImageSetObserver:
-	public:
-	    void Pbk2ImageSetComplete(MPbk2ImageOperation& aOperation);
-	    void Pbk2ImageSetFailed(MPbk2ImageOperation& aOperation, TInt aError );	        
-    };
-
-class CCreatorContactFieldImpl;
-class CCreatorContactField : public CBase, public MCreatorRandomDataField
-    {
-public:    
-    static CCreatorContactField* NewL(TInt aFieldType, const TDesC& aData);
-    static CCreatorContactField* NewL(TInt aFieldType, const TDesC8& aData);
-    static CCreatorContactField* NewL(TInt aFieldType, const TTime& aData);
-    
-    static CCreatorContactField* NewL(TInt aFieldType, TRandomLengthType aRandomLenType, TInt aRandomLen);
-    
-    ~CCreatorContactField();    
-    TInt FieldType();
-    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
-    virtual void SetRandomParametersL(  MCreatorRandomDataField::TRandomLengthType aRandomLenType = MCreatorRandomDataField::ERandomLengthDefault, 
-                                TInt aRandomLen = 0 );
-    virtual void ParseL(CCommandParser* parser);
-    
-private:    
-    CCreatorContactField();
-    void ConstructL(TInt aFieldType, const TDesC& aData);
-    void ConstructL(TInt aFieldType, const TDesC8& aData);
-    void ConstructL(TInt aFieldType, const TTime& aData);
-    CCreatorContactFieldImpl* pImpl;    
-    };
-    
-    
-/**
- * Virtual phonebook parameters
- */
-    
-
-class CVirtualPhonebookParameters : public CCreatorModuleBaseParameters
-    {
-public:
-	void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
-	
-	TInt CVirtualPhonebookParameters::ScriptLinkId() const;
-	void CVirtualPhonebookParameters::SetScriptLinkId(TInt aLinkId);
-	RPointerArray<CCreatorContactField> iContactFields;
-
-    HBufC*  iGroupName;
-    TInt    iContactsInGroup;
-    TInt iNumberOfPhoneNumberFields;
-    TInt iNumberOfURLFields;
-    TInt iNumberOfEmailAddressFields;
-    TInt iContactSetPtr;
-    RArray<TLinkIdParam> iLinkIds; // For contactgroup. Stores the linked contact ids.
-    
-public:
-    CVirtualPhonebookParameters();
-    ~CVirtualPhonebookParameters();
-    
-private:
-    TInt iLinkId; // For contact. Stores the contact id
-    };
-
-
-
-#endif // __CREATORVIRTUALPHONEBOOK_H__
--- a/creator/inc/creator_wepsecuritysettings.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef CREATORWEPSECURITYSETTINGS_H_
-#define CREATORWEPSECURITYSETTINGS_H_
-
-//
-// Methods copied from WEPSecuritySettingsImpl.h 
-// (Part of  : WEP Security Settings UI)
-// @see \s60\mw\networking\networkingutilities\WEPSecuritySettingsUI\inc\WEPSecuritySettingsImpl.h
-//
-
-
-// INCLUDES
-
-//#include "creator_model.h"
-
-#include <e32base.h>
-#include <metadatabase.h>
-using namespace CommsDat;
-
-// FORWARD DECLARATIONS
-
-class CCommsDatabase;
-
-// Index of first key
-const TInt KFirstKey = 0;
-
-// Index of second key
-const TInt KSecondKey = 1;
-
-// Index of third key
-const TInt KThirdKey = 2;
-
-// Index of fourth key
-const TInt KFourthKey = 3;
-
-const TInt KMaxNumberofKeys = 4;
-
-// Number of characters for a 232 bits key
-const TUint KKeyDataLength232Bits = 58;
-
-// The maximum length of key data
-const TUint KMaxLengthOfKeyData = KKeyDataLength232Bits;
-
-
-
-
-class CCreatorWEPSecuritySettings : public CBase
-    {
-public: 
-    static CCreatorWEPSecuritySettings* NewL();
-    static CCreatorWEPSecuritySettings* NewLC();
-    ~CCreatorWEPSecuritySettings();
-
-private:
-    CCreatorWEPSecuritySettings();
-    void ConstructL(); // from MCreatorModuleBase
-
-
-public:
-/**
-* Save to database.
-* @param aIapId Wlan Service Table Id of the IAP to be saved
-* @param aCommsDb Comms database.
-*/
-void SaveL( TUint32 aIapId, CCommsDatabase& aCommsDb ) const;
-
-public:
-// Enumeration of the possible keys in use
-enum TWEPKeyInUse
-    {
-    EKeyNumber1,            // Key number 1
-    EKeyNumber2,            // Key number 2
-    EKeyNumber3,            // Key number 3
-    EKeyNumber4             // Key number 4
-    };
-
-
-// Enumeration of the possible authentication types
-enum TWEPAuthentication
-    {
-    EAuthOpen,              // Open authentication
-    EAuthShared             // Shared authentication
-    };
-
-
-// Possible lengths of the keys
-enum TWEPKeyLength
-    {
-    E40Bits,                // 40 bits
-    E104Bits,               // 104 bits
-    E232Bits                // 232 bits
-    };
-
-
-// Possible formats of the keys
-enum TWEPKeyFormat
-    {
-    EAscii,                 // Ascii format
-    EHexadecimal            // Hex format
-    };
-    
-    
-
-private:
-
-// Index of the key currently in use (EKeyNumber1, EKeyNumber2, 
-// EKeyNumber3, EKeyNumber4
-CCreatorWEPSecuritySettings::TWEPKeyInUse iKeyInUse;
-
-// Type of authentication (EAuthOpen, EAuthShared)
-CCreatorWEPSecuritySettings::TWEPAuthentication iAuthentication;
-
-// Length of the key (E40Bits, E104Bits, E232Bits)
-CCreatorWEPSecuritySettings::TWEPKeyLength iKeyLength[KMaxNumberofKeys];
-
-// Format of the key (EAscii, EHexadecimal)
-CCreatorWEPSecuritySettings::TWEPKeyFormat iKeyFormat[KMaxNumberofKeys];
-
-
-    };
-
-
-
-#endif /*CREATORWEPSECURITYSETTINGS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/engine.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,504 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef __CREATORENGINE_H__
+#define __CREATORENGINE_H__
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+#include <W32STD.H>
+
+//#include <aknenv.h>
+#include <coeutils.h>
+#include <apparc.h>
+#include <eikenv.h>
+//#include <aknprogressdialog.h>
+//#include <eikprogi.h>
+#include <bautils.h>
+#include <commdb.h>
+#include <imageconversion.h> //TFrameInfo
+
+#include "creator.hrh"
+#include "creator_std.h"
+#include "creator_scriptentry.h"
+#include "creator_modulebase.h"
+#include "creator_browser.h"
+#include "creator_calendar.h"
+#include "creator_phonebookbase.h"
+#include "creator_note.h"
+#include "creator_log.h"
+#include "creator_connectionmethodbase.h"
+#include "creator_mailbox.h"
+//#include "creator_imps.h"
+#include "creator_message.h"
+#include "creator_landmark.h"
+#include "creator_randomdataparser.h"
+
+//class CCreatorAppUi;
+class TCommand;
+class CCreatorBrowser;
+class CCreatorCalendarBase;
+class CCreatorNotepad;
+class CCreatorLogs;
+class CCreatorAccessPoints;
+class CCreatorMailboxes;
+class CCreatorIMPS;
+class CCreatorFiles;
+class CCreatorMessages;
+class CCreatorLandmarks;
+class CDictionaryFileStore;
+class CImageDecoder;
+class CFbsBitmap;
+class CBitmapScaler;
+
+class EngineWrapper;
+class CCreatorCmdScriptRun;
+
+static const TUid KUidCreatorApp = {0x20011383};
+
+enum TListQueryId
+	{
+	R_GROUP_CREATION_TYPE_QUERY,
+	R_CONTACT_CREATION_TYPE_QUERY,
+	R_MESSAGE_TYPE_QUERY,
+	R_FOLDER_TYPE_QUERY,
+	R_UNREAD_QUERY,
+	R_ATTACHMENT_MULTI_SELECTION_QUERY,
+	R_AMS_ATTACHMENT_SINGLE_SELECTION_QUERY,
+	R_ATTACHMENT_SINGLE_SELECTION_QUERY
+	};
+
+/**
+ * Device memory information
+ */
+class TMemoryDetails
+	{
+public:
+    TBuf<16> iCFree;
+    TBuf<16> iDFree;
+    TBuf<16> iEFree;
+    TBuf<16> iHFree;
+	TBuf<16> iCSize;
+    TBuf<16> iDSize;
+	TBool    iENotAvailable;
+    TBuf<16> iESize;
+	TBuf<16> iHSize;
+	};
+// Common constant for undefined integer value:
+const TInt KUndef = KErrNotFound;
+
+class CCreatorEngine : public CActive 
+	{
+public:
+    
+    enum TRandomStringType
+        {
+        EFirstName = 0,
+        ESurname,
+        ECompany,
+        EAddress,
+        EJobTitle,
+        EPhoneNumber,
+        EGroupName,
+        EMeetingReason,
+        EMeetingPlace,
+        EMemoText,
+        EAnniversaryReason,
+        EToDoText,
+        EReminderText,
+        EMessageSubject,
+        EMessageText,
+        ECity,
+        ECountry,
+        EPostcode,        
+        EState,
+        EPobox,
+        EPrefix,
+        ESuffix,
+        ELandmarkName,
+        ELandmarkDescription
+        };
+
+
+// note! changing order will cause regression in other modules
+
+    enum TTestDataPath
+        {
+        EJPEG_25kB = 0,
+        EJPEG_200kB,
+        EJPEG_500kB,
+        EPNG_15kB,
+        EGIF_2kB,
+        ERNG_1kB,
+        EMIDI_10kB,
+        EWAVE_20kB,
+        EAMR_20kB,
+        EExcel_15kB,
+        EWord_20kB,
+        EPowerPoint_40kB,
+        EText_10kB,
+        EText_70kB,
+        E3GPP_70kB,
+        EMP3_250kB,
+        EAAC_100kB,
+        ERM_95kB,
+        EBMP_25kB,
+        EHTML_20kB,
+        EJAD_1kB,
+        EJAR_10kB,
+        EJP2_65kB,
+        EMP4_200kB,
+        EMXMF_40kB,
+        ERAM_1kB,
+        ESVG_15kB,
+        ESWF_15kB,
+        ETIF_25kB,
+        EVCF_1kB,
+        EVCS_1kB,
+        ESISX_10kB,
+        EWMA_50kB,
+        EWMV_200kB,
+        ESavedDeck_1kB,
+        LAST_FILE_ID//When you add new items to enum, add them before last item, so random number generations does not need to be updated also         
+        };
+        
+    enum TRandomDateType
+        {
+        EDatePast,
+        EDateFuture    
+        };
+
+public:
+    /**
+     * Constructor: NewL
+     */
+    static CCreatorEngine* NewL(EngineWrapper *aEngineWrapper);
+    /**
+     * Constructor: NewLC
+     */
+    static CCreatorEngine* NewLC(EngineWrapper *aEngineWrapper);	
+    ~CCreatorEngine();
+	
+	inline TMemoryDetails GetMemoryDetails(){ return iMemoryDetails; };
+	inline EngineWrapper* GetEngineWrapper(){ return iEngineWrapper; };
+	
+private:
+    CCreatorEngine();
+    /**
+     * EPOC default constructor for performing 2nd stage construction
+     */
+    void ConstructL(EngineWrapper *aEngineWrapper);
+	
+	void RequestMemoryDetails();
+    TBool MMC_OK() const;
+    void Init();
+    void RunL();
+    TInt RunError(TInt aError);
+    void DoCancel();
+
+    void ExecuteFirstCommandL(const TDesC& aText);
+    void ExecuteCommand();
+    void StartEnginesL();
+    void ShutDownEnginesL();
+    void CheckForMoreCommandsL();
+    
+    TBool IsDeleteCommand( TInt aCommand );
+    
+    TInt ReadRandomDataL(const TRandomStringType aRandomStringType,
+    		             const TInt aResourceId,
+    		             const TDesC& aFilename,
+    		             const CCreatorRandomDataParser::TRandomDataType aRandomDataType);
+    void GenerateSourceImageFileL( const TTestDataPath aFileType, const TDesC& aFileName );
+    void GenereteSourceTextFileL( const TDesC& aFileName, TInt aSize );
+
+public:
+    void ExecuteOptionsMenuCommandL(TInt aCommand);
+    void RunScriptL();
+    TInt RunScriptL(const TDesC& aScriptFile);
+
+    void AppendToCommandArrayL(TInt aCommand, CCreatorModuleBaseParameters* aParameters, TInt aNumberOfEntries = 1);
+    TInt CommandArrayCount();
+ 
+    TPtrC TestDataPathL(enum TTestDataPath aTestDataPath);
+    TPtrC RandomSoundFileL(); // Returns temporary path, which will be removed on shutdown 
+    void RandomPictureFileL(TDes& aPath);  // aPath temporary path, which will be removed on shutdown
+    TPtrC CreateRandomSoundFileL(); // Copies file to new location and returns the new path
+    TPtrC CreateSoundFileL(TTestDataPath aId); // Copies file to new location and returns the new path
+    
+    void CopyFileL(const TFileName& aSourceFile, const TFileName& aTargetFile, TBool aOverwrite = EFalse );
+    /*
+     * Gets attacment file id based on the file id string
+     * @return Attachment file id
+     * @param aAttachmentIdStr Attachment file id string
+     */
+    TInt GetAttachmentIdL( const TDesC& aAttachmentIdStr ) const;    
+
+    TUint32 GetDefaultIAPL();
+    TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
+
+    TPtrC RandomString(enum TRandomStringType aRandomStringType);    
+    TInt RandomNumber(TInt aRange);
+    TInt RandomNumber(TInt aMin, TInt aMax);
+    TTime RandomDate(TRandomDateType type, TInt aMinDays = 0, TInt aMaxDays = 360 );
+    TTime RandomDate(TTime baseTime, TRandomDateType type, TInt aMinDays = 0, TInt aMaxDays = 360);  
+    TTime RandomTime(TTime baseTime, TRandomDateType type, TInt aMinHours=0, TInt aMaxHours=24, TInt aMinMinutes=0, TInt aMaxMinutes=60 );
+    CDesCArrayFlat* SoundFilesL();
+    CDesCArrayFlat* PictureFilesL();
+    
+    HBufC* CreateEmailAddressLC();
+    HBufC* CreateHTTPUrlLC();
+    HBufC* CreateRandomStringLC(TInt aStrLen);
+    
+    HBufC* CreateEmailAddressLC(
+            const TDesC& firstname,
+            const TDesC& lastname,
+            const TDesC& domain,
+            const TDesC& country ) const;
+    
+    HBufC* CreateUrlLC(
+            const TDesC& protocol,
+            const TDesC& prefix,
+            const TDesC& domain,
+            const TDesC& country) const;
+    
+    void SetDefaultPathForFileCommandL(TInt aCommand, TFileName& aPath);
+
+    TBool GetRandomDataFilenameL(TDes& aFilename);
+    TBool GetRandomDataFromFileL(const TDesC& aFilename);
+    void CancelComplete();
+    CDictionaryFileStore* FileStoreLC();
+    void ReadEntryIdsFromStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
+    void WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid );
+    void ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
+    void WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
+    void RemoveStoreL( const TUid aModuleUid );
+	void ProgressDialogCancelledL();
+    
+private:
+    // needed by the engine itself
+    RTimer iTimer;
+    CEikonEnv* iEnv;
+    //CCreatorAppUi* iAppUi;
+    TInt iCurrentEntry;
+    TInt iEntriesToBeCreated;
+    TInt iFailedCommands;
+
+    CDesCArrayFlat* iSoundFileArray;
+    CDesCArrayFlat* iPictureFileArray;
+    CCommandArray* iCommandArray;
+    RPointerArray<CCreatorModuleBaseParameters> iParameterArray;
+    // progress bar
+    //CAknProgressDialog* iProgressDialog;
+    //CEikProgressInfo* iProgressInfo;
+        
+    // for the random data generator
+    TInt64 iSeed;
+    
+    class TStringArrayPtr
+        {
+        public:
+        TStringArrayPtr(TRandomStringType aType, CDesCArray* aPtr)
+            {
+            iStringType = aType;
+            iArrayPtr = aPtr;
+            };
+        TRandomStringType iStringType;
+        CDesCArray* iArrayPtr;
+        }; 
+    
+    RArray<TStringArrayPtr> iStringArrays;
+    
+    // modules
+    CCreatorBrowser* iBrowser;
+    CCreatorCalendarBase* iCalendar;
+    CCreatorPhonebookBase* iPhonebook;
+    CCreatorNotepad* iNotepad;
+    CCreatorLogs* iLogs;
+    CCreatorConnectionSettingsBase* iAccessPoints;
+    CCreatorMailboxes* iMailboxes;
+    CCreatorIMPS* iIMPS;
+    CCreatorFiles* iFiles;
+    CCreatorMessages* iMessages;
+    CCreatorLandmarks* iLandmarks;
+	CCreatorCmdScriptRun* iCmdScriptRun;
+
+    // options menu command home module
+    MCreatorModuleBase* iUsedOptionsMenuModule;
+    
+    HBufC* iTempPath;
+    
+    RPointerArray<HBufC> iAllocatedFilePaths;
+    TBool iUserCancelled;
+    
+    // For generating missing bitmaps
+    HBufC8* iBitmapData;
+    CFbsBitmap* iBitmap;
+    CFbsBitmap* iScaledBitmap;
+    CImageDecoder* iDecoder;
+    TFrameInfo iFrameinfo;
+    CImageEncoder* iEncoder;
+    CFrameImageData* iFrameImageData;
+    CBitmapScaler* iScaler;
+
+    EngineWrapper* iEngineWrapper; // Enginewrapper that is used for communicating between QT and Symbian
+	TMemoryDetails iMemoryDetails;
+	TInt iResourceFileId;
+
+	HBufC* iCommandLineScriptName;
+	HBufC* iCommandLineRandomDataFileName;
+	};
+
+// this class contains a command which will be executed
+class TCommand
+    {
+public:
+    TInt iCommandId;
+    CCreatorModuleBaseParameters* iParameters;
+public:
+    TCommand(TInt aCommandId, CCreatorModuleBaseParameters* aParameters);
+    ~TCommand();
+
+    };
+
+
+// utility class for waiting for asychronous requests
+class CAsyncWaiter : public CActive
+	{
+public:
+	static CAsyncWaiter* NewL( TInt aPriority = EPriorityStandard );
+	static CAsyncWaiter* NewLC( TInt aPriority = EPriorityStandard );
+	~CAsyncWaiter();
+	
+	void StartAndWait();
+	TInt Result() const;
+	
+private:
+	CAsyncWaiter( TInt aPriority );
+	
+	// from CActive
+	void RunL();
+	void DoCancel();
+	
+private:
+    CActiveSchedulerWait iWait;
+	TInt iError;
+    };
+	
+	
+/*
+ * Maps file id string (file name) to TTestDataPath (file id) and TCreatorIds (command id)
+ */
+// File ids:
+	
+	_LIT(K3GPP_70KB, "3GPP-70kB");
+	_LIT(KAAC_100KB, "AAC-100kB");
+	_LIT(KAMR_20KB, "AMR-20kB");
+	_LIT(KXLS_15KB, "XLS-15kB");
+	_LIT(KGIF_2KB, "GIF-2kB");
+	_LIT(KJPEG_200KB, "JPEG-200kB");
+	_LIT(KJPEG_25KB, "JPEG-25kB");
+	_LIT(KJPEG_500KB, "JPEG-500kB");
+	_LIT(KMIDI_10KB, "MIDI-10kB");
+	_LIT(KMP3_250KB, "MP3-250kB");
+	_LIT(KPNG_15KB, "PNG-15kB");
+	_LIT(KPPT_40KB, "PPT-40kB");
+	_LIT(KRM_95KB, "RM-95kB");
+	_LIT(KRNG_1KB, "RNG-1kB");
+	_LIT(KTXT_10KB, "TXT-10kB");
+	_LIT(KTXT_70KB, "TXT-70kB");
+	_LIT(KWAV_20KB, "WAV-20kB");
+	_LIT(KDOC_20KB, "DOC-20kB");
+	_LIT(KSWF_15KB, "SWF-15kB");
+	_LIT(KJAD_1KB, "JAD-1kB");
+	_LIT(KJAR_10KB, "JAR-10kB");
+	_LIT(KTIF_25KB, "TIF-25kB");
+	_LIT(KMXMF_40KB, "MXMF-40kB");
+	_LIT(KBMP_25KB, "BMP-25kB");
+	_LIT(KJP2_25KB, "JP2-25kB");
+	_LIT(KSVG_15KB, "SVG-15kB");
+	_LIT(KHTML_20KB, "HTML-20kB");
+	_LIT(KVCF_1KB, "VCF-1kB");
+	_LIT(KVCS_1KB, "VCS-1kB");
+	_LIT(KMP4_200KB, "MP4-200kB");
+	_LIT(KSISX_10KB, "SISX-10kB");
+	_LIT(KRAM_1KB, "RAM-1kB");
+    _LIT(KDECK_1KB, "DECK-1kB");
+    _LIT(KWMA_50KB, "WMA-50kB");
+    _LIT(KWMV_200KB, "WMV-200kB");
+	
+class FileMapping
+    {
+	public:
+	FileMapping(const TDesC& aFileName, TInt aFileId, TInt aCommandId );
+	const TDesC& FileName() const;
+	TInt FileId() const;
+	TInt CommandId() const;
+
+	private:
+	const TDesC& iFileName;
+	TInt  iFileId;
+	TInt  iCommandId;
+	};
+	
+	/*
+	 * This table contains the string <-> TTestDataPath mappings for the file types
+	 */
+	static FileMapping FileMap[] = 
+	    {
+      
+	    FileMapping(K3GPP_70KB, CCreatorEngine::E3GPP_70kB, ECmdCreateFileEntry3GPP_70kB),
+	    FileMapping(KAAC_100KB, CCreatorEngine::EAAC_100kB, ECmdCreateFileEntryAAC_100kB),
+	    FileMapping(KAMR_20KB, CCreatorEngine::EAMR_20kB, ECmdCreateFileEntryAMR_20kB),
+	    FileMapping(KXLS_15KB, CCreatorEngine::EExcel_15kB, ECmdCreateFileEntryXLS_15kB),
+	    FileMapping(KGIF_2KB, CCreatorEngine::EGIF_2kB, ECmdCreateFileEntryGIF_2kB),
+	    FileMapping(KJPEG_200KB, CCreatorEngine::EJPEG_200kB, ECmdCreateFileEntryJPEG_200kB),
+	    FileMapping(KJPEG_25KB, CCreatorEngine::EJPEG_25kB, ECmdCreateFileEntryJPEG_25kB),
+	    FileMapping(KJPEG_500KB, CCreatorEngine::EJPEG_500kB, ECmdCreateFileEntryJPEG_500kB),
+	    FileMapping(KMIDI_10KB, CCreatorEngine::EMIDI_10kB, ECmdCreateFileEntryMIDI_10kB),
+	    FileMapping(KMP3_250KB, CCreatorEngine::EMP3_250kB, ECmdCreateFileEntryMP3_250kB),
+	    FileMapping(KPNG_15KB, CCreatorEngine::EPNG_15kB, ECmdCreateFileEntryPNG_15kB),
+	    FileMapping(KPPT_40KB, CCreatorEngine::EPowerPoint_40kB, ECmdCreateFileEntryPPT_40kB),
+	    FileMapping(KRM_95KB, CCreatorEngine::ERM_95kB, ECmdCreateFileEntryRM_95kB),
+	    FileMapping(KRNG_1KB, CCreatorEngine::ERNG_1kB, ECmdCreateFileEntryRNG_1kB),
+	    FileMapping(KTXT_10KB, CCreatorEngine::EText_10kB, ECmdCreateFileEntryTXT_10kB),
+	    FileMapping(KTXT_70KB, CCreatorEngine::EText_70kB, ECmdCreateFileEntryTXT_70kB),
+	    FileMapping(KWAV_20KB, CCreatorEngine::EWAVE_20kB, ECmdCreateFileEntryWAV_20kB),
+	    FileMapping(KDOC_20KB, CCreatorEngine::EWord_20kB, ECmdCreateFileEntryDOC_20kB),
+	    FileMapping(KBMP_25KB, CCreatorEngine::EBMP_25kB, ECmdCreateFileEntryBMP_25kB),
+	    FileMapping(KDECK_1KB, CCreatorEngine::ESavedDeck_1kB, ECmdCreateFileEntryDeck_1kB),
+	    FileMapping(KHTML_20KB, CCreatorEngine::EHTML_20kB, ECmdCreateFileEntryHTML_20kB),
+	    FileMapping(KJAD_1KB, CCreatorEngine::EJAD_1kB, ECmdCreateFileEntryJAD_1kB),
+	    FileMapping(KJAR_10KB, CCreatorEngine::EJAR_10kB, ECmdCreateFileEntryJAR_10kB),
+	    FileMapping(KJP2_25KB, CCreatorEngine::EJP2_65kB, ECmdCreateFileEntryJP2_65kB),
+	    FileMapping(KMP4_200KB, CCreatorEngine::EMP4_200kB, ECmdCreateFileEntryMP4_200kB),
+	    FileMapping(KMXMF_40KB, CCreatorEngine::EMXMF_40kB, ECmdCreateFileEntryMXMF_40kB),
+	    FileMapping(KRAM_1KB, CCreatorEngine::ERAM_1kB, ECmdCreateFileEntryRAM_1kB),
+	    FileMapping(KSVG_15KB, CCreatorEngine::ESVG_15kB, ECmdCreateFileEntrySVG_15kB),
+	    FileMapping(KSWF_15KB, CCreatorEngine::ESWF_15kB, ECmdCreateFileEntrySWF_15kB),
+	    FileMapping(KTIF_25KB, CCreatorEngine::ETIF_25kB, ECmdCreateFileEntryTIF_25kB),
+	    FileMapping(KVCF_1KB, CCreatorEngine::EVCF_1kB, ECmdCreateFileEntryVCF_1kB),
+	    FileMapping(KVCS_1KB, CCreatorEngine::EVCS_1kB, ECmdCreateFileEntryVCS_1kB),
+	    FileMapping(KSISX_10KB, CCreatorEngine::ESISX_10kB, ECmdCreateFileEntrySISX_10kB),
+	    FileMapping(KWMA_50KB, CCreatorEngine::EWMA_50kB, ECmdCreateFileEntryWMA_50kB),
+	    FileMapping(KWMV_200KB, CCreatorEngine::EWMV_200kB, ECmdCreateFileEntryWMV_200kB)
+	    };
+
+#endif // __CREATORENGINE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/enginewrapper.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef ENGINEWRAPPER_H
+#define ENGINEWRAPPER_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include <badesca.h>
+#include <engine.h>
+
+ #include <QObject> // for iProgressNote signal connect
+
+
+class MainView;
+class MemoryDetails;
+class HbProgressDialog;
+class HbPopup;
+class HbCommonNote;
+
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class EngineWrapper : public QObject
+ { 
+	Q_OBJECT
+
+public:
+    
+    /**
+     * Constructor
+     */
+    EngineWrapper();
+    
+    /**
+     * Destructor
+     */
+    ~EngineWrapper();
+    
+    /**
+     * Initializes Engine Wrapper
+     * @return true if engine was started successfully
+     */
+    bool init();
+	
+	/**
+	* Get memory details
+	*/
+	MemoryDetails GetMemoryDetails();
+	
+public: 
+    
+    /* Functions that are called from UI */
+	bool ExecuteOptionsMenuCommand(int commandId);
+
+    
+public:
+
+    /* Functions that are called from engine: */
+    
+	/** 
+     * uses Notifications class to show error message 
+     */
+    void ShowErrorMessage(const TDesC& aErrorMessage);
+
+    /**
+     * uses Notifications class to show progressbar
+     */
+    void ShowProgressBar(const TDesC& aPrompt, int aMax);
+	
+	/**
+	* uses Notifications class to show user note
+	*/
+	void ShowNote(const TDesC& aNoteMessage, TInt aResourceId = 0);
+    
+    /**
+     * increments shown progressbar's value
+     */
+    void IncrementProgressbarValue();
+    
+    /**
+     * closes progressbar
+     */
+    void CloseProgressbar();	
+	
+	/**
+	* Create entries query dialog
+	*/
+	TBool EntriesQueryDialog(TInt& aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero = EFalse);
+
+	/**
+	* Create time query dialog
+	*/    
+    TBool TimeQueryDialog(TTime aTime, const TDesC& aPrompt);
+
+	/**
+	* Create yes or no query dialog
+	*/    
+    TBool YesNoQueryDialog(const TDesC& aPrompt);
+	
+	/**
+	* Popup list dialog for selecting item from dialog list
+	*/
+	bool PopupListDialog(const TDesC& aPrompt, CDesCArray* aFileNameArray, TInt& aIndex); 
+	
+	/**
+	* Directory query dialog
+	*/
+	bool DirectoryQueryDialog(const TDesC& aPrompt, TFileName& aDirectory);
+	
+	/**
+	* Create list query single-selection dialog
+	*/
+	bool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt& aIndex);
+
+	/**
+	* Create list query multi-selection dialog
+	*/
+	bool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aIndexes);
+	
+	
+	/**
+	* Close application when started from command line for script run.
+	*/
+	void CloseCreatorApp();
+
+private slots:
+	
+	/**
+	* progress dialog cancelled
+	*/
+	void ProgressDialogCancelled();    
+	
+private:
+    
+    
+    /* Creator engine */
+    CCreatorEngine* iEngine;
+    
+    /* progress dialog that is shown */
+    HbProgressDialog* iProgressDialog;
+    
+};
+
+#endif //ENGINEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/mainview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef MAINVIEW_H
+#define MAINVIEW_H
+
+#include <hbview.h>
+#include <enginewrapper.h>
+
+class HbMainWindow;
+class HbApplication;
+class HbAction;
+class QSignalMapper;
+
+class MemoryDetails
+{
+public:
+    QString         mCFree;
+    QString         mDFree;
+    QString         mEFree;
+    QString         mHFree;
+	QString         mCSize;
+	QString         mDSize;
+	bool			mENotAvailable;
+	QString         mESize;
+	QString         mHSize;
+};
+
+/**
+ * Class that implements the main view of Creator
+ */
+class MainView : public HbView
+{
+    Q_OBJECT
+    
+public:
+    
+    /**
+     * Constructor
+     */
+    MainView(HbMainWindow &mainWindow);
+    
+    /**
+     * Destructor
+     */
+	~MainView();
+
+	/**
+     * Initializes Engine Wrapper
+     * @param app application class of Creator
+     */
+    void init(HbApplication &app);
+	
+	/**
+	* Call application exit from engine.
+	*/
+	static void closeApp();
+
+private:
+    
+    /**
+     * Creates menu
+     */
+    void createMenu(HbApplication &app);
+    
+    /**
+     * Creates memory info text to UI
+     */
+    void createMemoryInfoText();
+    
+private slots:
+
+    
+    /**
+     * Shows about pop-up
+     */
+    void showAboutPopup();
+	/**
+	* calls engine wrapper to complete service request, specified with commandId.
+	*/
+	void executeMenuCommand(int cmd);
+  
+private:
+    
+    /* Main window of Creator */
+    HbMainWindow &mMainWindow;
+    
+   
+    /* Engine Wrapper */
+    EngineWrapper mEngineWrapper;
+    
+    /* Actions that are used in toolbars and menus */
+	HbAction* mActionRunScript;
+	HbAction* mActionCalendarAppointments;
+	HbAction* mActionCalendarEvents;
+	HbAction* mActionCalendarAnniversaries;
+	HbAction* mActionCalendarTodos;
+	HbAction* mActionCalendarReminders;	
+	HbAction* mActionBrowserBookmark;
+	HbAction* mActionBrowserBmarkFolder;
+	HbAction* mActionLogsMissedCalls;
+	HbAction* mActionLogsReceivedCalls;
+	HbAction* mActionLogsDialledNumbers;
+	HbAction* mActionMessageMailboxes;
+	HbAction* mActionMessages;
+	HbAction* mActionFilesJpeg25;
+	HbAction* mActionFilesJpeg200;
+	HbAction* mActionFilesJpeg500;
+	HbAction* mActionFilesPng15;
+	HbAction* mActionFilesGif2;
+	HbAction* mActionFilesBmp25;
+	HbAction* mActionFilesJp265;
+	HbAction* mActionFilesSvg15;
+	HbAction* mActionFilesTif25;
+	HbAction* mActionFilesRng1;
+	HbAction* mActionFilesMidi10;
+	HbAction* mActionFilesWave20;
+	HbAction* mActionFilesAmr20;
+	HbAction* mActionFilesExcel15;
+	HbAction* mActionFilesWord20;
+	HbAction* mActionFilesPPoint40;
+	HbAction* mActionFilesText10;
+	HbAction* mActionFilesText70;
+	HbAction* mActionFilesHtml20;
+	HbAction* mActionFilesMxmf40;
+	HbAction* mActionFilesRam1;
+	HbAction* mActionFilesJad1;
+	HbAction* mActionFilesJar10;
+	HbAction* mActionFilesVcf1;
+	HbAction* mActionFilesVcs1;
+	HbAction* mActionFilesSisx10;
+	HbAction* mActionFiles3Gpp70;
+	HbAction* mActionFilesMp3250;
+	HbAction* mActionFilesAAC100;
+	HbAction* mActionFilesSwf15;
+	HbAction* mActionFilesMp4200;
+	HbAction* mActionFilesRm95;
+	HbAction* mActionFilesWma50;
+	HbAction* mActionFilesWmv200;
+	HbAction* mActionPhonebookContacts;
+	HbAction* mActionPhonebookGroups;
+	HbAction* mActionBrowserSavedPages;
+	HbAction* mActionBrowserSavedPageFolders;
+	HbAction* mActionFilesEmptyFolder;
+	HbAction* mActionMiscConnection;
+	HbAction* mActionMiscImps;
+	HbAction* mActionMiscNotes;
+	HbAction* mActionMiscLandmarks;
+    HbAction* mActionAbout;
+    HbAction* mActionExit;
+	HbAction* mActionDeleteAllItems;
+	HbAction* mActionDeleteCreatorItems;
+	HbAction* mActionSelectRandomFile;
+	HbAction* mActionDeleteCalAllItems;
+	HbAction* mActionDeleteCalCreatorItems;
+	HbAction* mActionDeleteBookmarkAllItems;
+	HbAction* mActionDeleteBookmarkCreatorItems;
+	HbAction* mActionDeleteBookmarkFolderAllItems;
+	HbAction* mActionDeleteBookmarkFolderCreatorItems;
+	HbAction* mActionDeleteSavedPagesAllItems;
+	HbAction* mActionDeleteSavedPagesCreatorItems;
+	HbAction* mActionDeleteSavedPagesFolderAllItems;
+	HbAction* mActionDeleteSavedPagesFolderCreatorItems;
+	HbAction* mActionDeleteFiles;
+	HbAction* mActionDeleteLogsAll;
+	HbAction* mActionDeleteLogsByCreator;
+	HbAction* mActionDeleteMessagesAll;
+	HbAction* mActionDeleteMessagesByCreator;
+	HbAction* mActionDeleteConnMethsAll;
+	HbAction* mActionDeleteConnMethsByCreator;
+	HbAction* mActionDeleteImpsAll;
+	HbAction* mActionDeleteImpsByCreator;
+	HbAction* mActionDeleteNotes;
+	HbAction* mActionDeleteLandmarksAll;
+	HbAction* mActionDeleteLandmarksByCreator;
+	HbAction* mActionDeleteContactsAll;
+	HbAction* mActionDeleteContactsByCreator;
+	HbAction* mActionDeleteContactGroupsAll;
+	HbAction* mActionDeleteContactGroupsByCreator;
+	
+	
+	MemoryDetails mMemoryDetails;
+    // signal mapper
+    QSignalMapper *mSm;    
+};
+
+#endif // MAINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/notifications.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef NOTIFICATIONS_H_
+#define NOTIFICATIONS_H_
+
+#include <hbmessagebox.h>
+#include <hbselectiondialog.h>
+
+class HbProgressDialog;
+class HbPopup;
+
+class Notifications : public HbPopup
+    {
+
+	Q_OBJECT 	
+	
+public:
+    /**
+     * shows massage box
+     */
+	static void showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout );
+	
+    /**
+     * shows about box
+     */
+    static void about();
+    
+    /** 
+     * shows error message 
+     */
+    static void error(const QString& errorMessage);
+	
+	/**
+     * to shows progressbar
+     */
+	static HbProgressDialog* showProgressBar(const QString& text, int max);
+	
+	/**
+	* Entries query dialog
+	*/
+	static bool entriesQueryDialog(int& numberOfEntries, const QString& text, bool acceptsZero);
+    
+	/**
+	* Time query dialog
+	*/
+    static bool timeQueryDialog(QDate& date, const QString& text);
+
+	/**
+	* Yes or No query dialog
+	*/    
+    static bool yesNoQueryDialog(const QString& text);
+	
+	/**
+	* popup list dialog for selecting one item from list
+	*/
+	static void popupListDialog(const QString& text, QStringList& items, HbAbstractItemView::SelectionMode mode, QObject* receiver = 0, const char* member = 0);
+	
+	/**
+	* directory query dialog
+	*/
+	static bool directoryQueryDialog(const QString& text, QString& directory);
+
+    /**
+     * shows global HbGlobalCommonNote type note
+     */
+	static void showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout = HbPopup::ConfirmationNoteTimeout);
+    };
+
+
+
+#endif // NOTIFICATIONS_H_
--- a/creator/rom/creator.iby	Mon May 03 12:32:02 2010 +0300
+++ b/creator/rom/creator.iby	Fri May 14 15:53:02 2010 +0300
@@ -20,13 +20,16 @@
 #define __CREATOR_IBY__
 
 S60_APP_EXE(Creator)
-S60_APP_AIF_ICONS(Creator)
 S60_APP_RESOURCE(Creator)
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(Creator)
-#else
-  S60_APP_AIF_RSC(Creator)
-#endif
+S60_APP_RESOURCE(datacreator)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,Creator)
+
+data=ZPRIVATE\10003a3f\import\APPS\Creator_reg.RSC Private\10003a3f\import\Apps\Creator_reg.rsc 
+//#ifdef S60_UPGRADABLE_APP_REG_RSC
+//  S60_UPGRADABLE_APP_REG_RSC(Creator)
+//#else
+//  S60_APP_AIF_RSC(Creator)
+//#endif
 
 data=ZPRIVATE\20011383\backup_registration.xml        	private\20011383\backup_registration.xml
 data=ZSYSTEM\Install\Creator_stub.sis                   \system\install\Creator_stub.sis
--- a/creator/sis/Creator_S60-30.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"Creator"},(0x20011383),5,3,5,TYPE=SA
-
-; Supports S60 v 3.0
-[0x101F7961], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\Creator.exe"-"!:\sys\bin\Creator.exe"
-"\epoc32\data\z\Resource\apps\Creator_aif.mif"-"!:\Resource\Apps\Creator_aif.mif"
-"\epoc32\data\z\Resource\apps\Creator.rsc"-"!:\Resource\Apps\Creator.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\Creator_reg.rsc"-"!:\private\10003a3f\import\apps\Creator_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\20011383\backup_registration.xml"
-
-; test data:
-"\epoc32\data\Z\private\20011383\3GPP-70kB.3gpp"-"!:\private\20011383\3GPP-70kB.3gpp"
-"\epoc32\data\Z\private\20011383\AAC-100kB.aac"-"!:\private\20011383\AAC-100kB.aac"
-"\epoc32\data\Z\private\20011383\AMR-20kB.amr"-"!:\private\20011383\AMR-20kB.amr"
-"\epoc32\data\Z\private\20011383\BMP-25kB.bmp"-"!:\private\20011383\BMP-25kB.bmp"
-"\epoc32\data\Z\private\20011383\Deck-1kB.saveddeck"-"!:\private\20011383\Deck-1kB.saveddeck"
-"\epoc32\data\Z\private\20011383\DOC-20kB.doc"-"!:\private\20011383\DOC-20kB.doc"
-"\epoc32\data\Z\private\20011383\GIF-2kB.gif"-"!:\private\20011383\GIF-2kB.gif"
-"\epoc32\data\Z\private\20011383\HTML-20kB.html"-"!:\private\20011383\HTML-20kB.html"
-"\epoc32\data\Z\private\20011383\JAD-1kB.jad"-"!:\private\20011383\JAD-1kB.jad"
-"\epoc32\data\Z\private\20011383\JAR-10kB.jar"-"!:\private\20011383\JAR-10kB.jar"
-"\epoc32\data\Z\private\20011383\JP2-65kB.jp2"-"!:\private\20011383\JP2-65kB.jp2"
-"\epoc32\data\Z\private\20011383\JPEG-200kB.jpg"-"!:\private\20011383\JPEG-200kB.jpg"
-"\epoc32\data\Z\private\20011383\JPEG-25kB.jpg"-"!:\private\20011383\JPEG-25kB.jpg"
-"\epoc32\data\Z\private\20011383\JPEG-500kB.jpg"-"!:\private\20011383\JPEG-500kB.jpg"
-"\epoc32\data\Z\private\20011383\MIDI-10kB.mid"-"!:\private\20011383\MIDI-10kB.mid"
-"\epoc32\data\Z\private\20011383\MP3-250kB.mp3"-"!:\private\20011383\MP3-250kB.mp3"
-"\epoc32\data\Z\private\20011383\MP4-200kB.mp4"-"!:\private\20011383\MP4-200kB.mp4"
-"\epoc32\data\Z\private\20011383\MXMF-40kB.mxmf"-"!:\private\20011383\MXMF-40kB.mxmf"
-"\epoc32\data\Z\private\20011383\PNG-15kB.png"-"!:\private\20011383\PNG-15kB.png"
-"\epoc32\data\Z\private\20011383\PPT-40kB.ppt"-"!:\private\20011383\PPT-40kB.ppt"
-"\epoc32\data\Z\private\20011383\RAM-1kB.ram"-"!:\private\20011383\RAM-1kB.ram"
-"\epoc32\data\Z\private\20011383\RM-95kB.rm"-"!:\private\20011383\RM-95kB.rm"
-"\epoc32\data\Z\private\20011383\RNG-1kB.rng"-"!:\private\20011383\RNG-1kB.rng"
-"\epoc32\data\Z\private\20011383\SVG-15kB.svg"-"!:\private\20011383\SVG-15kB.svg"
-"\epoc32\data\Z\private\20011383\SWF-15kB.swf"-"!:\private\20011383\SWF-15kB.swf"
-"\epoc32\data\Z\private\20011383\TIF-25kB.tif"-"!:\private\20011383\TIF-25kB.tif"
-"\epoc32\data\Z\private\20011383\TXT-10kB.txt"-"!:\private\20011383\TXT-10kB.txt"
-"\epoc32\data\Z\private\20011383\TXT-70kB.txt"-"!:\private\20011383\TXT-70kB.txt"
-"\epoc32\data\Z\private\20011383\VCF-1kB.vcf"-"!:\private\20011383\VCF-1kB.vcf"
-"\epoc32\data\Z\private\20011383\VCS-1kB.vcs"-"!:\private\20011383\VCS-1kB.vcs"
-"\epoc32\data\Z\private\20011383\WAV-20kB.wav"-"!:\private\20011383\WAV-20kB.wav"
-"\epoc32\data\Z\private\20011383\XLS-15kB.xls"-"!:\private\20011383\XLS-15kB.xls"
-"\epoc32\data\Z\private\20011383\SISX-10kB.sisx"-"!:\private\20011383\SISX-10kB.sisx"
-"\epoc32\data\Z\private\20011383\WMA-50kB.wma"-"!:\private\20011383\WMA-50kB.wma"
-"\epoc32\data\Z\private\20011383\WMV-200kB.wmv"-"!:\private\20011383\WMV-200kB.wmv"
Binary file creator/sis/Creator_S60-30.sis has changed
--- a/creator/sis/Creator_S60-32.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"Creator"},(0x20011383),5,3,5,TYPE=SA
-
-; Supports S60 v 3.2
-[0x102752AE], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\Creator.exe"-"!:\sys\bin\Creator.exe"
-"\epoc32\data\z\Resource\apps\Creator_aif.mif"-"!:\Resource\Apps\Creator_aif.mif"
-"\epoc32\data\z\Resource\apps\Creator.rsc"-"!:\Resource\Apps\Creator.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\Creator_reg.rsc"-"!:\private\10003a3f\import\apps\Creator_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\20011383\backup_registration.xml"
-
-; test data:
-"\epoc32\data\Z\private\20011383\3GPP-70kB.3gpp"-"!:\private\20011383\3GPP-70kB.3gpp"
-"\epoc32\data\Z\private\20011383\AAC-100kB.aac"-"!:\private\20011383\AAC-100kB.aac"
-"\epoc32\data\Z\private\20011383\AMR-20kB.amr"-"!:\private\20011383\AMR-20kB.amr"
-"\epoc32\data\Z\private\20011383\BMP-25kB.bmp"-"!:\private\20011383\BMP-25kB.bmp"
-"\epoc32\data\Z\private\20011383\Deck-1kB.saveddeck"-"!:\private\20011383\Deck-1kB.saveddeck"
-"\epoc32\data\Z\private\20011383\DOC-20kB.doc"-"!:\private\20011383\DOC-20kB.doc"
-"\epoc32\data\Z\private\20011383\GIF-2kB.gif"-"!:\private\20011383\GIF-2kB.gif"
-"\epoc32\data\Z\private\20011383\HTML-20kB.html"-"!:\private\20011383\HTML-20kB.html"
-"\epoc32\data\Z\private\20011383\JAD-1kB.jad"-"!:\private\20011383\JAD-1kB.jad"
-"\epoc32\data\Z\private\20011383\JAR-10kB.jar"-"!:\private\20011383\JAR-10kB.jar"
-"\epoc32\data\Z\private\20011383\JP2-65kB.jp2"-"!:\private\20011383\JP2-65kB.jp2"
-"\epoc32\data\Z\private\20011383\JPEG-200kB.jpg"-"!:\private\20011383\JPEG-200kB.jpg"
-"\epoc32\data\Z\private\20011383\JPEG-25kB.jpg"-"!:\private\20011383\JPEG-25kB.jpg"
-"\epoc32\data\Z\private\20011383\JPEG-500kB.jpg"-"!:\private\20011383\JPEG-500kB.jpg"
-"\epoc32\data\Z\private\20011383\MIDI-10kB.mid"-"!:\private\20011383\MIDI-10kB.mid"
-"\epoc32\data\Z\private\20011383\MP3-250kB.mp3"-"!:\private\20011383\MP3-250kB.mp3"
-"\epoc32\data\Z\private\20011383\MP4-200kB.mp4"-"!:\private\20011383\MP4-200kB.mp4"
-"\epoc32\data\Z\private\20011383\MXMF-40kB.mxmf"-"!:\private\20011383\MXMF-40kB.mxmf"
-"\epoc32\data\Z\private\20011383\PNG-15kB.png"-"!:\private\20011383\PNG-15kB.png"
-"\epoc32\data\Z\private\20011383\PPT-40kB.ppt"-"!:\private\20011383\PPT-40kB.ppt"
-"\epoc32\data\Z\private\20011383\RAM-1kB.ram"-"!:\private\20011383\RAM-1kB.ram"
-"\epoc32\data\Z\private\20011383\RM-95kB.rm"-"!:\private\20011383\RM-95kB.rm"
-"\epoc32\data\Z\private\20011383\RNG-1kB.rng"-"!:\private\20011383\RNG-1kB.rng"
-"\epoc32\data\Z\private\20011383\SVG-15kB.svg"-"!:\private\20011383\SVG-15kB.svg"
-"\epoc32\data\Z\private\20011383\SWF-15kB.swf"-"!:\private\20011383\SWF-15kB.swf"
-"\epoc32\data\Z\private\20011383\TIF-25kB.tif"-"!:\private\20011383\TIF-25kB.tif"
-"\epoc32\data\Z\private\20011383\TXT-10kB.txt"-"!:\private\20011383\TXT-10kB.txt"
-"\epoc32\data\Z\private\20011383\TXT-70kB.txt"-"!:\private\20011383\TXT-70kB.txt"
-"\epoc32\data\Z\private\20011383\VCF-1kB.vcf"-"!:\private\20011383\VCF-1kB.vcf"
-"\epoc32\data\Z\private\20011383\VCS-1kB.vcs"-"!:\private\20011383\VCS-1kB.vcs"
-"\epoc32\data\Z\private\20011383\WAV-20kB.wav"-"!:\private\20011383\WAV-20kB.wav"
-"\epoc32\data\Z\private\20011383\XLS-15kB.xls"-"!:\private\20011383\XLS-15kB.xls"
-"\epoc32\data\Z\private\20011383\SISX-10kB.sisx"-"!:\private\20011383\SISX-10kB.sisx"
-"\epoc32\data\Z\private\20011383\WMA-50kB.wma"-"!:\private\20011383\WMA-50kB.wma"
-"\epoc32\data\Z\private\20011383\WMV-200kB.wmv"-"!:\private\20011383\WMV-200kB.wmv"
Binary file creator/sis/Creator_S60-32.sis has changed
--- a/creator/sis/Creator_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/creator/sis/Creator_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -29,8 +29,9 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\creator.exe"
-""-"z:\resource\apps\creator_aif.mif"
+""-"z:\resource\apps\creator.mif"
 ""-"z:\resource\apps\creator.rsc"
+""-"z:\resource\apps\datacreator.rsc"
 ""-"z:\private\10003a3f\import\apps\creator_reg.rsc"
 ""-"z:\private\20011383\backup_registration.xml"
 
--- a/creator/src/creator.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_app.h"
-
-#include <eikstart.h>
-
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CCreatorApplication;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-    
-
-
-
-
--- a/creator/src/creator_accesspoint.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,469 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_accesspoint.h" 
-#include "creator_traces.h"
-#include <aplistitemlist.h>
-#include <aplistitem.h> 
-
-static const TInt KAccessPointsFieldLength = 128;
-
-_LIT(KCreatorAccessPointsPrefixName, "CR_");
-_LIT(KZeroIP, "0.0.0.0");
-
-//----------------------------------------------------------------------------
-
-CAccessPointsParameters::CAccessPointsParameters()
-    {
-    LOGSTRING("Creator: CAccessPointsParameters::CAccessPointsParameters");
-
-    iConnectionName = HBufC::New(KAccessPointsFieldLength);
-    iWapStartPage = HBufC::New(KAccessPointsFieldLength);
-    iGprsAcessPointName = HBufC::New(KAccessPointsFieldLength);
-    iIspLoginName = HBufC::New(KAccessPointsFieldLength);
-    iIspLoginPass = HBufC::New(KAccessPointsFieldLength);
-    iWapGatewayAddress = HBufC::New(KAccessPointsFieldLength);
-    iIspIPAddr = HBufC::New(KAccessPointsFieldLength);
-    iIspIPNameServer1 = HBufC::New(KAccessPointsFieldLength);
-    iIspIPNameServer2 = HBufC::New(KAccessPointsFieldLength);
-    iIspDefaultTelNumber = HBufC::New(KAccessPointsFieldLength);
-    iProxyServerAddress = HBufC::New(KAccessPointsFieldLength);
-    }
-
-CAccessPointsParameters::~CAccessPointsParameters()
-    {
-    LOGSTRING("Creator: CAccessPointsParameters::~CAccessPointsParameters");
-
-    delete iProxyServerAddress;
-    delete iIspDefaultTelNumber;
-    delete iIspIPNameServer2;
-    delete iIspIPNameServer1;
-    delete iIspIPAddr;
-    delete iWapGatewayAddress;
-    delete iIspLoginPass;
-    delete iIspLoginName;
-    delete iGprsAcessPointName;
-    delete iWapStartPage;
-    delete iConnectionName;
-    }
-
-void CAccessPointsParameters::SetRandomCMNameL(CCreatorEngine& aEngine)
-	{
-	TInt num = aEngine.RandomNumber(1, 3);
-	TBuf<10> apType;
-
-	if (num==1)
-		apType = _L("mms");
-	else if (num==2)
-		apType = _L("wap");
-	else
-		apType = _L("internet");
-
-	TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
-
-	iConnectionName->Des() = KCreatorAccessPointsPrefixName;
-	iConnectionName->Des().Append( company );
-	iConnectionName->Des().Append(_L(" "));
-	iConnectionName->Des().Append(apType);
-	}
-
-void CAccessPointsParameters::SetRandomLoginNameL(CCreatorEngine& aEngine)
-	{
-	iIspLoginName->Des() = aEngine.RandomString(CCreatorEngine::EFirstName);
-	iIspLoginName->Des().LowerCase();
-	}
-
-void CAccessPointsParameters::SetRandomLoginPassL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomSecureAuthenticationL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomPromptPasswordL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomProxyAddressL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomProxyPortL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomStartPageL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomIPAddressL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomIP4NameServer1L(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomIP4NameServer2L(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomTelephoneNumberL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomBearerTypeIsdnL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomBearerSpeedL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomWapWspOptionL(CCreatorEngine& /*aEngine*/)
-	{}
-
-void CAccessPointsParameters::SetRandomGatewayAddressL(CCreatorEngine& /*aEngine*/)
-	{}
-
-//----------------------------------------------------------------------------
-
-CCreatorAccessPoints* CCreatorAccessPoints::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorAccessPoints* self = CCreatorAccessPoints::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorAccessPoints* CCreatorAccessPoints::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorAccessPoints* self = new (ELeave) CCreatorAccessPoints;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorAccessPoints::CCreatorAccessPoints()
-    {
-    }
-
-void CCreatorAccessPoints::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorAccessPoints::ConstructL");
-
-    iEngine = aEngine;
-
-    iCommsDb = CCommsDatabase::NewL();;
-    iApDataHandler = CApDataHandler::NewLC(*iCommsDb);
-    CleanupStack::Pop();
-    iApUtils = CApUtils::NewLC(*iCommsDb);
-    CleanupStack::Pop();
-    }
-
-CCreatorAccessPoints::~CCreatorAccessPoints()
-    {
-    LOGSTRING("Creator: CCreatorAccessPoints::~CCreatorAccessPoints");
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidIAP ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    delete iApUtils;
-    delete iApDataHandler;
-    delete iCommsDb;
-
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorAccessPoints::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorAccessPoints::AskDataFromUserL");
-
-    if( aCommand == ECmdDeleteIAPs )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all Access Points?") );
-        }
-    else if( aCommand == ECmdDeleteCreatorIAPs )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all Access Points created with Creator?") );
-        }
-
-    return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorAccessPoints::CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorAccessPoints::CreateAccessPointEntryL");
-
-    CAccessPointsParameters* parameters = (CAccessPointsParameters*) aParameters;
-    
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    
-            
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        TBuf<160> company = iEngine->RandomString(CCreatorEngine::ECompany);
-        TInt num = iEngine->RandomNumber(1, 3);
-        TBuf<10> apType;
-        
-        if (num==1)
-            apType = _L("mms");
-        else if (num==2)
-            apType = _L("wap");
-        else
-            apType = _L("internet");
-        
-        iParameters = new(ELeave) CAccessPointsParameters;
-        parameters = iParameters;
-
-        parameters->SetRandomCMNameL(*iEngine);
-
-        // in random mode just create GPRS access points
-        parameters->iBearerType = EApBearerTypeGPRS;
-
-        parameters->SetRandomLoginNameL(*iEngine);
-
-        iParameters->iIspLoginPass->Des() = iEngine->RandomString(CCreatorEngine::ESurname);
-        iParameters->iIspLoginPass->Des().LowerCase();
-
-        iParameters->iSecureAuthentication = EFalse;
-        iParameters->iPromptPassword = EFalse;
-
-        iParameters->iProxyServerAddress->Des() = _L("127.0.0.1");
-        iParameters->iProxyPortNumber = 80;
-
-        iParameters->iWapStartPage->Des() = _L("http://");
-        iParameters->iWapStartPage->Des().Append(apType);
-        iParameters->iWapStartPage->Des().Append(_L("."));
-        iParameters->iWapStartPage->Des().Append(company);
-        iParameters->iWapStartPage->Des().Append(_L(".com"));
-        iParameters->iWapStartPage->Des().LowerCase();
-
-        iParameters->iIspIPAddr->Des() = KZeroIP;
-        iParameters->iIspIPNameServer1->Des() = KZeroIP;
-        iParameters->iIspIPNameServer1->Des() = KZeroIP;
-        iParameters->iGprsAcessPointName->Des() = apType;
-        iParameters->iIspDefaultTelNumber->Des() = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
-        iParameters->iIspBearerCallTypeIsdn = ECallTypeISDNv110;
-        iParameters->iIspBearerSpeed = KSpeed14400;
-
-        iParameters->iWapWspOption = EWapWspOptionConnectionOriented;
-        iParameters->iWapGatewayAddress->Des() = KZeroIP;
-        }
-    else
-        {
-        // otherwise replace the parameters object
-        iParameters = parameters;
-        }
-
-    TInt err = KErrNone;
-
-    // access point item
-    CApAccessPointItem* apItem = CApAccessPointItem::NewLC();
-
-    // set the bearer type, if it fails try to set a default type
-    TRAPD(bearerErr, apItem->SetBearerTypeL(iParameters->iBearerType));
-    if (bearerErr != KErrNone)
-        {
-        iParameters->iBearerType = EApBearerTypeGPRS;
-        TRAPD(bearerErr2, apItem->SetBearerTypeL(iParameters->iBearerType));
-        bearerErr2=bearerErr2;
-        }
-
-    if (iParameters->iBearerType == EApBearerTypeGPRS) // GPRS
-        {
-        err = apItem->WriteLongTextL(EApGprsAccessPointName, iParameters->iGprsAcessPointName->Des());
-        }
-    else  // CSD or HCSD
-        {
-        err = apItem->WriteTextL(EApIspDefaultTelNumber, iParameters->iIspDefaultTelNumber->Des());
-        err = apItem->WriteUint(EApIspBearerCallTypeIsdn, iParameters->iIspBearerCallTypeIsdn);
-        err = apItem->WriteUint(EApIspBearerSpeed, iParameters->iIspBearerSpeed);
-        }
-
-    err = apItem->WriteTextL(EApIspLoginName, iParameters->iIspLoginName->Des());
-    err = apItem->WriteTextL(EApIspIfAuthName, iParameters->iIspLoginName->Des());
-    err = apItem->WriteTextL(EApIspLoginPass, iParameters->iIspLoginPass->Des());
-    err = apItem->WriteTextL(EApIspIfAuthPass, iParameters->iIspLoginPass->Des());
-    err = apItem->WriteTextL(EApGprsIfAuthPassword, iParameters->iIspLoginPass->Des());
-    err = apItem->WriteBool(EApIspDisablePlainTextAuth, iParameters->iSecureAuthentication);
-    err = apItem->WriteBool(EApIspPromptForLogin, iParameters->iPromptPassword);
-    err = apItem->WriteTextL(EApWapGatewayAddress, iParameters->iWapGatewayAddress->Des());
-    err = apItem->WriteLongTextL(EApProxyServerAddress, iParameters->iProxyServerAddress->Des());
-    err = apItem->WriteUint(EApProxyPortNumber, iParameters->iProxyPortNumber);
-    err = apItem->WriteLongTextL(EApWapStartPage, iParameters->iWapStartPage->Des());
-    err = apItem->WriteUint(EApWapWspOption, iParameters->iWapWspOption);
-    err = apItem->WriteTextL(EApGprsIPNameServer1, iParameters->iIspIPNameServer1->Des());
-    err = apItem->WriteTextL(EApGprsIPNameServer2, iParameters->iIspIPNameServer2->Des());
-    err = apItem->WriteTextL(EApIspIPAddr, iParameters->iIspIPAddr->Des());
-
-
-    TUint32 uid = iApDataHandler->CreateFromDataL(*apItem);  // save the access point, returns the uid of the AP
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( uid );
-        
-    TBuf<256> name = iParameters->iConnectionName->Des();
-    iApUtils->SetNameL(name, uid); // sets the AP name
-
-
-    // if no defaults set, set the created AP as a default
-
-    // MMS access point
-    if (iParameters->iWapStartPage->Des().FindF(_L("mms")) >=0  ||  iParameters->iConnectionName->Des().FindF(_L("mms")) >=0 )
-        {
-        //User::Panic(_L("Not done yet..."), 123);
-        }
-
-
-    // WAP access point
-    else if (iParameters->iConnectionName->Des().FindF(_L("wap")) >=0  ||  iParameters->iGprsAcessPointName->Des().FindF(_L("wap")) >= 0)
-        {
-        TUint32 defID = 0;
-        TRAP( err, defID = iApDataHandler->DefaultL(ETrue) );  // ETrue==WAP
-
-        if (defID <= 1)
-            TRAP( err, iApDataHandler->SetAsDefaultL(uid, EIspTypeWAPOnly) );
-
-        }
-
-    // Internet access point
-    else if (iParameters->iConnectionName->Des().FindF(_L("internet")) >=0  ||  iParameters->iGprsAcessPointName->Des().FindF(_L("internet")) >= 0)
-        {
-        TUint32 defID = 0;
-        TRAP( err, defID = iApDataHandler->DefaultL(EFalse) );  // EFalse==IAP
-
-        if (defID <= 1)
-            TRAP( err, iApDataHandler->SetAsDefaultL(uid, EIspTypeInternetOnly) );  //  <--  POSSIBLY NOT CORRECT, NEEDS MORE TESTING
-        }
-
-
-
-    CleanupStack::PopAndDestroy(); //apItem
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TUint32 CCreatorAccessPoints::AccessPointNameToIdL(const TDesC& aAPName, TBool /*aAnyIfNotFound*/ )
-    {
-    LOGSTRING("Creator: CCreatorEngine::AccessPointNameToIdL");
-
-    TBuf<256> apName = aAPName.Left(256);
-    apName.Trim();
-
-    TUint32 APId = iEngine->GetDefaultIAPL();
-
-    // return default IAP if requested
-    if (apName.CompareF(_L("DEFAULT-IAP")) == 0 || apName.CompareF(_L("DEFAULT")) == 0)
-        {
-        return APId;
-        }
-
-    CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
-    CleanupStack::PushL(db);
-    CApUtils* apUtils = CApUtils::NewLC(*db);
-    CApSelect* apSelect = CApSelect::NewLC(*db, KEApIspTypeAll, EApBearerTypeAll, KEApSortNameAscending);
-
-
-    // loop through all access points and try to find a matching name
-    if (apSelect->MoveToFirst())
-        {
-        do
-            {
-            TBuf<256> apName2;
-            apUtils->NameL(apSelect->Uid(), apName2);
-            apName2.Trim();
-
-            if (apName2.CompareF( apName ) == 0)
-                {
-                // match found, get uid and break the loop
-                TRAPD( err, APId = apUtils->IapIdFromWapIdL(apSelect->Uid()) );
-                err=err;
-                break;
-                }
-            }
-        while (apSelect->MoveNext());
-        }
-
-    CleanupStack::PopAndDestroy(3);  //apSelect, apUtils, db
-
-    return APId;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorAccessPoints::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
-    {
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorAccessPoints::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::DeleteAllL");
-    
-    CApSelect* selector = CApSelect::NewLC( *iCommsDb, 
-                                            KEApIspTypeAll,
-                                            EApBearerTypeAllBearers,
-                                            KEApSortUidAscending );
-    
-    CApListItemList* list = new (ELeave) CApListItemList();
-    CleanupStack::PushL( list );
-    TInt count = selector->AllListItemDataL( *list );
-    for ( TInt i = 0; i < count; i++ )
-        {
-        TRAP_IGNORE( iApDataHandler->RemoveAPL( (*list)[i]->Uid() ) );
-        }
-
-    CleanupStack::PopAndDestroy( list );
-    CleanupStack::PopAndDestroy( selector );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Logs related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorAccessPoints::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidIAP );
-    
-    // delete entries
-    for ( TInt i = 0; i < iEntryIds.Count(); i++ )
-        {
-        TRAP_IGNORE( iApDataHandler->RemoveAPL( iEntryIds[i] ) );
-        }
-    
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Logs related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
-    }
--- a/creator/src/creator_app.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_document.h"
-#include "creator_app.h"
-
-CApaDocument* CCreatorApplication::CreateDocumentL()
-    {  
-    // Create an Creator document, and return a pointer to it
-    CApaDocument* document = CCreatorDocument::NewL(*this);
-    return document;
-    }
-
-TUid CCreatorApplication::AppDllUid() const
-    {
-    // Return the UID for the Creator application
-    return KUidCreatorApp;
-    }
-
--- a/creator/src/creator_appui.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,360 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#include <creator.rsg>
-
-#include "creator.pan"
-#include "creator_appui.h"
-#include "creator_container.h"
-#include "creator.hrh"
-
-#include <bautils.h>
-#include <pathinfo.h> 
-#include <aknmessagequerydialog.h> 
-#include <eikmenub.h>
-#include <akntitle.h>
-#include <akncontext.h>
-#include <aknnotewrappers.h>
-#include <avkon.hrh>
-
-// delay before script running and application exiting in seconds
-// when script is run from command line
-const TInt KCommandLineDelay = 3;
-
-// ConstructL is called by the application framework
-void CCreatorAppUi::ConstructL()
-    {
-    BaseConstructL(EAknEnableSkin);
-
-    iAppView = CCreatorAppView::NewL(ClientRect());    
-
-    AddToStackL(iAppView);
-
-    iEnv=CEikonEnv::Static();
-
-    iEngine = CCreatorEngine::NewL(this);
- 
-	iMode = ETimerModeNone;
-	iTickCount = 0;
-    iTimer = CHeartbeat::NewL(0);
-    
-    // parse script name and random data file name from command line
-    iCommandLineScriptName = HBufC::NewL(User::CommandLineLength());
-    iCommandLineRandomDataFileName = HBufC::NewL(User::CommandLineLength());
-    HBufC* commandLine = HBufC::NewLC(User::CommandLineLength());
-    TPtr16 ptr = commandLine->Des();
-    User::CommandLine(ptr);
-    commandLine->Des().Trim();
-    
-    TInt pos = commandLine->Des().Find(_L(" "));
-    if (pos != KErrNotFound)
-    	{
-    	iCommandLineScriptName->Des().Copy(commandLine->Des().Left(pos));
-    	iCommandLineRandomDataFileName->Des().Copy(commandLine->Des().Mid(pos));
-    	iCommandLineRandomDataFileName->Des().Trim();
-    	}
-    else
-    	{
-    	iCommandLineScriptName->Des().Copy(commandLine->Des());
-    	iCommandLineRandomDataFileName->Des().Copy(KNullDesC);
-    	}
-
-    CleanupStack::PopAndDestroy(commandLine);
-    
-    if (iCommandLineScriptName->Des().Length() > 0)
-    	{
-    	iMode = ETimerModeStartScript;
-    	iTimer->Start(ETwelveOClock, this);
-    	}
-    }
-
-
-CCreatorAppUi::CCreatorAppUi()                              
-    {
-    // add any construction that cannot leave here
-    }
-
-
-CCreatorAppUi::~CCreatorAppUi()
-    {
-
-    delete iCommandLineRandomDataFileName;
-    delete iCommandLineScriptName;
-    
-    if (iTimer)
-    	{
-    	iTimer->Cancel();
-        delete iTimer;
-        iTimer = NULL;
-    	}
-    
-    delete iEngine;
-
-	if (iAppView)
-        {
-		RemoveFromStack(iAppView);
-        delete iAppView;
-        iAppView = NULL;
-        }
-    }
-
-
-// handle any menu commands
-void CCreatorAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch(aCommand)
-        {
-        // main menus, not assigned to any commands
-	    case ECmdCreateCalendarEntries:
-	    case ECmdCreateBrowserEntries:
-	    case ECmdCreateFileEntries:
-	    case ECmdCreateLogEntries:
-	    case ECmdCreateMessagingEntries:
-	    case ECmdCreateMiscEntries:
-	    case ECmdCreatePhoneBookEntries:
-            {
-            User::Panic (_L("Unused command"), 102);
-            }
-            break;
-
-        // about
-	    case ECmdAboutCreator:
-            {
-	        CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog;
-            dialog->ExecuteLD(R_CREATOR_ABOUT_DIALOG);
-            }
-            break;
-
-
-        // run script
-        case ECmdCreateFromFile:
-            {
-            iEngine->RunScriptL();
-			}
-			break;
-
-        // select random data file
-        case ECmdSelectRandomDataFile:
-            {
-            TFileName filename;
-            if (iEngine->GetRandomDataFilenameL(filename))
-            	{
-            	iEngine->GetRandomDataFromFileL(filename);
-            	}
-			}
-			break;
-
-
-        // commands:
-	    case ECmdCreateCalendarEntryAppointments:
-	    case ECmdCreateCalendarEntryEvents:
-	    case ECmdCreateCalendarEntryAnniversaries:
-	    case ECmdCreateCalendarEntryToDos:
-	    case ECmdCreateCalendarEntryReminders:
-        
-        case ECmdCreateBrowserBookmarkEntries:
-	    case ECmdCreateBrowserBookmarkFolderEntries:
-	    case ECmdCreateBrowserSavedPageEntries:
-	    case ECmdCreateBrowserSavedPageFolderEntries:
-
-	    case ECmdCreatePhoneBookEntryContacts:
-	    case ECmdCreatePhoneBookEntryGroups:
-
-   	    case ECmdCreateMiscEntryNotes:
-   	    case ECmdCreateMiscEntryLandmarks:
-
-	    case ECmdCreateLogEntryMissedCalls:
-	    case ECmdCreateLogEntryReceivedCalls:
-	    case ECmdCreateLogEntryDialledNumbers:
-
-	    case ECmdCreateMiscEntryAccessPoints:
-  	    case ECmdCreateMiscEntryIMPSServers:
-
-	    case ECmdCreateMessagingEntryMailboxes:
-	    case ECmdCreateMessagingEntryMessages:
-
-	    case ECmdCreateFileEntryEmptyFolder:
-	    case ECmdCreateFileEntry3GPP_70kB:
-	    case ECmdCreateFileEntryAAC_100kB:
-	    case ECmdCreateFileEntryAMR_20kB:
-	    case ECmdCreateFileEntryBMP_25kB:
-	    case ECmdCreateFileEntryDeck_1kB:
-	    case ECmdCreateFileEntryDOC_20kB:
-	    case ECmdCreateFileEntryGIF_2kB:
-	    case ECmdCreateFileEntryHTML_20kB:
-	    case ECmdCreateFileEntryJAD_1kB:
-	    case ECmdCreateFileEntryJAR_10kB:
-	    case ECmdCreateFileEntryJP2_65kB:
-	    case ECmdCreateFileEntryJPEG_200kB:
-	    case ECmdCreateFileEntryJPEG_25kB:
-	    case ECmdCreateFileEntryJPEG_500kB:
-	    case ECmdCreateFileEntryMIDI_10kB:
-	    case ECmdCreateFileEntryMP3_250kB:
-	    case ECmdCreateFileEntryMP4_200kB:
-	    case ECmdCreateFileEntryMXMF_40kB:
-	    case ECmdCreateFileEntryPNG_15kB:
-	    case ECmdCreateFileEntryPPT_40kB:
-	    case ECmdCreateFileEntryRAM_1kB:
-	    case ECmdCreateFileEntryRM_95kB:
-	    case ECmdCreateFileEntryRNG_1kB:
-	    case ECmdCreateFileEntrySVG_15kB:
-	    case ECmdCreateFileEntrySWF_15kB:
-	    case ECmdCreateFileEntryTIF_25kB:
-	    case ECmdCreateFileEntryTXT_10kB:
-	    case ECmdCreateFileEntryTXT_70kB:
-	    case ECmdCreateFileEntryVCF_1kB:
-	    case ECmdCreateFileEntryVCS_1kB:
-	    case ECmdCreateFileEntryWAV_20kB:
-	    case ECmdCreateFileEntryXLS_15kB:
-	    case ECmdCreateFileEntrySISX_10kB:
-	    case ECmdCreateFileEntryWMA_50kB:
-	    case ECmdCreateFileEntryWMV_200kB:
-	    case ECmdDeleteAllEntries:
-	    case ECmdDeleteAllCreatorEntries:
-	    case ECmdDeleteContacts:
-        case ECmdDeleteCreatorContacts:
-        case ECmdDeleteContactGroups:
-        case ECmdDeleteCreatorContactGroups:
-        case ECmdDeleteCalendarEntries:
-        case ECmdDeleteCreatorCalendarEntries:
-        case ECmdDeleteBrowserBookmarks:
-        case ECmdDeleteCreatorBrowserBookmarks:
-        case ECmdDeleteBrowserBookmarkFolders:
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-        case ECmdDeleteBrowserSavedPages:
-        case ECmdDeleteCreatorBrowserSavedPages:
-        case ECmdDeleteBrowserSavedPageFolders:
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-        case ECmdDeleteCreatorFiles:
-        case ECmdDeleteLogs:
-        case ECmdDeleteCreatorLogs:
-        case ECmdDeleteMessages:
-        case ECmdDeleteCreatorMessages:
-        case ECmdDeleteMailboxes:
-        case ECmdDeleteCreatorMailboxes:
-        case ECmdDeleteIAPs:
-        case ECmdDeleteCreatorIAPs:
-        case ECmdDeleteIMPSs:
-        case ECmdDeleteCreatorIMPSs:
-        case ECmdDeleteNotes:
-        case ECmdDeleteLandmarks:
-        case ECmdDeleteCreatorLandmarks:
-            {
-            iEngine->ExecuteOptionsMenuCommandL(aCommand);
-            }
-            break;
-
-        case ECmdDeleteEntries:
-        case ECmdCreatePhoneBookEntrySubscribedContacts:
-	    case ECmdCreateMessagingEntryCBSTopics:
-	    case ECmdCreateMessagingEntrySMSMessageCenters:
-	    case ECmdCreateMessagingEntryTemplates:
-	    case ECmdCreateMiscEntryAppMenuFolders:
-	    case ECmdCreateMiscEntrySyncSettings:
-        case ECmdCreateMessagingEntryDocumentsFolders:
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Please contact S60 CO if you need this feature..."));
-            }
-            break;
-
-		case EEikCmdExit:
-		case EAknSoftkeyExit:
-			{
-			Exit();
-			}
-            break;
-
-        default:
-            User::Panic (_L("Invalid command"), 101);
-            break;
-        }
-    }
-
-
-void CCreatorAppUi::DynInitMenuPaneL( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ )
-	{
-	}
-
-void CCreatorAppUi::RunScriptDone()
-	{
-	if (iMode == ETimerModeStartScript)
-		{
-		iMode = ETimerModeExitAppUi;
-		iTimer->Start(ETwelveOClock, this);
-		}
-	}
-
-void CCreatorAppUi::Beat()
-	{
-	Tick();
-	}
-
-void CCreatorAppUi::Synchronize()
-	{
-	Tick();
-	}
-
-void CCreatorAppUi::Tick()
-	{
-	iTickCount++;
-	if (iTickCount > KCommandLineDelay)
-		{
-		iTimer->Cancel();
-		iTickCount = 0;
-		if (iMode == ETimerModeStartScript)
-			{
-        	iEngine->GetRandomDataFromFileL(*iCommandLineRandomDataFileName);
-			TInt status = iEngine->RunScriptL(*iCommandLineScriptName);
-			if (status != KErrNone)
-				{
-				TBuf<128> noteMsg;
-				if (status == KErrNotFound)
-					{
-					_LIT(KMessage1, "Error in opening script file.");
-					noteMsg.Copy(KMessage1);
-					}
-				else if (status == KErrCorrupt)
-					{
-					_LIT(KMessage2, "Error in parsing script file.");
-					noteMsg.Copy(KMessage2);
-					}
-				else if (status == KErrCompletion)
-					{
-					_LIT(KMessage3, "Script file does not contain any elements.");
-					noteMsg.Copy(KMessage3);
-					}
-				else
-					{
-					_LIT(KMessage4, "Unknown error in opening script file.");
-					noteMsg.Copy(KMessage4);
-					}
-				CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-				note->ExecuteLD(noteMsg);
-				RunScriptDone();
-				}
-			}
-		else if (iMode == ETimerModeExitAppUi)
-	    	{
-	    	iMode = ETimerModeNone;
-	    	Exit();
-	    	}
-		}
-	}
--- a/creator/src/creator_browser.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,592 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_browser.h" 
-#include "creator_traces.h"
-
-#include <FavouritesWapAp.h> 
-
-
-static const TInt KBrowserFieldLength = 128;
-
-_LIT(KCreatorBrowserPrefixName, "CR_");
-_LIT(KCreatorBrowserPrefixFolderName, "CR_FLDR_");
-
-//----------------------------------------------------------------------------
-
-CBrowserParameters::CBrowserParameters()
-    {
-    LOGSTRING("Creator: CBrowserParameters::CBrowserParameters");
-
-    iBookmarkName = HBufC::New(KBrowserFieldLength);
-    iBookmarkAddress = HBufC::New(KBrowserFieldLength);
-    iBookmarkUsername = HBufC::New(KBrowserFieldLength);
-    iBookmarkPassword = HBufC::New(KBrowserFieldLength);    
-    iBookmarkFolderName = HBufC::New(KBrowserFieldLength);
-    iSavedDeckLinkName = HBufC::New(KBrowserFieldLength);
-    iSavedDeckLocalAddress = HBufC::New(KBrowserFieldLength);
-    iSavedDeckFolderName = HBufC::New(KBrowserFieldLength);
-    }
-
-CBrowserParameters::~CBrowserParameters()
-    {
-    LOGSTRING("Creator: CBrowserParameters::~CBrowserParameters");
-
-    delete iSavedDeckFolderName;
-    delete iSavedDeckLocalAddress;
-    delete iSavedDeckLinkName;
-    delete iBookmarkFolderName;
-    delete iBookmarkPassword;    
-    delete iBookmarkUsername;
-    delete iBookmarkAddress;
-    delete iBookmarkName;
-
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorBrowser* CCreatorBrowser::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorBrowser* self = CCreatorBrowser::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorBrowser* CCreatorBrowser::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorBrowser* self = new (ELeave) CCreatorBrowser;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorBrowser::CCreatorBrowser()
-    {
-    }
-
-void CCreatorBrowser::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::ConstructL");
-
-    iEngine = aEngine;
-    }
-
-CCreatorBrowser::~CCreatorBrowser()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::~CCreatorBrowser");
-    if ( iEngine && iBmEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iBmEntryIds, KUidDictionaryUidBrowserBookmarks ) );
-        }
-    iBmEntryIds.Reset();
-    iBmEntryIds.Close();
-
-    if ( iEngine && iBmFEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iBmFEntryIds, KUidDictionaryUidBrowserBookmarkF ) );
-        }
-    iBmFEntryIds.Reset();
-    iBmFEntryIds.Close();
-
-    if ( iEngine && iSpEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iSpEntryIds, KUidDictionaryUidBrowserSavedPg ) );
-        }
-    iSpEntryIds.Reset();
-    iSpEntryIds.Close();
-
-    if ( iEngine && iSpFEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iSpFEntryIds, KUidDictionaryUidBrowserSavedPgF ) );
-        }
-    iSpFEntryIds.Reset();
-    iSpFEntryIds.Close();
-
-    delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorBrowser::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::AskDataFromUserL");
-
-    TBool result( EFalse );
-    switch ( aCommand )
-        {
-        case ECmdDeleteBrowserBookmarks:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser bookmarks?") );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarks:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser bookmarks created with Creator?") );
-            break;
-            }
-        case ECmdDeleteBrowserBookmarkFolders:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser bookmark folders?") );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser bookmark folders created with Creator?") );
-            break;
-            }
-        case ECmdDeleteBrowserSavedPages:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser saved pages?") );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPages:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser saved pages created with Creator?") );
-            break;
-            }
-        case ECmdDeleteBrowserSavedPageFolders:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser saved pages folders?") );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-            {
-            result = iEngine->YesNoQueryDialogL( _L("Delete all Browser saved pages folders created with Creator?") );
-            break;
-            }
-        default:
-            {
-            result = iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-            break;
-            }
-        }
-    return result;
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorBrowser::CreateBookmarkEntryL(CBrowserParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::CreateBookmarkEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CBrowserParameters* parameters = aParameters;
-        
-    // random data needed if no predefined data available
-    if( !parameters )
-        {
-        iParameters = new(ELeave) CBrowserParameters;
-        parameters = iParameters; 
-
-        TFileName userAndPassword = iEngine->RandomString(CCreatorEngine::EFirstName);
-        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
-        TFileName url = name;
-        url.Insert(0, _L("http://www."));
-        url.Append(_L(".com/"));
-        name.Insert(0, KCreatorBrowserPrefixName);
-
-        parameters->iBookmarkName->Des() = name;
-        parameters->iBookmarkAddress->Des() = url;
-        parameters->iBookmarkUsername->Des() = userAndPassword;
-        parameters->iBookmarkPassword->Des() = userAndPassword;
-        }
-   
-    TInt err = KErrNone;
-
-    RFavouritesSession session;
-    User::LeaveIfError( session.Connect() );
-    CleanupClosePushL<RFavouritesSession>(session);
-    RFavouritesDb db;
-    User::LeaveIfError( db.Open(session, KBrowserBookmarks) );
-    CleanupClosePushL<RFavouritesDb>(db);
-
-    CFavouritesItem* item = CFavouritesItem::NewLC();
-    item->SetType( CFavouritesItem::EItem );
-    item->SetParentFolder( KFavouritesRootUid ) ;
-    item->SetNameL( parameters->iBookmarkName->Des() );
-    item->SetUrlL( parameters->iBookmarkAddress->Des() );
-    item->SetUserNameL( parameters->iBookmarkUsername->Des() );
-    item->SetPasswordL( parameters->iBookmarkPassword->Des() );
-    err = db.Add(*item, /*aAutoRename=*/ETrue);
-    if (err)
-        db.Commit();
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iBmEntryIds.Append( item->Uid() );
-    
-    CleanupStack::PopAndDestroy(3); //db, session, item
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorBrowser::CreateBookmarkFolderEntryL(CBrowserParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::CreateBookmarkFolderEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CBrowserParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CBrowserParameters;
-        parameters = iParameters;
-
-        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
-        name.Insert(0, KCreatorBrowserPrefixFolderName);
-
-        parameters->iBookmarkFolderName->Des() = name;
-        }
-    
-    TInt err = KErrNone;
-
-    RFavouritesSession session;
-    User::LeaveIfError( session.Connect() );
-    CleanupClosePushL<RFavouritesSession>(session);
-    RFavouritesDb db;
-    User::LeaveIfError( db.Open(session, KBrowserBookmarks) );
-    CleanupClosePushL<RFavouritesDb>(db);
-
-    CFavouritesItem* item = CFavouritesItem::NewLC();
-    item->SetType( CFavouritesItem::EFolder );
-    item->SetParentFolder( KFavouritesRootUid ) ;
-    item->SetNameL( parameters->iBookmarkFolderName->Des() );
-    
-    err = db.Add(*item, /*aAutoRename=*/ETrue);
-    if (err)
-        db.Commit();
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iBmFEntryIds.Append( item->Uid() );
-    
-    CleanupStack::PopAndDestroy(3); //db, session, item
-            
-
-    return err;
-    
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorBrowser::CreateSavedDeckEntryL(CBrowserParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::CreateSavedDeckEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CBrowserParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CBrowserParameters;
-        parameters = iParameters;
-
-        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
-        name.Insert(0, KCreatorBrowserPrefixName);
-
-        parameters->iSavedDeckLinkName->Des() = name;
-        parameters->iSavedDeckLocalAddress->Des() = iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB);
-        }
-   
-    TInt err = KErrNone;
-
-    // check the deck address is correct
-    if ( parameters->iSavedDeckLocalAddress->Des().Length() == 0 ||
-    		!BaflUtils::FileExists( CEikonEnv::Static()->FsSession(), parameters->iSavedDeckLocalAddress->Des() ))
-        {
-        // not found, use a default deck instead
-        delete parameters->iSavedDeckLocalAddress;
-        parameters->iSavedDeckLocalAddress = 0;
-        TPtrC tmp = iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB);
-        parameters->iSavedDeckLocalAddress = HBufC::NewL(tmp.Length());
-        parameters->iSavedDeckLocalAddress->Des() = tmp;
-        }
-
-
-    RFavouritesSession session;
-    User::LeaveIfError( session.Connect() );
-    CleanupClosePushL<RFavouritesSession>(session);
-    RFavouritesDb db;
-    User::LeaveIfError( db.Open(session, KBrowserSavedPages) );
-    CleanupClosePushL<RFavouritesDb>(db);
-
-    CFavouritesItem* item = CFavouritesItem::NewLC();
-    item->SetType( CFavouritesItem::EItem );
-    item->SetParentFolder( KFavouritesRootUid ) ;
-    item->SetNameL( parameters->iSavedDeckLinkName->Des() );
-    item->SetUrlL( _L(" ") );
-
-    TFavouritesWapAp favouritesAp;
-    favouritesAp.SetDefault();
-    item->SetWapAp( favouritesAp );
-
-    
-    err = db.Add(*item, /*aAutoRename=*/ETrue);
-    if (err)
-        db.Commit();
-    
-    // read the source deck to buffer
-    RFile sourceFile;
-    User::LeaveIfError( sourceFile.Open(CEikonEnv::Static()->FsSession(), parameters->iSavedDeckLocalAddress->Des(), EFileRead) );
-    CleanupClosePushL<RFile>(sourceFile);
-    TInt sourceFileSize(0);
-    err = sourceFile.Size(sourceFileSize);
-    HBufC8* sourceBuf = HBufC8::NewLC(sourceFileSize);
-    TPtr8 sourcePtr = sourceBuf->Des();
-    sourceFile.Read(sourcePtr);
-    
-    // write the deck
-    RFavouritesFile destinationFile;
-    User::LeaveIfError( destinationFile.Replace(db, item->Uid() ));
-    CleanupClosePushL<RFavouritesFile>(destinationFile);
-    err = destinationFile.Write(sourceBuf->Des());
-
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iSpEntryIds.Append( item->Uid() );
-
- 
-    CleanupStack::PopAndDestroy(6); //db, session, item, sourceFile, destinationFile, sourceBuf    
-    
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorBrowser::CreateSavedDeckFolderEntryL(CBrowserParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::CreateSavedDeckFolderEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-            
-    CBrowserParameters* parameters = aParameters;
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CBrowserParameters;
-        parameters = iParameters;
-        
-        TFileName name = iEngine->RandomString(CCreatorEngine::ECompany);
-        name.Insert(0, KCreatorBrowserPrefixFolderName);
-
-        parameters->iSavedDeckFolderName->Des() = name;
-        }
-   
-    TInt err = KErrNone;
-
-    RFavouritesSession session;
-    User::LeaveIfError( session.Connect() );
-    CleanupClosePushL<RFavouritesSession>(session);
-    RFavouritesDb db;
-    User::LeaveIfError( db.Open(session, KBrowserSavedPages) );
-    CleanupClosePushL<RFavouritesDb>(db);
-
-    CFavouritesItem* item = CFavouritesItem::NewLC();
-    item->SetType( CFavouritesItem::EFolder );
-    item->SetParentFolder( KFavouritesRootUid ) ;
-    item->SetNameL( parameters->iSavedDeckFolderName->Des() );
-    
-    err = db.Add(*item, /*aAutoRename=*/ETrue);
-    if (err)
-        db.Commit();
-
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iSpFEntryIds.Append( item->Uid() );
-
-    CleanupStack::PopAndDestroy(3); //db, session, item
-                
-    return err;
-    
-    }
-
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllL");
-    User::Leave( KErrNotSupported );
-    // will not be supported, see separate implementations below
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllCreatedByCreatorL");
-    User::Leave( KErrNotSupported );
-    // will not be supported, see separate implementations below
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllBookmarksL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarksL");
-    DeleteAllItemsL( KBrowserBookmarks,
-                     CFavouritesItem::EItem,
-                     EFalse,
-                     iBmEntryIds, // ignored, because deleting all
-                     KUidDictionaryUidBrowserBookmarks );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllBookmarksCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarksCreatedByCreatorL");
-    DeleteAllItemsL( KBrowserBookmarks,
-                     CFavouritesItem::EItem,
-                     ETrue,
-                     iBmEntryIds,
-                     KUidDictionaryUidBrowserBookmarks );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllBookmarkFoldersL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarkFoldersL");
-    DeleteAllItemsL( KBrowserBookmarks,
-                     CFavouritesItem::EFolder,
-                     EFalse,
-                     iBmFEntryIds, // ignored, because deleting all
-                     KUidDictionaryUidBrowserBookmarkF );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllBookmarkFoldersCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllBookmarkFoldersCreatedByCreatorL");
-    DeleteAllItemsL( KBrowserBookmarks,
-                     CFavouritesItem::EFolder,
-                     ETrue,
-                     iBmFEntryIds,
-                     KUidDictionaryUidBrowserBookmarkF );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllSavedPagesL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPagesL");
-    DeleteAllItemsL( KBrowserSavedPages,
-                     CFavouritesItem::EItem,
-                     EFalse,
-                     iSpEntryIds, // ignored, because deleting all
-                     KUidDictionaryUidBrowserSavedPg );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllSavedPagesCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPagesCreatedByCreatorL");
-    DeleteAllItemsL( KBrowserSavedPages,
-                     CFavouritesItem::EItem,
-                     ETrue,
-                     iSpEntryIds,
-                     KUidDictionaryUidBrowserSavedPg );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllSavedPageFoldersL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPageFoldersL");
-    DeleteAllItemsL( KBrowserSavedPages,
-                     CFavouritesItem::EFolder,
-                     EFalse,
-                     iSpFEntryIds, // ignored, because deleting all
-                     KUidDictionaryUidBrowserSavedPgF );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllSavedPageFoldersCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteAllSavedPageFolderssCreatedByCreatorL");
-    DeleteAllItemsL( KBrowserSavedPages,
-                     CFavouritesItem::EFolder,
-                     ETrue,
-                     iSpFEntryIds,
-                     KUidDictionaryUidBrowserSavedPgF );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorBrowser::DeleteAllItemsL( const TDesC& aDbName, 
-                                       CFavouritesItem::TType aTypeFilter,
-                                       TBool aOnlyCreatedWithCreator,
-                                       RArray<TInt>& aEntryIds,
-                                       const TUid aDictUid )
-    {
-    LOGSTRING("Creator: CCreatorBrowser::DeleteItemL");
-    RFavouritesSession session;
-    User::LeaveIfError( session.Connect() );
-    CleanupClosePushL( session );
-    RFavouritesDb db;
-    User::LeaveIfError( db.Open( session, aDbName ) );
-    CleanupClosePushL( db );
-       
-    if ( aOnlyCreatedWithCreator )
-        {
-        // read uids from Creator internal store
-        aEntryIds.Reset();
-        iEngine->ReadEntryIdsFromStoreL( aEntryIds, aDictUid );
-        
-        // delete entries from db
-        for ( TInt i = 0; i < aEntryIds.Count(); i++ )
-            {
-            db.Delete( aEntryIds[i] );
-            }
-        }
-    else
-        {
-        CArrayFixFlat<TInt>* uids = new (ELeave) CArrayFixFlat<TInt>(64);
-        CleanupStack::PushL( uids );
-        
-        // read uids from browser db
-        User::LeaveIfError( db.GetUids( *uids, KFavouritesRootUid, aTypeFilter ) );
-
-        // delete entries from db
-        for ( TInt i = 0; i < uids->Count(); i++ )
-            {
-            db.Delete( uids->At(i) );
-            }
-        
-        // db.Commit() seems to panic with EFavouritesNoTransaction
-        // deletion is successful even without commit, so not calling it
-        CleanupStack::PopAndDestroy( uids );
-        }
-       
-    // entries deleted, remove the Browser related registry
-    aEntryIds.Reset();
-    iEngine->RemoveStoreL( aDictUid );
-
-    CleanupStack::PopAndDestroy( &db );
-    CleanupStack::PopAndDestroy( &session );
-    }
--- a/creator/src/creator_browserelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_browserelement.h"
-#include "creator_traces.h"
-#include "creator_browser.h"
-
-using namespace creatorbrowser;
-
-/*
- * 
- */
-CCreatorBrowserElement* CCreatorBrowserElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorBrowserElement* self = new (ELeave) CCreatorBrowserElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorBrowserElement::CCreatorBrowserElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-
-/*
- * 
- */
-void CCreatorBrowserElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt entryAmount = 1;
-    TBool addAll = EFalse;
-    if( amountAttr )
-        {
-        entryAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement )
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
-        // Create browser entries, the amount of entries is defined by entryAmount:
-        for( TInt cI = 0; cI < entryAmount; ++cI )
-            {
-            CBrowserParameters* param = 0;
-            
-            if( fields.Count() > 0 )
-            	param = new (ELeave) CBrowserParameters;
-            else
-            	{
-            	// No fields defined --> Add all fields with random values:
-            	addAll = ETrue;
-            	break;
-            	}
-            
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();                
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                if( elemName == KName )
-                    {
-                    if( randomAttr || elemContent.Length() == 0)
-                        {
-                        elemContent.Set(iEngine->RandomString(CCreatorEngine::ECompany));
-                        }
-                    if( iName->Des() == KBookmark )
-                        {
-                        SetContentToTextParamL(param->iBookmarkName, elemContent);                        
-                        }
-                    else if( iName->Des() == KBookmarkFolder )
-                        {
-                        SetContentToTextParamL(param->iBookmarkFolderName, elemContent);
-                        }
-                    else if( iName->Des() == KSavedPage )
-                        {
-                        SetContentToTextParamL(param->iSavedDeckLinkName, elemContent);
-                        }
-                    else if( iName->Des() == KSavedPageFolder )
-                        {
-                        SetContentToTextParamL(param->iSavedDeckFolderName, elemContent);
-                        }
-                    }
-                
-                else if( elemName == KPath )
-                    {                    
-                    if( randomAttr || elemContent.Length() == 0)
-                        {
-                        SetContentToTextParamL(param->iSavedDeckLocalAddress, iEngine->TestDataPathL(CCreatorEngine::ESavedDeck_1kB));
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iSavedDeckLocalAddress, elemContent);
-                        }
-                    }
-                else if( elemName == KUsername )
-                    {
-                    if( randomAttr || elemContent.Length() == 0)
-                        {
-                        // Set username and password to same string
-                        if( param->iBookmarkPassword && param->iBookmarkPassword->Length() > 0 )
-                            {
-                            SetContentToTextParamL(param->iBookmarkUsername, param->iBookmarkPassword->Des());
-                            }
-                        else
-                            {
-                            SetContentToTextParamL(param->iBookmarkUsername, iEngine->RandomString(CCreatorEngine::EFirstName));
-                            }
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iBookmarkUsername, elemContent);
-                        }
-                    }
-                else if( elemName == KPassword )
-                    {
-                    if( randomAttr || elemContent.Length() == 0)
-                        {
-                        // Set username and password to same string
-                        if( param->iBookmarkUsername && param->iBookmarkUsername->Length() > 0 )
-                            {
-                            SetContentToTextParamL(param->iBookmarkPassword, param->iBookmarkUsername->Des());
-                            }
-                        else
-                            {
-                            SetContentToTextParamL(param->iBookmarkPassword, iEngine->RandomString(CCreatorEngine::EFirstName));                                                    
-                            }
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iBookmarkPassword, elemContent);
-                        }
-                    }
-                else if( elemName == KUrl )
-                    {
-                    if( randomAttr || elemContent.Length() == 0)
-                        {
-                        TDesC* tmpUrl = iEngine->CreateHTTPUrlLC();
-                        if( tmpUrl )
-                            {
-                            SetContentToTextParamL(param->iBookmarkAddress, *tmpUrl );
-                            }
-                        CleanupStack::PopAndDestroy(); // tmpUrl                        
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iBookmarkAddress, elemContent);
-                        }
-                    }
-                }
-            iEngine->AppendToCommandArrayL(GetBrowserCommandL(), param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	addAll = ETrue;
-    	}
-    
-    if( addAll )
-    	{
-    	iEngine->AppendToCommandArrayL(GetBrowserCommandL(), 0, entryAmount);
-    	}
-    }
-
-TInt CCreatorBrowserElement::GetBrowserCommandL() const
-    {
-    if( iName->Des() == KBookmark )
-        {
-        return ECmdCreateBrowserBookmarkEntries;
-        }
-    else if( iName->Des() == KBookmarkFolder )
-        {
-        return ECmdCreateBrowserBookmarkFolderEntries;
-        }
-    else if( iName->Des() == KSavedPage )
-        {
-        return ECmdCreateBrowserSavedPageEntries;
-        }
-    else if( iName->Des() == KSavedPageFolder )
-        {
-        return ECmdCreateBrowserSavedPageFolderEntries;
-        }
-    
-    LOGSTRING("CCreatorFileElement::GetBrowserCommandL: Unknown browser entry");
-    User::Leave(KErrGeneral);
-    return 0; // Not reached, but disables compiler warning...
-    }
--- a/creator/src/creator_calendar.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1601 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_calendar.h" 
-#include "creator_traces.h"
-#include "creator_scriptentry.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include "creator_contactsetcache.h"
-#include "creator_virtualphonebook.h"
-#endif
-#include <e32base.h>
-#include <e32math.h>
-#include <calrrule.h> 
-#include <calalarm.h>
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include <MVPbkFieldType.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkStoreContactFieldCollection.h>
-#include <MVPbkContactFieldTextData.h>
-#include <CVPbkContactManager.h>
-#include <MVPbkStoreContact.h>
-#include <CVPbkContactStoreUriArray.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <VPbkContactStoreUris.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStore.h>
-#include <MVPbkContactStoreProperties.h>
-#include <VPbkEng.rsg>
-#endif
-
-static const TInt KCalendarFieldLength = 128;
-
-
-CCreatorCalenderAttendee::CCreatorCalenderAttendee() 
-    {}
-
-CCreatorCalenderAttendee::~CCreatorCalenderAttendee()
-    {
-    delete iCommonName;
-    delete iEmailAddress;
-    }
-
-CCreatorCalenderAttendee* CCreatorCalenderAttendee::NewL()
-    {
-    CCreatorCalenderAttendee* self = new (ELeave) CCreatorCalenderAttendee;
-    return self;
-    }
-
-void CCreatorCalenderAttendee::SetCommonNameL(const TDesC& aName)
-    {
-    delete iCommonName;
-    iCommonName = 0;
-    iCommonName = HBufC::NewL(aName.Length());
-    iCommonName->Des().Copy(aName);
-    }
-
-void CCreatorCalenderAttendee::SetEmailAddressL(const TDesC& aEmail)
-    {
-    delete iEmailAddress;
-    iEmailAddress = 0;
-    iEmailAddress = HBufC::NewL(aEmail.Length());
-    iEmailAddress->Des().Copy(aEmail);
-    }
-
-void CCreatorCalenderAttendee::SetRole(CCalAttendee::TCalRole aRole)
-    {
-    iRole = aRole;
-    }
-
-void CCreatorCalenderAttendee::SetStatus(CCalAttendee::TCalStatus aStatus)
-    {
-    iStatus = aStatus;
-    }
-
-const TDesC& CCreatorCalenderAttendee::CommonName() const
-    {
-    if( iCommonName == 0 )
-    	return iDummy;
-    return *iCommonName;
-    }
-
-const TDesC& CCreatorCalenderAttendee::EmailAddress() const
-    {
-    if( iEmailAddress == 0 )
-    	return iDummy;
-    
-    return *iEmailAddress;
-    }
-
-CCalAttendee::TCalRole CCreatorCalenderAttendee::Role() const
-    {
-    return iRole;
-    }
-
-CCalAttendee::TCalStatus CCreatorCalenderAttendee::Status() const
-    {
-    return iStatus;
-    }
-
-TBool CCalenderInterimParameters::IsAllowedEntryStatus(CCalEntry::TType aType, CCalEntry::TStatus aStatus)
-    {
-    if( aType == CCalEntry::ETodo )
-        {
-        return  aStatus == CCalEntry::ECancelled ||
-                aStatus == CCalEntry::ETodoNeedsAction ||
-                aStatus == CCalEntry::ETodoCompleted ||
-                aStatus == CCalEntry::ETodoInProcess;
-        }
-    
-    return  aStatus == CCalEntry::ETentative ||
-            aStatus == CCalEntry::EConfirmed ||
-            aStatus == CCalEntry::ECancelled;
-    }
-
-//----------------------------------------------------------------------------
-
-CCalenderInterimParameters::CCalenderInterimParameters ( )
-    {
-    LOGSTRING("Creator: CCalenderInterimParameters::CCalenderInterimParameters");
-
-    iAppointmentLocation = HBufC::New (KCalendarFieldLength );
-    iAppointmentReason = HBufC::New (KCalendarFieldLength );
-    iEventReason = HBufC::New (KCalendarFieldLength );
-    iAnniversaryReason = HBufC::New (KCalendarFieldLength );
-    iTodoTask = HBufC::New (KCalendarFieldLength );
-    iReminderReason = HBufC::New (KCalendarFieldLength );
-    iDescription = HBufC::New (KCalendarFieldLength );
-    iSummary = HBufC::New (KCalendarFieldLength );
-    iLocation = HBufC::New (KCalendarFieldLength );
-    iOrganizerName = HBufC::New (KCalendarFieldLength );
-    iOrganizerEmail = HBufC::New (KCalendarFieldLength );
-
-    // set defaults, start date today and end date = today + 1 month
-    iRandomModeStartTime.HomeTime ( );
-    iRandomModeEndTime = iRandomModeStartTime;
-    iRandomModeEndTime += TTimeIntervalMonths (1 );
-    iAlarmTime = Time::NullTTime();
-    iUseRandomAlarmTime = EFalse;
-    iStatus = CCalEntry::ENullStatus;
-    }
-
-CCalenderInterimParameters::~CCalenderInterimParameters ( )
-    {
-    LOGSTRING("Creator: CCalenderInterimParameters::~CCalenderInterimParameters");
-
-    delete iTodoTask;
-    delete iAnniversaryReason;
-    delete iEventReason;
-    delete iAppointmentReason;
-    delete iAppointmentLocation;
-    delete iReminderReason;
-    delete iDescription;
-    delete iSummary;
-    delete iLocation;
-    delete iOrganizerName;
-    delete iOrganizerEmail;
-    iAttendees.ResetAndDestroy();
-    iAttendees.Close();
-    iAttendeeLinkIds.Reset();
-    iAttendeeLinkIds.Close();
-    }
-
-void CCalenderInterimParameters::ParseL (CCommandParser* parser,
-        TParseParams aCase )
-    {
-    LOGSTRING("Creator: CCalenderInterimParameters::ParseL");
-
-    HBufC* tempBuf= NULL;
-
-    switch (aCase )
-        {
-
-        case MCreatorModuleBaseParameters::ECalendarTodo:
-            {
-
-            parser->StrParserL (tempBuf, '|' );
-
-            CleanupStack::PushL (tempBuf );
-
-            this->iTodoDueTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (this->iTodoTask, '|' );
-
-            parser->StrParserL (tempBuf, ';' );
-            this->iTodoPriority = 2;
-            if (tempBuf->Compare (_L("LOW") ) == 0 )
-                this->iTodoPriority = 3;
-            else
-                if (tempBuf->Compare (_L("HIGH") ) == 0 )
-                    this->iTodoPriority = 1;
-
-            CleanupStack::PopAndDestroy (tempBuf );
-
-            }
-
-        case MCreatorModuleBaseParameters::ECalendarMemo:
-            {
-
-            parser->StrParserL (tempBuf, '|' );
-
-            this->iStartTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (tempBuf, '|' );
-            this->iEndTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (this->iDescription, ';' );
-
-            CleanupStack::PopAndDestroy (tempBuf );
-            }
-
-        case MCreatorModuleBaseParameters::ECalendarMeeting:
-            {
-
-            parser->StrParserL (tempBuf, '|' );
-
-            CleanupStack::PushL (tempBuf );
-
-            this->iStartTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (tempBuf, '|' );
-            this->iEndTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (this->iLocation, '|' );
-            parser->StrParserL (this->iDescription, ';' );
-
-            CleanupStack::PopAndDestroy (tempBuf );
-            }
-
-        case MCreatorModuleBaseParameters::ECalendarAnniv:
-            {
-
-            parser->StrParserL (tempBuf, '|' );
-
-            CleanupStack::PushL (tempBuf );
-
-            this->iStartTime = TTime (tempBuf->Des ( ) );
-
-            parser->StrParserL (this->iDescription, ';' );
-
-            CleanupStack::PopAndDestroy (tempBuf );
-
-            }
-        default:
-            {
-            //implement 
-            }
-        }
-    }
-//----------------------------------------------------------------------------
-
-CCreatorInterimCalendar* CCreatorInterimCalendar::NewL (CCreatorEngine* aEngine )
-    {
-    CCreatorInterimCalendar* self = CCreatorInterimCalendar::NewLC (aEngine );
-    CleanupStack::Pop (self );
-    return self;
-    }
-
-CCreatorInterimCalendar* CCreatorInterimCalendar::NewLC (CCreatorEngine* aEngine )
-    {
-    CCreatorInterimCalendar* self = new (ELeave) CCreatorInterimCalendar;
-    CleanupStack::PushL (self );
-    self->ConstructL (aEngine );
-    return self;
-    }
-
-CCreatorInterimCalendar::CCreatorInterimCalendar ( )
-    {
-    }
-
-void CCreatorInterimCalendar::ConstructL (CCreatorEngine* aEngine )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::ConstructL");
-
-    iEngine = aEngine;
-
-    // set defaults, start date today and end date = today + 1 month
-    iRandomModeStartTime.HomeTime ( );
-    iRandomModeEndTime = iRandomModeStartTime;
-    iRandomModeEndTime += TTimeIntervalMonths (1 );
-
-    iCalSession = CCalSession::NewL ( );
-    // Create and open a calendar file
-    const TDesC& fileName = iCalSession->DefaultFileNameL ( );//default filename is: "C:Calendar"
-    TRAPD(err, iCalSession->CreateCalFileL(fileName))
-    ;
-    // ignore KErrAlreadyExists leave code
-    if (err != KErrAlreadyExists )
-        {
-        User::LeaveIfError (err );
-        }
-    // Open the calendar file
-    iCalSession->OpenL (fileName );
-    iCalEntryView = CCalEntryView::NewL (*iCalSession, *this );
-    iNumberRepeatingEntries = 0;
-    iNumberOfAttendees = 0; //iEngine->RandomNumber(2, 15);
-    iSetAlarm = EFalse;
-    iWaiter = CAsyncWaiter::NewL();
-    }
-
-CCreatorInterimCalendar::~CCreatorInterimCalendar ( )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::~CCreatorInterimCalendar");
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidCalendar ) );
-        }
-        
-    iEntryIds.Reset();
-    iEntryIds.Close();
-        
-    if (iParameters )
-        {
-        delete iParameters;
-        }
-
-    if (iCalEntryView )
-        {
-        delete iCalEntryView;
-        }
-
-    if (iCalSession )
-        {
-        delete iCalSession;
-        }
-    delete iSoundFileArray;
-    delete iWaiter;
-    delete iTmpCN;
-    delete iTmpEmail;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    delete iExistingContacts;
-    delete iTempContact;
-    delete iContactManager;
-#endif
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorInterimCalendar::AskDataFromUserL (TInt aCommand,
-        TInt& aNumberOfEntries )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::AskDataFromUserL");
-
-    if( aCommand == ECmdDeleteCalendarEntries )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all calendar entries?") );
-        }
-    if( aCommand == ECmdDeleteCreatorCalendarEntries )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all calendar entries created with Creator?") ); 
-        }
-
-    // display queries
-    if (iEngine->EntriesQueryDialogL (aNumberOfEntries, _L("How many entries to create?") ) ) // ask number of entries to create
-        {
-        if( aCommand == ECmdCreateCalendarEntryEvents ||
-            aCommand == ECmdCreateCalendarEntryAppointments)
-            {
-            _LIT(KRepeatingNum, "How many repeating (weekly) entries");
-            if( !iEngine->EntriesQueryDialogL(iNumberRepeatingEntries, KRepeatingNum, ETrue))
-                {
-                return EFalse;
-                }
-            _LIT(KAttendeesNum, "How many attendees to create");
-            if( !iEngine->EntriesQueryDialogL(iNumberOfAttendees, KAttendeesNum, ETrue))
-                {
-                return EFalse;
-                }
-            }
-        if (iEngine->TimeQueryDialogL (iRandomModeStartTime, R_START_DATE_QUERY ) ) // ask start date
-            {
-            if (iEngine->TimeQueryDialogL (iRandomModeEndTime, R_END_DATE_QUERY ) ) // ask end date
-                {
-                if (iRandomModeStartTime > iRandomModeEndTime ) // check end date is ok
-                    {
-                    CAknInformationNote* note = new (ELeave) CAknInformationNote;
-                    note->ExecuteLD (_L("End date must be after start date") );
-
-                    return EFalse;
-                    }
-                else 
-                    {
-                    if( iEngine->YesNoQueryDialogL(_L("Add default alarm?")))
-                        {
-                        iSetAlarm = ETrue;
-                        }                   
-                    }                    
-                    return ETrue;
-                }
-            else
-                return EFalse;
-            }
-        else
-            return EFalse;
-        }
-    else
-        return EFalse;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorInterimCalendar::CreateAppointmentEntryL (
-        CCreatorModuleBaseParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL");
-        
-    delete iParameters;
-    iParameters = 0;
-    
-    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;   
-    
-    if( !parameters )
-        {
-        iParameters = new(ELeave) CCalenderInterimParameters;
-        parameters = iParameters;  
-        parameters->iRandomModeStartTime = iRandomModeStartTime;
-        parameters->iRandomModeEndTime = iRandomModeEndTime;    
-    
-        // difference between start and end times
-        TTimeIntervalMinutes differenceInMinutes;
-        parameters->iRandomModeEndTime.MinutesFrom (
-                parameters->iRandomModeStartTime, differenceInMinutes );
-
-        // start time (= something between the period start and end date)        
-        parameters->iStartTime = parameters->iRandomModeStartTime;
-        parameters->iStartTime
-                += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) );   
-        // set end time (= start time + some random time)    
-        parameters->iEndTime = parameters->iStartTime;    
-        parameters->iEndTime
-                += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) );
-        
-
-        // strings        
-        parameters->iLocation->Des ( )
-                = iEngine->RandomString (CCreatorEngine::EMeetingPlace );
-        parameters->iDescription->Des ( )
-                = iEngine->RandomString (CCreatorEngine::EMeetingReason );
-        
-        parameters->iSummary->Des()
-                        = parameters->iDescription->Des();
-        
-        parameters->iNumberRepeatingEntries = iNumberRepeatingEntries;
-        parameters->iNumberOfAttendees = iNumberOfAttendees;
-        }
-
-    TInt err = KErrNone;
-    HBufC8* guid = HBufC8::NewLC (255 );
-    TPtr8 uidP=guid->Des ( );
-    GenerateRandomId (uidP );
-    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAppt, guid,
-            CCalEntry::EMethodAdd, 0 );
-    CleanupStack::PushL (entry );
-
-    //Using same text as description and summary	
-    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
-    entry->SetSummaryL (parameters->iSummary->Des ( ) );
-    entry->SetLocationL (parameters->iLocation->Des ( ) );
-
-    TCalTime startTime;
-    TCalTime endTime;
-    // Set the start and end times using time values local to the current system time zone
-    TInt month = (TInt) parameters->iStartTime.DateTime().Month();
-    TInt date = parameters->iStartTime.DateTime().Day();
-    startTime.SetTimeLocalL (parameters->iStartTime );
-    endTime.SetTimeLocalL (parameters->iEndTime );
-    entry->SetStartAndEndTimeL (startTime, endTime );       
-    
-    if( parameters->IsAllowedEntryStatus(CCalEntry::EAppt, parameters->iStatus))
-        {
-        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL setting entry status: %d", parameters->iStatus);
-        entry->SetStatusL(parameters->iStatus);
-        }
-    
-    // Repeating times:
-    AddRepeatingRuleL(startTime, *entry, parameters);
-    SetOrganizerL(*entry, parameters);
-    
-    // Alarm:    
-    if( iSetAlarm || parameters->iUseRandomAlarmTime )
-        {        
-        SetRandomAlarmL(*entry);
-        }
-    else
-        {
-        SetAlarmL(*entry, parameters);
-        }
-        
-    // Add attendees:
-    AddAttendeesL(*entry, parameters);
-    
-    RPointerArray<CCalEntry> array;
-    CleanupClosePushL (array );
-    array.AppendL (entry );
-    
-    TInt success(0);
-    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
-    iCalEntryView->StoreL (array, success );
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( entry->LocalUidL() );
-    
-    //One item should be added at time
-    if (success != 1 )
-        {
-        err = 1;
-        }
-
-    CleanupStack::PopAndDestroy (&array );
-    CleanupStack::PopAndDestroy (entry );
-    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
-
-    return err;
-    }
-
-void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
-    {    
-    HBufC* orgName = 0;
-    HBufC* orgEmail = 0;
-    _LIT(KSpace, " ");
-    
-    //
-    // Common name
-    //
-    if( parameters == 0 || 
-        parameters->iOrganizerName == 0 || 
-        parameters->iOrganizerName->Length() == 0 )
-        {     
-        // Random:
-        TPtrC firstname  = iEngine->RandomString(CCreatorEngine::EFirstName);
-        TPtrC lastname = iEngine->RandomString(CCreatorEngine::ESurname);
-        orgName = HBufC::NewL(firstname.Length() + lastname.Length() + 1 );
-        CleanupStack::PushL(orgName);
-        orgName->Des().Copy(firstname);
-        orgName->Des().Append(KSpace);
-        orgName->Des().Append(lastname);        
-        }
-    else
-        {
-        orgName = HBufC::NewL(parameters->iOrganizerName->Length());
-        CleanupStack::PushL(orgName);
-        orgName->Des().Copy(parameters->iOrganizerName->Des());
-        }
-    
-    //
-    // Email
-    //
-    if( parameters == 0 ||
-        parameters->iOrganizerEmail == 0 || 
-        parameters->iOrganizerEmail->Length() == 0 )
-        {        
-        // Random:
-        TDesC* tmp = iEngine->CreateEmailAddressLC();
-        orgEmail = HBufC::NewL(tmp->Length());
-        orgEmail->Des().Copy(*tmp);
-        CleanupStack::PopAndDestroy(); // tmp
-        CleanupStack::PushL(orgEmail);
-        }
-    else
-        {
-        orgEmail = HBufC::NewL(parameters->iOrganizerEmail->Length());
-        CleanupStack::PushL(orgEmail);
-        orgEmail->Des().Copy(parameters->iOrganizerEmail->Des());
-        }
-    
-    SetOrganizerL(aCalEntry, orgName->Des(), orgEmail->Des(), orgEmail->Des());
-    CleanupStack::PopAndDestroy(); // orgName
-    CleanupStack::PopAndDestroy(); // orgEmail
-    }
-
-void CCreatorInterimCalendar::AddRepeatingRuleL(const TCalTime& aStartTime, CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
-    {
-    RArray<TDay> days;
-    CleanupClosePushL(days);
-    
-    // Recurrence rule. Weekly event.
-    if( parameters->iNumberRepeatingEntries > 0 )
-        {
-        TCalRRule calRepeat(TCalRRule::EWeekly);   
-        calRepeat.SetDtStart(aStartTime);
-        calRepeat.SetCount(parameters->iNumberRepeatingEntries);        
-        calRepeat.SetInterval(1);
-        //days.AppendL((TDay) iEngine->RandomNumber((TInt)EMonday, (TInt) ESunday));
-        TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek());
-        days.AppendL(tempDay);
-        calRepeat.SetByDay(days);        
-        aCalEntry.SetRRuleL(calRepeat);
-        }
-    else if(parameters->iRecurrentFrequency > TCalRRule::EInvalid)
-        {
-        TCalTime calTime;        
-        // Recurrent frequency
-        TCalRRule calRepeat(parameters->iRecurrentFrequency);
-        // Recurrent start        
-        calRepeat.SetDtStart(aStartTime);
-        if( parameters->iRecurrentFrequency == TCalRRule::EWeekly )
-        	{
-        	TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek());
-        	days.AppendL(tempDay);        
-        	calRepeat.SetByDay(days);  
-        	}
-        else if( parameters->iRecurrentFrequency == TCalRRule::EMonthly )
-        	{
-        	RArray< TInt > daysInMonth;
-        	CleanupClosePushL(daysInMonth);
-        	daysInMonth.AppendL(aStartTime.TimeLocalL().DayNoInMonth());
-        	calRepeat.SetByMonthDay(daysInMonth);
-        	CleanupStack::PopAndDestroy(&daysInMonth);
-        	}
-        else if( parameters->iRecurrentFrequency == TCalRRule::EYearly)
-        	{
-        	RArray< TMonth > monthsInYear;
-        	CleanupClosePushL(monthsInYear);
-        	monthsInYear.AppendL(aStartTime.TimeLocalL().DateTime().Month());
-        	calRepeat.SetByMonth(monthsInYear);
-        	CleanupStack::PopAndDestroy(&monthsInYear);
-        	}
-        
-        // Recurrent interval
-        if( parameters->iRecurrentInterval > 0 )
-        	calRepeat.SetInterval(parameters->iRecurrentInterval);
-                
-        // Recurrent end. End can be given as a number of repeating entries or as an end date.
-        // End date must be later than the start date, otherwise CCalEntry::SetRRuleL() panics.
-        if( parameters->iRepeatingCount > 0 )
-            {
-            calRepeat.SetCount(parameters->iRepeatingCount);
-            aCalEntry.SetRRuleL(calRepeat);            
-            }
-        else
-            {
-            TCalTime endTime;
-            endTime.SetTimeLocalL(parameters->iRecurrentEndTime);
-            if( endTime.TimeLocalL() > aStartTime.TimeLocalL())
-            	{
-            	calRepeat.SetUntil(endTime);
-            	aCalEntry.SetRRuleL(calRepeat);
-            	}
-            }           
-        }
-    CleanupStack::PopAndDestroy(&days);
-    }
-
-void CCreatorInterimCalendar::SetAlarmL(CCalEntry& aCalEntry, CCalenderInterimParameters* params)
-    {
-    if( params->iAlarmTime != Time::NullTTime() )
-        {
-        CCalAlarm* alarm = CCalAlarm::NewL();
-        CleanupStack::PushL(alarm);
-        //if( params->iAlarmTime <= params->iStartTime )
-        //	{
-        	TTimeIntervalMinutes diff;
-        	TInt err = params->iStartTime.MinutesFrom(params->iAlarmTime, diff);
-        	if( err == KErrNone)
-        		{
-        		alarm->SetTimeOffset(diff);
-        		TRAP(err, aCalEntry.SetAlarmL(alarm));
-        		if( err != KErrNone && err !=  KErrNotSupported )
-        			{
-        			User::Leave(err);
-        			}        		
-        		}
-        //	}
-        CleanupStack::PopAndDestroy(alarm);
-        }
-    }
-
-void CCreatorInterimCalendar::SetRandomAlarmL(CCalEntry& aCalEntry)
-    {
-    CCalAlarm* alarm = CCalAlarm::NewL();
-    CleanupStack::PushL(alarm);
-    alarm->SetTimeOffset(TTimeIntervalMinutes(iEngine->RandomNumber(0, 60)));
-    
-    TRAPD(err, aCalEntry.SetAlarmL(alarm));
-    if( err != KErrNone && err !=  KErrNotSupported )
-    	{
-    	User::Leave(err);
-    	}
-    CleanupStack::PopAndDestroy(alarm);
-    }
-
-void CCreatorInterimCalendar::SetPhoneOwnerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy )
-    {
-    CCalUser* phOwner = CCalUser::NewL(aEmail, aSentBy);
-    CleanupStack::PushL(phOwner);
-    TRAPD(err, aCalEntry.SetPhoneOwnerL(phOwner));            
-    CleanupStack::Pop(phOwner);
-    if( err == KErrNone )
-        {
-        phOwner->SetCommonNameL(aCN);
-        }
-    else
-        {
-        delete phOwner;
-        }
-    }
-
-void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy)
-    {
-    CCalUser* organizer = CCalUser::NewL(aEmail, aSentBy);
-    CleanupStack::PushL(organizer);
-    TRAPD(err, aCalEntry.SetOrganizerL(organizer));
-    CleanupStack::Pop(organizer);
-    if( err == KErrNone )
-        {
-        organizer->SetCommonNameL(aCN);
-        }
-    else
-        {
-        delete organizer;
-        }
-    }
-
-void CCreatorInterimCalendar::AddAttendeesL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters )
-    {
-    if( !parameters )
-        return;
-            
-    // Random attendees:
-    TInt numOfAttendees = parameters->iNumberOfAttendees;
-    for( TInt i = 0; i < numOfAttendees; ++i )
-        {
-        TPtrC firstname  = iEngine->RandomString(CCreatorEngine::EFirstName);
-        TPtrC lastname   = iEngine->RandomString(CCreatorEngine::ESurname);
-        TPtrC company    = iEngine->RandomString(CCreatorEngine::ECompany);
-        _LIT(KCountry, "com");        
-        TDesC* emailAddr = iEngine->CreateEmailAddressLC(firstname, lastname, company, KCountry);        
-        CCalAttendee* attendee = CCalAttendee::NewL(*emailAddr);        
-        CleanupStack::PushL(attendee);
-        aCalEntry.AddAttendeeL(attendee);
-        CleanupStack::Pop(attendee);
-        attendee->SetCommonNameL(firstname);
-                
-        // Set phone owner:
-        if( i == 1 )
-            {             
-            SetPhoneOwnerL(aCalEntry, firstname, *emailAddr, *emailAddr); 
-            attendee->SetRoleL(CCalAttendee::EReqParticipant); 
-            }
-        // Set organizer:
-        else if ( i == 0 )
-            {            
-            // Organizer is the chairman of the meeting:
-            SetOrganizerL(aCalEntry, firstname, *emailAddr, *emailAddr);
-            attendee->SetRoleL(CCalAttendee::EChair);
-            }
-        else if( i % 3 == 0 )
-            {
-            // every third attendee is optional:
-            attendee->SetRoleL(CCalAttendee::EOptParticipant);
-            }
-        else
-            {
-            // Others are required attendees:
-            attendee->SetRoleL(CCalAttendee::EReqParticipant);            
-            }
-        
-        TInt attStatus = iEngine->RandomNumber(0,5);
-        attendee->SetStatusL((CCalAttendee::TCalStatus) attStatus);
-        
-        CleanupStack::PopAndDestroy(emailAddr);
-        }
-    
-    // Explicit attendees:
-    for( TInt i = 0; i < parameters->iAttendees.Count(); ++i )
-        {
-        CCreatorCalenderAttendee* attendeeInfo = parameters->iAttendees[i];
-        if( attendeeInfo && attendeeInfo->EmailAddress().Length() > 0)
-        	{
-        	CCalAttendee* attendee = CCalAttendee::NewL(attendeeInfo->EmailAddress());
-        	CleanupStack::PushL(attendee);
-        	if( attendeeInfo->CommonName().Length() > 0 )
-        		attendee->SetCommonNameL(attendeeInfo->CommonName());
-        	attendee->SetRoleL(attendeeInfo->Role());
-        	attendee->SetStatusL(attendeeInfo->Status());
-        	attendee->SetResponseRequested(ETrue);
-        	aCalEntry.AddAttendeeL(attendee);
-        	CleanupStack::Pop(); // attendee
-        	}
-        }
-    
-    // Linked attendees:
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    
-    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-    uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
-    
-    if( iContactManager == 0 )
-        {
-        iContactManager = CVPbkContactManager::NewL( *uriArray, &CCoeEnv::Static()->FsSession());
-        }
-    CleanupStack::PopAndDestroy(uriArray);
-        
-    if( iContactManager )
-        {                
-        MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();              
-        storeList.OpenAllL(*this);
-        iWaiter->StartAndWait(); 
-        
-        // Sum number of existing contacts:
-        for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i )
-            {
-            TLinkIdParam id = parameters->iAttendeeLinkIds[i];
-            parameters->iNumberOfExistingAttendees += ContactLinkCache::Instance()->ContactSet(id.iLinkId).NumberOfExistingContacts();
-            }
-        
-        // Existing attendees:
-        if( parameters->iNumberOfExistingAttendees > 0 )
-            {
-            _LIT(dbUri, "cntdb://c:contacts.cdb");
-            TVPbkContactStoreUriPtr uri(dbUri);                   
-            MVPbkContactStore* store = storeList.Find(uri);
-            if( store )
-                {
-                const MVPbkFieldTypeList& fieldList = store->StoreProperties().SupportedFields();
-                
-                // get contacts, results will be set to iContactResults
-                MVPbkContactOperationBase* operation = iContactManager->FindL(_L(""), fieldList , *this);
-                if (operation)
-                    {
-                    CleanupDeletePushL( operation );
-                    iWaiter->StartAndWait();//Making asynchronous FindL to synchronous
-                    CleanupStack::Pop(operation);
-                    delete operation;
-                    }
-                if( iExistingContacts )
-                    {
-                    for( TInt i = 0; i < iExistingContacts->Count() && i < parameters->iNumberOfExistingAttendees; ++i )
-                        {
-                        MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( iExistingContacts->At(i), *this );
-        
-                        if (operation)
-                            {
-                            CleanupDeletePushL( operation );
-                            iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous
-                            CleanupStack::Pop(); // operation
-                            delete operation;
-                            operation = 0;
-                            HandleSingleContactResultL();
-                            CCalAttendee* attendee = 0;
-                            if( iTmpEmail && iTmpEmail->Length() > 0 )
-                                {
-                                attendee = CCalAttendee::NewL(*iTmpEmail);
-                                }
-                            else
-                                {
-                                _LIT(KDummy, "");
-                                attendee = CCalAttendee::NewL(KDummy);
-                                }
-                            CleanupStack::PushL(attendee);                            
-                            if( iTmpCN && iTmpCN->Length() > 0 )
-                                {
-                                attendee->SetCommonNameL(*iTmpCN);
-                                }
-                            attendee->SetRoleL(CCalAttendee::EReqParticipant);
-                            attendee->SetStatusL(CCalAttendee::EAccepted);
-                            attendee->SetResponseRequested(ETrue);
-                            aCalEntry.AddAttendeeL(attendee);
-                            CleanupStack::Pop(attendee);
-                            }   
-                        }
-                    }
-                } 
-            }
-        
-        for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i )
-            {
-            TLinkIdParam id = parameters->iAttendeeLinkIds[i];
-            RPointerArray<MVPbkContactLink>& links = ContactLinkCache::Instance()->ContactLinks(id.iLinkId);
-            for( TInt j = 0; j < links.Count() && (id.iLinkAmount < 0 || j < id.iLinkAmount); ++j )
-                {
-                MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( *(links[j]), *this );
-                if (operation)
-                    {
-                    CleanupDeletePushL( operation );
-                    iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous
-                    CleanupStack::Pop(operation);
-                    delete operation;
-                    operation = 0;
-                    HandleSingleContactResultL();
-                    CCalAttendee* attendee = 0;
-                    if( iTmpEmail && iTmpEmail->Length() > 0 )
-                        {
-                        attendee = CCalAttendee::NewL(*iTmpEmail);
-                        }
-                    else
-                        {
-                        _LIT(KDummy, "");
-                        attendee = CCalAttendee::NewL(KDummy);
-                        }      
-                    CleanupStack::PushL(attendee);                    
-                    if( iTmpCN && iTmpCN->Length() > 0 )
-                        {
-                        attendee->SetCommonNameL(*iTmpCN);
-                        }
-                    attendee->SetRoleL(CCalAttendee::EReqParticipant);
-                    attendee->SetStatusL(CCalAttendee::EAccepted);
-                    attendee->SetResponseRequested(ETrue);
-                    aCalEntry.AddAttendeeL(attendee);
-                    CleanupStack::Pop(attendee);
-                    }                    
-                }
-            }
-        
-        storeList.CloseAll(*this);        
-        }    
-#endif
-    }
-//----------------------------------------------------------------------------
-
-TInt CCreatorInterimCalendar::CreateEventEntryL (
-        CCreatorModuleBaseParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::CreateEventEntryL");
-
-    delete iParameters;
-    iParameters = 0;
-        
-    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;       
-    
-    // random data needed if no predefined data available
-    if (!parameters )
-        {
-        iParameters = new(ELeave) CCalenderInterimParameters;
-
-        iParameters->iRandomModeStartTime = iRandomModeStartTime;
-        iParameters->iRandomModeEndTime = iRandomModeEndTime;
-        iParameters->iNumberRepeatingEntries = iNumberRepeatingEntries;
-        iParameters->iNumberOfAttendees = iNumberOfAttendees;
-        
-        // difference between start and end times
-        TTimeIntervalMinutes differenceInMinutes;
-        iParameters->iRandomModeEndTime.MinutesFrom (
-                iParameters->iRandomModeStartTime, differenceInMinutes );
-
-        // start time (= something between the period start and end date)
-        iParameters->iStartTime = iParameters->iRandomModeStartTime;
-        iParameters->iStartTime
-                += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) );
-
-        // set end time (= start time + some random time)
-        iParameters->iEndTime = iParameters->iStartTime;
-        iParameters->iEndTime
-                += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) );        
-
-        // strings
-        iParameters->iDescription->Des()
-                = iEngine->RandomString (CCreatorEngine::EMemoText );
-        
-        iParameters->iSummary->Des() = iParameters->iDescription->Des();
-        
-        // Random event status:
-        iParameters->iStatus = 
-            (CCalEntry::TStatus) iEngine->RandomNumber(0, (TInt) CCalEntry::ECancelled);
-        
-        parameters = iParameters;
-        }
-
-    TInt err = KErrNone;
-    HBufC8* guid = HBufC8::NewLC (255 );
-    TPtr8 uidP=guid->Des ( );
-    GenerateRandomId (uidP );
-    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EEvent, guid,
-            CCalEntry::EMethodAdd, 0 );
-    CleanupStack::PushL (entry );
-    // iEntryUids->AppendL( *guid->Alloc() );
-    
-    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
-    entry->SetSummaryL (parameters->iSummary->Des ( ) );
-
-    TCalTime startTime;
-    TCalTime endTime;
-    // Set the start and end times using time values local to the current system time zone
-    startTime.SetTimeLocalL (parameters->iStartTime );
-    endTime.SetTimeLocalL (parameters->iEndTime );
-    entry->SetStartAndEndTimeL (startTime, endTime );
-
-    // Repeating times:
-    AddRepeatingRuleL(startTime, *entry, parameters);
-    
-    if( iSetAlarm || parameters->iUseRandomAlarmTime )
-        {        
-        SetRandomAlarmL(*entry);
-        }
-    else
-        {
-        SetAlarmL(*entry, parameters);
-        }
-    
-    // Add attendees:
-    AddAttendeesL(*entry, parameters);    
-    
-    if( parameters->IsAllowedEntryStatus(CCalEntry::EEvent, parameters->iStatus))
-        {
-        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateEventEntryL setting entry status: %d", parameters->iStatus);
-        entry->SetStatusL(parameters->iStatus);
-        }
-        
-    RPointerArray<CCalEntry> array;
-    CleanupClosePushL (array );
-    array.AppendL (entry );
-
-    TInt success(0);
-    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
-    iCalEntryView->StoreL (array, success );
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( entry->LocalUidL() );
-    
-    //One item should be added at time
-    if (success != 1 )
-        {
-        err = 1;
-        }
-
-    CleanupStack::PopAndDestroy (&array );
-    CleanupStack::PopAndDestroy (entry );
-    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
-    return err;
-
-    }
-
-//----------------------------------------------------------------------------
-
-
-TInt CCreatorInterimCalendar::CreateReminderEntryL (
-        CCreatorModuleBaseParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::CreateReminderEntryL");
-
-    delete iParameters;
-    iParameters = NULL;
-    
-    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
-
-    // random data needed if no predefined data available
-    if (!parameters )
-        {
-        iParameters = new(ELeave) CCalenderInterimParameters;
-
-        iParameters->iRandomModeStartTime = iRandomModeStartTime;
-        iParameters->iRandomModeEndTime = iRandomModeEndTime;
-
-        // difference between start and end times
-        TTimeIntervalDays
-                differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime );
-
-        // due time (= something between the period start and end date)
-        iParameters->iStartTime = iParameters->iRandomModeStartTime;
-        iParameters->iStartTime
-                += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) );
-
-        // strings
-        iParameters->iDescription->Des()
-                = iEngine->RandomString (CCreatorEngine::EReminderText );
-        
-        iParameters->iSummary->Des() = iParameters->iDescription->Des();
-
-        parameters = iParameters;
-        }
-
-    TInt err = KErrNone;
-
-    HBufC8* guid = HBufC8::NewLC (255 );
-    TPtr8 uidP=guid->Des ( );
-    GenerateRandomId (uidP );
-
-    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EReminder, guid,
-            CCalEntry::EMethodAdd, 0 );
-    CleanupStack::PushL (entry );
-
-    //Using same text as description and summary    
-    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
-    entry->SetSummaryL (parameters->iSummary->Des ( ) );
-
-    TCalTime startTime;
-    TCalTime endTime;
-    // Set the start and end times using time values local to the current system time zone
-    startTime.SetTimeLocalL (parameters->iStartTime );
-    TTime nullTime = Time::NullTTime ( );
-    endTime.SetTimeLocalL (nullTime );
-    entry->SetStartAndEndTimeL (startTime, endTime );
-        
-    if( parameters->IsAllowedEntryStatus(CCalEntry::EReminder, parameters->iStatus))
-        {
-        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateReminderEntryL setting entry status: %d", parameters->iStatus);
-        entry->SetStatusL(parameters->iStatus);
-        }
-    
-    if( iSetAlarm || parameters->iUseRandomAlarmTime )
-        {        
-        SetRandomAlarmL(*entry);
-        }
-    else
-        {
-        SetAlarmL(*entry, parameters);
-        }
-
-    RPointerArray<CCalEntry> array;
-    CleanupClosePushL (array );
-    array.AppendL (entry );
-
-    TInt success(0);
-    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
-    iCalEntryView->StoreL (array, success );
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( entry->LocalUidL() );
-    
-    //One item should be added at time
-    if (success != 1 )
-        {
-        err = 1;
-        }
-
-    CleanupStack::PopAndDestroy (&array );
-    CleanupStack::PopAndDestroy (entry );
-    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorInterimCalendar::CreateAnniversaryEntryL (
-        CCreatorModuleBaseParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::CreateAnniversaryEntryL");
-
-    delete iParameters;
-    iParameters = NULL;
-    
-    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
-
-    // random data needed if no predefined data available
-    if (!parameters )
-        {
-        iParameters = new(ELeave) CCalenderInterimParameters;
-
-        iParameters->iRandomModeStartTime = iRandomModeStartTime;
-        iParameters->iRandomModeEndTime = iRandomModeEndTime;
-
-        // difference between start and end times
-        TTimeIntervalDays differenceInDays = iParameters->iRandomModeEndTime.DaysFrom(iParameters->iRandomModeStartTime);  
-
-        // start time (= something between the period start and end date)
-        iParameters->iStartTime = iParameters->iRandomModeStartTime;
-        iParameters->iStartTime += TTimeIntervalDays( iEngine->RandomNumber(differenceInDays.Int()) );        
-        
-        // strings
-        iParameters->iDescription->Des().Copy (iEngine->RandomString (CCreatorEngine::EFirstName ) );
-        iParameters->iDescription->Des().Append ( _L("'s ") );
-        iParameters->iDescription->Des().Append (iEngine->RandomString (CCreatorEngine::EAnniversaryReason ) );
-        iParameters->iSummary->Des() = iParameters->iDescription->Des();
-        parameters = iParameters;
-        }
- 
-    TInt err = KErrNone;
-
-    HBufC8* guid = HBufC8::NewLC (255 );
-    TPtr8 uidP=guid->Des ( );
-    GenerateRandomId (uidP );
-
-    CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAnniv, guid,
-            CCalEntry::EMethodNone, 0 );
-    CleanupStack::PushL (entry );
-
-    //Using same text as description and summary	
-    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
-    entry->SetSummaryL (parameters->iSummary->Des ( ) );
-
-    TCalTime startTime;
-    TCalTime endTime;
-    TTime nullTime = Time::NullTTime ( );
-    endTime.SetTimeLocalL (nullTime );
-    
-    // Set the start time using time value local to the current system time zone
-    startTime.SetTimeLocalL (parameters->iStartTime );
-
-    entry->SetStartAndEndTimeL (startTime, endTime );
-
-    if( iSetAlarm || parameters->iUseRandomAlarmTime )
-        {        
-        SetRandomAlarmL(*entry);
-        }
-    else
-        {
-        SetAlarmL(*entry, parameters);
-        }
-    
-    //set repeating rule
-    TCalRRule yearlyRptRule(TCalRRule::EYearly);
-    yearlyRptRule.SetDtStart (startTime );
-    //Set repeating until forever, not setting it to stop
-    //yearlyRptRule.SetUntil(endTime);
-    entry->SetRRuleL (yearlyRptRule );
-
-    RPointerArray<CCalEntry> array;
-    CleanupClosePushL (array );
-    array.AppendL (entry );
-
-    TInt success(0);
-    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
-    iCalEntryView->StoreL (array, success );
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( entry->LocalUidL() );
-    
-    //One item should be added at time
-    if (success != 1 )
-        {
-        err = 1;
-        }
-
-    CleanupStack::PopAndDestroy (&array );
-    CleanupStack::PopAndDestroy (entry );
-    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorInterimCalendar::CreateTodoEntryL (
-        CCreatorModuleBaseParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::CreateTodoEntryL");
-
-    delete iParameters;
-    iParameters = NULL;
-    
-    CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters;
-
-    // random data needed if no predefined data available
-    if (!parameters )
-        {
-        iParameters = new(ELeave) CCalenderInterimParameters;
-
-        iParameters->iRandomModeStartTime = iRandomModeStartTime;
-        iParameters->iRandomModeEndTime = iRandomModeEndTime;
-
-        // difference between start and end times
-        TTimeIntervalDays
-                differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime );
-
-        // due time (= something between the period start and end date)
-        iParameters->iTodoDueTime = iParameters->iRandomModeStartTime;
-        iParameters->iTodoDueTime
-                += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) );
-
-        // strings
-        iParameters->iDescription->Des ( )
-                = iEngine->RandomString (CCreatorEngine::EToDoText );
-        
-        iParameters->iSummary->Des() = iParameters->iDescription->Des();
-
-        //priority
-        iParameters->iTodoPriority = iEngine->RandomNumber (1, 3 );
-        iParameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber((TInt) CCalEntry::ETodoNeedsAction, (TInt) CCalEntry::ETodoInProcess);
-        parameters = iParameters;
-        
-        }
-
-    TInt err = KErrNone;
-
-    HBufC8* guid = HBufC8::NewLC (255 );
-    TPtr8 uidP=guid->Des ( );
-    GenerateRandomId (uidP );
-
-    CCalEntry* entry = CCalEntry::NewL (CCalEntry::ETodo, guid,
-            CCalEntry::EMethodAdd, 0 );
-    CleanupStack::PushL (entry );
-
-    //Using same text as description and summary	
-    entry->SetDescriptionL (parameters->iDescription->Des ( ) );
-    entry->SetSummaryL (parameters->iSummary->Des ( ) );
-
-    entry->SetPriorityL (parameters->iTodoPriority );
-    
-    if( parameters->IsAllowedEntryStatus(CCalEntry::ETodo, parameters->iStatus))
-        {
-        LOGSTRING2("Creator: CCreatorInterimCalendar::CreateTodoEntryL setting entry status: %d", parameters->iStatus);
-        entry->SetStatusL(parameters->iStatus);
-        }
-
-    TCalTime startTime;
-    TCalTime endTime;
-    // Set the start and end times using time values local to the current system time zone
-    startTime.SetTimeLocalL (parameters->iTodoDueTime );
-    endTime.SetTimeLocalL (parameters->iTodoDueTime );
-    entry->SetStartAndEndTimeL (startTime, endTime );
-
-    if( iSetAlarm || parameters->iUseRandomAlarmTime )
-        {        
-        SetRandomAlarmL(*entry);
-        }
-    else
-        {
-        SetAlarmL(*entry, parameters);
-        }
-    
-    RPointerArray<CCalEntry> array;
-    CleanupClosePushL (array );
-    array.AppendL (entry );
-
-    TInt success(0);
-    //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed
-    iCalEntryView->StoreL (array, success );
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( entry->LocalUidL() );
-    
-    //One item should be added at time
-    if (success != 1 )
-        {
-        err = 1;
-        }
-
-    CleanupStack::PopAndDestroy (&array );
-    CleanupStack::PopAndDestroy (entry );
-    CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorInterimCalendar::Progress (TInt /*aPercentageCompleted*/)
-    {
-    //Not really needed but observer need to be implement
-    }
-
-void CCreatorInterimCalendar::Completed (TInt aError )
-    {
-    //Not really needed but observer need to be implement
-    LOGSTRING2("Creator: CCreatorInterimCalendar::Completed err=%d", aError);
-    }
-
-TBool CCreatorInterimCalendar::NotifyProgress ( )
-    {
-    //Not really needed but observer need to be implement
-    return NULL;
-    }
-
-//----------------------------------------------------------------------------
-
-
-void CCreatorInterimCalendar::GenerateRandomId (TDes8& aText )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::GenerateRandomId");
-
-    aText.Zero ( );
-
-    TTime now;
-    now.UniversalTime ( );
-    TInt64 time = now.Int64 ( );
-
-    // The number of characters in the guid should be
-    // more than 8 (to ensure the guids are not too small)
-    // less than 255 (this is the maximum length of a guid)
-    // less than MaxLength of the descriptor passed in		
-    TInt numChar(0);
-    do
-        {
-        numChar = Math::Rand (time ) % (aText.MaxLength ( ) - 1);
-        }
-    while (numChar > 255|| numChar < 8 );
-
-    for (TInt i(0); i < numChar ; ++i )
-        {
-        TInt character = Math::Rand (time )%6;
-        character = Math::Rand (time ) % 26+ ((character == 2) ? 'A' : 'a');
-        aText.Append (character );
-        }
-
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorInterimCalendar::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllL");
-    TCalTime zeroTime;
-    zeroTime.SetTimeUtcL( TCalTime::MinTime() );
-    RArray<TUint32> allIds;
-    CleanupClosePushL( allIds );
-    iCalEntryView->GetIdsModifiedSinceDateL( zeroTime, allIds );
-    if ( allIds.Count() )
-        {
-        TInt successCount( KErrNotFound );
-        iCalEntryView->DeleteL( allIds, successCount );
-        if ( successCount != allIds.Count() )
-            {
-            User::Leave( KErrGeneral );
-            }        
-        }
-    CleanupStack::PopAndDestroy( &allIds );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Calendar related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidCalendar );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorInterimCalendar::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidCalendar );
-    
-    // delete entries
-    TInt successCount(0); // ignore
-    TRAP_IGNORE( iCalEntryView->DeleteL( iEntryIds, successCount ) );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Calendar related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidCalendar );
-    }
-
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-void CCreatorInterimCalendar::VPbkSingleContactOperationComplete(
-            MVPbkContactOperationBase& /*aOperation*/,
-            MVPbkStoreContact* aContact )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::VPbkSingleContactOperationComplete" );
-    iWaiter->Cancel();
-    delete iTempContact;
-    iTempContact = aContact;
-    }
-void CCreatorInterimCalendar::HandleSingleContactResultL()
-	{
-    if( iTempContact )
-        {
-        TPtrC firstName;
-        TPtrC lastName;
-        TPtrC email;
-    
-        // Put contact's name to temporary member:
-        delete iTmpCN;
-        iTmpCN = 0;
-        delete iTmpEmail;
-        iTmpEmail = 0;
-    
-        MVPbkStoreContactFieldCollection& fields = iTempContact->Fields();
-        TInt fieldCount = fields.FieldCount();
-        for (TInt i = 0; i < fieldCount; ++i)
-            {
-            MVPbkStoreContactField& field = fields.FieldAt(i);
-            MVPbkContactFieldData& fieldData = field.FieldData();
-            const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
-            
-            if( fieldType ) 
-                {
-                TInt fieldId( fieldType->FieldTypeResId() );
-            
-                TVPbkFieldStorageType dataType = fieldData.DataType();
-                if( dataType == EVPbkFieldStorageTypeText)
-                    {
-                    MVPbkContactFieldTextData& textData = MVPbkContactFieldTextData::Cast(fieldData);                
-                    if( fieldId == R_VPBK_FIELD_TYPE_FIRSTNAME )
-                        {                    
-                        firstName.Set(textData.Text());
-                        }
-                    else if( fieldId == R_VPBK_FIELD_TYPE_LASTNAME )
-                        {
-                        lastName.Set(textData.Text());                          
-                        }
-                    else if( fieldId == R_VPBK_FIELD_TYPE_EMAILGEN ||
-                            fieldId == R_VPBK_FIELD_TYPE_EMAILHOME ||
-                            fieldId == R_VPBK_FIELD_TYPE_EMAILWORK )
-                        {
-                        email.Set(textData.Text());                        
-                        }
-                    }            
-                }
-            }
-        if( firstName.Length() > 0 && lastName.Length() > 0 )
-            {
-            _LIT(KSpace, " ");
-            TRAPD(err, iTmpCN = HBufC::NewL(firstName.Length() + lastName.Length() + 1 ));
-            if( err == KErrNone )
-            	{
-            	iTmpCN->Des().Copy(firstName);
-            	iTmpCN->Des().Append(KSpace);
-            	iTmpCN->Des().Append(lastName);
-            	}
-            }
-        else if( firstName.Length() > 0 )
-            {
-            TRAPD(err, iTmpCN = HBufC::NewL(firstName.Length()));
-            if( err == KErrNone )
-            	{
-            	iTmpCN->Des().Copy(firstName);
-            	}
-            }
-        else if( lastName.Length() > 0 )
-            {
-            TRAPD(err, iTmpCN = HBufC::NewL(lastName.Length()));
-            if( err == KErrNone )
-            	{
-            	iTmpCN->Des().Copy(lastName);
-            	}
-            }
-        
-        if( email.Length() > 0 )
-            {
-            TRAPD(err, iTmpEmail = HBufC::NewL(email.Length()));
-            if( err == KErrNone )
-            	{
-            	iTmpEmail->Des().Copy(email);
-            	}
-            }
-        delete iTempContact;
-        iTempContact = 0;
-        }
-    }
-    
-void CCreatorInterimCalendar::VPbkSingleContactOperationFailed(
-            MVPbkContactOperationBase& /*aOperation*/, 
-            TInt aError )
-    {
-    LOGSTRING2("Creator: CCreatorInterimCalendar::VPbkSingleContactOperationFailed - Error: %d", aError );
-    iWaiter->Cancel();
-    delete iTempContact;
-    iTempContact = 0;
-    }
-
-
-
-void CCreatorInterimCalendar::OpenComplete()
-    {    
-    LOGSTRING("Creator: CreatorInterimCalendar::OpenComplete()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorInterimCalendar::StoreReady(MVPbkContactStore& /*aContactStore*/)
-    {
-    LOGSTRING("Creator: CreatorInterimCalendar::StoreReady()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorInterimCalendar::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, 
-        TInt /*aReason*/)
-    {
-    LOGSTRING("Creator: CreatorInterimCalendar::StoreUnavailable()");
-    iWaiter->Cancel();
-    }
-
-
-void CCreatorInterimCalendar::HandleStoreEventL(
-        MVPbkContactStore& /*aContactStore*/, 
-        TVPbkContactStoreEvent /*aStoreEvent*/)
-    {
-    LOGSTRING("Creator: CreatorInterimCalendar::HandleStoreEventL()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorInterimCalendar::FindCompleteL( MVPbkContactLinkArray* aResults )
-    {
-    LOGSTRING("Creator: CreatorInterimCalendar::FindCompleteL()");
-    iWaiter->Cancel();
-    iExistingContacts = aResults;
-    }
-
-void CCreatorInterimCalendar::FindFailed( TInt aError )
-    {
-    LOGSTRING2("Creator: CreatorInterimCalendar::FindFailed() - Error: %d", aError);    
-    iWaiter->Cancel();
-    delete iExistingContacts;
-    iExistingContacts = 0;
-    }
-#endif
-//----------------------------------------------------------------------------
-
--- a/creator/src/creator_calendarelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,594 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_calendarelement.h"
-#include "creator_traces.h"
-#include "creator_calendar.h"
-
-using namespace creatorcalendar;
-
-CCreatorCalendarElement* CCreatorCalendarElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorCalendarElement* self = new (ELeave) CCreatorCalendarElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CCreatorCalendarElement::FillEntryParamsL(TEntryType aType, const RPointerArray<CCreatorScriptElement>& fields, CCalenderInterimParameters* parameters)
-    {
-    if( parameters == 0 )
-        return;
-    
-    TBool startResolved = EFalse;    
-    TBool endResolved = EFalse;
-    
-    for( TInt i = 0; i < fields.Count(); ++i )
-        {
-        TPtrC elemName = fields[i]->Name();
-        TPtrC elemContent = fields[i]->Content();
-        const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-        
-        if( elemName == KSummary || elemName == KDescription )
-            {           
-            if( randomAttr || elemContent.Length() == 0 )
-                {      
-                TPtrC reason;
-                if( aType == EAppointment )
-                    {
-                    reason.Set(iEngine->RandomString (CCreatorEngine::EMeetingReason ));                    
-                    }
-                else if( aType == EEvent )
-                    {
-                    reason.Set(iEngine->RandomString(CCreatorEngine::EMemoText));                    
-                    }
-                else if( aType == EReminder )
-                    {
-                    reason.Set(iEngine->RandomString(CCreatorEngine::EReminderText));                    
-                    }
-                else if( aType == EAnniversary )
-                    {                   
-                    reason.Set(iEngine->RandomString(CCreatorEngine::EAnniversaryReason));                    
-                    }
-                else if( aType == ETodo )
-                    {
-                    reason.Set(iEngine->RandomString(CCreatorEngine::EToDoText));                    
-                    }
-                
-                if( elemName == KDescription )
-                    {
-                    delete parameters->iDescription;
-                    parameters->iDescription = 0;
-                    parameters->iDescription = HBufC::NewL(reason.Length());
-                    parameters->iDescription->Des().Copy(reason);
-                    }
-                else if(elemName == KSummary)
-                    {
-                    delete parameters->iSummary;
-                    parameters->iSummary = 0;
-                    parameters->iSummary = HBufC::NewL(reason.Length());
-                    parameters->iSummary->Des().Copy(reason);
-                    }
-                }
-            else if( elemName == KDescription )                
-                {                
-                delete parameters->iDescription;
-                parameters->iDescription = 0;
-                parameters->iDescription = HBufC::NewL(elemContent.Length());
-                parameters->iDescription->Des().Copy(elemContent);
-                }
-            else if( elemName == KSummary)
-                {
-                delete parameters->iSummary;
-                parameters->iSummary = 0;
-                parameters->iSummary = HBufC::NewL(elemContent.Length());
-                parameters->iSummary->Des().Copy(elemContent);
-                }
-            }
-        else if( elemName == KLocation )
-            {
-            delete parameters->iLocation;
-            parameters->iLocation = 0;
-            
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                TPtrC reason = iEngine->RandomString (CCreatorEngine::EMeetingPlace );
-                parameters->iLocation = HBufC::NewL(reason.Length());
-                parameters->iLocation->Des().Copy(reason);
-                }
-            else
-                {
-                parameters->iLocation = HBufC::NewL(elemContent.Length());
-                parameters->iLocation->Des().Copy(elemContent);
-                }
-            }
-        else if( elemName == KStarttime )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {                
-                // Random start time used. If end time is already resolved, let's use that one for the basis. 
-                if( endResolved )
-                    {                    
-                    parameters->iStartTime = iEngine->RandomTime(parameters->iEndTime, CCreatorEngine::EDatePast);                    
-                    }
-                else
-                    {
-                    // Past or future:
-                    CCreatorEngine::TRandomDateType pastOrfuture = 
-                    (CCreatorEngine::TRandomDateType) iEngine->RandomNumber((TInt) CCreatorEngine::EDatePast,
-                                                                            (TInt) CCreatorEngine::EDateFuture);
-                    
-                    parameters->iStartTime = 
-                        iEngine->RandomTime(iEngine->RandomDate(pastOrfuture), pastOrfuture);  
-                    }
-                }
-            else
-                {
-                parameters->iStartTime = ConvertToDateTimeL(elemContent);                
-                }            
-            startResolved = ETrue;
-            }
-        else if( elemName == KEndtime )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                // Random end time used. If start time is already resolved, let's use that one.                
-                if( startResolved )
-                    {                    
-                    parameters->iEndTime = iEngine->RandomTime(parameters->iStartTime, CCreatorEngine::EDateFuture);                    
-                    }
-                else
-                    {
-                    // Past or future:
-                    CCreatorEngine::TRandomDateType pastOrfuture = 
-                    (CCreatorEngine::TRandomDateType) iEngine->RandomNumber((TInt) CCreatorEngine::EDatePast,
-                            (TInt) CCreatorEngine::EDateFuture);
-                    
-                    parameters->iEndTime = 
-                    iEngine->RandomTime(iEngine->RandomDate(pastOrfuture), pastOrfuture);  
-                    }                          
-                }
-            else
-                {
-                parameters->iEndTime = ConvertToDateTimeL(elemContent);
-                }
-            if( aType == ETodo )
-                {
-                parameters->iTodoDueTime = parameters->iEndTime;
-                }
-            }
-        else if( elemName == KRecurrentFreq )
-            {
-            TInt randomFreq = 0;
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                randomFreq = iEngine->RandomNumber(1, 4);
-                }
-            if(randomFreq == 1 || CompareIgnoreCase(elemContent, KDaily) == 0 )
-                parameters->iRecurrentFrequency = TCalRRule::EDaily;
-            else if( randomFreq == 2 || CompareIgnoreCase(elemContent, KWeekly) == 0 )
-                parameters->iRecurrentFrequency = TCalRRule::EWeekly;
-            else if( randomFreq == 3 || CompareIgnoreCase(elemContent, KMonthly) == 0 )
-                parameters->iRecurrentFrequency = TCalRRule::EMonthly;
-            else if( randomFreq == 4 || CompareIgnoreCase(elemContent, KYearly) == 0 )
-                parameters->iRecurrentFrequency = TCalRRule::EYearly;
-            else
-                parameters->iRecurrentFrequency = TCalRRule::EInvalid;            
-            }
-        else if( elemName == KRecurrentInterval )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                parameters->iRecurrentInterval = iEngine->RandomNumber(1,7);
-                }
-            else
-                {
-                parameters->iRecurrentInterval = ConvertStrToIntL(elemContent);
-                }
-            }
-        else if( elemName == KRecurrentFrom )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                if( startResolved )
-                    {
-                    // Let's use the start time if it's resolved.
-                    parameters->iRecurrentStartTime = parameters->iStartTime;
-                    }
-                else
-                    {
-                    parameters->iRecurrentStartTime = iEngine->RandomDate(CCreatorEngine::EDateFuture);
-                    }
-                }
-            else
-                {
-                parameters->iRecurrentStartTime = ConvertToDateTimeL(elemContent);
-                }           
-            }
-        else if( elemName == KRecurrentTo )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                parameters->iRepeatingCount = iEngine->RandomNumber(1, 6);
-                //parameters->iRecurrentEndTime = iEngine->RandomDate(CCreatorEngine::EDateFuture);                
-                }
-            else
-                {
-                parameters->iRecurrentEndTime = ConvertToDateTimeL(elemContent);
-                }           
-            }
-        else if( elemName == KRepeatingCount )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                parameters->iRepeatingCount = iEngine->RandomNumber(1, 52);
-                }
-            else
-                {
-                parameters->iRepeatingCount = ConvertStrToIntL(elemContent);
-                }
-            }
-        else if( elemName == KAlarmtime )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {                
-                parameters->iUseRandomAlarmTime = ETrue;
-                }
-            else
-                {
-                parameters->iAlarmTime = ConvertToDateTimeL(elemContent);
-                }
-            }
-        else if( elemName == KOrganizername )
-            {
-            delete parameters->iOrganizerName;
-            parameters->iOrganizerName = 0;
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                TPtrC name = iEngine->RandomString (CCreatorEngine::EFirstName );
-                parameters->iOrganizerName = HBufC::NewL(name.Length());
-                parameters->iOrganizerName->Des().Copy(name);
-                }
-            else
-                {            
-                parameters->iOrganizerName = HBufC::NewL(elemContent.Length());
-                parameters->iOrganizerName->Des().Copy(elemContent);
-                }
-            }
-        else if( elemName == KOrganizeremail )
-            {
-            delete parameters->iOrganizerEmail;
-            parameters->iOrganizerEmail = 0;
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                TDesC* email = iEngine->CreateEmailAddressLC();
-                parameters->iOrganizerEmail = (HBufC*) email;
-                CleanupStack::Pop(); // email
-                }
-            else
-                {
-                parameters->iOrganizerEmail = HBufC::NewL(elemContent.Length());
-                parameters->iOrganizerEmail->Des().Copy(elemContent);
-                }
-            }
-        else if( elemName == KStatus )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                if( aType == ETodo )
-                	{
-                	parameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber(CCalEntry::ETodoNeedsAction, CCalEntry::ETodoInProcess);
-                	}
-                else
-                	{
-                	parameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber(CCalEntry::ETentative, CCalEntry::ECancelled);
-                	}
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusTentative) == 0 )
-                {
-                parameters->iStatus = CCalEntry::ETentative;
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusConfirmed) == 0 )
-                {
-                parameters->iStatus = CCalEntry::EConfirmed;
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusCancelled) == 0 )
-                {
-                parameters->iStatus = CCalEntry::ECancelled;
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusNeedsAction) == 0 )
-                {
-                parameters->iStatus = CCalEntry::ETodoNeedsAction;
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusCompleted) == 0 )
-                {
-                parameters->iStatus = CCalEntry::ETodoCompleted;
-                }
-            else if( CompareIgnoreCase(elemContent, KCalStatusInProcess) == 0 )
-                {
-                parameters->iStatus = CCalEntry::ETodoInProcess;
-                }
-            else
-                {
-                parameters->iStatus = CCalEntry::ENullStatus;
-                }
-            }
-        else if( elemName == KPriority )
-            {
-            if( randomAttr || elemContent.Length() == 0 )
-                {
-                parameters->iTodoPriority = iEngine->RandomNumber(1,3);
-                }            
-            else if( CompareIgnoreCase(elemContent, KPriorityHigh) == 0)
-                {
-                parameters->iTodoPriority = 1;
-                }
-            else if( CompareIgnoreCase(elemContent, KPriorityMedium) == 0)
-                {
-                parameters->iTodoPriority = 2;
-                }
-            else if( CompareIgnoreCase(elemContent, KPriorityLow) == 0 )
-                {
-                parameters->iTodoPriority = 3;
-                }
-            else
-                {
-                parameters->iTodoPriority = ConvertStrToIntL(elemContent);
-                }
-            }
-        else if( elemName == KAttendees )
-            {            
-            const RPointerArray<CCreatorScriptElement>& attendeesSubElems = fields[i]->SubElements();
-            for( TInt j = 0; j < attendeesSubElems.Count(); ++j )
-                {
-                TPtrC eName = attendeesSubElems[j]->Name();
-                TPtrC eContent = attendeesSubElems[j]->Content();
-                if( eName == KContactSetRef )
-                    {
-                    AppendContactSetReferenceL(*attendeesSubElems[j], parameters->iAttendeeLinkIds);
-                    }
-                else if( eName == KAttendee )
-                    {
-                    CCreatorCalenderAttendee* calAtt = CCreatorCalenderAttendee::NewL();
-                    CleanupStack::PushL(calAtt);
-                    const RPointerArray<CCreatorScriptElement>& attendeeFields = attendeesSubElems[j]->SubElements();
-                    // Make sure that at least email is given:
-                    if(attendeeFields.Count() == 0 )
-                    	{
-                    	CCreatorScriptElement* emailField =  CCreatorScriptElement::NewL(iEngine, KEmail );
-                    	CleanupStack::PushL(emailField);
-                    	fields[i]->SubElements().AppendL(emailField);
-                    	CleanupStack::Pop(); // emailField	
-                    	}
-                    for( TInt k = 0; k < attendeeFields.Count(); ++k )
-                        {
-                        const CCreatorScriptAttribute* randomAttr = attendeeFields[k]->FindAttributeByName(KRandomLength);
-                        TPtrC attElemName = attendeeFields[k]->Name();
-                        TPtrC attElemCont = attendeeFields[k]->Content();
-                        if( attElemName == KCommonname )
-                            {
-                            if( randomAttr || attElemCont.Length() == 0)
-                                {
-                                // Random data:
-                                calAtt->SetCommonNameL(iEngine->RandomString(CCreatorEngine::EFirstName));
-                                }
-                            else
-                                {
-                                calAtt->SetCommonNameL(attElemCont);
-                                }
-                            }
-                        else if( attElemName == KEmail )
-                            {
-                            if( randomAttr || attElemCont.Length() == 0)
-                                {
-                                // Random data:
-                                TDesC* email = iEngine->CreateEmailAddressLC();
-                                calAtt->SetEmailAddressL(*email);
-                                CleanupStack::PopAndDestroy(); // email
-                                }
-                            else
-                                {                                
-                                calAtt->SetEmailAddressL(attElemCont);
-                                }
-                            }
-                        else if( attElemName == KRole )
-                            {
-                            if( randomAttr || attElemCont.Length() == 0)
-                                {
-                                // Random role:
-                                CCalAttendee::TCalRole randomRole = 
-                                    (CCalAttendee::TCalRole) iEngine->RandomNumber(
-                                            (TInt) CCalAttendee::EReqParticipant, 
-                                            (TInt) CCalAttendee::EChair);
-                                calAtt->SetRole(randomRole);
-                                }                                
-                            else if( CompareIgnoreCase(attElemCont, KRoleRequired) == 0 )
-                                {
-                                calAtt->SetRole(CCalAttendee::EReqParticipant);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KRoleOptional) == 0 )
-                                {
-                                calAtt->SetRole(CCalAttendee::EOptParticipant);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KRoleNonPart) == 0 )
-                                {
-                                calAtt->SetRole(CCalAttendee::ENonParticipant);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KRoleChair) == 0 )
-                                {
-                                calAtt->SetRole(CCalAttendee::EChair);
-                                }
-                            }
-                        else if( attElemName == KStatus )
-                            {
-                            if( randomAttr || attElemCont.Length() == 0)
-                                {
-                                // Random role:
-                                CCalAttendee::TCalStatus randomStatus = 
-                                (CCalAttendee::TCalStatus) iEngine->RandomNumber(
-                                        (TInt) CCalAttendee::ENeedsAction, 
-                                        (TInt) CCalAttendee::EInProcess);
-                                calAtt->SetStatus(randomStatus);
-                                }                                
-                            else if( CompareIgnoreCase(attElemCont, KStatusNeedsAction) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::ENeedsAction);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusAccepted) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::EAccepted);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusTentative) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::ETentative);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusConfirmed) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::EConfirmed);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusDeclined) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::EDeclined);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusCompleted) == 0 )
-                                {
-                                calAtt->SetStatus(CCalAttendee::ECompleted);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusDelegated) == 0 )
-                                {                                
-                                calAtt->SetStatus(CCalAttendee::EDelegated);
-                                }
-                            else if( CompareIgnoreCase(attElemCont, KStatusInProcess) == 0 )
-                                {                                
-                                calAtt->SetStatus(CCalAttendee::EInProcess);
-                                }
-                            }
-                        }
-                    parameters->iAttendees.AppendL(calAtt);
-                    CleanupStack::Pop(); // calAtt
-                    }
-                }
-            }
-        }    
-    }
-
-void CCreatorCalendarElement::ExecuteCommandL()
-	{
-	LOGSTRING("Creator: CCreatorCalendarElement::ExecuteCommandL");
-	// Amount of calendar entries:
-	const CCreatorScriptAttribute* calEntryAmountAttr = this->FindAttributeByName(KAmount);
-	const CCreatorScriptAttribute* calEntryTypeAttr = this->FindAttributeByName(KType);    
-	TInt entryAmount = 1;    
-	if( calEntryAmountAttr )
-		{
-		entryAmount = ConvertStrToIntL(calEntryAmountAttr->Value());
-		}
-	if( calEntryTypeAttr == 0 )
-		{
-		LOGSTRING("ERROR in CCreatorCalendarElement::ExecuteCommandL: Type attribute is missing.");
-		User::Leave(KErrGeneral); // type is required attribute
-		}
-
-	// Find fields element:
-	CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-	
-	for( TInt cI = 0; cI < entryAmount; ++cI )
-		{
-		CCalenderInterimParameters* param = new (ELeave) CCalenderInterimParameters;
-		CleanupStack::PushL(param);
-		if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeAppointment) == 0 )
-			{
-			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-				{
-				FillEntryParamsL(EAppointment, fieldsElement->SubElements(), param);
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAppointments, param);
-				}
-			else
-				{
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAppointments, 0, entryAmount);
-				CleanupStack::PopAndDestroy(param);
-				break; // We can step out from the for-loop, because the amount is given to engine.
-				}
-			}		
-		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeEvent ) == 0 )
-			{
-			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-				{
-				FillEntryParamsL(EEvent, fieldsElement->SubElements(), param);
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryEvents, param);
-				}
-			else
-				{
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryEvents, 0, entryAmount);
-				CleanupStack::PopAndDestroy(param);
-				break;  // We can step out from the for-loop, because the amount is given to engine.
-				}
-			}
-		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeReminder ) == 0 )
-			{
-			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-				{
-				FillEntryParamsL(EReminder, fieldsElement->SubElements(), param);
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryReminders, param);
-				}
-			else
-				{
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryReminders, 0, entryAmount);
-				CleanupStack::PopAndDestroy(param);
-				break;  // We can step out from the for-loop, because the amount is given to engine.
-				}
-			}
-		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeAnniversary ) == 0 )
-			{
-			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-				{
-				FillEntryParamsL(EAnniversary, fieldsElement->SubElements(), param);
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAnniversaries, param);
-				}
-			else
-				{
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryAnniversaries, 0, entryAmount);
-				CleanupStack::PopAndDestroy(param);
-				break;  // We can step out from the for-loop, because the amount is given to engine.
-				}
-			}
-		else if( CompareIgnoreCase(calEntryTypeAttr->Value(), KCalTypeTodo ) == 0 )
-			{
-			if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-				{
-				FillEntryParamsL(ETodo, fieldsElement->SubElements(), param);
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryToDos, param);
-				}
-			else
-				{
-				iEngine->AppendToCommandArrayL(ECmdCreateCalendarEntryToDos, 0, entryAmount);
-				CleanupStack::PopAndDestroy(param);
-				break;  // We can step out from the for-loop, because the amount is given to engine.
-				}
-			}
-		CleanupStack::Pop(); // param
-		}
-	}
-
-CCreatorCalendarElement::CCreatorCalendarElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
--- a/creator/src/creator_connectionmethod.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,948 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_connectionmethod.h" 
-#include "creator_traces.h"
-
-using namespace CMManager;
-
-#include <cmpluginpacketdatadef.h>  
-#include <cmplugincsddef.h> 
-#include <cmpluginhscsddef.h> 
-#include <cmmanagerext.h>
-#include <cmdestinationext.h> 
-#include <cmpluginembdestinationdef.h>
-#include <cmpluginvpndef.h>
-#include <cmpluginlanbasedef.h> 
-#include <cmdefconnvalues.h>
-#include <cmconnectionmethoddef.h>
-
-
-#include <wlanmgmtinterface.h>
-#include <wlanmgmtclient.h>
-#include <wlanmgmtclient.inl> 
-#include <wlanmgmtcommon.h> 
-#include <wlanscaninfo.h> 
-#include <wlanscaninfo.inl> 
-#include <wlanscaninfointerface.h>
-
-//#include <WEPSecuritySettingsUI.h>//For WEP setting
-//#include <dbcreatorcommon.h>
-
-static const TInt KConnectionSettingssFieldLength = 128;
-
-_LIT(KCreatorConnectionSettingssPrefixName, "CR_");
-
-//----------------------------------------------------------------------------
-
-CConnectionSettingsParameters::CConnectionSettingsParameters()
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::CConnectionSettingsParameters");
-        
-    iConnectionName = HBufC::New(KConnectionSettingssFieldLength);
-    iStartPage = HBufC::New(KConnectionSettingssFieldLength);
-    iLoginName = HBufC::New(KConnectionSettingssFieldLength);
-    iLoginPass = HBufC::New(KConnectionSettingssFieldLength);
-    iIPAddr = HBufC::New(KConnectionSettingssFieldLength);
-    iIP4NameServer1 = HBufC::New(KConnectionSettingssFieldLength);
-    iIP4NameServer2 = HBufC::New(KConnectionSettingssFieldLength);
-    iDefaultTelNumber = HBufC::New(KConnectionSettingssFieldLength);
-    iProxyServerAddress = HBufC::New(KConnectionSettingssFieldLength);
-    iSubnetMask = HBufC::New(KConnectionSettingssFieldLength); 
-    iGatewayAddress = HBufC::New(KConnectionSettingssFieldLength);
-    iWLANName = HBufC::New(KConnectionSettingssFieldLength);
-    iWlanIpAddr = HBufC::New(KConnectionSettingssFieldLength);
-    iIP6NameServer1 = HBufC::New(KConnectionSettingssFieldLength);
-    iIP6NameServer2 = HBufC::New(KConnectionSettingssFieldLength);
-    }
-
-CConnectionSettingsParameters::~CConnectionSettingsParameters()
-    {
-    LOGSTRING("Creator: CConnectionSettingssParameters::~CConnectionSettingssParameters");
-
-    delete iProxyServerAddress;
-    delete iDefaultTelNumber;
-    delete iIP4NameServer2;
-    delete iIP4NameServer1;
-    delete iIPAddr;    
-    delete iLoginPass;
-    delete iLoginName;
-    delete iStartPage;
-    delete iConnectionName;
-    delete iSubnetMask;  
-    delete iGatewayAddress;
-    delete iWLANName;
-    delete iWlanIpAddr;
-    delete iIP6NameServer1;
-    delete iIP6NameServer2;    
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorConnectionSettings* CCreatorConnectionSettings::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorConnectionSettings* self = CCreatorConnectionSettings::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorConnectionSettings* CCreatorConnectionSettings::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorConnectionSettings* self = new (ELeave) CCreatorConnectionSettings;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorConnectionSettings::CCreatorConnectionSettings()
-    {
-    }
-
-void CCreatorConnectionSettings::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::ConstructL");
-
-    iEngine = aEngine;
-    
-    iCmManagerExt.CreateTablesAndOpenL();
-    }
-
-CCreatorConnectionSettings::~CCreatorConnectionSettings()
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::~CCreatorConnectionSettings");
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidIAP ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    if (iParameters)
-        {
-        delete iParameters;
-        }
-    
-    iCmManagerExt.Close();
-    }
-    
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorConnectionSettings::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::AskDataFromUserL");
-
-    if( aCommand == ECmdDeleteIAPs )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all Connection Methods?") );
-        }
-    else if( aCommand == ECmdDeleteCreatorIAPs )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all Connection Methods created with Creator?") );
-        }
-    else
-        {
-        return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-        }
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorConnectionSettings::CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::CreateConnectionSettingsEntryL");
-
-    CConnectionSettingsParameters* parameters = (CConnectionSettingsParameters*) aParameters;
-    
-    // clear any existing parameter definations 
-    delete iParameters;
-    iParameters = NULL;
-            
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new (ELeave) CConnectionSettingsParameters();
-        parameters = iParameters;
-        SetRandomParametersL(*parameters);
-        }
-    
-    if( parameters->iBearerType == KRandomBearerType )
-    	{
-    	SetRandomBearerTypeL(*parameters);
-    	}
-    
-    TInt err = KErrNone;
-
-    // create unique name for each network destination
-    RCmDestinationExt dest;
-    TInt destinationError = KErrNone;
-    TInt count = 0;
-	TBuf<KConnectionSettingssFieldLength> name;
-	name.Copy(parameters->iConnectionName->Des());
-    do
-    	{
-    	TRAP(destinationError, dest = iCmManagerExt.CreateDestinationL(name));
-    	if (destinationError == KErrAlreadyExists)
-    		{
-    		name.Copy(parameters->iConnectionName->Des());
-    		count++;
-    		name.AppendFormat(_L(" (%d)"), count);
-    		}
-    	else if (destinationError != KErrNone)
-    		{
-    		User::Leave(destinationError);
-    		}
-    	}
-    while (destinationError == KErrAlreadyExists);
-    parameters->iConnectionName->Des().Copy(name);        
-
-    CleanupClosePushL(dest);
-    dest.UpdateL();
-    
-    RCmConnectionMethodExt conMethod = dest.CreateConnectionMethodL( parameters->iBearerType);//KUidPacketDataBearerType
-    CleanupClosePushL( conMethod );
-    
-    if(parameters->iBearerType == KUidWlanBearerType)
-        {
-        //IP net mask of interface
-        conMethod.SetStringAttributeL( EWlanIpNetMask, parameters->iSubnetMask->Des()  );
-
-        //IP address of EPOC.
-        conMethod.SetStringAttributeL( EWlanIpAddr, parameters->iWlanIpAddr->Des()  );
-        //
-        //following gateway ID:s is not workin, 
-        //logically ID would be EWlanIpGateway because EWlanIpNetMask
-        //is going to net mask, which is just before gateway in ui
-        //--->
-        conMethod.SetStringAttributeL( EWlanIpGateway, parameters->iGatewayAddress->Des()  );
-        //conMethod.SetStringAttributeL( EApIspIPGateway, parameters->iGatewayAddress->Des()  );
-        conMethod.SetStringAttributeL( ECmWapIPGatewayAddress, parameters->iGatewayAddress->Des()  );
-        conMethod.SetStringAttributeL( ECmIPGateway, parameters->iGatewayAddress->Des()  );
-        //<---
-        
-        //IP Address of primary and secondary name server (IP v4).
-        conMethod.SetStringAttributeL( EWlanIpNameServer1, parameters->iIP4NameServer1->Des()  );
-        conMethod.SetStringAttributeL( EWlanIpNameServer2, parameters->iIP4NameServer2->Des()  );
-        //The SSID of this WLAN connection.
-        conMethod.SetStringAttributeL( EWlanSSID, parameters->iWLANName->Des()  );
-
-        //IP6 address of primary and secondary name servers
-        conMethod.SetStringAttributeL( EWlanIp6NameServer1, parameters->iIP6NameServer1->Des()  );
-        conMethod.SetStringAttributeL( EWlanIp6NameServer2, parameters->iIP6NameServer2->Des()  );        
-
-        //
-        //Setting secure mode settings
-        //
-        
-        //Network status (default: EWlanSecModeOpen) // EWlanAuthenticationMode use instead?
-        conMethod.SetIntAttributeL( EWlanSecurityMode, parameters->iWLanSecMode );
-        //WLAN Network mode  
-        conMethod.SetIntAttributeL( EWlanConnectionMode, parameters->iWlanNetMode );
-        
-        
-        if(parameters->iWLanSecMode == EWlanSecModeOpen)
-            {}//Nothing to set when mode is open
-        else if(parameters->iWLanSecMode == EWlanSecModeWep)
-            {
-            //See WEPSecuritySettingsUI.h
-            
-            
-            ///CWEPSecuritySettings
-           // conMethod.SetIntAttributeL( EWlanSecurityMode, parameters->iWLanSecMode );
-            }
-        else if(parameters->iWLanSecMode == EWlanSecMode802_1x)
-            {
-            }
-        else if(parameters->iWLanSecMode == EWlanSecModeWpa)
-            {
-            }
-        else if(parameters->iWLanSecMode == EWlanSecModeWpa2)
-            {
-            }            
-        
-        //WLAN security setting 
-        //conMethod.SetStringAttributeL( EWlanAuthenticationMode, parameters->iIP6NameServer2->Des()  );
-        //Utilise this method
-        //conMethod.SetStringAttributeL( EWlanSecurityMode, parameters->iWLanSecMode  );
-        }
-    //Not known special attributes for packet data 
-    else if(parameters->iBearerType == KUidPacketDataBearerType)
-        {
-
-        //Access point name.
-        conMethod.SetStringAttributeL( EPacketDataAPName, parameters->iConnectionName->Des() );//crash
-        
-        //Authentication user name
-        conMethod.SetStringAttributeL( EPacketDataIFAuthName, parameters->iLoginName->Des()  );
-        ///TProtocolType a;
-        //EPdpTypeIPv4 or EPdpTypeIPv6
-        conMethod.SetIntAttributeL( EPacketDataPDPType, parameters->iProtocolType  );
-                
-        //IP6 address of primary and secondary name servers
-        conMethod.SetStringAttributeL( EPacketDataIPIP6NameServer1, parameters->iIP6NameServer1->Des()  );
-        conMethod.SetStringAttributeL( EPacketDataIPIP6NameServer2, parameters->iIP6NameServer2->Des()  );                
-        //IP address of primary name server
-        conMethod.SetStringAttributeL( EPacketDataIPNameServer1, parameters->iIP4NameServer1->Des()  );
-        //IP address of secondary name server
-        conMethod.SetStringAttributeL( EPacketDataIPNameServer2, parameters->iIP4NameServer2->Des()  );
-        
-        //Also existing but UI not showing them: EPacketDataHeaderCompression, EPacketDataDisablePlainTextAuth
-        //EPacketDataIFAuthPass, EDialIFAuthPass, EPacketDataIFPromptForAuth, EPacketDataIPAddr
-        }
-    else if(parameters->iBearerType == KUidCSDBearerType || parameters->iBearerType == KUidHSCSDBearerType)
-        {
-        //Authentication user name
-        conMethod.SetStringAttributeL( EDialIFAuthName, parameters->iLoginName->Des()  );
-        //Dial-up number
-        conMethod.SetStringAttributeL( EDialDefaultTelNum, parameters->iDefaultTelNumber->Des() );
-        //Call type
-        conMethod.SetIntAttributeL( EDialCallType , parameters->iBearerCallTypeIsdn );
-        //Maximum speed
-        conMethod.SetIntAttributeL( EDialMaxConnSpeed, parameters->iBearerSpeed );
-        //Prompt user for username and password? (Only for dial out)
-        conMethod.SetBoolAttributeL( EDialPromptForLogin, parameters->iPromptPassword );
-        //IP6 address of primary and secondary name servers
-        conMethod.SetStringAttributeL( EDialIP6NameServer1, parameters->iIP6NameServer1->Des()  );
-        conMethod.SetStringAttributeL( EDialIP6NameServer2, parameters->iIP6NameServer2->Des()  );         
-        //Disable plaintext authentication
-        conMethod.SetBoolAttributeL( EDialDisablePlainTextAuth, parameters->iDisableTextAuth );       
-        //IP address of primary name server
-        conMethod.SetStringAttributeL( EDialIPNameServer1, parameters->iIP4NameServer1->Des()  );
-        //IP address of secondary name server
-        conMethod.SetStringAttributeL( EDialIPNameServer2, parameters->iIP4NameServer2->Des()  );
-
-        //Also existing  EDialEnableIPHeaderComp; EDialIFPromptForAuth;EDialIPAddress parameters
-        
-        }
-    else if(parameters->iBearerType == KUidLanBearerType)
-        {
-
-        conMethod.SetStringAttributeL( ELanBaseIpNetMask, parameters->iSubnetMask->Des() );
-        conMethod.SetStringAttributeL( ELanBaseIpGateway, parameters->iGatewayAddress->Des());
-        conMethod.SetStringAttributeL( ELanBaseIpAddr, parameters->iIPAddr->Des() );
-        conMethod.SetStringAttributeL( ELanBaseIpNameServer1, parameters->iIP4NameServer1->Des() );
-        conMethod.SetStringAttributeL( ELanBaseIpNameServer2, parameters->iIP4NameServer2->Des() );
-        conMethod.SetStringAttributeL( ELanBaseIp6NameServer1,parameters->iIP6NameServer1->Des() );
-        conMethod.SetStringAttributeL( ELanBaseIp6NameServer2,parameters->iIP6NameServer2->Des() );
-        
-        }
-    else //KUidEmbeddedDestination and KPluginVPNBearerTypeUid
-        {
-        //NOTE: NOT Tested, because no supporting Emulator for them
-        
-        //Authentication user name
-        conMethod.SetStringAttributeL( ECmIFAuthName, parameters->iLoginName->Des()  );
-        //IP6 address of primary and secondary name servers
-        conMethod.SetStringAttributeL( ECmIP6NameServer1, parameters->iIP6NameServer1->Des()  );
-        conMethod.SetStringAttributeL( ECmIP6NameServer2, parameters->iIP6NameServer2->Des()  );        
-        //Disable plaintext authentication
-        conMethod.SetBoolAttributeL( ECmDisablePlainTextAuth, parameters->iDisableTextAuth );
-        //Prompt user for authentication
-        conMethod.SetBoolAttributeL( ECmIFPromptForAuth, parameters->iPromptPassword );
-        //Authentication password
-        conMethod.SetStringAttributeL( ECmIFAuthPass, parameters->iLoginPass->Des()  );
-        }
-    
-    //
-    //Adding common attributes, all not neccessary used with all bearer types, but should not cause any problems eather
-    //
-
-    //CM Name (Connection Method, formelly known as Access Point)         
-    conMethod.SetStringAttributeL( ECmName, parameters->iConnectionName->Des() );        
-    // Start page of CM
-    conMethod.SetStringAttributeL( ECmStartPage, parameters->iStartPage->Des() );
-    // Enable Proxy   
-    conMethod.SetBoolAttributeL( ECmProxyUsageEnabled, parameters->iUseProxy );
-    // Server Name
-    conMethod.SetStringAttributeL( ECmProxyServerName, parameters->iProxyServerAddress->Des() );
-    // Port Number
-    conMethod.SetIntAttributeL( ECmProxyPortNumber, parameters->iProxyPortNumber );
-    //Proxy login name
-    conMethod.SetStringAttributeL( ECmWapIPProxyLoginName, parameters->iLoginName->Des() );
-    //Proxy login password
-    conMethod.SetStringAttributeL( ECmWapIPProxyLoginPass, parameters->iLoginPass->Des() );
-    //IP address of gateway
-    conMethod.SetStringAttributeL( ECmIPGateway, parameters->iGatewayAddress->Des() );
-    //connection-oriented or connectionless API should be used
-    //ECmWapIPWSPOption option TWapWSPOption: ECmWapWspOptionConnectionless or ECmWapWspOptionConnectionOriented    
-    conMethod.SetIntAttributeL( ECmWapIPWSPOption, parameters->iWapWspOption );   
-    //NOT WORKING????? Attempt secure WTLS connection to the gateway
-    conMethod.SetBoolAttributeL( ECmWapIPSecurity, parameters->iSecureAuthentication );
-      
-    //
-    //Adding advanced settings (Network type, Phone IP addr, DNS addr, proxy srv name, proxy port nbr
-    //
-    
-    //IP address of interface
-    conMethod.SetStringAttributeL( ECmIPAddress, parameters->iIPAddr->Des() );    
-    //IP address of primary name server
-    conMethod.SetStringAttributeL( ECmIPNameServer1, parameters->iIP4NameServer1->Des()  );
-    //IP address of secondary name server
-    conMethod.SetStringAttributeL( ECmIPNameServer2, parameters->iIP4NameServer2->Des()  );
-      
-    
-    conMethod.UpdateL();
-
-    //If no defaults set, set the created CM as a default
-    SetDefaultCML( conMethod );
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( dest.Id() );
-    
-    conMethod.Close();
-    CleanupStack::Pop(  );//conMethod
-    
-    dest.UpdateL();
-    dest.Close();
-    CleanupStack::Pop(); // dest
-        
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-void CConnectionSettingsParameters::SetRandomCMNameL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomCMNameL");
-
-    TInt num = aEngine.RandomNumber(1, 3);
-    TBuf<10> apType;
-
-    if (num==1)
-        {
-        apType = _L("mms");
-        }            
-    else if (num==2)
-        {
-        apType = _L("wap");
-        }
-    else
-        {
-        apType = _L("internet");
-        }
-    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
-    iConnectionName->Des() = KCreatorConnectionSettingssPrefixName;
-    iConnectionName->Des().Append( company );
-    iConnectionName->Des().Append(_L(" "));
-    iConnectionName->Des().Append(apType);
-    }
-
-void CConnectionSettingsParameters::SetRandomWLANNameL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANNameL");
-
-    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
-    iWLANName->Des() = KCreatorConnectionSettingssPrefixName;
-    iWLANName->Des().Append( company );
-    iWLANName->Des().Append( _L(" WLAN") );
-    }
-
-void CConnectionSettingsParameters::SetRandomWLANNetModeL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANNetModeL");
-
-    TInt wlanNetModeRand = aEngine.RandomNumber(1, 2);
-    if(wlanNetModeRand == 1)
-        {
-        iWlanNetMode = EAdhoc;//Ad-Hoc mode
-        }
-    else
-        {
-        iWlanNetMode = CMManager::EInfra;//Infrastructure mode
-        } 
-    }
-
-void CConnectionSettingsParameters::SetRandomWLANSecurityModeL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomWLANSecurityModeL");
-
-    TInt wlanSecModeRand = aEngine.RandomNumber(1, 5);
-    if(wlanSecModeRand == 1)
-        {
-        iWLanSecMode = EWlanSecModeOpen;///< Open security mode
-        }
-    else if(wlanSecModeRand == 2)
-        {
-        iWLanSecMode = EWlanSecModeWep;///< WEP security mode
-        //See WEPSecuritySettingsUI.h
-                
-        ///CWEPSecuritySettings
-                
-        //WEP key in us
-        
-        //Authentication type
-                
-        //WEP Key settings (key len, key format, key data)        
-        }
-    else if(wlanSecModeRand == 3)
-        {
-        iWLanSecMode = EWlanSecMode802_1x; ///< 802.1x security mode
-        }
-    else if(wlanSecModeRand == 4)
-        {
-        iWLanSecMode = EWlanSecModeWpa;///< WPA security mode
-        }
-    else if(wlanSecModeRand == 5)
-        {
-        iWLanSecMode = EWlanSecModeWpa2;///< WPA@ security mode
-        }
-    }
-
-void CConnectionSettingsParameters::SetRandomLoginNameL(CCreatorEngine& aEngine)
-    {
-    iLoginName->Des() = aEngine.RandomString(CCreatorEngine::EFirstName);
-    iLoginName->Des().LowerCase();
-    }
-
-void CConnectionSettingsParameters::SetRandomLoginPassL(CCreatorEngine& aEngine)
-    {
-    iLoginPass->Des() = aEngine.RandomString(CCreatorEngine::ESurname);
-    iLoginPass->Des().LowerCase();
-    }
-
-void CConnectionSettingsParameters::SetRandomSecureAuthenticationL(CCreatorEngine& /*aEngine*/)
-    {
-    iSecureAuthentication = EFalse;
-    }
-
-void CConnectionSettingsParameters::SetRandomPromptPasswordL(CCreatorEngine& /*aEngine*/)
-    {
-    iPromptPassword = ETrue;
-    }
-
-void CConnectionSettingsParameters::SetRandomUseProxyL(CCreatorEngine& /*aEngine*/)
-    {
-    iUseProxy = ETrue;
-    }
-
-void CConnectionSettingsParameters::SetRandomProxyAddressL(CCreatorEngine& /*aEngine*/)
-    {
-    iProxyServerAddress->Des() = _L("127.0.0.1");
-    }
-
-void CConnectionSettingsParameters::SetRandomProxyPortL(CCreatorEngine& /*aEngine*/)
-    {
-    iProxyPortNumber = 80;
-    }
-
-void CConnectionSettingsParameters::SetRandomStartPageL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomStartPageL");
-
-    TInt num = aEngine.RandomNumber(1, 3);
-    TBuf<10> apType;
-
-    if (num==1)
-        {
-        apType = _L("mms");
-        }            
-    else if (num==2)
-        {
-        apType = _L("wap");
-        }
-    else
-        {
-        apType = _L("internet");
-        }
-    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);    
-    iStartPage->Des() = _L("http://");
-    iStartPage->Des().Append(apType);
-    iStartPage->Des().Append(_L("."));
-    iStartPage->Des().Append(company);
-    iStartPage->Des().Append(_L(".com"));
-    iStartPage->Des().LowerCase();
-    }
-
-void CConnectionSettingsParameters::SetRandomIPAddressL(CCreatorEngine& /*aEngine*/)
-    {
-    iIPAddr->Des() = _L("10.10.10.10");
-    }
-
-void CConnectionSettingsParameters::SetRandomIP4NameServer1L(CCreatorEngine& /*aEngine*/)
-    {
-    iIP4NameServer1->Des() = _L("10.1.1.1");
-    }
-void CConnectionSettingsParameters::SetRandomIP4NameServer2L(CCreatorEngine& /*aEngine*/)
-    {
-    iIP4NameServer2->Des() = _L("10.2.2.2");
-    }
-
-void CConnectionSettingsParameters::SetRandomProtocolTypeL(CCreatorEngine& aEngine)
-    {
-    LOGSTRING("Creator: CConnectionSettingsParameters::SetRandomProtocolTypeL");
-
-    TInt protocolTypeRand = aEngine.RandomNumber(1, 2);
-    if(protocolTypeRand == 1)
-        {
-        iProtocolType = RPacketContext::EPdpTypeIPv4;
-        }
-    else
-        {
-        iProtocolType = RPacketContext::EPdpTypeIPv6;
-        }
-    }
-
-void CConnectionSettingsParameters::SetRandomTelephoneNumberL(CCreatorEngine& aEngine)
-    {
-    iDefaultTelNumber->Des() = aEngine.RandomString(CCreatorEngine::EPhoneNumber);
-    }
-
-void CConnectionSettingsParameters::SetRandomBearerTypeIsdnL(CCreatorEngine& /*aEngine*/)
-    {
-    iBearerCallTypeIsdn = ECmCallTypeISDNv110;
-    }
-
-void CConnectionSettingsParameters::SetRandomBearerSpeedL(CCreatorEngine& /*aEngine*/)
-    {
-    iBearerSpeed = ECmSpeed14400;
-    }
-
-void CConnectionSettingsParameters::SetRandomWapWspOptionL(CCreatorEngine& /*aEngine*/)
-    {
-    iWapWspOption = ECmWapWspOptionConnectionless;
-    }
-
-void CConnectionSettingsParameters::SetRandomSubnetMaskL(CCreatorEngine& /*aEngine*/)
-    {
-    iSubnetMask->Des() = _L("255.255.255.0");
-    }
-
-void CConnectionSettingsParameters::SetRandomGatewayAddressL(CCreatorEngine& /*aEngine*/)
-    {
-    iGatewayAddress->Des() = _L("10.0.0.1");
-    }
-
-void CConnectionSettingsParameters::SetRandomWlanIpAddrL(CCreatorEngine& /*aEngine*/)
-    {
-    iWlanIpAddr->Des() = _L("10.0.0.99");
-    }
-
-void CConnectionSettingsParameters::SetRandomIPv6NameServer1L(CCreatorEngine& /*aEngine*/)
-    {
-    iIP6NameServer1->Des() = _L("2007:abcd:1000:2000:3000:4000:5000:6001");
-    }
-
-void CConnectionSettingsParameters::SetRandomIPv6NameServer2L(CCreatorEngine& /*aEngine*/)
-    {
-    iIP6NameServer2->Des() = _L("2007:abcd:1000:2000:3000:4000:5000:6002");
-    }
-
-void CConnectionSettingsParameters::SetRandomDisableTextAuthL(CCreatorEngine& /*aEngine*/)
-    {
-    iDisableTextAuth = EFalse;
-    }
-
-void CCreatorConnectionSettings::SetRandomBearerTypeL(CConnectionSettingsParameters& parameters)
-	{
-    LOGSTRING("Creator: CCreatorConnectionSettings::SetRandomBearerTypeL");
-
-	RArray<TUint32> supportedBearers = RArray<TUint32>( 10 );
-	iCmManagerExt.SupportedBearersL(supportedBearers);
-	CleanupClosePushL( supportedBearers );
-	    
-	//In random mode, skipping KUidLanBearerType
-	//Because of Emulator migh show it as supported, when it's really not
-	//and that causes weird situation in UI when there is an item, but it can't be opened
-	TInt lanID = supportedBearers.Find(KUidLanBearerType);
-	if( lanID != KErrNotFound )
-		{
-		supportedBearers.Remove(lanID);
-		}
-	
-	// in emulator remove WLAN
-	#ifdef __WINSCW__	
-	TInt wlanID = supportedBearers.Find(KUidWlanBearerType);
-	if( wlanID != KErrNotFound )
-		{
-		supportedBearers.Remove(wlanID);
-		}
-	#endif	
-				
-	/*
-	    for(TInt i = 0; i<supportedCount; i++)
-	        {
-	        TUint bearer = supportedBearers[i];
-	        if(bearer == KUidLanBearerType)
-	            {
-	            supportedBearers.Remove(i);
-	            }
-	        }
-	    */
-	    
-	//Select random bearer type. 
-	//Also possible to use SupportedBearersL() -method to find supported methods
-	//but using that will cause problems when setting attributes.
-	TInt supportedCount = supportedBearers.Count();    
-	TInt bearerTypeID = iEngine->RandomNumber(0, supportedCount-1);
-	    
-	TUint bearerType = supportedBearers[bearerTypeID];
-	    
-	//Bearer types KUidEmbeddedDestination and KPluginVPNBearerTypeUid is not supported
-	if(bearerType == KUidWlanBearerType)//Wireless LAN
-		{            
-		parameters.iBearerType = KUidWlanBearerType;
-		}
-	else if(bearerType == KUidPacketDataBearerType)//Packet data (GPRS)
-		{
-		parameters.iBearerType = KUidPacketDataBearerType;
-		}
-	else if(bearerType == KUidCSDBearerType)//Data Call
-		{
-		parameters.iBearerType = KUidCSDBearerType;
-		}
-	else if(bearerType == KUidHSCSDBearerType) //High speed GSM
-		{
-		parameters.iBearerType = KUidHSCSDBearerType;
-		}
-	else if(bearerType == KUidEmbeddedDestination)
-		{
-		parameters.iBearerType = KUidEmbeddedDestination;
-		}
-	else// if(bearerType == KPluginVPNBearerTypeUid)
-		{
-		parameters.iBearerType = KPluginVPNBearerTypeUid;
-		}
-	/* In random mode skipping LAN type
-	    else// if(bearerType == KUidLanBearerType)
-	        {
-	        iBearerType = KUidLanBearerType;
-	        }*/
-	    
-	CleanupStack::PopAndDestroy(); // supportedBearers
-	}
-
-void CCreatorConnectionSettings::SetRandomParametersL(CConnectionSettingsParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::SetRandomParametersL");
-        
-    // Connection method name:
-    parameters.SetRandomCMNameL(*iEngine);
-    
-    SetRandomBearerTypeL(parameters);
- 
-    if(parameters.iBearerType == KUidWlanBearerType)//Wireless LAN
-        {           
-        // WLAN name:
-        parameters.SetRandomWLANNameL(*iEngine);
-        
-        //WLAN network mode        
-        parameters.SetRandomWLANNetModeL(*iEngine);     
-        
-        //WLAN security mode:
-        parameters.SetRandomWLANSecurityModeL(*iEngine);
-        }
-    
-    // Login name:
-    parameters.SetRandomLoginNameL(*iEngine);
-
-    // Login password:
-    parameters.SetRandomLoginPassL(*iEngine);
-
-    // Secure authentication:
-    parameters.SetRandomSecureAuthenticationL(*iEngine);
-    
-    // Prompt password:
-    parameters.SetRandomPromptPasswordL(*iEngine);    
-
-    // Use proxy:
-    parameters.SetRandomUseProxyL(*iEngine);    
-    
-    // Proxy address
-    parameters.SetRandomProxyAddressL(*iEngine);    
-    
-    // Proxy port number:
-    parameters.SetRandomProxyPortL(*iEngine);    
-
-    // Start page:
-    parameters.SetRandomStartPageL(*iEngine);
-       
-    // IP address:
-    parameters.SetRandomIPAddressL(*iEngine);    
-    
-    // IPv4 name servers:
-    parameters.SetRandomIP4NameServer1L(*iEngine);
-    parameters.SetRandomIP4NameServer2L(*iEngine);
-      
-    // Protocol type:
-    parameters.SetRandomProtocolTypeL(*iEngine);
-    
-    // Default telephone number:
-    parameters.SetRandomTelephoneNumberL(*iEngine);
-         
-    // Bearer isdn
-    parameters.SetRandomBearerTypeIsdnL(*iEngine);
-
-    // Bearer speed:
-    parameters.SetRandomBearerSpeedL(*iEngine);    
-
-    // WAP wsp option:
-    parameters.SetRandomWapWspOptionL(*iEngine);
-
-    // Subnet mask:
-    parameters.SetRandomSubnetMaskL(*iEngine);
-    
-    // Gateway address:
-    parameters.SetRandomGatewayAddressL(*iEngine);
-    
-    // WLAN ip address:
-    parameters.SetRandomWlanIpAddrL(*iEngine);
-
-    // IPv6 name servers:
-    parameters.SetRandomIPv6NameServer1L(*iEngine);
-    parameters.SetRandomIPv6NameServer2L(*iEngine);
-    
-    // Disable text authorization:
-    parameters.SetRandomDisableTextAuthL(*iEngine);    
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorConnectionSettings::SetDefaultCML(RCmConnectionMethodExt conMethod)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::SetDefaultCM");
-
-    TCmDefConnValue defConnValue;
-        
-    //Returns the default connection method/SNAP.
-    TRAPD( err, iCmManagerExt.ReadDefConnL( defConnValue ) );
-    if( err ==  KErrNotSupported )
-        {
-        return; //If Default Connection NOT supported, just returning 
-        }
-    else if ( err != KErrNone )
-        {
-        User::Leave( err ); //If something else happend
-        }
-    else if ( defConnValue.iId == 0 ) // default not set
-        {       
-        TCmDefConnValue newDefaultCM;        
-        HBufC* cmName = conMethod.GetStringAttributeL( ECmName );        
-        CleanupStack::PushL( cmName );
-        newDefaultCM.iId = AccessPointNameToIdL( cmName->Des() );
-        newDefaultCM.iType = ECmDefConnDestination;
-        //Stores the default connection method/SNAP.
-        iCmManagerExt.WriteDefConnL( newDefaultCM );
-        CleanupStack::PopAndDestroy( cmName );        
-       }
-    }
-
-//----------------------------------------------------------------------------
-
-TUint32 CCreatorConnectionSettings::AccessPointNameToIdL(const TDesC& aAPName,
-                                                         TBool aAnyIfNotFound )
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::AccessPointNameToIdL");
-
-    //RCmDestination destination
-    
-    RArray<TUint32> destIdArray = RArray<TUint32>( 10 );
-    
-    iCmManagerExt.AllDestinationsL( destIdArray );
-    
-    CleanupClosePushL( destIdArray );
-    TUint32 id = 0 ;
-    TBool found = EFalse;
-    
-    for( TInt i = 0; i < destIdArray.Count(); i++ )
-        {
-        RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );           
-        CleanupClosePushL( dest );        
-
-        HBufC* destName = dest.NameLC();
-        
-        if (destName->CompareF(aAPName) == 0){        
-         id = dest.Id();
-         found = ETrue;
-        }
-        if ( !found && id == 0 && aAnyIfNotFound )
-            {
-            id = dest.Id();
-            }
-        CleanupStack::PopAndDestroy( 2 ); // destName , dest
-        if(found)
-            {
-            break;
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); // destIdArray   
-    return id;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorConnectionSettings::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::HandleSessionEventL");
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorConnectionSettings::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllL");
-    DeleteAllDestinationsL( EFalse );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorConnectionSettings::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidIAP );
-    
-    // delete entries
-    DeleteAllDestinationsL( ETrue );
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorConnectionSettings::DeleteAllDestinationsL( TBool aOnlyCreatedWithCreator )
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::DeleteAllDestinationsL");
-    RArray<TUint32> destIdArray(5);
-    CleanupClosePushL( destIdArray );
-    iCmManagerExt.AllDestinationsL( destIdArray );    
-    
-    for( TInt i = 0; i < destIdArray.Count(); i++ )
-        {
-        TRAP_IGNORE
-            (
-            RCmDestinationExt dest = iCmManagerExt.DestinationL( destIdArray[i] );           
-            CleanupClosePushL( dest );
-            
-            if ( !aOnlyCreatedWithCreator || iEntryIds.Find( destIdArray[i]) != KErrNotFound )
-                {
-                dest.DeleteLD();
-                }
-            CleanupStack::PopAndDestroy(); // dest
-            );
-        }
-   
-    CleanupStack::PopAndDestroy(); // destIdArray 
-    
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the IMPS related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidIAP );
-    }
-//----------------------------------------------------------------------------
--- a/creator/src/creator_connectionmethodelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,754 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_connectionmethodelement.h"
-#include "creator_traces.h"
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-#include "creator_connectionmethod.h"
-#include <cmpluginpacketdatadef.h>
-#include <cmplugindialcommondefs.h>
-#include <cmplugincsddef.h>
-#include <cmpluginhscsddef.h>
-#include <cmpluginembdestinationdef.h>
-#include <cmpluginvpndef.h>
-#include <cmpluginlanbasedef.h>
-#else
-#include "creator_accesspoint.h"
-#endif
-
-
-using namespace creatorconnectionmethod;
-
-// connection name needs extra space for possible renaming
-const TInt KExtraSpace = 10;
-
-/*
- * 
- */
-CCreatorConnectionMethodElement* CCreatorConnectionMethodElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorConnectionMethodElement* self = new (ELeave) CCreatorConnectionMethodElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorConnectionMethodElement::CCreatorConnectionMethodElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-void CCreatorConnectionMethodElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt cmAmount = 1;    
-    if( amountAttr )
-        {
-        cmAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create connection method entries, the amount of entries is defined by cmAmount:
-        for( TInt cI = 0; cI < cmAmount; ++cI )
-            {            
-            CConnectionSettingsParameters* param = new (ELeave) CConnectionSettingsParameters;
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                TBool useRandom = EFalse;
-                if( randomAttr || elemContent.Length() == 0 )
-                    {
-                    useRandom = ETrue;
-                    }
-                
-                if( elemName == Kconnectionname )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomCMNameL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iConnectionName, elemContent);
-                        // reserve extra space for possible renaming
-                        TInt newLen = param->iConnectionName->Length() + KExtraSpace;
-                        param->iConnectionName = param->iConnectionName->ReAllocL(newLen);
-                        }
-                    }
-                else if( elemName == Kstartpage )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomStartPageL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iStartPage, elemContent);
-                        }
-                    }
-                else if( elemName == Kwapwspoption )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomWapWspOptionL(*iEngine);
-                        }
-                    else
-                        {
-                        if( CompareIgnoreCase(elemContent, Kconnectionless) == 0 )
-                        	{
-                        	param->iWapWspOption = ECmWapWspOptionConnectionless;
-                        	}
-                        else if( CompareIgnoreCase(elemContent, Kconnectionoriented) == 0 )
-                        	{
-                        	param->iWapWspOption = ECmWapWspOptionConnectionOriented;
-                        	}
-                        }
-                    }
-                else if( elemName == Kprotocoltype )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomProtocolTypeL(*iEngine);
-                		}
-                	else
-                		{
-                		if( CompareIgnoreCase(elemContent, Kipv4) == 0 )
-                			{
-                			param->iProtocolType = RPacketContext::EPdpTypeIPv4;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Kipv6) == 0 )
-                			{
-                			param->iProtocolType = RPacketContext::EPdpTypeIPv6;
-                			}
-                		}
-                	}
-                else if( elemName == Kloginname )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomLoginNameL(*iEngine);                		
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iLoginName, elemContent);
-                		}
-                	}
-                else if( elemName == Ksecureauthentication )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomSecureAuthenticationL(*iEngine);
-                		}
-                	else
-                		{
-                		param->iSecureAuthentication = ConvertStrToBooleanL(elemContent);
-                		}
-                	}
-                else if( elemName == Kloginpass )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomLoginPassL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iLoginPass, elemContent);
-                		}
-                	}
-                else if( elemName == Kpromptpassword )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomPromptPasswordL(*iEngine);
-                		}
-                	else
-                		{
-                		param->iPromptPassword = ConvertStrToBooleanL(elemContent);
-                		}
-                	}
-                else if( elemName == Kgatewayaddress )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomGatewayAddressL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iGatewayAddress, elemContent);
-                		}
-                	}
-                else if( elemName == Ksubnetmask )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomSubnetMaskL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iSubnetMask, elemContent);
-                		}
-                	}
-                else if( elemName == Kdeviceipaddr )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomIPAddressL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iIPAddr, elemContent);
-                		}
-                	}
-                else if( elemName == Kip4nameserver1 )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomIP4NameServer1L(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iIP4NameServer1, elemContent);
-                		}
-                	}
-                else if( elemName == Kip4nameserver2 )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomIP4NameServer2L(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iIP4NameServer2, elemContent);
-                		}
-                	}
-                else if( elemName == Kdatacalltelnumber )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomTelephoneNumberL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iDefaultTelNumber, elemContent);
-                		}
-                	}
-                else if( elemName == Kdatacalltypeisdn )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomBearerTypeIsdnL(*iEngine);
-                		}
-                	else
-                		{
-                		if( CompareIgnoreCase(elemContent, Kanalogue) == 0 )
-                			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeAnalogue;
-                		else if( CompareIgnoreCase( elemContent, Kisdnv110) == 0 )
-                			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeISDNv110;
-                		else if( CompareIgnoreCase( elemContent, Kisdnv120) == 0 )
-                			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeISDNv120;
-                		}
-                	}
-                else if( elemName == Kbearertype )
-                	{
-                	if( useRandom )
-                		{
-                		param->iBearerType = KRandomBearerType;
-                		}
-                	else
-                		{
-                		if( CompareIgnoreCase(elemContent, Kwlan) == 0 )
-                			{
-                			param->iBearerType = KUidWlanBearerType;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Kgprs) == 0 )
-                			{
-                			param->iBearerType = KUidPacketDataBearerType;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Kdatacall) == 0 )
-                			{
-                			param->iBearerType = KUidCSDBearerType;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Khsgsm) == 0 )
-                			{
-                			param->iBearerType = KUidHSCSDBearerType;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Kembedded) == 0 )
-                			{
-                			param->iBearerType = KUidEmbeddedDestination;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Kvpn) == 0 )
-                			{
-                			param->iBearerType = KPluginVPNBearerTypeUid;
-                			}
-                		else if( CompareIgnoreCase(elemContent, Klan) == 0 )
-                			{
-                			param->iBearerType = KUidLanBearerType;
-                			}
-                		}
-                	}
-                else if( elemName == Kdatacalllinespeed )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomBearerSpeedL(*iEngine);
-                		}
-                	else
-                		{
-                		if( CompareIgnoreCase(elemContent, Kautomatic) == 0 )
-                			{                			 
-                			param->iBearerSpeed = CMManager::ECmSpeedAutobaud;
-                			}
-                		else
-                			{
-                			TUint lineSpeed = ConvertStrToUintL(elemContent);
-                			if( lineSpeed == 9600 )
-                				param->iBearerSpeed = CMManager::ECmSpeed9600;
-                			else if( lineSpeed == 14400 )
-                				param->iBearerSpeed = CMManager::ECmSpeed14400;
-                			else if( lineSpeed == 19200 )
-                				param->iBearerSpeed = CMManager::ECmSpeed19200;
-                			else if( lineSpeed == 28800 )
-                				param->iBearerSpeed = CMManager::ECmSpeed28800;
-                			else if( lineSpeed == 38400 )
-                				param->iBearerSpeed = CMManager::ECmSpeed38400;
-                			else if( lineSpeed == 43200 )
-                				param->iBearerSpeed = CMManager::ECmSpeed43200;
-                			else if( lineSpeed == 56000 )
-                				param->iBearerSpeed = CMManager::ECmSpeed56000;
-                			}                			
-                		}
-                	}
-                else if( elemName == Kuseproxy )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomUseProxyL(*iEngine);
-                		}
-                	else
-                		{
-                		param->iUseProxy = ConvertStrToBooleanL(elemContent);
-                		}
-                	}
-                else if( elemName == Kproxyserveraddress )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomProxyAddressL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iProxyServerAddress, elemContent);                		
-                		}
-                	}
-                else if( elemName == Kproxyportnumber )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomProxyPortL(*iEngine);
-                		}
-                	else
-                		{
-                		param->iProxyPortNumber = ConvertStrToUintL(elemContent);                		
-                		}
-                	}
-                else if( elemName == Kip6nameserver1 )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomIPv6NameServer1L(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iIP6NameServer1, elemContent);               		                		
-                		}
-                	}
-                else if( elemName == Kip6nameserver2 )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomIPv6NameServer2L(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iIP6NameServer2, elemContent);               		                		
-                		}
-                	}
-                else if( elemName == Kdisabletextauth )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomDisableTextAuthL(*iEngine);
-                		}
-                	else
-                		{
-                		param->iDisableTextAuth = ConvertStrToBooleanL(elemContent);
-                		}
-                	}
-                else if( elemName == Kwlanname )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomWLANNameL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iWLANName, elemContent);               		                		
-                		}
-                	}
-                else if( elemName == Kwlanipaddr )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomWlanIpAddrL(*iEngine);
-                		}
-                	else
-                		{
-                		SetContentToTextParamL(param->iWlanIpAddr, elemContent);               		                		
-                		}
-                	}
-                else if( elemName == Kwlansecmode )
-                	{
-                	if( useRandom )
-                		{
-                		param->SetRandomWLANSecurityModeL(*iEngine);
-                		}
-                	else
-                		{
-                		if( CompareIgnoreCase(elemContent, Kopen) == 0)
-                			param->iWLanSecMode = CMManager::EWlanSecModeOpen;
-                		else if( CompareIgnoreCase(elemContent, Kwep) == 0 )
-                			param->iWLanSecMode = CMManager::EWlanSecModeWep;
-                		else if( CompareIgnoreCase(elemContent, Ke802_1x) == 0 )
-                			param->iWLanSecMode = CMManager::EWlanSecMode802_1x;
-                		else if( CompareIgnoreCase(elemContent, Kwpa) == 0 )
-                			param->iWLanSecMode = CMManager::EWlanSecModeWpa;
-                		else if( CompareIgnoreCase(elemContent, Kwpa2) == 0 )
-                			param->iWLanSecMode = CMManager::EWlanSecModeWpa2;                		               		                		
-                		}
-                	}
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	// No fields defined so add random entries:
-    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, 0, cmAmount);
-    	}
-    }
-#else
-void CCreatorConnectionMethodElement::ExecuteCommandL()
-	{
-	const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-	TInt cmAmount = 1;    
-	if( amountAttr )
-		{
-		cmAmount = ConvertStrToIntL(amountAttr->Value());
-		}
-	// Get 'fields' element 
-	CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-	if( fieldsElement )
-		{
-		// Get sub-elements
-		const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-		// Create connection method entries, the amount of entries is defined by cmAmount:
-		for( TInt cI = 0; cI < cmAmount; ++cI )
-			{            
-			CAccessPointsParameters* param = new (ELeave) CAccessPointsParameters;
-			CleanupStack::PushL(param);
-
-			for( TInt i = 0; i < fields.Count(); ++i )
-				{
-				CCreatorScriptElement* field = fields[i];
-				TPtrC elemName = field->Name();
-				TPtrC elemContent = field->Content();
-				const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-				TBool useRandom = EFalse;
-				if( randomAttr || elemContent.Length() == 0 )
-					{
-					useRandom = ETrue;
-					}
-
-				if( elemName == Kconnectionname )
-					{
-					if( useRandom )
-						{
-						param->SetRandomCMNameL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iConnectionName, elemContent);
-                        // reserve extra space for possible renaming
-                        TInt newLen = param->iConnectionName->Length() + KExtraSpace;
-                        param->iConnectionName = param->iConnectionName->ReAllocL(newLen);
-
-                        SetContentToTextParamL(param->iGprsAcessPointName, elemContent);
-						}
-					}
-				else if( elemName == Kstartpage )
-					{
-					if( useRandom )
-						{
-						param->SetRandomStartPageL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iWapStartPage, elemContent);
-						}
-					}
-				else if( elemName == Kwapwspoption )
-					{
-					if( useRandom )
-						{
-						param->SetRandomWapWspOptionL(*iEngine);
-						}
-					else
-						{
-						if( CompareIgnoreCase(elemContent, Kconnectionless) == 0 )
-							{
-							param->iWapWspOption = EWapWspOptionConnectionless;
-							}
-						else if( CompareIgnoreCase(elemContent, Kconnectionoriented) == 0 )
-							{
-							param->iWapWspOption = EWapWspOptionConnectionOriented;
-							}
-						}
-					}
-				else if( elemName == Kloginname )
-					{
-					if( useRandom )
-						{
-						param->SetRandomLoginNameL(*iEngine);                		
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspLoginName, elemContent);
-						}
-					}
-				else if( elemName == Ksecureauthentication )
-					{
-					if( useRandom )
-						{
-						param->SetRandomSecureAuthenticationL(*iEngine);
-						}
-					else
-						{
-						param->iSecureAuthentication = ConvertStrToBooleanL(elemContent);
-						}
-					}
-				else if( elemName == Kloginpass )
-					{
-					if( useRandom )
-						{
-						param->SetRandomLoginPassL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspLoginPass, elemContent);
-						}
-					}
-				else if( elemName == Kpromptpassword )
-					{
-					if( useRandom )
-						{
-						param->SetRandomPromptPasswordL(*iEngine);
-						}
-					else
-						{
-						param->iPromptPassword = ConvertStrToBooleanL(elemContent);
-						}
-					}
-				else if( elemName == Kgatewayaddress )
-					{
-					if( useRandom )
-						{
-						param->SetRandomGatewayAddressL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iWapGatewayAddress, elemContent);
-						}
-					}
-				else if( elemName == Kdeviceipaddr )
-					{
-					if( useRandom )
-						{
-						param->SetRandomIPAddressL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspIPAddr, elemContent);
-						}
-					}
-				else if( elemName == Kip4nameserver1 )
-					{
-					if( useRandom )
-						{
-						param->SetRandomIP4NameServer1L(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspIPNameServer1, elemContent);
-						}
-					}
-				else if( elemName == Kip4nameserver2 )
-					{
-					if( useRandom )
-						{
-						param->SetRandomIP4NameServer2L(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspIPNameServer2, elemContent);
-						}
-					}
-				else if( elemName == Kdatacalltelnumber )
-					{
-					if( useRandom )
-						{
-						param->SetRandomTelephoneNumberL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iIspDefaultTelNumber, elemContent);
-						}
-					}
-				else if( elemName == Kdatacalltypeisdn )
-					{
-					if( useRandom )
-						{
-						param->SetRandomBearerTypeIsdnL(*iEngine);
-						}
-					else
-						{
-						if( CompareIgnoreCase(elemContent, Kanalogue) == 0 )
-							param->iIspBearerCallTypeIsdn = ECallTypeAnalogue;
-						else if( CompareIgnoreCase( elemContent, Kisdnv110) == 0 )
-							param->iIspBearerCallTypeIsdn = ECallTypeISDNv110;
-						else if( CompareIgnoreCase( elemContent, Kisdnv120) == 0 )
-							param->iIspBearerCallTypeIsdn = ECallTypeISDNv120;
-						}
-					}
-				else if( elemName == Kbearertype )
-					{
-					if( useRandom )
-						{
-						param->iBearerType = EApBearerTypeGPRS;
-						}
-					else
-						{
-						if( CompareIgnoreCase(elemContent, Kwlan) == 0 )
-							{
-							param->iBearerType = EApBearerTypeWLAN;
-							}
-						else if( CompareIgnoreCase(elemContent, Kgprs) == 0 )
-							{
-							param->iBearerType = EApBearerTypeGPRS;
-							}
-						else if( CompareIgnoreCase(elemContent, Kdatacall) == 0 )
-							{
-							param->iBearerType = EApBearerTypeCSD;
-							}
-						else if( CompareIgnoreCase(elemContent, Khsgsm) == 0 )
-							{
-							param->iBearerType = EApBearerTypeHSCSD;
-							}
-						else if( CompareIgnoreCase(elemContent, Klan) == 0 )
-							{
-							param->iBearerType = EApBearerTypeLAN;
-							}
-						}
-					}
-				else if( elemName == Kdatacalllinespeed )
-					{
-					if( useRandom )
-						{
-						param->SetRandomBearerSpeedL(*iEngine);
-						}
-					else
-						{
-						if( CompareIgnoreCase(elemContent, Kautomatic) == 0 )
-							{                			 
-							param->iIspBearerSpeed = KSpeedAutobaud;
-							}
-						else
-							{
-							TUint lineSpeed = ConvertStrToUintL(elemContent);
-							if( lineSpeed == 9600 )
-								param->iIspBearerSpeed = KSpeed9600;
-							else if( lineSpeed == 14400 )
-								param->iIspBearerSpeed = KSpeed14400;
-							else if( lineSpeed == 19200 )
-								param->iIspBearerSpeed = KSpeed19200;
-							else if( lineSpeed == 28800 )
-								param->iIspBearerSpeed = KSpeed28800;
-							else if( lineSpeed == 38400 )
-								param->iIspBearerSpeed = KSpeed38400;
-							else if( lineSpeed == 43200 )
-								param->iIspBearerSpeed = KSpeed43200;
-							else if( lineSpeed == 56000 )
-								param->iIspBearerSpeed = KSpeed56000;
-							}                			
-						}
-					}
-				else if( elemName == Kproxyserveraddress )
-					{
-					if( useRandom )
-						{
-						param->SetRandomProxyAddressL(*iEngine);
-						}
-					else
-						{
-						SetContentToTextParamL(param->iProxyServerAddress, elemContent);                		
-						}
-					}
-				else if( elemName == Kproxyportnumber )
-					{
-					if( useRandom )
-						{
-						param->SetRandomProxyPortL(*iEngine);
-						}
-					else
-						{
-						param->iProxyPortNumber = ConvertStrToUintL(elemContent);                		
-						}
-					}
-				}
-			iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, param);
-			CleanupStack::Pop(); // param
-			}
-		}
-	}
-#endif
--- a/creator/src/creator_contactelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,472 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_contactelement.h"
-#include "creator_traces.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include "creator_virtualphonebook.h"
-#endif
-#include "creator_factory.h"
-#include "creator_contactsetcache.h"
-#include <xml/documentparameters.h>
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include "VPbkEng.rsg"
-#endif
-
-using namespace Xml;
-using namespace creatorcontact;
-
-/**
- * Contact field element mappings:
- */
-enum TContactFieldDataType
-    {
-    EDataTypeText,
-    EDataTypeBinary,
-    EDataTypeDateTime    
-    };
-    
-class FieldMapping
-{
-public:
-    TPtrC iElementName;
-    TInt  iFieldCode;
-    TContactFieldDataType iDataType;
-};
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-FieldMapping fieldMappingTbl[] = {
-       {TPtrC(KFirstname), R_VPBK_FIELD_TYPE_FIRSTNAME, EDataTypeText},
-       {TPtrC(KLastname), R_VPBK_FIELD_TYPE_LASTNAME, EDataTypeText},
-       {TPtrC(KFirstnameReading), R_VPBK_FIELD_TYPE_FIRSTNAMEREADING, EDataTypeText},
-       {TPtrC(KLastnameReading), R_VPBK_FIELD_TYPE_LASTNAMEREADING, EDataTypeText},
-       {TPtrC(KPrefix), R_VPBK_FIELD_TYPE_PREFIX, EDataTypeText},
-       {TPtrC(KSuffix), R_VPBK_FIELD_TYPE_SUFFIX, EDataTypeText},
-       {TPtrC(KSecondname), R_VPBK_FIELD_TYPE_SECONDNAME, EDataTypeText},
-       {TPtrC(KLandphoneHome), R_VPBK_FIELD_TYPE_LANDPHONEHOME, EDataTypeText},
-       
-       {TPtrC(KMobilephoneHome), R_VPBK_FIELD_TYPE_MOBILEPHONEHOME, EDataTypeText},
-       {TPtrC(KVideonumberHome), R_VPBK_FIELD_TYPE_VIDEONUMBERHOME, EDataTypeText},
-       {TPtrC(KFaxnumberHome), R_VPBK_FIELD_TYPE_FAXNUMBERHOME, EDataTypeText},
-       {TPtrC(KVoipHome), R_VPBK_FIELD_TYPE_VOIPHOME, EDataTypeText},
-       {TPtrC(KEmailHome), R_VPBK_FIELD_TYPE_EMAILHOME, EDataTypeText},
-       {TPtrC(KUrlHome), R_VPBK_FIELD_TYPE_URLHOME, EDataTypeText},
-       {TPtrC(KAddrlabelHome), R_VPBK_FIELD_TYPE_ADDRLABELHOME, EDataTypeText},
-       {TPtrC(KAddrpoHome), R_VPBK_FIELD_TYPE_ADDRPOHOME, EDataTypeText},
-       
-       {TPtrC(KAddrextHome), R_VPBK_FIELD_TYPE_ADDREXTHOME, EDataTypeText},
-       {TPtrC(KAddrstreetHome), R_VPBK_FIELD_TYPE_ADDRSTREETHOME, EDataTypeText},
-       {TPtrC(KAddrlocalHome), R_VPBK_FIELD_TYPE_ADDRLOCALHOME, EDataTypeText},
-       {TPtrC(KAddrregionHome), R_VPBK_FIELD_TYPE_ADDRREGIONHOME, EDataTypeText},
-       {TPtrC(KAddrpostcodeHome), R_VPBK_FIELD_TYPE_ADDRPOSTCODEHOME, EDataTypeText},
-       {TPtrC(KAddrcountryHome), R_VPBK_FIELD_TYPE_ADDRCOUNTRYHOME, EDataTypeText},
-       {TPtrC(KJobtitle), R_VPBK_FIELD_TYPE_JOBTITLE, EDataTypeText},
-       {TPtrC(KCompanyname), R_VPBK_FIELD_TYPE_COMPANYNAME, EDataTypeText},
-       
-       {TPtrC(KLandphoneWork), R_VPBK_FIELD_TYPE_LANDPHONEWORK, EDataTypeText},
-       {TPtrC(KMobilephoneWork), R_VPBK_FIELD_TYPE_MOBILEPHONEWORK, EDataTypeText},
-       {TPtrC(KVideonumberWork), R_VPBK_FIELD_TYPE_VIDEONUMBERWORK, EDataTypeText},
-       {TPtrC(KFaxnumberWork), R_VPBK_FIELD_TYPE_FAXNUMBERWORK, EDataTypeText},
-       {TPtrC(KVoipWork), R_VPBK_FIELD_TYPE_VOIPWORK, EDataTypeText},
-       {TPtrC(KEmailWork), R_VPBK_FIELD_TYPE_EMAILWORK, EDataTypeText},
-       {TPtrC(KUrlWork), R_VPBK_FIELD_TYPE_URLWORK, EDataTypeText},
-       {TPtrC(KAddrlabelWork), R_VPBK_FIELD_TYPE_ADDRLABELWORK, EDataTypeText},
-       
-       {TPtrC(KAddrpoWork), R_VPBK_FIELD_TYPE_ADDRPOWORK, EDataTypeText},
-       {TPtrC(KAddrextWork), R_VPBK_FIELD_TYPE_ADDREXTWORK, EDataTypeText},
-       {TPtrC(KAddrstreetWork), R_VPBK_FIELD_TYPE_ADDRSTREETWORK, EDataTypeText},
-       {TPtrC(KAddrlocalWork), R_VPBK_FIELD_TYPE_ADDRLOCALWORK, EDataTypeText},
-       {TPtrC(KAddrregionWork), R_VPBK_FIELD_TYPE_ADDRREGIONWORK, EDataTypeText},
-       {TPtrC(KAddrpostcodeWork), R_VPBK_FIELD_TYPE_ADDRPOSTCODEWORK, EDataTypeText},
-       {TPtrC(KAddrcountryWork), R_VPBK_FIELD_TYPE_ADDRCOUNTRYWORK, EDataTypeText},
-       {TPtrC(KLandphoneGen), R_VPBK_FIELD_TYPE_LANDPHONEGEN, EDataTypeText},
-       
-       {TPtrC(KMobilephoneGen), R_VPBK_FIELD_TYPE_MOBILEPHONEGEN, EDataTypeText},
-       {TPtrC(KVideonumberGen), R_VPBK_FIELD_TYPE_VIDEONUMBERGEN, EDataTypeText},
-       {TPtrC(KFaxnumberGen), R_VPBK_FIELD_TYPE_FAXNUMBERGEN, EDataTypeText},
-       {TPtrC(KVoipGen), R_VPBK_FIELD_TYPE_VOIPGEN, EDataTypeText},
-       {TPtrC(KPoc), R_VPBK_FIELD_TYPE_POC, EDataTypeText},
-       {TPtrC(KSwis), R_VPBK_FIELD_TYPE_SWIS, EDataTypeText},
-       {TPtrC(KSip), R_VPBK_FIELD_TYPE_SIP, EDataTypeText},
-       {TPtrC(KEmailGen), R_VPBK_FIELD_TYPE_EMAILGEN, EDataTypeText},
-       
-       {TPtrC(KUrlGen), R_VPBK_FIELD_TYPE_URLGEN, EDataTypeText},
-       {TPtrC(KAddrlabelGen), R_VPBK_FIELD_TYPE_ADDRLABELGEN, EDataTypeText},
-       {TPtrC(KAddrpoGen), R_VPBK_FIELD_TYPE_ADDRPOGEN, EDataTypeText},
-       {TPtrC(KAddrextGen), R_VPBK_FIELD_TYPE_ADDREXTGEN, EDataTypeText},
-       {TPtrC(KAddrstreetGen), R_VPBK_FIELD_TYPE_ADDRSTREETGEN, EDataTypeText},
-       {TPtrC(KAddrlocalGen), R_VPBK_FIELD_TYPE_ADDRLOCALGEN, EDataTypeText},
-       {TPtrC(KAddrregionGen), R_VPBK_FIELD_TYPE_ADDRREGIONGEN, EDataTypeText},
-       {TPtrC(KAddrpostcodeGen), R_VPBK_FIELD_TYPE_ADDRPOSTCODEGEN, EDataTypeText},
-       
-       {TPtrC(KAddrcountryGen), R_VPBK_FIELD_TYPE_ADDRCOUNTRYGEN, EDataTypeText},
-       {TPtrC(KPagerNumber), R_VPBK_FIELD_TYPE_PAGERNUMBER, EDataTypeText},
-       {TPtrC(KDtmfString), R_VPBK_FIELD_TYPE_DTMFSTRING, EDataTypeText},
-       {TPtrC(KWvAddress), R_VPBK_FIELD_TYPE_WVADDRESS, EDataTypeText},
-       {TPtrC(KDate), R_VPBK_FIELD_TYPE_DATE, EDataTypeDateTime},
-       {TPtrC(KNote), R_VPBK_FIELD_TYPE_NOTE, EDataTypeText},
-       {TPtrC(KThumbnailPath), R_VPBK_FIELD_TYPE_THUMBNAILPIC, EDataTypeText},
-       {TPtrC(KThumbnailId), R_VPBK_FIELD_TYPE_THUMBNAILPIC, EDataTypeText},
-       {TPtrC(KRingTone), R_VPBK_FIELD_TYPE_RINGTONE, EDataTypeText},
-       {TPtrC(KRingToneId), R_VPBK_FIELD_TYPE_RINGTONE, EDataTypeText},
-       
-       {TPtrC(KCallerobjImg), R_VPBK_FIELD_TYPE_CALLEROBJIMG, EDataTypeText},
-       {TPtrC(KCallerobjText), R_VPBK_FIELD_TYPE_CALLEROBJTEXT, EDataTypeText},
-       {TPtrC(KMiddlename), R_VPBK_FIELD_TYPE_MIDDLENAME, EDataTypeText},
-       {TPtrC(KDepartment), R_VPBK_FIELD_TYPE_DEPARTMENT, EDataTypeText},
-       {TPtrC(KAsstname), R_VPBK_FIELD_TYPE_ASSTNAME, EDataTypeText},
-       {TPtrC(KSpouse), R_VPBK_FIELD_TYPE_SPOUSE, EDataTypeText},
-       {TPtrC(KChildren), R_VPBK_FIELD_TYPE_CHILDREN, EDataTypeText},
-       {TPtrC(KAsstphone), R_VPBK_FIELD_TYPE_ASSTPHONE, EDataTypeText},
-       
-       {TPtrC(KCarphone), R_VPBK_FIELD_TYPE_CARPHONE, EDataTypeText},
-       {TPtrC(KAnniversary), R_VPBK_FIELD_TYPE_ANNIVERSARY, EDataTypeDateTime},
-       {TPtrC(KSyncclass), R_VPBK_FIELD_TYPE_SYNCCLASS, EDataTypeText},
-       {TPtrC(KLocPrivacy), R_VPBK_FIELD_TYPE_LOCPRIVACY, EDataTypeText},
-       {TPtrC(KGenlabel), R_VPBK_FIELD_TYPE_GENLABEL, EDataTypeText}
-};
-#endif 
-
-CCreatorContactElementBase* CCreatorContactElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    LOGSTRING("Creator: CCreatorContactElementBase::NewL");
-    CCreatorContactElementBase* self = new (ELeave) CCreatorContactElementBase(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorContactElementBase::CCreatorContactElementBase(CCreatorEngine* aEngine) : CCreatorScriptElement(aEngine)
-    { }
-
-CCreatorContactElement* CCreatorContactElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    LOGSTRING("Creator: CCreatorContactElement::NewL");
-    CCreatorContactElement* self = new (ELeave) CCreatorContactElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorContactElement::CCreatorContactElement(CCreatorEngine* aEngine) 
-: 
-CCreatorContactElementBase(aEngine)
-    { 
-    iIsCommandElement = ETrue;
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-void CCreatorContactElement::ExecuteCommandL()
-    {    
-    LOGSTRING("Creator: CCreatorContactElement::ExecuteCommandL");
-    // Find out how many contacts should we create:
-    const CCreatorScriptAttribute* contactAmountAttr = this->FindAttributeByName(KAmount);    
-    TInt contactAmount = 1;    
-    if( contactAmountAttr )
-        {
-        contactAmount = ConvertStrToIntL(contactAmountAttr->Value());
-        }
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    TInt fieldMappingTblSize = sizeof(fieldMappingTbl)/sizeof(FieldMapping);
-    for( TInt cI = 0; cI < contactAmount; ++cI )
-        {
-        CVirtualPhonebookParameters* param = (CVirtualPhonebookParameters*) TCreatorFactory::CreatePhoneBookParametersL();
-        CleanupStack::PushL(param);
-        // Loop all the field elements
-        if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-            {
-            
-            const RPointerArray<CCreatorScriptElement>& fieldList = fieldsElement->SubElements();
-            
-            if( fieldList.Count() == 0 )
-                {
-                
-                }
-            for( TInt i = 0; i < fieldList.Count(); ++i )
-                {
-                TPtrC fieldName = fieldList[i]->Name();
-                const CCreatorScriptAttribute* amountAttr = fieldList[i]->FindAttributeByName(KAmount);
-                const CCreatorScriptAttribute* rndLenAttr = fieldList[i]->FindAttributeByName(KRandomLength);
-                const CCreatorScriptAttribute* increaseAttr = fieldList[i]->FindAttributeByName(KIncrease);
-                TBool increase( EFalse );
-                if ( increaseAttr )
-                    {
-                    increase = ConvertStrToBooleanL( increaseAttr->Value() );
-                    }
-                CCreatorContactField* field = 0;
-                for( TInt j = 0; j < fieldMappingTblSize; ++j )
-                    {
-                    const FieldMapping& mapping = fieldMappingTbl[j];
-                    if( fieldName == mapping.iElementName )
-                        {
-                        TInt rndLen = 0;
-                        TPtrC content = fieldList[i]->Content();
-                                                                        
-                        MCreatorRandomDataField::TRandomLengthType randomLenType = MCreatorRandomDataField::ERandomLengthUndefined;
-                    
-                        if( content == TPtrC(KEmpty) || content == TPtrC(KNullDesC) )
-                            {
-                            if( rndLenAttr == 0 )
-                                {
-                                randomLenType = MCreatorRandomDataField::ERandomLengthDefault;
-                                }
-                            else
-                                {
-                                randomLenType = ResolveRandomDataTypeL(*rndLenAttr, rndLen);
-                                }
-                            }
-                        else
-                            {
-                            // Special handling for file id content:
-                            if( fieldName == KThumbnailId )
-                                {
-                                // Thumbnail data is copied to the contact entry, so we can use temporary file:
-                                CCreatorEngine::TTestDataPath id = (CCreatorEngine::TTestDataPath) iEngine->GetAttachmentIdL(content);
-                                content.Set(iEngine->TestDataPathL(id));
-                                }
-                            else if( fieldName == KRingToneId )
-                            	{
-                            	// Contact entry contains just a link to the sound file, so we must 
-                            	// copy the temporary file to a permanent location:
-                            	CCreatorEngine::TTestDataPath id = (CCreatorEngine::TTestDataPath) iEngine->GetAttachmentIdL(content);
-                            	TPtrC fullTargetPath(iEngine->CreateSoundFileL(id));                           	
-                            	content.Set(fullTargetPath);
-                            	}
-                            }
-                        TInt amountValue = 1;
-                        if( amountAttr )
-                            {                        
-                            amountValue = ConvertStrToIntL(amountAttr->Value());
-                            }
-                        for( TInt k = 0; k < amountValue; ++k )
-                            {
-                            if ( increase &&
-                                 ( fieldName.FindF( _L("number") ) > KErrNotFound ||
-                                 fieldName.FindF( _L("phone") ) > KErrNotFound ) )
-                                {
-                                // increase phonenumber for each copy
-                                HBufC* incNum = HBufC::NewLC( content.Length() + 3 );
-                                if ( amountValue > 1 )
-                                    {
-                                    // amount defined in number field level
-                                    IncreasePhoneNumL( content, k, incNum );
-                                    }
-                                else
-                                    {
-                                    // amount defined in contact field level
-                                    IncreasePhoneNumL( content, cI, incNum );
-                                    }
-                                field = CCreatorContactField::NewL( mapping.iFieldCode, *incNum );
-                                CleanupStack::PushL( field );
-                                field->SetRandomParametersL( randomLenType, rndLen );
-                                param->iContactFields.AppendL( field );
-                                CleanupStack::Pop( field );
-                                CleanupStack::PopAndDestroy( incNum );
-                                }
-                            else
-                                {
-                                field = CCreatorContactField::NewL(mapping.iFieldCode, content);
-                                CleanupStack::PushL(field);
-                                field->SetRandomParametersL(randomLenType, rndLen);
-                                param->iContactFields.AppendL(field);
-                                CleanupStack::Pop(field);                                
-                                }
-                            }
-                        break;
-                        }
-                    }
-                }
-            } 
-        else
-        	{
-        	// No fields specified, so add all fields with random content:
-        	for( TInt i = 0; i < fieldMappingTblSize; ++i )
-        		{
-        		if( fieldMappingTbl[i].iElementName == KThumbnailId || 
-        			fieldMappingTbl[i].iElementName == KRingToneId )
-        			{
-        			// Skip thumbnail and ringtone IDs, since they are duplicates with thumbnailpath and ringtonepath
-        			continue;
-        			}
-        		CCreatorContactField* field = 0;
-        		if(fieldMappingTbl[i].iDataType == EDataTypeText )
-        			{
-        			field = CCreatorContactField::NewL(fieldMappingTbl[i].iFieldCode, KNullDesC);
-        			}
-        		else if( fieldMappingTbl[i].iDataType == EDataTypeBinary )
-        			{
-        			field = CCreatorContactField::NewL(fieldMappingTbl[i].iFieldCode, KNullDesC8);
-        			}
-        		else if( fieldMappingTbl[i].iDataType == EDataTypeDateTime )
-        			{                    	
-        			TDateTime dateTime(Time::NullTTime().DateTime());
-        			field = CCreatorContactField::NewL(fieldMappingTbl[i].iFieldCode, dateTime);
-        			}
-        		if( field )
-        			{
-        			CleanupStack::PushL(field);
-        			field->SetRandomParametersL(MCreatorRandomDataField::ERandomLengthDefault, 0);
-        			param->iContactFields.AppendL(field);
-        			CleanupStack::Pop(field);
-        			}
-        		}
-        	}
-        iEngine->AppendToCommandArrayL(ECmdCreatePhoneBookEntryContacts, param);
-        iParameters.AppendL(param); // Save the pointer to the parametes. 
-        CleanupStack::Pop(param);
-        }
-    }
-#else
-void CCreatorContactElement::ExecuteCommandL()
-    {}
-#endif
-
-CCreatorContactSetElement* CCreatorContactSetElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    LOGSTRING("Creator: CCreatorContactSetElement::NewL");
-    CCreatorContactSetElement* self = new (ELeave) CCreatorContactSetElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorContactSetElement::CCreatorContactSetElement(CCreatorEngine* aEngine) 
-: 
-CCreatorContactElementBase(aEngine)
-    { }
-
-void CCreatorContactSetElement::ExecuteCommandL()
-    { }
-
-void CCreatorContactSetElement::AddToCacheL()
-    {    
-    LOGSTRING("Creator: CCreatorContactSetElement::AddToCacheL");
-    const CCreatorScriptAttribute* linkIdAttr = this->FindAttributeByName(KId);
-    const CCreatorScriptAttribute* existingElemsAttr = this->FindAttributeByName(KExistingContacts);
-    TInt numOfExistingContacts = 0;
-    if( existingElemsAttr )
-        {
-        numOfExistingContacts = ConvertStrToIntL(existingElemsAttr->Value());
-        }
-    if( linkIdAttr )
-        {
-        TInt linkId = ConvertStrToIntL(linkIdAttr->Value());
-        if( linkId > 0 )
-            {    
-            CCreatorContactSet* newSet = CCreatorContactSet::NewL(linkId, numOfExistingContacts);
-            CleanupStack::PushL(newSet);
-            ContactLinkCache::Instance()->AppendL(newSet);
-            CleanupStack::Pop(newSet);
-                 
-            // Mark sub-elements (i.e. contacts) to this contact-set:
-            for( TInt i = 0; i < iSubElements.Count(); ++i )
-                {
-                for( TInt j = 0; j < iSubElements[i]->CommandParameters().Count(); ++j)
-                    {
-                    CCreatorModuleBaseParameters* params = iSubElements[i]->CommandParameters()[j];
-                    if( params )
-                        {
-                        params->SetScriptLinkId(linkId);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-CCreatorContactGroupElement* CCreatorContactGroupElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    LOGSTRING("Creator: CCreatorContactGroupElement::NewL");
-    CCreatorContactGroupElement* self = new (ELeave) CCreatorContactGroupElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorContactGroupElement::CCreatorContactGroupElement(CCreatorEngine* aEngine)
-: 
-CCreatorContactElementBase(aEngine)
-    { 
-    iIsCommandElement = ETrue;
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-void CCreatorContactGroupElement::ExecuteCommandL()
-    {
-    LOGSTRING("Creator: CCreatorContactGroupElement::ExecuteCommandL");
-    // Get attributes (amount and name)
-    const CCreatorScriptAttribute* groupAmountAttr = this->FindAttributeByName(KAmount);        
-    const CCreatorScriptAttribute* groupNameAttr = this->FindAttributeByName(KName);
-    // How many groups to create:
-    TInt groupAmount = 1;        
-    if( groupAmountAttr )
-        {
-        groupAmount = ConvertStrToIntL(groupAmountAttr->Value());
-        }
-    
-    for( TInt i = 0; i < groupAmount; ++i )
-        {        
-        CCreatorScriptElement* membersElement = FindSubElement(KMembers);
-        
-        if( membersElement )
-            {    
-            CVirtualPhonebookParameters* param = (CVirtualPhonebookParameters*) TCreatorFactory::CreatePhoneBookParametersL();            
-            CleanupStack::PushL(param);
-            
-            // Links to contact-sets:
-            const RPointerArray<CCreatorScriptElement>& linkList = membersElement->SubElements();
-            if( linkList.Count() > 0 )
-                {
-                for( TInt i = 0; i < linkList.Count(); ++i )
-                    {
-                    AppendContactSetReferenceL(*linkList[i], param->iLinkIds);
-                    }                
-                }
-            
-            if( groupNameAttr )
-                {
-                param->iGroupName->Des().Copy( groupNameAttr->Value() );
-                }
-            else
-                {
-                param->iGroupName->Des().Copy( iEngine->RandomString(CCreatorEngine::EGroupName) );
-                }                
-            iEngine->AppendToCommandArrayL(ECmdCreatePhoneBookEntryGroups, param);
-            CleanupStack::Pop(param);
-            }
-        }
-    }
-#else
-void CCreatorContactGroupElement::ExecuteCommandL()
-    {}
-#endif
-
-CCreatorContactFieldElement* CCreatorContactFieldElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    LOGSTRING("Creator: CCreatorContactFieldElement::NewL");
-    CCreatorContactFieldElement* self = new (ELeave) CCreatorContactFieldElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-
-CCreatorContactFieldElement::CCreatorContactFieldElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    { }
--- a/creator/src/creator_contactsetcache.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_contactsetcache.h"
-
-
-CContactLinkCacheImp* ContactLinkCache::iImp = 0;
-
-CCreatorContactSet* CCreatorContactSet::NewL(TInt aLinkId, TInt aNumOfExistingContacts)
-    {
-    return new (ELeave) CCreatorContactSet(aLinkId, aNumOfExistingContacts);    
-    }
-
-TInt CCreatorContactSet::LinkId() const
-    {
-    return iLinkId;
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-void CCreatorContactSet::AppendL(MVPbkContactLink* aContactLink)
-    {
-    iContactLinks.AppendL(aContactLink);
-    }
-
-RPointerArray<MVPbkContactLink>& CCreatorContactSet::ContactLinks()
-    {
-    return iContactLinks;
-    }
-
-const RPointerArray<MVPbkContactLink>& CCreatorContactSet::ContactLinks() const
-    {
-    return iContactLinks;
-    }
-
-
-TInt CCreatorContactSet::NumberOfExistingContacts() const
-    {
-    return iNumOfExistingContacts;
-    }
-
-CCreatorContactSet::~CCreatorContactSet()
-    {
-    iContactLinks.Reset();
-    iContactLinks.Close();
-    }
-
-#else
-CCreatorContactSet::~CCreatorContactSet()
-    {
-    }
-#endif
-
-
-CCreatorContactSet::CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts)
-    {
-    iLinkId = aLinkId;
-    iNumOfExistingContacts = aNumOfExistingContacts;
-    }
-
-class CContactLinkCacheImp : public CBase, public MContactLinkCache
-{
-public:
-    static CContactLinkCacheImp* NewL();
-    virtual ~CContactLinkCacheImp();
-    virtual void AppendL(CCreatorContactSet* aContactSet);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    virtual RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId);
-    virtual const RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) const;
-#endif        
-    virtual RPointerArray<CCreatorContactSet>& ContactSets();
-    virtual const RPointerArray<CCreatorContactSet>& ContactSets() const;
-    virtual const CCreatorContactSet& ContactSet(TInt aLinkId) const;
-    virtual CCreatorContactSet& ContactSet(TInt aLinkId);
-    
-private:
-    void ConstructL();
-    CContactLinkCacheImp();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)    
-    RPointerArray<MVPbkContactLink> iEmptyLinks;
-#endif    
-    RPointerArray<CCreatorContactSet> iContactSets;
-    CCreatorContactSet* iDummyContactSet;
-};
-
-CContactLinkCacheImp* CContactLinkCacheImp::NewL()
-    {
-    CContactLinkCacheImp* self = new (ELeave) CContactLinkCacheImp();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-void CContactLinkCacheImp::ConstructL()
-    {
-    if( iDummyContactSet == 0 )
-        iDummyContactSet = CCreatorContactSet::NewL(-1, 0);    
-    }
-
-CContactLinkCacheImp::CContactLinkCacheImp()
-: iDummyContactSet(0)
-    {}
-
-CContactLinkCacheImp::~CContactLinkCacheImp()
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)    
-    iEmptyLinks.ResetAndDestroy(); // just in case...
-    iEmptyLinks.Close();
-#endif
-    iContactSets.ResetAndDestroy();
-    iContactSets.Close();
-    delete iDummyContactSet;
-    }
-void CContactLinkCacheImp::AppendL(CCreatorContactSet* aContactSet)
-    {
-    iContactSets.AppendL(aContactSet);
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-
-RPointerArray<MVPbkContactLink>& CContactLinkCacheImp::ContactLinks(TInt aLinkId)
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return iContactSets[i]->ContactLinks();
-            }
-        }
-    return iEmptyLinks;
-    }
-
-const RPointerArray<MVPbkContactLink>& CContactLinkCacheImp::ContactLinks(TInt aLinkId) const
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return iContactSets[i]->ContactLinks();
-            }
-        }
-    return iEmptyLinks;
-    }
-
-#endif
-
-const CCreatorContactSet& CContactLinkCacheImp::ContactSet(TInt aLinkId) const
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return *iContactSets[i];
-            }
-        }
-        
-    return *iDummyContactSet;
-    }
-
-CCreatorContactSet& CContactLinkCacheImp::ContactSet(TInt aLinkId)
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return *iContactSets[i];
-            }
-        }
-        
-    return *iDummyContactSet;
-    }
-
-RPointerArray<CCreatorContactSet>& CContactLinkCacheImp::ContactSets()
-    {
-    return iContactSets;
-    }
-
-const RPointerArray<CCreatorContactSet>& CContactLinkCacheImp::ContactSets() const
-    {
-    return iContactSets;
-    }
-
-
-void ContactLinkCache::InitializeL()
-    {
-    if( iImp == 0 )
-        {
-        iImp = CContactLinkCacheImp::NewL();
-        }
-    }
-
-void ContactLinkCache::DestroyL()
-    {
-    delete iImp;
-    iImp = 0;
-    }
-
-MContactLinkCache* ContactLinkCache::Instance()
-    {
-    return iImp;
-    }
-
-
-    /*{
-public:
-    static void ;
-    static void DestructLD();
-    
-    static MContactLinkCache* Instance();
-    
-private:
-    CContactLinkImp* iImp;
-};*/
-
--- a/creator/src/creator_container.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <coemain.h>
-#include <aknnotewrappers.h>
-#include <creator.rsg>
-#include <AknDef.h>
-#include "creator_container.h"
-
-
-
-// Standard construction sequence
-CCreatorAppView* CCreatorAppView::NewL(const TRect& aRect)
-    {
-    CCreatorAppView* self = CCreatorAppView::NewLC(aRect);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorAppView* CCreatorAppView::NewLC(const TRect& aRect)
-    {
-    CCreatorAppView* self = new (ELeave) CCreatorAppView;
-    CleanupStack::PushL(self);
-    self->ConstructL(aRect);
-    return self;
-    }
-
-void CCreatorAppView::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();
-
-    }
-
-CCreatorAppView::CCreatorAppView()
-    {
-    // Add any construction code that can not leave here
-    }
-
-
-CCreatorAppView::~CCreatorAppView()
-    {
-    // Add any destruction code here
-    }
-
-
-// Draw this application's view to the screen
-void CCreatorAppView::Draw(const TRect& /*aRect*/) const
-    {
-
-    // Get the standard graphics context 
-    CWindowGc& gc = SystemGc();
-
-    // Gets the control's extent
-    TRect rect = Rect();
-
-    // Clears the screen
-    gc.Clear(rect);
-
-    // variables for memory and disk handling
-    TDriveNumber cDrive=EDriveC;
-    TDriveNumber dDrive=EDriveD;
-    TDriveNumber eDrive=EDriveE;
-    TVolumeInfo vinfo;
-    TBuf<16> cFree;
-    TBuf<16> dFree;
-    TBuf<16> eFree;
-    TBuf<16> cSize;
-    TBuf<16> dSize;
-    TBuf<16> eSize;
-    TBuf<64> cText;
-    TBuf<64> dText;
-    TBuf<64> eText;
-    TBuf<64> hText;
-
-    // get an access to file server
-    RFs& fsSession = ControlEnv()->FsSession();
-
-    // check the C-drive
-    fsSession.Volume(vinfo, cDrive);
-    cFree.Num(TInt64(vinfo.iFree/1024));
-    cSize.Num(TInt64(vinfo.iSize/1024));
-
-    // format the information about the C-drive
-    cText.Copy(_L("C: "));
-    cText.Append(cFree);
-    cText.Append(_L("kB of "));
-    cText.Append(cSize);
-    cText.Append(_L("kB"));
-
-
-    // the same thing for D-drive
-    fsSession.Volume(vinfo, dDrive);
-    dFree.Num(TInt64(vinfo.iFree/1024));
-    dSize.Num(TInt64(vinfo.iSize/1024));
-
-    dText.Copy(_L("D: "));
-    dText.Append(dFree);
-    dText.Append(_L("kB of "));
-    dText.Append(dSize);
-    dText.Append(_L("kB"));
-
-
-    // the same thing for E-drive (MMC), if it exists 
-    if (MMC_OK())
-        {
-        fsSession.Volume(vinfo, eDrive);
-        eFree.Num(TInt64(vinfo.iFree/1024));
-        eSize.Num(TInt64(vinfo.iSize/1024));
-
-        eText.Copy(_L("E: "));
-        eText.Append(eFree);
-        eText.Append(_L("kB of "));
-        eText.Append(eSize);
-        eText.Append(_L("kB"));
-        }	
-
-
-    // available work memory
-    TMemoryInfoV1Buf memory;
-    UserHal::MemoryInfo(memory);
-    TInt64 freeMemBytes=(TInt64)(memory().iFreeRamInBytes);
-    TInt64 sizeMemBytes=(TInt64)(memory().iTotalRamInBytes);
-
-    /// ...
-    TInt64 sizeWorkMemBytes = sizeMemBytes; 
-
-
-    TBuf<16> freeMem;
-    TBuf<16> sizeWorkMem;
-
-    freeMem.Num(TInt64(freeMemBytes/1024));
-    sizeWorkMem.Num(TInt64(sizeWorkMemBytes/1024));
-
-    hText.Copy(freeMem);
-    hText.Append(_L("kB of "));
-    hText.Append(sizeWorkMem);
-    hText.Append(_L("kB"));
-
-
-    // draw all the texts to the screen
-    gc.UseFont(AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont));
-   
-    TSize mainPaneSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, mainPaneSize);
-    
-    TReal X_factor = TReal(mainPaneSize.iWidth) / 176;
-    TReal Y_factor = TReal(mainPaneSize.iHeight) / 144;
-
-    gc.SetPenColor(KRgbDarkBlue);
-    gc.DrawText(_L("Free RAM memory:"), TPoint(TInt(4*X_factor), TInt(15*Y_factor)));
-    gc.SetPenColor(KRgbBlack);
-    gc.DrawText(hText, TPoint(TInt(4*X_factor), TInt(30*Y_factor)));
-
-    gc.SetPenColor(KRgbDarkBlue);
-    gc.DrawText(_L("Free disk memory:"), TPoint(TInt(4*X_factor), TInt(55*Y_factor)));
-    gc.SetPenColor(KRgbBlack);
-    gc.DrawText(cText, TPoint(TInt(4*X_factor), TInt(70*Y_factor)));
-    gc.DrawText(dText, TPoint(TInt(4*X_factor), TInt(85*Y_factor)));
-
-    if (MMC_OK())
-        {
-        gc.DrawText(eText, TPoint(TInt(4*X_factor), TInt(100*Y_factor)));
-        }
-
-    }
-
-TKeyResponse CCreatorAppView::OfferKeyEventL(
-		const TKeyEvent& aKeyEvent,TEventCode aType)
-	{
-	// return the default functionality
-	return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
-	}
-
-
-TCoeInputCapabilities CCreatorAppView::InputCapabilities() const
-	{
-	// this class does not implement any 'unusual' input capabilities
-	return TCoeInputCapabilities::ENone;
-	}
-
-
-void CCreatorAppView::UserDraw() const
-	{
-	ActivateGc();
-	Draw(Rect());
-	DeactivateGc();
-	}
-
-
-
-TBool CCreatorAppView::MMC_OK() const
-	{
-	TBool MMCstatus = EFalse;
-
-	TDriveNumber eDrive=EDriveE;
-    TVolumeInfo vinfo;
-
-	// check if we can access the E-drive:
-	if ( iEikonEnv->FsSession().Volume(vinfo, eDrive) == KErrNone)
-		{
-		MMCstatus = ETrue;
-		}
-	else
-		{
-		MMCstatus = EFalse;
-		}
-
-	// returns ETrue if MMC working properly
-	return MMCstatus;
-	}
-
-
-void CCreatorAppView::HandleResourceChange(TInt aType)
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-        }
-    }
-
--- a/creator/src/creator_document.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_appui.h"
-#include "creator_document.h"
-
-
-// Standard Symbian OS construction sequence
-CCreatorDocument* CCreatorDocument::NewL(CEikApplication& aApp)
-    {
-    CCreatorDocument* self = NewLC(aApp);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorDocument* CCreatorDocument::NewLC(CEikApplication& aApp)
-    {
-    CCreatorDocument* self = new (ELeave) CCreatorDocument(aApp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-void CCreatorDocument::ConstructL()
-    {
-    // Add any construction that can leave here
-    }    
-
-CCreatorDocument::CCreatorDocument(CEikApplication& aApp) : CAknDocument(aApp) 
-    {
-    // Add any construction that can not leave here
-    }   
-
-CCreatorDocument::~CCreatorDocument()
-    {
-    // Any destruction code here
-    }
-
-CEikAppUi* CCreatorDocument::CreateAppUiL()
-    {
-    // Create the application user interface, and return a pointer to it
-    CEikAppUi* appUi = new (ELeave) CCreatorAppUi;
-    return appUi;
-    }
-
--- a/creator/src/creator_factory.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_factory.h"
-
-#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
-    #include "creator_accessPoint.h"
-#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
-    #include "creator_phonebook.h"
-    #include "creator_accessPoint.h"
-#else
-    #include "creator_virtualphonebook.h"
-    #include "creator_connectionmethod.h"
-#endif 
-
-CCreatorPhonebookBase* TCreatorFactory::CreatePhoneBookL(CCreatorEngine* aEngine)
-{
-#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
-	; //TODO return an object
-#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
-    return CCreatorPhonebook::NewL(aEngine);
-#else
-    return CCreatorVirtualPhonebook::NewL(aEngine);
-#endif 
-
-}
-
-CCreatorModuleBaseParameters* TCreatorFactory::CreatePhoneBookParametersL()
-	{
-#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
-	; //TODO return an object
-#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
-	return new(ELeave) CPhonebookParameters;
-#else
-	return new(ELeave) CVirtualPhonebookParameters;
-#endif 	
-	}
-
-CCreatorConnectionSettingsBase* TCreatorFactory::CreateConnectionSettingsL(CCreatorEngine* aEngine)
-{
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ || SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
-    return CCreatorAccessPoints::NewL(aEngine);
-#else
-    return CCreatorConnectionSettings::NewL(aEngine);    
-#endif 
-
-}
-
-CCreatorModuleBaseParameters* TCreatorFactory::CreateConnectionSettingsParametersL()
-    {
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ || SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
-    return new(ELeave) CAccessPointsParameters;
-#else
-    return new(ELeave) CConnectionSettingsParameters;
-#endif 
-    }
--- a/creator/src/creator_file.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,847 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_file.h" 
-#include <DRMRights.h>
-#include <caf/supplier.h>
-#include <caf/importfile.h>
-#include "creator_traces.h"
-
-using namespace ContentAccess;
-
-static const TInt KFilesFieldLength = 256;
-
-//_LIT(KCreatorFilesPrefixName, "CR_");
-//_LIT(KCreatorFilesPrefixFolderName, "CR_FLDR_");
-
-//----------------------------------------------------------------------------
-
-CFilesParameters::CFilesParameters()
-    {
-    LOGSTRING("Creator: CFilesParameters::CFilesParameters");
-    iFullFilePath = HBufC::New(KFilesFieldLength);
-    }
-CFilesParameters::CFilesParameters( CFilesParameters& aCopy )
-    {
-    LOGSTRING("Creator: CFilesParameters::CFilesParameters");
-    iFullFilePath = HBufC::New(KFilesFieldLength);
-    iFullFilePath->Des().Copy( *aCopy.iFullFilePath );
-    iFileCommand = aCopy.iFileCommand;
-    iEncrypt = aCopy.iEncrypt;
-    if ( aCopy.iPermission )
-        {
-        iPermission = CDRMPermission::NewL();
-        iPermission->DuplicateL( *aCopy.iPermission );
-        }
-    }
-CFilesParameters::~CFilesParameters()
-    {
-    LOGSTRING("Creator: CFilesParameters::~CFilesParameters");
-    delete iFullFilePath;
-    delete iPermission;
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorFiles* CCreatorFiles::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorFiles* self = CCreatorFiles::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorFiles* CCreatorFiles::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorFiles* self = new (ELeave) CCreatorFiles;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorFiles::CCreatorFiles() :
-    iFs ( CEikonEnv::Static()->FsSession() )
-    {
-    }
-
-void CCreatorFiles::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorFiles::ConstructL");
-
-    iEngine = aEngine;
-
-    iDirectoryQueriedFromUser = HBufC::New(KFilesFieldLength);
-    User::LeaveIfError( iApaLs.Connect() );
-    
-    iFilePaths = new (ELeave) CDesCArrayFlat( 4 );
-    
-    // Restore file id 
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, KUidDictionaryUidFiles );
-        TRAPD( err, iFileId = in.ReadInt32L() );
-        if ( err )
-            {
-            iFileId = 1;
-            }
-        CleanupStack::PopAndDestroy(); // in
-        }
-    else
-        {
-        iFileId = 1;
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-CCreatorFiles::~CCreatorFiles()
-    {
-    LOGSTRING("Creator: CCreatorFiles::~CCreatorFiles");
-    
-    // this is done only once per file operation:
-    if ( iFilePaths && iFilePaths->Count() )
-        {
-        TRAP_IGNORE( StorePathsForDeleteL( *iFilePaths ) );
-        }
-    delete iFilePaths;
-    delete iDirectoryQueriedFromUser;
-    delete iParameters;
-    delete iUserParameters;
-    iApaLs.Close();
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorFiles::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorFiles::AskDataFromUserL");
-    
-    if ( aCommand == ECmdDeleteCreatorFiles )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all files created with Creator?") );
-        }
-    
-    delete iUserParameters;
-    iUserParameters = NULL;
-    iUserParameters = new(ELeave) CFilesParameters();
-    
-    iDirectoryQueriedFromUser->Des().Copy( KNullDesC );
-
-    if (iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?")))
-        {
-        // set a default directory  (eg. c:\Nokia\Images\)
-        TFileName directory;
-        iEngine->SetDefaultPathForFileCommandL(aCommand, directory);
-
-        // directory query dialog
-        CAknTextQueryDialog* textDialog = CAknTextQueryDialog::NewL(directory, CAknQueryDialog::ENoTone);
-        textDialog->SetMaxLength(256);
-
-        TBuf<50> promptText;
-
-        if (aCommand == ECmdCreateFileEntryEmptyFolder)
-            promptText.Copy( _L("Specify the folder path and name") );
-        else
-            promptText.Copy( _L("Specify the directory") );
-
-        if (textDialog->ExecuteLD(R_DIRECTORY_QUERY, promptText))
-            {
-	        // check that the root folder is correct
-            if (directory.Length() < 3  ||  BaflUtils::CheckFolder(iFs, directory.Left(3)) != KErrNone)
-                {
-                CAknErrorNote* errorNote = new (ELeave) CAknErrorNote;
-                errorNote->ExecuteLD(_L("Invalid path"));
-                return EFalse;
-                }        
-            else
-                {
-                // check the directory contains a trailing backlash
-                if (directory.Right(1) != _L("\\"))
-                    directory.Append(_L("\\"));
-
-                // copy the directory name to a class member
-                iDirectoryQueriedFromUser->Des() = directory;
-                if ( aCommand == ECmdCreateFileEntryEmptyFolder ) return ETrue;
-                else return AskDRMDataFromUserL();
-                }
-            }        
-        else
-            return EFalse;
-        }
-    else
-        return EFalse;
-
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorFiles::CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorFiles::CreateFileEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    TFileName directoryToBeCreated;
-            
-    CFilesParameters* parameters = aParameters;
-    
-    if (!parameters)
-        {
-        if ( iUserParameters )
-            {
-            iParameters = new (ELeave) CFilesParameters( *iUserParameters );
-            // iUserParameters = NULL;
-            }
-        else
-            {
-            // random data needed if no predefined data available
-            iParameters = new (ELeave) CFilesParameters;            
-            }
-        parameters = iParameters;
-        }
-
-    TInt err = KErrNone;
-
-    // if we just create directories
-    if ( aCommand == ECmdCreateFileEntryEmptyFolder)
-        {
-        // strip the last backslash from the path
-        if( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0)
-        	directoryToBeCreated = iDirectoryQueriedFromUser->Des();
-        else if( parameters->iFullFilePath && parameters->iFullFilePath->Des().Length() > 0 )
-        	directoryToBeCreated = parameters->iFullFilePath->Des();
-        else 
-        	return err;
-        
-        _LIT(KSlash, "\\");
-        if( directoryToBeCreated.Right(1) == KSlash )
-        	directoryToBeCreated.SetLength ( directoryToBeCreated.Length() - 1 ); 
-            
-        // generate a unique file name
-        err = CApaApplication::GenerateFileName( iFs, directoryToBeCreated);
-        if (err != KErrNone)
-            return err;
-
-        // now append the backslah back
-        directoryToBeCreated.Append( _L("\\") );
-        
-        // now create the new directory
-        err = iFs.MkDirAll( directoryToBeCreated );
-        
-        // Add directoryToBeCreated to store
-        iFilePaths->AppendL( directoryToBeCreated );
-
-        LOGSTRING3("Creator: CCreatorFiles::CreateFileEntryL creating empty directory %S returns err", &directoryToBeCreated, err);
-        }
-
-    else  // files
-        {
-        LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL file id is %d", aCommand);
-
-        // get source
-        TFileName fullSourcePath;
-        switch (aCommand)
-            {
-	        case ECmdCreateFileEntryJPEG_25kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_25kB );  break; }
-	        case ECmdCreateFileEntryJPEG_200kB:     { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_200kB );  break; }
-	        case ECmdCreateFileEntryJPEG_500kB:     { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJPEG_500kB );  break; }
-	        case ECmdCreateFileEntryPNG_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EPNG_15kB );  break; }
-	        case ECmdCreateFileEntryGIF_2kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EGIF_2kB );  break; }
-	        case ECmdCreateFileEntryRNG_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERNG_1kB );  break; }
-	        case ECmdCreateFileEntryMIDI_10kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMIDI_10kB );  break; }
-	        case ECmdCreateFileEntryWAV_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWAVE_20kB );  break; }
-	        case ECmdCreateFileEntryAMR_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EAMR_20kB );  break; }
-	        case ECmdCreateFileEntryXLS_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EExcel_15kB );  break; }
-	        case ECmdCreateFileEntryDOC_20kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWord_20kB );  break; }
-	        case ECmdCreateFileEntryPPT_40kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EPowerPoint_40kB );  break; }
-	        case ECmdCreateFileEntryTXT_10kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EText_10kB );  break; }
-	        case ECmdCreateFileEntryTXT_70kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EText_70kB );  break; }
-	        case ECmdCreateFileEntry3GPP_70kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::E3GPP_70kB );  break; }
-	        case ECmdCreateFileEntryMP3_250kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMP3_250kB );  break; }
-	        case ECmdCreateFileEntryAAC_100kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EAAC_100kB );  break; }
-	        case ECmdCreateFileEntryRM_95kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERM_95kB );  break; }
-	        case ECmdCreateFileEntryBMP_25kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EBMP_25kB );  break; }
-	        case ECmdCreateFileEntryDeck_1kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESavedDeck_1kB );  break; }
-	        case ECmdCreateFileEntryHTML_20kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EHTML_20kB );  break; }
-	        case ECmdCreateFileEntryJAD_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJAD_1kB );  break; }
-	        case ECmdCreateFileEntryJAR_10kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJAR_10kB );  break; }
-	        case ECmdCreateFileEntryJP2_65kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EJP2_65kB );  break; }
-	        case ECmdCreateFileEntryMP4_200kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMP4_200kB );  break; }
-	        case ECmdCreateFileEntryMXMF_40kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EMXMF_40kB );  break; }
-	        case ECmdCreateFileEntryRAM_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ERAM_1kB );  break; }
-	        case ECmdCreateFileEntrySVG_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESVG_15kB );  break; }
-	        case ECmdCreateFileEntrySWF_15kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESWF_15kB );  break; }
-	        case ECmdCreateFileEntryTIF_25kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ETIF_25kB );  break; }
-	        case ECmdCreateFileEntryVCF_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EVCF_1kB );  break; }
-	        case ECmdCreateFileEntryVCS_1kB:        { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EVCS_1kB );  break; }
-	        case ECmdCreateFileEntrySISX_10kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::ESISX_10kB );  break; }
-	        case ECmdCreateFileEntryWMA_50kB:       { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWMA_50kB );  break; }
-	        case ECmdCreateFileEntryWMV_200kB:      { fullSourcePath = iEngine->TestDataPathL( CCreatorEngine::EWMV_200kB );  break; }
-	        case ECmdCreateFileEntryEmptyFolder:    { User::Panic(_L("EmptyFolder"), 801); break; }
-	        default:                                { return KErrPathNotFound; }
-            }
-
-
-        // define the full target path
-        TFileName fullTargetPath;
-
-        if ( parameters->iFullFilePath && parameters->iFullFilePath->Des().Length() > 3 )
-            {
-            _LIT(KSlash, "\\");
-            // check the path is ok
-            fullTargetPath = parameters->iFullFilePath->Des();
-            
-            if(fullTargetPath.Right(1) == KSlash)
-                {
-                // Remove '\' from the end, because the filename check does not work with it:
-                fullTargetPath.SetLength ( fullTargetPath.Length() - 1 );
-                }
-            
-            if (!iFs.IsValidName( fullTargetPath ))
-		        User::Leave(KErrBadName);
-
-            // target path = directory + the file name from source path
-            TParse parser;
-            parser.Set(fullSourcePath, NULL, NULL);
-            
-            // Add '\' to the end:
-            fullTargetPath.Append(KSlash);            
-            // Add filename:
-            fullTargetPath.Append( parser.NameAndExt() );
-
-            LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iFullFilePath used, fullTargetPath: %S", &fullTargetPath);
-            }
-    
-        else if ( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0 )
-            {
-            // target path = directory + the file name from source path
-            TParse parser;
-            parser.Set(fullSourcePath, NULL, NULL);
-
-            fullTargetPath = iDirectoryQueriedFromUser->Des();
-            fullTargetPath.Append( parser.NameAndExt() );
-
-            LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iDirectoryQueriedFromUser used, fullTargetPath: %S", &fullTargetPath);
-            }
-
-        else
-            {   
-            LOGSTRING("Creator: CCreatorFiles::CreateFileEntryL leaving with KErrPathNotFound");
-            User::Leave(KErrPathNotFound);
-            }
-    
-        TBool encrypt = parameters->iEncrypt; 
-        if ( encrypt ) fullTargetPath.Append( KOma2DcfExtension );
-        // check the target path has a unique filename ie we won't overwrite existing files
-        // also generates any missing directories
-        if ( BaflUtils::FileExists( iFs, fullTargetPath ) )
-            {
-            GenerateFileNameL( fullTargetPath );
-            }
-        User::LeaveIfError(CApaApplication::GenerateFileName( iFs, fullTargetPath ) );
-        
-        if ( encrypt )
-            {
-            EncryptFileL( fullSourcePath, fullTargetPath, parameters );
-            }
-        else
-            {
-            // copy the file (synchronous function)
-            err = BaflUtils::CopyFile(iFs, fullSourcePath, fullTargetPath);
-            LOGSTRING4("Creator: CCreatorFiles::CreateFileEntryL copy %S to %S, err=%d", &fullSourcePath, &fullTargetPath, err);            
-            }
-        
-        if (err != KErrNone)
-            User::Leave(err);  // leave because copying failed
-
-        // Add fullTargetPath to store
-        iFilePaths->AppendL( fullTargetPath );
-        
-		// make sure that the file won't have a read only attribute
-		TEntry fileEntry;
-		iFs.Entry(fullTargetPath, fileEntry);
-		iFs.SetEntry(fullTargetPath, fileEntry.iModified, NULL, KEntryAttReadOnly);
-
-        // clear variables
-		parameters->iFullFilePath->Des().Copy ( KNullDesC );
-        }
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorFiles::EncryptFileL( const TDesC& aInFileName, const TDesC& aOutFileName, CFilesParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorFiles::EncryptFileL");
-    TBuf8<64> mime;
-    SetMimeTypeL( aInFileName, mime, aParameters );
-    CSupplier* supplier = CSupplier::NewLC();
-
-    CMetaDataArray* metaData = CMetaDataArray::NewLC();
-    
-    // Tell the agent which MIME type to use for the encrypted data
-    metaData->AddL( KOmaImportMimeTypeField, mime );
-
-    if ( aParameters && aParameters->iPermission )
-        {
-        // Combined Delivery file will be created
-        SetPermissionsL( metaData, aOutFileName, aParameters );
-        }
-    
-    supplier->SetOutputDirectoryL( *iDirectoryQueriedFromUser );
-    
-    // The KOmaImportContentType is a OMA DRM agent specific MIME type which
-    // indicates that plain content is to be encrypted
-    CImportFile* importFile = supplier->ImportFileL( KOmaImportContentType,
-                                                     *metaData,
-                                                     aOutFileName );
-    CleanupStack::PushL( importFile );
-    
-    // Peek the source file size:
-    TInt fileLen( 0 );
-    RFile file;
-    User::LeaveIfError( file.Open( iFs, aInFileName, EFileRead ) );
-    CleanupClosePushL( file );
-    User::LeaveIfError( file.Size( fileLen ) );
-    CleanupStack::PopAndDestroy( &file );
-    
-    // Read the source file to inmemory buffer
-    RFileReadStream rs;    
-    User::LeaveIfError( rs.Open( iFs,
-                                 aInFileName,
-                                 EFileStream | EFileRead ) ); 
-    CleanupClosePushL( rs );
-    HBufC8* fileBuf = HBufC8::NewLC( fileLen );
-    TPtr8 p = fileBuf->Des();
-    rs.ReadL( p, fileLen );
-    
-    // Start encryption
-    TInt err = importFile->WriteData( p );
-    if ( err == KErrCANewFileHandleRequired )
-        {
-        RFile file;
-        User::LeaveIfError( file.Create( iFs, aOutFileName, EFileWrite ) );
-        CleanupClosePushL( file );
-        importFile->ContinueWithNewOutputFile( file, aOutFileName );
-        CleanupStack::PopAndDestroy( &file );
-        }
-    else
-        {
-        User::LeaveIfError( err );
-        }
-    User::LeaveIfError( importFile->WriteDataComplete() );
-    CleanupStack::PopAndDestroy( fileBuf );
-    CleanupStack::PopAndDestroy( &rs );    
-    CleanupStack::PopAndDestroy( importFile );
-    CleanupStack::PopAndDestroy( metaData );
-    CleanupStack::PopAndDestroy( supplier );
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorFiles::SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorFiles::SetPermissionsL");
-    CDRMRights* rights = CDRMRights::NewL();
-    CleanupStack::PushL( rights );
-    
-    HBufC8* cnturi = HBufC8::NewL( KMaxFileName );
-    cnturi->Des().Copy( aOutFileName );
-    
-    CDRMAsset* asset = CDRMAsset::NewLC();
-    asset->iUid = cnturi;
-    // Set the asset to the rights class, it will duplicate the asset
-    rights->SetAssetL( *asset );
-    CleanupStack::PopAndDestroy( asset );
-    
-    rights->SetPermissionL( *aParameters->iPermission );
-    
-    // Construct externalized presentation of the rights object
-    TInt rightsSize = 1024 *100;
-    HBufC8* rightBuf = HBufC8::NewLC( rightsSize ); 
-    TPtr8 bptr = rightBuf->Des();
-    bptr.SetLength( rightsSize );
-    RMemWriteStream iWriteStream;
-    iWriteStream.Open( (TAny*)(rightBuf->Ptr() ), rightsSize );
-    CleanupClosePushL( iWriteStream );
-    iWriteStream << *rights;
-    iWriteStream.CommitL();
-    TPtr8 rp = rightBuf->Des();
-    
-    // Add rights to metadata
-    aMetaData->AddL( KOmaImportRightsField, rp );
-    CleanupStack::PopAndDestroy( &iWriteStream );
-    CleanupStack::PopAndDestroy( rightBuf );
-    CleanupStack::PopAndDestroy( rights );
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorFiles::SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters )
-    {
-    LOGSTRING("Creator: CCreatorFiles::SetMimeTypeL");
-    TUid appUid;
-    TDataType dataType;
-    User::LeaveIfError( iApaLs.AppForDocument( aFileName, appUid, dataType ) );
-    if ( dataType.Des().Length() )
-        {
-        aMime.Copy( dataType.Des() );    
-        }
-    else
-        {
-        // set default mime, because it was not recognized by iApaLs
-        aMime.Copy( _L("text/plain") );
-        }
-
-    // set DRM permissions according the type of the file
-    if ( aParameters->iPermission )
-        {
-        if ( dataType.Des().FindF( _L("image") ) > KErrNotFound )
-            {
-            aParameters->iPermission->iAvailableRights = ERightsDisplay | ERightsPrint;
-            }
-        else if ( dataType.Des().FindF( _L("audio") ) > KErrNotFound ||
-                  dataType.Des().FindF( _L("video") ) > KErrNotFound ||
-                  dataType.Des().FindF( _L("tone") ) > KErrNotFound || // e.g. application/vnd.nokia.ringing-tone
-                  dataType.Des().FindF( _L("realmedia") ) > KErrNotFound )
-            {
-            // media files
-            aParameters->iPermission->iAvailableRights = ERightsPlay;
-            }
-        else if ( dataType.Des().FindF( _L("archive") ) > KErrNotFound ||
-                  dataType.Des().FindF( _L("x-sis") ) > KErrNotFound )
-            {
-            // application/java-archive
-            // x-epoc/x-sisx-app
-            aParameters->iPermission->iAvailableRights = ERightsExecute;
-            }
-        else if ( dataType.Des().FindF( _L("application") ) > KErrNotFound ||
-                  dataType.Des().FindF( _L("text") ) > KErrNotFound )
-            {
-            // application/msexcel
-            // application/msword
-            // text/plain
-            // etc.
-            aParameters->iPermission->iAvailableRights = ERightsDisplay | ERightsPrint;
-            }
-        else
-            {
-            // other filetype
-            aParameters->iPermission->iAvailableRights = ERightsDisplay;
-            }
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorFiles::AskDRMDataFromUserL()
-    {
-    LOGSTRING("Creator: CCreatorFiles::AskDRMDataFromUserL");
-    // Encryption -dialog
-    TInt encIndex( 0 );
-    CAknListQueryDialog* encDlg = new (ELeave) CAknListQueryDialog( &encIndex );
-    encDlg->PrepareLC( R_ENCRYPTION_DIALOG );
-    //Create flat array from which list is built.
-    CDesCArrayFlat* items = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL(items);
-
-    // Add entires to list
-    items->AppendL( _L("None") );
-    items->AppendL( _L("DRM Forward Lock") );
-    items->AppendL( _L("DRM Combined Delivery") );
-
-    // Add items into main list
-    encDlg->SetOwnershipType( ELbmOwnsItemArray );
-    encDlg->SetItemTextArray( items );
-    CleanupStack::Pop( items );
-    encDlg->ListBox()->SetCurrentItemIndexAndDraw( 0 );
-   
-    if ( encDlg->RunLD() )
-        {
-        if ( encIndex > 0 )
-            {
-            iUserParameters->iEncrypt = ETrue;
-            }
-        if ( encIndex == 2 )
-            {
-            iUserParameters->iPermission = CDRMPermission::NewL();
-            CDRMPermission* perm = iUserParameters->iPermission; 
-            perm->iTopLevel->iActiveConstraints = EConstraintNone;
-            perm->iPlay->iActiveConstraints = EConstraintNone;
-            perm->iDisplay->iActiveConstraints = EConstraintNone;
-            perm->iPrint->iActiveConstraints = EConstraintNone;
-            perm->iExecute->iActiveConstraints = EConstraintNone;
-            perm->iUniqueID = 0;
-            // DRM Combined Delivery
-            return AskDRMCDDataFromUserL();
-            }
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorFiles::AskDRMCDDataFromUserL()
-    {
-    LOGSTRING("Creator: CCreatorFiles::AskDRMCDDataFromUserL");
-    TInt count( 0 );
-    if ( iEngine->EntriesQueryDialogL( count, _L("How many counts\r\n(0=unlimited)?"), ETrue ) )
-        {
-        if ( count > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type
-            perm->iDisplay->iActiveConstraints |= EConstraintCounter;
-            perm->iDisplay->iCounter = count;
-            perm->iDisplay->iOriginalCounter = count;
-
-            perm->iPlay->iActiveConstraints |= EConstraintCounter;
-            perm->iPlay->iCounter = count;
-            perm->iPlay->iOriginalCounter = count;
-
-            perm->iPrint->iActiveConstraints |= EConstraintCounter;
-            perm->iPrint->iCounter = count;
-            perm->iPrint->iOriginalCounter = count;
-            
-            perm->iExecute->iActiveConstraints |= EConstraintCounter;
-            perm->iExecute->iCounter = count;
-            perm->iExecute->iOriginalCounter = count;
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    /*
-    TInt seconds( 0 );
-    if ( iEngine->EntriesQueryDialogL( seconds, _L("How many accumulated seconds until expire (0=unlimited)?"), ETrue ) )
-        {
-        if ( seconds > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;            
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type            
-            perm->iDisplay->iActiveConstraints |= EConstraintAccumulated;
-            perm->iDisplay->iEndTime = Time::MaxTTime();
-            perm->iDisplay->iStartTime = Time::MinTTime();;
-            perm->iDisplay->iAccumulatedTime = seconds;
-            
-            perm->iPlay->iActiveConstraints |= EConstraintAccumulated;
-            perm->iPlay->iEndTime = Time::MaxTTime();
-            perm->iPlay->iStartTime = Time::MinTTime();;
-            perm->iPlay->iAccumulatedTime = seconds;
-
-            perm->iPrint->iActiveConstraints |= EConstraintAccumulated;
-            perm->iPrint->iEndTime = Time::MaxTTime();
-            perm->iPrint->iStartTime = Time::MinTTime();;
-            perm->iPrint->iAccumulatedTime = seconds;
-
-            perm->iExecute->iActiveConstraints |= EConstraintAccumulated;
-            perm->iExecute->iEndTime = Time::MaxTTime();
-            perm->iExecute->iStartTime = Time::MinTTime();;
-            perm->iExecute->iAccumulatedTime = seconds;
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    */
-    
-    TInt minutes( 0 );
-    if ( iEngine->EntriesQueryDialogL( minutes, _L("How many minutes until expire (0=unlimited)?"), ETrue ) )
-        {
-        if ( minutes > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;            
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type            
-            perm->iDisplay->iActiveConstraints |= EConstraintInterval;
-            perm->iDisplay->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iDisplay->iIntervalStart = Time::NullTTime();
-            
-            perm->iPlay->iActiveConstraints |= EConstraintInterval;
-            perm->iPlay->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iPlay->iIntervalStart = Time::NullTTime();
-
-            perm->iPrint->iActiveConstraints |= EConstraintInterval;
-            perm->iPrint->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iPrint->iIntervalStart = Time::NullTTime();
-
-            perm->iExecute->iActiveConstraints |= EConstraintInterval;
-            perm->iExecute->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iExecute->iIntervalStart = Time::NullTTime();
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    
-    return ETrue;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorFiles::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorFiles::DeleteAllL");
-    User::Leave( KErrNotSupported ); // will not be supported
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorFiles::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorFiles::DeleteAllCreatedByCreatorL");
-    iFileId = 1;
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-        
-    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, KUidDictionaryUidFiles );
-        CFileMan* fileMan = CFileMan::NewL( iFs );
-        CleanupStack::PushL( fileMan );
-        TFileName fullPath;
-        // ignore return value, don't update iFileId here:
-        TRAPD( err, in.ReadInt32L() );
-        while ( !err )
-            {
-            TInt len( KErrNotFound );
-            TRAP( err, len = in.ReadInt8L() );  // will leave with KErrEof
-            if ( !err )
-                {
-                TRAP( err, in.ReadL( fullPath, len ) );                    
-                }
-            if ( !err )
-                {
-                TEntry fileEntry;
-                iFs.Entry( fullPath, fileEntry );
-                if ( fileEntry.IsDir() )
-                    {
-                    fileMan->RmDir( fullPath ); // ignore return value
-                    }
-                else
-                    {
-                    iFs.Delete( fullPath ); // ignore return value    
-                    }                    
-                }
-            }
-        CleanupStack::PopAndDestroy( fileMan );
-        CleanupStack::PopAndDestroy( &in );
-        
-        // files deleted, remove the Creator internal file registry
-        store->Remove( KUidDictionaryUidFiles );
-        store->CommitL();
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorFiles::StorePathsForDeleteL( CDesCArray& aPaths )
-    {
-    LOGSTRING("Creator: CCreatorFiles::StorePathsForDeleteL");
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-    
-    // backup previous filepaths from store
-    // otherwise they would be overwritten when calling out.WriteL
-    CDesCArray* previousPaths = new (ELeave) CDesCArrayFlat( 4 );
-    CleanupStack::PushL( previousPaths );
-    
-    TFileName fullPath;
-    
-    if ( store->IsPresentL( KUidDictionaryUidFiles ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, KUidDictionaryUidFiles );
-        // ignore return value, don't update iFileId here:
-        TRAPD( err, in.ReadInt32L() );
-        while ( !err ) 
-            {
-            TRAP( err,
-                TInt len = in.ReadInt8L(); // will leave with KErrEof
-                in.ReadL( fullPath, len );
-                previousPaths->AppendL( fullPath );
-                );
-            }
-        CleanupStack::PopAndDestroy(); // in
-        }
-    
-    RDictionaryWriteStream out;       
-    out.AssignLC( *store, KUidDictionaryUidFiles );
-    
-    // write latest file id to store
-    out.WriteInt32L( iFileId );
-    
-    // restore previous paths to store
-    for ( TInt i = 0; i < previousPaths->Count(); i++ )
-        {
-        out.WriteInt8L( (*previousPaths)[i].Length() );
-        out.WriteL( (*previousPaths)[i] );            
-        }
-
-    // write new paths to store
-    for ( TInt i = 0; i < aPaths.Count(); i++ )
-        {
-        out.WriteInt8L( aPaths[i].Length() );
-        out.WriteL( aPaths[i] );            
-        }
-    
-    out.CommitL();
-    CleanupStack::PopAndDestroy(); // out
-    
-    store->CommitL();
-    CleanupStack::PopAndDestroy( previousPaths );
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorFiles::GenerateFileNameL( TFileName& aRootName )
-    {
-    LOGSTRING("Creator: CCreatorFiles::GenerateFileNameL");
-    if ( iFileId )
-        {
-        TBuf<16> extension;
-        if ( iFileId < 10 )
-            {
-            extension.Format( _L("(0%d)"), iFileId );     
-            }
-        else
-            {
-            extension.Format( _L("(%d)"), iFileId );
-            }
-        aRootName.Insert( aRootName.Locate( '.' ), extension );
-        }
-    iFileId++;
-    }
-
-// End of file
--- a/creator/src/creator_fileelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_fileelement.h"
-#include <DrmPermission.h>
-#include <DrmConstraint.h>
-#include "creator_traces.h"
-#include "creator_file.h"
-
-using namespace creatorfile;
-
-// 15 minutes per time zone, 60 seconds per minute
-const TInt KSecondsPerTimeZone = 900;
-const TInt KMinuteInMicroseconds = 60000000;
-const TInt KTimeZoneIncrement = 15;
-
-/*
- * 
- */
-CCreatorFileElement* CCreatorFileElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorFileElement* self = new (ELeave) CCreatorFileElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorFileElement::CCreatorFileElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-
-    TTime currUniversal;
-    TTime currLocal;
-    TInt64 result( 0 );
-    currUniversal.UniversalTime();
-    currLocal.HomeTime();
-    result = currLocal.Int64() - currUniversal.Int64();
-    result /= KMinuteInMicroseconds;
-    result /= KTimeZoneIncrement;
-    iTimeZone = I64INT( result );
-    }
-/*
- * 
- */
-void CCreatorFileElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt fileAmount = 1;    
-    if( amountAttr )
-        {
-        fileAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
-        // Create files, the amount of files is defined by fileAmount:
-        for( TInt cI = 0; cI < fileAmount; ++cI )
-            {
-            CFilesParameters* param = new (ELeave) CFilesParameters;
-            CleanupStack::PushL( param );
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-
-                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName( KRandomLength );
-                
-                if( elemName == KType )
-                    {
-                    param->iFileCommand = GetFileCommandL(elemContent, randomAttr || elemContent.Length() == 0);
-                    }
-                else if( elemName == KDirectory )
-                    {
-                    delete param->iFullFilePath;
-                    param->iFullFilePath = 0;
-                    if( randomAttr == 0 && elemContent.Length() > 0 )
-                    	{
-                    	param->iFullFilePath = elemContent.AllocL();
-                    	}
-                    else
-                        {
-                        TFileName defaultPath;
-                        iEngine->SetDefaultPathForFileCommandL( param->iFileCommand, defaultPath );
-                        param->iFullFilePath = defaultPath.AllocL();
-                        }
-                    }
-                else if ( elemName == KEncryption )
-                    {
-                    ParseDRMElementsL( field, param );
-                    }
-                }
-
-            if ( !param->iFileCommand )
-                {
-                param->iFileCommand = ECmdCreateFileEntryEmptyFolder;
-                }
-            iEngine->AppendToCommandArrayL( param->iFileCommand, param);
-            CleanupStack::Pop( param );
-            }
-        }
-    else
-    	{
-    	_LIT(KDummy, "");
-    	for( TInt cI = 0; cI < fileAmount; ++cI )
-    		{
-    		CFilesParameters* param = new (ELeave) CFilesParameters;
-    		CleanupStack::PushL(param);
-    		delete param->iFullFilePath;
-    		param->iFullFilePath = 0;
-    		TFileName defaultPath;
-    		param->iFileCommand = GetFileCommandL(KDummy, ETrue);
-    		iEngine->SetDefaultPathForFileCommandL(param->iFileCommand, defaultPath);                
-    		param->iFullFilePath = defaultPath.AllocL();
-    		
-    		iEngine->AppendToCommandArrayL(param->iFileCommand, param);
-    		CleanupStack::Pop(param);
-    		}
-    	}
-    }
-
-TInt CCreatorFileElement::GetFileCommandL( const TDesC& aFileIdStr, TBool aRandom ) const
-    {
-    TInt mapCount = sizeof(FileMap) / sizeof(FileMapping);
-    
-    if( aRandom )
-        {
-        return FileMap[iEngine->RandomNumber(0, mapCount-1)].CommandId();
-        }
-    
-    for( TInt i = 0; i < mapCount; ++i )
-        {
-        if( CompareIgnoreCase(FileMap[i].FileName(), aFileIdStr) == 0 )
-            return FileMap[i].CommandId();
-        }
-    LOGSTRING2("CCreatorFileElement::GetFileCommandL: Unknown file id: %S", &aFileIdStr);
-    User::Leave(KErrGeneral);
-    return 0; // Not reached, but disables compiler warning...
-    }
-
-void CCreatorFileElement::ParseDRMElementsL( CCreatorScriptElement* aField, CFilesParameters* aParam )
-    {
-    const CCreatorScriptAttribute* encryptionTypeAttr = aField->FindAttributeByName( KType );
-    if ( encryptionTypeAttr && encryptionTypeAttr->Value().Length() > 0 )
-        {
-        aParam->iEncrypt = ETrue;
-        if ( encryptionTypeAttr->Value() == KDRMCD ) 
-            {
-            delete aParam->iPermission;
-            aParam->iPermission = NULL;
-            // ownership transferred:
-            aParam->iPermission = CDRMPermission::NewL();
-            }
-        else if ( encryptionTypeAttr->Value() != KDRMFL )
-            {
-            // must be either KDRMCD or KDRMFL
-            User::Leave( KErrArgument );
-            }
-        }
-    else
-        {
-        User::Leave( KErrArgument );
-        }
-    
-    const RPointerArray<CCreatorScriptElement>& rights = aField->SubElements();
-    
-    if ( encryptionTypeAttr->Value() == KDRMFL && rights.Count() )
-        {
-        // Right definitions not allowed with DRM Forward Lock
-        // User::Leave( KErrArgument ); // Do not leave here
-        return; // Just omit rights definitions
-        }
-    
-    // parse right elements
-    CDRMPermission* drmPermission = aParam->iPermission;
-    for ( TInt r = 0; r < rights.Count(); r++ )
-        {
-        const CCreatorScriptAttribute* rightAttr = rights[r]->FindAttributeByName( KType );
-        if ( rightAttr->Value() == KDRMPlayRight &&
-             !( drmPermission->iAvailableRights & ERightsPlay ) )
-            {
-            drmPermission->iAvailableRights |= ERightsPlay;
-            ParseDRMConstraintsL( rights[r], drmPermission->iPlay );
-            }
-        else if ( rightAttr->Value() == KDRMDisplayRight  &&
-                !( drmPermission->iAvailableRights & ERightsDisplay ))
-            {
-            drmPermission->iAvailableRights |= ERightsDisplay;
-            ParseDRMConstraintsL( rights[r], drmPermission->iDisplay );
-            }
-        else if ( rightAttr->Value() == KDRMPrintRight  &&
-                !( drmPermission->iAvailableRights & ERightsPrint ) )
-            {
-            drmPermission->iAvailableRights |= ERightsPrint;
-            ParseDRMConstraintsL( rights[r], drmPermission->iPrint );
-            }
-        else if ( rightAttr->Value() == KDRMExecuteRight  &&
-                !( drmPermission->iAvailableRights & ERightsExecute ) )
-            {
-            drmPermission->iAvailableRights |= ERightsExecute;
-            ParseDRMConstraintsL( rights[r], drmPermission->iExecute );
-            }
-        }
-    }
-
-void CCreatorFileElement::ParseDRMConstraintsL( CCreatorScriptElement* aRight, CDRMConstraint* aConstraint )
-    {
-    const RPointerArray<CCreatorScriptElement>& constraints = aRight->SubElements();
-    for ( TInt c = 0; c < constraints.Count(); c++ )
-        {
-        TPtrC elemName = constraints[c]->Name();
-        TPtrC elemContent = constraints[c]->Content();
-        if ( elemName == KDRMCount )
-            {
-            TInt count = ConvertStrToIntL( elemContent );
-            // apply count constraint
-            aConstraint->iActiveConstraints |= EConstraintCounter;
-            aConstraint->iCounter = count;
-            aConstraint->iOriginalCounter = count;
-            }
-        else if ( elemName == KDRMInterval )
-            {
-            // apply interval constraint           
-            aConstraint->iActiveConstraints |= EConstraintInterval;
-            aConstraint->iInterval = ParseTimeInterval( elemContent );
-            aConstraint->iIntervalStart = Time::NullTTime();
-            }
-        else if ( elemName == KDRMStartTime )
-            {
-            // apply start time constraint           
-            aConstraint->iActiveConstraints |= EConstraintStartTime;
-            TTimeIntervalSeconds offset( iTimeZone * KSecondsPerTimeZone );
-            aConstraint->iStartTime = ConvertToDateTimeL( elemContent ) - offset;
-            }
-        else if ( elemName == KDRMEndTime )
-            {
-            // apply end time constraint
-            aConstraint->iActiveConstraints |= EConstraintEndTime;
-            TTimeIntervalSeconds offset( iTimeZone * KSecondsPerTimeZone );
-            aConstraint->iEndTime = ConvertToDateTimeL( elemContent ) - offset;
-            }
-        else if ( elemName == KDRMAccumulated )
-            {
-            // apply accumulated time constraint
-            aConstraint->iActiveConstraints |= EConstraintAccumulated;
-            if ( aConstraint->iEndTime == Time::NullTTime() )
-                {
-                aConstraint->iEndTime = Time::MaxTTime();
-                }
-            if ( aConstraint->iStartTime == Time::NullTTime() )
-                {
-                aConstraint->iStartTime = Time::MinTTime();
-                }
-            aConstraint->iAccumulatedTime = ParseTimeInterval( elemContent );
-            }
-        }
-    }
-
-TTimeIntervalSeconds CCreatorFileElement::ParseTimeInterval( TDesC& aTimeString )
-    {
-    // Iso8601 format (P1Y2M3DT4H5M6S) to TimeIntervalSeconds
-    TLex lex;
-    TInt year = 0;
-    TInt month = 0;
-    TInt day = 0;
-    TInt hour = 0;
-    TInt minute = 0;
-    TInt second = 0;
-
-    if (aTimeString.Length() > 0)
-        {    
-        lex = aTimeString;
-        lex.Inc(); // skip 'P'
-        lex.Val(year);
-        lex.Inc();
-        lex.Val(month);
-        lex.Inc();
-        lex.Val(day);
-        lex.Inc(2);
-        lex.Val(hour);
-        lex.Inc();
-        lex.Val(minute);
-        lex.Inc();
-        lex.Val(second);
-        }
-    TTimeIntervalSeconds result( ( ( ( year * 365 + month * 30 + day ) * 24 + hour )
-                * 60 + minute ) * 60 + second );
-    return result;
-    }
-
-// End of file
--- a/creator/src/creator_imps.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#ifdef __PRESENCE
-
-#include "creator_imps.h" 
-#include "creator_traces.h"
-
-#include <cimpssapsettingslist.h>
-
-static const TInt KIMPSFieldLength = 128;
-
-_LIT(KCreatorIMPSPrefixName, "CR_");
-
-
-//----------------------------------------------------------------------------
-
-CIMPSParameters::CIMPSParameters()
-    {
-    LOGSTRING("Creator: CIMPSParameters::CIMPSParameters");
-
-    iServerName = HBufC::New(KIMPSFieldLength);
-    iServerURL = HBufC::New(KIMPSFieldLength);
-    iServerUsername = HBufC::New(KIMPSFieldLength);
-    iServerPassword = HBufC::New(KIMPSFieldLength);
-    iServerAccessPointName = HBufC::New(KIMPSFieldLength);
-    // User needs to set connectionmethod manually to be able to use the IMPS setting
-    iServerAccessPointName->Des().Copy(_L("DEFAULT-IAP"));
-    }
-
-CIMPSParameters::~CIMPSParameters()
-    {
-    LOGSTRING("Creator: CIMPSParameters::~CIMPSParameters");
-
-    delete iServerAccessPointName;
-    delete iServerPassword;
-    delete iServerUsername;
-    delete iServerURL;
-    delete iServerName;
-    }
-
-void CIMPSParameters::SetRandomNameL(CCreatorEngine& aEngine)
-    {
-    if(iServerName == 0)
-        {
-        iServerName = HBufC::New(KIMPSFieldLength);
-        }
-    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
-    iServerName->Des() = KCreatorIMPSPrefixName;
-    iServerName->Des().Append( company );
-    iServerName->Des().Append( _L(" #") );
-    iServerName->Des().AppendNum( aEngine.RandomNumber(1000, 9999) );    
-    }
-
-void CIMPSParameters::SetRandomUrlL(CCreatorEngine& aEngine)
-    {
-    if(iServerURL == 0)
-        {
-        iServerURL = HBufC::New(KIMPSFieldLength);
-        }
-    TBuf<160> company = aEngine.RandomString(CCreatorEngine::ECompany);
-    iServerURL->Des() = _L("http://imps.");
-    iServerURL->Des().Append( company );
-    iServerURL->Des().Append( _L(".com:18080/CSP/csp") );
-    }
-
-void CIMPSParameters::SetRandomUsernameL(CCreatorEngine& aEngine)
-    {
-    iServerUsername->Des() = aEngine.RandomString(CCreatorEngine::EFirstName);
-    iServerUsername->Des().LowerCase();
-    }
-
-void CIMPSParameters::SetRandomPasswordL(CCreatorEngine& aEngine)
-    {
-    iServerPassword->Des() = aEngine.RandomString(CCreatorEngine::ESurname);
-    iServerPassword->Des().LowerCase();
-    }
-void CIMPSParameters::SetDefaultAccessPointL()
-    {
-    iServerAccessPointName->Des().Copy(_L("DEFAULT-IAP"));
-    }
-//----------------------------------------------------------------------------
-
-CCreatorIMPS* CCreatorIMPS::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorIMPS* self = CCreatorIMPS::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorIMPS* CCreatorIMPS::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorIMPS* self = new (ELeave) CCreatorIMPS;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorIMPS::CCreatorIMPS()
-    {
-    }
-
-void CCreatorIMPS::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorIMPS::ConstructL");
-
-    iEngine = aEngine;
-
-    iIMPSSAPSettingsStore = CIMPSSAPSettingsStore::NewL();    
-    }
-
-CCreatorIMPS::~CCreatorIMPS()
-    {
-    LOGSTRING("Creator: CCreatorIMPS::~CCreatorIMPS");
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidIMPS ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    delete iIMPSSAPSettingsStore;
-    
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorIMPS::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorIMPS::AskDataFromUserL");
-    if ( aCommand == ECmdDeleteIMPSs )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all IMPS server entries?") );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorIMPSs )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all IMPS server entries created with Creator?") );
-        }
-    return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorIMPS::CreateIMPSServerEntryL(CIMPSParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorIMPS::CreateIMPSServerEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CIMPSParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CIMPSParameters;
-        parameters = iParameters;                
-        parameters->SetRandomNameL(*iEngine);
-        parameters->SetRandomUrlL(*iEngine);
-        parameters->SetRandomUsernameL(*iEngine);
-        parameters->SetRandomPasswordL(*iEngine);
-        parameters->SetDefaultAccessPointL();
-        }
-
-    TInt err = KErrNone;
-
-    // set data to save item
-    CIMPSSAPSettings* settings = CIMPSSAPSettings::NewLC();
-    TUint32 iapId = iEngine->AccessPointNameToIdL(parameters->iServerAccessPointName->Des(), ETrue );
-    err = settings->SetAccessPoint( iapId );
-    if( err != KErrNone )
-    	{
-    	LOGSTRING("Creator: CCreatorIMPS::CreateIMPSServerEntryL - Unable to resolve access point.");
-    	err = KErrNone;
-    	}
-    settings->SetSAPNameL( parameters->iServerName->Des() );
-    settings->SetSAPAddressL( parameters->iServerURL->Des() );
-    settings->SetSAPUserIdL( parameters->iServerUsername->Des() );
-    settings->SetSAPUserPasswordL( parameters->iServerPassword->Des() );
-    
-    // save the item
-    TRAP(err, iIMPSSAPSettingsStore->StoreNewSAPL( settings, EIMPSIMAccessGroup ));
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( settings->Uid() );
-    
-    TRAP(err, iIMPSSAPSettingsStore->StoreNewSAPL( settings, EIMPSPECAccessGroup ));
-
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( settings->Uid() );
-    
-    CleanupStack::PopAndDestroy(); //settings
-    return err;
-    }
-
-
-//----------------------------------------------------------------------------
-void CCreatorIMPS::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorIMPS::DeleteAllL");
-    CIMPSSAPSettingsList* imps = CIMPSSAPSettingsList::NewLC();
-    iIMPSSAPSettingsStore->PopulateSAPSettingsListL( *imps, EIMPSAccessFilterAll );
-    for ( TInt i = 0; i < imps->Count(); i++ )
-        {
-        iIMPSSAPSettingsStore->DeleteSAPL( imps->UidForIndex( i ) ); 
-        }
-    CleanupStack::PopAndDestroy( imps );
-    
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the IMPS related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidIMPS );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorIMPS::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorIMPS::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidIMPS );
-    
-    // delete entries
-    for ( TInt i = 0; i < iEntryIds.Count(); i++ )
-        {
-        TRAP_IGNORE( iIMPSSAPSettingsStore->DeleteSAPL( iEntryIds[i] ) ); 
-        }
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the IMPS related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidIMPS );
-    }
-
-#endif //__PRESENCE
-#endif
--- a/creator/src/creator_impselement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#ifdef __PRESENCE
-
-#include "creator_impselement.h"
-#include "creator_traces.h"
-#include "creator_imps.h"
-
-using namespace creatorimps;
-
-/*
- * 
- */
-CCreatorImpsServerElement* CCreatorImpsServerElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorImpsServerElement* self = new (ELeave) CCreatorImpsServerElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorImpsServerElement::CCreatorImpsServerElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-void CCreatorImpsServerElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt entryAmount = 1;    
-    if( amountAttr )
-        {
-        entryAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create note entries, the amount of entries is defined by entryAmount:
-        for( TInt cI = 0; cI < entryAmount; ++cI )
-            {            
-            CIMPSParameters* param = new (ELeave) CIMPSParameters;
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                TBool useRandom = EFalse;
-                if( randomAttr || elemContent.Length() == 0 )
-                    {
-                    useRandom = ETrue;
-                    }
-                
-                if( elemName == KName )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomNameL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iServerName, elemContent);
-                        }                    
-                    }
-                if( elemName == KUrl )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomUrlL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iServerURL, elemContent);
-                        }
-                    }
-                if( elemName == KUsername )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomUsernameL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iServerUsername, elemContent);
-                        }
-                    }
-                if( elemName == KPassword )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomPasswordL(*iEngine);
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iServerPassword, elemContent);
-                        }
-                    }
-                if( elemName == KConnectionMethodName )
-                    {
-                    if( useRandom || CompareIgnoreCase(elemContent, creatorimps::KDefault) == 0 )
-                        {
-                        param->SetDefaultAccessPointL();
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iServerAccessPointName, elemContent);
-                        }
-                    }
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryIMPSServers, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryIMPSServers, 0, entryAmount);
-    	}
-    }
-
-#endif // __PRESENCE
-#endif
--- a/creator/src/creator_landmark.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,497 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_landmark.h" 
-#include "creator_traces.h"
-
-#include <EPos_CPosLandmarkDatabase.h>
-#include <EPos_CPosLmCategoryManager.h>
-#include <lbsposition.h>
-
-_LIT(KAccommodation, "accommodation");
-_LIT(KBusiness, "business");
-_LIT(KCommunication, "communication");
-_LIT(KEducational, "educational");
-_LIT(KEntertainment, "entertainment");
-_LIT(KFoodAndBeverage, "food");
-_LIT(KGeographical, "geographical");
-_LIT(KOutdoor, "outdoor");
-_LIT(KPeople, "people");
-_LIT(KPublic, "public");
-_LIT(KReligious, "religious");
-_LIT(KShopping, "shopping");
-_LIT(KSightseeing, "sightseeing");
-_LIT(KSports, "sports");
-_LIT(KTransport, "transport");
-
-
-/**
- * Class mapping the strings to global landmark categories
- */
-class CategoryMapping
-{
-public:
-    CategoryMapping(TUint aId, const TDesC& aCategoryStr)
-    : 
-    iGlobalId(aId),
-    iStr(aCategoryStr)
-    {}
-
-    TPosLmGlobalCategory iGlobalId;
-    const TDesC& iStr;
-};
-
-/**
- * Global landmark categories
- */
-CategoryMapping LandmarkCategories[] =    {
-        CategoryMapping(3000, KAccommodation), // Accommodation
-        CategoryMapping(6000, KBusiness), // Business
-        CategoryMapping(9000, KCommunication), // Communication
-        CategoryMapping(12000, KEducational), // Educational institute
-        CategoryMapping(15000, KEntertainment), // Entertainment
-        CategoryMapping(18000, KFoodAndBeverage), // Food & Beverage
-        CategoryMapping(21000, KGeographical), // Geographical area
-        CategoryMapping(24000, KOutdoor), // Outdoor activities        
-        CategoryMapping(27000, KPeople), // People
-        CategoryMapping(30000, KPublic), // Public service
-        CategoryMapping(33000, KReligious), // Religious places
-        CategoryMapping(36000, KShopping), // Shopping
-        CategoryMapping(39000, KSightseeing), // Sightseeing
-        CategoryMapping(42000, KSports), // Sports
-        CategoryMapping(45000, KTransport)  // Transport
-};
-
-/**
- * Return landmark global id
- */ 
-TPosLmGlobalCategory CCreatorLandmarks::GetCategoryIdL(const TDesC& aCategoryStr)
-    {
-    TUint numOfCategories = sizeof(LandmarkCategories)/sizeof(CategoryMapping);
-    for( TUint i = 0; i < numOfCategories; ++i )
-        {
-        if( LandmarkCategories[i].iStr == aCategoryStr )
-            return LandmarkCategories[i].iGlobalId;
-        }
-    
-    return 0;
-    }
-
-/**
- *
- */ 
-CLandmarkParameters::CLandmarkParameters()
-    {
-    LOGSTRING("Creator: CLandmarkParameters::CLandmarkParameters");
-    }
-
-/**
- *
- */
-CLandmarkParameters::~CLandmarkParameters()
-    {
-    LOGSTRING("Creator: CLandmarkParameters::~CLandmarkParameters");
-    delete iName;    
-    delete iStreet;
-    delete iCity;    
-    delete iState;
-    delete iCountry;
-    delete iPostCode;    
-    delete iDescription;
-    delete iPhonenumber;
-    delete iUrl;
-    iCategories.Close();
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomNameL(CCreatorEngine& aEngine)
-    {    
-    TPtrC name(aEngine.RandomString(CCreatorEngine::ELandmarkName));
-    delete iName;
-    iName = 0;
-    iName = HBufC::NewL(name.Length());
-    iName->Des().Copy(name);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomUrlL(CCreatorEngine& aEngine)
-    {
-    _LIT(KUrlPrefix, "http://www.");
-    _LIT(KUrlPostfix, ".com");
-    TPtrC company(aEngine.RandomString(CCreatorEngine::ECompany));
-    delete iUrl;
-    iUrl = 0;
-    iUrl = HBufC::NewL(KUrlPrefix().Length()+company.Length()+KUrlPostfix().Length());
-    iUrl->Des() = KUrlPrefix;
-    iUrl->Des().Append( company );
-    iUrl->Des().Append( KUrlPostfix );
-    }
-
-/**
- *
- */
-void CLandmarkParameters::AddRandomCategoryL(CCreatorEngine& aEngine)
-    {
-    TUint numOfCategories = sizeof(LandmarkCategories)/sizeof(CategoryMapping);
-    iCategories.AppendL(LandmarkCategories[aEngine.RandomNumber(0, numOfCategories-1)].iGlobalId);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomStreetL(CCreatorEngine& aEngine)
-    {
-    TPtrC street(aEngine.RandomString(CCreatorEngine::EAddress));
-    delete iStreet;
-    iStreet = 0;
-    iStreet = HBufC::NewL(street.Length());
-    iStreet->Des().Copy(street);
-    }
- 
-/**
- *
- */
-void CLandmarkParameters::SetRandomCityL(CCreatorEngine& aEngine)
-    {
-    TPtrC city(aEngine.RandomString(CCreatorEngine::ECity));
-    delete iCity;
-    iCity = 0;
-    iCity = HBufC::NewL(city.Length());
-    iCity->Des().Copy(city);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomStateL(CCreatorEngine& aEngine)
-    {
-    TPtrC state(aEngine.RandomString(CCreatorEngine::EState));
-    delete iState;
-    iState = 0;
-    iState = HBufC::NewL(state.Length());
-    iState->Des().Copy(state);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomCountryL(CCreatorEngine& aEngine)
-    {
-    TPtrC country(aEngine.RandomString(CCreatorEngine::ECountry));
-    delete iCountry;
-    iCountry = 0;
-    iCountry = HBufC::NewL(country.Length());
-    iCountry->Des().Copy(country);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomPostCodeL(CCreatorEngine& aEngine)
-    {
-    TPtrC po(aEngine.RandomString(CCreatorEngine::EPostcode));
-    delete iPostCode;
-    iPostCode = 0;
-    iPostCode = HBufC::NewL(po.Length());
-    iPostCode->Des().Copy(po);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomLatitudeL(CCreatorEngine& aEngine)
-    {
-    iLatitude = aEngine.RandomNumber(-89, 89); // Degrees
-    TReal64 random = aEngine.RandomNumber(0, 9999); // Desimals 
-    iLatitude +=  random / 10000.0;
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomLongitudeL(CCreatorEngine& aEngine)
-    {
-    TInt minDegrees = -179;
-    TInt maxDegrees = 179;
-    TInt minDecimal = 0;
-    TInt maxDecimal = 9999;
-    TReal64 divider = 10000.0;
-    iLongitude = aEngine.RandomNumber(minDegrees, maxDegrees); // Degrees
-    TReal64 random = aEngine.RandomNumber(minDecimal, maxDecimal); 
-    iLongitude += random  / divider;
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomPositionAccuracyL(CCreatorEngine& aEngine)
-    {
-    this->iPositionAccuracy = aEngine.RandomNumber(0,5);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomAltitudeL(CCreatorEngine& aEngine)
-    {
-    this->iAltitude = aEngine.RandomNumber(0,120);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine)
-    {
-    this->iAltitudeAccuracy = aEngine.RandomNumber(0,5);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomDescriptionL(CCreatorEngine& aEngine)
-    {
-    delete iDescription;
-    iDescription = 0;
-    TPtrC desc(aEngine.RandomString(CCreatorEngine::ELandmarkDescription));
-    iDescription = HBufC::NewL(desc.Length());
-    iDescription->Des().Copy(desc);
-    }
-
-/**
- *
- */
-void CLandmarkParameters::SetRandomPhoneNumberL(CCreatorEngine& aEngine)
-    {
-    delete iPhonenumber;
-    iPhonenumber = 0;
-    TPtrC phone(aEngine.RandomString(CCreatorEngine::EPhoneNumber));
-    iPhonenumber = HBufC::NewL(phone.Length());
-    iPhonenumber->Des().Copy(phone);
-    }
-
-/**
- *
- */
-CCreatorLandmarks::CCreatorLandmarks()
-    {
-    }
-
-/**
- *
- */
-CCreatorLandmarks* CCreatorLandmarks::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorLandmarks* self = CCreatorLandmarks::NewLC(aEngine);
-    CleanupStack::Pop(); // self
-    return self;
-    }
-
-/**
- *
- */
-CCreatorLandmarks* CCreatorLandmarks::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorLandmarks* self = new (ELeave) CCreatorLandmarks;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-/**
- *
- */
-void CCreatorLandmarks::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::ConstructL");
-    iEngine = aEngine;
-    iLandmarkDb = CPosLandmarkDatabase::OpenL();
-    if( iLandmarkDb->IsInitializingNeeded() )
-        {
-        ExecuteAndDeleteLD(iLandmarkDb->InitializeL());
-        }
-    }
-
-/**
- *
- */
-CCreatorLandmarks::~CCreatorLandmarks()
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::~CCreatorLandmarks");
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidLandmarks ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    delete iLandmarkDb;
-    delete iLmOperation;
-    delete iParameters;
-    }
-
-/**
- *
- */
-TBool CCreatorLandmarks::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::AskDataFromUserL");
-    if ( aCommand == ECmdDeleteLandmarks )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all Landmarks?") );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorLandmarks )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all Landmarks created with Creator?") );
-        }
-    return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many landmarks to create?"));    
-    }
-
-/**
- * Convert global category id to local category id
- */
-TPosLmItemId CCreatorLandmarks::GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID )
-{
-    CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL( *iLandmarkDb );
-    CleanupStack::PushL( categoryManager );
-
-    // Find ID of the given global category in given database
-    TPosLmItemId id = categoryManager->GetGlobalCategoryL( aGlobalCategoryID );
-    CleanupStack::PopAndDestroy(); // categoryManager
-    return id;
-}
-
-/**
- *
- */
-TInt CCreatorLandmarks::CreateLandmarkEntryL(CLandmarkParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::CreateLandmarkEntryL");
-    TInt err = KErrNone;
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-        
-    CLandmarkParameters* parameters = aParameters;
-        
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CLandmarkParameters;
-        parameters = iParameters;
-            
-        TBuf<160> company = iEngine->RandomString(CCreatorEngine::ECompany);
-
-        parameters->SetRandomNameL(*iEngine);
-        parameters->SetRandomUrlL(*iEngine);
-        parameters->AddRandomCategoryL(*iEngine);
-        parameters->SetRandomStreetL(*iEngine);
-        parameters->SetRandomCityL(*iEngine);
-        parameters->SetRandomStateL(*iEngine);
-        parameters->SetRandomCountryL(*iEngine);
-        parameters->SetRandomPostCodeL(*iEngine);
-        parameters->SetRandomLatitudeL(*iEngine);
-        parameters->SetRandomLongitudeL(*iEngine);
-        parameters->SetRandomPositionAccuracyL(*iEngine);
-        parameters->SetRandomAltitudeL(*iEngine);
-        parameters->SetRandomAltitudeAccuracyL(*iEngine);
-        parameters->SetRandomDescriptionL(*iEngine);
-        parameters->SetRandomPhoneNumberL(*iEngine);
-        }
-    
-    CPosLandmark* newLandmark = CPosLandmark::NewLC();        
-    TCoordinate crd(parameters->iLatitude, parameters->iLongitude, parameters->iAltitude);
-    TLocality loc(crd, parameters->iPositionAccuracy, parameters->iAltitudeAccuracy);
-    newLandmark->SetPositionL(loc);
-    
-    // Add categories
-    for( TInt i = 0; i < parameters->iCategories.Count(); ++i )
-        {
-        newLandmark->AddCategoryL(GetCategoryIdL(parameters->iCategories[i]));
-        }
-    if( parameters->iName )    
-        newLandmark->SetLandmarkNameL(parameters->iName->Des());    
-    if( parameters->iCountry )
-        newLandmark->SetPositionFieldL(EPositionFieldCountry, parameters->iCountry->Des());
-    if( parameters->iCity )
-        newLandmark->SetPositionFieldL(EPositionFieldCity, parameters->iCity->Des());
-    if( parameters->iPostCode )
-        newLandmark->SetPositionFieldL(EPositionFieldPostalCode, parameters->iPostCode->Des());
-    if( parameters->iState )
-        newLandmark->SetPositionFieldL(EPositionFieldState, parameters->iState->Des());
-    if( parameters->iStreet )
-        newLandmark->SetPositionFieldL(EPositionFieldStreet, parameters->iStreet->Des());
-    if( parameters->iPhonenumber )
-        newLandmark->SetPositionFieldL(EPositionFieldBuildingTelephone, parameters->iPhonenumber->Des());
-    if( parameters->iDescription )
-        newLandmark->SetLandmarkDescriptionL(parameters->iDescription->Des());    
-    if( parameters->iUrl )
-        newLandmark->SetPositionFieldL(EPositionFieldMediaLinksStart, parameters->iUrl->Des());
-    
-    TRAP(err, iLandmarkDb->AddLandmarkL(*newLandmark));
-    
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( newLandmark->LandmarkId() );
-
-    ExecuteAndDeleteLD(iLandmarkDb->CompactL());
-    
-    CleanupStack::PopAndDestroy(newLandmark);
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorLandmarks::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::DeleteAllL");
-    ExecuteAndDeleteLD( iLandmarkDb->RemoveAllLandmarksL() );
-    ExecuteAndDeleteLD( iLandmarkDb->CompactL() );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Landmarks related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidLandmarks );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorLandmarks::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidLandmarks );
-    
-    // delete entries
-    TRAP_IGNORE(
-        ExecuteAndDeleteLD( iLandmarkDb->RemoveLandmarksL( iEntryIds ) );
-        ExecuteAndDeleteLD( iLandmarkDb->CompactL() );
-        );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Landmarks related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidLandmarks );
-    }
-
-
--- a/creator/src/creator_landmarkelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_landmarkelement.h"
-#include "creator_traces.h"
-#include "creator_landmark.h"
-
-using namespace creatorlandmark;
-
-/*
- * 
- */
-CCreatorLandmarkElement* CCreatorLandmarkElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorLandmarkElement* self = new (ELeave) CCreatorLandmarkElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorLandmarkElement::CCreatorLandmarkElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-void CCreatorLandmarkElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt lmAmount = 1;    
-    if( amountAttr )
-        {
-        lmAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create note entries, the amount of entries is defined by noteAmount:
-        for( TInt cI = 0; cI < lmAmount; ++cI )
-            {            
-            CLandmarkParameters* param = new (ELeave) CLandmarkParameters;
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                TBool useRandom = EFalse;
-                if( randomAttr || elemContent.Length() == 0 )
-                    {
-                    useRandom = ETrue;
-                    }
-                
-                if( elemName == KName )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomNameL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iName, elemContent);
-                        }
-                    }
-                else if( elemName == KCategory )
-                    {
-                    if( useRandom )
-                        {
-                        param->AddRandomCategoryL(*iEngine);
-                        }                    
-                    else
-                        {
-                        TPosLmItemId categoryId = CCreatorLandmarks::GetCategoryIdL(elemContent);
-                        if( categoryId > 0 )
-                            {
-                            param->iCategories.AppendL(categoryId);
-                            }
-                        }
-                    }
-                else if( elemName == KDescription )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomDescriptionL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iDescription, elemContent);
-                        }
-                    }
-                else if( elemName == KStreet )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomStreetL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iStreet, elemContent);
-                        }
-                    }
-                else if( elemName == KPostalcode )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomPostCodeL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iPostCode, elemContent);
-                        }
-                    }
-                else if( elemName == KCity )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomCityL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iCity, elemContent);
-                        }
-                    }
-                else if( elemName == KState )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomStateL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iState, elemContent);
-                        }
-                    }
-                else if( elemName == KCountry )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomCountryL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iCountry, elemContent);
-                        }
-                    }
-                else if( elemName == KPhonenumber )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomPhoneNumberL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iPhonenumber, elemContent);
-                        }
-                    }
-                else if( elemName == KUrl )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomUrlL(*iEngine);
-                        }                    
-                    else
-                        {
-                        SetContentToTextParamL(param->iUrl, elemContent);
-                        }
-                    }
-                else if( elemName == KLatitude )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomLatitudeL(*iEngine);
-                        }                    
-                    else
-                        {
-                        ConvertStrToReal64L(elemContent, param->iLatitude);
-                        }
-                    }
-                else if( elemName == KLongitude )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomLongitudeL(*iEngine);
-                        }                    
-                    else
-                        {
-                        ConvertStrToReal64L(elemContent, param->iLongitude);
-                        }
-                    }
-                else if( elemName == KPositionaccuracy )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomPositionAccuracyL(*iEngine);
-                        }                    
-                    else
-                        {
-                        param->iPositionAccuracy = ConvertStrToIntL(elemContent);
-                        }
-                    }
-                else if( elemName == KAltitude )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomAltitudeL(*iEngine);
-                        }                    
-                    else
-                        {
-                        ConvertStrToReal32L(elemContent, param->iAltitude);
-                        }
-                    }
-                else if( elemName == KAltitudeaccuracy )
-                    {
-                    if( useRandom )
-                        {
-                        param->SetRandomAltitudeAccuracyL(*iEngine);
-                        }                    
-                    else
-                        {
-                        param->iAltitudeAccuracy = ConvertStrToIntL(elemContent);
-                        }
-                    }
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryLandmarks, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryLandmarks, 0, lmAmount);
-    	}
-    }
--- a/creator/src/creator_log.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <cntdef.h>
-
-#include "creator_log.h" 
-#include "creator_traces.h"
-
-static const TInt KLogsFieldLength = 256;
-
-//_LIT(KCreatorLogsPrefixName, "CR_");
-
-//----------------------------------------------------------------------------
-
-CLogsParameters::CLogsParameters()
-    {
-    LOGSTRING("Creator: CLogsParameters::CLogsParameters");
-
-    iPhoneNumber = HBufC::New(KLogsFieldLength);
-    /*iMissedCallPhoneNumber = HBufC::New(KLogsFieldLength);
-    iReceivedCallPhoneNumber = HBufC::New(KLogsFieldLength);
-    iDialledNumberPhoneNumber = HBufC::New(KLogsFieldLength);*/
-    }
-
-CLogsParameters::~CLogsParameters()
-    {
-    LOGSTRING("Creator: CLogsParameters::~CLogsParameters");
-
-    delete iPhoneNumber;
-    /*delete iDialledNumberPhoneNumber;
-    delete iReceivedCallPhoneNumber;
-    delete iMissedCallPhoneNumber;*/
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorLogs* CCreatorLogs::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorLogs* self = CCreatorLogs::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorLogs* CCreatorLogs::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorLogs* self = new (ELeave) CCreatorLogs;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorLogs::CCreatorLogs() : CActive(0)
-    {
-    }
-
-void CCreatorLogs::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorLogs::ConstructL");
-
-    iEngine = aEngine;
-
-    iLogClient = CLogClient::NewL(CEikonEnv::Static()->FsSession());
-    iLogEvent = CLogEvent::NewL();
-
-	CActiveScheduler::Add(this); // needed by CActive
-    }
-
-CCreatorLogs::~CCreatorLogs()
-    {
-    LOGSTRING("Creator: CCreatorLogs::~CCreatorLogs");
-
-    Cancel(); //from CActive
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidLogs ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    delete iLogEvent;
-    delete iLogClient;
-
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorLogs::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
-    if ( aCommand == ECmdDeleteLogs )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all log entries?") );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorLogs )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all log entries created with Creator?") );
-        }
-    return iEngine->EntriesQueryDialogL( aNumberOfEntries, _L("How many entries to create?") );
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorLogs::RunL()
-	{
-    LOGSTRING("Creator: CCreatorLogs::RunL");
-
-    // log writing finished, stop the async waiting
-    iLogWriteWait.AsyncStop();
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorLogs::DoCancel()
-	{
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorLogs::CreateMissedCallEntryL(CLogsParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorLogs::CreateMissedCallEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CLogsParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CLogsParameters;
-        parameters = iParameters;
-
-        /*iParameters->iMissedCallPhoneNumber->Des().Zero();
-        iParameters->iMissedCallPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-
-        iParameters->iMissedCallEventTime.UniversalTime();
-        iParameters->iMissedCallEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );*/
-        parameters->iPhoneNumber->Des().Zero();
-        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-        
-        parameters->iEventTime.UniversalTime();
-        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
-
-        }
-    
-    // defaults
-    iLogEvent->SetId( KLogNullIdCreator );    
-    iLogEvent->SetEventType( KNullUid );
-    iLogEvent->SetRemoteParty( KNullDesC );
-    iLogEvent->SetDirection( KNullDesC );
-    iLogEvent->SetTime( Time::NullTTime() );
-    iLogEvent->SetDurationType( KLogNullDurationTypeCreator );
-    iLogEvent->SetDuration( KLogNullDurationCreator );
-    iLogEvent->SetStatus( KNullDesC );
-    iLogEvent->SetSubject( KNullDesC );
-    iLogEvent->SetNumber( KNullDesC );
-    iLogEvent->SetContact( KNullContactId );
-    iLogEvent->SetLink( KLogNullLinkCreator );
-    iLogEvent->SetDescription( KNullDesC );
-    iLogEvent->SetFlags( KLogNullFlags );
-    iLogEvent->SetEventType(KLogCallEventTypeUid);
-    iLogEvent->SetSubject(_L("A"));
-
-    // set direction
-    TLogString missed;
-    iLogClient->GetString(missed, R_LOG_DIR_MISSED);
-    iLogEvent->SetDirection(missed);
-
-    // set duration
-    iLogEvent->SetDurationType( KLogDurationNoneCreator );
-    TLogDuration duration = 0;
-    iLogEvent->SetDuration(duration);
-
-    // set the phone number
-    //iLogEvent->SetNumber( iParameters->iMissedCallPhoneNumber->Des() );
-    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
-
-    // set event time
-    //iLogEvent->SetTime( iParameters->iMissedCallEventTime );
-    iLogEvent->SetTime( parameters->iEventTime );
-
-    // start writing
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 150));
-	iLogClient->AddEvent(*iLogEvent, iStatus);
-	SetActive();
-
-    // wait till adding has finished
-    iLogWriteWait.Start();
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( iLogEvent->Id() );
-
-    return iStatus.Int();  // should be KErrNone if writing was succesful
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorLogs::CreateReceivedCallEntryL(CLogsParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorLogs::CreateReceivedCallEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CLogsParameters* parameters = aParameters;
-        
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CLogsParameters;
-        parameters = iParameters;
-
-        /*iParameters->iReceivedCallPhoneNumber->Des().Zero();
-        iParameters->iReceivedCallPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-
-        iParameters->iReceivedCallEventTime.UniversalTime();
-        iParameters->iReceivedCallEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
-
-        iParameters->iReceivedCallDuration = iEngine->RandomNumber(7200);*/
-        parameters->iPhoneNumber->Des().Zero();
-        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-        
-        parameters->iEventTime.UniversalTime();
-        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
-        
-        parameters->iDuration = iEngine->RandomNumber(7200);
-        }
-   
-    // defaults
-    iLogEvent->SetId( KLogNullIdCreator );
-    iLogEvent->SetEventType( KNullUid );
-    iLogEvent->SetRemoteParty( KNullDesC );
-    iLogEvent->SetDirection( KNullDesC );
-    iLogEvent->SetTime( Time::NullTTime() );
-    iLogEvent->SetDurationType( KLogNullDurationTypeCreator );
-    iLogEvent->SetDuration( KLogNullDurationCreator );
-    iLogEvent->SetStatus( KNullDesC );
-    iLogEvent->SetSubject( KNullDesC );
-    iLogEvent->SetNumber( KNullDesC );
-    iLogEvent->SetContact( KNullContactId );
-    iLogEvent->SetLink( KLogNullLinkCreator );
-    iLogEvent->SetDescription( KNullDesC );
-    iLogEvent->SetFlags( KLogNullFlags );
-    iLogEvent->SetEventType(KLogCallEventTypeUid);
-    iLogEvent->SetSubject(_L("A"));
-
-    // set direction
-    TLogString incoming;
-    iLogClient->GetString(incoming, R_LOG_DIR_IN);
-    iLogEvent->SetDirection(incoming);
-
-    // set duration
-    iLogEvent->SetDurationType( KLogDurationValidCreator );
-    //iLogEvent->SetDuration( iParameters->iReceivedCallDuration );
-    iLogEvent->SetDuration( parameters->iDuration );
-
-    // set the phone number
-    //iLogEvent->SetNumber( iParameters->iReceivedCallPhoneNumber->Des() );
-    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
-
-    // set event time
-    //iLogEvent->SetTime( iParameters->iReceivedCallEventTime );
-    iLogEvent->SetTime( parameters->iEventTime );
-
-    // start writing
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 151));
-	iLogClient->AddEvent(*iLogEvent, iStatus);
-	SetActive();
-
-    // wait till adding has finished
-    iLogWriteWait.Start();
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iEntryIds.Append( iLogEvent->Id() );
-
-    return iStatus.Int();  // should be KErrNone if writing was succesful
-    }
-
-//----------------------------------------------------------------------------
-
-
-TInt CCreatorLogs::CreateDialledNumberEntryL(CLogsParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorLogs::CreateDialledNumberEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CLogsParameters* parameters = aParameters; 
-        
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CLogsParameters;
-        parameters = iParameters;
-
-        /*iParameters->iDialledNumberPhoneNumber->Des().Zero();
-        iParameters->iDialledNumberPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-
-        iParameters->iDialledNumberEventTime.UniversalTime();
-        iParameters->iDialledNumberEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
-
-        iParameters->iDialledNumberDuration = iEngine->RandomNumber(7200);*/
-        parameters->iPhoneNumber->Des().Zero();
-        parameters->iPhoneNumber->Des().AppendNum( iEngine->RandomNumber(1000000, 9999999) );
-
-        parameters->iEventTime.UniversalTime();
-        parameters->iEventTime -= TTimeIntervalMinutes( iEngine->RandomNumber(12000) );
-
-        parameters->iDuration = iEngine->RandomNumber(7200);
-
-        }
-   
-    // defaults
-    iLogEvent->SetId( KLogNullIdCreator );
-    iLogEvent->SetEventType( KNullUid );
-    iLogEvent->SetRemoteParty( KNullDesC );
-    iLogEvent->SetDirection( KNullDesC );
-    iLogEvent->SetTime( Time::NullTTime() );
-    iLogEvent->SetDurationType( KLogNullDurationTypeCreator );
-    iLogEvent->SetDuration( KLogNullDurationCreator );
-    iLogEvent->SetStatus( KNullDesC );
-    iLogEvent->SetSubject( KNullDesC );
-    iLogEvent->SetNumber( KNullDesC );
-    iLogEvent->SetContact( KNullContactId );
-    iLogEvent->SetLink( KLogNullLinkCreator );
-    iLogEvent->SetDescription( KNullDesC );
-    iLogEvent->SetFlags( KLogNullFlags );
-    iLogEvent->SetEventType(KLogCallEventTypeUid);
-    iLogEvent->SetSubject(_L("A"));
-
-    // set direction
-    TLogString outgoing;
-    iLogClient->GetString(outgoing, R_LOG_DIR_OUT);
-    iLogEvent->SetDirection(outgoing);
-
-    // set duration
-    iLogEvent->SetDurationType( KLogDurationValidCreator );
-    //iLogEvent->SetDuration( iParameters->iDialledNumberDuration );
-    iLogEvent->SetDuration( parameters->iDuration );
-
-    // set the phone number
-    //iLogEvent->SetNumber( iParameters->iDialledNumberPhoneNumber->Des() );
-    iLogEvent->SetNumber( parameters->iPhoneNumber->Des() );
-
-    // set event time
-    //iLogEvent->SetTime( iParameters->iDialledNumberEventTime );
-    iLogEvent->SetTime( parameters->iEventTime );
-
-    // start writing
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("LogWriter"), 152));
-	iLogClient->AddEvent(*iLogEvent, iStatus);
-	SetActive();
-
-    // wait till adding has finished
-    iLogWriteWait.Start();
-
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( iLogEvent->Id() );
-    
-    return iStatus.Int();  // should be KErrNone if writing was succesful
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorLogs::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorLogs::DeleteAllL");
-    iLogClient->ClearLog( TTime( Time::MaxTTime() ), iStatus ); 
-    SetActive();
-    
-    // wait till delete has finished
-    iLogWriteWait.Start();
-    User::LeaveIfError( iStatus.Int() );
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Logs related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidLogs );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorLogs::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorLogs::DeleteAllCreatedByCreatorL");
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidLogs );
-    
-    // delete entries
-    for ( TInt i = 0; i < iEntryIds.Count(); i++ )
-        {
-        // This could be implemented with while loop
-        // with additional cancel flag. That would enable 
-        // using CancelOp() and cancelling would be bit smoother.
-        // With this for loop implementation all entries will be
-        // deleted whether or not user cancels during logs operation.
-
-        iLogClient->DeleteEvent( iEntryIds[i], iStatus );
-        SetActive();        
-        // wait till delete has finished
-        iLogWriteWait.Start();
-        }
-    
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Logs related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidLogs );
-    }
--- a/creator/src/creator_logelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_logelement.h"
-#include "creator_traces.h"
-#include "creator_log.h"
-
-using namespace creatorlog;
-
-/*
- * 
- */
-CCreatorLogElement* CCreatorLogElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorLogElement* self = new (ELeave) CCreatorLogElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorLogElement::CCreatorLogElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-/*
- * 
- */
-void CCreatorLogElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt logAmount = 1;    
-    if( amountAttr )
-        {
-        logAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create log entries, the amount of entries is defined by logAmount:
-        for( TInt cI = 0; cI < logAmount; ++cI )
-            {
-            TInt direction = -1;
-            CLogsParameters* param = new (ELeave) CLogsParameters;
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName(KRandomLength);
-                const CCreatorScriptAttribute* increaseAttr = field->FindAttributeByName(KIncrease);
-                TBool increase( EFalse );
-                if ( increaseAttr )
-                    {
-                    increase = ConvertStrToBooleanL( increaseAttr->Value() );
-                    }
-                
-                if( elemName == KDirection )
-                    {
-                    direction = GetLogCommandL(elemContent, randomAttr || elemContent.Length() == 0); 
-                    }
-                else if( elemName == KDuration )
-                    {
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        param->iDuration = iEngine->RandomNumber(7200);
-                        }
-                    else
-                        {
-                        param->iDuration = ConvertStrToIntL(elemContent);
-                        }
-                    }
-                else if( elemName == KPhonenumber )
-                    {
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        SetContentToTextParamL(param->iPhoneNumber, iEngine->RandomString(CCreatorEngine::EPhoneNumber));
-                        }
-                    else
-                        {
-                        if ( increase )
-                            {
-                            delete param->iPhoneNumber;
-                            param->iPhoneNumber = NULL;
-                            param->iPhoneNumber = HBufC::NewL( elemContent.Length() + 3 );
-                            IncreasePhoneNumL( elemContent, cI, param->iPhoneNumber );
-                            }
-                        else
-                            {
-                            SetContentToTextParamL(param->iPhoneNumber, elemContent);
-                            }
-                        }                    
-                    }
-                else if( elemName == KDatetime )
-                    {
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        param->iEventTime = iEngine->RandomTime(iEngine->RandomDate(CCreatorEngine::EDatePast), CCreatorEngine::EDatePast); 
-                        }
-                    else
-                        {
-                        param->iEventTime = ConvertToDateTimeL(elemContent);
-                        }
-                    }
-                }
-            
-            if( direction == -1 )
-                {
-                direction = GetLogCommandL(KEmpty, ETrue); 
-                }
-            iEngine->AppendToCommandArrayL(direction, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	for(TInt i = 0; i < logAmount; ++i )
-    		{
-    		iEngine->AppendToCommandArrayL(GetLogCommandL(KEmpty, ETrue), 0, 1);
-    		}
-    	}
-    }
-
-TInt CCreatorLogElement::GetLogCommandL( const TDesC& aLogCmdStr, TBool aRandom ) const
-    {      
-    if( aRandom )
-        {
-        TInt commandArray[] = {
-                    ECmdCreateLogEntryMissedCalls,
-                    ECmdCreateLogEntryReceivedCalls,
-                    ECmdCreateLogEntryDialledNumbers
-            };
-        return commandArray[iEngine->RandomNumber(0, 2)];
-        }
-    
-    if( CompareIgnoreCase(aLogCmdStr, KMissed) == 0 )
-        return ECmdCreateLogEntryMissedCalls;
-    else if( CompareIgnoreCase(aLogCmdStr, KIn) == 0 )
-        return ECmdCreateLogEntryReceivedCalls;
-    else if( CompareIgnoreCase(aLogCmdStr, KOut) == 0 )
-        return ECmdCreateLogEntryDialledNumbers;
-    
-    LOGSTRING2("CCreatorLogElement::GetLogCommandL: Unknown log direction: %S", &aLogCmdStr);
-    User::Leave(KErrNotFound);
-    return -1; // Not reached, but disables compiler warning...
-    }
--- a/creator/src/creator_mailbox.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,793 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_mailbox.h" 
-#include "creator_traces.h"
-
-#include <etelmm.h>
-#include <msvapi.h>
-
-static const TInt KMailboxesFieldLength = 160;
-
-_LIT(KCreatorMailboxesPrefixName, "CR_");
-
-_LIT(KDefaultIncomingServer, "mail.example.com");
-_LIT(KDefaultOutgoingServer, "smtp.example.com");
-_LIT(KInternet, "internet");
-
-
-//----------------------------------------------------------------------------
-
-CMailboxesParameters::CMailboxesParameters()
-    {
-    LOGSTRING("Creator: CMailboxesParameters::CMailboxesParameters");
-
-    iIncomingPort = KUndef;
-    iOutgoingPort = KUndef;
-    iMaxEmailSize = KUndef;
-    iSyncRate = KUndef;
-    iAttachmentFetchSize = KUndef;
-    iAttachmentSizeLimit = KUndef;
-    iBodyTextSizeLimit = KUndef;
-    iAttachmentFetchSize = KUndef;
-    iInboxSyncLimit = -1; // -1 = All
-    iMailboxSyncLimit = -1; // -1 = All    
-    iToCCIncludeLimit = KUndef;
-    iImapIdleTimeout = KUndef;
-    
-    /*iMailboxName = HBufC::New(KMailboxesFieldLength);
-    iAccessPoint = HBufC::New(KMailboxesFieldLength);
-    iMyMailAddress = HBufC::New(KMailboxesFieldLength);
-    iOutgoingMailServer = HBufC::New(KMailboxesFieldLength);
-    iUserName = HBufC::New(KMailboxesFieldLength);
-    iPassword = HBufC::New(KMailboxesFieldLength);
-    iIncomingMailServer = HBufC::New(KMailboxesFieldLength);*/
-    }
-
-CMailboxesParameters::~CMailboxesParameters()
-    {
-    LOGSTRING("Creator: CMailboxesParameters::~CMailboxesParameters");
-
-    /*delete iIncomingMailServer;
-    delete iPassword;
-    delete iUserName;
-    delete iOutgoingMailServer;
-    delete iMyMailAddress;
-    delete iAccessPoint;
-    delete iMailboxName;*/
-    
-    delete iMailboxName;
-    delete iIncomingLoginName;
-    delete iIncomingPassword;
-    delete iIncomingServerName;
-    delete iIncomingConnectionMethod;
-    delete iIncomingFolderPath;
-    delete iPathSeparator;
-    delete iOutgoingLoginName;
-    delete iOutgoingPassword;
-    delete iOutgoingServerName;
-    delete iOutgoingConnectionMethod;
-    delete iOwnEmailAddress;
-    delete iOwnEmailAlias;
-    delete iReceiptAddress;
-    delete iReplyToAddress;
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorMailboxes* CCreatorMailboxes::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorMailboxes* self = CCreatorMailboxes::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorMailboxes* CCreatorMailboxes::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorMailboxes* self = new (ELeave) CCreatorMailboxes;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorMailboxes::CCreatorMailboxes()
-    {    
-    }
-
-void CCreatorMailboxes::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::ConstructL");
-
-    iEngine = aEngine;
-    }
-
-CCreatorMailboxes::~CCreatorMailboxes()
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::~CCreatorMailboxes");
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidMailbox ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorMailboxes::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::AskDataFromUserL");
-    if ( aCommand == ECmdDeleteMailboxes )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all mailboxes?") );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorMailboxes )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all mailboxes created with Creator?") );
-        }
-    return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMailboxes::CreateMailboxEntryL(CMailboxesParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::CreateMailboxEntryL");
-
-      // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CMailboxesParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CMailboxesParameters;
-        parameters = iParameters;
-
-        TPtrC company(iEngine->RandomString(CCreatorEngine::ECompany));
-        TPtrC firstName(iEngine->RandomString(CCreatorEngine::EFirstName));
-        
-        delete parameters->iMailboxName;
-        parameters->iMailboxName = 0;
-        parameters->iMailboxName = HBufC::NewL(KMailboxesFieldLength);
-        parameters->iMailboxName->Des() = KCreatorMailboxesPrefixName;
-        parameters->iMailboxName->Des().Append( company );
-        parameters->iMailboxName->Des().Append(_L(" #"));
-        parameters->iMailboxName->Des().AppendNum(iEngine->RandomNumber(1, 100));
-        
-        delete parameters->iIncomingLoginName;
-        parameters->iIncomingLoginName = 0;
-        parameters->iIncomingLoginName = HBufC::NewL(KMailboxesFieldLength); 
-        delete parameters->iOutgoingLoginName;
-        parameters->iOutgoingLoginName = 0;
-        parameters->iOutgoingLoginName = HBufC::NewL(KMailboxesFieldLength); 
-        parameters->iIncomingLoginName->Des() = iEngine->RandomString(CCreatorEngine::EFirstName);
-        parameters->iIncomingLoginName->Des().LowerCase();
-        parameters->iOutgoingLoginName->Des().Copy(parameters->iIncomingLoginName->Des());
-        
-        delete parameters->iIncomingPassword;
-        parameters->iIncomingPassword = 0;
-        parameters->iIncomingPassword = HBufC::NewL(KMailboxesFieldLength); 
-        delete parameters->iOutgoingPassword;
-        parameters->iOutgoingPassword = 0;
-        parameters->iOutgoingPassword = HBufC::NewL(KMailboxesFieldLength); 
-        parameters->iIncomingPassword->Des() = iEngine->RandomString(CCreatorEngine::ESurname);
-        parameters->iIncomingPassword->Des().LowerCase();
-        parameters->iOutgoingPassword->Des().Copy(parameters->iIncomingPassword->Des());
-        
-        delete parameters->iIncomingServerName;
-        parameters->iIncomingServerName = 0;
-        parameters->iIncomingServerName = HBufC::NewL(KMailboxesFieldLength); 
-        parameters->iIncomingServerName->Des() = _L("incoming.");
-        parameters->iIncomingServerName->Des().Append(company);
-        parameters->iIncomingServerName->Des().Append(_L(".com"));
-        parameters->iIncomingServerName->Des().LowerCase();
-                
-        delete parameters->iIncomingConnectionMethod;
-        parameters->iIncomingConnectionMethod = 0;
-        parameters->iIncomingConnectionMethod = HBufC::NewL(KInternet().Length());
-        parameters->iIncomingConnectionMethod->Des() = KInternet;  // use always this one, if it's not found, default will be used instead
-        
-        delete parameters->iOutgoingServerName;
-        parameters->iOutgoingServerName = 0;
-        parameters->iOutgoingServerName = HBufC::NewL(KMailboxesFieldLength); 
-        parameters->iOutgoingServerName->Des() = _L("smtp.");
-        parameters->iOutgoingServerName->Des().Append(company);
-        parameters->iOutgoingServerName->Des().Append(_L(".com"));
-        parameters->iOutgoingServerName->Des().LowerCase();
-        
-        delete parameters->iOutgoingConnectionMethod;
-        parameters->iOutgoingConnectionMethod = 0;
-        parameters->iOutgoingConnectionMethod = HBufC::NewL(KInternet().Length());
-        parameters->iOutgoingConnectionMethod->Des() = KInternet;  // use always this one, if it's not found, default will be used instead
-
-        delete parameters->iOwnEmailAddress;
-        parameters->iOwnEmailAddress = 0;
-        parameters->iOwnEmailAddress = iEngine->CreateEmailAddressLC();
-        parameters->iOwnEmailAddress->Des().LowerCase();
-        CleanupStack::Pop(); // parameters->iOwnEmailAddress
-        
-        delete parameters->iOwnEmailAlias;
-        parameters->iOwnEmailAlias = 0;
-        parameters->iOwnEmailAlias = HBufC::NewL(firstName.Length());        
-        parameters->iOwnEmailAlias->Des().Copy(firstName);       
-
-        delete parameters->iReceiptAddress;
-        parameters->iReceiptAddress = 0;
-        parameters->iReceiptAddress = iEngine->CreateEmailAddressLC();
-        parameters->iReceiptAddress->Des().LowerCase();
-        CleanupStack::Pop(); // parameters->iReceiptAddress
-        
-        delete parameters->iReplyToAddress;
-        parameters->iReplyToAddress = 0;
-        parameters->iReplyToAddress = iEngine->CreateEmailAddressLC();
-        parameters->iReplyToAddress->Des().LowerCase();
-        CleanupStack::Pop(); // parameters->iReplyToAddress
-        
-        parameters->iIncomingSSLWrapper = iEngine->RandomNumber(0, 1);
-        parameters->iIncomingSecureSockets = iEngine->RandomNumber(0, 1);        
-        parameters->iAcknowledgeReceipts = iEngine->RandomNumber(0, 1);
-        parameters->iAutoSendOnConnect = iEngine->RandomNumber(0, 1);
-        parameters->iDeleteEmailsAtDisconnect = iEngine->RandomNumber(0, 1);
-        parameters->iImapIdleCommand = iEngine->RandomNumber(0, 1);
-        parameters->iMarkSeenInSync = iEngine->RandomNumber(0, 1);
-        parameters->iEnableExpungeMode = iEngine->RandomNumber(0, 1);
-        parameters->iUseApop = iEngine->RandomNumber(0, 1);
-        parameters->iDisconnectedUserMode = iEngine->RandomNumber(0, 1);                
-        parameters->iOutgoingSSLWrapper = iEngine->RandomNumber(0, 1);
-        parameters->iOutgoingSecureSockets = iEngine->RandomNumber(0, 1);
-        parameters->iIncludeSignature = EFalse;
-        parameters->iAddVCard = EFalse;
-        parameters->iRequestReceipts = iEngine->RandomNumber(0, 1);
-        parameters->iSmtpAuth = iEngine->RandomNumber(0, 1);
-        
-        parameters->iIncomingPort = iEngine->RandomNumber(25, 500);
-        parameters->iAttachmentSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
-        parameters->iBodyTextSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
-        parameters->iAttachmentFetchSize = iEngine->RandomNumber(1, 40960);
-        parameters->iImapIdleTimeout = iEngine->RandomNumber(10, 2000);
-        parameters->iMaxEmailSize = iEngine->RandomNumber(1024, KMaxTInt);
-        parameters->iSyncRate = iEngine->RandomNumber(10, 500);        
-        parameters->iInboxSyncLimit = iEngine->RandomNumber(-1, 256);
-        parameters->iMailboxSyncLimit = iEngine->RandomNumber(-1, 256);
-        parameters->iOutgoingPort = KDefaultSmtpPort;
-        parameters->iToCCIncludeLimit = iEngine->RandomNumber(0, 30);                      
-        
-        parameters->iGetEmailOptions = (CMailboxesParameters::TGetEmailOption) iEngine->RandomNumber(CMailboxesParameters::EUndef, CMailboxesParameters::EGetEmailOptionLast-1);
-        parameters->iSubscribeType = (TFolderSubscribeType) iEngine->RandomNumber(EUpdateNeither, EUpdateBoth);
-        parameters->iSyncType = (TFolderSyncType) iEngine->RandomNumber(EUseCombination, EUseRemote);
-        parameters->iSendCopyToSelf = (TImSMTPSendCopyToSelf) iEngine->RandomNumber(ESendNoCopy, ESendCopyAsBccRecipient);
-        parameters->iSendOption = (TImSMTPSendMessageOption) iEngine->RandomNumber(ESendMessageImmediately, ESendMessageOnRequest);
-        parameters->iMailboxType = (TMailboxType) iEngine->RandomNumber(EMailboxPOP3, EMailboxIMAP4);
-        }
-   
-    TInt err = KErrNone;
-    
-    // make sure we have some IMEI stored
-    if (iIMEI.Length() == 0)
-        {
-        TRAP(err, GetIMEIFromThePhoneL());
-        }
-
-    // init 
-    CImImap4Settings* imap4Set = new(ELeave) CImImap4Settings;
-    CleanupStack::PushL(imap4Set);
-    CImPop3Settings* pop3Set = new(ELeave) CImPop3Settings;
-    CleanupStack::PushL(pop3Set);
-    CImSmtpSettings* smtpSet = new(ELeave) CImSmtpSettings;
-    CleanupStack::PushL(smtpSet);
-    CImIAPPreferences* outgoingIAPSet = CImIAPPreferences::NewLC();
-    CImIAPPreferences* incomingIAPSet = CImIAPPreferences::NewLC();
-    CEmailAccounts* account = CEmailAccounts::NewLC();
-  
-    // Get SMTP settings:
-    PopulateSmtpSettingsL(*account, *smtpSet, *outgoingIAPSet, *parameters);
-  
-    // appending mailbox type to array to be able to use
-    // correct type when deleting mailboxes
-    iEntryIds.Append( parameters->iMailboxType );
-    
-    if (parameters->iMailboxType == EMailboxIMAP4)
-        {
-        // Get IMAP settings:
-        PopulateImapSettingsL(*account, *imap4Set, *incomingIAPSet, *parameters);
-        TImapAccount imapAccountId = account->CreateImapAccountL(parameters->iMailboxName->Des(), *imap4Set, *incomingIAPSet, EFalse);
-        TSmtpAccount smtpAccountId = account->CreateSmtpAccountL(imapAccountId, *smtpSet, *outgoingIAPSet, EFalse);
-        account->SetDefaultSmtpAccountL(smtpAccountId);
-
-        iEntryIds.Append( imapAccountId.iImapAccountId );
-        iEntryIds.Append( imapAccountId.iImapService );
-        iEntryIds.Append( imapAccountId.iSmtpService );      
-        iEntryIds.Append( smtpAccountId.iSmtpAccountId );
-        iEntryIds.Append( smtpAccountId.iSmtpService );
-        iEntryIds.Append( smtpAccountId.iRelatedService );
-        
-        StoreIMEIToEntryL( imapAccountId.iImapService );
-        StoreIMEIToEntryL( smtpAccountId.iSmtpService );
-        }
-    else
-        {
-        // Get POP settings:
-        PopulatePopSettingsL(*account, *pop3Set, *incomingIAPSet, *parameters);
-        TPopAccount popAccountId = account->CreatePopAccountL(parameters->iMailboxName->Des(), *pop3Set, *incomingIAPSet, EFalse);
-        TSmtpAccount smtpAccountId = account->CreateSmtpAccountL(popAccountId, *smtpSet, *outgoingIAPSet, EFalse);     
-        account->SetDefaultSmtpAccountL(smtpAccountId);
-        
-        iEntryIds.Append( popAccountId.iPopAccountId );
-        iEntryIds.Append( popAccountId.iPopService );
-        iEntryIds.Append( popAccountId.iSmtpService );
-        iEntryIds.Append( smtpAccountId.iSmtpAccountId );
-        iEntryIds.Append( smtpAccountId.iSmtpService );
-        iEntryIds.Append( smtpAccountId.iRelatedService );
-
-        StoreIMEIToEntryL( popAccountId.iPopService );
-        StoreIMEIToEntryL( smtpAccountId.iSmtpService );
-        }  
-    CleanupStack::PopAndDestroy(6); //imap4Set, pop3Set, smtpSet, outgoingIAPSet, incomingIAPSet, account 
-        
-    return err;
-    }
-
-void CCreatorMailboxes::PopulateImapSettingsL( 
-            CEmailAccounts& aEmailAccount, 
-            CImImap4Settings& aImapSettings, 
-            CImIAPPreferences& aIApSettings, 
-            const CMailboxesParameters& aParameters )
-    {
-    // Get default settings first:
-    aEmailAccount.PopulateDefaultImapSettingsL(aImapSettings, aIApSettings);
-    
-    TImIAPChoice iapChoice;
-    iapChoice.iIAP = 0;
-    if( aParameters.iIncomingConnectionMethod == 0 || 
-        aParameters.iIncomingConnectionMethod->Des().Length() == 0 )
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
-        }
-    else
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iIncomingConnectionMethod->Des()));
-        }
-    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
-    aIApSettings.AddIAPL(iapChoice);
-    
-    TBuf8<256> buf8;
-    if( aParameters.iIncomingLoginName && aParameters.iIncomingLoginName->Length() > 0 )                
-        buf8.Copy(aParameters.iIncomingLoginName->Des());
-    else
-        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
-    aImapSettings.SetLoginNameL(buf8);  //8
-    
-    if( aParameters.iIncomingPassword && aParameters.iIncomingPassword->Length() > 0 )
-        buf8.Copy(aParameters.iIncomingPassword->Des());    
-    else
-        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
-    aImapSettings.SetPasswordL(buf8);  //8
-    
-    if( aParameters.iIncomingFolderPath && aParameters.iIncomingFolderPath->Length() > 0 )
-        {
-        buf8.Copy(aParameters.iIncomingFolderPath->Des());
-        aImapSettings.SetFolderPathL(buf8);
-        }
-    
-    if( aParameters.iPathSeparator && aParameters.iPathSeparator->Length() > 0 )
-        aImapSettings.SetPathSeparator(aParameters.iIncomingFolderPath->Des()[0]);
-    
-    aImapSettings.SetDisconnectedUserMode(aParameters.iDisconnectedUserMode);
-    aImapSettings.SetSynchronise(aParameters.iSyncType);
-    aImapSettings.SetSubscribe(aParameters.iSubscribeType);
-    aImapSettings.SetAutoSendOnConnect(aParameters.iAutoSendOnConnect);
-    
-    if(aParameters.iMaxEmailSize != KUndef )
-        aImapSettings.SetMaxEmailSize(aParameters.iMaxEmailSize);
-    
-    aImapSettings.SetDeleteEmailsWhenDisconnecting(aParameters.iDeleteEmailsAtDisconnect);
-    aImapSettings.SetAcknowledgeReceipts(aParameters.iAcknowledgeReceipts);
-            
-    if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyText )
-        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyText);
-    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyTextAndAttachments )
-        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
-    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetAttachments )
-        aImapSettings.SetGetMailOptions(EGetImap4EmailAttachments);
-    else if(aParameters.iGetEmailOptions == CMailboxesParameters::EGetBodyAlternativeText )
-        aImapSettings.SetGetMailOptions(EGetImap4EmailBodyAlternativeText);
-    else
-        aImapSettings.SetGetMailOptions(EGetImap4EmailHeaders); // Default
-    
-    if( aParameters.iInboxSyncLimit != KUndef )
-        aImapSettings.SetInboxSynchronisationLimit(aParameters.iInboxSyncLimit);
-    
-    if( aParameters.iMailboxSyncLimit != KUndef )
-        aImapSettings.SetMailboxSynchronisationLimit(aParameters.iMailboxSyncLimit);
-    
-    aImapSettings.SetUpdatingSeenFlags(aParameters.iMarkSeenInSync);
-    
-    if( aParameters.iSyncRate != KUndef )
-        aImapSettings.SetSyncRateL(aParameters.iSyncRate);
-    
-    if( aParameters.iAttachmentFetchSize != KUndef )
-        aImapSettings.SetFetchSizeL(aParameters.iAttachmentFetchSize);
-    
-    aImapSettings.SetImapIdle(aParameters.iImapIdleCommand);
-    if( aParameters.iImapIdleTimeout != KUndef )
-        aImapSettings.SetImapIdleTimeoutL(aParameters.iImapIdleTimeout);
-    
-    if( aParameters.iBodyTextSizeLimit != KUndef )
-        aImapSettings.SetBodyTextSizeLimitL(aParameters.iBodyTextSizeLimit);
-    
-    if( aParameters.iAttachmentSizeLimit != KUndef )
-        aImapSettings.SetAttachmentSizeLimitL(aParameters.iAttachmentSizeLimit);
-    
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-    aImapSettings.SetUseExpunge(aParameters.iEnableExpungeMode);
-#endif
-    
-    if(aParameters.iIncomingServerName && aParameters.iIncomingServerName->Length() > 0 )
-        aImapSettings.SetServerAddressL(aParameters.iIncomingServerName->Des());
-    else
-        aImapSettings.SetServerAddressL(KDefaultIncomingServer);
-        
-    if( aParameters.iIncomingPort != KUndef )
-        aImapSettings.SetPort(aParameters.iIncomingPort);                 
-      
-    aImapSettings.SetSecureSockets(aParameters.iIncomingSecureSockets);
-    aImapSettings.SetSSLWrapper(aParameters.iIncomingSSLWrapper);
-    }
-
-void CCreatorMailboxes::PopulatePopSettingsL( 
-            CEmailAccounts& aEmailAccount, 
-            CImPop3Settings& aPopSettings, 
-            CImIAPPreferences& aIApSettings, 
-            const CMailboxesParameters& aParameters )
-    {
-    aEmailAccount.PopulateDefaultPopSettingsL(aPopSettings, aIApSettings);
-    
-    TImIAPChoice iapChoice;
-    iapChoice.iIAP = 0;
-    if( aParameters.iIncomingConnectionMethod == 0 || 
-        aParameters.iIncomingConnectionMethod->Des().Length() == 0 )
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
-        }
-    else
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iIncomingConnectionMethod->Des() ));
-        }
-    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
-    aIApSettings.AddIAPL(iapChoice);
-    
-    TBuf8<256> buf8;
-    if( aParameters.iIncomingLoginName && aParameters.iIncomingLoginName->Length() > 0 )                
-        buf8.Copy(aParameters.iIncomingLoginName->Des());
-    else
-        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
-    aPopSettings.SetLoginNameL(buf8);  //8
-        
-    if( aParameters.iIncomingPassword && aParameters.iIncomingPassword->Length() > 0 )
-        buf8.Copy(aParameters.iIncomingPassword->Des());    
-    else
-        buf8.Copy(iEngine->RandomString(CCreatorEngine::EFirstName));
-    aPopSettings.SetPasswordL(buf8);  //8
-    
-    aPopSettings.SetAutoSendOnConnect( aParameters.iAutoSendOnConnect );
-    aPopSettings.SetApop( aParameters.iUseApop );
-    aPopSettings.SetDisconnectedUserMode( aParameters.iDisconnectedUserMode );
-    aPopSettings.SetDeleteEmailsWhenDisconnecting( aParameters.iDeleteEmailsAtDisconnect );
-    aPopSettings.SetAcknowledgeReceipts( aParameters.iAcknowledgeReceipts );
-    
-    if( aParameters.iMaxEmailSize != KUndef )
-        aPopSettings.SetMaxEmailSize(aParameters.iMaxEmailSize);
-    
-    if(aParameters.iGetEmailOptions != CMailboxesParameters::EGetHeaders && 
-            aParameters.iGetEmailOptions != CMailboxesParameters::EUndef )
-        {
-        aPopSettings.SetGetMailOptions(EGetPop3EmailMessages);
-        aPopSettings.SetPopulationLimitL( -1 ); // -1 = body and attachment
-        }
-    else
-        {
-        aPopSettings.SetGetMailOptions(EGetPop3EmailHeaders); // Default
-        aPopSettings.SetPopulationLimitL( -2 ); // -2 = headers only
-        }
-    
-    if( aParameters.iInboxSyncLimit != KUndef )
-        {
-        aPopSettings.SetInboxSynchronisationLimit(aParameters.iInboxSyncLimit);
-        }
-    
-    if(aParameters.iIncomingServerName && aParameters.iIncomingServerName->Length() > 0 )
-        aPopSettings.SetServerAddressL(aParameters.iIncomingServerName->Des());
-    else
-        aPopSettings.SetServerAddressL(KDefaultIncomingServer);
-            
-    if( aParameters.iIncomingPort != KUndef )
-        aPopSettings.SetPort(aParameters.iIncomingPort);                 
-          
-    aPopSettings.SetSecureSockets(aParameters.iIncomingSecureSockets);
-    aPopSettings.SetSSLWrapper(aParameters.iIncomingSSLWrapper);    
-    }
-
-void CCreatorMailboxes::PopulateSmtpSettingsL( 
-        CEmailAccounts& aEmailAccount, 
-        CImSmtpSettings& aSmtpSettings, 
-        CImIAPPreferences& aIApSettings, 
-        const CMailboxesParameters& aParameters )
-    {    
-    // Get default settings first: 
-    aEmailAccount.PopulateDefaultSmtpSettingsL(aSmtpSettings, aIApSettings);
-    TImIAPChoice iapChoice;
-    iapChoice.iIAP = 0;
-    if( aParameters.iOutgoingConnectionMethod == 0 || 
-        aParameters.iOutgoingConnectionMethod->Des().Length() == 0 )
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( KInternet ));
-        }
-    else
-        {
-        TRAP_IGNORE( iapChoice.iIAP = iEngine->AccessPointNameToIdL( aParameters.iOutgoingConnectionMethod->Des() ));
-        }
-    iapChoice.iDialogPref = ECommDbDialogPrefDoNotPrompt;
-    aIApSettings.AddIAPL(iapChoice);
-    
-    // set SMTP preferences
-    if( aParameters.iOwnEmailAlias && aParameters.iOwnEmailAlias->Length() > 0 )
-        aSmtpSettings.SetEmailAliasL(aParameters.iOwnEmailAlias->Des());
-    
-    if( aParameters.iOwnEmailAddress && aParameters.iOwnEmailAddress->Length() > 0 )    
-        aSmtpSettings.SetEmailAddressL(aParameters.iOwnEmailAddress->Des());
-    
-    if( aParameters.iReplyToAddress && aParameters.iReplyToAddress->Length() > 0 )
-        aSmtpSettings.SetReplyToAddressL(aParameters.iReplyToAddress->Des());
-    
-    if( aParameters.iReceiptAddress && aParameters.iReceiptAddress->Length() > 0 )
-        aSmtpSettings.SetReceiptAddressL(aParameters.iReceiptAddress->Des());    
-    
-    aSmtpSettings.SetBodyEncoding(EMsgOutboxMIME);
-    aSmtpSettings.SetAddVCardToEmail(aParameters.iAddVCard);
-    aSmtpSettings.SetAddSignatureToEmail(aParameters.iIncludeSignature);
-    aSmtpSettings.SetRequestReceipts(aParameters.iRequestReceipts);
-    aSmtpSettings.SetSendCopyToSelf(aParameters.iSendCopyToSelf);    
-    aSmtpSettings.SetSendMessageOption(aParameters.iSendOption);        
-            
-    TBuf8<256> buf8;
-    if( aParameters.iOutgoingLoginName && aParameters.iOutgoingLoginName->Length() > 0 )
-        {
-        buf8.Copy(aParameters.iOutgoingLoginName->Des());
-        aSmtpSettings.SetLoginNameL(buf8);  //8
-        }
-    
-    if( aParameters.iOutgoingPassword && aParameters.iOutgoingPassword->Length() > 0)
-        {
-        buf8.Copy(aParameters.iOutgoingPassword->Des());
-        aSmtpSettings.SetPasswordL(buf8);  //8
-        }
-    
-    aSmtpSettings.SetSMTPAuth(aParameters.iSmtpAuth);
-    if( aParameters.iToCCIncludeLimit != KUndef )
-         aSmtpSettings.SetToCcIncludeLimitL(aParameters.iToCCIncludeLimit);
-    
-    if( aParameters.iOutgoingServerName && aParameters.iOutgoingServerName->Length() > 0 )
-        aSmtpSettings.SetServerAddressL(aParameters.iOutgoingServerName->Des());
-    else
-        aSmtpSettings.SetServerAddressL(KDefaultOutgoingServer);
-    
-    if( aParameters.iOutgoingPort != KUndef )
-        aSmtpSettings.SetPort(aParameters.iOutgoingPort);
-                
-    aSmtpSettings.SetSecureSockets(aParameters.iOutgoingSecureSockets);
-    aSmtpSettings.SetSSLWrapper(aParameters.iOutgoingSSLWrapper);
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorMailboxes::StoreIMEIToEntryL(const TMsvId aMailboxId)
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::StoreIMEIToEntryL");
-
-    CMsvSession* session = CMsvSession::OpenSyncL(*this);
-    CleanupStack::PushL(session);
-    
-    CMsvEntry* centry = session->GetEntryL(aMailboxId);
-    CleanupStack::PushL(centry);
-
-    TMsvEntry tentry = centry->Entry();
-    tentry.iDescription.Set(iIMEI);
-    centry->ChangeL(tentry);
-
-    CleanupStack::PopAndDestroy(2); // centry, session
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorMailboxes::GetIMEIFromThePhoneL()
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::GetIMEIFromThePhoneL");
-
-#ifndef __WINS__
-
-    RTelServer telServer;
-    User::LeaveIfError( telServer.Connect() );
-    CleanupClosePushL(telServer);
-
-    TInt numPhones = 0;
-    User::LeaveIfError( telServer.EnumeratePhones( numPhones ) );
-    if ( numPhones < 1 )
-        {
-        User::Leave( KErrNotFound );
-        }
-    RTelServer::TPhoneInfo info;
-    User::LeaveIfError( telServer.GetPhoneInfo( 0, info ) );
-    RMobilePhone mobilePhone;
-    User::LeaveIfError( mobilePhone.Open( telServer, info.iName ) );
-    CleanupClosePushL( mobilePhone );
-
-    //mobilePhone.Initialise();
-    TUint32 identityCaps;
-    User::LeaveIfError( mobilePhone.GetIdentityCaps( identityCaps ) );
-
-    if ( identityCaps & RMobilePhone::KCapsGetSerialNumber )
-        {
-        TRequestStatus status;
-        RMobilePhone::TMobilePhoneIdentityV1 mobilePhoneIdentity;
-
-        mobilePhone.GetPhoneId( status, mobilePhoneIdentity );
-
-        User::WaitForRequest( status );
-        User::LeaveIfError( status.Int() );
-
-        iIMEI.Copy( mobilePhoneIdentity.iSerialNumber );
-        }
-    else
-        {
-        User::Leave( KErrNotSupported );
-        }
-
-    CleanupStack::PopAndDestroy( &mobilePhone );
-    CleanupStack::PopAndDestroy( &telServer );
-
-#else
-
-    // use fixed IMEI for emulator
-    _LIT( KIMAEmulatorImei, "123456789012345" );
-    iIMEI.Copy( KIMAEmulatorImei );
-
-#endif // __WINS__
-
-    }
-    
-//----------------------------------------------------------------------------
-
-void CCreatorMailboxes::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
-    {
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMailboxes::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::DeleteAllL");
-    
-    CEmailAccounts* accountMgr = CEmailAccounts::NewLC();
-    
-    // Delete pop accounts
-    RArray<TPopAccount> popAccountsToDelete;
-    CleanupClosePushL( popAccountsToDelete );
-    accountMgr->GetPopAccountsL( popAccountsToDelete );
-    for ( TInt i = 0; i < popAccountsToDelete.Count(); i++ )
-        {
-        accountMgr->DeletePopAccountL( popAccountsToDelete[i] );
-        }
-    CleanupStack::PopAndDestroy( &popAccountsToDelete );
-    
-    // Delete imap accounts
-    RArray<TImapAccount> imapAccountsToDelete;
-    CleanupClosePushL( imapAccountsToDelete );
-    accountMgr->GetImapAccountsL( imapAccountsToDelete );
-    for ( TInt i = 0; i < imapAccountsToDelete.Count(); i++ )
-        {
-        accountMgr->DeleteImapAccountL( imapAccountsToDelete[i] );
-        }
-    CleanupStack::PopAndDestroy( &imapAccountsToDelete );
-    
-    // Delete smtp accounts
-    RArray<TSmtpAccount> smtpAccountsToDelete;
-    CleanupClosePushL( smtpAccountsToDelete );
-    accountMgr->GetSmtpAccountsL( smtpAccountsToDelete );
-    for ( TInt i = 0; i < smtpAccountsToDelete.Count(); i++ )
-        {
-        accountMgr->DeleteSmtpAccountL( smtpAccountsToDelete[i] );
-        }
-    CleanupStack::PopAndDestroy( &smtpAccountsToDelete );
-
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Mailbox related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidMailbox );
-    
-    CleanupStack::PopAndDestroy( accountMgr ); 
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMailboxes::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::DeleteAllCreatedByCreatorL");
-    
-    iEntryIds.Reset();
-    CEmailAccounts* accountMgr = CEmailAccounts::NewLC();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidMailbox );
-    
-    TInt i(0);
-    while ( i < iEntryIds.Count() && iEntryIds.Count() > 6 ) 
-        {
-        // there should be at least 7 items in the array:
-        // one for mailbox type
-        // 3 for imap OR pop ids
-        // 3 for smtp ids
-
-        // delete entries
-        
-        TInt type = iEntryIds[i++]; // TMailboxType
-        if ( type == EMailboxPOP3 )
-            {
-            TPopAccount popAccount;
-            popAccount.iPopAccountId = iEntryIds[i++];
-            popAccount.iPopService = iEntryIds[i++];            
-            popAccount.iSmtpService = iEntryIds[i++];
-            TRAP_IGNORE( accountMgr->DeletePopAccountL( popAccount ) );            
-            }
-        else if ( type == EMailboxIMAP4 )
-            {
-            TImapAccount imapAccount;
-            imapAccount.iImapAccountId = iEntryIds[i++];
-            imapAccount.iImapService = iEntryIds[i++];
-            imapAccount.iImapService = iEntryIds[i++];
-            TRAP_IGNORE( accountMgr->DeleteImapAccountL( imapAccount ) );
-            }
-        else 
-            {
-            // ignore unknown mailbox types
-            i +=3;
-            }
-        
-        // There should be one smtp service for each pop and imap service
-        TSmtpAccount smtpAccount;
-        smtpAccount.iSmtpAccountId = iEntryIds[i++];
-        smtpAccount.iSmtpService = iEntryIds[i++];
-        smtpAccount.iRelatedService = iEntryIds[i++];
-        TRAP_IGNORE( accountMgr->DeleteSmtpAccountL( smtpAccount ) );
-        }
-
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the mailbox related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidMailbox );
-
-    CleanupStack::PopAndDestroy( accountMgr ); 
-    }
-//----------------------------------------------------------------------------
-
--- a/creator/src/creator_mailboxelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,495 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_mailboxelement.h"
-#include "creator_traces.h"
-#include "creator_mailbox.h"
-
-using namespace creatormailbox;
-
-/*
- * 
- */
-CCreatorMailboxElement* CCreatorMailboxElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorMailboxElement* self = new (ELeave) CCreatorMailboxElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorMailboxElement::CCreatorMailboxElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-TBool CCreatorMailboxElement::SetIntegerParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
-    {    
-    _LIT( KAll, "all");
-    
-    if( aElemName == Kincomingport )
-        {
-        if( aSetRandom )
-            param->iIncomingPort = iEngine->RandomNumber(25, 500);
-        else        
-            param->iIncomingPort = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Kattachmentsizelimit )
-        {
-        if( aSetRandom )
-            param->iAttachmentSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
-        else
-            param->iAttachmentSizeLimit = ConvertStrToIntL(aElemContent);
-        }        
-    else if( aElemName == Kbodytextsizelimit )
-        {
-        if( aSetRandom )
-            param->iBodyTextSizeLimit = iEngine->RandomNumber(1, KMaxTInt);
-        else
-            param->iBodyTextSizeLimit = ConvertStrToIntL(aElemContent);
-        }     
-    else if( aElemName == Kattachmentfetchsize )
-        {
-        if( aSetRandom )
-            param->iAttachmentFetchSize = iEngine->RandomNumber(1, 40960);
-        else            
-            param->iAttachmentFetchSize = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Kimapidletimeout )
-        {
-        if( aSetRandom )
-            param->iImapIdleTimeout = iEngine->RandomNumber(10, 2000);
-        else
-            param->iImapIdleTimeout = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Kmaxemailsize )
-        {
-        if( aSetRandom )
-            param->iMaxEmailSize =  iEngine->RandomNumber(1024, KMaxTInt);
-        else
-            param->iMaxEmailSize = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Ksyncrate )
-        {
-        if( aSetRandom )
-            param->iSyncRate = iEngine->RandomNumber(10, 500);
-        else
-            param->iSyncRate = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Kinboxsynclimit )
-        {
-        if( aSetRandom )
-            param->iInboxSyncLimit = iEngine->RandomNumber(-1, 256);
-        else if( CompareIgnoreCase(aElemContent, KAll) == 0 )
-            param->iInboxSyncLimit = -1;
-        else
-            param->iInboxSyncLimit = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Kmailboxsynclimit )
-        {
-        if( aSetRandom )
-            param->iMailboxSyncLimit = iEngine->RandomNumber(-1, 256);
-        else if( CompareIgnoreCase(aElemContent, KAll) == 0 )
-            param->iMailboxSyncLimit = -1;
-        else
-            param->iMailboxSyncLimit = ConvertStrToIntL(aElemContent);
-        }        
-    else if( aElemName == Koutgoingport )
-        {
-        if( aSetRandom )
-            param->iOutgoingPort = KDefaultSmtpPort;
-        else
-            param->iOutgoingPort = ConvertStrToIntL(aElemContent);
-        }
-    else if( aElemName == Ktoccincludelimit )
-        {
-        if( aSetRandom )
-            param->iToCCIncludeLimit = iEngine->RandomNumber(0, 30);
-        else
-            param->iToCCIncludeLimit = ConvertStrToIntL(aElemContent);
-        }
-    else
-        return EFalse;
-    
-    return ETrue;
-    }
-
-TBool CCreatorMailboxElement::GetBooleanValueL(const TDesC& aElemContent, TBool aSetRandom)
-    {
-    if( aSetRandom )
-        return iEngine->RandomNumber(0,1) == 1;
-    
-    return ConvertStrToBooleanL(aElemContent);
-    }
-
-TBool CCreatorMailboxElement::SetBooleanParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
-    {  
-    TBool val = GetBooleanValueL(aElemContent, aSetRandom);
-    if( aElemName == Kincomingsslwrapper )
-        param->iIncomingSSLWrapper = val;
-    else if( aElemName == Kincomingsecuresockets )
-        param->iIncomingSecureSockets = val;
-    else if( aElemName == Kacknowledgereceipts )
-        param->iAcknowledgeReceipts = val;
-    else if( aElemName == Kautosendonconnect )
-        param->iAutoSendOnConnect = val;
-    else if( aElemName == Kdeletemailsatdisconnect )
-        param->iDeleteEmailsAtDisconnect = val;
-    else if( aElemName == Kimapidlecommand )
-        param->iImapIdleCommand = val;
-    else if( aElemName == Kmarkseeninsync )
-        param->iMarkSeenInSync = val;
-    else if( aElemName == Kenableexpungemode )
-        param->iEnableExpungeMode = val;
-    else if( aElemName == Kuseapopsecurelogin )
-        param->iUseApop = val;
-    else if( aElemName == Kdisconnectedusermode )
-        param->iDisconnectedUserMode = val;
-    else if( aElemName == Koutgoingsslwrapper )
-        param->iOutgoingSSLWrapper = val;
-    else if( aElemName == Koutgoingsecuresockets )
-        param->iOutgoingSecureSockets = val;
-    else if( aElemName == Kincludesignature )
-        param->iIncludeSignature = val;
-    else if( aElemName == Kaddvcard )
-        param->iAddVCard = val;
-    else if( aElemName == Krequestreceipts )
-        param->iRequestReceipts = val;
-    else if( aElemName == Ksmtpauth )
-        param->iSmtpAuth = val;
-    else
-        return EFalse;
-
-    return ETrue;
-    }
-
-TBool CCreatorMailboxElement::SetTextParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
-    {   
-    _LIT(KIncomingSrvPrefix, "mail.");
-    _LIT(KOutgoingSrvPrefix, "smtp.");
-    _LIT(KSrvPostfix, ".com");
-    _LIT(KDefaultConnMethod, "internet");
-    
-    if( aElemName == Kname )
-        {
-        if( aSetRandom )
-            {
-            TPtrC company(iEngine->RandomString(CCreatorEngine::ECompany));
-            SetContentToTextParamL(param->iMailboxName, company);
-            }
-        else
-            SetContentToTextParamL(param->iMailboxName, aElemContent);
-        }
-    else if( aElemName == Kincomingloginname )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
-            SetContentToTextParamL(param->iIncomingLoginName, random);
-            param->iIncomingLoginName->Des().LowerCase();
-            }
-        else
-            SetContentToTextParamL(param->iIncomingLoginName, aElemContent);
-        }
-    else if( aElemName == Kincomingpassword )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
-            SetContentToTextParamL(param->iIncomingPassword, random);
-            param->iIncomingPassword->Des().LowerCase();
-            }
-        else
-            SetContentToTextParamL(param->iIncomingPassword, aElemContent);
-        }
-    else if( aElemName == Kincomingservername )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::ECompany));
-            HBufC* srvName = HBufC::NewLC(KIncomingSrvPrefix().Length()+random.Length()+KSrvPostfix().Length());
-            srvName->Des().Copy(KIncomingSrvPrefix);
-            srvName->Des().Append(random);
-            srvName->Des().Append(KSrvPostfix);
-            SetContentToTextParamL(param->iIncomingServerName, srvName->Des());
-            CleanupStack::PopAndDestroy(); // srvName
-            }
-        else
-            SetContentToTextParamL(param->iIncomingServerName, aElemContent);
-        }
-    else if( aElemName == Kincomingconnectionmethod )
-        {
-        if( aSetRandom )                        
-            SetContentToTextParamL(param->iIncomingConnectionMethod, KDefaultConnMethod);            
-        else
-            SetContentToTextParamL(param->iIncomingConnectionMethod, aElemContent);
-        }
-    else if( aElemName == Kincomingfolderpath )
-        SetContentToTextParamL(param->iIncomingFolderPath, aElemContent);
-    else if( aElemName == Kpathseparator )
-        SetContentToTextParamL(param->iPathSeparator, aElemContent);
-    else if( aElemName == Koutgoingloginname )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
-            SetContentToTextParamL(param->iOutgoingLoginName, random);
-            param->iOutgoingLoginName->Des().LowerCase();
-            }
-        else
-            SetContentToTextParamL(param->iOutgoingLoginName, aElemContent);
-        }
-    else if( aElemName == Koutgoingpassword )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::EFirstName));
-            SetContentToTextParamL(param->iOutgoingPassword, random);
-            param->iOutgoingPassword->Des().LowerCase();
-            }
-        else
-            SetContentToTextParamL(param->iOutgoingPassword, aElemContent);
-        }
-    else if( aElemName == Koutgoingservername )
-        {
-        if( aSetRandom )
-            {
-            TPtrC random(iEngine->RandomString(CCreatorEngine::ECompany));
-            HBufC* srvName = HBufC::NewLC(KOutgoingSrvPrefix().Length()+random.Length()+KSrvPostfix().Length());
-            srvName->Des().Copy(KOutgoingSrvPrefix);
-            srvName->Des().Append(random);
-            srvName->Des().Append(KSrvPostfix);
-            SetContentToTextParamL(param->iOutgoingServerName, srvName->Des());
-            CleanupStack::PopAndDestroy(); // srvName
-            }
-        else
-            SetContentToTextParamL(param->iOutgoingServerName, aElemContent);
-        }
-    else if( aElemName == Koutgoingconnectionmethod )
-        {
-        if( aSetRandom )            
-            SetContentToTextParamL(param->iOutgoingConnectionMethod, KDefaultConnMethod);            
-        else
-            SetContentToTextParamL(param->iOutgoingConnectionMethod, aElemContent);
-        }
-    else if( aElemName == Kownemail )
-        {
-        if( aSetRandom )
-            {
-            TDesC* email = iEngine->CreateEmailAddressLC();
-            SetContentToTextParamL(param->iOwnEmailAddress, *email);
-            CleanupStack::PopAndDestroy(); // email
-            }
-        else
-            SetContentToTextParamL(param->iOwnEmailAddress, aElemContent);
-        }
-    else if( aElemName == Kemailalias )
-        {
-        if( aSetRandom )
-            {
-            _LIT(KSpace, " ");
-            TPtrC firstName(iEngine->RandomString(CCreatorEngine::EFirstName));
-            TPtrC lastName(iEngine->RandomString(CCreatorEngine::ESurname));
-            HBufC* alias = HBufC::NewLC(firstName.Length() + lastName.Length() + KSpace().Length());
-            alias->Des().Copy(firstName);
-            alias->Des().Append(KSpace);
-            alias->Des().Append(lastName);
-            SetContentToTextParamL(param->iOwnEmailAlias, alias->Des());
-            CleanupStack::PopAndDestroy(); // alias
-            }
-        else        
-            SetContentToTextParamL(param->iOwnEmailAlias, aElemContent);
-        }
-    else if( aElemName == Kreceiptaddress )
-        {
-        if( aSetRandom )
-            {
-            TDesC* email = iEngine->CreateEmailAddressLC();
-            SetContentToTextParamL(param->iReceiptAddress, *email);
-            CleanupStack::PopAndDestroy(); // email
-            }
-        else
-            SetContentToTextParamL(param->iReceiptAddress, aElemContent);
-        }
-    else if( aElemName == Kreplytoaddress )
-        {
-        if( aSetRandom )
-            {
-            TDesC* email = iEngine->CreateEmailAddressLC();
-            SetContentToTextParamL(param->iReceiptAddress, *email);
-            CleanupStack::PopAndDestroy(); // email
-            }
-        else
-            SetContentToTextParamL(param->iReplyToAddress, aElemContent);
-        }
-    else
-        return EFalse;
-    
-    return ETrue;
-    }
-
-TBool CCreatorMailboxElement::SetEnumParamL(const TDesC& aElemName, const TDesC& aElemContent, CMailboxesParameters* param, TBool aSetRandom )
-    {
-    // Get email options:
-    if( aElemName == Kgetemailoptions )
-        {
-        if( aSetRandom )
-            param->iGetEmailOptions = (CMailboxesParameters::TGetEmailOption) iEngine->RandomNumber(
-                                                    CMailboxesParameters::EGetHeaders, 
-                                                    CMailboxesParameters::EGetEmailOptionLast-1);
-        else if( CompareIgnoreCase(aElemContent, Kgetheaders ) == 0 )
-            param->iGetEmailOptions = CMailboxesParameters::EGetHeaders;
-        else if( CompareIgnoreCase(aElemContent, Kgetbodytext) == 0 )
-            param->iGetEmailOptions = CMailboxesParameters::EGetBodyText;
-        else if( CompareIgnoreCase(aElemContent, Kgetbodytextandattachments) == 0 )
-            param->iGetEmailOptions = CMailboxesParameters::EGetBodyTextAndAttachments;
-        else if( CompareIgnoreCase(aElemContent, Kgetattachments) == 0 )
-            param->iGetEmailOptions = CMailboxesParameters::EGetAttachments;
-        else if( CompareIgnoreCase(aElemContent, Kgetbodyalternativetext) == 0 )
-            param->iGetEmailOptions = CMailboxesParameters::EGetBodyAlternativeText;
-        else 
-            param->iGetEmailOptions = CMailboxesParameters::EUndef;
-        }
-    
-    // Subscribe type:
-    else if( aElemName == Ksubscribetype )
-        {
-        if( aSetRandom )
-            param->iSubscribeType = (TFolderSubscribeType) iEngine->RandomNumber( EUpdateNeither, EUpdateBoth );
-        else if( CompareIgnoreCase( aElemContent, Kupdatelocal) == 0 )
-            param->iSubscribeType = EUpdateLocal;            
-        else if( CompareIgnoreCase( aElemContent, Kupdateremote) == 0 )
-            param->iSubscribeType = EUpdateRemote;
-        else if( CompareIgnoreCase( aElemContent, Kupdateboth) == 0 )
-            param->iSubscribeType = EUpdateBoth;
-        else
-            param->iSubscribeType = EUpdateNeither;
-        }
-    
-    // Folder synchronization type:
-    else if( aElemName == Kfoldersynctype)
-        {
-        if( aSetRandom )
-            param->iSyncType = (TFolderSyncType) iEngine->RandomNumber(EUseCombination, EUseRemote);
-        else if( CompareIgnoreCase( aElemContent, Kuselocal) == 0 )
-            param->iSyncType = EUseLocal;
-        else if( CompareIgnoreCase( aElemContent, Kuseremote) == 0 )
-            param->iSyncType = EUseRemote;
-        else
-            param->iSyncType = EUseCombination;
-        }
-     
-    // Send copy to self option:
-    else if( aElemName == Kcopytoself )
-        {
-        if( aSetRandom )
-            param->iSendCopyToSelf = (TImSMTPSendCopyToSelf) iEngine->RandomNumber(ESendNoCopy, ESendCopyAsBccRecipient);
-        else if( CompareIgnoreCase( aElemContent, Kto) == 0 )
-            param->iSendCopyToSelf = ESendCopyAsToRecipient;
-        else if( CompareIgnoreCase( aElemContent, Kcc) == 0 )
-            param->iSendCopyToSelf = ESendCopyAsCcRecipient;
-        else if( CompareIgnoreCase( aElemContent, Kbcc) == 0 )
-            param->iSendCopyToSelf = ESendCopyAsBccRecipient;
-        else
-            param->iSendCopyToSelf = ESendNoCopy;
-        }
-    
-    // Send option:
-    else if( aElemName == Ksendoption )
-        {
-        if( aSetRandom )
-            param->iSendOption = (TImSMTPSendMessageOption) iEngine->RandomNumber(ESendMessageImmediately, ESendMessageOnRequest);
-        else if( CompareIgnoreCase( aElemContent, Konnextconnection) == 0 )
-            param->iSendOption = ESendMessageOnNextConnection;
-        else if( CompareIgnoreCase( aElemContent, Konrequest) == 0 )
-            param->iSendOption = ESendMessageOnRequest;
-        else
-            param->iSendOption = ESendMessageImmediately;
-        }
-    else
-        {
-        return EFalse;
-        }
-    return ETrue;
-    }
-
-void CCreatorMailboxElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    const CCreatorScriptAttribute* typeAttr = FindAttributeByName(KMailboxType);
-    TInt amount = 1;    
-    if( amountAttr )
-        {
-        amount = ConvertStrToIntL(amountAttr->Value());
-        }
-    
-    TMailboxType mailboxType = EMailboxPOP3;
-    
-    if( typeAttr && CompareIgnoreCase(typeAttr->Value(), Kimap4) == 0 )
-        {
-        mailboxType = EMailboxIMAP4;
-        }
-    
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create mailbox entries, the amount of entries is defined by amount:
-        for( TInt cI = 0; cI < amount; ++cI )
-            {            
-            CMailboxesParameters* param = new (ELeave) CMailboxesParameters;
-            CleanupStack::PushL(param);
-            
-            param->iMailboxType = mailboxType;
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                TBool useRandom = EFalse;
-                if( randomAttr || elemContent.Length() == 0 )
-                    {
-                    useRandom = ETrue;
-                    }
-                
-                if( SetTextParamL(elemName, elemContent, param, useRandom ) == EFalse &&
-                    SetBooleanParamL(elemName, elemContent, param, useRandom ) == EFalse &&
-                    SetIntegerParamL(elemName, elemContent, param, useRandom ) == EFalse &&
-                    SetEnumParamL(elemName, elemContent, param, useRandom ) )
-                    {
-                    LOGSTRING2("CCreatorMailboxElement::ExecuteCommandL: Unknown mailbox field: %S", &elemName);
-                    }
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMailboxes, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMailboxes, 0, amount);
-    	}
-    }
--- a/creator/src/creator_message.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2226 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_message.h" 
-#include "creator_traces.h"
-#include "creator_contactsetcache.h"
-#include <apgcli.h>
-
-//#include <MuiuServiceUtilities.h>
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-#include <MVPbkFieldType.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkStoreContactFieldCollection.h>
-#include <MVPbkContactFieldTextData.h>
-#include <CVPbkContactManager.h>
-#include <MVPbkStoreContact.h>
-
-#include <CVPbkContactStoreUriArray.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <VPbkContactStoreUris.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStore.h>
-#include <MVPbkContactStoreProperties.h>
-#include <VPbkEng.rsg>
-#include <cmsvrecipientlist.h>
-#endif
-#include <mmf/common/mmfcontrollerpluginresolver.h> // for CleanupResetAndDestroyPushL
-
-
-//static const TInt KMessagesFieldLength = 1024;
-
-//_LIT(KCreatorMessagesPrefixName, "CR_");
-//_LIT(KCreatorMessagesPrefixFolderName, "CR_FLDR_");
-
-
-const TUid KUidBIOBusinessCardMsg =  {0x10005531}; 
-_LIT(KEmpty, "");
-
-//----------------------------------------------------------------------------
-
-CMessagesParameters::CMessagesParameters()
-    {
-    LOGSTRING("Creator: CMessagesParameters::CMessagesParameters");
-
-    iSenderAddress = HBufC::New(128);
-    iRecipientAddress = HBufC::New(128);
-    iMessageSubject = HBufC::New(128);
-    iMessageBodyText = HBufC::New(10240);
-    TRAP_IGNORE(iAttachments = new(ELeave) CArrayFixFlat<TInt>(64));
-    iCreateAsUnread = ETrue;
-    }
-
-CMessagesParameters::~CMessagesParameters()
-    {
-    LOGSTRING("Creator: CMessagesParameters::~CMessagesParameters");
-
-
-    delete iMessageBodyText;
-    delete iMessageSubject;
-    delete iRecipientAddress;
-    delete iSenderAddress;
-    delete iAttachments;
-    iAttachmentPaths.ResetAndDestroy();
-    iAttachmentPaths.Close(); 
-    iRecipientAddressArray.ResetAndDestroy();
-    iRecipientAddressArray.Close();
-    iRecipientLinkIds.Close();
-    iSenderLinkIds.Close();
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorMessages* CCreatorMessages::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorMessages* self = CCreatorMessages::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorMessages* CCreatorMessages::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorMessages* self = new (ELeave) CCreatorMessages;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorMessages::CCreatorMessages()
-:
-iSession(0)
-    {
-    }
-
-void CCreatorMessages::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorMessages::ConstructL");
-    iEngine = aEngine;
-    
-    TRAP_IGNORE(iAttachments = new(ELeave) CArrayFixFlat<TInt>(64));
-    iWaiter = CAsyncWaiter::NewL();
-    }
-
-CCreatorMessages::~CCreatorMessages()
-    {
-    LOGSTRING("Creator: CCreatorMessages::~CCreatorMessages");
-
-    if ( iEngine && iEntryIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidMessages ) );
-        }
-    iEntryIds.Reset();
-    iEntryIds.Close();
-    
-    delete iParameters;
-    delete iWaiter;
-    delete iTmpPhoneNumber;
-    delete iTmpEmail;
-    delete iAttachments;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    delete iExistingContacts;
-    if( iContactManager )
-    	iContactManager->ContactStoresL().CloseAll(*this);
-    delete iContactManager;
-    delete iTempContact;
-#endif
-    iRecipientArray.ResetAndDestroy();
-    iRecipientArray.Close();
-    iSenderArray.ResetAndDestroy();
-    iSenderArray.Close();
-    delete iSession;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorMessages::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorMessages::AskDataFromUserL");
-
-    if ( aCommand == ECmdDeleteMessages )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all messages?") );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorMessages )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all messages created with Creator?") );
-        }
-
-    if (iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?")))
-        {
-        
-        // message type query
-        CAknListQueryDialog* dlg1 = new(ELeave) CAknListQueryDialog( (TInt*) &iMessageType );
-        if (dlg1->ExecuteLD(R_MESSAGE_TYPE_QUERY))
-            {
-            TInt folderTypeQueryResource(R_FOLDER_TYPE_QUERY);
-            
-            /*
-            if (iMessageType == EEmail)
-                folderTypeQueryResource = R_FOLDER_TYPE_WITH_MAILBOX_QUERY;
-            */
-
-            // folder query
-            CAknListQueryDialog* dlg2 = new(ELeave) CAknListQueryDialog( (TInt*) &iFolderType );
-            if (dlg2->ExecuteLD(folderTypeQueryResource))
-                {
-                /*
-                if (iFolderType == EMailbox)
-                    {
-                    // array to hold mailbox names
-                    CDesCArray* names = new (ELeave) CDesCArrayFlat(16);
-                    CleanupStack::PushL(names);                    
-                    
-                    CMsvSession* session = CMsvSession::OpenSyncL(*this);
-                    CleanupStack::PushL(session);
-    
-                    // generate list of mailboxes
-                    CMsvEntrySelection* entrySelection = MsvUiServiceUtilities::GetListOfAccountsWithMTML(*session, KUidMsgTypeSMTP, ETrue);
-                    CleanupStack::PushL(entrySelection);
-
-                    TBool doReturn(EFalse);
-                    
-                    if (entrySelection->Count() == 0)
-                        {
-                        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                        note->ExecuteLD(_L("No mailboxes found"));
-
-                        doReturn = ETrue;
-                        }
-                    else
-                        {
-                        // get mailbox names
-                        for (TInt i=0; i<entrySelection->Count(); i++)
-                            {
-                            CMsvEntry* centry = session->GetEntryL(entrySelection->At(i));
-                            CleanupStack::PushL(centry);
-
-                            TMsvEntry tentry = centry->Entry();
-                            names->AppendL(tentry.iDetails);
-                            CleanupStack::PopAndDestroy(); //centry
-                            }
-                        
-                        // show query
-                        TInt index(0);
-                        CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
-                        dlg->PrepareLC(R_MAILBOX_SELECTION_QUERY);
-                        dlg->SetItemTextArray(names);
-                        dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
-
-                        if(dlg->RunLD())
-                            {
-                            iUserSelectedMailbox = entrySelection->At(index);
-
-                            doReturn = EFalse;
-                            }
-                        else
-                            {
-                            doReturn = ETrue;
-                            }    
-                        
-                        }
-                    
-                    CleanupStack::PopAndDestroy(3); // names, session, entrySelection
-                    
-                    if (doReturn)
-                        return EFalse;                    
-                    }
-                */
-                
-                // query create as unread
-                CAknListQueryDialog* dlg3 = new(ELeave) CAknListQueryDialog( (TInt*) &iCreateAsUnread );
-                if (dlg3->ExecuteLD(R_UNREAD_QUERY))
-                    {                
-
-                    // query number of characters in msg body
-                    switch (iMessageType)
-                        {
-                        case ESMS:
-                        case EMMS:
-                        case EEmail:
-                            {
-                            iDefinedMessageLength = 100;
-                            if (iEngine->EntriesQueryDialogL(iDefinedMessageLength, _L("Amount of characters in message body?"), ETrue))
-                                {
-                                ;
-                                }
-                            else
-                                return EFalse;
-
-                            break;
-                            }
-                        case EAMS:
-                        	{
-                        	iDefinedMessageLength = 0;
-                        	break;
-                        	}
-                        default: break;
-                        }
-
-                    // query attachments
-                    iAttachments->Reset();
-              
-                    switch (iMessageType)
-                        {
-                        case EMMS:
-                        case EEmail:
-                            {
-                            CAknListQueryDialog* dlg4 = new(ELeave) CAknListQueryDialog( iAttachments );
-                            if (dlg4->ExecuteLD(R_ATTACHMENT_MULTI_SELECTION_QUERY))
-                                {
-                                // "none" is selected
-                                if (iAttachments->At(0) == 0)
-                                    iAttachments->Reset();
-                                else  // otherwise fix indexes
-                                    {
-                                    for (TInt i=0; i<iAttachments->Count(); i++)
-                                        iAttachments->At(i)--;  // decrease value by one 
-
-                                    }
-                                }
-                            else
-                                return EFalse;
-                            
-                            break;
-                            }
-                        case EAMS:
-                        	{
-                            iAttachments->AppendL( TInt(0) );
-
-                            CAknListQueryDialog* dlg5 = new(ELeave) CAknListQueryDialog( &iAttachments->At(0) );
-                            if (dlg5->ExecuteLD(R_AMS_ATTACHMENT_SINGLE_SELECTION_QUERY))
-                                {
-                                ;
-                                }
-                            else
-                                return EFalse;                        
-
-                            break;
-                        	}
-                            
-                        case EIrMessage:
-                        case EBTMessage:
-                            {
-                            iAttachments->AppendL( TInt(0) );
-
-                            CAknListQueryDialog* dlg5 = new(ELeave) CAknListQueryDialog( &iAttachments->At(0) );
-                            if (dlg5->ExecuteLD(R_ATTACHMENT_SINGLE_SELECTION_QUERY))
-                                {
-                                ;
-                                }
-                            else
-                                return EFalse;                        
-
-                            break;
-                            }
-                        default: break;
-                        }
-                    
-                    return ETrue;  // all queries accepted
-
-                    }
-                else
-                    return EFalse;
-                }
-            else
-                return EFalse;
-            }
-        else
-            return EFalse;
-        }
-    else
-        return EFalse;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateRandomMessageEntryL(TInt aCommand)
-    {
-    LOGSTRING2("Creator: CCreatorMessages::CreateRandomMessageEntryL - Command: %d", aCommand);
-
-    TInt err = KErrNone;
-    
-    iDefinedMessageLength = iEngine->RandomNumber(100, 300);
-
-
-    switch (aCommand)
-        {
-	    case ECmdCreateRandomEntrySMSInbox:     { iMessageType=ESMS; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntrySMSDrafts:    { iMessageType=ESMS; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntrySMSOutbox:    { iMessageType=ESMS; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntrySMSSent:      { iMessageType=ESMS; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
-	    
-        case ECmdCreateRandomEntryMMSInbox:     { iMessageType=EMMS; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryMMSDrafts:    { iMessageType=EMMS; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryMMSOutbox:    { iMessageType=EMMS; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}    
-	    case ECmdCreateRandomEntryMMSSent:      { iMessageType=EMMS; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
-	    
-        case ECmdCreateRandomEntryEmailInbox:   { iMessageType=EEmail; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryEmailDrafts:  { iMessageType=EEmail; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryEmailOutbox:  { iMessageType=EEmail; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryEmailSent:    { iMessageType=EEmail; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
-	    
-        case ECmdCreateRandomEntryBIOInbox:     { iMessageType=ESmartMessage; iFolderType=EInbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBIODrafts:    { iMessageType=ESmartMessage; iFolderType=EDrafts; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBIOOutbox:    { iMessageType=ESmartMessage; iFolderType=EOutbox; err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBIOSent:      { iMessageType=ESmartMessage; iFolderType=ESent; err=CreateMessageEntryL(NULL); break;}
-	    
-        case ECmdCreateRandomEntryIRInbox:      { iMessageType=EIrMessage; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryIRDrafts:     { iMessageType=EIrMessage; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryIROutbox:     { iMessageType=EIrMessage; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryIRSent:       { iMessageType=EIrMessage; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    
-        case ECmdCreateRandomEntryBTInbox:      { iMessageType=EBTMessage; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBTDrafts:     { iMessageType=EBTMessage; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBTOutbox:     { iMessageType=EBTMessage; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryBTSent:       { iMessageType=EBTMessage; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) ); err=CreateMessageEntryL(NULL); break;}
-        
-	    case ECmdCreateRandomEntryAMSInbox:     { iMessageType=EAMS; iFolderType=EInbox; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryAMSDrafts:     { iMessageType=EAMS; iFolderType=EDrafts; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryAMSOutbox:     { iMessageType=EAMS; iFolderType=EOutbox; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
-	    case ECmdCreateRandomEntryAMSSent:     { iMessageType=EAMS; iFolderType=ESent; iAttachments->Reset(); iAttachments->AppendL( CCreatorEngine::EMP3_250kB); err=CreateMessageEntryL(NULL); break;}
-
-	    default: { User::Panic(_L("MessageCommand"), 901);  break;}
-        }
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateMessageEntryL(CMessagesParameters *aParameters, TBool /*aTakeUserGivenParameters*/)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateMessageEntryL");
-    
-    delete iParameters;
-    iParameters = 0;   
-    
-    CMessagesParameters* parameters = aParameters;
-           
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CMessagesParameters;
-        parameters = iParameters;
-        // check if values from ui needed
-        //if (aTakeUserGivenParameters)
-        //    {            
-            parameters->iMessageType = iMessageType;
-            parameters->iFolderType = iFolderType;
-            parameters->iDefinedMessageLength = iDefinedMessageLength;
-            parameters->iCreateAsUnread = iCreateAsUnread;
-
-            for (TInt i=0; i<iAttachments->Count(); i++)
-                parameters->iAttachments->AppendL(iAttachments->At(i)); 
-        //    }
-        //else
-        //    {
-            // message length
-        //    parameters->iDefinedMessageLength = iEngine->RandomNumber(100, 300);
-        //    }    
-
-        if (parameters->iMessageType == EEmail)
-            {
-            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
-            parameters->iSenderAddress->Des().Append( _L("@") );
-            parameters->iSenderAddress->Des().Append( iEngine->RandomString(CCreatorEngine::ECompany) );
-            parameters->iSenderAddress->Des().Append( _L(".com") );
-
-            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
-            parameters->iRecipientAddress->Des().Append( _L("@") );
-            parameters->iRecipientAddress->Des().Append( iEngine->RandomString(CCreatorEngine::ECompany) );
-            parameters->iRecipientAddress->Des().Append( _L(".net") );
-            }
-        else if (parameters->iMessageType == EIrMessage || parameters->iMessageType == EBTMessage)
-            {
-            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
-            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EFirstName) );
-            }
-        else
-            {
-            parameters->iSenderAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EPhoneNumber) );
-            parameters->iRecipientAddress->Des().Copy( iEngine->RandomString(CCreatorEngine::EPhoneNumber) );
-            }
-
-        // subject
-        parameters->iMessageSubject->Des() = iEngine->RandomString(CCreatorEngine::EMessageSubject);
-
-        // message body
-        parameters->iMessageBodyText->Des().Copy(_L(""));
-        TPtrC randText = iEngine->RandomString(CCreatorEngine::EMessageText);
-        for (TInt i=0; i<parameters->iDefinedMessageLength / randText.Length() +1; i++)
-            {
-            parameters->iMessageBodyText->Des().Append( randText );
-            parameters->iMessageBodyText->Des().Append( _L(" ") );
-            }
-        parameters->iMessageBodyText->Des() = parameters->iMessageBodyText->Des().Left(parameters->iDefinedMessageLength);
-
-        // BIO message type (from bitsids.h)  // TO-DO: add support for all BIO message types...
-        parameters->iBIOMessageType = KUidBIOBusinessCardMsg;
-        }
-    
-    
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    
-    // Get number of existing senders and recipients:
-    for( TInt i = 0; i < parameters->iRecipientLinkIds.Count(); ++i )
-        {       
-        
-        TLinkIdParam recipientId = parameters->iRecipientLinkIds[i];        
-        // Is maximum number limited:
-        if(recipientId.iLinkAmount == KUndef || 
-           recipientId.iLinkAmount >= ContactLinkCache::Instance()->ContactSet(recipientId.iLinkId).NumberOfExistingContacts() )
-            {
-            parameters->iNumberOfExistingRecipients += ContactLinkCache::Instance()->ContactSet(recipientId.iLinkId).NumberOfExistingContacts();
-            }
-        else
-            {
-            parameters->iNumberOfExistingRecipients += recipientId.iLinkAmount;
-            }
-        }
-    for( TInt i = 0; i < parameters->iSenderLinkIds.Count(); ++i )
-        {
-        TLinkIdParam senderId = parameters->iSenderLinkIds[i];
-        // Is maximum number limited:
-        if( senderId.iLinkAmount == KUndef ||
-            senderId.iLinkAmount >= ContactLinkCache::Instance()->ContactSet(senderId.iLinkId).NumberOfExistingContacts())
-            {
-            parameters->iNumberOfExistingSenders += ContactLinkCache::Instance()->ContactSet(senderId.iLinkId).NumberOfExistingContacts();
-            }
-        else
-            {
-            parameters->iNumberOfExistingSenders += senderId.iLinkAmount;
-            }            
-        }
-    
-#endif
-
-    TInt err = KErrNone;
-
-    switch (parameters->iMessageType)
-        {
-        case ESMS:          { err = CreateSMSEntryL(*parameters);  break; }
-        case EMMS:          { err = CreateMMSEntryL(*parameters);  break; }
-        case EAMS:          { err = CreateAMSEntryL(*parameters);  break; }
-        case EEmail:        { err = CreateEmailEntryL(*parameters);  break; }
-        case ESmartMessage: { err = CreateSmartMessageEntryL(*parameters);  break; }
-        case EIrMessage:    { err = CreateObexEntryL( TUid::Uid(KUidMsgTypeIrTInt32), *parameters );  break; }    
-        case EBTMessage:    { err = CreateObexEntryL( TUid::Uid(KUidMsgTypeBtTInt32), *parameters );  break; }
-        default:            { User::Panic(_L("MsgType"), 851);  break;}
-
-        }
-
-    iSenderArray.ResetAndDestroy();
-    iRecipientArray.ResetAndDestroy();
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateSMSEntryL(const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateSMSEntryL");
-
-    TInt err = KErrNone;
-               
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-
-    // get the client mtm and return if it isn't supported in the system        
-    CSmsClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CSmsClientMtm*>(registry->NewMtmL(KUidMsgTypeSMS)));
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("SMS: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // get default service
-    TMsvId defaultServiceId = 0;
-    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
-    if (err)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("SMS: Define a SMS centre first"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        } 
-    
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry);    
-    
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-    // set the from field to sms header
-    if (parameters.iFolderType == EInbox)
-        {
-        CSmsHeader& smsHeader = clientMtm->SmsHeader();
-
-        if( parameters.iSenderAddress )
-            {
-            smsHeader.SetFromAddressL( parameters.iSenderAddress->Des() );
-            }
-        else
-            {
-            smsHeader.SetFromAddressL(KEmpty);
-            }
-        }       
-
-    // set body
-    clientMtm->Body().Reset();
-    clientMtm->Body().InsertL(0, parameters.iMessageBodyText->Des());        
-
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();
-
-    // set the details field
-    if (parameters.iFolderType == EInbox)
-        {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
-        }
-    else
-        {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
-        // Add all recipients to clientMtm
-        // iRecipientArray is up-to-date so don't call AddRecipientsL here 
-        for( TInt i = 0; i < iRecipientArray.Count(); i++ )
-            {
-            clientMtm->AddAddresseeL( iRecipientArray[i]->Des() );
-            }
-        }
-
-    // set the sending state for outbox message
-    // to avoid SMSMtmUI:15 panic in messages application
-    if (parameters.iFolderType == EOutbox )
-        {
-        messageEntry.SetSendingState( KMsvSendStateWaiting );
-        }
-
-    // set the description field same as the first part of the message body
-    messageEntry.iDescription.Set( parameters.iMessageBodyText->Des().Left(KSmsDescriptionLength) );
-
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);
-
-    // save the message     
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-    messageEntry.SetAttachment(EFalse);
-    messageEntry.iDate.HomeTime();
-    messageEntry.SetVisible(ETrue);
-    messageEntry.SetInPreparation(EFalse);
-   
-    if (parameters.iCreateAsUnread)
-        {
-        messageEntry.SetUnread(ETrue);
-        messageEntry.SetNew(ETrue);
-        }
-    else
-        {
-        messageEntry.SetUnread(EFalse);
-        messageEntry.SetNew(EFalse);
-        }
-    
-    messageEntry.SetComplete(ETrue);
-    messageEntry.iServiceId = defaultServiceId;
-    messageEntry.iRelatedId = 0;
-    clientMtm->Entry().ChangeL(messageEntry);
-
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); //registry, clientMtm
-        
-    return err;
-
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateMMSEntryL(const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateMMSEntryL");
-
-    TInt err = KErrNone;
-
-        
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-    
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-
-    // get the client mtm and return if it isn't supported in the system        
-    CMmsClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CMmsClientMtm*>(registry->NewMtmL(KUidMsgTypeMultimedia)));
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("MMS: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // get default service
-    TMsvId defaultServiceId = 0;
-    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
-    if (err)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("MMS: Define MMS settings first"));
-        CleanupStack::PopAndDestroy(4);
-        User::Leave(KErrNotFound);
-        } 
-    
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry);    
-    
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-    // set subject
-    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
-            
-    // set some mms defaults
-    clientMtm->SetMessageClass(EMmsClassPersonal);
-    clientMtm->SetExpiryInterval(86400);
-    clientMtm->SetDeliveryTimeInterval(3600);
-    clientMtm->SetMessagePriority(EMmsPriorityLow);
-    clientMtm->SetSenderVisibility(EMmsMaximumSenderVisibility);
-    clientMtm->SetDeliveryReport(EMmsDeliveryReportYes);
-    clientMtm->SetReadReply(EMmsReadReplyYes);        
-    
-    // set the sender / addressee field
-    if (parameters.iFolderType == EInbox)
-        {        
-        AddMtmSenderL(*clientMtm, parameters, EFalse);                
-        }
-    
-    // Add all recipients to clientMtm
-    AddRecipientsL( *clientMtm, parameters, EFalse );  
-        
-    // get an access to the message store
-    CMsvStore* store = msvEntry->EditStoreL();
-    CleanupStack::PushL(store);                  
-   
-
-    // set body as an attachment
-    CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
-    CleanupStack::PushL(mimeHeaders);
-    mimeHeaders->SetContentTypeL( _L8("text") );
-    mimeHeaders->SetContentSubTypeL( _L8("plain") );
-    mimeHeaders->SetMimeCharset( KMmsUtf8 );
-    mimeHeaders->SetSuggestedFilenameL( _L("body.txt") );
-    
-    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
-    CleanupStack::PushL(attachmentInfo);
-    attachmentInfo->SetAttachmentNameL( _L("body.txt") );
-    attachmentInfo->SetMimeTypeL( _L8("text/plain") );
-    mimeHeaders->StoreL( *attachmentInfo );
-    
-    RFile textFile;
-
-    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-    attachMan.CreateAttachmentL(_L("body.txt"), textFile, attachmentInfo, waiter->iStatus );
-    CleanupStack::Pop(); // waiter
-    CleanupStack::Pop(); // attachmentInfo
-    CleanupStack::PushL(waiter);
-    waiter->StartAndWait();
-    CleanupStack::PopAndDestroy(waiter);        
-   
-    HBufC8* tempBuf = HBufC8::NewLC( parameters.iMessageBodyText->Des().Length() );
-    tempBuf->Des().Copy( parameters.iMessageBodyText->Des() );
-    textFile.Write( tempBuf->Des() );        
-    textFile.Close();
-    CleanupStack::PopAndDestroy(); //tempBuf
-    
-    CleanupStack::PopAndDestroy(); //mimeHeaders
-
-    
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();        
-    
-    // set the details field
-    if (parameters.iFolderType == EInbox)
-        {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
-        }
-    else
-        {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
-        }    
-
-    // set the description field same as the message subject
-    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
-
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);        
-    
-
-      // save the attachments
-    HandleAttachementsL(parameters, store, err );
-//    for (TInt i=0; i<parameters.iAttachments->Count(); i++)
-//        {
-//        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
-//
-//        TParse parser;
-//        parser.Set(sourceFileName, NULL, NULL);
-//        TFileName shortFileName = parser.NameAndExt();
-//
-//        // get the mime type
-//        RApaLsSession ls;
-//        User::LeaveIfError(ls.Connect());
-//        CleanupClosePushL<RApaLsSession>(ls);
-//        TUid appUid;
-//        TDataType dataType;
-//        ls.AppForDocument(sourceFileName, appUid, dataType);
-//        CleanupStack::PopAndDestroy(); //ls
-//        TPtrC8 mimeType = dataType.Des8();
-//        
-//        // attachment settings
-//        MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-//        CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
-//        attachmentInfo->SetAttachmentNameL( shortFileName );        
-//        attachmentInfo->SetMimeTypeL( mimeType );        
-//
-//        // save
-//        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-//        
-//        TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
-//        if (err == KErrNone)
-//            waiter->StartAndWait();
-//        else
-//            LOGSTRING2("Creator: CCreatorMessages::CreateMMSEntryL failed to attach %S", &sourceFileName);
-//
-//        CleanupStack::PopAndDestroy(waiter);  
-//        }
-
-    // save the changes made to the message store
-    store->CommitL();
-    CleanupStack::PopAndDestroy(store);   
-           
-    
-    // save the message      
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-	messageEntry.SetAttachment(ETrue);
-    messageEntry.iDate.HomeTime();
-    messageEntry.SetVisible(ETrue);
-    messageEntry.SetInPreparation(EFalse);
-    if (parameters.iCreateAsUnread)
-        {
-        messageEntry.SetUnread(ETrue);
-        messageEntry.SetNew(ETrue);
-        }
-    else
-        {
-        messageEntry.SetUnread(EFalse);
-        messageEntry.SetNew(EFalse);
-        }
-    messageEntry.SetComplete(ETrue);
-    messageEntry.iServiceId = defaultServiceId;
-    messageEntry.iRelatedId = 0;
-    
-    if (parameters.iFolderType == EDrafts) 
-        messageEntry.SetReadOnly(EFalse);
-    else
-        messageEntry.SetReadOnly(ETrue);
-
-	messageEntry.iMtmData1 = KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated;
-	
-    clientMtm->Entry().ChangeL(messageEntry);
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); // registry, clientMtm        
-        
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::HandleAttachementsL(const CMessagesParameters& parameters, CMsvStore* store, TInt err )
-    {
-    // save the attachments (added with id's)
-  for (TInt i=0; i<parameters.iAttachments->Count(); i++)
-      {
-      TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
-      HandleAttachementL(store, err, sourceFileName );
-
-      }    
-  //Adding attachmentpaths
-  for (TInt i=0; i<parameters.iAttachmentPaths.Count(); i++)
-      {
-      HBufC* point = parameters.iAttachmentPaths[i];
-      TFileName sourceFileName(point->Des());      
-      HandleAttachementL(store, err, sourceFileName );
-      }
-    }
-//----------------------------------------------------------------------------
-
-void CCreatorMessages::HandleAttachementL(CMsvStore* store, TInt err, TFileName& sourceFileName )
-    {
-    TParse parser;
-    parser.Set(sourceFileName, NULL, NULL);
-    TFileName shortFileName = parser.NameAndExt();
-
-    // get the mime type
-    RApaLsSession ls;
-    User::LeaveIfError(ls.Connect());
-    CleanupClosePushL<RApaLsSession>(ls);
-    TUid appUid;
-    TDataType dataType;
-    ls.AppForDocument(sourceFileName, appUid, dataType);
-    CleanupStack::PopAndDestroy(); //ls
-    TPtrC8 mimeType = dataType.Des8();
-    
-    // attachment settings
-    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
-    CleanupStack::PushL(attachmentInfo);
-    attachmentInfo->SetAttachmentNameL( shortFileName );        
-    attachmentInfo->SetMimeTypeL( mimeType );
-    
-    if ( mimeType == _L8("text/plain") )
-        {
-        // CMsvMimeHeaders needs to be stored in case of text file 
-        CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
-        CleanupStack::PushL(mimeHeaders);
-        mimeHeaders->SetContentTypeL( _L8("text") );
-        mimeHeaders->SetContentSubTypeL( _L8("plain") );
-        mimeHeaders->SetMimeCharset( KMmsUtf8 );
-        mimeHeaders->StoreL( *attachmentInfo );
-        CleanupStack::PopAndDestroy( mimeHeaders );
-        }
-
-    // save
-    
-    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-    TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
-    if (err == KErrNone)
-    	{
-        waiter->StartAndWait();
-        CleanupStack::PopAndDestroy(waiter);
-        CleanupStack::Pop(); // attachmentInfo, the ownership is transferred
-    	}
-    else
-    	{
-    	CleanupStack::PopAndDestroy(waiter);
-    	CleanupStack::PopAndDestroy(); // attachmentInfo, ownership is not transferred (leave occurs)
-        LOGSTRING2("Creator: CCreatorMessages::HandleAttachementsL failed to attach %S", &sourceFileName);
-    	}
-    }
-      //----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateAMSEntryL(const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateAMSEntryL");
-
-    TInt err = KErrNone;
-
-        
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-
-    // get the client mtm and return if it isn't supported in the system        
-    CMmsClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CMmsClientMtm*>(registry->NewMtmL(KUidMsgTypeMultimedia)));
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("MMS: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // get default service
-    TMsvId defaultServiceId = 0;
-    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
-    if (err)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("MMS: Define MMS settings first"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        } 
-    
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry);    
-    
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-    // set subject
-    clientMtm->SetSubjectL(parameters.iMessageSubject->Des() );
-            
-    // set some mms defaults
-    clientMtm->SetMessageClass(EMmsClassPersonal);
-    clientMtm->SetExpiryInterval(86400);
-    clientMtm->SetDeliveryTimeInterval(3600);
-    clientMtm->SetMessagePriority(EMmsPriorityLow);
-    clientMtm->SetSenderVisibility(EMmsMaximumSenderVisibility);
-    clientMtm->SetDeliveryReport(EMmsDeliveryReportYes);
-    clientMtm->SetReadReply(EMmsReadReplyYes);        
-    
-    // set the sender / addressee field
-    if (parameters.iFolderType == EInbox)
-        {
-        AddMtmSenderL(*clientMtm, parameters, EFalse);                
-        }
-
-    // Add all recipients to clientMtm
-    AddRecipientsL( *clientMtm, parameters, EFalse );
-    
-        
-    // get an access to the message store
-    CMsvStore* store = msvEntry->EditStoreL();
-    CleanupStack::PushL(store);                  
-   
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();        
-    
-    // set the details field
-    if (parameters.iFolderType == EInbox)
-        {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
-        }  
-    else
-        {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
-        }
-
-    // set the description field same as the message subject
-    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
-    messageEntry.iBioType = KUidMsgSubTypeMmsAudioMsg.iUid;
-    
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);        
-    
-
-    TFileName sourceFileName = iEngine->TestDataPathL( CCreatorEngine::EAMR_20kB );
-    TParse parser;
-    parser.Set(sourceFileName, NULL, NULL);
-    TFileName shortFileName = parser.NameAndExt();
-
-    // get the mime type
-    RApaLsSession ls;
-    User::LeaveIfError(ls.Connect());
-    CleanupClosePushL<RApaLsSession>(ls);
-    TUid appUid;
-    TDataType dataType;
-    ls.AppForDocument(sourceFileName, appUid, dataType);
-    CleanupStack::PopAndDestroy(); //ls
-    TPtrC8 mimeType = dataType.Des8();
-        
-    // attachment settings
-    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-    CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
-    attachmentInfo->SetAttachmentNameL( shortFileName );        
-    attachmentInfo->SetMimeTypeL( mimeType );        
-
-    // save
-    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-      
-    TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
-    if (err == KErrNone)
-        waiter->StartAndWait();
-    else
-        LOGSTRING2("Creator: CCreatorMessages::CreateAMSEntryL failed to attach %S", &sourceFileName);
-
-    CleanupStack::PopAndDestroy(waiter);  
-
-    // save the changes made to the message store
-    store->CommitL();
-    CleanupStack::PopAndDestroy(store);   
-           
-    
-    // save the message      
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-	messageEntry.SetAttachment(ETrue);
-    messageEntry.iDate.HomeTime();
-    messageEntry.SetVisible(ETrue);
-    messageEntry.SetInPreparation(EFalse);
-    if (parameters.iCreateAsUnread)
-        {
-        messageEntry.SetUnread(ETrue);
-        messageEntry.SetNew(ETrue);
-        }
-    else
-        {
-        messageEntry.SetUnread(EFalse);
-        messageEntry.SetNew(EFalse);
-        }
-    messageEntry.SetComplete(ETrue);
-    messageEntry.iServiceId = defaultServiceId;
-    messageEntry.iRelatedId = 0;
-    
-    if (parameters.iFolderType == EDrafts) 
-        messageEntry.SetReadOnly(EFalse);
-    else
-        messageEntry.SetReadOnly(ETrue);
-
-	messageEntry.iMtmData1 = KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated;
-	
-    clientMtm->Entry().ChangeL(messageEntry);
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); // registry, clientMtm        
-        
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateEmailEntryL(const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateEmailEntryL");
-
-    TInt err = KErrNone;
-
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-    
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-    
-    // get the client mtm and return if it isn't supported in the system        
-    CSmtpClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CSmtpClientMtm*>(registry->NewMtmL(KUidMsgTypeSMTP)));
-    
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("Email: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // get default service
-    TMsvId defaultServiceId(0);
-    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
-    if (err)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("Email: Define a mailbox first"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        } 
-                
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        case EMailbox:  { msvEntry->SetEntryL(iUserSelectedMailbox);          break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry); 
-
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-    // set subject
-    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
-    
-    // set body
-    clientMtm->Body().Reset();
-    clientMtm->Body().InsertL(0, parameters.iMessageBodyText->Des()); 
-
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();
-    
-    // set the address fields
-    if (parameters.iFolderType == EInbox)
-        {
-        AddSenderToMtmAddresseeL(*clientMtm, parameters, ETrue );
-        SetSenderToEntryDetails(messageEntry, parameters, ETrue);
-        messageEntry.iMtm = KUidMsgTypeIMAP4;  // or any other than KUidMsgTypeSMTP to display 'from' field instead of 'to' field 
-        }
-    else
-        {
-        // Add all recipients to clientMtm
-        AddRecipientsL( *clientMtm, parameters, ETrue );
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);        
-        }
-
-    // set the description field same as the message subject
-    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
-
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);
-    
-    // get an access to the message store
-    CMsvStore* store = msvEntry->EditStoreL();
-    CleanupStack::PushL(store); 
-    
-    // save the attachments
-    HandleAttachementsL(parameters, store, err);
-//    for (TInt i=0; i<parameters.iAttachments->Count(); i++)
-//        {
-//        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i) );
-//
-//        TParse parser;
-//        parser.Set(sourceFileName, NULL, NULL);
-//        TFileName shortFileName = parser.NameAndExt();
-//
-//        // get the mime type
-//        RApaLsSession ls;
-//        User::LeaveIfError(ls.Connect());
-//        CleanupClosePushL<RApaLsSession>(ls);
-//        TUid appUid;
-//        TDataType dataType;
-//        ls.AppForDocument(sourceFileName, appUid, dataType);
-//        CleanupStack::PopAndDestroy(); //ls
-//        TPtrC8 mimeType = dataType.Des8();
-//        
-//        // attachment settings
-//        MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-//        CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred
-//        attachmentInfo->SetAttachmentNameL( shortFileName );        
-//        attachmentInfo->SetMimeTypeL( mimeType );        
-//
-//        // save
-//        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-//
-//        TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus ));
-//        if (err == KErrNone)
-//            waiter->StartAndWait();
-//        else
-//            LOGSTRING2("Creator: CCreatorMessages::CreateEmailEntryL failed to attach %S", &sourceFileName);
-//
-//        CleanupStack::PopAndDestroy(waiter);  
-//        }
-
-    // save the changes made to the message store
-    store->CommitL();
-    CleanupStack::PopAndDestroy(store); 
-            
-    // save the message      
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-	TMsvEmailEntry temailEntry = static_cast<TMsvEmailEntry>(messageEntry);
-    temailEntry.SetMessageFolderType(EFolderTypeUnknown);
-    temailEntry.SetDisconnectedOperation(ENoDisconnectedOperations);
-    temailEntry.SetEncrypted(EFalse);
-    temailEntry.SetSigned(EFalse);
-    temailEntry.SetVCard(EFalse);
-    temailEntry.SetVCalendar(EFalse);
-    temailEntry.SetReceipt(EFalse);
-    temailEntry.SetMHTMLEmail(EFalse);
-    temailEntry.SetBodyTextComplete(ETrue);
-    
-	if (parameters.iAttachments->Count() > 0)
-        temailEntry.SetAttachment(ETrue);
-    else
-        temailEntry.SetAttachment(EFalse);
-	
-    temailEntry.iDate.HomeTime();
-    temailEntry.SetVisible(ETrue);
-    temailEntry.SetInPreparation(EFalse);
-    if (parameters.iCreateAsUnread)
-        {
-        temailEntry.SetUnread(ETrue);
-        temailEntry.SetNew(ETrue);
-        }
-    else
-        {
-        temailEntry.SetUnread(EFalse);
-        temailEntry.SetNew(EFalse);
-        }
-    temailEntry.SetComplete(ETrue);
-    temailEntry.iServiceId = defaultServiceId;
-    temailEntry.iRelatedId = 0;
-    
-    clientMtm->Entry().ChangeL(temailEntry);
-
-    // reset email headers
-    CImHeader* header = CImHeader::NewLC();
-    CMsvStore* msvStore = msvEntry->EditStoreL();
-    CleanupStack::PushL(msvStore);
-    header->RestoreL(*msvStore);
-    header->SetSubjectL( parameters.iMessageSubject->Des() );
-    if( iSenderArray.Count() == 0 )
-        {
-        GetSendersL(iSenderArray, parameters, ETrue, 1 );
-        }
-    
-    if( iSenderArray.Count() > 0 )
-        {
-        header->SetFromL(iSenderArray[0]->Des());
-        }
-    else
-        {
-        header->SetFromL( parameters.iSenderAddress->Des() );
-        }
-    if( parameters.iRecipientAddress->Length() > 0 )
-        {
-        header->SetReceiptAddressL( parameters.iRecipientAddress->Des() );
-        }
-    else if( parameters.iRecipientAddressArray.Count() > 0 )
-        {
-        header->SetReceiptAddressL( parameters.iRecipientAddressArray[0]->Des());
-        }
-    
-    header->StoreL( *msvStore );
-    msvStore->CommitL();
-    CleanupStack::PopAndDestroy(2); // msvStore, header
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); // registry, clientMtm 
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateSmartMessageEntryL(const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateSmartMessageEntryL");
-
-    TInt err = KErrNone;
-
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-    
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-
-    // get the client mtm and return if it isn't supported in the system        
-    CSmsClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CSmsClientMtm*>(registry->NewMtmL(KUidMsgTypeSMS)));
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("BIO: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // get default service
-    TMsvId defaultServiceId = 0;
-    TRAP(err, defaultServiceId = clientMtm->DefaultServiceL());
-    if (err)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("SMS: Define a SMS centre first"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        } 
-    
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry);    
-    
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-     // set the from field to sms header
-    if (parameters.iFolderType == EInbox)
-        {
-        CSmsHeader& smsHeader = clientMtm->SmsHeader();
-        
-        if( parameters.iSenderAddress )
-            {
-            smsHeader.SetFromAddressL( parameters.iSenderAddress->Des() );
-            }
-        else
-            {
-            smsHeader.SetFromAddressL(KEmpty);
-            }
-        }       
-
-    // set body, the BIO message itself
-    clientMtm->Body().Reset();
-    clientMtm->Body().InsertL(0, _L("Business Card\nTester Mike\nThe Company Ltd.\nSoftware Engineer\ntel +358 66 1234567\n")); 
-
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();
-
-    // TO-DO: Add support for all BIO messages, currently just insert a business card message ... :
-    // set the message type
-    // parameters.iBIOMessageType ...
-    clientMtm->BioTypeChangedL(KUidBIOBusinessCardMsg);
-    messageEntry.iBioType = KUidBIOBusinessCardMsg.iUid;
-
-    // set the details field
-    if (parameters.iFolderType == EInbox)
-        {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
-        }        
-    else
-        {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
-        }
-
-    // set the subject line
-    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
-
-    // set correct MTM type
-    messageEntry.iMtm= KUidBIOMessageTypeMtm;
-
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);
-
-    // save the message     
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-    messageEntry.SetAttachment(EFalse);
-    messageEntry.iDate.HomeTime();
-    messageEntry.SetVisible(ETrue);
-    messageEntry.SetInPreparation(EFalse);
-    if (parameters.iCreateAsUnread)
-        {
-        messageEntry.SetUnread(ETrue);
-        messageEntry.SetNew(ETrue);
-        }
-    else
-        {
-        messageEntry.SetUnread(EFalse);
-        messageEntry.SetNew(EFalse);
-        }
-    messageEntry.SetComplete(ETrue);
-    messageEntry.iServiceId = defaultServiceId;
-    messageEntry.iRelatedId = 0;
-    clientMtm->Entry().ChangeL(messageEntry);
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); // registry, clientMtm
-        
-    
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorMessages::CreateObexEntryL(TUid aMtm, const CMessagesParameters& parameters)
-    {
-    LOGSTRING("Creator: CCreatorMessages::CreateObexEntryL");
-
-    TInt err = KErrNone;
-
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }    
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL(registry);
-
-    // get the client mtm and return if it isn't supported in the system        
-    CObexClientMtm* clientMtm = NULL;
-    TRAP(err, clientMtm = static_cast<CObexClientMtm*>(registry->NewMtmL(aMtm)));
-    if (err || !clientMtm)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("Obex: Message type module not found"));
-        CleanupStack::PopAndDestroy(2);
-        User::Leave(KErrNotFound);
-        }  
-    CleanupStack::PushL(clientMtm);   
-
-    // create a new object to access an existing entry
-    CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
-    CleanupStack::PushL(msvEntry);
-  
-    // define default service
-    TMsvId defaultServiceId = 0;
-    
-    // set folder type
-    switch (parameters.iFolderType)
-        {
-        case EInbox:    { msvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);   break; }
-        case EDrafts:   { msvEntry->SetEntryL(KMsvDraftEntryId);              break; }
-        case EOutbox:   { msvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);  break; }
-        case ESent:     { msvEntry->SetEntryL(KMsvSentEntryId);               break; }
-        default:        { User::Panic(_L("Folder Type"), 871);                break; } 
-        }
-        
-    // mtm takes ownership of entry context	
-    CleanupStack::Pop(msvEntry);
-    clientMtm->SetCurrentEntryL(msvEntry);    
-    
-    // create a new message
-    clientMtm->CreateMessageL(defaultServiceId);
-
-    // get the entry of the message
-    TMsvEntry messageEntry = clientMtm->Entry().Entry();
-
-    // set subject
-    clientMtm->SetSubjectL( parameters.iMessageSubject->Des() );
-    messageEntry.iDescription.Set( parameters.iMessageSubject->Des().Left(KSmsDescriptionLength) );
-
-    // set body, must be empty for obex messages
-    clientMtm->Body().Reset();
-
-    // set the details field and
-    if (parameters.iFolderType == EInbox)
-        {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);
-        }        
-    else
-        {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
-        }
-    
-    // set mtm
-    messageEntry.iMtm = aMtm;
-    messageEntry.iType = KUidMsvMessageEntry;
-    messageEntry.iServiceId = KMsvUnknownServiceIndexEntryId;
-
-    // save the changes done above
-    clientMtm->Entry().ChangeL(messageEntry);
-
-    // save the message      
-    clientMtm->SaveMessageL();
-    	
-	// final fine tuning
-    messageEntry.iDate.HomeTime();
-    messageEntry.SetVisible(ETrue);
-    messageEntry.SetInPreparation(EFalse);
-    if (parameters.iCreateAsUnread)
-        {
-        messageEntry.SetUnread(ETrue);
-        messageEntry.SetNew(ETrue);
-        }
-    else
-        {
-        messageEntry.SetUnread(EFalse);
-        messageEntry.SetNew(EFalse);
-        }
-    messageEntry.SetComplete(ETrue);
-    clientMtm->Entry().ChangeL(messageEntry);
-    
-    // save the attachment
-    if (parameters.iAttachments->Count() >= 1)
-        {
-        // create a new entry for the attachment
-        TMsvEntry attachTEntry;
-        attachTEntry.iType      = KUidMsvAttachmentEntry;
-        attachTEntry.iServiceId = KMsvUnknownServiceIndexEntryId;   
-        attachTEntry.iMtm       = KUidMsgTypeBt; //save as bt message
-        
-        msvEntry->CreateL(attachTEntry);
-        
-        CMsvEntry* attachEntry = iSession->GetEntryL(attachTEntry.Id());
-        clientMtm->SetCurrentEntryL(attachEntry);
-                
-        // get source file
-        TFileName sourceFileName = iEngine->TestDataPathL( (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(0) );
-
-        // get the mime type
-        RApaLsSession ls;
-        User::LeaveIfError(ls.Connect());
-        CleanupClosePushL<RApaLsSession>(ls);
-        TUid appUid;
-        TDataType mimeType;
-        ls.AppForDocument(sourceFileName, appUid, mimeType);
-        CleanupStack::PopAndDestroy(); //ls
-        
-        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-
-        // add an attachment to the current message entry
-        TRAP(err, clientMtm->AddAttachmentL( sourceFileName, mimeType.Des8(), 0, waiter->iStatus ));
-        if (err == KErrNone)
-            waiter->StartAndWait();
-        else
-            LOGSTRING2("Creator: CCreatorMessages::CreateObexEntryL failed to attach %S", &sourceFileName);
-        
-        CleanupStack::PopAndDestroy(waiter);
-        }
-    
-    // id has been generated, store it for being able to delete
-    // only entries created with Creator
-    iEntryIds.Append( messageEntry.Id() );
-    
-    CleanupStack::PopAndDestroy(2); // registry, clientMtm 
-
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorMessages::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
-    {
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
-    {        
-    // Only one sender allowed:
-    if( iSenderArray.Count() == 0 )
-        {
-        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
-        }
-    if( iSenderArray.Count() > 0 )
-        {        
-        aMsgEntry.iDetails.Set( iSenderArray[0]->Des() );        
-        }
-    else
-        {
-        aMsgEntry.iDetails.Set(KEmpty);
-        }        
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
-    {        
-    // Only one sender allowed:
-    GetAllRecipientsL(iRecipientArray, aParameters, aUseEmailAddress);
-    if( iRecipientArray.Count() > 0 )
-        {
-        const TDesC& temp = iRecipientArray[0]->Des();
-        aMsgEntry.iDetails.Set( temp );
-        }
-    else
-        {
-        aMsgEntry.iDetails.Set(KEmpty);
-        }        
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::AddSenderToMtmAddresseeL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
-    {    
-    // Only one sender allowed:
-    if( iSenderArray.Count() == 0 )
-        {
-        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
-        }
-    
-    for( TInt i = 0; i < iSenderArray.Count(); ++i )
-        {
-        aMtm.AddAddresseeL( iSenderArray[i]->Des() );        
-        }    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::AddMtmSenderL(CMmsClientMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
-    {    
-    // Only one sender allowed:
-    if( iSenderArray.Count() == 0 )
-        {
-        GetSendersL(iSenderArray, aParameters, aUseEmailAddress, 1 );
-        }
-    
-    if( iSenderArray.Count() > 0 )
-        {
-        aMtm.SetSenderL( iSenderArray[0]->Des() );        
-        }    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::GetSendersL(RPointerArray<HBufC>& aSenderArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress, TInt aMaxNum )
-    {
-    TInt counter = 0;
-    
-    if( counter < aMaxNum || aMaxNum == KUndef )
-        {
-        if( aParameters.iSenderAddress && aParameters.iSenderAddress->Length() > 0 )
-            {
-            HBufC* temp = HBufC::NewL(aParameters.iSenderAddress->Length());
-            CleanupStack::PushL(temp);
-            temp->Des().Copy(aParameters.iSenderAddress->Des());
-            aSenderArray.AppendL( temp );
-            CleanupStack::Pop(); // temp
-            ++counter;
-            }
-        }
-            
-    if( counter < aMaxNum || aMaxNum == KUndef )
-        {
-        RPointerArray<HBufC> tempArray;
-        CleanupResetAndDestroyPushL( tempArray );
-        GetLinkedAddressesL(tempArray, aParameters.iSenderLinkIds, aUseEmailAddress, aParameters.iNumberOfExistingSenders);
-        for( TInt i = 0; i < tempArray.Count() && (counter < aMaxNum || aMaxNum == KUndef); ++i )
-            {
-            HBufC* temp = tempArray[i]->AllocLC();
-            aSenderArray.AppendL(temp);
-            CleanupStack::Pop(); // temp
-            ++counter;
-            }
-        CleanupStack::PopAndDestroy(); // tempArray
-        }    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::AddRecipientsL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
-    {
-    GetAllRecipientsL(iRecipientArray, aParameters, aUseEmailAddress);
-    for( TInt i = 0; i < iRecipientArray.Count(); ++i )
-        {
-        aMtm.AddAddresseeL( iRecipientArray[i]->Des() );        
-        }    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::GetAllRecipientsL(RPointerArray<HBufC>& aRecipientArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress )
-    {
-    
-    // If iRecipientAddress is given, add it to the array:
-    if( aParameters.iRecipientAddress && aParameters.iRecipientAddress->Length() > 0 )
-        {
-        HBufC* temp = HBufC::NewL(aParameters.iRecipientAddress->Length());
-        CleanupStack::PushL(temp);
-        temp->Des().Copy(aParameters.iRecipientAddress->Des());
-        aRecipientArray.AppendL( temp );
-        CleanupStack::Pop(); // temp
-        }
-    
-    // Add all recipients listed in iRecipientAddressArray:
-    for( TInt i = 0; i < aParameters.iRecipientAddressArray.Count(); ++i )
-        {
-        HBufC* temp = HBufC::NewL(aParameters.iRecipientAddressArray[i]->Length());
-        CleanupStack::PushL(temp);
-        temp->Des().Copy(aParameters.iRecipientAddressArray[i]->Des());
-        aRecipientArray.AppendL( temp );
-        CleanupStack::Pop(); // temp        
-        }
-    
-    // Get all linked addresses. 
-    GetLinkedAddressesL(aRecipientArray, aParameters.iRecipientLinkIds, aUseEmailAddress, aParameters.iNumberOfExistingRecipients);
-    }
-
-/*
- * Get all linked addresses. This method gets addresses that are linked with contact-set id and 
- * existing addresses from the contact database, if required.
- */
-void CCreatorMessages::GetLinkedAddressesL(
-        RPointerArray<HBufC>& aAddressArray, 
-        const RArray<TLinkIdParam>& aLinkIds, 
-        TBool aUseEmailAddress,
-        TInt aNumOfExistingAddresses )
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-    
-    if( aNumOfExistingAddresses > 0 || aLinkIds.Count() > 0 )
-        {
-        // First create contact manager:
-        if( iContactManager == 0)
-        	{
-        	CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-        	uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
-        	iContactManager = CVPbkContactManager::NewL( *uriArray, &CCoeEnv::Static()->FsSession());
-        	CleanupStack::PopAndDestroy(uriArray);
-
-        
-            // Then open the stores:
-                
-            MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();              
-            storeList.OpenAllL(*this);
-            iWaiter->StartAndWait(); 
-            _LIT(dbUri, "cntdb://c:contacts.cdb");
-            TVPbkContactStoreUriPtr uri(dbUri);                   
-            iStore = storeList.Find(uri);
-        	}
-        // Existing attendees:
-        if( aNumOfExistingAddresses > 0 )
-        	{        	
-        	if( iStore )
-        		{
-        		const MVPbkFieldTypeList& fieldList = iStore->StoreProperties().SupportedFields();
-
-        		// get contacts, results will be set to iExistingContacts
-        		MVPbkContactOperationBase* operation = iContactManager->FindL(_L(""), fieldList , *this);
-        		if (operation)
-        			{
-        			CleanupDeletePushL( operation );
-        			iWaiter->StartAndWait();//Making asynchronous FindL to synchronous
-        			CleanupStack::Pop(operation);
-        			delete operation;
-        			}
-        		if( iExistingContacts )
-        			{
-        			// Loop the links pointing to the existing contacts:
-        			TInt addedContacts = 0;
-        			for( TInt i = 0; i < iExistingContacts->Count() && addedContacts < aNumOfExistingAddresses; ++i )
-        				{
-        				// Get the address of the actual contact based on the contact link. Results are stored in
-        				// iTmpEmail and iTmpPhoneNumber
-        				MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( iExistingContacts->At(i), *this );
-        				if (operation)
-        					{
-        					CleanupDeletePushL( operation );
-        					iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous
-        					CleanupStack::Pop(); // operation
-        					delete operation;
-        					operation = 0;
-        					HandleSingleContactResultL();
-        					if( aUseEmailAddress && iTmpEmail && iTmpEmail->Length() > 0 )
-        						{
-        						HBufC* temp = HBufC::NewL(iTmpEmail->Length());
-        						CleanupStack::PushL(temp);
-        						temp->Des().Copy(iTmpEmail->Des());
-        						aAddressArray.AppendL(temp);
-        						CleanupStack::Pop(); // temp
-        						delete iTmpEmail;
-        						iTmpEmail = 0; // The pointer is owned by the aAddressArray now.    
-        						++addedContacts;
-        						}
-        					else if( !aUseEmailAddress && iTmpPhoneNumber && iTmpPhoneNumber->Length() > 0 )
-        						{
-        						HBufC* temp = HBufC::NewL(iTmpPhoneNumber->Length());
-        						CleanupStack::PushL(temp);
-        						temp->Des().Copy(iTmpPhoneNumber->Des());
-        						aAddressArray.AppendL(temp);
-        						CleanupStack::Pop(); // temp
-        						delete iTmpPhoneNumber;
-        						iTmpPhoneNumber = 0; // The pointer is owned by the aAddressArray now.
-        						++addedContacts;
-        						}
-        					}                            
-        				}
-        			}
-        		} 
-        	}
-
-        // Loop linked contact-set ids:
-        for( TInt i = 0; i < aLinkIds.Count(); ++i )
-        	{
-        	TLinkIdParam id = aLinkIds[i];
-        	// Get all contact links in the contact-set...
-        	RPointerArray<MVPbkContactLink>& links = ContactLinkCache::Instance()->ContactLinks(id.iLinkId);
-        	// ... and loop the links:
-        	TInt addedContacts = 0;
-        	for( TInt j = 0; j < links.Count() && (id.iLinkAmount < 0 || addedContacts < id.iLinkAmount); ++j )
-        		{
-        		// Again retrieve contact based on the contact link. Results are stored in
-        		// iTmpEmail and iTmpPhoneNumber:
-        		MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( *(links[j]), *this );
-        		if (operation)
-        			{
-        			CleanupDeletePushL( operation );
-        			iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous
-        			CleanupStack::Pop(operation);
-        			delete operation;
-        			operation = 0;
-        			HandleSingleContactResultL();
-        			if( aUseEmailAddress && iTmpEmail && iTmpEmail->Length() > 0 )
-        				{                                    
-        				aAddressArray.AppendL(iTmpEmail);
-        				iTmpEmail = 0; // The pointer is owned by the aAddressArray now.
-        				++addedContacts;
-        				}
-        			else if( !aUseEmailAddress && iTmpPhoneNumber && iTmpPhoneNumber->Length() > 0 )
-        				{
-        				aAddressArray.AppendL(iTmpPhoneNumber);
-        				iTmpPhoneNumber = 0; // The pointer is owned by the aAddressArray now.
-        				++addedContacts;
-        				}
-        			}                 
-        		}
-        	}
-
-        //if( iContactManager )
-        //	iContactManager->ContactStoresL().CloseAll(*this);
-        }
-#endif
-}
-
-//----------------------------------------------------------------------------
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-void CCreatorMessages::VPbkSingleContactOperationComplete(
-            MVPbkContactOperationBase& /*aOperation*/,
-            MVPbkStoreContact* aContact )
-    {
-    LOGSTRING("Creator: CCreatorMessages::VPbkSingleContactOperationComplete" );
-    iWaiter->Cancel();
-    delete iTempContact;    
-    iTempContact = aContact;
-    }
-
-void CCreatorMessages::HandleSingleContactResultL()
-	{
-    if( iTempContact )
-        {        
-        TPtrC phoneNumber;        
-        TPtrC email;
-       
-        // Put contact's name to temporary member:
-        delete iTmpPhoneNumber;
-        iTmpPhoneNumber = 0;
-        delete iTmpEmail;
-        iTmpEmail = 0;
-       
-        TBool phFound = EFalse;
-        TBool emailFound = EFalse;
-        
-        MVPbkStoreContactFieldCollection& fields = iTempContact->Fields();
-        TInt fieldCount = fields.FieldCount();
-        for (TInt i = 0; i < fieldCount; ++i)
-            {
-            MVPbkStoreContactField& field = fields.FieldAt(i);
-            MVPbkContactFieldData& fieldData = field.FieldData();
-            const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
-            
-            if( fieldType ) 
-                {
-                // Find phone number and email:
-                TInt fieldId( fieldType->FieldTypeResId() );
-            
-                TVPbkFieldStorageType dataType = fieldData.DataType();
-                if( dataType == EVPbkFieldStorageTypeText)
-                    {
-                    MVPbkContactFieldTextData& textData = MVPbkContactFieldTextData::Cast(fieldData);                
-                    if( !phFound &&
-                        (fieldId == R_VPBK_FIELD_TYPE_LANDPHONEGEN ||
-                        fieldId == R_VPBK_FIELD_TYPE_LANDPHONEHOME ||
-                        fieldId == R_VPBK_FIELD_TYPE_LANDPHONEWORK ||                      
-                        fieldId == R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ||
-                        fieldId == R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ||
-                        fieldId == R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ))
-                        {                    
-                        phoneNumber.Set(textData.Text());
-                        phFound = ETrue;
-                        }
-                    else if( !emailFound &&
-                            (fieldId == R_VPBK_FIELD_TYPE_EMAILGEN ||
-                            fieldId == R_VPBK_FIELD_TYPE_EMAILHOME ||
-                            fieldId == R_VPBK_FIELD_TYPE_EMAILWORK ))
-                        {
-                        email.Set(textData.Text());
-                        emailFound = ETrue;
-                        }
-                    
-                    if( phFound && emailFound )
-                        break; // No need to loop more fields.
-                    }            
-                }
-            }
-        if( phoneNumber.Length() > 0 )
-            {
-            delete iTmpPhoneNumber;
-            iTmpPhoneNumber = 0;
-            iTmpPhoneNumber = HBufC::NewL(phoneNumber.Length());
-            iTmpPhoneNumber->Des().Copy(phoneNumber); 
-            }                
-        if( email.Length() > 0 )
-            {
-            delete iTmpEmail;
-            iTmpEmail = 0;
-            iTmpEmail = HBufC::NewL(email.Length());            	
-            iTmpEmail->Des().Copy(email);
-            }
-        delete iTempContact;
-        iTempContact = 0;
-        }
-    }
-    
-void CCreatorMessages::VPbkSingleContactOperationFailed(
-            MVPbkContactOperationBase& /*aOperation*/, 
-            TInt aError )
-    {
-    LOGSTRING2("Creator: CCreatorMessages::VPbkSingleContactOperationFailed - Error: %d", aError );
-    iWaiter->Cancel();
-    }
-
-void CCreatorMessages::OpenComplete()
-    {    
-    LOGSTRING("Creator: CCreatorMessages::OpenComplete()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorMessages::StoreReady(MVPbkContactStore& /*aContactStore*/)
-    {
-    LOGSTRING("Creator: CCreatorMessages::StoreReady()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorMessages::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, 
-        TInt /*aReason*/)
-    {
-    LOGSTRING("Creator: CCreatorMessages::StoreUnavailable()");
-    iWaiter->Cancel();
-    }
-
-
-void CCreatorMessages::HandleStoreEventL(
-        MVPbkContactStore& /*aContactStore*/, 
-        TVPbkContactStoreEvent /*aStoreEvent*/)
-    {
-    LOGSTRING("Creator: CCreatorMessages::HandleStoreEventL()");
-    iWaiter->Cancel();
-    }
-
-void CCreatorMessages::FindCompleteL( MVPbkContactLinkArray* aResults )
-    {
-    LOGSTRING("Creator: CCreatorMessages::FindCompleteL()");
-    iWaiter->Cancel();
-    delete iExistingContacts;
-    iExistingContacts = aResults;
-    }
-
-void CCreatorMessages::FindFailed( TInt aError )
-    {
-    LOGSTRING2("Creator: CCreatorMessages:FindFailed() - Error: %d", aError);    
-    iWaiter->Cancel();
-    delete iExistingContacts;
-    iExistingContacts = 0;
-    }
-#endif
-
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorMessages::DeleteAllL");
-    DeleteAllMessagesL( EFalse );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::DeleteAllMessagesL( TBool aOnlyCreatedWithCreator )
-    {
-    LOGSTRING("Creator: CCreatorMessages::DeleteAllMessagesL");
-    TInt err( KErrNone );
-    
-    // init    
-    if( iSession == 0 )
-        {
-        iSession = CMsvSession::OpenSyncL(*this);
-        }
-    
-    CClientMtmRegistry* registry = CClientMtmRegistry::NewL(*iSession);
-    CleanupStack::PushL( registry );
-
-    // get the client mtm and return if it isn't supported in the system        
-    CSmsClientMtm* clientMtm( NULL );
-    TRAP( err, clientMtm = static_cast<CSmsClientMtm*>( registry->NewMtmL( KUidMsgTypeSMS ) ) );
-    if ( err || !clientMtm )
-        {
-        CAknErrorNote* note = new (ELeave) CAknErrorNote();
-        note->ExecuteLD( _L( "SMS: Message type module not found" ) );
-        CleanupStack::PopAndDestroy( 2 );
-        User::Leave( KErrNotFound );
-        }
-    CleanupStack::PushL( clientMtm );
-    
-    TRAP_IGNORE( DeleteAllFromFolderL( KMsvGlobalInBoxIndexEntryId, iSession, clientMtm, aOnlyCreatedWithCreator ) );
-    TRAP_IGNORE( DeleteAllFromFolderL( KMsvDraftEntryId, iSession, clientMtm, aOnlyCreatedWithCreator ) );
-    TRAP_IGNORE( DeleteAllFromFolderL( KMsvGlobalOutBoxIndexEntryId, iSession, clientMtm, aOnlyCreatedWithCreator ) );
-    TRAP_IGNORE( DeleteAllFromFolderL( KMsvSentEntryId, iSession, clientMtm, aOnlyCreatedWithCreator ) );
-    
-    // reset must be done here, because iEntryIds is stored in destructor
-    iEntryIds.Reset();
-    
-    // all entries deleted, remove the Messages related registry
-    iEngine->RemoveStoreL( KUidDictionaryUidMessages );
-
-    CleanupStack::PopAndDestroy( clientMtm );
-    CleanupStack::PopAndDestroy( registry );    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::DeleteAllFromFolderL( const TMsvId aContext, 
-                                             CMsvSession* aSession,
-                                             CSmsClientMtm* aClientMtm,
-                                             TBool aOnlyCreatedWithCreator )
-    {
-    LOGSTRING("Creator: CCreatorMessages::DeleteAllFromFolderL");
-    
-    TMsvSelectionOrdering sort;
-    sort.SetShowInvisibleEntries( ETrue );
-
-    CMsvEntry* inboxContext = CMsvEntry::NewL( *aSession, aContext, sort );
-    CleanupStack::PushL( inboxContext );
-
-    CMsvEntrySelection* entries = inboxContext->ChildrenL();
-    CleanupStack::PushL( entries );
-
-    TInt msgCount = entries->Count();
-    for ( TInt i = 0; i < entries->Count(); i++)
-        {
-        TMsvId entryID = entries->At(i);
-        aClientMtm->SwitchCurrentEntryL( entryID );
-
-        if ( !aOnlyCreatedWithCreator || iEntryIds.Find( entryID ) != KErrNotFound )
-            {
-            CMsvEntry* entry = aSession->GetEntryL( (*entries)[i] );
-            CleanupStack::PushL( entry );
-
-            entry->DeleteL( entries->At(i) );
-            CleanupStack::PopAndDestroy( entry );            
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( entries );
-    CleanupStack::PopAndDestroy( inboxContext );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorMessages::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorMessages::DeleteAllCreatedByCreatorL");
-    
-    iEntryIds.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidMessages );
-    
-    // delete them
-    DeleteAllMessagesL( ETrue );
-    }
-
-CRecipientInfo::CRecipientInfo() 
-    {
-    
-    }
-
-CRecipientInfo::~CRecipientInfo()
-    {
-    delete iPhoneNumber;
-    delete iEmailAddress;
-    }
-
-void CRecipientInfo::SetPhoneNumber(HBufC* aPhone)
-    {
-    delete iPhoneNumber;    
-    iPhoneNumber = aPhone;    
-    }
-
-void CRecipientInfo::SetEmailAddress(HBufC* aEmail)
-    {
-    delete iEmailAddress;    
-    iEmailAddress = aEmail;    
-    }
-
-const HBufC* CRecipientInfo::PhoneNumber() const
-    {
-    return iPhoneNumber;
-    }
-
-const HBufC* CRecipientInfo::EmailAddress() const
-    {
-    return iEmailAddress;
-    }
--- a/creator/src/creator_messageelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,474 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_messageelement.h"
-#include "creator_traces.h"
-#include "creator_message.h"
-
-using namespace creatormsg;
-
-/*
- * 
- */
-CCreatorMessageElement* CCreatorMessageElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorMessageElement* self = new (ELeave) CCreatorMessageElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorMessageElement::CCreatorMessageElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-/*
- * Sets message type
- */
-void CCreatorMessageElement::SetMessageTypeL(CMessagesParameters& aParameters, const TDesC& aMsgTypeStr ) const
-    {
-    if( CompareIgnoreCase(aMsgTypeStr, KSms) == 0 )
-        {
-        aParameters.iMessageType = ESMS;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KMms) == 0 )
-        {
-        aParameters.iMessageType = EMMS;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KAms) == 0 )
-        {
-        aParameters.iMessageType = EAMS;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KEmail) == 0 )
-        {
-        aParameters.iMessageType = EEmail;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KSmart) == 0 )
-        {
-        aParameters.iMessageType = ESmartMessage;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KIr) == 0 )
-        {
-        aParameters.iMessageType = EIrMessage;
-        }
-    else if( CompareIgnoreCase(aMsgTypeStr, KBt) == 0 )
-        {
-        aParameters.iMessageType = EBTMessage;
-        }
-    else
-        {
-        LOGSTRING2("ERROR in CCreatorMessageElement::SetMessageTypeL: Unknown message type: %S", &aMsgTypeStr);
-        User::Leave(KErrGeneral);
-        }
-    }
-/*
- * Returns maximum length of the body text, when randomlength=max is used.
- */
-TInt CCreatorMessageElement::GetMaxBodyLength( const TDesC& aMsgType ) const
-    {
-    TInt len = 0;
-    if( CompareIgnoreCase(aMsgType, KSms) == 0 )
-        {
-        len = 160;
-        }
-    else if( CompareIgnoreCase(aMsgType, KMms) == 0 )
-        {
-        len = 160;
-        }    
-    else if( CompareIgnoreCase(aMsgType, KEmail) == 0 )
-        {
-        len = 1024;
-        }
-    else
-        {
-        len = KUndef;
-        }
-    return len;
-    }
-/*
- * Returns random body text length
- */
-TInt CCreatorMessageElement::GetRandomBodyLengthL(const TDesC& aRandomLenStr, const TDesC& aMsgType ) const
-    {
-    TInt len = 0;
-    if( aRandomLenStr == KMax )
-        {
-        len = GetMaxBodyLength(aMsgType);
-        }
-    else if( aRandomLenStr == KDefault )
-        {
-        len = KUndef;        
-        }
-    else
-        {
-        len = ConvertStrToIntL(aRandomLenStr);
-        }
-    return len;
-    }
-
-/*
- * Creates random message address (To/From)
- * Returns phone number for SMS, MMS, AMS and Smart messages.
- * Email address for others
- */
-HBufC* CCreatorMessageElement::CreateMessageAddressLC(const TDesC& msgType)
-    {
-    HBufC* toAddr;
-    if( CompareIgnoreCase(msgType, KSms) == 0 || 
-        CompareIgnoreCase(msgType, KMms) == 0 || 
-        CompareIgnoreCase(msgType, KAms) == 0 || 
-        CompareIgnoreCase(msgType, KSmart) == 0)
-        {
-        TPtrC temp = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
-        toAddr = HBufC::NewL(temp.Length());
-        CleanupStack::PushL(toAddr);
-        toAddr->Des().Copy(temp);
-        }
-    else
-        {
-        toAddr = iEngine->CreateEmailAddressLC();
-        }
-    return toAddr;
-    }
-
-/*
- *
- */
-void CCreatorMessageElement::ExecuteCommandL()
-    {
-    LOGSTRING("Creator: CCreatorMessageElement::ExecuteCommandL");
-    
-    // Find out the message type:
-    const CCreatorScriptAttribute* msgTypeAttr = this->FindAttributeByName(KType);
-    TPtrC msgType;
-    if( msgTypeAttr )
-        {
-        msgType.Set(msgTypeAttr->Value());
-        }
-    else
-        {
-        LOGSTRING("ERROR in CCreatorMessageElement::ExecuteCommandL: Type attribute is missing.");
-        User::Leave(KErrGeneral); // type is required attribute
-        }
-    
-    // Find out the amount of calendar entries:
-    const CCreatorScriptAttribute* msgAmountAttr = this->FindAttributeByName(KAmount);
-    TInt msgAmount = 1;    
-    if( msgAmountAttr )
-        {
-        msgAmount = ConvertStrToIntL(msgAmountAttr->Value());
-        }    
-    
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
-        {
-        // Get sub-elements (i.e the message field elements)
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();
-        
-        // Create message entries, the amount of entries is defined by msgAmount:
-        for( TInt cI = 0; cI < msgAmount; ++cI )
-            {
-            CMessagesParameters* param = new (ELeave) CMessagesParameters;
-            CleanupStack::PushL(param);
-            
-            // Message type:
-            if( msgTypeAttr )
-                {
-                SetMessageTypeL(*param, msgTypeAttr->Value());
-                }           
-            
-            // Loop all the message field elements:
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const RPointerArray<CCreatorScriptElement>& contactReferences = field->SubElements();
-                const CCreatorScriptAttribute* randomAttr = field->FindAttributeByName(KRandomLength);
-                const CCreatorScriptAttribute* amountAttr = field->FindAttributeByName(KAmount);
-                const CCreatorScriptAttribute* increaseAttr = field->FindAttributeByName(KIncrease);
-                TBool increase( EFalse );
-                if ( increaseAttr )
-                    {
-                    increase = ConvertStrToBooleanL( increaseAttr->Value() );
-                    }
-                TInt fieldAmount = 1;
-                if( amountAttr )
-                    {
-                    fieldAmount = ConvertStrToIntL(amountAttr->Value());
-                    }               
-                
-                if( elemName == KTo )
-                    {
-                    // Recipient ('to'-field)
-                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
-                        {
-                        if( (randomAttr || elemContent.Length() == 0 ) && contactReferences.Count() == 0 )
-                            {                        
-                            // Random content
-                            HBufC* toAddr = CreateMessageAddressLC(msgType);
-                            if( toAddr )
-                                {
-                                param->iRecipientAddressArray.AppendL(toAddr);
-                                CleanupStack::Pop(); // toAddr
-                                }
-                            }
-                        else
-                            {                            
-                            if( elemContent.Length() > 0 && contactReferences.Count() == 0)
-                                {
-                                // Explicit recipient given
-                                HBufC* recipient = HBufC::NewL( elemContent.Length() + 3 );
-                                CleanupStack::PushL(recipient);
-                                if ( increase )
-                                    {
-                                    IncreasePhoneNumL( elemContent, cI, recipient );
-                                    }
-                                else
-                                    {
-                                    recipient->Des().Copy(elemContent);
-                                    }
-                                param->iRecipientAddressArray.AppendL(recipient);
-                                CleanupStack::Pop(); // recipient
-                                }
-                            else
-                                {
-                                // Recipients specified with contact-set-references (if any)
-                                for( TInt csI = 0; csI < contactReferences.Count(); ++csI )
-                                    {                            
-                                    CCreatorScriptElement* contactSetRef = contactReferences[csI];
-                                    AppendContactSetReferenceL(*contactSetRef, param->iRecipientLinkIds);                                
-                                    }
-                                }
-                            }
-                        }
-                    }
-                else if( elemName == KFrom )
-                    {
-                    // Sender ('from'-field)
-                    // Amount attribute for sender is ignored, because there can be only one sender                 
-                    delete param->iSenderAddress;
-                    param->iSenderAddress = 0;
-                    if( (randomAttr || elemContent.Length() == 0 ) && contactReferences.Count() == 0 )
-                        {
-                        // Get random address
-                        param->iSenderAddress = CreateMessageAddressLC(msgType);
-                        CleanupStack::Pop(); // param->iSenderAddress
-                        }
-                    else
-                        {                        
-                        if( elemContent.Length() > 0 && contactReferences.Count() == 0)
-                            {
-                            // Explicit sender address given
-                            param->iSenderAddress = HBufC::NewL(elemContent.Length());
-                            if ( increase )
-                                {
-                                IncreasePhoneNumL( elemContent, cI, param->iSenderAddress );
-                                }
-                            else
-                                {
-                                param->iSenderAddress->Des().Copy(elemContent);
-                                }
-                            }
-                        else
-                            {
-                            // Senders specified with contact-set-references (if any)
-                            for( TInt csI = 0; csI < contactReferences.Count(); ++csI )
-                                {                            
-                                CCreatorScriptElement* contactSetRef = contactReferences[csI];
-                                AppendContactSetReferenceL(*contactSetRef, param->iSenderLinkIds);                                
-                                }
-                            }                           
-                        }
-                    }
-                else if( elemName == KFolder )              
-                    {
-                    // Folder type
-                    if( CompareIgnoreCase(elemContent, KSent) == 0 )
-                        {
-                        param->iFolderType = ESent;
-                        }
-                    else if( CompareIgnoreCase(elemContent, KInbox) == 0 )
-                        {
-                        param->iFolderType = EInbox;
-                        }
-                    else if( CompareIgnoreCase(elemContent, KOutbox) == 0 )
-                        {
-                        param->iFolderType = EOutbox;
-                        }
-                    else if( CompareIgnoreCase(elemContent, KDraft) == 0 )
-                        {
-                        param->iFolderType = EDrafts;
-                        }                        
-                    }
-                else if( elemName == KSubject )
-                    {
-                    // Message subject
-                    delete param->iMessageSubject;
-                    param->iMessageSubject = 0;
-                    
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        // Random data should be used
-                        TPtrC temp = iEngine->RandomString(CCreatorEngine::EMessageSubject);
-                        param->iMessageSubject = HBufC::NewL(temp.Length());
-                        param->iMessageSubject->Des().Copy(temp);
-                        }
-                    else
-                        {                        
-                        param->iMessageSubject = HBufC::NewL(elemContent.Length());
-                        param->iMessageSubject->Des().Copy(elemContent);
-                        }
-                    }
-                else if( elemName == KText )
-                    {
-                    // Body text
-                    delete param->iMessageBodyText;
-                    param->iMessageBodyText = 0;
-                    
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        // Put random text:
-                        if( randomAttr && randomAttr->Value() != KDefault )
-                            {
-                            // Get the random length
-                            TInt len = GetRandomBodyLengthL(randomAttr->Value(), msgTypeAttr->Value());
-                            if( len != KUndef )
-                                {
-                                param->iMessageBodyText = iEngine->CreateRandomStringLC(len);
-                                CleanupStack::Pop(); // param->iMessageBodyText
-                                }
-                            }
-                        else
-                            {
-                            // Use default random data
-                            TPtrC temp = iEngine->RandomString(CCreatorEngine::EMessageText);
-                            param->iMessageBodyText = HBufC::NewL(temp.Length());
-                            param->iMessageBodyText->Des().Copy(temp);
-                            }
-                        }
-                    else
-                        {
-                        param->iMessageBodyText = HBufC::NewL(elemContent.Length());
-                        param->iMessageBodyText->Des().Copy(elemContent);
-                        }
-                    }
-                else if( elemName == KAttachmentId )
-                    {
-                    // Attachment file id
-                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
-                        {                        
-                        if( randomAttr  || elemContent.Length() == 0)
-                            {
-                            //When type is AMS, attachement will be audio
-                            if(param->iMessageType == EAMS)
-                                {
-                                param->iAttachments->AppendL(CCreatorEngine::EMP3_250kB);
-                                }
-                            //Otherwise attachement can be any file
-                            else
-                                {
-                                //EJPEG_25kB is first (0) in the enum and LAST_FILE_ID is last in the enum, so real last item id is one before LAST_FILE_ID
-                                param->iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID-1) );                                
-                                }
-                            }
-                        else
-                            {
-                            //When user has been set attechment by it self, we trust user selection (not validating value, e.g. if message is SMS and there is attachement)
-                            TInt id = iEngine->GetAttachmentIdL(elemContent);
-                            if( id != KUndef )
-                                {
-                                param->iAttachments->AppendL( id );
-                                }
-                            }
-                        }
-                    }
-                // Attachment file path handling 
-                //E.g. C:\data\others\DOC-20kB.doc
-                else if( elemName == KAttachmentPath )
-                    {
-                    // Attachment file id
-                    for( TInt amountIndex = 0; amountIndex < fieldAmount; ++amountIndex )
-                        {
-                        //Path is random, getting one of the files (not even using path attribute, but id with random)
-                        if( randomAttr  || elemContent.Length() == 0)
-                            {
-                            //EJPEG_25kB is first (0) in the enum and LAST_FILE_ID is last in the enum, so real last item id is one before LAST_FILE_ID
-                            param->iAttachments->AppendL( iEngine->RandomNumber(CCreatorEngine::EJPEG_25kB, CCreatorEngine::LAST_FILE_ID -1) );
-                            }
-                        //Otherwise adding attachement path as it is to paths.
-                        else
-                            {
-                            //Adding Attachement file path
-                            HBufC* elemData = elemContent.AllocLC();
-                            param->iAttachmentPaths.AppendL( elemData );     
-                            CleanupStack::Pop(elemData);
-                            }
-                        }
-                    }
-                else if ( elemName == KStatus )
-                    {
-                    if( CompareIgnoreCase( elemContent, KNew ) == 0 )
-                        {
-                        param->iCreateAsUnread = ETrue;
-                        }
-                    else if( CompareIgnoreCase( elemContent, KRead ) == 0 )
-                        {
-                        param->iCreateAsUnread = EFalse;
-                        }
-                    }
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMessagingEntryMessagesViaScript, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	for( TInt i = 0; i < msgAmount; ++i )
-    		{
-    		TInt randMsg = 0;
-    		if( msgType == KSms )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntrySMSInbox, ECmdCreateRandomEntrySMSSent);
-    		else if( msgType == KMms )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryMMSInbox, ECmdCreateRandomEntryMMSSent);
-    		else if( msgType == KAms )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryAMSInbox, ECmdCreateRandomEntryAMSSent);
-    		else if( msgType == KEmail )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryEmailInbox, ECmdCreateRandomEntryEmailSent);
-    		else if( msgType == KSmart )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryBIOInbox, ECmdCreateRandomEntryBIOSent);
-    		else if( msgType == KBt )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryBTInbox, ECmdCreateRandomEntryBTSent);
-    		else if( msgType == KIr )
-    			randMsg = iEngine->RandomNumber(ECmdCreateRandomEntryIRInbox, ECmdCreateRandomEntryIRSent);
-    			
-    		if( randMsg > 0 )
-    			{
-    			iEngine->AppendToCommandArrayL(randMsg, 0, 1);
-    			}
-    		}
-    	}
-    }
-
-// End of file
--- a/creator/src/creator_model.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2576 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include <cntdb.h>//For Math
-
-#include "creator_model.h"
-#include "creator_traces.h"
-#include "creator_factory.h"
-#include "creator_scriptparser.h"
-#include "creator_appui.h"
-#include "creator_app.h" // KUidCreatorApp
-#include "creator_file.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
-  #include "creator_contactsetcache.h"
-#endif
-
-#include <apparc.h>
-#include <eikappui.h>
-#include <eikapp.h>
-#include <bitmaptransforms.h>
-
-_LIT(KTempPathDrive, "d");
-_LIT(KTempPath, ":\\Creator\\");
-_LIT(KSavingText, "Saving");
-_LIT(KDeletingText, "Deleting");
-const TInt KRegisterDrive = EDriveC;
-_LIT(KRegisterFileName, "creator_created_items.dat");
-
-
-// ---------------------------------------------------------------------------
-
-CCreatorEngine* CCreatorEngine::NewL(CCreatorAppUi* aAppUi)
-    {
-    LOGSTRING("Creator: CCreatorEngine::NewL");
-    CCreatorEngine* self = new(ELeave) CCreatorEngine;
-    CleanupStack::PushL(self);
-    self->ConstructL(aAppUi);
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CCreatorEngine::CCreatorEngine() 
-: 
-CActive(0)
-{}
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::ConstructL(CCreatorAppUi* aAppUi)
-    {
-    LOGSTRING("Creator: CCreatorEngine::ConstructL");
-
-    iEnv = CEikonEnv::Static();
-    User::LeaveIfError(iTimer.CreateLocal());
-
-    iAppUi = aAppUi;
-
-    // these are needed by the random data generator
-    TTime now;
-    now.HomeTime();
-    iSeed=now.Int64();
-    
-    iTempPath = HBufC::NewL(KTempPathDrive().Length() + KTempPath().Length());
-    iTempPath->Des().Copy(KTempPathDrive);
-    iTempPath->Des().Append(KTempPath);
-
-    GetRandomDataFromFileL(KNullDesC);
-        
-    CActiveScheduler::Add(this);
-
-    }
-
-// ---------------------------------------------------------------------------
-
-CCreatorEngine::~CCreatorEngine()
-    {
-    LOGSTRING("Creator: CCreatorEngine::~CCreatorEngine");
-
-    Cancel();
-    
-    for( TInt i = 0; i < iStringArrays.Count(); ++i )
-        {
-        delete iStringArrays[i].iArrayPtr;
-        }
-    iStringArrays.Close();
-    iAllocatedFilePaths.ResetAndDestroy();
-    iAllocatedFilePaths.Close();
-    iTimer.Close();
-    
-    delete iPictureFileArray;
-    delete iSoundFileArray;
-    delete iTempPath;
-    delete iFrameImageData;
-    delete iEncoder;
-    delete iScaler;
-    delete iDecoder;
-    delete iScaledBitmap;
-    delete iBitmap;
-    delete iBitmapData;
-    }
-
-void CCreatorEngine::CopyFileL(const TFileName& aSourceFile, const TFileName& aTargetFile, TBool aOverwrite )
-	{
-	if( !aOverwrite && ConeUtils::FileExists(aTargetFile))
-		{
-		// File already exists
-		return;
-		}
-	
-	// Make sure that the path exists. Creates the directory if it does not exist already:
-	ConeUtils::EnsurePathExistsL(aTargetFile);	
-	User::LeaveIfError(BaflUtils::CopyFile(CEikonEnv::Static()->FsSession(), aSourceFile, aTargetFile));
-	}
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::ExecuteFirstCommandL(const TDesC& aText)
-    {
-    LOGSTRING("Creator: CCreatorEngine::ExecuteFirstCommand");
-
-    // init the progress bar
-    iProgressDialog = new(ELeave)CAknProgressDialog((reinterpret_cast<CEikDialog**>(&iProgressDialog)), ETrue);
-    iProgressDialog->SetCallback(this);
-    iProgressDialog->PrepareLC(R_PROGRESS_NOTE);
-    iProgressDialog->SetCurrentLabelL( EAknCtNote, aText );
-    iProgressInfo = iProgressDialog->GetProgressInfoL();
-    iProgressInfo->SetFinalValue( CommandArrayCount() );
-    iProgressDialog->RunLD();
-    iProgressDialog->MakeVisible( ETrue );
-    
-    iFailedCommands = 0;
-
-    // starts executing commands
-    ExecuteCommand();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::ExecuteCommand()
-    {
-    LOGSTRING("Creator: CCreatorEngine::ExecuteCommand");
-
-    // make sure the engine isn't active, should never happen
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("IsActive"), 500));
-
-    // execute a command after a very short delay (75ms)
-    iTimer.After(iStatus, 75);
-    SetActive();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::RunL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::RunL");
-    LOGSTRING2("Creator: CCreatorEngine::RunL iCommandId=%d", iCommandArray->At(iCurrentEntry).iCommandId);
-    
-    if ( iUserCancelled ) return;
-    
-    if (!iCommandArray->At(iCurrentEntry).iParameters)
-        {
-        LOGSTRING("Creator: CCreatorEngine::RunL - iParameters==NULL !");
-        }
-
-    // launch a command
-
-    TCreatorIds cmd = (TCreatorIds)iCommandArray->At(iCurrentEntry).iCommandId; 
-    switch( cmd )
-        {
-	    case ECmdCreateBrowserBookmarkEntries: { iBrowser->CreateBookmarkEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    case ECmdCreateBrowserBookmarkFolderEntries: { iBrowser->CreateBookmarkFolderEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    case ECmdCreateBrowserSavedPageEntries: { iBrowser->CreateSavedDeckEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    case ECmdCreateBrowserSavedPageFolderEntries: { iBrowser->CreateSavedDeckFolderEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    
-        case ECmdCreateCalendarEntryAppointments: { iCalendar->CreateAppointmentEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-	    case ECmdCreateCalendarEntryEvents: { iCalendar->CreateEventEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-	    case ECmdCreateCalendarEntryAnniversaries: { iCalendar->CreateAnniversaryEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-	    case ECmdCreateCalendarEntryToDos: { iCalendar->CreateTodoEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-        case ECmdCreateCalendarEntryReminders: { iCalendar->CreateReminderEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-
-	    
-	    case ECmdCreatePhoneBookEntryContacts: { iPhonebook->CreateContactEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-	    case ECmdCreatePhoneBookEntryGroups: { iPhonebook->CreateGroupEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-	    case ECmdCreatePhoneBookEntrySubscribedContacts: { iPhonebook->CreateSubscribedContactEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-	    case ECmdCreateMiscEntryNotes: { iNotepad->CreateNoteEntryL(reinterpret_cast<CNotepadParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-#endif
-	    case ECmdCreateLogEntryMissedCalls: { iLogs->CreateMissedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    case ECmdCreateLogEntryReceivedCalls: { iLogs->CreateReceivedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-	    case ECmdCreateLogEntryDialledNumbers: { iLogs->CreateDialledNumberEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-
-        case ECmdCreateMiscEntryAccessPoints: { iAccessPoints->CreateConnectionSettingsEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-        case ECmdDeleteIAPs: { iAccessPoints->DeleteAllL(); } break;
-        case ECmdDeleteCreatorIAPs: { iAccessPoints->DeleteAllCreatedByCreatorL(); } break;
-
-        case ECmdCreateMiscEntryLandmarks: { iLandmarks->CreateLandmarkEntryL(reinterpret_cast<CLandmarkParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-        
-	    case ECmdCreateMessagingEntryMailboxes: { iMailboxes->CreateMailboxEntryL(reinterpret_cast<CMailboxesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-        #ifdef __PRESENCE
-  	     case ECmdCreateMiscEntryIMPSServers: { iIMPS->CreateIMPSServerEntryL(reinterpret_cast<CIMPSParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-        #endif
-#endif
-	    case ECmdCreateMessagingEntryMessages:  { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters), ETrue); } break;
-	    case ECmdCreateMessagingEntryMessagesViaScript:  { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-
-	    case ECmdCreateRandomEntrySMSInbox:
-	    case ECmdCreateRandomEntrySMSDrafts:
-	    case ECmdCreateRandomEntrySMSOutbox:
-	    case ECmdCreateRandomEntrySMSSent:
-	    case ECmdCreateRandomEntryMMSInbox:
-	    case ECmdCreateRandomEntryMMSDrafts:
-	    case ECmdCreateRandomEntryMMSOutbox:
-	    case ECmdCreateRandomEntryMMSSent:
-	    case ECmdCreateRandomEntryAMSInbox:
-	    case ECmdCreateRandomEntryAMSDrafts:
-	    case ECmdCreateRandomEntryAMSOutbox:
-	    case ECmdCreateRandomEntryAMSSent:
-	    case ECmdCreateRandomEntryEmailInbox:
-	    case ECmdCreateRandomEntryEmailDrafts:
-	    case ECmdCreateRandomEntryEmailOutbox:
-	    case ECmdCreateRandomEntryEmailSent:
-	    case ECmdCreateRandomEntryBIOInbox:
-	    case ECmdCreateRandomEntryBIODrafts:
-	    case ECmdCreateRandomEntryBIOOutbox:
-	    case ECmdCreateRandomEntryBIOSent:
-	    case ECmdCreateRandomEntryIRInbox:
-	    case ECmdCreateRandomEntryIRDrafts:
-	    case ECmdCreateRandomEntryIROutbox:
-	    case ECmdCreateRandomEntryIRSent:
-	    case ECmdCreateRandomEntryBTInbox:
-	    case ECmdCreateRandomEntryBTDrafts:
-	    case ECmdCreateRandomEntryBTOutbox:
-	    case ECmdCreateRandomEntryBTSent:
-	            { iMessages->CreateRandomMessageEntryL(iCommandArray->At(iCurrentEntry).iCommandId); } break;
-
-        case ECmdCreateFileEntryEmptyFolder:
-        case ECmdCreateFileEntry3GPP_70kB:
-        case ECmdCreateFileEntryAAC_100kB:
-        case ECmdCreateFileEntryAMR_20kB:
-        case ECmdCreateFileEntryBMP_25kB:
-        case ECmdCreateFileEntryDeck_1kB:
-        case ECmdCreateFileEntryDOC_20kB:
-        case ECmdCreateFileEntryGIF_2kB:
-        case ECmdCreateFileEntryHTML_20kB:
-        case ECmdCreateFileEntryJAD_1kB:
-        case ECmdCreateFileEntryJAR_10kB:
-        case ECmdCreateFileEntryJP2_65kB:
-        case ECmdCreateFileEntryJPEG_200kB:
-        case ECmdCreateFileEntryJPEG_25kB:
-        case ECmdCreateFileEntryJPEG_500kB:
-        case ECmdCreateFileEntryMIDI_10kB:
-        case ECmdCreateFileEntryMP3_250kB:
-        case ECmdCreateFileEntryMP4_200kB:
-        case ECmdCreateFileEntryMXMF_40kB:
-        case ECmdCreateFileEntryPNG_15kB:
-        case ECmdCreateFileEntryPPT_40kB:
-        case ECmdCreateFileEntryRAM_1kB:
-        case ECmdCreateFileEntryRM_95kB:
-        case ECmdCreateFileEntryRNG_1kB:
-        case ECmdCreateFileEntrySVG_15kB:
-        case ECmdCreateFileEntrySWF_15kB:
-        case ECmdCreateFileEntryTIF_25kB:
-        case ECmdCreateFileEntryTXT_10kB:
-        case ECmdCreateFileEntryTXT_70kB:
-        case ECmdCreateFileEntryVCF_1kB:
-        case ECmdCreateFileEntryVCS_1kB:
-        case ECmdCreateFileEntryWAV_20kB:
-        case ECmdCreateFileEntryXLS_15kB:
-        case ECmdCreateFileEntrySISX_10kB:
-        case ECmdCreateFileEntryWMA_50kB:
-        case ECmdCreateFileEntryWMV_200kB:
-	            { iFiles->CreateFileEntryL( reinterpret_cast<CFilesParameters*>(iCommandArray->At(iCurrentEntry).iParameters), iCommandArray->At(iCurrentEntry).iCommandId ); } break;
-        case ECmdDeleteContacts:
-            {
-            iPhonebook->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteContactGroups:
-            {
-            iPhonebook->DeleteAllGroupsL();
-            break;            
-            }
-        case ECmdDeleteCreatorContacts:
-            {
-            iPhonebook->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteCreatorContactGroups:
-            {
-            iPhonebook->DeleteAllGroupsCreatedByCreatorL();
-            break;            
-            }
-        case ECmdDeleteCalendarEntries:
-            {
-            iCalendar->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteCreatorCalendarEntries:
-            {
-            iCalendar->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteLogs:
-            {
-            iLogs->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteCreatorLogs:
-            {
-            iLogs->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteMessages:
-            {
-            iMessages->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteCreatorMessages:
-            {
-            iMessages->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteLandmarks:
-            {
-            iLandmarks->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteCreatorLandmarks:
-            {
-            iLandmarks->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteMailboxes:
-            {
-            iMailboxes->DeleteAllL();
-            break;
-            }
-        case ECmdDeleteCreatorMailboxes:
-            {
-            iMailboxes->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteNotes:
-            {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-            iNotepad->DeleteAllL();
-#endif
-            break;
-            }
-        case ECmdDeleteIMPSs:
-            {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-#ifdef __PRESENCE
-            iIMPS->DeleteAllL();
-#endif
-#endif            
-            break;
-            }
-        case ECmdDeleteCreatorIMPSs:
-            {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-#ifdef __PRESENCE
-            iIMPS->DeleteAllCreatedByCreatorL();
-#endif
-#endif            
-            break;
-            }
-        case ECmdDeleteBrowserBookmarks:
-            {
-            iBrowser->DeleteAllBookmarksL();
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarks:
-            {
-            iBrowser->DeleteAllBookmarksCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteBrowserBookmarkFolders:
-            {
-            iBrowser->DeleteAllBookmarkFoldersL();
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-            {
-            iBrowser->DeleteAllBookmarkFoldersCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteBrowserSavedPages:
-            {
-            iBrowser->DeleteAllSavedPagesL();
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPages:
-            {
-            iBrowser->DeleteAllSavedPagesCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteBrowserSavedPageFolders:
-            {
-            iBrowser->DeleteAllSavedPageFoldersL();
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-            {
-            iBrowser->DeleteAllSavedPageFoldersCreatedByCreatorL();
-            break;
-            }
-        case ECmdDeleteCreatorFiles:
-            {
-            iFiles->DeleteAllCreatedByCreatorL();
-            break;
-            }
-        default:
-            User::Panic (_L("ExecuteOptionsMenuCommandL"), 205);
-            break;
-        }
-
-    TRAP_IGNORE( CheckForMoreCommandsL() );
-
-    }
-    
-CDesCArrayFlat* CCreatorEngine::PictureFilesL()
-    {
-    if( iPictureFileArray == 0 )
-        {
-        _LIT(KImageFile, "JPEG*.jpg");
-        _LIT(KImageFileDir, "C:\\Data\\");
-        _LIT(KImageFileDir2, "Z:\\Data\\");
-        iPictureFileArray = new (ELeave) CDesCArrayFlat(8);        
-        TInt err = CreatorFileUtils::FindFilesRecursiveL(iPictureFileArray, KImageFile, KImageFileDir);
-        if( iPictureFileArray->Count() == 0 )
-            {
-            err = CreatorFileUtils::FindFilesRecursiveL(iPictureFileArray, KImageFile, KImageFileDir2);
-            }
-        }
-    return iPictureFileArray;
-    }
-
-CDesCArrayFlat* CCreatorEngine::SoundFilesL()
-    {
-    if( iSoundFileArray == 0 )
-        {
-        _LIT(KSoundFile, "*.aac");
-        _LIT(KSoundFileDir, "Z:\\data\\Sounds\\");
-        iSoundFileArray = new (ELeave) CDesCArrayFlat(8);                  
-        TInt err = CreatorFileUtils::FindFilesRecursiveL(iSoundFileArray, KSoundFile, KSoundFileDir);
-        }
-    return iSoundFileArray;
-    }
-// ---------------------------------------------------------------------------
-
-TInt CCreatorEngine::RunError(TInt aError)
-    {
-    LOGSTRING2("Creator: CCreatorEngine::RunError %d", aError);
-    
-    iFailedCommands++;
-    
-    _LIT(KMessage, "Command error %d");
-    TBuf<128> noteMsg;
-    noteMsg.Format(KMessage, aError);
-    iEnv->InfoMsg(noteMsg);
-    
-    TRAP_IGNORE( CheckForMoreCommandsL() );
-    
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::CheckForMoreCommandsL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL");
-    if ( iUserCancelled ) return;
-    // update the progress bar
-    iProgressInfo->IncrementAndDraw(1);
-
-	// check if we have more commands to be executed
-	if (iCurrentEntry >= CommandArrayCount() - 1)
-		{
-        LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL all done");
-
-        // all done, free resources and show a note
-        ShutDownEnginesL();
-
-		iProgressDialog->ProcessFinishedL();
-		
-		if (iFailedCommands == 0)
-		    {
-		    _LIT(KMessage, "Done");
-
-    		CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-    		note->ExecuteLD(KMessage);
-		    }
-		else
-		    {
-		    _LIT(KMessage, "Done, %d commands failed");
-            TBuf<128> noteMsg;
-            noteMsg.Format(KMessage, iFailedCommands);
-            
-    		CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-    		note->ExecuteLD(noteMsg);
-		    }
-		
-	    iAppUi->RunScriptDone();
-
-		}
-	else
-		{
-		// maintain requests
-		iCurrentEntry++;
-
-        LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
-
-        ExecuteCommand();
-		}
-    }
-
-// ---------------------------------------------------------------------------
-
-// This callback function is called when cancel button of the progress bar was pressed
-void CCreatorEngine::DialogDismissedL(TInt aButtonId)
-    {
-    LOGSTRING("Creator: CCreatorEngine::DialogDismissedL");
-
-    // check if cancel button was pressed
-    if (aButtonId == EAknSoftkeyCancel)
-        {
-        iUserCancelled = ETrue;
-        // cancel the active object, command executer 
-        Cancel();
-
-        // delete parameters from the command array, otherwise there might be memory leaks
-        for (TInt i=iCurrentEntry; i<CommandArrayCount(); i++)
-            {
-            if ( iCommandArray->At(i).iParameters )
-                delete iCommandArray->At(i).iParameters;
-                iCommandArray->At(i).iParameters = NULL;
-            }
-        
-        if ( iPhonebook && iPhonebook->IsActive() )
-            {
-            // virtual phonebook is known to require asynchronous
-            // cancelling of operation
-            iPhonebook->CancelOperation();
-            }
-        else if ( iDecoder  )
-            {
-            iDecoder->Cancel();
-            // CancelComplete() will be called from GenerateSourceImageFileL
-            }
-        else if ( iScaler )
-            {
-            iScaler->Cancel();
-            // CancelComplete() will be called from GenerateSourceImageFileL
-            }
-        else if ( iEncoder  )
-            {
-            iEncoder->Cancel();
-            // CancelComplete() will be called from GenerateSourceImageFileL
-            }
-        else
-            {
-            // free resources and show a note
-            ShutDownEnginesL();
-
-            CAknInformationNote* note = new (ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Cancelled"));
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::StartEnginesL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::StartEnginesL");
-    
-    // reset user cancel flag
-    iUserCancelled = EFalse;
-    
-    // start from the beginning
-    iCurrentEntry = 0;
-
-    // we'll retrieve a correct number for this later
-    iEntriesToBeCreated = 0;
-
-    // init the command array
-    __ASSERT_ALWAYS(!iCommandArray, User::Panic(_L("iCommandArray"), 701));
-    iCommandArray = new(ELeave) CCommandArray(10000);
-
-    // init all modules here
-    TInt err(KErrNone);
-    TRAP(err, iBrowser = CCreatorBrowser::NewL(this));
-    TRAP(err, iCalendar = CCreatorInterimCalendar::NewL(this));
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    TRAP(err, iPhonebook = (CCreatorPhonebookBase*)TCreatorFactory::CreatePhoneBookL(this));
-    TRAP(err, iNotepad = CCreatorNotepad::NewL(this));
-#endif
-    TRAP(err, iLogs = CCreatorLogs::NewL(this));
-    TRAP(err, iAccessPoints = (CCreatorConnectionSettingsBase*)TCreatorFactory::CreateConnectionSettingsL(this));
-    TRAP(err, iMailboxes = CCreatorMailboxes::NewL(this));
-    TRAP(err, iFiles = CCreatorFiles::NewL(this));
-    TRAP(err, iMessages = CCreatorMessages::NewL(this));
-    TRAP(err, iLandmarks = CCreatorLandmarks::NewL(this));
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    #ifdef __PRESENCE
-      TRAP(err, iIMPS = CCreatorIMPS::NewL(this));
-    #endif 
-#endif    
-      
-      
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)     
-    // Initialize contact-set cache:
-   ContactLinkCache::InitializeL();
-#endif
-    // ...
-    // ...
-    // ...
-
-    }
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::ShutDownEnginesL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::ShutDownEnginesL");
-
-        
-    // delete all modules here and free resources which aren't anymore needed
-
-
-    #ifdef __PRESENCE
-     delete iIMPS;
-     iIMPS = NULL;
-    #endif
-
-    delete iMessages;
-    iMessages = NULL;
-    delete iFiles;
-    iFiles = NULL;
-    delete iMailboxes;
-    iMailboxes = NULL;
-    delete iAccessPoints;
-    iAccessPoints = NULL;
-    delete iLogs;
-    iLogs = NULL;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    delete iNotepad;
-    iNotepad = NULL;
-
-    delete iPhonebook;
-    iPhonebook = NULL;
-#endif    
-    delete iCalendar;
-    iCalendar = NULL;
-    delete iBrowser;
-    iBrowser = NULL;
-    delete iLandmarks;
-    iLandmarks = NULL;
-    
-    // ...
-    // ...
-    // ...
-
-
-    // now delete the command array
-    delete iCommandArray;
-    iCommandArray = NULL;
-    
-    
-    iParameterArray.ResetAndDestroy();
-    iParameterArray.Close();
-    
-    
-	// clear temp drive
-	CFileMan* fileMan = CFileMan::NewL( iEnv->FsSession() );
-	CleanupStack::PushL( fileMan );
-	fileMan->RmDir( iTempPath->Des() );
-	CleanupStack::PopAndDestroy(); //fileMan
-	
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)	
-	// Cleanup the contact-set cache:
-	ContactLinkCache::DestroyL();
-#endif    
-	
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::DoCancel()
-    {
-    LOGSTRING("Creator: CCreatorEngine::DoCancel");
-
-    iTimer.Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::RunScriptL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::RunScriptL");
-
-    // startup modules (also inits the command array):
-    StartEnginesL();
-
-    // use the command parser module to init the command array from a script file
-    CCommandParser* commandParser = CCommandParser::NewLC(this);
-    RFile scriptFile;
-    TBool ret = commandParser->OpenScriptL(scriptFile);
-    CleanupClosePushL(scriptFile);
-    if( ret )
-        {
-        // wait dialog
-        CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-        waitDialog->SetSoftkeys( R_AVKON_SOFTKEYS_CANCEL );
-        TInt dialogId = waitDialog->ShowNoteL( EAknGlobalWaitNote, _L("Parsing") );
-        
-        TInt parseErr( KErrNone );
-        TRAPD( parserErr,
-               CCreatorScriptParser* scriptParser = CCreatorScriptParser::NewLC(this);
-               scriptParser->ParseL(scriptFile);
-               parseErr = scriptParser->GetError();
-               CleanupStack::PopAndDestroy( scriptParser );
-             );
-        waitDialog->CancelNoteL( dialogId );
-        CleanupStack::PopAndDestroy( waitDialog );
-        User::LeaveIfError( parserErr );
-        
-        if(parseErr != KErrNone)
-            {
-            // show error note
-            CAknErrorNote* note = new (ELeave) CAknErrorNote;
-            _LIT(KErrMsg, "Parser error: %d");
-            TBuf<32> msgBuf;
-            msgBuf.Format(KErrMsg, parseErr);
-            note->ExecuteLD(msgBuf);
-            CleanupStack::PopAndDestroy(); //commandParser   
-            ShutDownEnginesL();
-            return;
-            }         
-        }
-    CleanupStack::PopAndDestroy( &scriptFile );
-    CleanupStack::PopAndDestroy( commandParser );   
-
-    // start executing commands if commands in the command array
-    if (CommandArrayCount() > 0)
-        {
-        ExecuteFirstCommandL( KSavingText );
-        }
-    else
-        {
-        ShutDownEnginesL();
-        }
-
-    }
-/*
-void CCreatorEngine::RunScriptL()
-    {
-    LOGSTRING("Creator: CCreatorEngine::RunScriptL");
-
-    // startup modules (also inits the command array):
-    StartEnginesL();
-
-    // use the command parser module to init the command array from a script file
-    CCommandParser* commandParser = CCommandParser::NewLC(this);
-    commandParser->OpenScriptL();
-
-    CleanupStack::PopAndDestroy(); //commandExecuter
-
-    // start executing commands if commands in the command array
-    if (CommandArrayCount() > 0)
-        {
-        ExecuteFirstCommandL(KSavingText);
-        }
-    else
-        {
-        ShutDownEnginesL();
-        }
-
-    }
-
-*/
-
-// ---------------------------------------------------------------------------
-
-TInt CCreatorEngine::RunScriptL(const TDesC& aScriptFile)
-    {
-    LOGSTRING("Creator: CCreatorEngine::RunScriptL");
-
-    // startup modules (also inits the command array):
-    StartEnginesL();
-
-    RFile scriptFile;
-    if (scriptFile.Open(CEikonEnv::Static()->FsSession(), aScriptFile, EFileRead) != KErrNone)
-    	{
-    	ShutDownEnginesL();
-    	return KErrNotFound; // file error
-    	}
-    
-    CleanupClosePushL(scriptFile);
-    CCreatorScriptParser* scriptParser = CCreatorScriptParser::NewLC(this);
-    scriptParser->ParseL(scriptFile);
-    TInt err = scriptParser->GetError();
-    CleanupStack::PopAndDestroy(); //scriptParser
-    CleanupStack::Pop(); // scriptFile
-    scriptFile.Close();
-        
-    if (err != KErrNone)
-        {
-        ShutDownEnginesL();
-        return KErrCorrupt; // parser error
-        }         
-
-    // start executing commands if commands in the command array
-    if (CommandArrayCount() > 0)
-        {
-        ExecuteFirstCommandL( KSavingText );
-        return KErrNone; // executing commands is started
-        }
-    else
-        {
-        ShutDownEnginesL();
-        return KErrCompletion; // nothing to do
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::ExecuteOptionsMenuCommandL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorEngine::ExecuteOptionsMenuCommandL");
-
-    // startup modules (also inits the command array):
-    StartEnginesL();
-
-    // set the home module
-    switch(aCommand)
-        {
-	    case ECmdCreateBrowserBookmarkEntries:
-	    case ECmdCreateBrowserBookmarkFolderEntries:
-	    case ECmdCreateBrowserSavedPageEntries:
-	    case ECmdCreateBrowserSavedPageFolderEntries:
-	    case ECmdDeleteBrowserBookmarks:
-	    case ECmdDeleteBrowserBookmarkFolders:
-	    case ECmdDeleteBrowserSavedPages:
-	    case ECmdDeleteBrowserSavedPageFolders:
-        case ECmdDeleteCreatorBrowserBookmarks:
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-        case ECmdDeleteCreatorBrowserSavedPages:
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-            {
-            iUsedOptionsMenuModule = iBrowser;
-            }
-            break;
-	    
-        case ECmdCreateCalendarEntryAppointments:
-	    case ECmdCreateCalendarEntryEvents:
-	    case ECmdCreateCalendarEntryAnniversaries:
-	    case ECmdCreateCalendarEntryToDos:
-	    case ECmdCreateCalendarEntryReminders:
-	    case ECmdDeleteCalendarEntries:
-	    case ECmdDeleteCreatorCalendarEntries:
-            {
-            iUsedOptionsMenuModule = iCalendar;
-            }
-            break;
-
-	    case ECmdCreatePhoneBookEntryContacts:
-	    case ECmdCreatePhoneBookEntryGroups:
-	    case ECmdCreatePhoneBookEntrySubscribedContacts:
-	    case ECmdDeleteContacts:
-	    case ECmdDeleteCreatorContacts:
-        case ECmdDeleteContactGroups:
-        case ECmdDeleteCreatorContactGroups:
-            {
-            iUsedOptionsMenuModule = iPhonebook;
-            }
-            break;
-
-	    case ECmdCreateMiscEntryNotes:
-	    case ECmdDeleteNotes:
-            {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-            iUsedOptionsMenuModule = iNotepad;
-#endif
-            }
-            break;
-
-	    case ECmdCreateLogEntryMissedCalls:
-	    case ECmdCreateLogEntryReceivedCalls:
-	    case ECmdCreateLogEntryDialledNumbers:
-	    case ECmdDeleteLogs:
-	    case ECmdDeleteCreatorLogs:
-            {
-            iUsedOptionsMenuModule = iLogs;
-            }
-            break;
-
-	    case ECmdCreateMiscEntryAccessPoints:
-	    case ECmdDeleteIAPs:
-	    case ECmdDeleteCreatorIAPs:
-            {
-            iUsedOptionsMenuModule = iAccessPoints;
-            }
-            break;
-
-	    case ECmdCreateMessagingEntryMailboxes:
-	    case ECmdDeleteMailboxes:
-	    case ECmdDeleteCreatorMailboxes:
-            {
-            iUsedOptionsMenuModule = iMailboxes;
-            }
-            break;
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-        #ifdef __PRESENCE
-	      case ECmdCreateMiscEntryIMPSServers:
-	      case ECmdDeleteIMPSs:
-	      case ECmdDeleteCreatorIMPSs:
-            {
-            iUsedOptionsMenuModule = iIMPS;
-            }
-            break;
-        #endif
-#endif
-	      case ECmdCreateFileEntryEmptyFolder:
-	      case ECmdCreateFileEntry3GPP_70kB:
-	      case ECmdCreateFileEntryAAC_100kB:
-	      case ECmdCreateFileEntryAMR_20kB:
-	      case ECmdCreateFileEntryBMP_25kB:
-	      case ECmdCreateFileEntryDeck_1kB:
-	      case ECmdCreateFileEntryDOC_20kB:
-	      case ECmdCreateFileEntryGIF_2kB:
-	      case ECmdCreateFileEntryHTML_20kB:
-	      case ECmdCreateFileEntryJAD_1kB:
-	      case ECmdCreateFileEntryJAR_10kB:
-	      case ECmdCreateFileEntryJP2_65kB:
-	      case ECmdCreateFileEntryJPEG_200kB:
-	      case ECmdCreateFileEntryJPEG_25kB:
-	      case ECmdCreateFileEntryJPEG_500kB:
-	      case ECmdCreateFileEntryMIDI_10kB:
-	      case ECmdCreateFileEntryMP3_250kB:
-	      case ECmdCreateFileEntryMP4_200kB:
-	      case ECmdCreateFileEntryMXMF_40kB:
-	      case ECmdCreateFileEntryPNG_15kB:
-	      case ECmdCreateFileEntryPPT_40kB:
-	      case ECmdCreateFileEntryRAM_1kB:
-	      case ECmdCreateFileEntryRM_95kB:
-	      case ECmdCreateFileEntryRNG_1kB:
-	      case ECmdCreateFileEntrySVG_15kB:
-	      case ECmdCreateFileEntrySWF_15kB:
-	      case ECmdCreateFileEntryTIF_25kB:
-	      case ECmdCreateFileEntryTXT_10kB:
-	      case ECmdCreateFileEntryTXT_70kB:
-	      case ECmdCreateFileEntryVCF_1kB:
-	      case ECmdCreateFileEntryVCS_1kB:
-	      case ECmdCreateFileEntryWAV_20kB:
-	      case ECmdCreateFileEntryXLS_15kB:
-	      case ECmdCreateFileEntrySISX_10kB:
-	      case ECmdCreateFileEntryWMA_50kB:
-	      case ECmdCreateFileEntryWMV_200kB:
-	      case ECmdDeleteCreatorFiles:
-
-            {
-            iUsedOptionsMenuModule = iFiles;
-            }
-            break;
-
-
-        case ECmdCreateMessagingEntryMessages:
-        case ECmdDeleteMessages:
-        case ECmdDeleteCreatorMessages:
-            {
-            iUsedOptionsMenuModule = iMessages;
-            }
-            break;
-            
-        case ECmdCreateMiscEntryLandmarks:
-        case ECmdDeleteLandmarks:
-        case ECmdDeleteCreatorLandmarks:
-            {
-            iUsedOptionsMenuModule = iLandmarks;
-            }
-            break;
-        case ECmdDeleteAllEntries:
-        case ECmdDeleteAllCreatorEntries:
-            {
-            break;
-            }
-        default:
-            User::Panic (_L("ExecuteOptionsMenuCommandL"), 201);
-            break;
-        }
-
-
-    //If it's a delete command, asking do you really want to delete
-    if( IsDeleteCommand( aCommand ) )
-        {
-        if ( aCommand == ECmdDeleteAllEntries )
-            {
-            if ( YesNoQueryDialogL( _L("Delete all entries?") ) )
-                {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-                AppendToCommandArrayL( ECmdDeleteContacts, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteContactGroups, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
-            
-#endif            
-                AppendToCommandArrayL( ECmdDeleteCalendarEntries, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserBookmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserBookmarkFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserSavedPages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserSavedPageFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteLogs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteIAPs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteLandmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
-                
-                // started exucuting delete commands
-                ExecuteFirstCommandL( KDeletingText );
-                }
-            else
-                {
-                // cancelled, free resources
-                ShutDownEnginesL();
-                }
-            }
-        else if ( aCommand == ECmdDeleteAllCreatorEntries )
-            {
-            if ( YesNoQueryDialogL( _L("Delete all entries created with Creator?") ) )
-                {
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4            
-                AppendToCommandArrayL( ECmdDeleteCreatorContacts, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorContactGroups, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
-#endif
-                AppendToCommandArrayL( ECmdDeleteCreatorCalendarEntries, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarkFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPageFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorLogs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorIAPs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorLandmarks, NULL, 1 );
-                
-                // started exucuting delete commands
-                ExecuteFirstCommandL( KDeletingText );
-                }
-            else
-                {
-                // cancelled, free resources
-                ShutDownEnginesL();
-                }
-            }
-        else if ( iUsedOptionsMenuModule->AskDataFromUserL( aCommand, iEntriesToBeCreated )  )
-            {
-            // add this command to command array
-            AppendToCommandArrayL( aCommand, NULL, 1 );
-    
-            // started exucuting commands
-            ExecuteFirstCommandL( KDeletingText );        
-            }
-        else
-            {
-            // cancelled, free resources
-            ShutDownEnginesL();
-            }
-        }
-
-    // ask user data, if query accepted start processing...
-    else if (iUsedOptionsMenuModule->AskDataFromUserL(aCommand, iEntriesToBeCreated))
-        {
-        // add this command to command array
-        AppendToCommandArrayL(aCommand, NULL, iEntriesToBeCreated);
-
-        // started exucuting commands
-        ExecuteFirstCommandL( KSavingText );
-        }
-     else
-        {
-        // cancelled, free resources
-        ShutDownEnginesL();
-        }
-    }
-
-
-
-TBool CCreatorEngine::IsDeleteCommand(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorEngine::IsDeleteCommand");
-
-    switch(aCommand)
-        {
-        //Add supported delete command here        
-        case ECmdDeleteAllEntries:
-        case ECmdDeleteAllCreatorEntries:
-        case ECmdDeleteEntries:
-        case ECmdDeleteContacts:
-        case ECmdDeleteCreatorContacts:
-        case ECmdDeleteContactGroups:
-        case ECmdDeleteCreatorContactGroups:
-        case ECmdDeleteCalendarEntries:
-        case ECmdDeleteCreatorCalendarEntries:
-        case ECmdDeleteBrowserBookmarks:
-        case ECmdDeleteCreatorBrowserBookmarks:
-        case ECmdDeleteBrowserBookmarkFolders:
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-        case ECmdDeleteBrowserSavedPages:
-        case ECmdDeleteCreatorBrowserSavedPages:
-        case ECmdDeleteBrowserSavedPageFolders:
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-        case ECmdDeleteCreatorFiles:
-        case ECmdDeleteLogs:
-        case ECmdDeleteCreatorLogs:
-        case ECmdDeleteMessages:
-        case ECmdDeleteCreatorMessages:
-        case ECmdDeleteMailboxes:
-        case ECmdDeleteCreatorMailboxes:
-        case ECmdDeleteIAPs:
-        case ECmdDeleteCreatorIAPs:
-        case ECmdDeleteIMPSs:
-        case ECmdDeleteCreatorIMPSs:
-        case ECmdDeleteNotes:
-        case ECmdDeleteLandmarks:
-        case ECmdDeleteCreatorLandmarks:
-            {
-            return ETrue;
-            }
-        default:
-            {
-            return EFalse;
-            }
-        }
-     
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CCreatorEngine::GetRandomDataFilenameL(TDes& aFilename)
-	{
-    CCommandParser* commandParser = CCommandParser::NewLC(this);
-	TBool ret = commandParser->GetRandomDataFilenameL(aFilename);
-    CleanupStack::PopAndDestroy(commandParser);
-    return ret;
-	}
-
-// ---------------------------------------------------------------------------
-
-TBool CCreatorEngine::GetRandomDataFromFileL(const TDesC& aFilename)
-	{
-    // wait dialog
-    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
-    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Reading random data"));
-
-    for (TInt i = 0; i < iStringArrays.Count(); ++i)
-        {
-        delete iStringArrays[i].iArrayPtr;
-        }
-    iStringArrays.Reset();
-
-    TBool errorDetected = EFalse;
-
-    // NOTE: These must be exactly in same order as in enumeration:
-    
-    if (ReadRandomDataL(EFirstName, R_DATA_FIRSTNAMES, aFilename, CCreatorRandomDataParser::EFirstName) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ESurname, R_DATA_SURNAMES, aFilename, CCreatorRandomDataParser::ESurname) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ECompany, R_DATA_COMPANIES, aFilename, CCreatorRandomDataParser::ECompany) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EAddress, R_DATA_ADDRESSES, aFilename, CCreatorRandomDataParser::EAddress) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EJobTitle, R_DATA_JOBTITLES, aFilename, CCreatorRandomDataParser::EJobTitle) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EPhoneNumber, R_DATA_PHONENUMBERS, aFilename, CCreatorRandomDataParser::EPhoneNumber) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EGroupName, R_DATA_GROUPNAMES, aFilename, CCreatorRandomDataParser::EGroupName) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EMeetingReason, R_DATA_MEETINGREASONS, aFilename, CCreatorRandomDataParser::EMeetingReason) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EMeetingPlace, R_DATA_MEETINGPLACES, aFilename, CCreatorRandomDataParser::EMeetingPlace) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EMemoText, R_DATA_MEMOS, aFilename, CCreatorRandomDataParser::EMemoText) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EAnniversaryReason, R_DATA_ANNIVERSARIES, aFilename, CCreatorRandomDataParser::EAnniversaryReason) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EToDoText, R_DATA_TODOS, aFilename, CCreatorRandomDataParser::EToDoText) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EReminderText, R_DATA_REMINDERS, aFilename, CCreatorRandomDataParser::EReminderText) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EMessageSubject, R_DATA_MESSAGESUBJECTS, aFilename, CCreatorRandomDataParser::EMessageSubject) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EMessageText, R_DATA_MESSAGETEXTS, aFilename, CCreatorRandomDataParser::EMessageText) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ECity, R_DATA_CITIES, aFilename, CCreatorRandomDataParser::ECity) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ECountry, R_DATA_COUNTRIES, aFilename, CCreatorRandomDataParser::ECountry) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EPostcode, R_DATA_POSTCODES, aFilename, CCreatorRandomDataParser::EPostcode) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EState, R_DATA_STATES, aFilename, CCreatorRandomDataParser::EState) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EPobox, R_DATA_POBOXES, aFilename, CCreatorRandomDataParser::EPobox) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(EPrefix, R_DATA_PREFIXES, aFilename, CCreatorRandomDataParser::EPrefix) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ESuffix, R_DATA_SUFFIXES, aFilename, CCreatorRandomDataParser::ESuffix) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ELandmarkName, R_DATA_LANDMARK_NAMES, aFilename, CCreatorRandomDataParser::ELandmarkName) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    if (ReadRandomDataL(ELandmarkDescription, R_DATA_LANDMARK_DESCRIPTIONS, aFilename, CCreatorRandomDataParser::ELandmarkDescription) != KErrNone)
-    	{
-    	errorDetected = ETrue;
-    	}
-    
-    // remove the wait dialog
-    waitDialog->CancelNoteL(dialogId);
-    CleanupStack::PopAndDestroy(waitDialog);
-    
-    if (errorDetected)
-    	{
-		CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-		note->ExecuteLD(_L("Error in reading random data."));
-   	}
-    
-    return !errorDetected;
-	}
-
-// ---------------------------------------------------------------------------
-
-TInt CCreatorEngine::ReadRandomDataL(const TRandomStringType aRandomStringType,
-		                             const TInt aResourceId,
-		                             const TDesC& aFilename,
-		                             const CCreatorRandomDataParser::TRandomDataType aRandomDataType)
-	{
-	TInt error = KErrNone;
-	if (aFilename == KNullDesC)
-		{
-        iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, iEnv->ReadDesCArrayResourceL(aResourceId)));
-		}
-	else
-		{
-	    CCreatorRandomDataParser* dataParser = CCreatorRandomDataParser::NewLC();
-		CDesCArrayFlat* array = NULL;
-	
-		TRAP(error, array = dataParser->ParseL(aFilename, aRandomDataType));
-		if (error == KErrNone)
-			{
-			error = dataParser->GetError();
-			}
-	    if ((error == KErrNone) && (array->MdcaCount() > 0))
-	    	{
-	    	iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, array));
-	    	}
-	    else
-	    	{
-	    	if (array)
-	    		{
-	    		array->Reset();
-	    		delete array;
-	    		}
-	        iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, iEnv->ReadDesCArrayResourceL(aResourceId)));
-	    	}
-		CleanupStack::PopAndDestroy(dataParser);
-		}
-	return error;
-	}
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::AppendToCommandArrayL(TInt aCommand, CCreatorModuleBaseParameters* aParameters, TInt aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorEngine::AppendToCommandArrayL");
-    iParameterArray.AppendL(aParameters);
-
-    for (TInt i=0; i<aNumberOfEntries; i++)
-        iCommandArray->AppendL( TCommand(aCommand, aParameters) );
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CCreatorEngine::CommandArrayCount()
-    {
-    TInt count(0);
-    
-    if (iCommandArray)
-        count = iCommandArray->Count();
-    
-    LOGSTRING2("Creator: CCreatorEngine::CommandArrayCount returns %d", count);
-    
-    return count;
-    }
-
-// ---------------------------------------------------------------------------
-
-//returs fileid by its name, eg. 1 in 
-TInt CCreatorEngine::GetAttachmentIdL( const TDesC& aAttachmentIdStr ) const
-    {
-    TInt mapCount = sizeof(FileMap) / sizeof(FileMapping);
-    
-    for( TInt i = 0; i < mapCount; ++i )
-        {
-        if( FileMap[i].FileName() == aAttachmentIdStr )
-            return FileMap[i].FileId();
-        }
-    LOGSTRING2("CCreatorEngine::GetAttachmentIdL: Unknown attachment file id: %s", &aAttachmentIdStr);
-    User::Leave(KErrGeneral);
-    return KErrNotFound; // Not reached, but disables a compiler warning
-    }
-
-// ---------------------------------------------------------------------------
-
-// returns a random string from the resource files
-TPtrC CCreatorEngine::TestDataPathL (enum TTestDataPath aTestDataPath )
-    {
-    LOGSTRING("Creator: CCreatorEngine::TestDataPathL");
-
-    TFileName filePath;
-
-    switch (aTestDataPath )
-        {
-        case ESavedDeck_1kB:
-            {
-            filePath.Copy (_L("Deck-1kB.saveddeck") );
-            }
-            break;
-    
-        case EJPEG_25kB:
-            {
-            filePath.Copy (_L("JPEG-25kB.jpg") );
-            }
-            break;
-    
-        case EJPEG_200kB:
-            {
-            filePath.Copy (_L("JPEG-200kB.jpg") );
-            }
-            break;
-    
-        case EJPEG_500kB:
-            {
-            filePath.Copy (_L("JPEG-500kB.jpg") );
-            }
-            break;
-    
-        case EPNG_15kB:
-            {
-            filePath.Copy (_L("PNG-15kB.png") );
-            }
-            break;
-    
-        case EGIF_2kB:
-            {
-            filePath.Copy (_L("GIF-2kB.gif") );
-            }
-            break;
-    
-        case ERNG_1kB:
-            {
-            filePath.Copy (_L("RNG-1kB.rng") );
-            }
-            break;
-    
-        case EMIDI_10kB:
-            {
-            filePath.Copy (_L("MIDI-10kB.mid") );
-            }
-            break;
-    
-        case EWAVE_20kB:
-            {
-            filePath.Copy (_L("WAV-20kB.wav") );
-            }
-            break;
-    
-        case EAMR_20kB:
-            {
-            filePath.Copy (_L("AMR-20kB.amr") );
-            }
-            break;
-    
-        case EExcel_15kB:
-            {
-            filePath.Copy (_L("XLS-15kB.xls") );
-            }
-            break;
-    
-        case EWord_20kB:
-            {
-            filePath.Copy (_L("DOC-20kB.doc") );
-            }
-            break;
-    
-        case EPowerPoint_40kB:
-            {
-            filePath.Copy (_L("PPT-40kB.ppt") );
-            }
-            break;
-    
-        case EText_10kB:
-            {
-            filePath.Copy (_L("TXT-10kB.txt") );
-            }
-            break;
-    
-        case EText_70kB:
-            {
-            filePath.Copy (_L("TXT-70kB.txt") );
-            }
-            break;
-    
-        case E3GPP_70kB:
-            {
-            filePath.Copy (_L("3GPP-70kB.3gpp") );
-            }
-            break;
-    
-        case EMP3_250kB:
-            {
-            filePath.Copy (_L("MP3-250kB.mp3") );
-            }
-            break;
-    
-        case EAAC_100kB:
-            {
-            filePath.Copy (_L("AAC-100kB.aac") );
-            }
-            break;
-    
-        case ERM_95kB:
-            {
-            filePath.Copy (_L("RM-95kB.rm") );
-            }
-            break;
-    
-        case EBMP_25kB:
-            {
-            filePath.Copy (_L("BMP-25kB.bmp") );
-            }
-            break;
-        case EHTML_20kB:
-            {
-            filePath.Copy (_L("HTML-20kB.html") );
-            }
-            break;
-        case EJAD_1kB:
-            {
-            filePath.Copy (_L("JAD-1kB.jad") );
-            }
-            break;
-        case EJAR_10kB:
-            {
-            filePath.Copy (_L("JAR-10kB.jar") );
-            }
-            break;
-        case EJP2_65kB:
-            {
-            filePath.Copy (_L("JP2-65kB.jp2") );
-            }
-            break;
-        case EMP4_200kB:
-            {
-            filePath.Copy (_L("MP4-200kB.mp4") );
-            }
-            break;
-        case EMXMF_40kB:
-            {
-            filePath.Copy (_L("MXMF-40kB.mxmf") );
-            }
-            break;
-        case ERAM_1kB:
-            {
-            filePath.Copy (_L("RAM-1kB.ram") );
-            }
-            break;
-        case ESVG_15kB:
-            {
-            filePath.Copy (_L("SVG-15kB.svg") );
-            }
-            break;
-        case ESWF_15kB:
-            {
-            filePath.Copy (_L("SWF-15kB.swf") );
-            }
-            break;
-        case ETIF_25kB:
-            {
-            filePath.Copy (_L("TIF-25kB.tif") );
-            }
-            break;
-        case EVCF_1kB:
-            {
-            filePath.Copy (_L("VCF-1kB.vcf") );
-            }
-            break;
-        case EVCS_1kB:
-            {
-            filePath.Copy (_L("VCS-1kB.vcs") );
-            }
-            break;
-        case ESISX_10kB:
-            {
-            filePath.Copy (_L("SISX-10kB.sisx") );
-            }
-            break;
-        case EWMA_50kB:
-            {
-            filePath.Copy (_L("WMA-50kB.wma") );
-            }
-            break;
-        case EWMV_200kB:
-            {
-            filePath.Copy (_L("WMV-200kB.wmv") );
-            }
-            break;
-
-        default:
-            User::Panic (_L("Test data"), 401 );
-            break;
-        }
-
-    TFileName fullTargetPath;
-    fullTargetPath.Copy( iTempPath->Des() );
-    fullTargetPath.Append( filePath );
-    if (ConeUtils::FileExists(fullTargetPath))
-        {        
-        // No need to copy, if the file already exists.
-        LOGSTRING2("Creator: CCreatorEngine::TestDataPathL %S already exists", &fullTargetPath);
-        return fullTargetPath;
-        }
-
-    // Define the path where the testdata can be retrieved
-	// get the data from the private directory in secure platform
-    TFileName fullAppPath = iEnv->EikAppUi()->Application()->AppFullName();
-	TChar driveLetter = fullAppPath[0];
-	TInt driveNumber;
-	
-	iEnv->FsSession().CharToDrive(driveLetter, driveNumber);
-	iEnv->FsSession().SetSessionToPrivate( driveNumber );   // "\\private\\20011383\\"
- 
-
-    // check the file exists
-    if (!ConeUtils::FileExists(filePath))
-        {
-        LOGSTRING2("Creator: CCreatorEngine::TestDataPathL %S not found", &filePath);
-
-        TInt generatingError( KErrNone );
-        
-        // The file could be on C drive
-        iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
-        
-        if ( !ConeUtils::FileExists( filePath ) )
-            {
-            // The file is not on C drive, see if we can generate it
-            
-            // Make sure that the private path of this app in c-drive exists
-            iEnv->FsSession().CreatePrivatePath( KRegisterDrive );
-            
-            TFileName privatePath;
-            iEnv->FsSession().PrivatePath( privatePath );
-            privatePath.Append( filePath );
-            TChar privateDriveChar;
-            iEnv->FsSession().DriveToChar( KRegisterDrive, privateDriveChar );
-            TFileName fullPrivatePath; // full path of a file to be generated
-            fullPrivatePath.Append( privateDriveChar );
-            fullPrivatePath.Append( ':' );
-            fullPrivatePath.Append( privatePath );
-
-            switch ( aTestDataPath )
-                {
-                case EJPEG_25kB:
-                case EJPEG_200kB:
-                case EJPEG_500kB:
-                case EBMP_25kB:
-                case EGIF_2kB:
-                    {
-                    TRAP( generatingError, GenerateSourceImageFileL( aTestDataPath, fullPrivatePath ) );
-                    // GenerateSourceImageFileL calls TestDataPathL -> private session points to z
-                    // change it back to KRegisterDrive, because generated source file is there
-                    // and we need to copy it at the end of this function.
-                    iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
-                    break;
-                    }
-                case EText_10kB:
-                    {
-                    TRAP( generatingError, GenereteSourceTextFileL( fullPrivatePath, 10000 ) );
-                    // GenerateSourceImageFileL calls TestDataPathL -> private session points to z
-                    // change it back to KRegisterDrive, because generated source file is there
-                    // and we need to copy it at the end of this function.
-                    iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
-                    break;
-                    }
-                case EText_70kB:
-                    {
-                    TRAP( generatingError, GenereteSourceTextFileL( fullPrivatePath, 70000 ) );
-                    break;
-                    }
-                default:
-                    {
-                    generatingError = KErrNotSupported;
-                    break;
-                    }
-                }
-            }
-        
-        if ( iUserCancelled )
-            {
-            LOGSTRING("Creator: CCreatorEngine::TestDataPathL iUserCancelled" );
-            User::Leave( KErrCancel );
-            }
-        
-        if ( generatingError )
-            {
-            // Generating the file failed
-            
-            // cancel the dialog
-            iProgressDialog->ProcessFinishedL();
-            DialogDismissedL(EAknSoftkeyBack);
-
-            // show error note
-            CAknErrorNote* note = new (ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Test data missing"));
-
-            User::Leave(KErrPathNotFound);
-            }
-        }
-
-	// now copy the data to D-drive to make the file public
-	iEnv->FsSession().MkDirAll( iTempPath->Des() );
-	TInt copyErr = BaflUtils::CopyFile(iEnv->FsSession(), filePath, fullTargetPath);
-	LOGSTRING4("Creator: CCreatorEngine::TestDataPathL copy %S to %S returns=%d", &filePath, &fullTargetPath, copyErr);
-	
-	// make sure that the file won't have a read only attribute
-	TEntry fileEntry;
-	iEnv->FsSession().Entry(fullTargetPath, fileEntry);
-	iEnv->FsSession().SetEntry(fullTargetPath, fileEntry.iModified, NULL, KEntryAttReadOnly);
-	
-	filePath = fullTargetPath;  // change the reference to the temp path
-    return filePath;
-    }
-
-// ---------------------------------------------------------------------------
-
-// a generic query which can be used by the modules
-TBool CCreatorEngine::EntriesQueryDialogL(TInt& aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero)
-    {
-    LOGSTRING("Creator: CCreatorEngine::EntriesQueryDialogL");
-
-    CAknNumberQueryDialog* dialog = CAknNumberQueryDialog::NewL(aNumberOfEntries, CAknQueryDialog::ENoTone);
-    dialog->SetMinimumAndMaximum (1, 99999);
-
-    if(dialog->ExecuteLD(R_ENTRY_QUERY, aPrompt))
-        {
-        if (aAcceptsZero)
-            {
-            if (aNumberOfEntries>=0)
-                return ETrue;
-            else
-                return EFalse;
-            }
-        else
-            {
-            if (aNumberOfEntries>0)
-                return ETrue;
-            else
-                return EFalse;
-            }
-        }
-    else
-        return EFalse; // cancelled
-
-
-    }
-
-// ---------------------------------------------------------------------------
-
-// a generic query which can be used by the modules
-TBool CCreatorEngine::TimeQueryDialogL(TTime& aTime, TInt aResourceId)
-    {
-    LOGSTRING("Creator: CCreatorEngine::TimeQueryDialogL");
-
-    CAknTimeQueryDialog* dialog = CAknTimeQueryDialog::NewL(aTime, CAknQueryDialog::ENoTone);
-    return dialog->ExecuteLD(aResourceId);
-    }
-
-// ---------------------------------------------------------------------------
-
-// a generic YES NO query which can be used by the modules
-TBool CCreatorEngine::YesNoQueryDialogL(const TDesC& aPrompt)
-    {
-    LOGSTRING("Creator: CCreatorEngine::YesNoQueryDialogL");
-
-    CAknQueryDialog* dialog = CAknQueryDialog::NewL( );
-    
-    TInt yes = dialog->ExecuteLD(R_YES_NO_DIALOG, aPrompt);    
-
-    return  (TBool)yes;
-
-    }
-
-// ---------------------------------------------------------------------------
-
-
-
-// a method to return a default Internet Access Point
-TUint32 CCreatorEngine::GetDefaultIAPL()
-	{
-    LOGSTRING("Creator: CCreatorEngine::GetDefaultIAPL");
-
-	TUint32 lIAPid = 1; // Default value
-
-	CCommsDatabase* cDatabase = CCommsDatabase::NewL();
-	CleanupStack::PushL(cDatabase);
-
-	CCommsDbTableView* tableView = cDatabase->OpenTableLC(TPtrC(IAP));
-
-	TInt errorCode = tableView->GotoFirstRecord();
-		
-	if ( errorCode == KErrNone ) 
-		{
-		TUint32	iValue;
-		tableView->ReadUintL(TPtrC(COMMDB_ID),iValue);
-		lIAPid = iValue;
-		}
-
-	CleanupStack::PopAndDestroy(2); // cDatabase,tableView
-
-	return lIAPid;
-	}
-
-// ---------------------------------------------------------------------------
-
-TUint32 CCreatorEngine::AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound )
-    {
-    LOGSTRING("Creator: CCreatorEngine::AccessPointNameToIdL");
-    // Accespoint impl moved from engine to accespoint implementations for supporting 3.0-3.1 and 3.2->
-    return iAccessPoints->AccessPointNameToIdL(aAPName, aAnyIfNotFound );
-    }
-
-static CCreatorEngine::TTestDataPath SoundFiles[] = {
-        CCreatorEngine::EMIDI_10kB,
-        CCreatorEngine::EWAVE_20kB,  
-        CCreatorEngine::EMP3_250kB,
-        CCreatorEngine::EAAC_100kB
-        };
-
-static CCreatorEngine::TTestDataPath PictureFiles[] = 
-    {
-    CCreatorEngine::EJPEG_25kB,
-    CCreatorEngine::EJPEG_200kB,
-    CCreatorEngine::EJPEG_500kB,
-    CCreatorEngine::EPNG_15kB,
-    CCreatorEngine::EGIF_2kB
-    };
-
-TPtrC CCreatorEngine::CreateSoundFileL(TTestDataPath aId)
-{
-	TPtrC tempPath(TestDataPathL(aId));
-	// Copy file to permanent location:
-    TParse parser;
-    parser.Set(tempPath, NULL, NULL);
-    TPtrC fileName(parser.NameAndExt());
-    HBufC* fullTargetPath = HBufC::NewLC( KMaxFileName );
-    fullTargetPath->Des().Copy( PathInfo::PhoneMemoryRootPath() );
-    fullTargetPath->Des().Append( PathInfo::DigitalSoundsPath() );
-    
-    fullTargetPath->Des().Append(fileName);
-    CopyFileL(tempPath, *fullTargetPath);
-    iAllocatedFilePaths.AppendL(fullTargetPath);
-    CleanupStack::Pop(); // fullTargetPath
-    return fullTargetPath->Des(); 
-}
-TPtrC CCreatorEngine::CreateRandomSoundFileL()
-{
-    TInt numOfFiles = sizeof(SoundFiles) / sizeof(TTestDataPath);
-    return CreateSoundFileL(SoundFiles[RandomNumber(0, numOfFiles-1)]);
-}
-TPtrC CCreatorEngine::RandomSoundFileL()
-{
-    TInt numOfFiles = sizeof(SoundFiles) / sizeof(TTestDataPath);
-    return TestDataPathL(SoundFiles[RandomNumber(0, numOfFiles-1)]);
-}
-    
-TPtrC CCreatorEngine::RandomPictureFileL()
-{
-    TInt numOfFiles = sizeof(PictureFiles) / sizeof(TTestDataPath);
-    return TestDataPathL(PictureFiles[RandomNumber(0, numOfFiles-1)]);
-}
-// ---------------------------------------------------------------------------
-
-// returns a random string from the resource files
-TPtrC CCreatorEngine::RandomString(enum TRandomStringType aRandomStringType)
-    {
-    LOGSTRING("Creator: CCreatorEngine::RandomString");
-    
-    // Let's see if the array is OK and the string arrays are in correct order:
-    if( ((TInt) aRandomStringType) < iStringArrays.Count() && 
-        iStringArrays[aRandomStringType].iStringType == aRandomStringType)
-        {        
-        TInt rand = (TInt) (iStringArrays[aRandomStringType].iArrayPtr->Count() * Math::FRand(iSeed));
-        return (*iStringArrays[aRandomStringType].iArrayPtr)[rand];
-        }
-    
-    // Now let's loop the arrays and try to find one with the type:
-    for( TInt i = 0; i < iStringArrays.Count(); ++i )
-        {
-        if( iStringArrays[i].iStringType == aRandomStringType )
-            {
-            TInt rand = (TInt) (iStringArrays[i].iArrayPtr->Count() * Math::FRand(iSeed));
-            return (*iStringArrays[i].iArrayPtr)[rand];
-            }
-        }
-
-    User::Panic (_L("Random string"), 402);    
-    return NULL;
-    }
-
-// ---------------------------------------------------------------------------
-
-// returns a random number
-TInt CCreatorEngine::RandomNumber(TInt aRange)
-    {
-    LOGSTRING2("Creator: CCreatorEngine::RandomNumber aRange=%d", aRange);
-
-    return (TInt) (aRange*Math::FRand(iSeed));
-    }
-
-// ---------------------------------------------------------------------------
-
-// returns a random number
-TInt CCreatorEngine::RandomNumber(TInt aMin, TInt aMax)
-    {
-    LOGSTRING3("Creator: CCreatorEngine::RandomNumber aMin=%d aMax=%d", aMin, aMax);
-
-    TInt range = (aMax > aMin ? aMax - aMin : aMin - aMax) + 1;
-    TInt random = (TInt) (range*Math::FRand(iSeed));
-    
-    random = (random % range) + aMin;
-
-    if (random > aMax)
-        random = aMax;
-    else if (random < aMin)
-        random = aMin;
-    
-    return random;
-    }
-
-TTime CCreatorEngine::RandomTime(TTime baseTime, TRandomDateType type, TInt aMinHours, TInt aMaxHours, TInt aMinMinutes, TInt aMaxMinutes )
-    {
-    TInt randomHours = RandomNumber(aMinHours, aMaxHours);
-    TInt randomMinutes = RandomNumber(aMinMinutes, aMaxMinutes);
-    
-    switch( type )
-    {
-    case EDatePast:
-        return (baseTime - TTimeIntervalHours(randomHours)) - TTimeIntervalMinutes(randomMinutes);
-    case EDateFuture:
-        return (baseTime + TTimeIntervalHours(randomHours)) + TTimeIntervalMinutes(randomMinutes);
-    default:
-        break;
-    }
-    return baseTime;
-    }
-
-TTime CCreatorEngine::RandomDate(TTime baseTime, TRandomDateType type, TInt aMinDays, TInt aMaxDays)
-    {
-    TInt random = RandomNumber(aMinDays, aMaxDays);
-    
-    switch( type )
-    {
-    case EDatePast:
-        return baseTime - TTimeIntervalDays(random);
-    case EDateFuture:
-        return baseTime + TTimeIntervalDays(random);
-    default:
-        break;
-    }
-        
-    return baseTime;
-    }
-
-TTime CCreatorEngine::RandomDate(TRandomDateType type, TInt aMinDays, TInt aMaxDays)
-    {    
-    TTime time;
-    // Set to current time:
-    time.HomeTime();
-    return RandomDate(time, type, aMinDays, aMaxDays);
-    }
-
-HBufC* CCreatorEngine::CreateEmailAddressLC()
-    {
-    _LIT(KCountry, "com");    
-    return CreateEmailAddressLC(RandomString(EFirstName), RandomString(ESurname), RandomString(ECompany), KCountry);
-    }
-
-HBufC* CCreatorEngine::CreateHTTPUrlLC()
-    {
-    _LIT(KProtocol, "http://");
-    _LIT(KPrefix, "www");
-    _LIT(KCountry, "com");
-    return CreateUrlLC(KProtocol, KPrefix, RandomString(ECompany), KCountry);
-    }
-
-HBufC* CCreatorEngine::CreateRandomStringLC(TInt aStrLen)
-    {
-    TInt minAscii = 65;
-    TInt maxAscii = 90;
-    HBufC* str = HBufC::NewL(aStrLen);
-    CleanupStack::PushL(str);
-    for( TInt i = 0; i < aStrLen; ++i )
-        {
-        TInt random = RandomNumber(minAscii, maxAscii);
-        TChar randomChar = TChar((TUint) random);
-        str->Des().Append(randomChar);
-        }    
-    return str;
-    }
-
-HBufC* CCreatorEngine::CreateEmailAddressLC(
-        const TDesC& firstname,
-        const TDesC& lastname,
-        const TDesC& domain,
-        const TDesC& country ) const
-        {
-        HBufC* email = HBufC::New(firstname.Length() + lastname.Length() + domain.Length() + country.Length() + 3);
-        CleanupStack::PushL(email);        
-        _LIT(KEmailAddr, "%S.%S@%S.%S");
-        email->Des().Format(KEmailAddr, &firstname, &lastname, &domain, &country);
-        return email;
-        }
-        
-HBufC* CCreatorEngine::CreateUrlLC(
-        const TDesC& protocol,
-        const TDesC& prefix,
-        const TDesC& domain,
-        const TDesC& country) const
-    {
-    HBufC* url = HBufC::New(protocol.Size() + prefix.Size() + domain.Size() + country.Size() + 2);
-    CleanupStack::PushL(url);
-    _LIT(KUrl, "%S%S.%S.%S");
-    url->Des().Format(KUrl, &protocol, &prefix, &domain, &country);    
-    return url;
-    }
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::SetDefaultPathForFileCommandL(TInt aCommand, TFileName& aPath)
-	{
-	aPath.Copy( PathInfo::PhoneMemoryRootPath() );
-	switch (aCommand)
-	{
-	case ECmdCreateFileEntryJPEG_25kB:
-	case ECmdCreateFileEntryJPEG_200kB:
-	case ECmdCreateFileEntryJPEG_500kB:
-	case ECmdCreateFileEntryPNG_15kB:
-	case ECmdCreateFileEntryGIF_2kB:
-	case ECmdCreateFileEntryBMP_25kB:
-	case ECmdCreateFileEntrySVG_15kB:
-	case ECmdCreateFileEntryTIF_25kB:
-	case ECmdCreateFileEntryJP2_65kB:
-
-		{  aPath.Append( PathInfo::ImagesPath() );  break;  }
-
-	case ECmdCreateFileEntryRNG_1kB:
-		{  aPath.Append( PathInfo::SimpleSoundsPath() );  break;  }
-
-	case ECmdCreateFileEntryMIDI_10kB:
-	case ECmdCreateFileEntryWAV_20kB:
-	case ECmdCreateFileEntryAMR_20kB:
-	case ECmdCreateFileEntryMP3_250kB:
-	case ECmdCreateFileEntryAAC_100kB:
-	case ECmdCreateFileEntryWMA_50kB:
-		{  aPath.Append( PathInfo::DigitalSoundsPath() );  break;  }
-
-	case ECmdCreateFileEntry3GPP_70kB:
-	case ECmdCreateFileEntryRM_95kB:
-	case ECmdCreateFileEntryMP4_200kB:
-	case ECmdCreateFileEntryWMV_200kB:
-
-		{  aPath.Append( PathInfo::VideosPath() );  break;  }
-
-	case ECmdCreateFileEntryEmptyFolder:
-		{  aPath.Append( _L("MyFolder\\") );  break;  }
-
-	default:
-		{  aPath.Append( PathInfo::OthersPath() );  break;  }
-
-	}
-	}
-
-
-// ---------------------------------------------------------------------------
-
-void CCreatorEngine::CancelComplete()
-    {
-    LOGSTRING("Creator: CCreatorEngine::CancelComplete");
-    // free resources and show a note
-    TRAP_IGNORE( ShutDownEnginesL() );
-
-    TRAP_IGNORE(
-        CAknInformationNote* note = new (ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Cancelled"));
-        );
-    }
-
-// ---------------------------------------------------------------------------
-
-TCommand::TCommand(TInt aCommandId, CCreatorModuleBaseParameters* aParameters)
-    {
-    iCommandId = aCommandId;
-    iParameters = aParameters;
-    }
-
-// ---------------------------------------------------------------------------
-
-TCommand::~TCommand()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-CAsyncWaiter* CAsyncWaiter::NewL(TInt aPriority)
-	{
-	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
-	return self;
-	}
-
-CAsyncWaiter* CAsyncWaiter::NewLC(TInt aPriority)
-	{
-	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
-	CleanupStack::PushL(self);
-	return self;
-	}
-	
-CAsyncWaiter::CAsyncWaiter(TInt aPriority) : CActive(aPriority)
-	{
-	CActiveScheduler::Add(this);
-	}	
-
-CAsyncWaiter::~CAsyncWaiter()
-	{
-	Cancel();
-	}
-	
-void CAsyncWaiter::StartAndWait()
-	{
-    LOGSTRING("Creator: CAsyncWaiter::StartAndWait");
-
-    iStatus = KRequestPending;
-    SetActive();
-    iWait.Start();
-	}
-	
-TInt CAsyncWaiter::Result() const
-	{
-	return iError;
-	}
-	
-void CAsyncWaiter::RunL()
-	{
-    LOGSTRING("Creator: CAsyncWaiter::RunL");
-
-	iError = iStatus.Int();
-	CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-	}
-	
-void CAsyncWaiter::DoCancel()
-	{
-    LOGSTRING("Creator: CAsyncWaiter::DoCancel");
-
-	iError = KErrCancel;
-    if( iStatus == KRequestPending )
-        {
-        TRequestStatus* s=&iStatus;
-        User::RequestComplete( s, KErrCancel );
-        }
-
-    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-	}
-	
-FileMapping::FileMapping( const TDesC& aAttName, TInt aAttId, TInt aCommandId )
-    :
-    iFileName(aAttName),
-    iFileId(aAttId),
-    iCommandId(aCommandId)
-    {}
-
-    const TDesC& FileMapping::FileName() const
-    {
-        return iFileName;
-    }
-
-    TInt FileMapping::FileId() const
-    {
-        return iFileId;
-    }   
-
-    TInt FileMapping::CommandId() const
-    {
-        return iCommandId;
-    }
-    
-// ---------------------------------------------------------------------------  
-CDictionaryFileStore* CCreatorEngine::FileStoreLC()
-    {
-    LOGSTRING("Creator: CCreatorEngine::FileStoreLC");
-    CDictionaryFileStore* store;
-    
-    // make sure that the private path of this app in c-drive exists
-    CEikonEnv::Static()->FsSession().CreatePrivatePath( KRegisterDrive ); // c:\\private\\20011383\\
-
-    // handle register always in the private directory 
-    User::LeaveIfError( CEikonEnv::Static()->FsSession().SetSessionToPrivate( KRegisterDrive ) );
-    store = CDictionaryFileStore::OpenLC( CEikonEnv::Static()->FsSession(), KRegisterFileName, KUidCreatorApp );
-    return store;
-    }
-    
-// ---------------------------------------------------------------------------
-void CCreatorEngine::ReadEntryIdsFromStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid )
-    {
-    LOGSTRING("Creator: CCreatorEngine::ReadEntryIdsFromStoreL");
-    CDictionaryFileStore* store = FileStoreLC();
-    User::LeaveIfNull( store );
-    if ( store->IsPresentL( aModuleUid ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, aModuleUid );
-        TFileName fullPath;
-        TInt err( KErrNone );
-        TInt id( KErrNotFound );
-        while ( !err )
-            {
-            TRAP( err, id = in.ReadInt32L() );  // will leave with KErrEof
-            if ( !err )
-                {
-                aEntryIds.Append( id );
-                }
-            }
-        CleanupStack::PopAndDestroy( &in );
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-// ---------------------------------------------------------------------------
-void CCreatorEngine::WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid )
-    {
-    LOGSTRING("Creator: CCreatorEngine::WriteEntryIdsToStoreL");
-    CDictionaryFileStore* store = FileStoreLC();
-    User::LeaveIfNull( store );
-    
-    // backup previous ids from store
-    // otherwise they would be overwritten when calling out.WriteL
-    RArray<TInt> previousIds;
-    CleanupClosePushL( previousIds );
-    
-    if ( store->IsPresentL( aModuleUid ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, aModuleUid );        
-        TInt err( KErrNone );
-        TInt id( KErrNotFound );
-        while ( !err ) 
-            {
-            TRAP( err, id = in.ReadInt32L() ); // will leave with KErrEof
-            if ( !err )
-                {
-                previousIds.Append( id );
-                }
-            }
-        CleanupStack::PopAndDestroy( &in );
-        }
-    
-    RDictionaryWriteStream out;       
-    out.AssignLC( *store, aModuleUid );
-    
-    // restore previous ids to store
-    for ( TInt i = 0; i < previousIds.Count(); i++ )
-        {
-        out.WriteInt32L( previousIds[i] );            
-        }
-
-    // write new ids to store
-    for ( TInt i = 0; i < aEntryIds.Count(); i++ )
-        {
-        out.WriteInt32L( aEntryIds[i] );        
-        }
-    
-    out.CommitL();
-    CleanupStack::PopAndDestroy( &out );
-    
-    store->CommitL();
-    CleanupStack::PopAndDestroy( &previousIds );
-    CleanupStack::PopAndDestroy( store );
-    }
-
-// ---------------------------------------------------------------------------
-void CCreatorEngine::ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid )
-    {
-    LOGSTRING("Creator: CCreatorEngine::ReadEntryIdsFromStoreL");
-    CDictionaryFileStore* store = FileStoreLC();
-    User::LeaveIfNull( store );
-    if ( store->IsPresentL( aModuleUid ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, aModuleUid );
-        TFileName fullPath;
-        TInt err( KErrNone );
-        TUint32 id( KErrNone ); 
-        while ( !err )
-            {
-            TRAP( err, id = in.ReadUint32L() );  // will leave with KErrEof
-            if ( !err )
-                {
-                aEntryIds.Append( id );
-                }
-            }
-        CleanupStack::PopAndDestroy( &in );
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-// ---------------------------------------------------------------------------
-void CCreatorEngine::WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid )
-    {
-    LOGSTRING("Creator: CCreatorEngine::WriteEntryIdsToStoreL");
-    CDictionaryFileStore* store = FileStoreLC();
-    User::LeaveIfNull( store );
-    
-    // backup previous ids from store
-    // otherwise they would be overwritten when calling out.WriteL
-    RArray<TUint32> previousIds;
-    CleanupClosePushL( previousIds );
-    
-    if ( store->IsPresentL( aModuleUid ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, aModuleUid );
-        TInt err( KErrNone );
-        TUint32 id( KErrNone );
-        while ( !err ) 
-            {
-            TRAP( err, id = in.ReadUint32L() ); // will leave with KErrEof
-            if ( !err )
-                {
-                previousIds.Append( id );
-                }
-            }
-        CleanupStack::PopAndDestroy( &in );
-        }
-    
-    RDictionaryWriteStream out;       
-    out.AssignLC( *store, aModuleUid );
-    
-    // restore previous ids to store
-    for ( TInt i = 0; i < previousIds.Count(); i++ )
-        {
-        out.WriteUint32L( previousIds[i] );            
-        }
-
-    // write new ids to store
-    for ( TInt i = 0; i < aEntryIds.Count(); i++ )
-        {
-        out.WriteUint32L( aEntryIds[i] );        
-        }
-    
-    out.CommitL();
-    CleanupStack::PopAndDestroy( &out );
-    
-    store->CommitL();
-    CleanupStack::PopAndDestroy( &previousIds );
-    CleanupStack::PopAndDestroy( store );
-    }
-
-// ---------------------------------------------------------------------------
-void CCreatorEngine::RemoveStoreL( const TUid aModuleUid )
-    {
-    LOGSTRING("Creator: CCreatorEngine::RemoveStoreL");
-    CDictionaryFileStore* store = FileStoreLC();
-    User::LeaveIfNull( store );
-    if ( store->IsPresentL( aModuleUid ) )
-        {        
-        // entries of this module should be deleted by now,
-        // remove the Creator internal registry for this module
-        store->Remove( aModuleUid );
-        store->CommitL();
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorEngine::GenerateSourceImageFileL(
-    const CCreatorEngine::TTestDataPath aFileType,
-    const TDesC& aFileName )
-    {
-    LOGSTRING("Creator: CCreatorEngine::GenerateSourceImageFileL");
-    
-    // Peek file size
-    RFile file;
-    TInt fileSize( 0 );
-    // Using png file as the source file
-    TFileName fileName = TestDataPathL( CCreatorEngine::EPNG_15kB );
-    User::LeaveIfError( file.Open( iEnv->FsSession(),
-                                   fileName,
-                                   EFileRead | EFileShareAny ) );
-    CleanupClosePushL( file );
-    User::LeaveIfError( file.Size( fileSize ) );
-    CleanupStack::PopAndDestroy( &file );
-    
-    // Using heap variables, because bitmaps 
-    // may reserve large amount of memory.
-    
-    // Read data from the file
-    RFileReadStream ws;    
-    User::LeaveIfError( ws.Open( iEnv->FsSession(),
-                                 fileName,
-                                 EFileStream | EFileRead | EFileShareAny ) );
-    CleanupClosePushL( ws );
-    delete iBitmapData;
-    iBitmapData = NULL;
-    iBitmapData = HBufC8::NewL( fileSize );
-    TPtr8 dataPtr = iBitmapData->Des();
-    ws.ReadL( dataPtr, fileSize );
-    CleanupStack::PopAndDestroy( &ws );
-       
-    // Create decoder for the data
-    delete iDecoder;
-    iDecoder = NULL;
-    iDecoder = CImageDecoder::DataNewL( iEnv->FsSession(), dataPtr );
-    iFrameinfo = iDecoder->FrameInfo();
-    
-    // Create bitmap handle for the source image
-    iBitmap = new (ELeave) CFbsBitmap();
-    User::LeaveIfError( iBitmap->Create( iFrameinfo.iFrameCoordsInPixels.Size(), EColor16M ) );
-    
-    // Convert the data from the file into bitmap format (inmemory)  
-    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-    iDecoder->Convert( &waiter->iStatus, *iBitmap );
-    waiter->StartAndWait();
-    delete iDecoder;
-    iDecoder = NULL;
-    delete iBitmapData;
-    iBitmapData = NULL;
-    if ( iUserCancelled )
-        {
-        CancelComplete();
-        User::Leave( KErrCancel );
-        }
-    User::LeaveIfError( waiter->Result() );
-    
-    // Define the target dimensions and image quality
-    // so that the generated file size will match required size.
-    // Quality and scaling factors are defined experimentally.
-    delete iScaler;
-    iScaler = NULL;
-    iScaler = CBitmapScaler::NewL();
-    iScaledBitmap = new (ELeave) CFbsBitmap();
-    // use original size as base
-    TSize scaledSize( iFrameinfo.iFrameCoordsInPixels.Size() );
-    delete iFrameImageData;
-    iFrameImageData = NULL;
-    iFrameImageData = CFrameImageData::NewL();
-    TBuf8<64> mimeType;
-    TJpegImageData* jpegImageData( NULL );
-    TBmpImageData* bmpImageData( NULL );
-    switch ( aFileType )
-        {
-        case CCreatorEngine::EJPEG_25kB:
-            // QualityFactor = 93 and size factor = 2 -> 25kB jpeg file
-            mimeType.Copy( _L8("image/jpeg") );
-            jpegImageData = new (ELeave) TJpegImageData;
-            // Set some format specific data
-            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
-            jpegImageData->iQualityFactor = 93; // 0..100
-            // ownership passed to iFrameImageData after AppendImageData
-            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
-            scaledSize.iHeight *= 2;
-            scaledSize.iWidth *= 2;
-            break;
-        case CCreatorEngine::EJPEG_200kB:
-            {
-            mimeType.Copy( _L8("image/jpeg") );
-            jpegImageData = new (ELeave) TJpegImageData;
-            // Set some format specific data
-            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
-#ifdef __WINS__
-            // QualityFactor = 95 and size factor = 7 -> 196kB jpeg file
-            jpegImageData->iQualityFactor = 95; // 0..100
-            scaledSize.iHeight *= 7;
-            scaledSize.iWidth *= 7;
-#else
-            // In hw the image compression seems to work
-            // more efficiently. Need to set greater values.
-            jpegImageData->iQualityFactor = 100; // 0..100
-            scaledSize.iHeight *= 7;
-            scaledSize.iWidth *= 7;
-            // 100, 7, 7 -> 213kB
-#endif
-            // ownership passed to iFrameImageData after AppendImageData
-            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
-            break;
-            }
-        case CCreatorEngine::EJPEG_500kB:
-            {
-            mimeType.Copy( _L8("image/jpeg") );
-            jpegImageData = new (ELeave) TJpegImageData;
-            // Set some format specific data
-            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
-#ifdef __WINS__
-            // QualityFactor = 99 and size factor = 8 -> 514kB jpeg file
-            jpegImageData->iQualityFactor = 99; // 0..100
-            scaledSize.iHeight *= 8;
-            scaledSize.iWidth *= 8;
-#else
-            // In hw the image compression seems to work
-            // more efficiently. Need to set greater values. 
-            jpegImageData->iQualityFactor = 100; // 0..100
-            scaledSize.iHeight *= 13;
-            scaledSize.iWidth *= 13;
-            // 100, 13, 13 -> 535kB
-#endif
-            // ownership passed to iFrameImageData after AppendImageData
-            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
-            break;
-            }
-        case CCreatorEngine::EBMP_25kB:
-            {
-            // bit depyh 8 and 11/10 size factor -> 25kB bmp
-            mimeType.Copy( _L8("image/bmp") );
-            bmpImageData = new (ELeave) TBmpImageData;
-            bmpImageData->iBitsPerPixel = 8;
-            // ownership passed to iFrameImageData after AppendImageData
-            User::LeaveIfError( iFrameImageData->AppendImageData( bmpImageData ) );
-            scaledSize.iHeight *= 11;
-            scaledSize.iWidth *= 11;
-            scaledSize.iHeight /= 10;
-            scaledSize.iWidth /= 10;
-            break;
-            }
-        case CCreatorEngine::EGIF_2kB:
-            {
-            // size factor 1/2 -> 2560B gif
-            mimeType.Copy( _L8("image/gif") );
-            // GIF encoder is not configurable, only the size matters here
-            scaledSize.iHeight /= 2;
-            scaledSize.iWidth /= 2;
-            break;
-            }
-        default: break;
-        }
-
-    // Scale to reach target size
-    User::LeaveIfError( iScaledBitmap->Create( scaledSize, EColor16M ) );
-    iScaler->Scale( &waiter->iStatus, *iBitmap, *iScaledBitmap );
-    waiter->StartAndWait();
-    delete iBitmap;
-    iBitmap = NULL;
-    delete iScaler;
-    iScaler = NULL;
-    if ( iUserCancelled )
-        {
-        CancelComplete();
-        User::Leave( KErrCancel );
-        }
-    User::LeaveIfError( waiter->Result() );
-    
-    // Encode to target format
-    delete iEncoder;
-    iEncoder = NULL;
-    // Creating CImageEncoder opens the target file
-    iEncoder = CImageEncoder::FileNewL( iEnv->FsSession(), aFileName, mimeType );
-
-    // Do the conversion to target format, this will write to the file
-    iEncoder->Convert( &waiter->iStatus, *iScaledBitmap, iFrameImageData );
-    waiter->StartAndWait();
-    delete iEncoder;
-    iEncoder = NULL;
-    delete iFrameImageData;
-    iFrameImageData = NULL;
-    delete iScaledBitmap;
-    iScaledBitmap = NULL;
-    if ( iUserCancelled )
-        {
-        CancelComplete();
-        User::Leave( KErrCancel );
-        }
-    User::LeaveIfError( waiter->Result() );
-    CleanupStack::PopAndDestroy( waiter );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorEngine::GenereteSourceTextFileL( const TDesC& aFileName, TInt aSize )
-    {
-    LOGSTRING("Creator: CCreatorEngine::GenereteSourceTextFileL");
-    RFile txtFile;
-    _LIT8( KTestContent, "Testing... ");
-    _LIT8( KTestContentCRLF, "\r\n");
-    txtFile.Create( iEnv->FsSession(),
-                    aFileName,
-                    EFileStreamText | EFileWrite | EFileShareAny );
-    CleanupClosePushL( txtFile );
-    for ( TInt i = 1; i*KTestContent().Length() < aSize; i++ )
-        {
-        User::LeaveIfError( txtFile.Write( KTestContent ) );
-        if ( !( i % 10 ) ) // linefeed for every 10th
-            {
-            User::LeaveIfError( txtFile.Write( KTestContentCRLF ) );
-            }
-        }
-    CleanupStack::PopAndDestroy( &txtFile );
-    }
--- a/creator/src/creator_note.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_note.h" 
-#include "creator_traces.h"
-
-const TInt KCreatorDiskSpaceNeededForSingleDeletion( 8192 );
-_LIT( KCreatorNotepadFile, "c:Notepad.dat" );
-
-// @see \s60\app\organizer\notepad\notepad1\LibSrc\NpdCoreModel.cpp KSecureUid.Name()
-_LIT( KCreatorNotepadFormat, "SECURE[101F8878]" ); 
-_LIT( KCreatorNotepadDeleteAllSQL, "DELETE FROM Table1");
-
-//----------------------------------------------------------------------------
-
-CNotepadParameters::CNotepadParameters()
-    {
-    LOGSTRING("Creator: CNotepadParameters::CNotepadParameters");
-
-    iNoteText = HBufC::New(KNotepadFieldLength);
-    }
-
-CNotepadParameters::~CNotepadParameters()
-    {
-    LOGSTRING("Creator: CNotepadParameters::~CNotepadParameters");
-
-    delete iNoteText;
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorNotepad* CCreatorNotepad::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorNotepad* self = CCreatorNotepad::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorNotepad* CCreatorNotepad::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorNotepad* self = new (ELeave) CCreatorNotepad;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorNotepad::CCreatorNotepad() : iFs ( CEikonEnv::Static()->FsSession() )
-    {
-    }
-
-void CCreatorNotepad::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorNotepad::ConstructL");
-
-    iEngine = aEngine;
-
-    iNotepadApi = CNotepadApi::NewL();
-    }
-
-CCreatorNotepad::~CCreatorNotepad()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
-    
-    delete iNotepadApi;
-    
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorNotepad::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorNotepad::AskDataFromUserL");
-
-    if ( aCommand == ECmdDeleteNotes )
-        {
-        return iEngine->YesNoQueryDialogL( _L("Delete all Notes?") );
-        }
-    
-    // By Creator not supported because 
-    // note id is not available via Notepad API
-
-    return iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"));
-    }
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorNotepad::CreateNoteEntryL(CNotepadParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorNotepad::CreateNoteEntryL");
-
-    // clear any existing parameter definations
-    delete iParameters;
-    iParameters = NULL;
-    
-    CNotepadParameters* parameters = aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CNotepadParameters;
-        parameters = iParameters;
-        parameters->iNoteText->Des() = iEngine->RandomString(CCreatorEngine::EMessageText);
-        }
-    
-    TInt err = KErrNone;
-
-    iNotepadApi->AddContentL(parameters->iNoteText->Des());
-    
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorNotepad::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::DeleteAllL");
-    // Open Notes db
-    RDbs dbs;
-    User::LeaveIfError( dbs.Connect() );
-    CleanupClosePushL( dbs );
-    RDbNamedDatabase db;
-    TInt openErr( db.Open( dbs, KCreatorNotepadFile, KCreatorNotepadFormat ) );
-    CleanupClosePushL( db );
-    
-    if ( openErr && openErr !=  KErrNotFound )
-        {
-        User::Leave( openErr );
-        }
-    
-    // do not leave if openErr == KErrNotFound, 
-    // it means there is no notes (file) created -> no need to delete
-    
-    if ( openErr !=  KErrNotFound )
-        {
-        TInt retval = iFs.ReserveDriveSpace( KDefaultDrive, KCreatorDiskSpaceNeededForSingleDeletion );
-        if ( retval == KErrNone )
-            {
-            retval = iFs.GetReserveAccess( KDefaultDrive );
-            }
-
-        // Delete all Notes. Ignore rowCount returnvalue
-        db.Execute( KCreatorNotepadDeleteAllSQL );            
-        
-        User::LeaveIfError( db.Compact() );
-        
-        if ( retval == KErrNone )
-            {
-            retval = iFs.ReleaseReserveAccess( KDefaultDrive );
-            }
-        }
-    
-    CleanupStack::PopAndDestroy( &db );
-    CleanupStack::PopAndDestroy( &dbs );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorNotepad::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::DeleteAllCreatedByCreatorL");
-    // Not supported because note id is not available via Notepad API
-    User::Leave( KErrNotSupported );
-    }
--- a/creator/src/creator_noteelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_noteelement.h"
-#include "creator_traces.h"
-#include "creator_note.h"
-
-using namespace creatornote;
-
-/*
- * 
- */
-CCreatorNoteElement* CCreatorNoteElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
-    {
-    CCreatorNoteElement* self = new (ELeave) CCreatorNoteElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop(self);
-    return self;
-    }
-/*
- * 
- */
-CCreatorNoteElement::CCreatorNoteElement(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    {
-    iIsCommandElement = ETrue;
-    }
-
-void CCreatorNoteElement::ExecuteCommandL()
-    {
-    const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
-    TInt noteAmount = 1;    
-    if( amountAttr )
-        {
-        noteAmount = ConvertStrToIntL(amountAttr->Value());
-        }
-    // Get 'fields' element 
-    CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
-    if( fieldsElement && fieldsElement->SubElements().Count() > 0)
-        {
-        // Get sub-elements
-        const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
-        // Create note entries, the amount of entries is defined by noteAmount:
-        for( TInt cI = 0; cI < noteAmount; ++cI )
-            {            
-            CNotepadParameters* param = new (ELeave) CNotepadParameters;
-            CleanupStack::PushL(param);
-            
-            for( TInt i = 0; i < fields.Count(); ++i )
-                {
-                CCreatorScriptElement* field = fields[i];
-                TPtrC elemName = field->Name();
-                TPtrC elemContent = field->Content();
-                const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
-                TBool useMax = EFalse;
-                if( randomAttr && randomAttr->Value() == KMax )
-                    {
-                    useMax = ETrue;
-                    }
-                
-                if( elemName == KText )
-                    {
-                    if( randomAttr || elemContent.Length() == 0 )
-                        {
-                        if( useMax )
-                            {
-                            TDesC* temp = iEngine->CreateRandomStringLC(KNotepadFieldLength);                            
-                            SetContentToTextParamL(param->iNoteText, *temp);
-                            CleanupStack::PopAndDestroy(); // temp
-                            }
-                        else
-                            {
-                            SetContentToTextParamL(param->iNoteText, iEngine->RandomString(CCreatorEngine::EMessageText));
-                            }
-                        }
-                    else
-                        {
-                        SetContentToTextParamL(param->iNoteText, elemContent);
-                        }
-                    }
-                }
-            iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryNotes, param);
-            CleanupStack::Pop(); // param
-            }
-        }
-    else
-    	{
-    	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryNotes, 0, noteAmount);
-    	}
-    }
--- a/creator/src/creator_phonebook.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,514 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_phonebook.h" 
-#include "creator_traces.h"
-
-#include <cpbkcontactiter.h>
-
-//----------------------------------------------------------------------------
-
-CPhonebookParameters::CPhonebookParameters()
-    {
-    LOGSTRING("Creator: CPhonebookParameters::CPhonebookParameters");
-
-    iContactFirstName = HBufC::New(KPhonebookFieldLength);
-    iContactLastName = HBufC::New(KPhonebookFieldLength);
-    iContactCompanyName = HBufC::New(KPhonebookFieldLength);
-    iContactJobTitle = HBufC::New(KPhonebookFieldLength);
-    iContactPostalAddress = HBufC::New(KPhonebookFieldLength);
-    iWvUserId = HBufC::New(KPhonebookFieldLength);
-    iRingingtone = HBufC::New(KPhonebookFieldLength);
-    iThumbnailImage = HBufC::New(KPhonebookFieldLength);
-    iContactPhoneNumberGeneral = HBufC::New(KPhonebookFieldLength);
-    iContactURL = HBufC::New(KPhonebookFieldLength);
-    iContactEmailAddress = HBufC::New(KPhonebookFieldLength);
-    iGroupName = HBufC::New(KPhonebookFieldLength);
-    }
-
-CPhonebookParameters::~CPhonebookParameters()
-    {
-    LOGSTRING("Creator: CPhonebookParameters::~CPhonebookParameters");
-
-    delete iGroupName;
-    delete iContactEmailAddress;
-    delete iContactURL;
-    delete iContactPhoneNumberGeneral;
-    delete iThumbnailImage;
-    delete iRingingtone;
-    delete iWvUserId;
-    delete iContactPostalAddress;
-    delete iContactJobTitle;
-    delete iContactCompanyName;
-    delete iContactLastName;
-    delete iContactFirstName;
-    }
-void CPhonebookParameters::ParseL (CCommandParser* parser, TParseParams /*aCase = 0*/)
-	{
-	parser->StrParserL (iContactFirstName, '|');
-	parser->StrParserL (iContactLastName, '|');
-	parser->StrParserL (iContactCompanyName, '|');
-	parser->StrParserL (iContactJobTitle, '|');
-	parser->StrParserL (iContactPostalAddress, '|');
-	parser->StrParserL (iContactPhoneNumberGeneral, '|');
-	parser->StrParserL (iContactURL, '|');
-	parser->StrParserL (iContactEmailAddress, '|');
-	parser->StrParserL (iWvUserId, '|');
-	parser->StrParserL (iRingingtone, '|');
-	parser->StrParserL (iThumbnailImage, ';');
-	}
-//----------------------------------------------------------------------------
-
-CCreatorPhonebook* CCreatorPhonebook::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorPhonebook* self = CCreatorPhonebook::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorPhonebook* CCreatorPhonebook::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorPhonebook* self = new (ELeave) CCreatorPhonebook;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorPhonebook::CCreatorPhonebook()
-    {
-    }
-
-void CCreatorPhonebook::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::ConstructL");
-
-    iEngine = aEngine;  
-    iContactDBEngine = CPbkContactEngine::NewL();
-    iOpCounter = 0;
-    SetDefaultParameters();
-    }
-
-CCreatorPhonebook::~CCreatorPhonebook()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::~CCreatorPhonebook");
-
-    if ( iEngine && iContactIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iContactIds, KUidDictionaryUidContacts ) );
-        }
-    iContactIds.Reset();
-    iContactIds.Close();
-
-    if ( iEngine && iGroupIds.Count() )
-        {
-        TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iGroupIds, KUidDictionaryUidContactGroups ) );
-        }
-    iGroupIds.Reset();
-    iGroupIds.Close();
-       
-    iEntriesToDelete.Reset();
-    iEntriesToDelete.Close();
-    
-    CompactPbkDatabase( ETrue );
-
-    delete iContactDBEngine;
-
-    if (iParameters)
-        delete iParameters;
-    }
-
-//----------------------------------------------------------------------------
-TInt CCreatorPhonebook::CreateContactEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::CreateContactEntryL");
-    
-    delete iParameters;
-    iParameters = 0;
-    
-    CPhonebookParameters* parameters = (CPhonebookParameters*) aParameters;
-    
-    // random data needed if no predefined data available
-    if (!parameters)
-        {
-        iParameters = new(ELeave) CPhonebookParameters;
-        
-        iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
-        iParameters->iNumberOfURLFields = iNumberOfURLFields;
-        iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;        
-        
-        iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
-        iParameters->iNumberOfURLFields = iNumberOfURLFields;
-        iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;
-        
-        iParameters->iContactFirstName->Des() = iEngine->RandomString(CCreatorEngine::EFirstName);
-        iParameters->iContactLastName->Des() = iEngine->RandomString(CCreatorEngine::ESurname);
-        iParameters->iContactCompanyName->Des() = iEngine->RandomString(CCreatorEngine::ECompany);
-        iParameters->iContactJobTitle->Des() = iEngine->RandomString(CCreatorEngine::EJobTitle);
-        iParameters->iContactPostalAddress->Des() = iEngine->RandomString(CCreatorEngine::EAddress);
-        
-        iParameters->iWvUserId->Des().Copy(_L("wv:"));
-        iParameters->iWvUserId->Des().Append(iParameters->iContactFirstName->Des());
-
-        // TO-DO.....
-        //iParameters->iRingingtone->Des() = KNullDesC;
-        //iParameters->iThumbnailImage->Des() = KNullDesC;
-
-        iParameters->iContactPhoneNumberGeneral->Des() = iEngine->RandomString(CCreatorEngine::EPhoneNumber);
-  
-        iParameters->iContactURL->Des().Copy( _L("http://www.") );
-        iParameters->iContactURL->Des().Append( iParameters->iContactCompanyName->Des() );
-        iParameters->iContactURL->Des().Append( _L(".com/") );
-
-        iParameters->iContactEmailAddress->Des().Copy( iParameters->iContactFirstName->Des() );
-        iParameters->iContactEmailAddress->Des().Append( _L("@") );
-        iParameters->iContactEmailAddress->Des().Append( iParameters->iContactCompanyName->Des() );
-        iParameters->iContactEmailAddress->Des().Append( _L(".com") );
-
-        }
-    else
-        {
-        iParameters = parameters;
-        }
-
-    TInt err = KErrNone;
-
-    // create a new contact item based on the default template
-	CPbkContactItem* newContact = iContactDBEngine->CreateEmptyContactL();
-	CleanupStack::PushL(newContact);
-
-    AddFieldToContactItemL (*newContact, EPbkFieldIdFirstName, iParameters->iContactFirstName->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdLastName, iParameters->iContactLastName->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdCompanyName, iParameters->iContactCompanyName->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdJobTitle, iParameters->iContactJobTitle->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdPostalAddress, iParameters->iContactPostalAddress->Des());
-    
-    AddFieldToContactItemL (*newContact, EPbkFieldIdWVID, iParameters->iWvUserId->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdPersonalRingingToneIndication, iParameters->iRingingtone->Des());
-    AddFieldToContactItemL (*newContact, EPbkFieldIdThumbnailImage, iParameters->iThumbnailImage->Des());
-
-    for (TInt i=0; i<iParameters->iNumberOfPhoneNumberFields; i++)
-        {
-        if (i%6 == 0)
-            AddFieldToContactItemL (*newContact, EPbkFieldIdPhoneNumberGeneral, iParameters->iContactPhoneNumberGeneral->Des());
-        else if (i%6 == 1)
-            AddFieldToContactItemL (*newContact, EPbkFieldIdPhoneNumberMobile, iParameters->iContactPhoneNumberGeneral->Des());
-        else if (i%6 == 2)
-            AddFieldToContactItemL (*newContact, EPbkFieldIdFaxNumber, iParameters->iContactPhoneNumberGeneral->Des());
-        else if (i%6 == 3)
-            AddFieldToContactItemL (*newContact, EPbkFieldIdPagerNumber, iParameters->iContactPhoneNumberGeneral->Des());
-        else if (i%6 == 4)
-            AddFieldToContactItemL (*newContact, EPbkFieldIdPhoneNumberHome, iParameters->iContactPhoneNumberGeneral->Des());
-        else 
-            AddFieldToContactItemL (*newContact, EPbkFieldIdPhoneNumberWork, iParameters->iContactPhoneNumberGeneral->Des());
-        }
-
-    for (TInt j=0; j<iParameters->iNumberOfURLFields; j++)
-        AddFieldToContactItemL (*newContact, EPbkFieldIdURL, iParameters->iContactURL->Des());
-
-    for (TInt k=0; k<iParameters->iNumberOfEmailAddressFields; k++)
-        AddFieldToContactItemL (*newContact, EPbkFieldIdEmailAddress, iParameters->iContactEmailAddress->Des());
-
-
-    // add the contact item to the database
-	iContactDBEngine->AddNewContactL(*newContact);
-
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-	iContactIds.Append( newContact->Id() );
-
-	CleanupStack::PopAndDestroy(); // newContact
-
-    CompactPbkDatabase();
-
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorPhonebook::CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters) 
-    { 
-    LOGSTRING("Creator: CCreatorPhonebook::CreateGroupEntryL"); 
-
-    // clear any existing parameter definations 
-    if (iParameters) 
-        { 
-        delete iParameters; 
-        iParameters = NULL; 
-        } 
-        
-    // random data needed if no predefined data available 
-    if (!aParameters) 
-        { 
-        iParameters = new(ELeave) CPhonebookParameters; 
-        
-        iParameters->iContactsInGroup = iContactsInGroup; 
-
-        iParameters->iGroupName->Des().Copy( iEngine->RandomString(CCreatorEngine::EGroupName) ); 
-        iParameters->iGroupName->Des().Append( _L(" #") ); 
-        iParameters->iGroupName->Des().AppendNum( iEngine->RandomNumber(1000, 9999) ); 
-        } 
-    else 
-        { 
-        // otherwise replace the parameters object 
-        iParameters = (CPhonebookParameters*) aParameters; 
-        } 
-
-    TInt err(KErrNone); 
-
-    // create contact iterator 
-    CPbkContactIter* contactIter = iContactDBEngine->CreateContactIteratorLC(); 
-    
-    // create contact id array 
-    CContactIdArray* contactIdArray = CContactIdArray::NewLC();  
-
-    // get all contacts    
-    TBool getFirstContact(ETrue); 
-    TContactItemId contactId; 
-    
-    for (;;) 
-        { 
-        if (getFirstContact) 
-            { 
-            // get first contact 
-            contactId = contactIter->FirstL(); 
-            getFirstContact = EFalse; 
-            } 
-        else 
-            { 
-            // get next contact 
-            contactId = contactIter->NextL(); 
-            } 
-        
-        // check if valid contact id received 
-        if (contactId == KNullContactId) 
-            { 
-            // no more contacts, so break 
-            break; 
-            } 
-        else 
-            { 
-            // append to array 
-            contactIdArray->AddL(contactId); 
-            }    
-        } 
-
-    // create a new contact group 
-    CContactGroup* newGroup = iContactDBEngine->CreateContactGroupL( iParameters->iGroupName->Des() ); 
-    CleanupStack::PushL(newGroup); 
-
-    // define amounts of contacts to be added to the group 
-    TInt amountOfContactsToBeAdded; 
-    if (iParameters->iContactsInGroup == KCreateRandomAmountOfGroups) 
-        amountOfContactsToBeAdded = iEngine->RandomNumber(30); 
-    else     
-        amountOfContactsToBeAdded = iParameters->iContactsInGroup; 
-    
-    
-    // a simple way to randomise order of contacts in the array 
-    if (iEngine->RandomNumber(1, 2) == 1) 
-        contactIdArray->ReverseOrder(); 
-    
-    // assign contacts from the array to the group if any contacts available        
-    if (contactIdArray->Count() > 0) 
-        { 
-        // get random start number which defines from which position to start adding contacts 
-        TInt arrayPosCounter = iEngine->RandomNumber(contactIdArray->Count()-1); 
-        TInt addedContacsCounter(0); 
-    
-        for (TInt y=0; y<amountOfContactsToBeAdded; y++) 
-            { 
-            // add contact to group 
-            iContactDBEngine->AddContactToGroupL((*contactIdArray)[arrayPosCounter], newGroup->Id()); 
-            addedContacsCounter++; 
-            arrayPosCounter++; 
-            
-            // no need to add more contacts than actually available 
-            if (addedContacsCounter >= contactIdArray->Count()) 
-                break; 
-
-            // if limit reached, start from the beginning 
-            if (arrayPosCounter >= contactIdArray->Count()) 
-                arrayPosCounter = 0; 
-            } 
-        }
-    
-    // id has been generated, store it for being able to delete
-    // entries created only with Creator
-    iGroupIds.Append( newGroup->Id() );
-    
-    CleanupStack::PopAndDestroy(3); // newGroup, contactIdArray, contactIter 
-
-    CompactPbkDatabase(); 
-
-    return err; 
-    } 
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorPhonebook::CreateSubscribedContactEntryL(CCreatorModuleBaseParameters* /*aParameters*/)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::CreateSubscribedContactEntryL");
-
-    return KErrNotSupported;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorPhonebook::AddFieldToContactItemL(CPbkContactItem& aItem, TPbkFieldId aFieldId, const TDesC& aFieldText)
-	{
-    //LOGSTRING("Creator: CCreatorPhonebook::AddFieldToContactItemL");
-
-    CPbkFieldInfo* fieldInfo = iContactDBEngine->FieldsInfo().Find( aFieldId );
-    if( fieldInfo ) // field was found
-        {
-        // add the field and value to contact
-        TPbkContactItemField* itemField = aItem.AddOrReturnUnusedFieldL( *fieldInfo );
-
-        if( itemField && aFieldText.Length() > 0 ) // add text also
-            {
-            if( itemField->ItemField().StorageType() == KStorageTypeText )
-                {
-		        CContactTextField* textField = itemField->ItemField().TextStorage();
-                
-                // clip the text if it doesn't fit to the field
-	            textField->SetTextL( aFieldText.Left( fieldInfo->MaxLength() ) );
-	    	    }
-    		}
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorPhonebook::CompactPbkDatabase(TBool aCompressImmediately)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::CompactPbkDatabase");
-
-    iOpCounter++;
-
-    // compress the database immediately or after each 100th operation
-    if (aCompressImmediately || iOpCounter%100 == 0)
-        {
-        CContactDatabase& db = iContactDBEngine->Database();
-
-        if (db.CompressRequired())
-            {
-            LOGSTRING("Creator: CCreatorPhonebook::CompactPbkDatabase - Compacting...");
-            TRAP_IGNORE( db.CompactL() );
-            }
-        }
-    }
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllL");
-    DeleteAllItemsL( KUidDictionaryUidContacts );
-    iContactIds.Reset();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContacts );
-    iContactIds.Reset();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsL");
-    DeleteAllItemsL( KUidDictionaryUidContactGroups );
-    iGroupIds.Reset();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContactGroups );
-    iGroupIds.Reset();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllItemsL( TUid aStoreUid )
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteItemsL");
-    __ASSERT_ALWAYS( aStoreUid == KUidDictionaryUidContacts || 
-                     aStoreUid == KUidDictionaryUidContactGroups,
-                     User::Panic( _L("CCreatorPb"), KErrArgument ) );
-    
-    CContactIdArray* allContacts = iContactDBEngine->FindLC( _L("") );
-    
-    CPbkContactItem* item;
-    TInt i(0);
-    // remove that type of item ids from the array
-    // that we don't want to delete
-    while( allContacts && i < allContacts->Count() )
-        {
-        item = iContactDBEngine->ReadContactL( (*allContacts)[i] );
-        if ( ( aStoreUid == KUidDictionaryUidContactGroups ) == 
-             ( item->Type() != KUidContactGroup ) )
-            {
-            allContacts->Remove( i );
-            }
-        else
-            {
-            i++;
-            }
-        delete item;
-        item = NULL;
-        }
-    iContactDBEngine->DeleteContactsL( *allContacts );
-    CleanupStack::PopAndDestroy( allContacts );
-
-    // contacts deleted, remove the store
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    if ( store )
-        {
-        store->Remove( aStoreUid );
-        store->CommitL();        
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteItemsCreatedWithCreatorL( TUid aStoreUid )
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteItemsCreatedWithCreatorL");
-    __ASSERT_ALWAYS( aStoreUid == KUidDictionaryUidContacts || 
-                     aStoreUid == KUidDictionaryUidContactGroups,
-                     User::Panic( _L("CCreatorPb"), KErrArgument ) );
-    
-    iEntriesToDelete.Reset();
-    
-    // fetch ids of entries created by Creator
-    iEngine->ReadEntryIdsFromStoreL( iEntriesToDelete, aStoreUid );
-    
-    // delete entries
-    for ( TInt i = 0; i < iEntriesToDelete.Count(); i++ )
-        {
-        TRAP_IGNORE( iContactDBEngine->DeleteContactL( iEntriesToDelete[i] ) );
-        }
-    
-    iEntriesToDelete.Reset();
-    
-    // all entries deleted, remove the Logs related registry
-    iEngine->RemoveStoreL( aStoreUid );
-    }
--- a/creator/src/creator_phonebookbase.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_phonebookbase.h"
-#include "creator_model.h"
-#include "creator_traces.h"
-
-TBool CCreatorPhonebookBase::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::AskDataFromUserL");
-    
-    if( aCommand == ECmdDeleteContacts )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all contacts?") );
-        }
-    if( aCommand == ECmdDeleteCreatorContacts )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all contacts created with Creator?") ); 
-        }
-    if( aCommand == ECmdDeleteContactGroups )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all contact groups?") );
-        }
-    if( aCommand == ECmdDeleteCreatorContactGroups )
-        {
-        return iEngine->YesNoQueryDialogL(_L("Delete all contact groups created with Creator?") ); 
-        }    
-    // display queries
-    if (iEngine->EntriesQueryDialogL(aNumberOfEntries, _L("How many entries to create?"))) // ask number of entries to create
-        {
-        if (aCommand == ECmdCreatePhoneBookEntryContacts)
-            {
-            TInt index = 0;
-            CAknListQueryDialog* dlg1 = new(ELeave) CAknListQueryDialog(&index);
-            if (dlg1->ExecuteLD(R_CONTACT_CREATION_TYPE_QUERY))
-                {
-                if (index == 0) //first item
-                    {
-                    iDefaultFieldsSelected = ETrue;
-                    return ETrue;    
-                    }
-                else  // detailed mode selected
-                    {
-                    iDefaultFieldsSelected = EFalse;
-                    if (iEngine->EntriesQueryDialogL(iNumberOfPhoneNumberFields, _L("Amount of phone number fields in one contact?"), ETrue))
-                        {
-                        if (iEngine->EntriesQueryDialogL(iNumberOfURLFields, _L("Amount of URL fields in one contact?"), ETrue))
-                            {
-                            if (iEngine->EntriesQueryDialogL(iNumberOfEmailAddressFields, _L("Amount of email fields in one contact?"), ETrue))
-                                {                                
-                                return ETrue;
-                                }
-                            else
-                                return EFalse;
-                            }
-                            else
-                                return EFalse;
-                        }
-                    else
-                        return EFalse;
-                    }
-                }
-            else
-                return EFalse;
-            }
-        else if (aCommand == ECmdCreatePhoneBookEntryGroups)
-            {
-            TInt index = 0;
-            CAknListQueryDialog* dlg1 = new(ELeave) CAknListQueryDialog(&index);
-            if (dlg1->ExecuteLD(R_GROUP_CREATION_TYPE_QUERY))
-                {
-                if (index == 0) //first item
-                    {
-                    iContactsInGroup = KCreateRandomAmountOfGroups;
-                    return ETrue;
-                    }
-                else
-                    {
-                    if (iEngine->EntriesQueryDialogL(iContactsInGroup, _L("Amount of contacts in one group?"), ETrue))
-                        {
-                        return ETrue;
-                        }
-                    else
-                        return EFalse;
-                    }
-                }
-            else
-                return EFalse;
-            }
-        else
-            return ETrue;
-        }
-    else
-        return EFalse;
-    }
-
-void CCreatorPhonebookBase::SetDefaultParameters()
-    {
-    iNumberOfPhoneNumberFields = 1;
-    iNumberOfURLFields = 0;
-    iNumberOfEmailAddressFields = 0;
-    iContactsInGroup = 50;
-    iDefaultFieldsSelected = EFalse;
-    }
--- a/creator/src/creator_randomdataparser.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <f32file.h>
-#include <utf.h>
-#include <xml/documentparameters.h>
-#include "creator_randomdataparser.h"
-#include "creator_traces.h"
-
-// XML element names
-_LIT(KRootElement, "creatordata");
-_LIT(KFirstName, "firstname");
-_LIT(KSurname, "surname");
-_LIT(KCompany, "company");
-_LIT(KAddress, "address");
-_LIT(KJobTitle, "jobtitle");
-_LIT(KPhoneNumber, "phonenumber");
-_LIT(KGroupName, "groupname");
-_LIT(KMeetingReason, "meetingreason");
-_LIT(KMeetingPlace, "meetingplace");
-_LIT(KMemoText, "memo");
-_LIT(KAnniversaryReason, "anniversary");
-_LIT(KToDoText, "todo");
-_LIT(KReminderText, "reminder");
-_LIT(KMessageSubject, "messagesubject");
-_LIT(KMessageText, "messagetext");
-_LIT(KCity, "city");
-_LIT(KCountry, "country");
-_LIT(KPostcode, "postcode");
-_LIT(KState, "state");
-_LIT(KPobox, "pobox");
-_LIT(KPrefix, "prefix");
-_LIT(KSuffix, "suffix");
-_LIT(KLandmarkName, "landmarkname");
-_LIT(KLandmarkDescription, "landmarkdescription");
-
-using namespace Xml;
-
-CCreatorRandomDataParser::CCreatorRandomDataParser() 
-    {        
-    }
-
-void CCreatorRandomDataParser::ConstructL()
-    {
-    LOGSTRING("Creator: CCreatorRandomDataParser::ConstructL");
-	iElementNameArray = new (ELeave) CDesCArrayFlat(32);
-	iElementNameArray->InsertL(EFirstName, KFirstName);
-	iElementNameArray->InsertL(ESurname, KSurname);
-	iElementNameArray->InsertL(ECompany, KCompany);
-	iElementNameArray->InsertL(EAddress, KAddress);
-	iElementNameArray->InsertL(EJobTitle, KJobTitle);
-	iElementNameArray->InsertL(EPhoneNumber, KPhoneNumber);
-	iElementNameArray->InsertL(EGroupName, KGroupName);
-	iElementNameArray->InsertL(EMeetingReason, KMeetingReason);
-	iElementNameArray->InsertL(EMeetingPlace, KMeetingPlace);
-	iElementNameArray->InsertL(EMemoText, KMemoText);
-	iElementNameArray->InsertL(EAnniversaryReason, KAnniversaryReason);
-	iElementNameArray->InsertL(EToDoText, KToDoText);
-	iElementNameArray->InsertL(EReminderText, KReminderText);
-	iElementNameArray->InsertL(EMessageSubject, KMessageSubject);
-	iElementNameArray->InsertL(EMessageText, KMessageText);
-	iElementNameArray->InsertL(ECity, KCity);
-	iElementNameArray->InsertL(ECountry, KCountry);
-	iElementNameArray->InsertL(EPostcode, KPostcode);
-	iElementNameArray->InsertL(EState, KState);
-	iElementNameArray->InsertL(EPobox, KPobox);
-	iElementNameArray->InsertL(EPrefix, KPrefix);
-	iElementNameArray->InsertL(ESuffix, KSuffix);
-	iElementNameArray->InsertL(ELandmarkName, KLandmarkName);
-	iElementNameArray->InsertL(ELandmarkDescription, KLandmarkDescription);
-	iContentData = HBufC::NewL(16);
-    iResultArray = new (ELeave) CDesCArrayFlat(16);
-    }
-
-CCreatorRandomDataParser* CCreatorRandomDataParser::NewL()
-    {
-    LOGSTRING("Creator: CCreatorRandomDataParser::NewL");
-    CCreatorRandomDataParser* self = CCreatorRandomDataParser::NewLC();    
-    CleanupStack::Pop();
-    return self;
-    }
-
-CCreatorRandomDataParser* CCreatorRandomDataParser::NewLC()
-    {
-    LOGSTRING("Creator: CCreatorRandomDataParser::NewLC");
-    CCreatorRandomDataParser* self = new (ELeave) CCreatorRandomDataParser;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CCreatorRandomDataParser::~CCreatorRandomDataParser()
-    {
-    delete iParser;
-    delete iResultArray;
-    delete iContentData;
-    delete iElementNameArray;
-    }
-
-void CCreatorRandomDataParser::GetTextFileMode(RFile& aFile, TInt& aFileSize) 
-    { 
-    LOGSTRING("Creator: CCreatorRandomDataParser::GetTextFileMode");
-    iScriptTextFormat = EFormatANSIASCII; 
-
-    // if we are working with text files, check the type first   
-    TBuf8<4> BOM; 
-
-    // first check for UTF-16 
-    if (aFileSize >= 2 && aFile.Read(0, BOM, 2) == KErrNone) 
-        { 
-        if (BOM.Length()==2 && BOM[0]==0xFF && BOM[1]==0xFE) 
-            { 
-            iScriptTextFormat = EFormatUTF16LE; 
-            aFileSize -= 2; 
-            return; 
-            } 
-        else if (BOM.Length()==2 && BOM[0]==0xFE && BOM[1]==0xFF) 
-            { 
-            iScriptTextFormat = EFormatUTF16BE; 
-            aFileSize -= 2; 
-            return;                 
-            }       
-        }
-        // then check for UTF-8 
-    if (aFileSize >= 3 && aFile.Read(0, BOM, 3) == KErrNone) 
-        { 
-        if (BOM.Length()==3 && BOM[0]==0xEF && BOM[1]==0xBB && BOM[2]==0xBF) 
-            { 
-            iScriptTextFormat = EFormatUTF8; 
-            aFileSize -= 3; 
-            return; 
-            } 
-        }
-        
-    // none of those, seek back to beginning 
-    TInt pos(0); 
-    aFile.Seek(ESeekStart, pos); 
-    }    
- 
-
-
-CDesCArrayFlat* CCreatorRandomDataParser::ParseL(const TDesC& aFileName, const TRandomDataType aDataType)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::ParseL: %S", &aFileName);
-    
-    iDataType = aDataType;
-    
-    // Create and start XML-parser
-    if( iParser == 0)
-        {
-        _LIT8(KXmlMimeType, "text/xml");
-        iParser = CParser::NewL(KXmlMimeType, *this);        
-        }
-
-    RFs filesession;
-    CleanupClosePushL(filesession);
-    User::LeaveIfError( filesession.Connect() );
-    
-    iResultArray->Reset();
-    
-    Xml::ParseL(*iParser, filesession, aFileName);
-    
-    CleanupStack::PopAndDestroy(&filesession); // filesession 
-    
-    CDesCArrayFlat* tempArray = new (ELeave) CDesCArrayFlat(8);
-    CleanupStack::PushL(tempArray);
-    for (TInt i = 0; i < iResultArray->MdcaCount(); i++)
-    	{
-    	tempArray->AppendL(iResultArray->MdcaPoint(i));
-    	}
-    CleanupStack::Pop(tempArray);
-    return tempArray;
-    }
-
-void CCreatorRandomDataParser::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartDocumentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);    
-    iInsideRootElement = EFalse;
-	iContentParsingActive = EFalse;
-    }
-
-void CCreatorRandomDataParser::OnEndDocumentL(TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndDocumentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnStartPrefixMappingL(const RString& /*aPrefix*/, 
-                                                     const RString& /*aUri*/, 
-                                                     TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnProcessingInstructionL(const TDesC8& /*aTarget*/, 
-                                                        const TDesC8& /*aData*/, 
-                                                        TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorRandomDataParser::OnError(TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnError: %d", aErrorCode);
-    
-    iLastError = aErrorCode;
-    }
-
-TAny* CCreatorRandomDataParser::GetExtendedInterface(const TInt32 aUid)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::GetExtendedInterface (UID: %d)", aUid);
-    return this;
-    }
-
-void CCreatorRandomDataParser::OnStartElementL(const Xml::RTagInfo& aElement,
-                                               const Xml::RAttributeArray& /*aAttributes*/,
-                                               TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnStartElementL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-
-    const TDesC8& elementName8 = aElement.LocalName().DesC();        
-    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
-    if (iInsideRootElement || (elementName16->Des() == KRootElement))
-    	{
-    	iInsideRootElement = ETrue;
-    	}
-    if (iInsideRootElement && (elementName16->Des() == iElementNameArray->MdcaPoint(iDataType)))
-    	{
-        iContentParsingActive = ETrue;
-        iContentData->Des().Zero();
-    	}
-    CleanupStack::PopAndDestroy(elementName16);
-    }
-
-void CCreatorRandomDataParser::OnEndElementL(const Xml::RTagInfo& aElement, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnEndElementL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-
-    const TDesC8& elementName8 = aElement.LocalName().DesC();
-    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
-    if (!iInsideRootElement || (elementName16->Des() == KRootElement))
-    	{
-    	iInsideRootElement = EFalse;
-    	}
-    CleanupStack::PopAndDestroy(elementName16);
-
-    if (iContentParsingActive)
-		{
-	    if (iContentData->Des().Length() > 0)
-	    	{
-	    	iResultArray->AppendL(*iContentData);
-	    	}
-        iContentParsingActive = EFalse;
-		}
-    }
-
-void CCreatorRandomDataParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorRandomDataParser::OnContentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    
-    if (iContentParsingActive)
-    	{
-        HBufC* data16 = Convert8BitTo16BitLC(aBytes);
-        TInt newLen = iContentData->Des().Length() + data16->Des().Length();
-        iContentData = iContentData->ReAllocL(newLen);
-        iContentData->Des().Append(*data16);
-        CleanupStack::PopAndDestroy(data16);
-    	}
-    }
-
-HBufC16* CCreatorRandomDataParser::Convert8BitTo16BitLC(const TDesC8& aInput) 
-    {     
-    LOGSTRING("Creator: CCreatorRandomDataParser::Convert8BitTo16BitLC");
-    HBufC16* output = NULL;
-    
-    output = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aInput);
-    
-    CleanupStack::PushL(output);
-    return output;          
-    } 
-
-TInt CCreatorRandomDataParser::GetError() const 
-	{
-    return iLastError;
-	}
--- a/creator/src/creator_scriptelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,721 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_traces.h"
-#include "creator_scriptelement.h"
-#include <xml/documentparameters.h>
-#include <collate.h>
-#include <etel3rdparty.h> // KMaxTelNumberSize
-
-using namespace Xml;
-
-CCreatorScriptElementCache* CCreatorScriptElementCache::NewL()
-{
-    CCreatorScriptElementCache* self = new (ELeave) CCreatorScriptElementCache;
-    CleanupStack::PushL(self);
-    
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-}
-
-CCreatorScriptElementCache::CCreatorScriptElementCache()
-    {
-    
-    }
-
-void CCreatorScriptElementCache::ConstructL()
-    {
-    
-    }
- 
-CCreatorScriptElementCache::~CCreatorScriptElementCache()
-    {
-    iElementCache.Reset();
-    iElementCache.Close();
-    }
-    
-void CCreatorScriptElementCache::RemoveElements()
-    {
-    iElementCache.Reset();
-    }
-
-        
-void CCreatorScriptElementCache::AddElementL(CCreatorScriptElement* aElement)
-    {
-    iElementCache.AppendL(aElement);
-    }
-
-/**
- * 
- */
-CCreatorScriptAttribute* CCreatorScriptAttribute::NewLC(const TDesC& aName, const TDesC& aValue)
-    {
-    CCreatorScriptAttribute* self = new(ELeave) CCreatorScriptAttribute();
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aValue);
-    return self;
-    }
-
-CCreatorScriptAttribute* CCreatorScriptAttribute::NewL(const TDesC& aName, const TDesC& aValue)
-    {
-    CCreatorScriptAttribute* self = CCreatorScriptAttribute::NewLC(aName, aValue);
-    CleanupStack::Pop(); // self    
-    return self;
-    }
-
-CCreatorScriptAttribute::~CCreatorScriptAttribute()
-    {
-    delete iName;
-    delete iValue;
-    }
-    
-TPtrC CCreatorScriptAttribute::Name() const
-    {
-    return iName->Des();
-    }
-
-void CCreatorScriptAttribute::SetNameL(const TDesC& aName) 
-    {
-    if( iName )
-        {
-        delete iName;
-        iName = 0;
-        }    
-    iName = HBufC::NewL(aName.Length());
-    iName->Des() = aName; 
-    }       
-    
-TPtrC CCreatorScriptAttribute::Value() const
-    {
-    return iValue->Des();
-    }
-
-void CCreatorScriptAttribute::SetValueL(const TDesC& aValue)
-    {
-    if( iValue )
-        {
-        delete iValue;
-        iValue = 0;
-        }
-    iValue = HBufC::NewL(aValue.Length());
-    iValue->Des() = aValue; 
-    }   
-
-CCreatorScriptAttribute::CCreatorScriptAttribute()
-    {    
-    }
-
-void CCreatorScriptAttribute::ConstructL(const TDesC& aName, const TDesC& aValue)
-    {
-    SetNameL(aName);
-    SetValueL(aValue);
-    }
-
-/**
- * CCreatorScriptElement
- */
-
-CCreatorScriptElement* CCreatorScriptElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    CCreatorScriptElement* self = new (ELeave) CCreatorScriptElement(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-
-CCreatorScriptElement::~CCreatorScriptElement()
-    {
-    LOGSTRING("Creator: CCreatorScriptElement::~CCreatorScriptElement");
-    iSubElements.ResetAndDestroy();
-    iAttributes.ResetAndDestroy();
-    iSubElements.Close();
-    iAttributes.Close();
-    iParameters.Reset();
-    iParameters.Close();
-    delete iName;
-    delete iContent;
-    delete iContext;
-    }
-
-RPointerArray<CCreatorScriptElement> const& CCreatorScriptElement::SubElements() const
-    {
-    return iSubElements;
-    }
-
-RPointerArray<CCreatorScriptElement>& CCreatorScriptElement::SubElements()
-    {
-    return iSubElements;
-    }
-    
-CCreatorScriptElement* CCreatorScriptElement::SubElement(TInt aIndex)
-    {
-    return iSubElements[aIndex];
-    }
-
-CCreatorScriptElement* CCreatorScriptElement::FindSubElement(const TDesC& aName)
-    {
-    for( TInt i = 0; i < iSubElements.Count(); ++i )
-        {
-        if( iSubElements[i]->Name() == aName )
-            {
-            return iSubElements[i];
-            }            
-        }
-    return 0;
-    }
-    
-void CCreatorScriptElement::RemoveSubElements()
-    {
-    iSubElements.ResetAndDestroy();
-    }
-    
-void CCreatorScriptElement::RemoveSubElementL(TInt aIndex)
-    {
-    if( aIndex < iSubElements.Count())
-        {
-        delete iSubElements[aIndex];
-        iSubElements.Remove(aIndex);
-        }
-    else
-        {
-        User::Leave(KErrArgument);
-        }
-    }
-    
-void CCreatorScriptElement::AddSubElementL(CCreatorScriptElement* aElem, TInt aIndex )
-    {
-    if( aIndex == -1 || aIndex == iSubElements.Count() )
-        {
-        iSubElements.AppendL(aElem);
-        }
-    else if( aIndex < iSubElements.Count())
-        {
-        iSubElements.Insert(aElem, aIndex);
-        }
-    else
-        {
-        User::Leave(KErrArgument);
-        }
-    }
-  
-RPointerArray<CCreatorScriptAttribute> const& CCreatorScriptElement::Attributes() const
-    {
-    return iAttributes;
-    }
-
-        
- CCreatorScriptAttribute* CCreatorScriptElement::Attribute(TInt aIndex)
-     {
-     return iAttributes[aIndex];
-     }
-    
-void CCreatorScriptElement::RemoveAttributes()
-    {
-    iAttributes.ResetAndDestroy();
-    }
-    
- 
-void CCreatorScriptElement::RemoveAttributeL(TInt aIndex)
-    {
-    if( aIndex < iAttributes.Count())
-        {
-        delete iAttributes[aIndex];
-        iAttributes.Remove(aIndex);
-        }
-    else
-        {
-        User::Leave(KErrArgument);
-        }
-    }
- 
-void CCreatorScriptElement::AddAttributeL(CCreatorScriptAttribute* aAttribute, TInt aIndex )
-    {
-    if( aIndex == -1 || aIndex == iAttributes.Count() )
-        {
-        iAttributes.AppendL(aAttribute);
-        }
-    else if( aIndex < iAttributes.Count())
-        {
-        iAttributes.Insert(aAttribute, aIndex);        
-        }
-    else
-        {
-        User::Leave(KErrArgument);
-        }
-    }
-
-TPtrC CCreatorScriptElement::Name() const
-    {
-    if( iName )
-        return iName->Des();
-    return TPtrC();
-    }
-
-void CCreatorScriptElement::SetNameL(const TDesC& aName)
-    {
-    if( iName )
-        {
-        delete iName;
-        iName = 0;
-        }    
-    iName = HBufC::NewL(aName.Length());
-    iName->Des() = aName; 
-    }
-
- 
-TPtrC CCreatorScriptElement::Content() const
-    {
-    if (iContent)
-        return iContent->Des();
-    return TPtrC();
-    }
-    
-void CCreatorScriptElement::SetContentL(const TDesC& aContent)
-    {
-    if( iContent )
-        {
-        delete iContent;
-        iContent = 0;
-        }    
-    iContent = HBufC::NewL(aContent.Length());
-    iContent->Des() = aContent;
-    }
-
-void CCreatorScriptElement::AppendContentL(const TDesC& aContent)
-    {
-    if( iContent == 0 )
-        {
-        SetContentL(aContent);
-        return;
-        }
-            
-    iContent = iContent->ReAllocL(iContent->Length() + aContent.Length() );
-    
-    TPtr ptr(iContent->Des());
-    ptr += aContent;
-    }
-
-TPtrC CCreatorScriptElement::Context() const
-    {
-    if( iContext )
-        return iContext->Des();
-    return TPtrC();
-    }
-    
-void CCreatorScriptElement::SetContextL(const TDesC& aContext)
-    {
-    if( iContext )
-        {
-        delete iContext;
-        iContext = 0;
-        }    
-    iContext = HBufC::NewL(aContext.Length());
-    iContext->Des() = aContext;
-    }
-
-const CCreatorScriptAttribute* CCreatorScriptElement::FindAttributeByName(const TDesC& aName) const
-    {
-    for( TInt i = 0; i < iAttributes.Count(); ++i )
-        {
-        CCreatorScriptAttribute* attr = iAttributes[i];
-        if( attr->Name() == aName )
-            {
-            return attr;
-            }
-        }
-    return 0;
-    }
-
-CCreatorScriptAttribute* CCreatorScriptElement::FindAttributeByName(const TDesC& aName)
-    {    
-    for( TInt i = 0; i < iAttributes.Count(); ++i )
-        {
-        CCreatorScriptAttribute* attr = iAttributes[i];
-        if( attr->Name() == aName )
-            {
-            return attr;
-            }
-        }
-    return 0;
-    }
-
-TBool CCreatorScriptElement::IsCacheNeeded()
-    {
-    _LIT(KIDAttrName, "id");
-    const CCreatorScriptAttribute* attr = FindAttributeByName(KIDAttrName);
-    return attr != 0;
-    }
-
-void CCreatorScriptElement::AddToCacheL(CCreatorScriptElementCache& aCache)
-    {
-    aCache.AddElementL(this);
-    }
-
-RPointerArray<CCreatorModuleBaseParameters>& CCreatorScriptElement::CommandParameters()
-    {
-    return iParameters;
-    }
-
-const RPointerArray<CCreatorModuleBaseParameters>& CCreatorScriptElement::CommandParameters() const
-    {
-    return iParameters;
-    }
-
-void CCreatorScriptElement::AddToCacheL()
-    {    
-    }
-
-TBool CCreatorScriptElement::IsCommandElement() const
-    {
-    return iIsCommandElement;
-    }
-
-void CCreatorScriptElement::ExecuteCommandL()
-    {
-    
-    }
-   
-TBool CCreatorScriptElement::IsRoot() const
-    {
-    _LIT(KRootName, "creatorscript");
-    if(iName->Des() == KRootName)
-        return ETrue;
-    return EFalse;
-    }
-
-CCreatorScriptElement::CCreatorScriptElement(CCreatorEngine* aEngine)
-: 
-iIsCommandElement(EFalse),
-iIsRoot(EFalse),
-iEngine(aEngine)
-    {}
-    
-void CCreatorScriptElement::ConstructL(const TDesC& aName, const TDesC& aContext)
-    {
-    SetNameL(aName);
-    SetContextL(aContext);
-    }
-    
-TBool CCreatorScriptElement::IsSubElementSupported(const CCreatorScriptElement& /*aElem*/) const
-    {
-    return ETrue;
-    }
-
-TBool CCreatorScriptElement::ConvertStrToBooleanL(const TDesC& aStr) const
-    {
-    TBool boolVal = EFalse;
-    _LIT(KYes, "yes");
-    _LIT(KTrue, "true");
-    if( CompareIgnoreCase(aStr, KYes) == 0 ||
-        CompareIgnoreCase(aStr, KTrue) == 0 )
-        {
-        boolVal = ETrue;
-        }    
-    return boolVal;
-    }
-
-TInt CCreatorScriptElement::ConvertStrToIntL(const TDesC& aStr) const
-    {
-    TInt intVal = 0;
-    TLex lex(aStr);
-    TInt errorCode=lex.Val(intVal);
-    User::LeaveIfError(errorCode);
-    return intVal;
-    }
-
-TUint CCreatorScriptElement::ConvertStrToUintL(const TDesC& aStr) const
-	{
-	TUint uintVal = 0;
-	TLex lex(aStr);
-	TInt errorCode=lex.Val(uintVal);
-	User::LeaveIfError(errorCode);
-	return uintVal;
-	}
-void CCreatorScriptElement::ConvertStrToReal64L(const TDesC& aStr, TReal64& aVal) const
-    {    
-    TLex lex(aStr);
-    TInt errorCode=lex.Val(aVal);
-    User::LeaveIfError(errorCode);    
-    }
-
-void CCreatorScriptElement::ConvertStrToReal32L(const TDesC& aStr, TReal32& aVal) const
-    {    
-    TLex lex(aStr);
-    TInt errorCode=lex.Val(aVal);
-    User::LeaveIfError(errorCode);    
-    }
-
-MCreatorRandomDataField::TRandomLengthType CCreatorScriptElement::ResolveRandomDataTypeL(const CCreatorScriptAttribute& aAttr, TInt& aRandomLen) const
-    {    
-    TPtrC attrVal = aAttr.Value();
-    if(attrVal == KMax )
-        return MCreatorRandomDataField::ERandomLengthMax;
-    if(attrVal == KDefault)
-        return MCreatorRandomDataField::ERandomLengthDefault;
-    
-    // Let's see if the value is numeric:
-    TInt val = 0;
-    TLex lex(attrVal);
-    TInt errorCode=lex.Val(val);
-    if( errorCode == KErrNone )   
-        {
-        aRandomLen = val;
-        return MCreatorRandomDataField::ERandomLengthExplicit;
-        }
-    return MCreatorRandomDataField::ERandomLengthUndefined;
-    }
-
-void CCreatorScriptElement::AppendContactSetReferenceL(
-        const CCreatorScriptElement& aContactSetRefElem, 
-        RArray<TLinkIdParam>& aLinkArray ) const
-        {
-        const TDesC& eName = aContactSetRefElem.Name();
-        if( eName != KContactSetRef )
-            return;
-        
-        const CCreatorScriptAttribute* linkIdAttr = aContactSetRefElem.FindAttributeByName(KId);
-        if( linkIdAttr )
-            {
-            TInt linkId = ConvertStrToIntL(linkIdAttr->Value());
-            if( linkId > 0 )
-                {
-                TLinkIdParam linkParams;
-                // Add contact-set-reference id to links
-                linkParams.iLinkId = linkId;
-                linkParams.iLinkAmount = KUndef; // undefined
-                // Resolve maxamount:
-                const CCreatorScriptAttribute* maxAmount = aContactSetRefElem.FindAttributeByName(KMaxAmount);
-                if( maxAmount )
-                    {                                
-                    TInt maxAmountVal = ConvertStrToIntL(maxAmount->Value());
-                    if( maxAmountVal > 0 )
-                        {
-                        linkParams.iLinkAmount = maxAmountVal;
-                        }
-                    }
-                aLinkArray.AppendL(linkParams);
-                }
-            }
-        }       
-
-TTime CCreatorScriptElement::ConvertToDateTimeL(const TDesC& aDtStr) const
-    {
-    _LIT(KDateFieldSeparator, "-");
-    _LIT(KTimeFieldSeparator, ":");    
-    _LIT(KDateTimeSeparator, "T");    
-    _LIT(KTimeSuffix, ".");
-    _LIT(KDateSuffix, ":");
-    // Format date-time string:
-    HBufC* formatted = HBufC::NewLC(aDtStr.Length());
-    formatted->Des().Copy(aDtStr);
-    
-    TBool hasTimePart = EFalse; 
-    TBool hasDateTimeSeparator = EFalse;
-    TInt pos = 0;
-    
-    // Date and month numbering starts from 0 in Symbian, so first
-    // we need to decrease the date and month by one. Script format is following:
-    // yyyy-mm-ddThh:mm:ss
-    // Remove also date field separators ('-')
-    while( (pos = formatted->Find(KDateFieldSeparator)) != KErrNotFound )
-        {
-        // decrease month or date by one
-        
-        // First char. Can be zero also:
-        TInt newValue = 0;
-        const TPtrC& char1 = formatted->Des().Mid(pos+1).Left(1);
-        newValue = 10 * ConvertStrToIntL(char1);
-        // Next char:
-        const TPtrC& char2 = formatted->Des().Mid(pos+2).Left(1);
-        newValue += ConvertStrToIntL(char2);
-       
-        if( newValue > 0 )
-            {
-            --newValue;
-            }
-        
-        _LIT(KTemp, "%d");
-        HBufC* formatBuf = KTemp().AllocLC();
-        HBufC* buf = 0;
-        if( newValue < 10 )
-            buf = HBufC::NewLC(1);            
-        else
-            buf = HBufC::NewLC(2);
-                        
-        TPtr temp(buf->Des());
-        temp.Format(*formatBuf, newValue);
-        if( newValue < 10 )
-            {
-            formatted->Des()[pos+1] = TChar('0');
-            formatted->Des()[pos+2] = buf->Des()[0];
-            }
-        else
-            {
-            formatted->Des()[pos+1] = buf->Des()[0];
-            formatted->Des()[pos+2] = buf->Des()[1];
-            }
-        // Finally, delete the '-' separator:
-        formatted->Des().Delete(pos, 1);        
-        CleanupStack::PopAndDestroy(2);
-        }
-    
-    while( (pos = formatted->Find(KTimeFieldSeparator)) != KErrNotFound )
-        {
-        formatted->Des().Delete(pos, 1);
-        hasTimePart = ETrue;
-        }
-    
-    // Replace 'T' with ':':
-    if( (pos = formatted->Find(KDateTimeSeparator)) != KErrNotFound )
-        {
-        formatted->Des().Replace(pos, 1, KDateSuffix);
-        hasDateTimeSeparator = ETrue;
-        }
-    
-    if( hasTimePart )
-        formatted->Des().Append(KTimeSuffix);
-    else if( !hasDateTimeSeparator )
-        formatted->Des().Append(KDateSuffix);
-    
-    
-    TTime ret;
-    ret.Set(*formatted);    
-    CleanupStack::PopAndDestroy(); // formatted
-    return ret;
-    }
-
-TInt CCreatorScriptElement::CompareIgnoreCase(const TDesC& aStr1, const TDesC& aStr2 ) const
-    {
-    // Get default collation method:
-    TCollationMethod defaultCollationMethod = *Mem::CollationMethodByIndex(0); 
-    
-    // Add ignore case flag:
-    defaultCollationMethod.iFlags |= TCollationMethod::EFoldCase;
-    
-    return aStr1.CompareF(aStr2);
-    }
-
-void CCreatorScriptElement::SetContentToTextParamL(HBufC*& aPtr, const TDesC& aContent )
-    {
-    delete aPtr;
-    aPtr = 0;
-    aPtr = HBufC::NewL(aContent.Length());
-    aPtr->Des().Copy(aContent);
-    }
-
-/**
- * Increases phonenumber by aDelta.
- */
-void CCreatorScriptElement::IncreasePhoneNumL( const TDesC& aOriginal, TInt aDelta, HBufC* aIncreased ) const
-    {
-    LOGSTRING("Creator: CCreatorMessageElement::IncreasePhoneNumL");
-    __ASSERT_ALWAYS( aDelta >= 0, User::Panic( _L("IncreasePhoneNumL"), KErrArgument ) );
-    
-    // special cases, that are handled:
-    // +9          -> +9, +10, +11...
-    // +3584098#99 -> +3584098#99, +3584098#100, +3584098#101...
-    // #           -> #0, #1, #2...
-    // 123#        -> 123#0, 123#1, 123#2... 
-    // 099         -> 099, 100, 101...
-    
-    // find out if there are any special characters, like # p or *, in the original number
-    TInt startIndex( aOriginal.Length() -1 );
-    while ( startIndex >= 0 && 
-            aOriginal[startIndex] >= '0' &&
-            aOriginal[startIndex] <= '9' )
-        {
-        startIndex--;
-        }
-    startIndex++;
-    
-    // append original head that may contain any non number characters 
-    aIncreased->Des().Append( aOriginal.Left( startIndex ) );
-    
-    TBuf<CTelephony::KMaxTelNumberSize> tailBuf;
-    if ( aOriginal.Length() > startIndex )
-        {
-        tailBuf.Copy( aOriginal.Right( aOriginal.Length() -startIndex ) );
-        }
-    
-    // parse the tail part of the original number
-    TInt64 intVal = 0;
-    if ( aOriginal.Length() > startIndex )
-        {
-        TLex lex( tailBuf );
-        User::LeaveIfError( lex.Val( intVal ) ); // this loses leading zeros
-        }
-    
-    // increase
-    intVal += aDelta;
-    
-    // restore leading zeros to tail, if any
-    TBuf<CTelephony::KMaxTelNumberSize> resultTailNoZeros;
-    resultTailNoZeros.AppendNum( intVal );
-    TInt tailLeadingZerosToRestore = tailBuf.Length() - resultTailNoZeros.Length();
-    for ( TInt i = 0; i < tailLeadingZerosToRestore; i++ )
-        {
-        aIncreased->Des().AppendNum( 0 );
-        }
-
-    // and finally, append the increased value as tail part of the result
-    aIncreased->Des().Append( resultTailNoZeros );    
-    }
-
-CCreatorScriptRoot* CCreatorScriptRoot::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    CCreatorScriptRoot* self = new (ELeave) CCreatorScriptRoot(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorScriptRoot::CCreatorScriptRoot(CCreatorEngine* aEngine)
-:
-CCreatorScriptElement(aEngine)
-    {
-    iIsRoot=ETrue;
-    }
-
-
-CCreatorCalendarElementBase* CCreatorCalendarElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    CCreatorCalendarElementBase* self = new (ELeave) CCreatorCalendarElementBase(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorCalendarElementBase::CCreatorCalendarElementBase(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    { }
-
-CCreatorMessageElementBase* CCreatorMessageElementBase::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext)
-    {
-    CCreatorMessageElementBase* self = new (ELeave) CCreatorMessageElementBase(aEngine);
-    CleanupStack::PushL(self);
-    self->ConstructL(aName, aContext);
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorMessageElementBase::CCreatorMessageElementBase(CCreatorEngine* aEngine) 
-: 
-CCreatorScriptElement(aEngine)
-    { }
--- a/creator/src/creator_scriptelementfactory.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_traces.h"
-#include "creator_scriptelementfactory.h"
-#include "creator_contactelement.h"
-#include "creator_calendarelement.h"
-#include "creator_messageelement.h"
-#include "creator_fileelement.h"
-#include "creator_browserelement.h"
-#include "creator_logelement.h"
-#include "creator_noteelement.h"
-#include "creator_impselement.h"
-#include "creator_landmarkelement.h"
-#include "creator_mailboxelement.h"
-#include "creator_connectionmethodelement.h"
-
-CCreatorScriptElement* TCreatorScriptElementFactory::CreateElementL(CCreatorEngine* aEngine, const TDesC& aElementName, const TDesC& aContext )
-    {   
-    LOGSTRING2("TCreatorScriptElementFactory::CreateElementL: %S", &aElementName);
-    
-    if( aContext.Length() >= KFields().Length() && 
-    	aContext.Right(KFields().Length()) == KFields)
-    	{
-    	// This is a field element under 'fields'.
-    	return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
-    	}    
-    else if( aElementName == creatorcontact::KContact )
-        {
-        return CCreatorContactElement::NewL(aEngine, aElementName, aContext);  
-        }
-    else if( aElementName == creatorcontact::KContactSet)
-        {
-        return CCreatorContactSetElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorcontact::KContactGroup )
-        {
-        return CCreatorContactGroupElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == KFields)
-        {
-        return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == KScript )
-        {
-        return CCreatorScriptRoot::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorcalendar::KCalendar )
-        {
-        return CCreatorCalendarElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatormsg::KMessage )
-        {
-        return CCreatorMessageElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorfile::KFile )
-        {
-        return CCreatorFileElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorbrowser::KBookmark ||
-            aElementName == creatorbrowser::KBookmarkFolder ||
-            aElementName == creatorbrowser::KSavedPage ||
-            aElementName == creatorbrowser::KSavedPageFolder )
-        {
-        return CCreatorBrowserElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorlog::KLog )
-        {
-        return CCreatorLogElement::NewL(aEngine, aElementName, aContext);
-        }
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    else if( aElementName == creatornote::KNote )
-        {
-        return CCreatorNoteElement::NewL(aEngine, aElementName, aContext);
-        }
-#endif
-#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
-    #ifdef __PRESENCE
-    else if( aElementName == creatorimps::KImpsServer )
-        {
-        return CCreatorImpsServerElement::NewL(aEngine, aElementName, aContext);
-        }
-	#endif // __PRESENCE
-#endif    
-    else if( aElementName == creatorlandmark::KLandmark )
-        {
-        return CCreatorLandmarkElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatormailbox::Kmailbox )
-        {
-        return CCreatorMailboxElement::NewL(aEngine, aElementName, aContext);
-        }
-    else if( aElementName == creatorconnectionmethod::KCm )
-    	{
-    	return CCreatorConnectionMethodElement::NewL(aEngine, aElementName, aContext);
-    	}
-    else
-        {
-        return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
-        }       
-    }
--- a/creator/src/creator_scriptentry.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,728 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_model.h"
-#include "creator_traces.h"
-#include "creator_factory.h"
-
-#include <aknlists.h> 
-#include <AknsSkinInstance.h>
-
-
-#include <data_caging_path_literals.hrh>
-
-
-const TInt KReadBufSize = 8192;
-
-// Creator random data file filter
-_LIT(KRandomDataFileFilter, "*.creatordataxml");
-
-// ---------------------------------------------------------------------------
-
-
-CCommandParser* CCommandParser::NewL(CCreatorEngine* aEngine)
-    {
-    CCommandParser* self = CCommandParser::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCommandParser* CCommandParser::NewLC(CCreatorEngine* aEngine)
-    {
-    CCommandParser* self = new (ELeave) CCommandParser;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCommandParser::CCommandParser()
-	{
-	}
-
-void CCommandParser::ConstructL(CCreatorEngine* aEngine)
-	{
-    LOGSTRING("Creator: CCommandParser::ConstructL");
-
-    iEngine = aEngine;
-
-    iReadBuf = HBufC8::NewL(KReadBufSize);
-	}
-
-CCommandParser::~CCommandParser()
-	{
-    LOGSTRING("Creator: CCommandParser::~CCommandParser");
-
-    if (iSearchArray)
-        delete iSearchArray;
-
-    if (iReadBuf)
-        delete iReadBuf;
-	}
-
-
-// ---------------------------------------------------------------------------
-//#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-void CCommandParser::OpenScriptL() {}
-TBool CCommandParser::OpenScriptL(RFile& aScriptFile)
-    {    
-    LOGSTRING("Creator: CCommandParser::OpenScriptL");
-    TBool ret = EFalse;
-
-    // init the search array
-    iSearchArray = new(ELeave) CDesCArrayFlat(500);
-
-    // wait dialog
-    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
-    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
-
-
-    // search all the .creator files from the phone
-    TInt err;
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\")));
-
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\system\\apps\\Creator\\")));
-
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\data\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\data\\")));
-    
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\documents\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\documents\\")));
-
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\creator\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\creator\\")));
-    
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\scripts\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\scripts\\")));
-    
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\temp\\")));
-    
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\system\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\system\\temp\\")));
-
-    TRAP(err, FindFiles(_L("*.creatorxml"), _L("\\private\\20011383\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\private\\20011383\\")));
-
-    TRAP(err, FindFilesRecursiveL(_L("*.creatorxml"), _L("\\private\\1000484b\\")));
-
-
-    // remove the wait dialog
-    waitDialog->CancelNoteL(dialogId);
-    CleanupStack::PopAndDestroy(); //waitDialog;
-
-
-    if ( iSearchArray->MdcaCount() > 0)
-        {
-        // create a file name array based on the iSearchArray
-        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount());
-        CleanupStack::PushL(fileNameArray);
-        
-        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
-            {
-            
-            TParse filename; // file name parser
-            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
-
-            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
-                {
-                TFileName nameMMC;
-                nameMMC.Append(filename.Name());
-                nameMMC.Append(_L("\t0"));        // MMC icon
-                fileNameArray->AppendL(nameMMC);
-                }
-            else
-                {
-                fileNameArray->AppendL(filename.Name());
-                }
-            }
-        CleanupStack::Pop(fileNameArray);
-
-
-        // create a popup list
-        CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
-        CleanupStack::PushL(listBox);
-        CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
-        CleanupStack::PushL(popupList);
-        popupList->SetTitleL(_L("Select script"));
-        listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
-        listBox->CreateScrollBarFrameL( ETrue );
-        listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        listBox->Model()->SetItemTextArray( fileNameArray );
-        listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
-        listBox->HandleItemAdditionL();
-
-
-        // define MMC icon 
-        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-        _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
-        CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
-        listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
-
-        TParse* fp = new(ELeave) TParse();
-        fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
-        TFileName resourceFileName( fp->FullName() );
-        delete fp;
-
-        CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
-            resourceFileName,
-            EMbmAknmemorycarduiQgn_indi_mmc_add,
-            EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
-        CleanupStack::PushL( icon );
-        iconArray->AppendL( icon );
-        CleanupStack::Pop( icon );
-
-
-        // execute dialog
-        TBool result = popupList->ExecuteLD();
-        CleanupStack::Pop();  // popupList
-
-        if ( result ) 
-            {
-            // open the file for reading
-            //RFile file;
-            TRAPD(err, aScriptFile.Open(CEikonEnv::Static()->FsSession(), iSearchArray->MdcaPoint(listBox->CurrentItemIndex()), EFileRead));
-            if( err != KErrNone)
-                {
-                aScriptFile.Close();
-                User::Leave(err);
-                }
-            ret = ETrue;
-            }
-        CleanupStack::PopAndDestroy();  //listBox
-        }
-    else  // no scripts found from the search paths
-        {
-        CAknInformationNote* note = new (ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("No scripts found"));
-        }
-
-    delete iSearchArray;
-    iSearchArray = NULL;
-    return ret;
-    }
-/*
-#else
-// ---------------------------------------------------------------------------
-void CCommandParser::OpenScriptL()
-    {
-    LOGSTRING("Creator: CCommandParser::OpenScriptL");
-
-    // init the search array
-    iSearchArray = new(ELeave) CDesCArrayFlat(500);
-
-    // wait dialog
-    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
-    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
-
-
-    // search all the .creator files from the phone
-    TInt err;
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\")));
-
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\system\\apps\\Creator\\")));
-
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\data\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\data\\")));
-    
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\documents\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\documents\\")));
-
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\creator\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\creator\\")));
-    
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\scripts\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\scripts\\")));
-    
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\temp\\")));
-    
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\system\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\system\\temp\\")));
-
-    TRAP(err, FindFiles(_L("*.creator"), _L("\\private\\101FA751\\")));
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\private\\101FA751\\")));
-
-    TRAP(err, FindFilesRecursiveL(_L("*.creator"), _L("\\private\\1000484b\\")));
-
-
-    // remove the wait dialog
-    waitDialog->CancelNoteL(dialogId);
-    CleanupStack::PopAndDestroy(); //waitDialog;
-
-
-    if ( iSearchArray->MdcaCount() > 0)
-        {
-        // create a file name array based on the iSearchArray
-        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount());
-        CleanupStack::PushL(fileNameArray);
-        
-        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
-            {
-            
-            TParse filename; // file name parser
-            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
-
-            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
-                {
-                TFileName nameMMC;
-                nameMMC.Append(filename.Name());
-                nameMMC.Append(_L("\t0"));        // MMC icon
-                fileNameArray->AppendL(nameMMC);
-                }
-            else
-                {
-                fileNameArray->AppendL(filename.Name());
-                }
-            }
-        CleanupStack::Pop(fileNameArray);
-
-
-        // create a popup list
-        CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
-        CleanupStack::PushL(listBox);
-        CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
-        CleanupStack::PushL(popupList);
-        popupList->SetTitleL(_L("Select script"));
-        listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
-        listBox->CreateScrollBarFrameL( ETrue );
-        listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        listBox->Model()->SetItemTextArray( fileNameArray );
-        listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
-        listBox->HandleItemAdditionL();
-
-
-        // define MMC icon 
-        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-        _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
-        CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
-        listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
-
-        TParse* fp = new(ELeave) TParse();
-        fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
-        TFileName resourceFileName( fp->FullName() );
-        delete fp;
-
-        CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
-            resourceFileName,
-            EMbmAknmemorycarduiQgn_indi_mmc_add,
-            EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
-        CleanupStack::PushL( icon );
-        iconArray->AppendL( icon );
-        CleanupStack::Pop( icon );
-
-
-        // execute dialog
-        TBool result = popupList->ExecuteLD();
-        CleanupStack::Pop();  // popupList
-
-        if ( result ) 
-            {
-            // open the file for reading
-            RFile file;
-            User::LeaveIfError(file.Open(CEikonEnv::Static()->FsSession(), iSearchArray->MdcaPoint(listBox->CurrentItemIndex()), EFileRead));
-            while (ReadLineFromFileL(file) == KErrNone)
-                {
-                iReadBuf->Des().Trim();  // delete leading and trailing white space
-
-                if (iReadBuf->Length() < 5)  // command too short, ignoring...
-                    {
-                    //CEikonEnv::Static()->InfoMsg(_L("Corrupted line"));
-                    }
-        
-                // check it's a valid line: first char is A-Z and the line ends to ';'
-                else if (iReadBuf->Des()[0] >= 'A' && iReadBuf->Des()[0] <= 'Z' && iReadBuf->Des()[iReadBuf->Length()-1] == ';')
-                    {
-                    // this line is valid -> parse the command
-                    ParseCommandFromDescriptorL();
-                    }
-                else
-                    {
-                    //CEikonEnv::Static()->InfoMsg(_L("Not a valid line"));
-                    }
-
-                }
-
-            file.Close();
-
-            // show a note if there were no valid commands in the script
-            if (iEngine->CommandArrayCount() == 0)
-                {
-                CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                note->ExecuteLD(_L("No valid commands in this script"));
-                }
-
-            }
-
-        CleanupStack::PopAndDestroy();  //listBox
-        }
-    
-    else  // no scripts found from the search paths
-        {
-        CAknInformationNote* note = new (ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("No scripts found"));
-        }
-
-
-    delete iSearchArray;
-    iSearchArray = NULL;
-
-    }
-#endif
-*/
-
-TBool CCommandParser::GetRandomDataFilenameL(TDes& aFilename)
-    {    
-    LOGSTRING("Creator: CCommandParser::GetRandomDataFilenameL");
-    TBool ret = EFalse;
-
-    // init the search array
-    if (iSearchArray)
-    	{
-    	delete iSearchArray;
-    	iSearchArray = NULL;
-    	}
-    iSearchArray = new(ELeave) CDesCArrayFlat(500);
-
-    // wait dialog
-    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
-    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Searching"));
-
-
-    // search all the creator random data files from the phone
-    TInt err;
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\")));
-
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\system\\apps\\Creator\\")));
-
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\data\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\data\\")));
-    
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\documents\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\documents\\")));
-
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\creator\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\creator\\")));
-    
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\scripts\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\scripts\\")));
-    
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\temp\\")));
-    
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\system\\temp\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\system\\temp\\")));
-
-    TRAP(err, FindFiles(KRandomDataFileFilter, _L("\\private\\20011383\\")));
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\private\\20011383\\")));
-
-    TRAP(err, FindFilesRecursiveL(KRandomDataFileFilter, _L("\\private\\1000484b\\")));
-
-
-    // remove the wait dialog
-    waitDialog->CancelNoteL(dialogId);
-    CleanupStack::PopAndDestroy(); //waitDialog;
-
-
-    if (iSearchArray->MdcaCount() > 0)
-        {
-        // create a file name array based on the iSearchArray
-        CDesCArray* fileNameArray = new(ELeave) CDesCArrayFlat(iSearchArray->MdcaCount() + 1);
-        CleanupStack::PushL(fileNameArray);
-
-        for (TInt i=0; i<iSearchArray->MdcaCount(); i++)
-            {
-            
-            TParse filename; // file name parser
-            filename.Set(iSearchArray->MdcaPoint(i), NULL, NULL);
-
-            if ( filename.Drive()[0] == 'e' || filename.Drive()[0] == 'E')  // MMC
-                {
-                TFileName nameMMC;
-                nameMMC.Append(filename.Name());
-                nameMMC.Append(_L("\t0"));        // MMC icon
-                fileNameArray->AppendL(nameMMC);
-                }
-            else
-                {
-                fileNameArray->AppendL(filename.Name());
-                }
-            }
-
-        // add "default" (resource file) to list
-        fileNameArray->AppendL(_L("Default"));
-
-        CleanupStack::Pop(fileNameArray);
-
-
-        // create a popup list
-        CAknSinglePopupMenuStyleListBox* listBox = new(ELeave) CAknSinglePopupMenuStyleListBox;
-        CleanupStack::PushL(listBox);
-        CAknPopupList* popupList = CAknPopupList::NewL( listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow );
-        CleanupStack::PushL(popupList);
-        popupList->SetTitleL(_L("Select random data file"));
-        listBox->ConstructL( popupList, EAknListBoxSelectionList|EAknListBoxLoopScrolling );
-        listBox->CreateScrollBarFrameL( ETrue );
-        listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        listBox->Model()->SetItemTextArray( fileNameArray );
-        listBox->Model()->SetOwnershipType( ELbmOwnsItemArray );  // !!!
-        listBox->HandleItemAdditionL();
-
-
-        // define MMC icon 
-        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-        _LIT( KFLDMemoryCardUiBitmapFile, "z:aknmemorycardui.mbm" );
-        CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 1 );
-        listBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
-
-        TParse* fp = new(ELeave) TParse();
-        fp->Set(KFLDMemoryCardUiBitmapFile, &KDC_APP_BITMAP_DIR, NULL);
-        TFileName resourceFileName( fp->FullName() );
-        delete fp;
-
-        CGulIcon* icon = AknsUtils::CreateGulIconL( skin, KAknsIIDQgnIndiMmcAdd,
-            resourceFileName,
-            EMbmAknmemorycarduiQgn_indi_mmc_add,
-            EMbmAknmemorycarduiQgn_indi_mmc_add_mask );
-        CleanupStack::PushL( icon );
-        iconArray->AppendL( icon );
-        CleanupStack::Pop( icon );
-
-
-        // execute dialog
-        TBool result = popupList->ExecuteLD();
-        CleanupStack::Pop();  // popupList
-
-        if ( result ) 
-            {
-            if (listBox->CurrentItemIndex() == (fileNameArray->Count() - 1))
-            	{
-            	// "default" (resource file) selected
-            	aFilename.Copy(KNullDesC);
-            	}
-            else
-            	{
-            	// xml file selected
-            	aFilename.Copy(iSearchArray->MdcaPoint(listBox->CurrentItemIndex()));
-            	}
-            ret = ETrue;
-            }
-        CleanupStack::PopAndDestroy();  //listBox
-        }
-    else  // no random data files found from the search paths
-        {
-        CAknInformationNote* note = new (ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("No random data files found"));
-        }
-
-    delete iSearchArray;
-    iSearchArray = NULL;
-    return ret;
-    }
-
-TInt CCommandParser::FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
-    {
-    return CreatorFileUtils::FindFilesRecursiveL(iSearchArray, aFileName, aPath);
-    }
-TInt CreatorFileUtils::FindFilesRecursiveL(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath)
-	{
-    TInt err = KErrNone;
-    CDirScan* scan = CDirScan::NewLC(CEikonEnv::Static()->FsSession());
-    scan->SetScanDataL(aPath, KEntryAttDir, ESortNone);
-    CDir* dirEntries = NULL;
-
-    for(;;)
-        {
-        TRAP(err, scan->NextL(dirEntries));
-        if (!dirEntries  || (err!=KErrNone))
-            break;
-
-        for (TInt i=0; i<dirEntries->Count(); i++) 
-            {
-            TFileName path(scan->FullPath());
-            path.Append((*dirEntries)[i].iName);
-            path.Append(_L("\\"));
-            FindFiles(aFileArray, aFileName, path);
-            }
-        delete(dirEntries);
-        }
-
-    CleanupStack::PopAndDestroy(scan);
-    return err;
-    }
-
-TInt CreatorFileUtils::FindFiles(CDesCArrayFlat* aFileArray, const TDesC& aFileName, const TDesC& aPath)
-    {
-    TFindFile fileFinder(CEikonEnv::Static()->FsSession());
-    CDir* fileList; 
-    TInt err = fileFinder.FindWildByDir(aFileName, aPath, fileList);
-
-    while (err == KErrNone)
-        {
-        for (TInt i=0; i<fileList->Count(); i++)
-            {
-            TParse fullentry;
-            fullentry.Set((*fileList)[i].iName, &fileFinder.File(), NULL);
-            
-            TRAP(err, aFileArray->AppendL(fullentry.FullName())); 
-            }
-
-        delete fileList;
-        err = fileFinder.FindWild(fileList);
-        }
-    return err;
-    }
-// ---------------------------------------------------------------------------
-
-TInt CCommandParser::FindFiles(const TDesC& aFileName, const TDesC& aPath)
-    {
-    return CreatorFileUtils::FindFiles(iSearchArray, aFileName, aPath);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CCommandParser::ReadLineFromFileL(RFile& aInputFile)
-    {
-    LOGSTRING("Creator: CCommandParser::ReadLineFromFile");
-
-	_LIT8(KImcvCRLF, "\r\n");
-
-    TInt err = KErrNone;
-
-    //  Read into the buffer
-    HBufC8* tempLine = HBufC8::NewLC(KReadBufSize);
-    TPtr8 buffer = tempLine->Des();
-
-    // clear the targer
-    iReadBuf->Des().Copy(_L(""));
-
-    //  Get the current file position
-    TInt filePos = 0;
-    aInputFile.Seek(ESeekCurrent, filePos);
-
-    //  Read the buffer
-    err = aInputFile.Read(buffer);
-
-    //end of file?
-    TInt s = buffer.Length();
-    if  ( s == 0)
-        err = KErrEof;
-
-    if  (err == KErrNone)
-        {
-        //  Copy to the lfcr and then set the file pointer to the point after that
-        TInt pos = buffer.Find(KImcvCRLF);
-        if      ( pos != -1)
-            {
-            iReadBuf->Des().Justify(buffer, pos, ELeft, ' ');
-            filePos += (pos+2);
-
-            //  Set the file pointer back to after the lfcr
-            aInputFile.Seek(ESeekStart, filePos);
-            }
-        //  Else fill the whole buffer
-        else
-            {
-            iReadBuf->Des().Copy(buffer);
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); // tempLine
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCommandParser::StrParserL(HBufC*& aDestinationBuf, TUint aToken)
-    {
-    // store old position
-	iParserOldPosition = iParserPosition;
-
-    // make sure we are not reading outside of buffer
-    if (iParserPosition >= iReadBuf->Length() - 1)
-        return;
-    
-    // read until asked token
-	do
-	    {
-	    iParserPosition++;
-	    }
-	while (iReadBuf->Des()[iParserPosition] != aToken && iParserPosition < iReadBuf->Des().Length()-1);
-	
-	// calculate length of the destination buffer
-	TInt bufferLength = iParserPosition-iParserOldPosition-1;
-	
-	// reset the destination buffer
-	if (aDestinationBuf)
-	    {
-        delete aDestinationBuf;
-        aDestinationBuf = NULL;
-	    }
-
-    // allocate memory for the destination buffer
-	aDestinationBuf = HBufC::NewL(bufferLength);
-
-	// copy data from the read buffer to the destination buffer
-    aDestinationBuf->Des().Copy(iReadBuf->Des().Mid(iParserOldPosition+1, bufferLength));
-    }
-
-// ---------------------------------------------------------------------------
-
-void CCommandParser::StrParserL(HBufC8*& aDestinationBuf, TUint aToken)
-    {
-    // store old position
-	iParserOldPosition = iParserPosition;
-
-    // make sure we are not reading outside of buffer
-    if (iParserPosition >= iReadBuf->Length() - 1)
-        return;
-    
-    // read until asked token
-	do
-	    {
-	    iParserPosition++;
-	    }
-	while (iReadBuf->Des()[iParserPosition] != aToken && iParserPosition < iReadBuf->Des().Length()-1);
-	
-	// calculate length of the destination buffer
-	TInt bufferLength = iParserPosition-iParserOldPosition-1;
-	
-	// reset the destination buffer
-	if (aDestinationBuf)
-	    {
-        delete aDestinationBuf;
-        aDestinationBuf = NULL;
-	    }
-
-    // allocate memory for the destination buffer
-	aDestinationBuf = HBufC8::NewL(bufferLength);
-
-	// copy data from the read buffer to the destination buffer
-    aDestinationBuf->Des().Copy(iReadBuf->Des().Mid(iParserOldPosition+1, bufferLength));
-    }
-
-//----------------------------------------------------------------------------
-
-void CCommandParser::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) // from MMsvSessionObserver
-    {
-    }
-
-//----------------------------------------------------------------------------
-
--- a/creator/src/creator_scriptparser.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <f32file.h>
-#include <utf.h>
-#include <xml/documentparameters.h>
-#include "creator_scriptparser.h"
-#include "creator_scriptelementfactory.h"
-#include "creator_traces.h"
-
-using namespace Xml;
-
-CCreatorScriptParser::CCreatorScriptParser() 
-: iDefaultElement(TCreatorScriptElementInfo(TCreatorScriptElementInfo::EStatusUndefined, 0))
-    {        
-    }
-void CCreatorScriptParser::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorScriptParser::ConstructL");
-    iEngine = aEngine;
-    }
-
-CCreatorScriptParser* CCreatorScriptParser::NewL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorScriptParser::NewL");
-    CCreatorScriptParser* self = CCreatorScriptParser::NewLC(aEngine);    
-    CleanupStack::Pop();
-    return self;
-    }
-CCreatorScriptParser* CCreatorScriptParser::NewLC(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorScriptParser::NewLC");
-    CCreatorScriptParser* self = new (ELeave) CCreatorScriptParser;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorScriptParser::~CCreatorScriptParser()
-    {
-    delete iParser;
-    if( iElementStack.Count() > 0 )
-        {
-        delete iElementStack[0].iElement;        
-        }
-    iElementStack.Reset();
-    iElementStack.Close();
-    }
-
-void CCreatorScriptParser::GetTextFileMode(RFile& aFile, TInt& aFileSize) 
-    { 
-    LOGSTRING("Creator: CCreatorScriptParser::GetTextFileMode");
-    iScriptTextFormat = EFormatANSIASCII; 
-
-    // if we are working with text files, check the type first   
-    TBuf8<4> BOM; 
-
-    // first check for UTF-16 
-    if (aFileSize >= 2 && aFile.Read(0, BOM, 2) == KErrNone) 
-        { 
-        if (BOM.Length()==2 && BOM[0]==0xFF && BOM[1]==0xFE) 
-            { 
-            iScriptTextFormat = EFormatUTF16LE; 
-            aFileSize -= 2; 
-            return; 
-            } 
-        else if (BOM.Length()==2 && BOM[0]==0xFE && BOM[1]==0xFF) 
-            { 
-            iScriptTextFormat = EFormatUTF16BE; 
-            aFileSize -= 2; 
-            return;                 
-            }       
-        }
-        // then check for UTF-8 
-    if (aFileSize >= 3 && aFile.Read(0, BOM, 3) == KErrNone) 
-        { 
-        if (BOM.Length()==3 && BOM[0]==0xEF && BOM[1]==0xBB && BOM[2]==0xBF) 
-            { 
-            iScriptTextFormat = EFormatUTF8; 
-            aFileSize -= 3; 
-            return; 
-            } 
-        }
-        
-    // none of those, seek back to beginning 
-    TInt pos(0); 
-    aFile.Seek(ESeekStart, pos); 
-    }    
- 
-
-
-void CCreatorScriptParser::ParseL(const TDesC& aFileName)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::ParseL: %S", &aFileName);
-    // Create and start XML-parser
-    if( iParser == 0)
-        {
-        _LIT8(KXmlMimeType, "text/xml");
-        iParser = CParser::NewL(KXmlMimeType, *this);        
-        }
-
-    RFs filesession;
-    CleanupClosePushL(filesession);
-    User::LeaveIfError( filesession.Connect() );
-    Xml::ParseL(*iParser, filesession, aFileName);
-    
-    CleanupStack::PopAndDestroy(&filesession); // filesession    
-    }
-
-void CCreatorScriptParser::ParseL(RFile& aFile)
-    {
-    LOGSTRING("Creator: CCreatorScriptParser::ParseL");
-    TInt filesize = 0;
-    aFile.Size(filesize);
-    GetTextFileMode(aFile, filesize);
-    // Create and start XML-parser    
-    if( iParser == 0)
-        {
-        _LIT8(KXmlMimeType, "text/xml");
-        iParser = CParser::NewL(KXmlMimeType, *this);        
-        }
-    Xml::ParseL(*iParser, aFile);
-    }
-
-void CCreatorScriptParser::OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnStartDocumentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);    
-    const TDesC8& charSet = aDocParam.CharacterSetName().DesC();
-    }
-
-void CCreatorScriptParser::OnEndDocumentL(TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnEndDocumentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorScriptParser::OnStartPrefixMappingL(   const RString& /*aPrefix*/, 
-                                                    const RString& /*aUri*/, 
-                                                    TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-
-void CCreatorScriptParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-void CCreatorScriptParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-void CCreatorScriptParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-void CCreatorScriptParser::OnProcessingInstructionL(  const TDesC8& /*aTarget*/, 
-                                    const TDesC8& /*aData*/, 
-                                    TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    }
-void CCreatorScriptParser::OnError(TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnError: %d", aErrorCode);
-    
-    iLastError = aErrorCode;
-    
-    // Delete all elements from the stack:
-    while(iElementStack.Count() > 0 )
-        {
-        TCreatorScriptElementInfo previousElem = LastElementInfo();    
-        delete previousElem.iElement;
-        previousElem.iElement = 0;
-        iElementStack.Remove(iElementStack.Count()-1);
-        }
-    }
-TAny* CCreatorScriptParser::GetExtendedInterface(const TInt32 aUid)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::GetExtendedInterface (UID: %d)", aUid);
-    return this;
-    }
-
-const TCreatorScriptElementInfo& CCreatorScriptParser::LastElementInfo() const
-{
-    LOGSTRING("Creator: CCreatorScriptParser::LastElementInfo");
-    if(iElementStack.Count() > 0)
-        {
-        return iElementStack[iElementStack.Count()-1];
-        }
-    return iDefaultElement;
-}
-
-/**
- * Create an element and add attributes to it.
- */
-void CCreatorScriptParser::OnStartElementL(  const RTagInfo& aElement,
-                                            const RAttributeArray& aAttributes,
-                                            TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnStartElementL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    const TDesC8& elementName8 = aElement.LocalName().DesC();        
-    HBufC* elementName16 = Convert8BitTo16BitLC(elementName8);
-        
-    const TCreatorScriptElementInfo& context = LastElementInfo();
-    
-    CCreatorScriptElement* element = 0;
-    if( context.iElement )
-        {
-        HBufC* fullContext = HBufC::NewL(
-                context.iElement->Context().Length() + 
-                context.iElement->Name().Length() + 
-                2);        
-        CleanupStack::PushL(fullContext);
-        if(context.iElement->Context() != KNullDesC && 
-           context.iElement->Context().Length() > 0 )
-            {
-            fullContext->Des().Copy(context.iElement->Context());
-            _LIT(KContextSeparator, "::");
-            fullContext->Des().Append(TPtrC(KContextSeparator));
-            }
-        const TDesC& parentName = context.iElement->Name();
-        if(parentName.Length() > 0 )
-            {            
-            fullContext->Des().Append(parentName);
-            }
-        element = TCreatorScriptElementFactory::CreateElementL( iEngine,
-                                                                elementName16->Des(), 
-                                                                fullContext->Des());
-        CleanupStack::PopAndDestroy(fullContext); // fullContext        
-        }
-    else
-        {
-        element = TCreatorScriptElementFactory::CreateElementL(iEngine, elementName16->Des());        
-        }
-        
-    CleanupStack::PopAndDestroy(elementName16);
-    CleanupStack::PushL(element);
-    
-    if( element == 0 )
-        {
-        // Add NULL pointer to stack. Otherwise the stack would go out of sync. in ::OnEndElement().
-        TCreatorScriptElementInfo info(TCreatorScriptElementInfo::EStatusParsing, element);
-        iElementStack.AppendL(info);   
-        CleanupStack::Pop(element);
-        return;        
-        }
-        
-    // Add attributes to the element:
-    TInt attrCount = aAttributes.Count();
-    for(TInt i = 0; i < attrCount; ++i)
-        {
-        const RAttribute& attribute = aAttributes[i];
-        const RTagInfo& nameInfo = attribute.Attribute();
-        const TDesC8& attrName8 = nameInfo.LocalName().DesC();
-        const TDesC8& value8 = attribute.Value().DesC();
-        // Convert data to 16 bit:
-        HBufC* attrName16 = Convert8BitTo16BitLC(attrName8);
-        HBufC* value16 = Convert8BitTo16BitLC(value8);
-        CCreatorScriptAttribute* scriptAttr = CCreatorScriptAttribute::NewLC(attrName16->Des(), value16->Des());
-        element->AddAttributeL(scriptAttr);
-        CleanupStack::Pop(scriptAttr);
-        CleanupStack::PopAndDestroy(value16);
-        CleanupStack::PopAndDestroy(attrName16);
-        }
-    
-    // Save element to the stack:
-    TCreatorScriptElementInfo info(TCreatorScriptElementInfo::EStatusParsing, element);
-    iElementStack.AppendL(info);
-    CleanupStack::Pop(element);
-    }
-
-/**
- * Executes the command if needed. Also caches the element for future use, if needed.
- */
-void CCreatorScriptParser::OnEndElementL(const RTagInfo& /*aElement*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnEndElementL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-     
-    if( iElementStack.Count() == 0 )
-        {
-        return;
-        }
-    // Get element from the stack:    
-    TCreatorScriptElementInfo elementInfo = LastElementInfo();
-    
-    if( elementInfo.iElement == 0 )
-        {
-        // Remove element from the stack:        
-        iElementStack.Remove(iElementStack.Count()-1);
-        return;
-        }
-        
-    // Execute the command if this is a command element:
-    if( elementInfo.iElement->IsCommandElement() )
-        {
-        elementInfo.iElement->ExecuteCommandL();
-        }
-    
-    // Remove element from the stack:
-    iElementStack.Remove(iElementStack.Count()-1);
-    
-    // Get the previous element from the stack:
-    if( iElementStack.Count() > 0 )
-        {
-        TCreatorScriptElementInfo previousElem = LastElementInfo();
-        
-        if( previousElem.iElement->IsRoot() )
-            {
-            // This element is not a sub-element (except of the root element, of course).        
-            if( elementInfo.iElement->IsCacheNeeded() )
-                {
-                // Add element to the cache, since it will be needed in future.            
-                elementInfo.iElement->AddToCacheL();
-                }
-            //else
-            //    {
-                // Not needed anymore, so element can be deleted:
-                delete elementInfo.iElement;
-                elementInfo.iElement = 0;
-           //     }
-            }
-        else
-            {
-            // There is a parent element (other than root), so we add this element
-            // as a sub-element fot it.
-            previousElem.iElement->AddSubElementL(elementInfo.iElement);
-            }
-        }
-    else
-        {
-        // Delete root element, which will delete recursively all sub-elements:
-        delete elementInfo.iElement;
-        elementInfo.iElement = 0;
-        }
-    }
-
-/**
- * Add content to element.
- */
-void CCreatorScriptParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
-    {
-    LOGSTRING2("Creator: CCreatorScriptParser::OnContentL (Error code: %d)", aErrorCode);
-    User::LeaveIfError(aErrorCode);
-    if( iElementStack.Count() > 0 )
-        {
-        HBufC* contentData = Convert8BitTo16BitLC(aBytes);
-        TCreatorScriptElementInfo elementInfo = iElementStack[iElementStack.Count()-1];
-        if( elementInfo.iElement )
-            {
-            elementInfo.iElement->AppendContentL(*contentData);
-            }
-        CleanupStack::PopAndDestroy(contentData);
-        }
-    }
-
-HBufC16* CCreatorScriptParser::Convert8BitTo16BitLC(const TDesC8& aInput) 
-    {     
-    LOGSTRING("Creator: CCreatorScriptParser::Convert8BitTo16BitLC");
-    HBufC16* output = NULL;
-    
-    output = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aInput);
-    
-    CleanupStack::PushL(output);
-    return output;          
-    } 
-
-TInt CCreatorScriptParser::GetError() const 
-{
-    return iLastError;
-}
--- a/creator/src/creator_virtualphonebook.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1802 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "creator_virtualphonebook.h" 
-#include "creator_traces.h"
-#include "creator_contactsetcache.h"
-
-#include <CVPbkContactStoreUriArray.h>
-#include <VPbkContactStoreUris.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <MVPbkContactGroup.h>
-#include <MVPbkContactStore.h>
-#include <CVPbkContactManager.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStoreListObserver.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkStoreContact.h>
-#include <MVPbkContactStoreProperties.h>
-#include <MVPbkContactFieldData.h>
-#include <MVPbkFieldType.h>
-#include <MVPbkContactFieldTextData.h>
-#include <MVPbkContactFieldBinaryData.h>
-#include <MVPbkContactFieldDateTimeData.h>
-#include <CVPbkContactViewDefinition.h>
-#include <MVPbkContactView.h>
-
-#include <VPbkContactView.hrh>
-#include <VPbkEng.rsg>
-
-typedef struct {
-TInt iFieldCode;
-TInt iRandomType;
-} FieldInfo;
-static const TInt RND_TYPE_UNDEF = -99;
-FieldInfo CreatorVPbkMiscTextFields[] = {        
-        {R_VPBK_FIELD_TYPE_FIRSTNAME, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_FIRSTNAMEREADING, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_LASTNAME, (TInt) CCreatorEngine::ESurname},
-        {R_VPBK_FIELD_TYPE_LASTNAMEREADING, (TInt) CCreatorEngine::ESurname},
-        {R_VPBK_FIELD_TYPE_COMPANYNAME, (TInt) CCreatorEngine::ECompany},
-        {R_VPBK_FIELD_TYPE_JOBTITLE, (TInt) CCreatorEngine::EJobTitle},
-        {R_VPBK_FIELD_TYPE_PREFIX, (TInt) CCreatorEngine::EPrefix},
-        {R_VPBK_FIELD_TYPE_SUFFIX, (TInt) CCreatorEngine::ESuffix},
-        {R_VPBK_FIELD_TYPE_SECONDNAME, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_ADDRLABELGEN, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRPOGEN, (TInt) CCreatorEngine::EPobox},
-        {R_VPBK_FIELD_TYPE_ADDREXTGEN, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRSTREETGEN, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRLOCALGEN, (TInt) CCreatorEngine::ECity},
-        {R_VPBK_FIELD_TYPE_ADDRREGIONGEN, (TInt) CCreatorEngine::EState},
-        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEGEN, (TInt) CCreatorEngine::EPostcode},
-        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYGEN, (TInt) CCreatorEngine::ECountry},
-        {R_VPBK_FIELD_TYPE_ADDRLABELHOME, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRPOHOME, (TInt) CCreatorEngine::EPobox},
-        {R_VPBK_FIELD_TYPE_ADDREXTHOME, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRSTREETHOME, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRLOCALHOME, (TInt) CCreatorEngine::ECity},
-        {R_VPBK_FIELD_TYPE_ADDRREGIONHOME, (TInt) CCreatorEngine::EState},
-        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEHOME, (TInt) CCreatorEngine::EPostcode},
-        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYHOME, (TInt) CCreatorEngine::ECountry},
-        {R_VPBK_FIELD_TYPE_ADDRLABELWORK, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRPOWORK, (TInt) CCreatorEngine::EPobox},
-        {R_VPBK_FIELD_TYPE_ADDREXTWORK, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRSTREETWORK, (TInt) CCreatorEngine::EAddress},
-        {R_VPBK_FIELD_TYPE_ADDRLOCALWORK, (TInt) CCreatorEngine::ECity},
-        {R_VPBK_FIELD_TYPE_ADDRREGIONWORK, (TInt) CCreatorEngine::EState},
-        {R_VPBK_FIELD_TYPE_ADDRPOSTCODEWORK, (TInt) CCreatorEngine::EPostcode},
-        {R_VPBK_FIELD_TYPE_ADDRCOUNTRYWORK, (TInt) CCreatorEngine::ECountry},
-        {R_VPBK_FIELD_TYPE_POC, (TInt) CCreatorEngine::EPhoneNumber},
-        {R_VPBK_FIELD_TYPE_SWIS, (TInt) CCreatorEngine::EPhoneNumber},
-        {R_VPBK_FIELD_TYPE_SIP, (TInt) CCreatorEngine::EPhoneNumber},
-        {R_VPBK_FIELD_TYPE_DTMFSTRING, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_NOTE,(TInt)  CCreatorEngine::EMemoText},
-        {R_VPBK_FIELD_TYPE_MIDDLENAME, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_DEPARTMENT, (TInt) CCreatorEngine::ECompany},
-        {R_VPBK_FIELD_TYPE_ASSTNAME, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_SPOUSE, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_CHILDREN, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_SYNCCLASS, RND_TYPE_UNDEF},
-        {R_VPBK_FIELD_TYPE_LOCPRIVACY, RND_TYPE_UNDEF},
-        {R_VPBK_FIELD_TYPE_GENLABEL, (TInt) CCreatorEngine::EFirstName},
-        {R_VPBK_FIELD_TYPE_WVADDRESS, (TInt) CCreatorEngine::EPhoneNumber},
-        {R_VPBK_FIELD_TYPE_RINGTONE, RND_TYPE_UNDEF},
-        {R_VPBK_FIELD_TYPE_THUMBNAILPIC, RND_TYPE_UNDEF},
-        {R_VPBK_FIELD_TYPE_CALLEROBJTEXT, (TInt) CCreatorEngine::EFirstName}
-        };
-                    
-TInt CreatorVPbkBinaryFields[] = {
-        R_VPBK_FIELD_TYPE_CALLEROBJIMG//,
-        //R_VPBK_FIELD_TYPE_THUMBNAILPATH
-        };
-
-TInt CreatorVPbkDateTimeFields[] = {
-        R_VPBK_FIELD_TYPE_ANNIVERSARY
-        };
-
-//----------------------------------------------------------------------------
-TInt CreatorVPbkPhoneNumberFields[] =
-    {
-    R_VPBK_FIELD_TYPE_LANDPHONEGEN,
-    R_VPBK_FIELD_TYPE_LANDPHONEHOME,
-    R_VPBK_FIELD_TYPE_LANDPHONEWORK,                        
-    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,
-    R_VPBK_FIELD_TYPE_MOBILEPHONEHOME,
-    R_VPBK_FIELD_TYPE_MOBILEPHONEWORK,
-    R_VPBK_FIELD_TYPE_FAXNUMBERGEN,
-    R_VPBK_FIELD_TYPE_FAXNUMBERHOME,
-    R_VPBK_FIELD_TYPE_FAXNUMBERWORK,
-    R_VPBK_FIELD_TYPE_PAGERNUMBER,           
-    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
-    R_VPBK_FIELD_TYPE_VIDEONUMBERHOME,
-    R_VPBK_FIELD_TYPE_VIDEONUMBERWORK,
-    R_VPBK_FIELD_TYPE_VOIPGEN,
-    R_VPBK_FIELD_TYPE_VOIPHOME,
-    R_VPBK_FIELD_TYPE_VOIPWORK,
-    R_VPBK_FIELD_TYPE_ASSTPHONE,
-    R_VPBK_FIELD_TYPE_CARPHONE
-    };
-
-TInt CreatorVPbkUrlFields[] =
-    {
-    R_VPBK_FIELD_TYPE_URLGEN,
-    R_VPBK_FIELD_TYPE_URLHOME,
-    R_VPBK_FIELD_TYPE_URLWORK
-    };
-
-TInt CreatorVPbkEmailFields[] =
-    {
-    R_VPBK_FIELD_TYPE_EMAILGEN,
-    R_VPBK_FIELD_TYPE_EMAILHOME,
-    R_VPBK_FIELD_TYPE_EMAILWORK
-    };
-
-//----------------------------------------------------------------------------
-
-CVirtualPhonebookParameters::CVirtualPhonebookParameters()
-    {
-    LOGSTRING("Creator: CVirtualPhonebookParameters::CVirtualPhonebookParameters");
-    iGroupName = HBufC::New(KPhonebookFieldLength);  
-    }
-
-CVirtualPhonebookParameters::~CVirtualPhonebookParameters()
-    {
-    LOGSTRING("Creator: CVirtualPhonebookParameters::~CVirtualPhonebookParameters");
-
-    delete iGroupName;   
-    iContactFields.ResetAndDestroy();
-    iContactFields.Close();
-    iLinkIds.Reset();
-    iLinkIds.Close();
-    }
-
-void CVirtualPhonebookParameters::ParseL(CCommandParser* /*parser*/, TParseParams /*aCase = 0*/)
-	{
-	}
-
-TInt CVirtualPhonebookParameters::ScriptLinkId() const
-    {
-    return iLinkId;
-    }
-
-void CVirtualPhonebookParameters::SetScriptLinkId(TInt aLinkId)
-    {
-    iLinkId = aLinkId;
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorVirtualPhonebook* CCreatorVirtualPhonebook::NewL(CCreatorEngine* aEngine)
-    {
-    CCreatorVirtualPhonebook* self = CCreatorVirtualPhonebook::NewLC(aEngine);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorVirtualPhonebook* CCreatorVirtualPhonebook::NewLC(CCreatorEngine* aEngine)
-    {
-    CCreatorVirtualPhonebook* self = new (ELeave) CCreatorVirtualPhonebook;
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngine);
-    return self;
-    }
-
-CCreatorVirtualPhonebook::CCreatorVirtualPhonebook()
-    {    
-    iAddAllFields = EFalse;
-    }
-
-void CCreatorVirtualPhonebook::ConstructL(CCreatorEngine* aEngine)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::ConstructL");
-
-    iContactLinkArray = CVPbkContactLinkArray::NewL();
-    iContactsToDelete = CVPbkContactLinkArray::NewL();
-    iContactGroupsToDelete = CVPbkContactLinkArray::NewL();
-    
-    iEngine = aEngine;
-    SetDefaultParameters();
-    
-    // initialize virtual phonebook
-    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-    uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
-    iContactManager = CVPbkContactManager::NewL( *uriArray, &CCoeEnv::Static()->FsSession());
-    CleanupStack::PopAndDestroy(uriArray);
-    
-    //When the contact manager is created, the stores is opened
-    MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
-    
-    iWaiter = CAsyncWaiter::NewL();
-
-    //MVPbkContactStoreListObserver must give as parameter    
-    storeList.OpenAllL(*this);
-    // wait for OpenComplete() callback
-    iWaiter->StartAndWait();
-    
-    _LIT(dbUri, "cntdb://c:contacts.cdb");
-    const TVPbkContactStoreUriPtr uri = TVPbkContactStoreUriPtr(dbUri);
-       
-    iStore = storeList.Find(uri);    
-    iOpCounter = 0;    
-    }
-
-TBool CCreatorVirtualPhonebook::IsActive()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::IsActive");
-    return iOperation != NULL;
-    }
-
-void CCreatorVirtualPhonebook::CancelOperation()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::CancelOperation");
-    iCancelCbRequested = ETrue;    
-    }
-
-CCreatorVirtualPhonebook::~CCreatorVirtualPhonebook()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::~CCreatorVirtualPhonebook");
-    
-    // this is done only once per phonebook operation
-    if ( iContactsToDelete && iContactsToDelete->Count() )
-        {
-        TRAP_IGNORE( StoreLinksForDeleteL( *iContactsToDelete, KUidDictionaryUidContacts ) );
-        }
-    delete iContactsToDelete;
-    if ( iContactGroupsToDelete && iContactGroupsToDelete->Count() )
-        {
-        TRAP_IGNORE( StoreLinksForDeleteL( *iContactGroupsToDelete, KUidDictionaryUidContactGroups ) );
-        }
-    delete iContactGroupsToDelete;
-    
-    iPreviousDeleteLinks.ResetAndDestroy();
-    
-    delete iOperation;
-    
-    TInt err = 0;
-    TRAP(err, CompactPbkDatabaseL( ETrue ));
-
-    if(iContactResults)
-    	{
-    	delete iContactResults;
-    	}
-    
-    delete iContactLinkArray;
-    delete iContactGroupsInStore;
-    
-    if(iContactManager)
-    	{
-    	TRAP(err, iContactManager->ContactStoresL().CloseAll(*this));
-    	delete iContactManager;
-    	}
-    if(iWaiter)
-    	{
-    	delete iWaiter;    
-    	}
-    if (iParameters)
-    	{
-        delete iParameters;
-    	}
-    }
-
-//----------------------------------------------------------------------------
-TBool CCreatorVirtualPhonebook::AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AskDataFromUserL");
-    TBool ret = CCreatorPhonebookBase::AskDataFromUserL(aCommand, aNumberOfEntries);
-   
-    if(ret && aCommand == ECmdCreatePhoneBookEntryContacts && !iDefaultFieldsSelected)    
-        {
-        iAddAllFields = iEngine->YesNoQueryDialogL(_L("Add all the other fields to contacts?"));
-        }
-    return ret;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllL");
-    
-    // Delete all contacts, not contact groups
-    
-    //get field types
-    const MVPbkFieldTypeList& fieldList = iStore->StoreProperties().SupportedFields();
-        
-    // get all contact links, results will be set to iContactResults
-    MVPbkContactOperationBase* operation = iContactManager->FindL( _L(""), fieldList , *this );
-    if ( operation )
-        {
-        iWaiter->StartAndWait(); //Making asynchronous FindL to synchronous
-        delete operation;
-        }
-    
-    while( iContactResults->Count() && 
-           !iCancelCbRequested &&
-           HasOtherThanGroupsL( iContactResults ) )
-        {
-        // delete all found contacts
-        DeleteContactsL( iContactResults, EFalse );
-        
-        if ( !iCancelCbRequested )
-            {
-            // find next set of contacts to delete
-            MVPbkContactOperationBase* operation = iContactManager->FindL( _L(""), fieldList , *this );
-            if ( operation )
-                {
-                iWaiter->StartAndWait(); //Making asynchronous FindL to synchronous
-                delete operation;
-                }
-            }
-        }
-    
-    if ( iCancelCbRequested && iEngine )
-        {
-        // User cancelled, must callback to finish terminatio sequence
-        iEngine->CancelComplete();
-        }
-    else
-        {
-        // contacts deleted, remove the Creator internal contact registry
-        // (no callback required)
-        CDictionaryFileStore* store = iEngine->FileStoreLC();
-        if ( store )
-            {
-            store->Remove( KUidDictionaryUidContacts );
-            store->CommitL();        
-            }
-        CleanupStack::PopAndDestroy( store );
-        }    
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContacts );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteAllGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllGroupsL");
-    User::LeaveIfNull( iStore );
-    MVPbkContactLinkArray* groups = iStore->ContactGroupsLC();
-    DeleteContactsL( groups, ETrue );
-    CleanupStack::PopAndDestroy(); // cannot use groups as parameter
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteAllGroupsCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteAllGroupsCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContactGroups );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteContactsL( MVPbkContactLinkArray* aContacts, TBool aGroup )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteContactsL");
-    const MVPbkContactLink* link( NULL );
-    delete iOperation;
-    iOperation = NULL;
-    TInt i(0);
-    while ( aContacts && i < aContacts->Count() && !iCancelCbRequested )
-        {
-        link = &aContacts->At( i++ );
-        if ( aGroup == IsContactGroupL( *link ) )
-            {
-            iOperation = iContactManager->RetrieveContactL( *link, *this );
-            // see VPbkSingleContactOperationComplete
-            if ( iOperation )
-                {
-                iWaiter->StartAndWait();
-                delete iOperation;
-                iOperation = NULL;
-                }            
-            }
-        link = NULL;
-        }
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DeleteItemsCreatedWithCreatorL( TUid aStoreUid )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DeleteItemsCreatedWithCreatorL");
-    __ASSERT_ALWAYS( aStoreUid == KUidDictionaryUidContacts || 
-                     aStoreUid == KUidDictionaryUidContactGroups,
-                     User::Panic( _L("CCreatorVPb"), KErrArgument ) );
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-    if ( store->IsPresentL( aStoreUid ) )
-        {
-        TRAP_IGNORE( DoDeleteItemsCreatedWithCreatorL( aStoreUid, store ) );
-
-        if ( iCancelCbRequested && iEngine )
-            {
-            iEngine->CancelComplete();
-            }
-        else
-            {
-            // contacts deleted, remove the Creator internal contact registry
-            store->Remove( aStoreUid );
-            store->CommitL();            
-            }
-        }
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::DoDeleteItemsCreatedWithCreatorL");
-    RDictionaryReadStream in;
-    in.OpenLC( *aStore, aStoreUid );
-    MVPbkContactLinkArray* contactsToDelete = NULL;
-    // fetch contact links from store
-    while ( ( contactsToDelete = iContactManager->CreateLinksLC( in ) ) != NULL && // will leave with KErrEof
-            !iCancelCbRequested ) 
-        {
-        DeleteContactsL( contactsToDelete, aStoreUid == KUidDictionaryUidContactGroups );
-        // PopAndDestroy for contactsToDelete causes E32USER-CBase:90
-        // however there is no mem-leak even if not deleting contactsToDelete object
-        }
-    CleanupStack::PopAndDestroy(); // in
-    }
-
-//----------------------------------------------------------------------------
-TBool CCreatorVirtualPhonebook::HasOtherThanGroupsL( MVPbkContactLinkArray* aContacts )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::HasOtherThanGroupsL");
-    TBool result( EFalse );
-    TInt i(0);
-    while ( aContacts && i < aContacts->Count() && !iCancelCbRequested && !result )
-        {
-        if ( !IsContactGroupL( aContacts->At( i++ ) ) )
-            {
-            result = ETrue;
-            }
-        }
-    return result;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::VPbkSingleContactOperationComplete(
-                MVPbkContactOperationBase& /*aOperation*/,
-                MVPbkStoreContact* aContact )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::VPbkSingleContactOperationComplete");
-    
-    // This callback is currently used only for deleting a contact
-    // See DeleteContactsL
-    
-    TRAP_IGNORE( 
-            aContact->PushL();
-            aContact->DeleteL( *this );
-            CleanupStack::PopAndDestroy( aContact );
-        );
-    }
-
-void CCreatorVirtualPhonebook::VPbkSingleContactOperationFailed(
-                MVPbkContactOperationBase& /*aOperation*/, 
-                TInt /*aError*/ )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::VPbkSingleContactOperationFailed");
-    iWaiter->Cancel();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::StoreLinksForDeleteL( MVPbkContactLinkArray& aLinks, TUid aStoreUid )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreLinksForDeleteL");
-    CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-    
-    // backup previous contact links from store
-    // otherwise they would be overwritten when calling out.WriteL
-    MVPbkContactLinkArray* previousLinks( NULL );
-    if ( store->IsPresentL( aStoreUid ) )
-        {
-        RDictionaryReadStream in;
-        in.OpenLC( *store, aStoreUid );        
-        TRAP_IGNORE( 
-            while ( ( previousLinks = iContactManager->CreateLinksLC( in )) != NULL ) // will leave with KErrEof
-                {
-                CleanupStack::Pop(); // previousLinks
-                iPreviousDeleteLinks.Append( previousLinks );
-                previousLinks = NULL;
-                }
-            );
-        CleanupStack::PopAndDestroy(); // in
-        }
-
-    RDictionaryWriteStream out;       
-    out.AssignLC( *store, aStoreUid );
-    
-    // restore previous links
-    for ( TInt i = 0; i < iPreviousDeleteLinks.Count(); i++ )
-        {
-        out.WriteL( *iPreviousDeleteLinks[i]->PackLC() );
-        CleanupStack::PopAndDestroy(); // PackLC            
-        }
-    iPreviousDeleteLinks.ResetAndDestroy();
-    
-    // write new links
-    out.WriteL( *aLinks.PackLC() );
-    out.CommitL();
-    CleanupStack::PopAndDestroy(); // aLinks.PackLC
-    CleanupStack::PopAndDestroy(); // out
-    
-    store->CommitL();
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC& aData)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC& aData)");
-    if(iParameters == 0)
-        return;
-    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
-    CleanupStack::PushL(field);
-    iParameters->iContactFields.AppendL(field);
-    CleanupStack::Pop();
-    }
-
-void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC8& aData)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TDesC8& aData)");
-    if(iParameters == 0)
-        return;
-    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
-    CleanupStack::PushL(field);
-    iParameters->iContactFields.AppendL(field);
-    CleanupStack::Pop();
-    }
-
-void CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TTime& aData)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToParamsL(TInt aFieldType, const TTime& aData)");
-    if(iParameters == 0)
-        return;
-    CCreatorContactField* field = CCreatorContactField::NewL(aFieldType, aData);
-    CleanupStack::PushL(field);
-    iParameters->iContactFields.AppendL(field);
-    CleanupStack::Pop();
-    }
-       
-//----------------------------------------------------------------------------
-TInt CCreatorVirtualPhonebook::iPhoneNumberFields[] =
-    {
-    R_VPBK_FIELD_TYPE_LANDPHONEGEN,
-    R_VPBK_FIELD_TYPE_LANDPHONEHOME,
-    R_VPBK_FIELD_TYPE_LANDPHONEWORK,                        
-    R_VPBK_FIELD_TYPE_MOBILEPHONEGEN,
-    R_VPBK_FIELD_TYPE_MOBILEPHONEHOME,
-    R_VPBK_FIELD_TYPE_MOBILEPHONEWORK,
-    R_VPBK_FIELD_TYPE_FAXNUMBERGEN,
-    R_VPBK_FIELD_TYPE_FAXNUMBERHOME,
-    R_VPBK_FIELD_TYPE_FAXNUMBERWORK,
-    R_VPBK_FIELD_TYPE_PAGERNUMBER,           
-    R_VPBK_FIELD_TYPE_VIDEONUMBERGEN,
-    R_VPBK_FIELD_TYPE_VIDEONUMBERHOME,
-    R_VPBK_FIELD_TYPE_VIDEONUMBERWORK,
-    R_VPBK_FIELD_TYPE_VOIPGEN,
-    R_VPBK_FIELD_TYPE_VOIPHOME,
-    R_VPBK_FIELD_TYPE_VOIPWORK,
-    R_VPBK_FIELD_TYPE_ASSTPHONE,
-    R_VPBK_FIELD_TYPE_CARPHONE
-    };
-
-TInt CCreatorVirtualPhonebook::iUrlFields[] =
-    {
-    R_VPBK_FIELD_TYPE_URLGEN,
-    R_VPBK_FIELD_TYPE_URLHOME,
-    R_VPBK_FIELD_TYPE_URLWORK
-    };
-
-TInt CCreatorVirtualPhonebook::iEmailFields[] =
-    {
-    R_VPBK_FIELD_TYPE_EMAILGEN,
-    R_VPBK_FIELD_TYPE_EMAILHOME,
-    R_VPBK_FIELD_TYPE_EMAILWORK
-    };
-
-void CCreatorVirtualPhonebook::InitializeContactParamsL(/*CCreatorModuleBaseParameters* aParameters*/)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::InitializeContactParamsL");        
-    iParameters = new (ELeave) CVirtualPhonebookParameters;
-        
-    iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
-    iParameters->iNumberOfURLFields = iNumberOfURLFields;
-    iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;       
-        
-    TPtrC firstname = iEngine->RandomString(CCreatorEngine::EFirstName);
-    TPtrC lastname  = iEngine->RandomString(CCreatorEngine::ESurname);               
-                    
-    if( iAddAllFields )
-        {
-        // Add text fields:
-        TInt textFieldCount = sizeof(CreatorVPbkMiscTextFields) / sizeof(FieldInfo);
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {                
-            CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkMiscTextFields[tfIndex].iFieldCode, KNullDesC);
-            CleanupStack::PushL(field);
-            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
-            iParameters->iContactFields.AppendL(field);
-            CleanupStack::Pop(field);
-            }
-            
-        // Add binary fields:
-        TInt binFieldCount = sizeof(CreatorVPbkBinaryFields) / sizeof(TInt);
-        for( TInt bfIndex = 0; bfIndex < binFieldCount; ++bfIndex )
-            {                
-            CCreatorContactField* field = CCreatorContactField::NewL(CreatorVPbkBinaryFields[bfIndex], KNullDesC8);
-            CleanupStack::PushL(field);
-            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
-            iParameters->iContactFields.AppendL(field);
-            CleanupStack::Pop(field);
-            }
-            
-        // Add date-time fields:
-        TInt dtFieldCount = sizeof(CreatorVPbkDateTimeFields) / sizeof(TInt);
-        for( TInt dtIndex = 0; dtIndex < dtFieldCount; ++dtIndex )
-            {
-            AddFieldToParamsL(CreatorVPbkDateTimeFields[dtIndex], iEngine->RandomDate(CCreatorEngine::EDateFuture));
-            }
-
-        AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJIMG, KNullDesC8);        
-        AddFieldToParamsL(R_VPBK_FIELD_TYPE_THUMBNAILPIC, KNullDesC8);        
-        AddFieldToParamsL(R_VPBK_FIELD_TYPE_CALLEROBJTEXT, firstname);
-        }
-    else
-        {                      
-        AddFieldToParamsL(R_VPBK_FIELD_TYPE_FIRSTNAME, firstname);            
-        AddFieldToParamsL(R_VPBK_FIELD_TYPE_LASTNAME, lastname);            
-        }
-                    
-    // Phone numbers:
-    TInt arraySize = sizeof(iPhoneNumberFields)/sizeof(TInt);
-    TInt index = 0;
-    for (TInt i=0; i<iParameters->iNumberOfPhoneNumberFields; i++ )
-        {            
-        if( index >= arraySize )
-            {
-            index = 0;
-            }
-        if( arraySize > 0  )
-            {
-            CCreatorContactField* field = CCreatorContactField::NewL(iPhoneNumberFields[index], KNullDesC);
-            CleanupStack::PushL(field);
-            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
-            iParameters->iContactFields.AppendL(field);
-            CleanupStack::Pop(field);
-            }
-        ++index;
-        }
-            
-       
-    // URLs:
-    arraySize = sizeof(iUrlFields)/sizeof(TInt);
-    index = 0;
-    for( TInt i = 0; i < iParameters->iNumberOfURLFields; ++i)
-        {
-        if( index >= arraySize )
-            {
-            index = 0;
-            }
-        if( arraySize > 0  )
-            {
-            CCreatorContactField* field = CCreatorContactField::NewL(iUrlFields[index], KNullDesC);
-            CleanupStack::PushL(field);
-            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
-            iParameters->iContactFields.AppendL(field);
-            CleanupStack::Pop(field);            
-            }
-        ++index;
-        }
-                    
-    // EMail addresses:
-    arraySize = sizeof(iEmailFields)/sizeof(TInt);
-    index = 0;
-    for( TInt i = 0; i < iParameters->iNumberOfEmailAddressFields; ++i)
-        {
-        if( index >= arraySize )
-            {
-            index = 0;
-            }
-        if( arraySize > 0  )
-            {
-            CCreatorContactField* field = CCreatorContactField::NewL(iEmailFields[index], KNullDesC);
-            CleanupStack::PushL(field);
-            field->SetRandomParametersL(CCreatorContactField::ERandomLengthDefault);
-            iParameters->iContactFields.AppendL(field);
-            CleanupStack::Pop(field);               
-            }
-        ++index;
-        }
-    }
-
-TInt CCreatorVirtualPhonebook::CreateContactEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateContactEntryL");
-    
-    delete iParameters;
-    iParameters = 0;
-    CVirtualPhonebookParameters* parameters = 0;
-    
-    if( aParameters == 0 )
-        {
-        InitializeContactParamsL();
-        parameters = iParameters;
-        }
-    else
-        {
-        parameters = (CVirtualPhonebookParameters*) aParameters;
-        }
-    
-    TInt err = KErrNone;
-
-    // create a new contact item
-    MVPbkStoreContact* newContact = iStore->CreateNewContactLC();
-    for( TInt i = 0; i < parameters->iContactFields.Count(); ++i )
-        {
-        CCreatorContactField* cField = parameters->iContactFields[i];
-        if( cField )
-            {
-            cField->AddToContactL(iEngine, *newContact, this);
-            }
-        }
-
-    RArray<MVPbkStoreContact*> contacts;
-    CleanupClosePushL( contacts );    
-    contacts.Append(newContact);        
-    
-    delete iOperation;
-    iOperation = NULL;
-    iLastError = KErrNone;
-    iOperation = iContactManager->CommitContactsL( contacts.Array(), *this );    
-    if ( iOperation )
-        {
-        iWaiter->StartAndWait();//Making asynchronous CommitContctsL to synchronous
-        delete iOperation;
-        iOperation = NULL;
-        }
-    User::LeaveIfError(iLastError);
-    
-    // store the link to contact, so that Creator is able to delete
-    // it when user requests deletion of contacts that are created by Creator 
-    MVPbkContactLink* linkToContact = newContact->CreateLinkLC();
-    if( linkToContact )
-        {
-        iContactsToDelete->AppendL( linkToContact );
-        CleanupStack::Pop(); // linkToContact
-        
-        // If this contact has a link id in script (i.e. belongs to a contact-set), we must cache the contact id:
-        if( parameters->ScriptLinkId() > 0 )
-            {                
-            RPointerArray<CCreatorContactSet>& contactsets = ContactLinkCache::Instance()->ContactSets();
-            TBool setFound(EFalse);
-            for(TInt i = 0; i < contactsets.Count(); ++i )
-                {
-                if( contactsets[i]->LinkId() == parameters->ScriptLinkId())
-                    {
-                    MVPbkContactLink* linkToContact = newContact->CreateLinkLC();
-                    if( linkToContact )
-                        {
-                        contactsets[i]->AppendL(linkToContact);
-                        iContactLinkArray->AppendL(linkToContact);
-                        CleanupStack::Pop(); // linkToContact
-                        }
-                    setFound = ETrue;
-                    break;
-                    }
-                }
-            if( !setFound )
-                {
-                LOGSTRING2("Error: Contact set id %d not found.", parameters->ScriptLinkId());
-                }
-            }
-        }
-    
-    CleanupStack::Pop();//contacts
-    contacts.Close();
-    CompactPbkDatabaseL();
-    CleanupStack::PopAndDestroy();//newContact
-    if ( iCancelCbRequested && iEngine ) iEngine->CancelComplete();
-    return err;
-    }
-
-
-//----------------------------------------------------------------------------
-
-void CCreatorVirtualPhonebook::AddImageToContactL(MVPbkStoreContact& aContact, TInt aFieldResId, const TDesC& aFileName)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::AddImageToContactL");
-    CPbk2ImageManager* imageMgr = CPbk2ImageManager::NewL(*iContactManager);
-    CleanupStack::PushL(imageMgr);
-    const MVPbkFieldTypeList& fieldList = aContact.ParentStore().StoreProperties().SupportedFields();        
-    const MVPbkFieldType* fieldType = fieldList.Find(aFieldResId);
-    if( fieldType == 0 )
-        {
-        return;
-        }
-    MPbk2ImageOperation* imageOp = 0;
-    TRAPD(err, imageOp = imageMgr->SetImageAsyncL(aContact, *fieldType, *this, aFileName));   
-    if( err == KErrNone)
-        {
-        if (imageOp)
-            {
-            CleanupDeletePushL( imageOp );
-            iWaiter->StartAndWait(); // Making asynchronous SetImageAsyncL to synchronous
-            CleanupStack::Pop(imageOp);
-            delete imageOp;
-            }
-        }    
-    else if(err != KErrNotSupported)
-        {
-        User::Leave(err);
-        }
-    CleanupStack::PopAndDestroy(imageMgr);        
-    }
-
-// Checks if the link is a group or not
-TBool CCreatorVirtualPhonebook::IsContactGroupL(const MVPbkContactLink& aLink)
-	{
-	LOGSTRING("Creator: CCreatorPhonebook::IsContactGroupL");
-	if( iStore )
-		{
-		delete iContactGroupsInStore;
-		iContactGroupsInStore = 0;
-		// Save contact group links here
-		iContactGroupsInStore = iStore->ContactGroupsLC();
-		CleanupStack::Pop();
-		}
-		
-	if( iContactGroupsInStore )
-		{
-		// Loop all the groups and check if any of them matches to the given link.
-		for( TInt i = 0; i < iContactGroupsInStore->Count(); ++i )
-			{
-			if( (*iContactGroupsInStore)[i].IsSame(aLink) )
-				return ETrue;
-			}
-		}
-	return EFalse;
-	}
-
-TInt CCreatorVirtualPhonebook::CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateGroupEntryL");
-    delete iParameters;
-    iParameters = 0;
-    
-    CVirtualPhonebookParameters* parameters = (CVirtualPhonebookParameters*) aParameters;
-    
-    if( !parameters )
-        {
-        iParameters = new (ELeave) CVirtualPhonebookParameters;
-        iParameters->iContactsInGroup = iContactsInGroup;
-        iParameters->iGroupName->Des().Copy( iEngine->RandomString(CCreatorEngine::EGroupName) );
-        iParameters->iGroupName->Des().Append( _L(" #") );
-        iParameters->iGroupName->Des().AppendNum( iEngine->RandomNumber(1000, 9999) );
-        parameters = iParameters;
-        }
-
-    TInt err = KErrNone;
- 
-    // create a new contact group    
-    MVPbkContactGroup* newGroup = iStore->CreateNewContactGroupLC();
-    
-    newGroup->SetGroupLabelL(parameters->iGroupName->Des());
-        
-    // define amounts of contacts to be added to the group
-    TInt amountOfContactsToBeAdded = 0;
-    if (parameters->iContactsInGroup == KCreateRandomAmountOfGroups)
-    	{
-        amountOfContactsToBeAdded = iEngine->RandomNumber(30);
-    	}
-    else 
-    	{
-        amountOfContactsToBeAdded = parameters->iContactsInGroup;
-    	}
-    
-    if( parameters->iLinkIds.Count() > 0 )
-        {
-        for( TInt i = 0; i < parameters->iLinkIds.Count(); ++i )
-            {
-            const CCreatorContactSet& set = ContactLinkCache::Instance()->ContactSet(parameters->iLinkIds[i].iLinkId);
-            
-            const RPointerArray<MVPbkContactLink>& links = set.ContactLinks();
-            TInt numberOfExplicitLinks = links.Count(); // Number of defined contacts in contact-set
-            TInt numberOfExistingContacts = set.NumberOfExistingContacts(); // Number of existing contacts in contact-set
-            TInt maxAmount = numberOfExplicitLinks + numberOfExistingContacts;
-            
-            if( parameters->iLinkIds[i].iLinkAmount > 0 )
-                maxAmount = parameters->iLinkIds[i].iLinkAmount; // Max amount is limited
-            
-            TInt addedMembers = 0;
-            
-            for( TInt j = 0; j < links.Count() && addedMembers < maxAmount; ++j )
-                {
-                MVPbkContactLink* link = links[j]; 
-                if( link && IsContactGroupL(*link) == EFalse )
-                    {
-                    TRAPD(err, newGroup->AddContactL(*link));
-                    if( err != KErrAlreadyExists )
-                    	{
-                    	// Ignore "allready exists" -error
-                    	User::LeaveIfError(err);
-                    	++addedMembers;
-                    	}                    
-                    }
-                }
-            if( addedMembers < maxAmount )
-            	{
-            	// Add existing contacts, withing the limits set by maxAmount:
-            	amountOfContactsToBeAdded += maxAmount - addedMembers;
-            	}
-            }
-        }
-    if( amountOfContactsToBeAdded > 0 )
-        {    
-        CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
-        CleanupStack::PushL( viewDef );
-        viewDef->SetType( EVPbkContactsView );
-        MVPbkContactView* contactView = iStore->CreateViewLC( 
-                *viewDef, 
-                *this, 
-                iStore->StoreProperties().SupportedFields() );
-        iWaiter->StartAndWait();//Making asynchronous CreateViewLC to synchronous
-
-        TInt cnt = 0;
-        // assign some random contacts to the group
-        for ( TInt y = 0; cnt < amountOfContactsToBeAdded && y < contactView->ContactCountL(); ++y )
-            {
-            MVPbkContactLink* link = contactView->CreateLinkLC( y );
-            if( link )
-                {
-                TRAPD( err, newGroup->AddContactL( *link ) );
-                CleanupStack::PopAndDestroy(); // link
-                if( err != KErrAlreadyExists )
-                    {
-                    // Ignore "allready exists" -error
-                    User::LeaveIfError( err );
-                    ++cnt;
-                    }
-                }
-            }
-        CleanupStack::PopAndDestroy(); // contactView
-        CleanupStack::PopAndDestroy( viewDef );
-        }
-    
-    newGroup->CommitL(*this);
-    iWaiter->StartAndWait(); //Making asynchronous CommitL to synchronous
-
-    // store the link to contact, so that Creator is able to delete
-    // it when user requests deletion of contacts that were created with Creator 
-    MVPbkContactLink* linkToContact = newGroup->CreateLinkLC();
-    if( linkToContact )
-        {
-        iContactGroupsToDelete->AppendL( linkToContact );
-        CleanupStack::Pop(); // linkToContact
-        }
-    
-    CleanupStack::PopAndDestroy(); // newGroup
-   
-    CompactPbkDatabaseL();
-
-    return err;
-
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorVirtualPhonebook::CreateSubscribedContactEntryL(CCreatorModuleBaseParameters* /*aParameters*/)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::CreateSubscribedContactEntryL");
-
-    return KErrNotSupported;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorVirtualPhonebook::AddFieldToContactItemL(
-		MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TDesC& aFieldText)
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
-
-    // Get field type object
-    const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();        
-    const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
-    if( fieldType == 0 )
-        return; // field type is not supported
-    
-    // Create a new field
-	MVPbkStoreContactField* newField = newContact.CreateFieldLC(*fieldType);	
-	if( !newField )
-	    {
-	    User::Leave(KErrNotSupported);
-	    }
-	
-	MVPbkContactFieldData& fieldData = newField->FieldData();
-	
-	//data type must be text in this case
-	TVPbkFieldStorageType dataType = fieldData.DataType();
-
-	if(dataType == EVPbkFieldStorageTypeText)
-	    {
-		//set text to field	
-		MVPbkContactFieldTextData& tmpData = MVPbkContactFieldTextData::Cast(fieldData);
-		tmpData.SetTextL(aFieldText);
-		//set field to contact		
-		newContact.AddFieldL(newField);//This object takes ownership of the field.
-		CleanupStack::Pop(newField);			
-	    }
-	else
-		{
-		User::Leave(KErrArgument);
-		}
-	
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorVirtualPhonebook::AddFieldToContactItemL(
-		MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TDesC8& aFieldText)
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
-
-	//get field types
-	const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();
-	
-	//get wanted field type
-	const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
-	
-	//create a new field
-	MVPbkStoreContactField* newField =
-	            newContact.CreateFieldLC(*fieldType);
-	//get field data	
-	MVPbkContactFieldData& fieldData = newField->FieldData();
-	
-	//data type must be text in this case
-	TVPbkFieldStorageType dataType = fieldData.DataType();
-
-	if(dataType == EVPbkFieldStorageTypeBinary){
-		//set bindata to field	
-		MVPbkContactFieldBinaryData& tmpData = MVPbkContactFieldBinaryData::Cast(fieldData);		
-		tmpData.SetBinaryDataL(aFieldText);
-		//set field to contact		
-		newContact.AddFieldL(newField);//This object takes ownership of the field.
-		CleanupStack::Pop(newField);			
-	}
-	else
-		{
-		CleanupStack::PopAndDestroy(newField);
-		}
-	
-    }
-
-void CCreatorVirtualPhonebook::AddFieldToContactItemL(
-        MVPbkStoreContact& newContact, TPbkFieldId aFieldId, const TTime& aFieldText)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::AddFieldToContactItemL");
-    //get field types
-    const MVPbkFieldTypeList& fieldList = newContact.ParentStore().StoreProperties().SupportedFields();
-        
-    //get wanted field type
-    const MVPbkFieldType* fieldType = fieldList.Find(aFieldId);
-        
-    //create a new field
-    MVPbkStoreContactField* newField = newContact.CreateFieldLC(*fieldType);
-    //get field data    
-    MVPbkContactFieldData& fieldData = newField->FieldData();
-        
-    //data type must be datetime in this case
-    TVPbkFieldStorageType dataType = fieldData.DataType();
-
-    if(dataType == EVPbkFieldStorageTypeDateTime)
-        {
-        //set bindata to field  
-        MVPbkContactFieldDateTimeData& tmpData = MVPbkContactFieldDateTimeData::Cast(fieldData);        
-        tmpData.SetDateTime(aFieldText);
-        //set field to contact      
-        newContact.AddFieldL(newField);//This object takes ownership of the field.
-        CleanupStack::Pop(newField);            
-        }
-    else
-        {
-        CleanupStack::PopAndDestroy(newField);
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorVirtualPhonebook::CompactPbkDatabaseL(TBool aCompressImmediately)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::CompactPbkDatabase");
-
-    iOpCounter++;
-
-    // compress the database immediately or after each 100th operation
-    if (aCompressImmediately || iOpCounter%100 == 0)
-        {
-        MVPbkContactOperationBase* operation= iContactManager->CompressStoresL(*this);
-        if (operation)
-            {
-            CleanupDeletePushL( operation );
-            iWaiter->StartAndWait();//Making asynchronous CompressStoresL to synchronous
-            CleanupStack::Pop(operation);
-            delete operation;
-            }             		 
-        }
-    }
-
-//----------------------------------------------------------------------------
-//Observer implementations for MVPbkContactStoreListObserver 
-//(and it's super class MVPbkContactStoreObserver)
-
-void CCreatorVirtualPhonebook::OpenComplete()
-	{
-	LOGSTRING("Creator: CCreatorVirtualPhonebook::OpenComplete()");
-    iWaiter->Cancel();
-	}
-
-void CCreatorVirtualPhonebook::StoreReady(MVPbkContactStore& /*aContactStore*/)
-	{
-	LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreReady()");
-	}
-
-
-void CCreatorVirtualPhonebook::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, 
-        TInt /*aReason*/)
-	{
-	LOGSTRING("Creator: CCreatorVirtualPhonebook::StoreUnavailable()");
-	}
-
-
-void CCreatorVirtualPhonebook::HandleStoreEventL(
-        MVPbkContactStore& /*aContactStore*/, 
-        TVPbkContactStoreEvent /*aStoreEvent*/)
-	{
-	LOGSTRING("Creator: CCreatorVirtualPhonebook::HandleStoreEventL()");
-	}
-
-
- TAny* CCreatorVirtualPhonebook::ContactStoreObserverExtension(
-		 TUid /*aExtensionUid*/) 
-        
- { 
- LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactStoreObserverExtension()");
- return NULL; 
- }
- 
- 
-//----------------------------------------------------------------------------
-//Observer implementation for MVPbkBatchOperationObserver
-
-void CCreatorVirtualPhonebook::StepComplete( 
-     MVPbkContactOperationBase& /*aOperation*/,
-     TInt /*aStepSize*/ )
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::StepComplete" );
-    
-	}
-
-
-TBool CCreatorVirtualPhonebook::StepFailed(
-     MVPbkContactOperationBase& /*aOperation*/,
-     TInt /*aStepSize*/, TInt aError )
-{
-	LOGSTRING2("Creator: CCreatorVirtualPhonebook::StepFailed - Error: %d", aError );
-	iLastError = aError;
-	iWaiter->Cancel();
-	return EFalse;
-}
-
-
-void CCreatorVirtualPhonebook::OperationComplete( 
-     MVPbkContactOperationBase& /*aOperation*/ )
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::OperationComplete" );
-    //Canceling waiter when operation is done.
-    iWaiter->Cancel();
-	}
-
-
-TAny* CCreatorVirtualPhonebook::BatchOperationObserverExtension( 
-     TUid /*aExtensionUid*/ ) 
-     {
-     LOGSTRING("Creator: CCreatorVirtualPhonebook::BatchOperationObserverExtension" );
-     return NULL;
-     }
-
-//----------------------------------------------------------------------------
-//Observer implementation for MVPbkContactFindObserver
-void CCreatorVirtualPhonebook::FindCompleteL( MVPbkContactLinkArray* aResults )
-  	 {
-  	 LOGSTRING("Creator: CCreatorVirtualPhonebook::FindCompleteL" );
-  	 if(iContactResults)
-  		 {
-  		 delete iContactResults;
-  		 iContactResults = NULL;
-  		 }
-  	 iContactResults = aResults;
-  	 iWaiter->Cancel();
-   	 }
-
-void CCreatorVirtualPhonebook::FindFailed( TInt aError )
- 	 {
- 	LOGSTRING2("Creator: CCreatorVirtualPhonebook::FindFailed - Error: %d", aError );
- 	iLastError = aError;
- 	iWaiter->Cancel();
-  	 }
-
-TAny* CCreatorVirtualPhonebook::ContactFindObserverExtension( 
-	                TUid /*aExtensionUid*/ )
-	 {
-	 LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactFindObserverExtension" );
-	 return NULL;
-	 }	                
-
-
-//Observer implementation for MVPbkContactObserver
-//----------------------------------------------------------------------------
-
-void CCreatorVirtualPhonebook::ContactOperationCompleted(TContactOpResult aResult)
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactOperationCompleted" );
-            
-	TContactOp op = aResult.iOpCode; 		 
-    switch ( op )
-        {
-        case EContactCommit:
-        case EContactDelete:
-            {
-            iWaiter->Cancel();
-            break;
-            }
-        case EContactLock:
-        default: break;
-        }
-	}
-	
-void CCreatorVirtualPhonebook::ContactOperationFailed
-			(TContactOp /*aOpCode*/, TInt aErrorCode, TBool /*aErrorNotified*/)
-	{
-    LOGSTRING2("Creator: CCreatorVirtualPhonebook::ContactOperationFailed - Error: %d", aErrorCode );
-    iLastError = aErrorCode;
-    iWaiter->Cancel();
-	}
-	
-TAny* CCreatorVirtualPhonebook::ContactObserverExtension(TUid /*aExtensionUid*/) 
-	{
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactObserverExtension" );
-    return NULL;
-	}
-
-void CCreatorVirtualPhonebook::Pbk2ImageSetComplete(MPbk2ImageOperation& /*aOperation*/)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::Pbk2ImageSetComplete" );
-    //Canceling waiter when operation is done.
-    iWaiter->Cancel();
-    }
-
-void CCreatorVirtualPhonebook::Pbk2ImageSetFailed(MPbk2ImageOperation& /*aOperation*/, TInt /*aError*/)
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::Pbk2ImageSetFailed" );
-    //Canceling waiter when operation is done.
-    iWaiter->Cancel();
-    }
-
-
-//Observer implementation for MVPbkContactViewObserver
-//----------------------------------------------------------------------------
-void CCreatorVirtualPhonebook::ContactViewReady( MVPbkContactViewBase& /*aView*/ )
-    {
-    LOGSTRING("Creator: CCreatorVirtualPhonebook::ContactViewReady" );
-    iWaiter->Cancel();
-    }
-
-void CCreatorVirtualPhonebook::ContactViewUnavailable(
-        MVPbkContactViewBase& /*aView*/ )
-    {
-    iWaiter->Cancel();
-    }
-
-void CCreatorVirtualPhonebook::ContactAddedToView(
-        MVPbkContactViewBase& /*aView*/, 
-        TInt /*aIndex*/, 
-        const MVPbkContactLink& /*aContactLink*/ )
-    {
-    }
-
-void CCreatorVirtualPhonebook::ContactRemovedFromView(
-        MVPbkContactViewBase& /*aView*/, 
-        TInt /*aIndex*/, 
-        const MVPbkContactLink& /*aContactLink*/ )
-    {
-    }
-        
-void CCreatorVirtualPhonebook::ContactViewError(
-        MVPbkContactViewBase& /*aView*/, 
-        TInt /*aError*/, 
-        TBool /*aErrorNotified*/ )
-    {
-    iWaiter->Cancel();
-    }
-
-/**
- * CCreatorContactFieldImpl Base class for contact field implementations
- */
-class CCreatorContactFieldImpl : public CBase
-    {
-public:        
-    virtual ~CCreatorContactFieldImpl() {};
-    
-    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
-    virtual void SetRandomParametersL(CCreatorContactField::TRandomLengthType aRandomLenType = CCreatorContactField::ERandomLengthDefault, TInt aRandomLen = 0 );
-    virtual void ParseL(CCommandParser* parser);
-     
-    virtual TInt FieldType();
-protected:
-    CCreatorContactFieldImpl(TInt aFieldType);    
-    TInt iFieldType;    
-    CCreatorContactField::TRandomLengthType iRandomLenType;
-    TInt iRandomLen;
-    };
-    
-void CCreatorContactFieldImpl::AddToContactL(CCreatorEngine* /*aEngine*/, MVPbkStoreContact& /*aContact*/, CCreatorVirtualPhonebook* /*aVPbk*/ )
-    {}
-
-void CCreatorContactFieldImpl::SetRandomParametersL(CCreatorContactField::TRandomLengthType aRandomLenType, TInt aRandomLen )
-    {    
-    iRandomLenType = aRandomLenType;
-    iRandomLen = aRandomLen;
-    }
-
-void CCreatorContactFieldImpl::ParseL(CCommandParser* /*parser*/)
-    {}
-    
-CCreatorContactFieldImpl::CCreatorContactFieldImpl(TInt aFieldType)
-    {
-    iFieldType = aFieldType;
-    }
-
-TInt CCreatorContactFieldImpl::FieldType()
-    {
-    return iFieldType;    
-    }
-
-
-/**
- * CCreatorContactTextField Text field implementation
- */
-class CCreatorContactTextField : public CCreatorContactFieldImpl
-    {
-    public:
-    static CCreatorContactTextField* NewL(TInt aFieldType, const TDesC& aData);
-    ~CCreatorContactTextField();
-    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);    
-    virtual void ParseL(CCommandParser* parser);
-    
-    protected:
-    virtual void SetDefaultRandomContentL(CCreatorEngine* aEngine);
-    virtual void SetExplicitRandomContentL(CCreatorEngine* aEngine, TInt aRandomLen);
-    
-    private:    
-    CCreatorContactTextField(TInt aFieldType);
-    void ConstructL(const TDesC& aData);
-    HBufC* iPtr;    
-    };
-    
-CCreatorContactTextField::CCreatorContactTextField(TInt aFieldType) 
-: CCreatorContactFieldImpl(aFieldType)
-    { }
-CCreatorContactTextField::~CCreatorContactTextField()
-    { 
-    delete iPtr; 
-    }
- void CCreatorContactTextField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
-     {
-     LOGSTRING("Creator: CCreatorContactTextField::AddToContactL"); 
-     if( aVPbk == 0 )
-         User::Leave(KErrArgument);
-               
-     if( iPtr == 0 || iPtr->Length() == 0)
-         {
-         switch( iRandomLenType )
-         {
-         case CCreatorContactField::ERandomLengthDefault:
-             {
-             SetDefaultRandomContentL(aEngine);
-             break;
-             }
-         case CCreatorContactField::ERandomLengthMax:
-             {
-             const MVPbkFieldTypeList& fieldList = aContact.ParentStore().StoreProperties().SupportedFields();
-             const MVPbkFieldType* fieldType = fieldList.Find(iFieldType);
-             if( fieldType == 0 )
-                 return; // field type is not supported
-                 
-             // Create a new field
-             MVPbkStoreContactField* newField = aContact.CreateFieldLC(*fieldType);    
-             if( !newField )
-                 {
-                 User::Leave(KErrNotSupported);
-                 }
-                 
-             MVPbkContactFieldData& fieldData = newField->FieldData();  
-             //data type must be text in this case
-             TVPbkFieldStorageType dataType = fieldData.DataType();
-
-             if(dataType == EVPbkFieldStorageTypeText)
-                 {
-                 //set text to field 
-                 MVPbkContactFieldTextData& tmpData = MVPbkContactFieldTextData::Cast(fieldData);
-                 iRandomLen = tmpData.MaxLength();
-                 if( iRandomLen == KVPbkUnlimitedFieldLength )
-                     iRandomLen = 128;
-                 }
-             CleanupStack::PopAndDestroy(newField);       
-             SetExplicitRandomContentL(aEngine, iRandomLen);
-             break;
-             }
-         case CCreatorContactField::ERandomLengthExplicit:
-             {
-             SetExplicitRandomContentL(aEngine, iRandomLen);
-             break;
-             }
-         default:
-             break;
-         }
-         }
-     if( iPtr )
-         {
-         if( iFieldType == R_VPBK_FIELD_TYPE_THUMBNAILPIC )
-             {
-             if( iPtr && iPtr->Length() > 0 )
-            	 {
-            	 aVPbk->AddImageToContactL(aContact, iFieldType, iPtr->Des());
-            	 }
-             }
-         //Thumbnail id handling
-         /*else if( iFieldType == FIELD_TYPE_THUMBNAILPIC_ID )
-             {
-             if( iPtr && iPtr->Length() > 0 )
-                 {
-                 TInt id = aEngine->GetAttachmentIdL(iPtr->Des());
-                 if( id != KUndef )
-                     {
-                     //get picture path by id
-                     TFileName sourceFileName = aEngine->TestDataPathL((CCreatorEngine::TTestDataPath)id);// (CCreatorEngine::TTestDataPath) parameters.iAttachments->At(i)
-                     //set image to contact
-                     aVPbk->AddImageToContactL(aContact, R_VPBK_FIELD_TYPE_THUMBNAILPIC, sourceFileName);                     
-                     }
-                 }
-             }*/         
-         else
-             {
-             if( iPtr && iPtr->Length() > 0 )
-            	 {
-            	 aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr->Des());
-            	 }
-             }
-         }
-     }
-
- void CCreatorContactTextField::SetDefaultRandomContentL(CCreatorEngine* aEngine)
-     {
-     LOGSTRING("Creator: CCreatorContactTextField::SetDefaultRandomContentL");
-     if( aEngine == 0 )
-         return;
-     
-     if( iPtr )
-         {
-         delete iPtr;
-         iPtr = 0;
-         }
-     TPtrC contentData;
-     
-     TInt textFieldCount = sizeof(CreatorVPbkMiscTextFields) / sizeof(FieldInfo);
-     TBool found = EFalse;
-     for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-         {
-         if( iFieldType == CreatorVPbkMiscTextFields[tfIndex].iFieldCode )
-             {
-             found = ETrue;
-             if( CreatorVPbkMiscTextFields[tfIndex].iRandomType != RND_TYPE_UNDEF )
-                 {
-                 contentData.Set(aEngine->RandomString((CCreatorEngine::TRandomStringType) CreatorVPbkMiscTextFields[tfIndex].iRandomType));
-                 }
-             else
-                 {
-                 switch( iFieldType )
-                 {
-                 case R_VPBK_FIELD_TYPE_RINGTONE:
-                     {
-                     contentData.Set(aEngine->CreateRandomSoundFileL());
-                     break;                 
-                     }
-                 //Thumbnail (path) and thumbnailid handling with random is the same, only in script they have different handling
-                 case R_VPBK_FIELD_TYPE_THUMBNAILPIC:                 
-                     {
-                     contentData.Set(aEngine->RandomPictureFileL());
-                     break;
-                     }
-                 case R_VPBK_FIELD_TYPE_SYNCCLASS:
-                 case R_VPBK_FIELD_TYPE_LOCPRIVACY:
-                     {
-                     _LIT(KPublic, "Public");
-                     contentData.Set(KPublic);
-                     break;
-                     }
-                 default:
-                     break;
-                 }
-                 }
-             break;
-             }
-         }
-     
-     if( found == EFalse )
-         {
-         TInt phNumFieldCount = sizeof(CreatorVPbkPhoneNumberFields) / sizeof(TInt);
-         for( TInt phIndex = 0; phIndex < phNumFieldCount; ++phIndex )
-             {
-             if( iFieldType == CreatorVPbkPhoneNumberFields[phIndex] )
-                 {
-                 contentData.Set(aEngine->RandomString(CCreatorEngine::EPhoneNumber));
-                 found = ETrue;
-                 break;
-                 }
-             }
-         }
-     
-     if( found == EFalse )
-         {
-         TInt emailFieldCount = sizeof(CreatorVPbkEmailFields) / sizeof(TInt);
-         for( TInt eIndex = 0; eIndex < emailFieldCount; ++eIndex )
-             {
-             if( iFieldType == CreatorVPbkEmailFields[eIndex] )
-                 {
-                 iPtr = aEngine->CreateEmailAddressLC();
-                 CleanupStack::Pop();
-                 return;
-                 }
-             }
-         }
-     iPtr = HBufC::NewL(contentData.Length());
-     iPtr->Des().Copy(contentData);
-     }
- 
- void CCreatorContactTextField::SetExplicitRandomContentL(CCreatorEngine* aEngine, TInt aRandomLen)
-     {     
-     LOGSTRING("Creator: CCreatorContactTextField::SetExplicitRandomContentL");
-     if( iPtr )
-         {
-         delete iPtr;
-         iPtr = 0;
-         }
-     iPtr = aEngine->CreateRandomStringLC(aRandomLen);
-     CleanupStack::Pop(); // iPtr
-     }
- 
- void CCreatorContactTextField::ParseL(CCommandParser* parser)
-     {
-     parser->StrParserL(iPtr, '|');
-     }
- 
- void CCreatorContactTextField::ConstructL(const TDesC& aData)
-      {     
-      iPtr = HBufC::New(KPhonebookFieldLength);
-      iPtr->Des().Copy(aData);
-      }
- 
- CCreatorContactTextField* CCreatorContactTextField::NewL(TInt aFieldType, const TDesC& aData)
-     {
-     CCreatorContactTextField* self = new (ELeave) CCreatorContactTextField(aFieldType);
-     CleanupStack::PushL(self);
-     self->ConstructL(aData);
-     CleanupStack::Pop();
-     return self;
-     }
- /**
-  * CCreatorContactBinaryField Binary field implementation
-  */
- class CCreatorContactBinaryField : public CCreatorContactFieldImpl
-    {
-public:
-    static CCreatorContactBinaryField* NewL(TInt aFieldType, const TDesC8& aData);
-    ~CCreatorContactBinaryField();  
-    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
-    virtual void ParseL(CCommandParser* parser);
-    virtual void SetDefaultRandomContentL(CCreatorEngine* aEngine);
-private:
-    CCreatorContactBinaryField(TInt aFieldType);
-    void ConstructL(const TDesC8& aData);
-    HBufC8* iPtr;    
-    };
- 
- CCreatorContactBinaryField::CCreatorContactBinaryField(TInt aFieldType) 
- : CCreatorContactFieldImpl(aFieldType)
-     { }
- CCreatorContactBinaryField::~CCreatorContactBinaryField()
-     { 
-     delete iPtr; 
-     }
-   
- void CCreatorContactBinaryField::ConstructL(const TDesC8& aData)
-     {
-     iPtr = HBufC8::New(KPhonebookFieldLength);
-     iPtr->Des() = aData;
-     }
- 
- CCreatorContactBinaryField* CCreatorContactBinaryField::NewL(TInt aFieldType, const TDesC8& aData)
-      {
-      CCreatorContactBinaryField* self = new (ELeave) CCreatorContactBinaryField(aFieldType);
-      CleanupStack::PushL(self);
-      self->ConstructL(aData);
-      CleanupStack::Pop();
-      return self;
-      }
- 
-void CCreatorContactBinaryField::AddToContactL(CCreatorEngine* /*aEngine*/, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
-    {
-    LOGSTRING("Creator: CCreatorContactBinaryField::AddToContactL");
-    if( aVPbk == 0 )
-        User::Leave(KErrArgument);
-    if( iPtr )
-        {
-            aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr->Des());
-        }
-    }
-void CCreatorContactBinaryField::ParseL(CCommandParser* parser)
-     {
-     parser->StrParserL(iPtr, '&');
-     }
-
-void CCreatorContactBinaryField::SetDefaultRandomContentL(CCreatorEngine* /*aEngine*/)
-    {
-    LOGSTRING("Creator: CCreatorContactBinaryField::SetDefaultRandomContentL");
-    }
-
-/**
- * CCreatorContactDateTimeField
- */ 
-class CCreatorContactDateTimeField : public CCreatorContactFieldImpl
-    {
-public:
-    static CCreatorContactDateTimeField* NewL(TInt aFieldType, const TTime& aData);
-    ~CCreatorContactDateTimeField();  
-    virtual void AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk);
-    virtual void ParseL(CCommandParser* parser);    
-private:
-CCreatorContactDateTimeField(TInt aFieldType);
-    void ConstructL(const TTime& aData);
-    TTime iPtr;    
-    };
- 
-CCreatorContactDateTimeField::CCreatorContactDateTimeField(TInt aFieldType) 
-: CCreatorContactFieldImpl(aFieldType)
-     { }
-CCreatorContactDateTimeField::~CCreatorContactDateTimeField()
-     {
-     }
-   
- void CCreatorContactDateTimeField::ConstructL(const TTime& aData)
-     {
-     iPtr = aData;
-     }
- 
- CCreatorContactDateTimeField* CCreatorContactDateTimeField::NewL(TInt aFieldType, const TTime& aData)
-      {
-      CCreatorContactDateTimeField* self = new (ELeave) CCreatorContactDateTimeField(aFieldType);
-      CleanupStack::PushL(self);
-      self->ConstructL(aData);
-      CleanupStack::Pop();
-      return self;
-      }
- 
-void CCreatorContactDateTimeField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
-    {
-    LOGSTRING("Creator: CCreatorContactDateTimeField::AddToContactL");
-    if( aVPbk == 0 )
-        User::Leave(KErrArgument);
-    
-    //TTime undefTime();
-    if( iPtr == Time::NullTTime() )
-        {
-        iPtr = aEngine->RandomDate(CCreatorEngine::EDateFuture);
-        }
-    
-    aVPbk->AddFieldToContactItemL(aContact, iFieldType, iPtr);    
-    }
-void CCreatorContactDateTimeField::ParseL(CCommandParser* /*parser*/)
-     {
-     //parser->StrParserL(iPtr, '&');
-     }
-
-/**
- * CCreatorContactField Contact field API
- */
-CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TDesC& aData)
-    {
-    CCreatorContactField* self = new (ELeave) CCreatorContactField();
-    CleanupStack::PushL(self);
-    self->ConstructL(aFieldType, aData);
-    CleanupStack::Pop();
-    return self;
-    }
-
-CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TDesC8& aData)
-    {
-    CCreatorContactField* self = new (ELeave) CCreatorContactField();
-    CleanupStack::PushL(self);
-    self->ConstructL(aFieldType, aData);
-    CleanupStack::Pop();
-    return self;
-    }
-
-CCreatorContactField* CCreatorContactField::NewL(TInt aFieldType, const TTime& aData)
-    {
-    CCreatorContactField* self = new (ELeave) CCreatorContactField();
-    CleanupStack::PushL(self);
-    self->ConstructL(aFieldType, aData);
-    CleanupStack::Pop();
-    return self;
-    }
-
-void CCreatorContactField::ConstructL(TInt aFieldType, const TDesC& aData)
-    {
-    pImpl = CCreatorContactTextField::NewL(aFieldType, aData); 
-    }
-
-void CCreatorContactField::ConstructL(TInt aFieldType, const TDesC8& aData)
-    {
-    pImpl = CCreatorContactBinaryField::NewL(aFieldType, aData);    
-    }
-
-void CCreatorContactField::ConstructL(TInt aFieldType, const TTime& aData)
-    {
-    pImpl = CCreatorContactDateTimeField::NewL(aFieldType, aData);    
-    }
-
-CCreatorContactField::CCreatorContactField()
-    {}
-CCreatorContactField::~CCreatorContactField()
-    {
-    delete pImpl;
-    }
- 
-TInt CCreatorContactField::FieldType()
-    {
-    return pImpl->FieldType();
-    }
-void CCreatorContactField::AddToContactL(CCreatorEngine* aEngine, MVPbkStoreContact& aContact, CCreatorVirtualPhonebook* aVPbk)
-    {
-    pImpl->AddToContactL(aEngine, aContact, aVPbk);
-    }
-void CCreatorContactField::ParseL(CCommandParser* parser)
-    {
-    pImpl->ParseL(parser);
-    }
-
-void CCreatorContactField::SetRandomParametersL(TRandomLengthType aRandomLenType, TInt aRandomLen )
-    {
-    pImpl->SetRandomParametersL(aRandomLenType, aRandomLen);
-    }
--- a/creator/src/creator_wepsecuritysettings.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "creator_traces.h"
-#include "creator_wepsecuritysettings.h"
-#include <commdb.h>
-//#include <featmgr.h>
-#include <wlancdbcols.h>
-
-//#include <commsdattypesv1_1.h>
-//#include <cmmanagertablefields.h>
-//#include <wlancontainer.h>
-
-
-
-//----------------------------------------------------------------------------
-
-CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewL()
-    {
-    CCreatorWEPSecuritySettings* self = CCreatorWEPSecuritySettings::NewLC();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorWEPSecuritySettings* CCreatorWEPSecuritySettings::NewLC()
-    {
-    CCreatorWEPSecuritySettings* self = new (ELeave) CCreatorWEPSecuritySettings;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-CCreatorWEPSecuritySettings::CCreatorWEPSecuritySettings()
-    {
-    }
-
-void CCreatorWEPSecuritySettings::ConstructL()
-    {
-    LOGSTRING("Creator: CCreatorWEPSecuritySettings::ConstructL");
-    }
-
-CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings()
-    {
-    LOGSTRING("Creator: CCreatorWEPSecuritySettings::~CCreatorWEPSecuritySettings");
-
-    
-    }
-
-    
-
-//----------------------------------------------------------------------------
-
-
-
-// ---------------------------------------------------------
-// CWEPSecuritySettingsImpl::SaveL
-// ---------------------------------------------------------
-//
-void CCreatorWEPSecuritySettings::SaveL( TUint32 /*aIapId*/, 
-                                      CCommsDatabase& /*aCommsDb*/ ) const
-    {
-    /*
-    // Data of the key
-    TBuf8<KMaxLengthOfKeyData> iKeyData[KMaxNumberofKeys];    
-    
-    CCommsDbTableView* wLanServiceTable;
-
-    // Caller MUST initiate a transaction, WE WILL NOT.
-
-    wLanServiceTable = aCommsDb.OpenViewMatchingUintLC( 
-                    TPtrC( WLAN_SERVICE ), TPtrC( WLAN_SERVICE_ID ), aIapId );
-    TInt errorCode = wLanServiceTable->GotoFirstRecord();
-
-    if ( errorCode == KErrNone )
-        {
-        wLanServiceTable->UpdateRecord();
-        }
-    else
-        {
-        TUint32 dummyUid( 0 ); //was KUidNone
-        User::LeaveIfError( wLanServiceTable->InsertRecord( dummyUid ) );
-
-        // Save link to LAN service
-        wLanServiceTable->WriteUintL( TPtrC( WLAN_SERVICE_ID ), aIapId );
-        }
-
-    // Save index of key in use
-    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_INDEX ), 
-                                 ( TUint32& ) iKeyInUse );
-
-    // Save index of key in use
-    wLanServiceTable->WriteUintL( TPtrC( NU_WLAN_AUTHENTICATION_MODE ), 
-                                 ( TUint32& ) iAuthentication );
-
-    // Save first WEP key
-    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY1 ), 
-                                  iKeyData[KFirstKey] );
-
-    // Save second WEP key
-    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY2 ), 
-                                  iKeyData[KSecondKey] );
-
-    // Save third WEP key
-    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY3 ), 
-                                  iKeyData[KThirdKey] );
-
-    // Save fourth WEP key
-    wLanServiceTable->WriteTextL( TPtrC( NU_WLAN_WEP_KEY4 ), 
-                                  iKeyData[KFourthKey] );
-
-    // Save the format of the keys
-    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY1_FORMAT ), 
-                                 ( TUint32& ) iKeyFormat[KFirstKey] );
-
-    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY2_FORMAT ), 
-                                 ( TUint32& ) iKeyFormat[KSecondKey] );
-
-    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY3_FORMAT ), 
-                                 ( TUint32& ) iKeyFormat[KThirdKey] );
-
-    wLanServiceTable->WriteUintL( TPtrC( WLAN_WEP_KEY4_FORMAT ), 
-                                 ( TUint32& ) iKeyFormat[KFourthKey] );
-
-    wLanServiceTable->PutRecordChanges();
-
-    CleanupStack::PopAndDestroy( wLanServiceTable );  // wLanServiceTable
-    */
-    }
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/engine.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,2566 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <EIKENV.H>
+#include <S32FILE.H> 
+#include <coemain.h>
+
+#include <datacreator.rsg>
+
+#include "mainview.h"
+#include "engine.h"
+#include "enginewrapper.h"
+
+
+#include <cntdb.h>//For Math
+
+
+#include "creator_traces.h"
+#include "creator_factory.h"
+#include "creator_scriptparser.h"
+#include "creator_file.h"
+#include "creator_cmdscriptrun.h"
+
+
+#include <apparc.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <bitmaptransforms.h>
+
+_LIT(KEDriveError, "Not available");
+_LIT(KTempPathDrive, "d");
+_LIT(KTempPath, ":\\Creator\\");
+_LIT(KSavingText, "Saving");
+_LIT(KDeletingText, "Deleting");
+const TInt KRegisterDrive = EDriveC;
+_LIT(KRegisterFileName, "creator_created_items.dat");
+_LIT(KResourceFileName, "z:\\Resource\\apps\\datacreator.RSC");
+
+
+// ---------------------------------------------------------------------------
+
+CCreatorEngine* CCreatorEngine::NewL(EngineWrapper *aEngineWrapper)
+    {
+    CCreatorEngine* self = CCreatorEngine::NewLC(aEngineWrapper);
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CCreatorEngine* CCreatorEngine::NewLC(EngineWrapper *aEngineWrapper)
+    {
+    CCreatorEngine* self = new (ELeave) CCreatorEngine();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngineWrapper);
+    return self;
+	}
+	
+// ---------------------------------------------------------------------------
+
+CCreatorEngine::CCreatorEngine() 
+: 
+CActive(0)
+{}
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::ConstructL(EngineWrapper *aEngineWrapper)
+    {
+    LOGSTRING("Creator: CCreatorEngine::ConstructL");
+
+    iEngineWrapper = aEngineWrapper;
+	iMemoryDetails.iENotAvailable = EFalse;
+	RequestMemoryDetails();
+    iEnv = CEikonEnv::Static();
+	// add second resource file to use for creator random data generation:
+	iResourceFileId = iEnv->AddResourceFileL(KResourceFileName);
+    User::LeaveIfError(iTimer.CreateLocal());
+
+    // these are needed by the random data generator
+    TTime now;
+    now.HomeTime();
+    iSeed=now.Int64();
+    
+    iTempPath = HBufC::NewL(KTempPathDrive().Length() + KTempPath().Length());
+    iTempPath->Des().Copy(KTempPathDrive);
+    iTempPath->Des().Append(KTempPath);
+	
+	iCmdScriptRun = CCreatorCmdScriptRun::NewL(this);
+
+    GetRandomDataFromFileL(KNullDesC);
+        
+    CActiveScheduler::Add(this);
+
+    }
+
+// ---------------------------------------------------------------------------
+
+CCreatorEngine::~CCreatorEngine()
+    {
+    LOGSTRING("Creator: CCreatorEngine::~CCreatorEngine");
+
+    Cancel();
+    
+    for( TInt i = 0; i < iStringArrays.Count(); ++i )
+        {
+        delete iStringArrays[i].iArrayPtr;
+        }
+    iStringArrays.Close();
+    iAllocatedFilePaths.ResetAndDestroy();
+    iAllocatedFilePaths.Close();
+    iTimer.Close();
+
+
+	iEnv->DeleteResourceFile(iResourceFileId);
+    
+    delete iPictureFileArray;
+    delete iSoundFileArray;
+    delete iTempPath;
+    delete iFrameImageData;
+    delete iEncoder;
+    delete iScaler;
+    delete iDecoder;
+    delete iScaledBitmap;
+    delete iBitmap;
+    delete iBitmapData;
+	
+    delete iCmdScriptRun;
+    iCmdScriptRun = NULL;	
+    }
+
+void CCreatorEngine::CopyFileL(const TFileName& aSourceFile, const TFileName& aTargetFile, TBool aOverwrite )
+	{
+	if( !aOverwrite && ConeUtils::FileExists(aTargetFile))
+		{
+		// File already exists
+		return;
+		}
+	
+	// Make sure that the path exists. Creates the directory if it does not exist already:
+	ConeUtils::EnsurePathExistsL(aTargetFile);	
+	User::LeaveIfError(BaflUtils::CopyFile(CEikonEnv::Static()->FsSession(), aSourceFile, aTargetFile));
+	}
+
+// ---------------------------------------------------------------------------
+	
+void CCreatorEngine::RequestMemoryDetails() 
+    {
+    // variables for memory and disk handling
+    TDriveNumber cDrive=EDriveC;
+    TDriveNumber dDrive=EDriveD;
+    TDriveNumber eDrive=EDriveE;
+    TVolumeInfo vinfo;
+    TBuf<16> cFree;
+    TBuf<16> dFree;
+    TBuf<16> eFree;
+    TBuf<16> cSize;
+    TBuf<16> dSize;
+    TBuf<16> eSize;
+
+    // get an access to file server
+    RFs& fsSession = CEikonEnv::Static()->FsSession();
+
+    // check the C-drive
+    fsSession.Volume(vinfo, cDrive);
+    iMemoryDetails.iCFree.Num(TInt64(vinfo.iFree/1024));
+    iMemoryDetails.iCSize.Num(TInt64(vinfo.iSize/1024));
+
+    // the same thing for D-drive
+    fsSession.Volume(vinfo, dDrive);
+	iMemoryDetails.iDFree.Num(TInt64(vinfo.iFree/1024));
+	iMemoryDetails.iDSize.Num(TInt64(vinfo.iSize/1024));
+
+    // the same thing for E-drive (MMC), if it exists 
+    if (MMC_OK())
+        {
+        fsSession.Volume(vinfo, eDrive);
+        iMemoryDetails.iEFree.Num(TInt64(vinfo.iFree/1024));
+		iMemoryDetails.iESize.Num(TInt64(vinfo.iSize/1024));
+
+        }
+	
+	else {
+		iMemoryDetails.iEFree = KEDriveError;
+		iMemoryDetails.iENotAvailable = ETrue;
+		}
+    // available work memory
+    TMemoryInfoV1Buf memory;
+    UserHal::MemoryInfo(memory);
+    TInt64 freeMemBytes=(TInt64)(memory().iFreeRamInBytes);
+    TInt64 sizeMemBytes=(TInt64)(memory().iTotalRamInBytes);
+    TInt64 sizeWorkMemBytes = sizeMemBytes; 
+    iMemoryDetails.iHFree.Num(TInt64(freeMemBytes/1024));
+    iMemoryDetails.iHSize.Num(TInt64(sizeWorkMemBytes/1024));
+    }
+
+// ---------------------------------------------------------------------------
+	
+TBool CCreatorEngine::MMC_OK() const
+	{
+	TBool MMCstatus = EFalse;
+
+	TDriveNumber eDrive=EDriveE;
+    TVolumeInfo vinfo;
+    TInt err = CEikonEnv::Static()->FsSession().Volume(vinfo, eDrive);
+	// check if we can access the E-drive:
+	if ( err == KErrNone)
+		{
+		MMCstatus = ETrue;
+		}
+	else
+		{
+		MMCstatus = EFalse;
+		}
+
+	// returns ETrue if MMC working properly
+	return MMCstatus;
+	}	
+	
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::ExecuteFirstCommandL(const TDesC& aText)
+    {
+    LOGSTRING("Creator: CCreatorEngine::ExecuteFirstCommand");
+
+    if( !iCommandArray->Count())
+        {
+        ShutDownEnginesL();
+        return;
+        }
+    
+    // show a progress dialog
+    iEngineWrapper->ShowProgressBar(aText, CommandArrayCount());	
+
+    iFailedCommands = 0;
+
+    // starts executing commands
+    ExecuteCommand();
+
+	
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::ExecuteCommand()
+    {
+    LOGSTRING("Creator: CCreatorEngine::ExecuteCommand");
+
+    // make sure the engine isn't active, should never happen
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("IsActive"), 500));
+
+    // execute a command after a very short delay (75ms)
+    iTimer.After(iStatus, 75);
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::RunL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::RunL");
+    LOGSTRING2("Creator: CCreatorEngine::RunL iCommandId=%d", iCommandArray->At(iCurrentEntry).iCommandId);
+    
+    if ( iUserCancelled ) 
+    	{
+    	return;
+    	}
+    
+    if (!iCommandArray->At(iCurrentEntry).iParameters)
+        {
+        LOGSTRING("Creator: CCreatorEngine::RunL - iParameters==NULL !");
+        }
+
+    // launch a command
+
+    TCreatorIds cmd = (TCreatorIds)iCommandArray->At(iCurrentEntry).iCommandId; 
+    switch( cmd )
+        {
+	    case ECmdCreateBrowserBookmarkEntries: { iBrowser->CreateBookmarkEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    case ECmdCreateBrowserBookmarkFolderEntries: { iBrowser->CreateBookmarkFolderEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    case ECmdCreateBrowserSavedPageEntries: { iBrowser->CreateSavedDeckEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    case ECmdCreateBrowserSavedPageFolderEntries: { iBrowser->CreateSavedDeckFolderEntryL(reinterpret_cast<CBrowserParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    
+        case ECmdCreateCalendarEntryAppointments: { iCalendar->CreateAppointmentEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+	    case ECmdCreateCalendarEntryEvents: { iCalendar->CreateEventEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+	    case ECmdCreateCalendarEntryAnniversaries: { iCalendar->CreateAnniversaryEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+	    case ECmdCreateCalendarEntryToDos: { iCalendar->CreateTodoEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+        case ECmdCreateCalendarEntryReminders: { iCalendar->CreateReminderEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+
+	    
+	    case ECmdCreatePhoneBookEntryContacts: { iPhonebook->CreateContactEntryL(iCommandArray->At(iCurrentEntry).iParameters) ; } break;
+	    case ECmdCreatePhoneBookEntryGroups: { iPhonebook->CreateGroupEntryL(iCommandArray->At(iCurrentEntry).iParameters) ; } break;
+	    case ECmdCreatePhoneBookEntrySubscribedContacts: { iPhonebook->CreateSubscribedContactEntryL(iCommandArray->At(iCurrentEntry).iParameters) ; } break;
+
+	    case ECmdCreateMiscEntryNotes: { iNotepad->CreateNoteEntryL(reinterpret_cast<CNotepadParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+
+	    case ECmdCreateLogEntryMissedCalls: { iLogs->CreateMissedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    case ECmdCreateLogEntryReceivedCalls: { iLogs->CreateReceivedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+	    case ECmdCreateLogEntryDialledNumbers: { iLogs->CreateDialledNumberEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+
+        case ECmdCreateMiscEntryAccessPoints: { iAccessPoints->CreateConnectionSettingsEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
+        case ECmdDeleteIAPs: { iAccessPoints->DeleteAllL(); } break;
+        case ECmdDeleteCreatorIAPs: { iAccessPoints->DeleteAllCreatedByCreatorL(); } break;
+
+        case ECmdCreateMiscEntryLandmarks: { iLandmarks->CreateLandmarkEntryL(reinterpret_cast<CLandmarkParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+        
+	    case ECmdCreateMessagingEntryMailboxes: { iMailboxes->CreateMailboxEntryL(reinterpret_cast<CMailboxesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+/*
+        #ifdef __PRESENCE
+  	     case ECmdCreateMiscEntryIMPSServers: { iIMPS->CreateIMPSServerEntryL(reinterpret_cast<CIMPSParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+        #endif
+*/
+	    case ECmdCreateMessagingEntryMessages:  { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters), ETrue); } break;
+	    case ECmdCreateMessagingEntryMessagesViaScript:  { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
+
+	    case ECmdCreateRandomEntrySMSInbox:
+	    case ECmdCreateRandomEntrySMSDrafts:
+	    case ECmdCreateRandomEntrySMSOutbox:
+	    case ECmdCreateRandomEntrySMSSent:
+	    case ECmdCreateRandomEntryMMSInbox:
+	    case ECmdCreateRandomEntryMMSDrafts:
+	    case ECmdCreateRandomEntryMMSOutbox:
+	    case ECmdCreateRandomEntryMMSSent:
+	    case ECmdCreateRandomEntryAMSInbox:
+	    case ECmdCreateRandomEntryAMSDrafts:
+	    case ECmdCreateRandomEntryAMSOutbox:
+	    case ECmdCreateRandomEntryAMSSent:
+	    case ECmdCreateRandomEntryEmailInbox:
+	    case ECmdCreateRandomEntryEmailDrafts:
+	    case ECmdCreateRandomEntryEmailOutbox:
+	    case ECmdCreateRandomEntryEmailSent:
+	    case ECmdCreateRandomEntryBIOInbox:
+	    case ECmdCreateRandomEntryBIODrafts:
+	    case ECmdCreateRandomEntryBIOOutbox:
+	    case ECmdCreateRandomEntryBIOSent:
+	    case ECmdCreateRandomEntryIRInbox:
+	    case ECmdCreateRandomEntryIRDrafts:
+	    case ECmdCreateRandomEntryIROutbox:
+	    case ECmdCreateRandomEntryIRSent:
+	    case ECmdCreateRandomEntryBTInbox:
+	    case ECmdCreateRandomEntryBTDrafts:
+	    case ECmdCreateRandomEntryBTOutbox:
+	    case ECmdCreateRandomEntryBTSent:
+	            { iMessages->CreateRandomMessageEntryL(iCommandArray->At(iCurrentEntry).iCommandId); } break;
+
+        case ECmdCreateFileEntryEmptyFolder:
+        case ECmdCreateFileEntry3GPP_70kB:
+        case ECmdCreateFileEntryAAC_100kB:
+        case ECmdCreateFileEntryAMR_20kB:
+        case ECmdCreateFileEntryBMP_25kB:
+        case ECmdCreateFileEntryDeck_1kB:
+        case ECmdCreateFileEntryDOC_20kB:
+        case ECmdCreateFileEntryGIF_2kB:
+        case ECmdCreateFileEntryHTML_20kB:
+        case ECmdCreateFileEntryJAD_1kB:
+        case ECmdCreateFileEntryJAR_10kB:
+        case ECmdCreateFileEntryJP2_65kB:
+        case ECmdCreateFileEntryJPEG_200kB:
+        case ECmdCreateFileEntryJPEG_25kB:
+        case ECmdCreateFileEntryJPEG_500kB:
+        case ECmdCreateFileEntryMIDI_10kB:
+        case ECmdCreateFileEntryMP3_250kB:
+        case ECmdCreateFileEntryMP4_200kB:
+        case ECmdCreateFileEntryMXMF_40kB:
+        case ECmdCreateFileEntryPNG_15kB:
+        case ECmdCreateFileEntryPPT_40kB:
+        case ECmdCreateFileEntryRAM_1kB:
+        case ECmdCreateFileEntryRM_95kB:
+        case ECmdCreateFileEntryRNG_1kB:
+        case ECmdCreateFileEntrySVG_15kB:
+        case ECmdCreateFileEntrySWF_15kB:
+        case ECmdCreateFileEntryTIF_25kB:
+        case ECmdCreateFileEntryTXT_10kB:
+        case ECmdCreateFileEntryTXT_70kB:
+        case ECmdCreateFileEntryVCF_1kB:
+        case ECmdCreateFileEntryVCS_1kB:
+        case ECmdCreateFileEntryWAV_20kB:
+        case ECmdCreateFileEntryXLS_15kB:
+        case ECmdCreateFileEntrySISX_10kB:
+        case ECmdCreateFileEntryWMA_50kB:
+        case ECmdCreateFileEntryWMV_200kB:
+	            { iFiles->CreateFileEntryL( reinterpret_cast<CFilesParameters*>(iCommandArray->At(iCurrentEntry).iParameters), iCommandArray->At(iCurrentEntry).iCommandId ); } break;
+        case ECmdDeleteContacts:
+            {
+            iPhonebook->DeleteAllL(); 
+            break;
+            }
+        case ECmdDeleteContactGroups:
+            {
+            iPhonebook->DeleteAllGroupsL();
+            break;            
+            }
+        case ECmdDeleteCreatorContacts:
+            {
+            iPhonebook->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteCreatorContactGroups:
+            {
+            iPhonebook->DeleteAllGroupsCreatedByCreatorL();
+            break;            
+            }
+        case ECmdDeleteCalendarEntries:
+            {
+            iCalendar->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorCalendarEntries:
+            {
+            iCalendar->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteLogs:
+            {
+            iLogs->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorLogs:
+            {
+            iLogs->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteMessages:
+            {
+            iMessages->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorMessages:
+            {
+            iMessages->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteLandmarks:
+            {
+            iLandmarks->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorLandmarks:
+            {
+            iLandmarks->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteMailboxes:
+            {
+            iMailboxes->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorMailboxes:
+            {
+            iMailboxes->DeleteAllCreatedByCreatorL();
+            break;
+            }
+
+        case ECmdDeleteNotes:
+            {
+            iNotepad->DeleteAllL();
+            break;
+            }
+/*
+        case ECmdDeleteIMPSs:
+            {
+            iIMPS->DeleteAllL();
+            break;
+            }
+        case ECmdDeleteCreatorIMPSs:
+            {
+            iIMPS->DeleteAllCreatedByCreatorL();
+            break;
+            }
+*/
+        case ECmdDeleteBrowserBookmarks:
+            {
+            iBrowser->DeleteAllBookmarksL();
+            break;
+            }
+        case ECmdDeleteCreatorBrowserBookmarks:
+            {
+            iBrowser->DeleteAllBookmarksCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteBrowserBookmarkFolders:
+            {
+            iBrowser->DeleteAllBookmarkFoldersL();
+            break;
+            }
+        case ECmdDeleteCreatorBrowserBookmarkFolders:
+            {
+            iBrowser->DeleteAllBookmarkFoldersCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteBrowserSavedPages:
+            {
+            iBrowser->DeleteAllSavedPagesL();
+            break;
+            }
+        case ECmdDeleteCreatorBrowserSavedPages:
+            {
+            iBrowser->DeleteAllSavedPagesCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteBrowserSavedPageFolders:
+            {
+            iBrowser->DeleteAllSavedPageFoldersL();
+            break;
+            }
+        case ECmdDeleteCreatorBrowserSavedPageFolders:
+            {
+            iBrowser->DeleteAllSavedPageFoldersCreatedByCreatorL();
+            break;
+            }
+        case ECmdDeleteCreatorFiles:
+            {
+            iFiles->DeleteAllCreatedByCreatorL();
+            break;
+            }
+        default:
+            User::Panic (_L("ExecuteOptionsMenuCommandL"), 205);
+            break;
+        }
+
+    TRAP_IGNORE( CheckForMoreCommandsL() );
+
+    }
+    
+CDesCArrayFlat* CCreatorEngine::PictureFilesL()
+    {
+    if( iPictureFileArray == 0 )
+        {
+        _LIT(KImageFile, "JPEG*.jpg");
+        _LIT(KImageFileDir, "C:\\Data\\");
+        _LIT(KImageFileDir2, "Z:\\Data\\");
+        iPictureFileArray = new (ELeave) CDesCArrayFlat(8);        
+        TInt err = CreatorFileUtils::FindFilesRecursiveL(iPictureFileArray, KImageFile, KImageFileDir);
+        if( iPictureFileArray->Count() == 0 )
+            {
+            err = CreatorFileUtils::FindFilesRecursiveL(iPictureFileArray, KImageFile, KImageFileDir2);
+            }
+        }
+    return iPictureFileArray;
+    }
+
+CDesCArrayFlat* CCreatorEngine::SoundFilesL()
+    {
+    if( iSoundFileArray == 0 )
+        {
+        _LIT(KSoundFile, "*.aac");
+        _LIT(KSoundFileDir, "Z:\\data\\Sounds\\");
+        iSoundFileArray = new (ELeave) CDesCArrayFlat(8);                  
+        TInt err = CreatorFileUtils::FindFilesRecursiveL(iSoundFileArray, KSoundFile, KSoundFileDir);
+        }
+    return iSoundFileArray;
+    }
+// ---------------------------------------------------------------------------
+
+TInt CCreatorEngine::RunError(TInt aError)
+    {
+    LOGSTRING2("Creator: CCreatorEngine::RunError %d", aError);
+    
+    iFailedCommands++;
+  
+    _LIT(KMessage, "Command error %d");
+    TBuf<128> noteMsg;
+    noteMsg.Format(KMessage, aError);
+//    iEnv->InfoMsg(noteMsg);
+	iEngineWrapper->ShowNote(noteMsg);  
+    TRAP_IGNORE( CheckForMoreCommandsL() );
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::CheckForMoreCommandsL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL");
+    if ( iUserCancelled ) 
+		{
+		return;
+		}
+    // update the progress bar
+    //iProgressInfo->IncrementAndDraw(1);
+	iEngineWrapper->IncrementProgressbarValue();
+
+	// check if we have more commands to be executed
+	if (iCurrentEntry >= CommandArrayCount() - 1)
+		{
+        LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL all done");
+
+        // all done, free resources and show a note
+        ShutDownEnginesL();
+
+		//iProgressDialog->ProcessFinishedL();
+		
+		// remove the progress dialog from the screen
+        iEngineWrapper->CloseProgressbar();
+		//ProgressDialogCancelledL();
+		
+		if (iFailedCommands == 0)
+		    {
+		    iEngineWrapper->ShowNote(_L("Done"));
+		    }
+		else
+		    {
+			_LIT(KMessage, "Done, %d commands failed");
+            TBuf<128> noteMsg;
+            noteMsg.Format(KMessage, iFailedCommands);
+			iEngineWrapper->ShowNote(noteMsg);
+		    }
+		
+	    iCmdScriptRun->RunScriptDone();
+
+		}
+	else
+		{
+		// maintain requests
+		iCurrentEntry++;
+
+        LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
+
+        ExecuteCommand();
+		}
+    }
+
+// ---------------------------------------------------------------------------
+
+// This callback function is called when cancel button of the progress bar was pressed
+
+void CCreatorEngine::ProgressDialogCancelledL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::ProgressDialogCancelledL");
+
+        iUserCancelled = ETrue;
+        // cancel the active object, command executer 
+        Cancel();
+
+        // delete parameters from the command array, otherwise there might be memory leaks
+        for (TInt i=iCurrentEntry; i<CommandArrayCount(); i++)
+            {
+            if ( iCommandArray->At(i).iParameters )
+				{
+                delete iCommandArray->At(i).iParameters;
+                iCommandArray->At(i).iParameters = NULL;
+				}
+            }
+
+        if ( iPhonebook /*&& iPhonebook->IsActive()*/ )
+            {
+            // virtual phonebook is known to require asynchronous
+            // cancelling of operation
+            }
+        else if ( iDecoder  )
+            {
+            iDecoder->Cancel();
+            // CancelComplete() will be called from GenerateSourceImageFileL
+            }
+        else if ( iScaler )
+            {
+            iScaler->Cancel();
+            // CancelComplete() will be called from GenerateSourceImageFileL
+            }
+        else if ( iEncoder  )
+            {
+            iEncoder->Cancel();
+            // CancelComplete() will be called from GenerateSourceImageFileL
+            }
+        else
+            {
+            // free resources and show a note
+            ShutDownEnginesL();
+            iEngineWrapper->ShowNote(_L("Cancelled"));
+            }
+        
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::StartEnginesL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::StartEnginesL");
+    
+    // reset user cancel flag
+    iUserCancelled = EFalse;
+    
+    // start from the beginning
+    iCurrentEntry = 0;
+
+    // we'll retrieve a correct number for this later
+    iEntriesToBeCreated = 0;
+
+    // init the command array
+    __ASSERT_ALWAYS(!iCommandArray, User::Panic(_L("iCommandArray"), 701));
+    iCommandArray = new(ELeave) CCommandArray(10000);
+
+    // init all modules here
+    TInt err(KErrNone);
+    TRAP(err, iBrowser = CCreatorBrowser::NewL(this));
+    TRAP(err, iCalendar = CCreatorInterimCalendar::NewL(this));
+    TRAP(err, iPhonebook = (CCreatorPhonebookBase*)TCreatorFactory::CreatePhoneBookL(this)); 
+    TRAP(err, iNotepad = CCreatorNotepad::NewL(this));
+    TRAP(err, iLogs = CCreatorLogs::NewL(this));
+    TRAP(err, iAccessPoints = (CCreatorConnectionSettingsBase*)TCreatorFactory::CreateConnectionSettingsL(this));
+    TRAP(err, iMailboxes = CCreatorMailboxes::NewL(this));
+    TRAP(err, iFiles = CCreatorFiles::NewL(this));
+    TRAP(err, iMessages = CCreatorMessages::NewL(this));
+    TRAP(err, iLandmarks = CCreatorLandmarks::NewL(this));
+/*
+    #ifdef __PRESENCE
+      TRAP(err, iIMPS = CCreatorIMPS::NewL(this));
+    #endif 
+*/
+      
+      
+    // ...
+    // ...
+    // ...
+
+    }
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::ShutDownEnginesL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::ShutDownEnginesL");
+
+        
+    // delete all modules here and free resources which aren't anymore needed
+
+/*
+    #ifdef __PRESENCE
+     delete iIMPS;
+     iIMPS = NULL;
+    #endif
+*/
+    delete iMessages;
+    iMessages = NULL;
+    delete iFiles;
+    iFiles = NULL;
+    delete iMailboxes;
+    iMailboxes = NULL;
+    delete iAccessPoints;
+    iAccessPoints = NULL;
+    delete iLogs;
+    iLogs = NULL;
+    delete iNotepad;
+    iNotepad = NULL;
+    delete iPhonebook;
+    iPhonebook = NULL;
+    delete iCalendar;
+    iCalendar = NULL;
+    delete iBrowser;
+    iBrowser = NULL;
+    delete iLandmarks;
+    iLandmarks = NULL;
+
+    // now delete the command array
+    delete iCommandArray;
+    iCommandArray = NULL;
+	
+	// delete parameter array
+	iParameterArray.ResetAndDestroy();
+	iParameterArray.Close();
+    
+	// clear temp drive
+	CFileMan* fileMan = CFileMan::NewL( iEnv->FsSession() );
+	CleanupStack::PushL( fileMan );
+	fileMan->RmDir( iTempPath->Des() );
+	CleanupStack::PopAndDestroy(); //fileMan
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::DoCancel()
+    {
+    LOGSTRING("Creator: CCreatorEngine::DoCancel");
+
+    iTimer.Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::RunScriptL()
+    {
+    LOGSTRING("Creator: CCreatorEngine::RunScriptL");
+
+    // startup modules (also inits the command array):
+    StartEnginesL();
+
+    // use the command parser module to init the command array from a script file
+    CCommandParser* commandParser = CCommandParser::NewLC(this);
+    RFile scriptFile;
+    TBool ret = commandParser->OpenScriptL(scriptFile);
+    CleanupClosePushL(scriptFile);
+    if( ret )
+        {
+        // wait dialog
+		/* TODO
+        CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+        waitDialog->SetSoftkeys( R_AVKON_SOFTKEYS_CANCEL );
+        TInt dialogId = waitDialog->ShowNoteL( EAknGlobalWaitNote, _L("Parsing") );
+        */
+        TInt parseErr( KErrNone );
+        TRAPD( parserErr,
+               CCreatorScriptParser* scriptParser = CCreatorScriptParser::NewLC(this);
+               scriptParser->ParseL(scriptFile);
+               parseErr = scriptParser->GetError();
+               CleanupStack::PopAndDestroy( scriptParser );
+             );
+        //waitDialog->CancelNoteL( dialogId );
+        //CleanupStack::PopAndDestroy( waitDialog );
+        User::LeaveIfError( parserErr );
+        
+        if(parseErr != KErrNone)
+            {
+			
+            // show error note
+            _LIT(KErrMsg, "Parser error: %d");
+            TBuf<32> msgBuf;
+            msgBuf.Format(KErrMsg, parseErr);
+            iEngineWrapper->ShowNote(msgBuf);
+            CleanupStack::PopAndDestroy(); //commandParser   
+            ShutDownEnginesL();
+            return;
+            }         
+        }
+    CleanupStack::PopAndDestroy( &scriptFile );
+    CleanupStack::PopAndDestroy( commandParser );   
+
+    // start executing commands if commands in the command array
+    if (CommandArrayCount() > 0)
+        {
+        ExecuteFirstCommandL( KSavingText );
+        }
+    else
+        {
+        ShutDownEnginesL();
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CCreatorEngine::RunScriptL(const TDesC& aScriptFile)
+    {
+    LOGSTRING("Creator: CCreatorEngine::RunScriptL");
+
+    // startup modules (also inits the command array):
+    StartEnginesL();
+
+    RFile scriptFile;
+    if (scriptFile.Open(CEikonEnv::Static()->FsSession(), aScriptFile, EFileRead) != KErrNone)
+    	{
+    	ShutDownEnginesL();
+    	return KErrNotFound; // file error
+    	}
+    
+    CleanupClosePushL(scriptFile);
+    CCreatorScriptParser* scriptParser = CCreatorScriptParser::NewLC(this);
+    scriptParser->ParseL(scriptFile);
+    TInt err = scriptParser->GetError();
+    CleanupStack::PopAndDestroy(); //scriptParser
+    CleanupStack::Pop(); // scriptFile
+    scriptFile.Close();
+        
+    if (err != KErrNone)
+        {
+        ShutDownEnginesL();
+        return KErrCorrupt; // parser error
+        }         
+
+    // start executing commands if commands in the command array
+    if (CommandArrayCount() > 0)
+        {
+        ExecuteFirstCommandL( KSavingText );
+        return KErrNone; // executing commands is started
+        }
+    else
+        {
+        ShutDownEnginesL();
+        return KErrCompletion; // nothing to do
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::ExecuteOptionsMenuCommandL(TInt aCommand)
+    {
+    LOGSTRING("Creator: CCreatorEngine::ExecuteOptionsMenuCommandL");
+
+    // startup modules (also inits the command array):
+    StartEnginesL();
+
+    // set the home module
+    switch(aCommand)
+        {
+	    case ECmdCreateBrowserBookmarkEntries:
+	    case ECmdCreateBrowserBookmarkFolderEntries:
+	    case ECmdCreateBrowserSavedPageEntries:
+	    case ECmdCreateBrowserSavedPageFolderEntries:
+	    case ECmdDeleteBrowserBookmarks:
+	    case ECmdDeleteBrowserBookmarkFolders:
+	    case ECmdDeleteBrowserSavedPages:
+	    case ECmdDeleteBrowserSavedPageFolders:
+        case ECmdDeleteCreatorBrowserBookmarks:
+        case ECmdDeleteCreatorBrowserBookmarkFolders:
+        case ECmdDeleteCreatorBrowserSavedPages:
+        case ECmdDeleteCreatorBrowserSavedPageFolders:
+            {
+            iUsedOptionsMenuModule = iBrowser;
+            }
+            break;
+	    
+        case ECmdCreateCalendarEntryAppointments:
+	    case ECmdCreateCalendarEntryEvents:
+	    case ECmdCreateCalendarEntryAnniversaries:
+	    case ECmdCreateCalendarEntryToDos:
+	    case ECmdCreateCalendarEntryReminders:
+	    case ECmdDeleteCalendarEntries:
+	    case ECmdDeleteCreatorCalendarEntries:
+            {
+            iUsedOptionsMenuModule = iCalendar;
+            }
+            break;
+
+	    case ECmdCreatePhoneBookEntryContacts:
+	    case ECmdCreatePhoneBookEntryGroups:
+	    case ECmdCreatePhoneBookEntrySubscribedContacts:
+	    case ECmdDeleteContacts:
+	    case ECmdDeleteCreatorContacts:
+        case ECmdDeleteContactGroups:
+        case ECmdDeleteCreatorContactGroups:
+            {
+            iUsedOptionsMenuModule = iPhonebook;
+            }
+            break;
+
+	    case ECmdCreateMiscEntryNotes:
+	    case ECmdDeleteNotes:
+            {
+            iUsedOptionsMenuModule = iNotepad;
+            }
+            break;
+
+	    case ECmdCreateLogEntryMissedCalls:
+	    case ECmdCreateLogEntryReceivedCalls:
+	    case ECmdCreateLogEntryDialledNumbers:
+	    case ECmdDeleteLogs:
+	    case ECmdDeleteCreatorLogs:
+            {
+            iUsedOptionsMenuModule = iLogs;
+            }
+            break;
+
+	    case ECmdCreateMiscEntryAccessPoints:
+	    case ECmdDeleteIAPs:
+	    case ECmdDeleteCreatorIAPs:
+            {
+            iUsedOptionsMenuModule = iAccessPoints;
+            }
+            break;
+
+	    case ECmdCreateMessagingEntryMailboxes:
+	    case ECmdDeleteMailboxes:
+	    case ECmdDeleteCreatorMailboxes:
+            {
+            iUsedOptionsMenuModule = iMailboxes;
+            }
+            break;
+/*
+        #ifdef __PRESENCE
+	      case ECmdCreateMiscEntryIMPSServers:
+	      case ECmdDeleteIMPSs:
+	      case ECmdDeleteCreatorIMPSs:
+            {
+            iUsedOptionsMenuModule = iIMPS;
+            }
+            break;
+        #endif
+*/
+	      case ECmdCreateFileEntryEmptyFolder:
+	      case ECmdCreateFileEntry3GPP_70kB:
+	      case ECmdCreateFileEntryAAC_100kB:
+	      case ECmdCreateFileEntryAMR_20kB:
+	      case ECmdCreateFileEntryBMP_25kB:
+	      case ECmdCreateFileEntryDeck_1kB:
+	      case ECmdCreateFileEntryDOC_20kB:
+	      case ECmdCreateFileEntryGIF_2kB:
+	      case ECmdCreateFileEntryHTML_20kB:
+	      case ECmdCreateFileEntryJAD_1kB:
+	      case ECmdCreateFileEntryJAR_10kB:
+	      case ECmdCreateFileEntryJP2_65kB:
+	      case ECmdCreateFileEntryJPEG_200kB:
+	      case ECmdCreateFileEntryJPEG_25kB:
+	      case ECmdCreateFileEntryJPEG_500kB:
+	      case ECmdCreateFileEntryMIDI_10kB:
+	      case ECmdCreateFileEntryMP3_250kB:
+	      case ECmdCreateFileEntryMP4_200kB:
+	      case ECmdCreateFileEntryMXMF_40kB:
+	      case ECmdCreateFileEntryPNG_15kB:
+	      case ECmdCreateFileEntryPPT_40kB:
+	      case ECmdCreateFileEntryRAM_1kB:
+	      case ECmdCreateFileEntryRM_95kB:
+	      case ECmdCreateFileEntryRNG_1kB:
+	      case ECmdCreateFileEntrySVG_15kB:
+	      case ECmdCreateFileEntrySWF_15kB:
+	      case ECmdCreateFileEntryTIF_25kB:
+	      case ECmdCreateFileEntryTXT_10kB:
+	      case ECmdCreateFileEntryTXT_70kB:
+	      case ECmdCreateFileEntryVCF_1kB:
+	      case ECmdCreateFileEntryVCS_1kB:
+	      case ECmdCreateFileEntryWAV_20kB:
+	      case ECmdCreateFileEntryXLS_15kB:
+	      case ECmdCreateFileEntrySISX_10kB:
+	      case ECmdCreateFileEntryWMA_50kB:
+	      case ECmdCreateFileEntryWMV_200kB:
+	      case ECmdDeleteCreatorFiles:
+
+            {
+            iUsedOptionsMenuModule = iFiles;
+            }
+            break;
+
+
+        case ECmdCreateMessagingEntryMessages:
+        case ECmdDeleteMessages:
+        case ECmdDeleteCreatorMessages:
+            {
+            iUsedOptionsMenuModule = iMessages;
+            }
+            break;
+            
+        case ECmdCreateMiscEntryLandmarks:
+        case ECmdDeleteLandmarks:
+        case ECmdDeleteCreatorLandmarks:
+            {
+            iUsedOptionsMenuModule = iLandmarks;
+            }
+            break;
+        case ECmdDeleteAllEntries:
+        case ECmdDeleteAllCreatorEntries:
+            {
+            break;
+            }
+        default:
+            User::Panic (_L("ExecuteOptionsMenuCommandL"), 201);
+            break;
+        }
+
+
+    //If it's a delete command, asking do you really want to delete
+    if( IsDeleteCommand( aCommand ) )
+        {
+        if ( aCommand == ECmdDeleteAllEntries )
+            {
+            if ( iEngineWrapper->YesNoQueryDialog( _L("Delete all entries?") ) )
+                {
+                AppendToCommandArrayL( ECmdDeleteContacts, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteContactGroups, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCalendarEntries, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteBrowserBookmarks, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteBrowserBookmarkFolders, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteBrowserSavedPages, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteBrowserSavedPageFolders, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteLogs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteIAPs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteLandmarks, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
+                
+                // started exucuting delete commands
+                ExecuteFirstCommandL( KDeletingText );
+                }
+            else
+                {
+                // cancelled, free resources
+                ShutDownEnginesL();
+                }
+            }
+        else if ( aCommand == ECmdDeleteAllCreatorEntries )
+            {
+            if ( iEngineWrapper->YesNoQueryDialog( _L("Delete all entries created with Creator?") ) )
+                {
+                AppendToCommandArrayL( ECmdDeleteCreatorContacts, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorContactGroups, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorCalendarEntries, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarks, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarkFolders, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPages, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPageFolders, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorLogs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorIAPs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
+                AppendToCommandArrayL( ECmdDeleteCreatorLandmarks, NULL, 1 );
+                
+                // started exucuting delete commands
+                ExecuteFirstCommandL( KDeletingText );
+                }
+            else
+                {
+                // cancelled, free resources
+                ShutDownEnginesL();
+                }
+            }
+        else if ( iUsedOptionsMenuModule->AskDataFromUserL( aCommand, iEntriesToBeCreated )  )
+            {
+            // add this command to command array
+            AppendToCommandArrayL( aCommand, NULL, 1 );
+    
+            // started exucuting commands
+            ExecuteFirstCommandL( KDeletingText );        
+            }
+        else
+            {
+            // cancelled, free resources
+            ShutDownEnginesL();
+            }
+        }
+
+    // ask user data, if query accepted start processing...
+    else if (iUsedOptionsMenuModule->AskDataFromUserL(aCommand, iEntriesToBeCreated))
+        {
+        // add this command to command array
+        AppendToCommandArrayL(aCommand, NULL, iEntriesToBeCreated);
+
+        // started exucuting commands
+        ExecuteFirstCommandL( KSavingText );
+        }
+     else
+        {
+        // cancelled, free resources
+        ShutDownEnginesL();
+        }
+    }
+
+
+
+TBool CCreatorEngine::IsDeleteCommand(TInt aCommand)
+    {
+    LOGSTRING("Creator: CCreatorEngine::IsDeleteCommand");
+
+    switch(aCommand)
+        {
+        //Add supported delete command here        
+        case ECmdDeleteAllEntries:
+        case ECmdDeleteAllCreatorEntries:
+        case ECmdDeleteEntries:
+        case ECmdDeleteContacts:
+        case ECmdDeleteCreatorContacts:
+        case ECmdDeleteContactGroups:
+        case ECmdDeleteCreatorContactGroups:
+        case ECmdDeleteCalendarEntries:
+        case ECmdDeleteCreatorCalendarEntries:
+        case ECmdDeleteBrowserBookmarks:
+        case ECmdDeleteCreatorBrowserBookmarks:
+        case ECmdDeleteBrowserBookmarkFolders:
+        case ECmdDeleteCreatorBrowserBookmarkFolders:
+        case ECmdDeleteBrowserSavedPages:
+        case ECmdDeleteCreatorBrowserSavedPages:
+        case ECmdDeleteBrowserSavedPageFolders:
+        case ECmdDeleteCreatorBrowserSavedPageFolders:
+        case ECmdDeleteCreatorFiles:
+        case ECmdDeleteLogs:
+        case ECmdDeleteCreatorLogs:
+        case ECmdDeleteMessages:
+        case ECmdDeleteCreatorMessages:
+        case ECmdDeleteMailboxes:
+        case ECmdDeleteCreatorMailboxes:
+        case ECmdDeleteIAPs:
+        case ECmdDeleteCreatorIAPs:
+        case ECmdDeleteIMPSs:
+        case ECmdDeleteCreatorIMPSs:
+        case ECmdDeleteNotes:
+        case ECmdDeleteLandmarks:
+        case ECmdDeleteCreatorLandmarks:
+            {
+            return ETrue;
+            }
+        default:
+            {
+            return EFalse;
+            }
+        }
+     
+    }
+
+// ---------------------------------------------------------------------------
+
+TBool CCreatorEngine::GetRandomDataFilenameL(TDes& aFilename)
+	{
+    CCommandParser* commandParser = CCommandParser::NewLC(this);
+	TBool ret = commandParser->GetRandomDataFilenameL(aFilename);
+    CleanupStack::PopAndDestroy(commandParser);
+    return ret;
+	}
+
+// ---------------------------------------------------------------------------
+
+TBool CCreatorEngine::GetRandomDataFromFileL(const TDesC& aFilename)
+	{
+    // wait dialog
+	// TODO
+    //CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
+    //waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_CANCEL);
+    //TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Reading random data"));
+
+    for (TInt i = 0; i < iStringArrays.Count(); ++i)
+        {
+        delete iStringArrays[i].iArrayPtr;
+        }
+    iStringArrays.Reset();
+
+    TBool errorDetected = EFalse;
+
+    // NOTE: These must be exactly in same order as in enumeration:
+
+    if (ReadRandomDataL(EFirstName, R_DATA_FIRSTNAMES, aFilename, CCreatorRandomDataParser::EFirstName) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ESurname, R_DATA_SURNAMES, aFilename, CCreatorRandomDataParser::ESurname) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ECompany, R_DATA_COMPANIES, aFilename, CCreatorRandomDataParser::ECompany) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EAddress, R_DATA_ADDRESSES, aFilename, CCreatorRandomDataParser::EAddress) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EJobTitle, R_DATA_JOBTITLES, aFilename, CCreatorRandomDataParser::EJobTitle) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EPhoneNumber, R_DATA_PHONENUMBERS, aFilename, CCreatorRandomDataParser::EPhoneNumber) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EGroupName, R_DATA_GROUPNAMES, aFilename, CCreatorRandomDataParser::EGroupName) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EMeetingReason, R_DATA_MEETINGREASONS, aFilename, CCreatorRandomDataParser::EMeetingReason) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EMeetingPlace, R_DATA_MEETINGPLACES, aFilename, CCreatorRandomDataParser::EMeetingPlace) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EMemoText, R_DATA_MEMOS, aFilename, CCreatorRandomDataParser::EMemoText) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EAnniversaryReason, R_DATA_ANNIVERSARIES, aFilename, CCreatorRandomDataParser::EAnniversaryReason) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EToDoText, R_DATA_TODOS, aFilename, CCreatorRandomDataParser::EToDoText) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EReminderText, R_DATA_REMINDERS, aFilename, CCreatorRandomDataParser::EReminderText) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EMessageSubject, R_DATA_MESSAGESUBJECTS, aFilename, CCreatorRandomDataParser::EMessageSubject) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EMessageText, R_DATA_MESSAGETEXTS, aFilename, CCreatorRandomDataParser::EMessageText) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ECity, R_DATA_CITIES, aFilename, CCreatorRandomDataParser::ECity) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ECountry, R_DATA_COUNTRIES, aFilename, CCreatorRandomDataParser::ECountry) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EPostcode, R_DATA_POSTCODES, aFilename, CCreatorRandomDataParser::EPostcode) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EState, R_DATA_STATES, aFilename, CCreatorRandomDataParser::EState) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EPobox, R_DATA_POBOXES, aFilename, CCreatorRandomDataParser::EPobox) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(EPrefix, R_DATA_PREFIXES, aFilename, CCreatorRandomDataParser::EPrefix) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ESuffix, R_DATA_SUFFIXES, aFilename, CCreatorRandomDataParser::ESuffix) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ELandmarkName, R_DATA_LANDMARK_NAMES, aFilename, CCreatorRandomDataParser::ELandmarkName) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    if (ReadRandomDataL(ELandmarkDescription, R_DATA_LANDMARK_DESCRIPTIONS, aFilename, CCreatorRandomDataParser::ELandmarkDescription) != KErrNone)
+    	{
+    	errorDetected = ETrue;
+    	}
+    
+    // remove the wait dialog
+    //waitDialog->CancelNoteL(dialogId);
+    //CleanupStack::PopAndDestroy(waitDialog);
+    
+    if (errorDetected)
+    	{
+		iEngineWrapper->ShowNote(_L("Error in reading random data."));
+   	}
+    return !errorDetected;
+	}
+
+// ---------------------------------------------------------------------------
+
+TInt CCreatorEngine::ReadRandomDataL(const TRandomStringType aRandomStringType,
+		                             const TInt aResourceId,
+		                             const TDesC& aFilename,
+		                             const CCreatorRandomDataParser::TRandomDataType aRandomDataType)
+	{
+	TInt error = KErrNone;
+	if (aFilename == KNullDesC)
+		{
+        iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, iEnv->ReadDesCArrayResourceL(aResourceId)));
+		}
+	else
+		{
+	    CCreatorRandomDataParser* dataParser = CCreatorRandomDataParser::NewLC();
+		CDesCArrayFlat* array = NULL;
+	
+		TRAP(error, array = dataParser->ParseL(aFilename, aRandomDataType));
+		if (error == KErrNone)
+			{
+			error = dataParser->GetError();
+			}
+	    if ((error == KErrNone) && (array->MdcaCount() > 0))
+	    	{
+	    	iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, array));
+	    	}
+	    else
+	    	{
+	    	if (array)
+	    		{
+	    		array->Reset();
+	    		delete array;
+	    		}
+	        iStringArrays.AppendL(TStringArrayPtr(aRandomStringType, iEnv->ReadDesCArrayResourceL(aResourceId)));
+	    	}
+		CleanupStack::PopAndDestroy(dataParser);
+		}
+	return error;
+	}
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::AppendToCommandArrayL(TInt aCommand, CCreatorModuleBaseParameters* aParameters, TInt aNumberOfEntries)
+    {
+    LOGSTRING("Creator: CCreatorEngine::AppendToCommandArrayL");
+    iParameterArray.AppendL(aParameters);
+
+    for (TInt i=0; i<aNumberOfEntries; i++)
+        iCommandArray->AppendL( TCommand(aCommand, aParameters) );
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CCreatorEngine::CommandArrayCount()
+    {
+    TInt count(0);
+    
+    if (iCommandArray)
+        count = iCommandArray->Count();
+    
+    LOGSTRING2("Creator: CCreatorEngine::CommandArrayCount returns %d", count);
+    
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+
+//returs fileid by its name, eg. 1 in 
+TInt CCreatorEngine::GetAttachmentIdL( const TDesC& aAttachmentIdStr ) const
+    {
+    TInt mapCount = sizeof(FileMap) / sizeof(FileMapping);
+    
+    for( TInt i = 0; i < mapCount; ++i )
+        {
+        if( FileMap[i].FileName() == aAttachmentIdStr )
+            return FileMap[i].FileId();
+        }
+    LOGSTRING2("CCreatorEngine::GetAttachmentIdL: Unknown attachment file id: %s", &aAttachmentIdStr);
+    User::Leave(KErrGeneral);
+    return KErrNotFound; // Not reached, but disables a compiler warning
+    }
+
+// ---------------------------------------------------------------------------
+
+// returns a random string from the resource files
+TPtrC CCreatorEngine::TestDataPathL (enum TTestDataPath aTestDataPath )
+    {
+    LOGSTRING("Creator: CCreatorEngine::TestDataPathL");
+
+    static TFileName filePath;
+
+    switch (aTestDataPath )
+        {
+        case ESavedDeck_1kB:
+            {
+            filePath.Copy (_L("Deck-1kB.saveddeck") );
+            }
+            break;
+    
+        case EJPEG_25kB:
+            {
+            filePath.Copy (_L("JPEG-25kB.jpg") );
+            }
+            break;
+    
+        case EJPEG_200kB:
+            {
+            filePath.Copy (_L("JPEG-200kB.jpg") );
+            }
+            break;
+    
+        case EJPEG_500kB:
+            {
+            filePath.Copy (_L("JPEG-500kB.jpg") );
+            }
+            break;
+    
+        case EPNG_15kB:
+            {
+            filePath.Copy (_L("PNG-15kB.png") );
+            }
+            break;
+    
+        case EGIF_2kB:
+            {
+            filePath.Copy (_L("GIF-2kB.gif") );
+            }
+            break;
+    
+        case ERNG_1kB:
+            {
+            filePath.Copy (_L("RNG-1kB.rng") );
+            }
+            break;
+    
+        case EMIDI_10kB:
+            {
+            filePath.Copy (_L("MIDI-10kB.mid") );
+            }
+            break;
+    
+        case EWAVE_20kB:
+            {
+            filePath.Copy (_L("WAV-20kB.wav") );
+            }
+            break;
+    
+        case EAMR_20kB:
+            {
+            filePath.Copy (_L("AMR-20kB.amr") );
+            }
+            break;
+    
+        case EExcel_15kB:
+            {
+            filePath.Copy (_L("XLS-15kB.xls") );
+            }
+            break;
+    
+        case EWord_20kB:
+            {
+            filePath.Copy (_L("DOC-20kB.doc") );
+            }
+            break;
+    
+        case EPowerPoint_40kB:
+            {
+            filePath.Copy (_L("PPT-40kB.ppt") );
+            }
+            break;
+    
+        case EText_10kB:
+            {
+            filePath.Copy (_L("TXT-10kB.txt") );
+            }
+            break;
+    
+        case EText_70kB:
+            {
+            filePath.Copy (_L("TXT-70kB.txt") );
+            }
+            break;
+    
+        case E3GPP_70kB:
+            {
+            filePath.Copy (_L("3GPP-70kB.3gpp") );
+            }
+            break;
+    
+        case EMP3_250kB:
+            {
+            filePath.Copy (_L("MP3-250kB.mp3") );
+            }
+            break;
+    
+        case EAAC_100kB:
+            {
+            filePath.Copy (_L("AAC-100kB.aac") );
+            }
+            break;
+    
+        case ERM_95kB:
+            {
+            filePath.Copy (_L("RM-95kB.rm") );
+            }
+            break;
+    
+        case EBMP_25kB:
+            {
+            filePath.Copy (_L("BMP-25kB.bmp") );
+            }
+            break;
+        case EHTML_20kB:
+            {
+            filePath.Copy (_L("HTML-20kB.html") );
+            }
+            break;
+        case EJAD_1kB:
+            {
+            filePath.Copy (_L("JAD-1kB.jad") );
+            }
+            break;
+        case EJAR_10kB:
+            {
+            filePath.Copy (_L("JAR-10kB.jar") );
+            }
+            break;
+        case EJP2_65kB:
+            {
+            filePath.Copy (_L("JP2-65kB.jp2") );
+            }
+            break;
+        case EMP4_200kB:
+            {
+            filePath.Copy (_L("MP4-200kB.mp4") );
+            }
+            break;
+        case EMXMF_40kB:
+            {
+            filePath.Copy (_L("MXMF-40kB.mxmf") );
+            }
+            break;
+        case ERAM_1kB:
+            {
+            filePath.Copy (_L("RAM-1kB.ram") );
+            }
+            break;
+        case ESVG_15kB:
+            {
+            filePath.Copy (_L("SVG-15kB.svg") );
+            }
+            break;
+        case ESWF_15kB:
+            {
+            filePath.Copy (_L("SWF-15kB.swf") );
+            }
+            break;
+        case ETIF_25kB:
+            {
+            filePath.Copy (_L("TIF-25kB.tif") );
+            }
+            break;
+        case EVCF_1kB:
+            {
+            filePath.Copy (_L("VCF-1kB.vcf") );
+            }
+            break;
+        case EVCS_1kB:
+            {
+            filePath.Copy (_L("VCS-1kB.vcs") );
+            }
+            break;
+        case ESISX_10kB:
+            {
+            filePath.Copy (_L("SISX-10kB.sisx") );
+            }
+            break;
+        case EWMA_50kB:
+            {
+            filePath.Copy (_L("WMA-50kB.wma") );
+            }
+            break;
+        case EWMV_200kB:
+            {
+            filePath.Copy (_L("WMV-200kB.wmv") );
+            }
+            break;
+
+        default:
+            User::Panic (_L("Test data"), 401 );
+            break;
+        }
+
+    TFileName fullTargetPath;
+    fullTargetPath.Copy( iTempPath->Des() );
+    fullTargetPath.Append( filePath );
+    if (ConeUtils::FileExists(fullTargetPath))
+        {        
+        // No need to copy, if the file already exists.
+        LOGSTRING2("Creator: CCreatorEngine::TestDataPathL %S already exists", &fullTargetPath);
+        return fullTargetPath;
+        }
+
+    // Define the path where the testdata can be retrieved
+	// get the data from the private directory in secure platform
+    TFileName fullAppPath = iEnv->EikAppUi()->Application()->AppFullName();
+	TChar driveLetter = fullAppPath[0];
+	TInt driveNumber;
+	
+	iEnv->FsSession().CharToDrive(driveLetter, driveNumber);
+	iEnv->FsSession().SetSessionToPrivate( driveNumber );   // "\\private\\20011383\\"
+ 
+
+    // check the file exists
+    if (!ConeUtils::FileExists(filePath))
+        {
+        LOGSTRING2("Creator: CCreatorEngine::TestDataPathL %S not found", &filePath);
+
+        TInt generatingError( KErrNone );
+        
+        // The file could be on C drive
+        iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
+        
+        if ( !ConeUtils::FileExists( filePath ) )
+            {
+            // The file is not on C drive, see if we can generate it
+            
+            // Make sure that the private path of this app in c-drive exists
+            iEnv->FsSession().CreatePrivatePath( KRegisterDrive );
+            
+            TFileName privatePath;
+            iEnv->FsSession().PrivatePath( privatePath );
+            privatePath.Append( filePath );
+            TChar privateDriveChar;
+            iEnv->FsSession().DriveToChar( KRegisterDrive, privateDriveChar );
+            TFileName fullPrivatePath; // full path of a file to be generated
+            fullPrivatePath.Append( privateDriveChar );
+            fullPrivatePath.Append( ':' );
+            fullPrivatePath.Append( privatePath );
+
+            switch ( aTestDataPath )
+                {
+                case EJPEG_25kB:
+                case EJPEG_200kB:
+                case EJPEG_500kB:
+                case EBMP_25kB:
+                case EGIF_2kB:
+                    {
+                    TRAP( generatingError, GenerateSourceImageFileL( aTestDataPath, fullPrivatePath ) );
+                    // GenerateSourceImageFileL calls TestDataPathL -> private session points to z
+                    // change it back to KRegisterDrive, because generated source file is there
+                    // and we need to copy it at the end of this function.
+                    iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
+                    break;
+                    }
+                case EText_10kB:
+                    {
+                    TRAP( generatingError, GenereteSourceTextFileL( fullPrivatePath, 10000 ) );
+                    // GenerateSourceImageFileL calls TestDataPathL -> private session points to z
+                    // change it back to KRegisterDrive, because generated source file is there
+                    // and we need to copy it at the end of this function.
+                    iEnv->FsSession().SetSessionToPrivate( KRegisterDrive );
+                    break;
+                    }
+                case EText_70kB:
+                    {
+                    TRAP( generatingError, GenereteSourceTextFileL( fullPrivatePath, 70000 ) );
+                    break;
+                    }
+                default:
+                    {
+                    generatingError = KErrNotSupported;
+                    break;
+                    }
+                }
+            }
+        
+        if ( iUserCancelled )
+            {
+            LOGSTRING("Creator: CCreatorEngine::TestDataPathL iUserCancelled" );
+            User::Leave( KErrCancel );
+            }
+        
+        if ( generatingError )
+            {
+            // Generating the file failed
+            
+            // cancel the dialog
+            //iProgressDialog->ProcessFinishedL();
+            //DialogDismissedL(EAknSoftkeyBack);
+
+			// remove the progress dialog from the screen
+			iEngineWrapper->CloseProgressbar();
+			
+			
+            // show error note
+            iEngineWrapper->ShowNote(_L("Test data missing"));
+			
+            User::Leave(KErrPathNotFound);
+            }
+        }
+
+	// now copy the data to D-drive to make the file public
+	iEnv->FsSession().MkDirAll( iTempPath->Des() );
+	TInt copyErr = BaflUtils::CopyFile(iEnv->FsSession(), filePath, fullTargetPath);
+	LOGSTRING4("Creator: CCreatorEngine::TestDataPathL copy %S to %S returns=%d", &filePath, &fullTargetPath, copyErr);
+	
+	// make sure that the file won't have a read only attribute
+	TEntry fileEntry;
+	iEnv->FsSession().Entry(fullTargetPath, fileEntry);
+	iEnv->FsSession().SetEntry(fullTargetPath, fileEntry.iModified, NULL, KEntryAttReadOnly);
+	
+	filePath = fullTargetPath;  // change the reference to the temp path
+    return filePath;
+    }
+
+
+// ---------------------------------------------------------------------------
+
+
+
+// a method to return a default Internet Access Point
+TUint32 CCreatorEngine::GetDefaultIAPL()
+	{
+    LOGSTRING("Creator: CCreatorEngine::GetDefaultIAPL");
+
+	TUint32 lIAPid = 1; // Default value
+
+	CCommsDatabase* cDatabase = CCommsDatabase::NewL();
+	CleanupStack::PushL(cDatabase);
+
+	CCommsDbTableView* tableView = cDatabase->OpenTableLC(TPtrC(IAP));
+
+	TInt errorCode = tableView->GotoFirstRecord();
+		
+	if ( errorCode == KErrNone ) 
+		{
+		TUint32	iValue;
+		tableView->ReadUintL(TPtrC(COMMDB_ID),iValue);
+		lIAPid = iValue;
+		}
+
+	CleanupStack::PopAndDestroy(2); // cDatabase,tableView
+
+	return lIAPid;
+	}
+
+// ---------------------------------------------------------------------------
+
+TUint32 CCreatorEngine::AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound )
+    {
+    LOGSTRING("Creator: CCreatorEngine::AccessPointNameToIdL");
+    // Accespoint impl moved from engine to accespoint implementations for supporting 3.0-3.1 and 3.2->
+    return iAccessPoints->AccessPointNameToIdL(aAPName, aAnyIfNotFound );
+    }
+
+static CCreatorEngine::TTestDataPath SoundFiles[] = {
+        CCreatorEngine::EMIDI_10kB,
+        CCreatorEngine::EWAVE_20kB,  
+        CCreatorEngine::EMP3_250kB,
+        CCreatorEngine::EAAC_100kB
+        };
+
+static CCreatorEngine::TTestDataPath PictureFiles[] = 
+    {
+    CCreatorEngine::EJPEG_25kB,
+    CCreatorEngine::EJPEG_200kB,
+    CCreatorEngine::EJPEG_500kB,
+    CCreatorEngine::EPNG_15kB,
+    CCreatorEngine::EGIF_2kB
+    };
+
+TPtrC CCreatorEngine::CreateSoundFileL(TTestDataPath aId)
+{
+	TPtrC tempPath(TestDataPathL(aId));
+	// Copy file to permanent location:
+    TParse parser;
+    parser.Set(tempPath, NULL, NULL);
+    TPtrC fileName(parser.NameAndExt());
+    HBufC* fullTargetPath = HBufC::NewLC( KMaxFileName );
+    fullTargetPath->Des().Copy( PathInfo::PhoneMemoryRootPath() );
+    fullTargetPath->Des().Append( PathInfo::DigitalSoundsPath() );
+    
+    fullTargetPath->Des().Append(fileName);
+    CopyFileL(tempPath, *fullTargetPath);
+    iAllocatedFilePaths.AppendL(fullTargetPath);
+    CleanupStack::Pop(); // fullTargetPath
+    return fullTargetPath->Des(); 
+}
+TPtrC CCreatorEngine::CreateRandomSoundFileL()
+{
+    TInt numOfFiles = sizeof(SoundFiles) / sizeof(TTestDataPath);
+    return CreateSoundFileL(SoundFiles[RandomNumber(0, numOfFiles-1)]);
+}
+TPtrC CCreatorEngine::RandomSoundFileL()
+{
+    TInt numOfFiles = sizeof(SoundFiles) / sizeof(TTestDataPath);
+    return TestDataPathL(SoundFiles[RandomNumber(0, numOfFiles-1)]);
+}
+    
+void CCreatorEngine::RandomPictureFileL(TDes& aPath)
+{
+    TInt numOfFiles = sizeof(PictureFiles) / sizeof(TTestDataPath);
+    aPath = TestDataPathL(PictureFiles[RandomNumber(0, numOfFiles-1)]);
+}
+// ---------------------------------------------------------------------------
+
+// returns a random string from the resource files
+TPtrC CCreatorEngine::RandomString(enum TRandomStringType aRandomStringType)
+    {
+    LOGSTRING("Creator: CCreatorEngine::RandomString");
+    
+    // Let's see if the array is OK and the string arrays are in correct order:
+    if( ((TInt) aRandomStringType) < iStringArrays.Count() && 
+        iStringArrays[aRandomStringType].iStringType == aRandomStringType)
+        {        
+        TInt rand = (TInt) (iStringArrays[aRandomStringType].iArrayPtr->Count() * Math::FRand(iSeed));
+        return (*iStringArrays[aRandomStringType].iArrayPtr)[rand];
+        }
+    
+    // Now let's loop the arrays and try to find one with the type:
+    for( TInt i = 0; i < iStringArrays.Count(); ++i )
+        {
+        if( iStringArrays[i].iStringType == aRandomStringType )
+            {
+            TInt rand = (TInt) (iStringArrays[i].iArrayPtr->Count() * Math::FRand(iSeed));
+            return (*iStringArrays[i].iArrayPtr)[rand];
+            }
+        }
+
+    User::Panic (_L("Random string"), 402);    
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+
+// returns a random number
+TInt CCreatorEngine::RandomNumber(TInt aRange)
+    {
+    LOGSTRING2("Creator: CCreatorEngine::RandomNumber aRange=%d", aRange);
+
+    return (TInt) (aRange*Math::FRand(iSeed));
+    }
+
+// ---------------------------------------------------------------------------
+
+// returns a random number
+TInt CCreatorEngine::RandomNumber(TInt aMin, TInt aMax)
+    {
+    LOGSTRING3("Creator: CCreatorEngine::RandomNumber aMin=%d aMax=%d", aMin, aMax);
+
+    TInt range = (aMax > aMin ? aMax - aMin : aMin - aMax) + 1;
+    TInt random = (TInt) (range*Math::FRand(iSeed));
+    
+    random = (random % range) + aMin;
+
+    if (random > aMax)
+        random = aMax;
+    else if (random < aMin)
+        random = aMin;
+    
+    return random;
+    }
+
+TTime CCreatorEngine::RandomTime(TTime baseTime, TRandomDateType type, TInt aMinHours, TInt aMaxHours, TInt aMinMinutes, TInt aMaxMinutes )
+    {
+    TInt randomHours = RandomNumber(aMinHours, aMaxHours);
+    TInt randomMinutes = RandomNumber(aMinMinutes, aMaxMinutes);
+    
+    switch( type )
+    {
+    case EDatePast:
+        return (baseTime - TTimeIntervalHours(randomHours)) - TTimeIntervalMinutes(randomMinutes);
+    case EDateFuture:
+        return (baseTime + TTimeIntervalHours(randomHours)) + TTimeIntervalMinutes(randomMinutes);
+    default:
+        break;
+    }
+    return baseTime;
+    }
+
+TTime CCreatorEngine::RandomDate(TTime baseTime, TRandomDateType type, TInt aMinDays, TInt aMaxDays)
+    {
+    TInt random = RandomNumber(aMinDays, aMaxDays);
+    
+    switch( type )
+    {
+    case EDatePast:
+        return baseTime - TTimeIntervalDays(random);
+    case EDateFuture:
+        return baseTime + TTimeIntervalDays(random);
+    default:
+        break;
+    }
+        
+    return baseTime;
+    }
+
+TTime CCreatorEngine::RandomDate(TRandomDateType type, TInt aMinDays, TInt aMaxDays)
+    {    
+    TTime time;
+    // Set to current time:
+    time.HomeTime();
+    return RandomDate(time, type, aMinDays, aMaxDays);
+    }
+
+HBufC* CCreatorEngine::CreateEmailAddressLC()
+    {
+    _LIT(KCountry, "com");    
+    return CreateEmailAddressLC(RandomString(EFirstName), RandomString(ESurname), RandomString(ECompany), KCountry);
+    }
+
+HBufC* CCreatorEngine::CreateHTTPUrlLC()
+    {
+    _LIT(KProtocol, "http://");
+    _LIT(KPrefix, "www");
+    _LIT(KCountry, "com");
+    return CreateUrlLC(KProtocol, KPrefix, RandomString(ECompany), KCountry);
+    }
+
+HBufC* CCreatorEngine::CreateRandomStringLC(TInt aStrLen)
+    {
+    TInt minAscii = 65;
+    TInt maxAscii = 90;
+    HBufC* str = HBufC::NewL(aStrLen);
+    CleanupStack::PushL(str);
+    for( TInt i = 0; i < aStrLen; ++i )
+        {
+        TInt random = RandomNumber(minAscii, maxAscii);
+        TChar randomChar = TChar((TUint) random);
+        str->Des().Append(randomChar);
+        }    
+    return str;
+    }
+
+HBufC* CCreatorEngine::CreateEmailAddressLC(
+        const TDesC& firstname,
+        const TDesC& lastname,
+        const TDesC& domain,
+        const TDesC& country ) const
+        {
+        HBufC* email = HBufC::New(firstname.Length() + lastname.Length() + domain.Length() + country.Length() + 3);
+        CleanupStack::PushL(email);        
+        _LIT(KEmailAddr, "%S.%S@%S.%S");
+        email->Des().Format(KEmailAddr, &firstname, &lastname, &domain, &country);
+        return email;
+        }
+        
+HBufC* CCreatorEngine::CreateUrlLC(
+        const TDesC& protocol,
+        const TDesC& prefix,
+        const TDesC& domain,
+        const TDesC& country) const
+    {
+    HBufC* url = HBufC::New(protocol.Size() + prefix.Size() + domain.Size() + country.Size() + 2);
+    CleanupStack::PushL(url);
+    _LIT(KUrl, "%S%S.%S.%S");
+    url->Des().Format(KUrl, &protocol, &prefix, &domain, &country);    
+    return url;
+    }
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::SetDefaultPathForFileCommandL(TInt aCommand, TFileName& aPath)
+	{
+	aPath.Copy( PathInfo::PhoneMemoryRootPath() );
+	switch (aCommand)
+	{
+	case ECmdCreateFileEntryJPEG_25kB:
+	case ECmdCreateFileEntryJPEG_200kB:
+	case ECmdCreateFileEntryJPEG_500kB:
+	case ECmdCreateFileEntryPNG_15kB:
+	case ECmdCreateFileEntryGIF_2kB:
+	case ECmdCreateFileEntryBMP_25kB:
+	case ECmdCreateFileEntrySVG_15kB:
+	case ECmdCreateFileEntryTIF_25kB:
+	case ECmdCreateFileEntryJP2_65kB:
+
+		{  aPath.Append( PathInfo::ImagesPath() );  break;  }
+
+	case ECmdCreateFileEntryRNG_1kB:
+		{  aPath.Append( PathInfo::SimpleSoundsPath() );  break;  }
+
+	case ECmdCreateFileEntryMIDI_10kB:
+	case ECmdCreateFileEntryWAV_20kB:
+	case ECmdCreateFileEntryAMR_20kB:
+	case ECmdCreateFileEntryMP3_250kB:
+	case ECmdCreateFileEntryAAC_100kB:
+	case ECmdCreateFileEntryWMA_50kB:
+		{  aPath.Append( PathInfo::DigitalSoundsPath() );  break;  }
+
+	case ECmdCreateFileEntry3GPP_70kB:
+	case ECmdCreateFileEntryRM_95kB:
+	case ECmdCreateFileEntryMP4_200kB:
+	case ECmdCreateFileEntryWMV_200kB:
+
+		{  aPath.Append( PathInfo::VideosPath() );  break;  }
+
+	case ECmdCreateFileEntryEmptyFolder:
+		{  aPath.Append( _L("MyFolder\\") );  break;  }
+
+	default:
+		{  aPath.Append( PathInfo::OthersPath() );  break;  }
+
+	}
+	}
+
+
+// ---------------------------------------------------------------------------
+
+void CCreatorEngine::CancelComplete()
+    {
+    LOGSTRING("Creator: CCreatorEngine::CancelComplete");
+    // free resources and show a note
+    TRAP_IGNORE( ShutDownEnginesL() );
+
+    TRAP_IGNORE(iEngineWrapper->ShowNote(_L("Cancelled")));
+	
+	}
+
+// ---------------------------------------------------------------------------
+
+TCommand::TCommand(TInt aCommandId, CCreatorModuleBaseParameters* aParameters)
+    {
+    iCommandId = aCommandId;
+    iParameters = aParameters;
+    }
+
+// ---------------------------------------------------------------------------
+
+TCommand::~TCommand()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+CAsyncWaiter* CAsyncWaiter::NewL(TInt aPriority)
+	{
+	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
+	return self;
+	}
+
+CAsyncWaiter* CAsyncWaiter::NewLC(TInt aPriority)
+	{
+	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
+	CleanupStack::PushL(self);
+	return self;
+	}
+	
+CAsyncWaiter::CAsyncWaiter(TInt aPriority) : CActive(aPriority)
+	{
+	CActiveScheduler::Add(this);
+	}	
+
+CAsyncWaiter::~CAsyncWaiter()
+	{
+	Cancel();
+	}
+	
+void CAsyncWaiter::StartAndWait()
+	{
+    LOGSTRING("Creator: CAsyncWaiter::StartAndWait");
+    iStatus = KRequestPending;
+    SetActive();
+    iWait.Start();
+	}
+	
+TInt CAsyncWaiter::Result() const
+	{
+	return iError;
+	}
+	
+void CAsyncWaiter::RunL()
+	{
+    LOGSTRING("Creator: CAsyncWaiter::RunL");
+
+	iError = iStatus.Int();
+	//CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+	iWait.AsyncStop();
+	}
+	
+void CAsyncWaiter::DoCancel()
+	{
+    LOGSTRING("Creator: CAsyncWaiter::DoCancel");
+
+	iError = KErrCancel;
+    if( iStatus == KRequestPending )
+        {
+        TRequestStatus* s=&iStatus;
+        User::RequestComplete( s, KErrCancel );
+        }
+    iWait.AsyncStop();
+    //CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+	}
+	
+FileMapping::FileMapping( const TDesC& aAttName, TInt aAttId, TInt aCommandId )
+    :
+    iFileName(aAttName),
+    iFileId(aAttId),
+    iCommandId(aCommandId)
+    {}
+
+    const TDesC& FileMapping::FileName() const
+    {
+        return iFileName;
+    }
+
+    TInt FileMapping::FileId() const
+    {
+        return iFileId;
+    }   
+
+    TInt FileMapping::CommandId() const
+    {
+        return iCommandId;
+    }
+    
+// ---------------------------------------------------------------------------  
+CDictionaryFileStore* CCreatorEngine::FileStoreLC()
+    {
+    LOGSTRING("Creator: CCreatorEngine::FileStoreLC");
+    CDictionaryFileStore* store;
+    
+    // make sure that the private path of this app in c-drive exists
+    CEikonEnv::Static()->FsSession().CreatePrivatePath( KRegisterDrive ); // c:\\private\\20011383\\
+
+    // handle register always in the private directory 
+    User::LeaveIfError( CEikonEnv::Static()->FsSession().SetSessionToPrivate( KRegisterDrive ) );
+    store = CDictionaryFileStore::OpenLC( CEikonEnv::Static()->FsSession(), KRegisterFileName, KUidCreatorApp );
+    return store;
+    }
+    
+// ---------------------------------------------------------------------------
+void CCreatorEngine::ReadEntryIdsFromStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid )
+    {
+    LOGSTRING("Creator: CCreatorEngine::ReadEntryIdsFromStoreL");
+    CDictionaryFileStore* store = FileStoreLC();
+    User::LeaveIfNull( store );
+    if ( store->IsPresentL( aModuleUid ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, aModuleUid );
+        TFileName fullPath;
+        TInt err( KErrNone );
+        TInt id( KErrNotFound );
+        while ( !err )
+            {
+            TRAP( err, id = in.ReadInt32L() );  // will leave with KErrEof
+            if ( !err )
+                {
+                aEntryIds.Append( id );
+                }
+            }
+        CleanupStack::PopAndDestroy( &in );
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+// ---------------------------------------------------------------------------
+void CCreatorEngine::WriteEntryIdsToStoreL( RArray<TInt>& aEntryIds, const TUid aModuleUid )
+    {
+    LOGSTRING("Creator: CCreatorEngine::WriteEntryIdsToStoreL");
+    CDictionaryFileStore* store = FileStoreLC();
+    User::LeaveIfNull( store );
+    
+    // backup previous ids from store
+    // otherwise they would be overwritten when calling out.WriteL
+    RArray<TInt> previousIds;
+    CleanupClosePushL( previousIds );
+    
+    if ( store->IsPresentL( aModuleUid ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, aModuleUid );        
+        TInt err( KErrNone );
+        TInt id( KErrNotFound );
+        while ( !err ) 
+            {
+            TRAP( err, id = in.ReadInt32L() ); // will leave with KErrEof
+            if ( !err )
+                {
+                previousIds.Append( id );
+                }
+            }
+        CleanupStack::PopAndDestroy( &in );
+        }
+    
+    RDictionaryWriteStream out;       
+    out.AssignLC( *store, aModuleUid );
+    
+    // restore previous ids to store
+    for ( TInt i = 0; i < previousIds.Count(); i++ )
+        {
+        out.WriteInt32L( previousIds[i] );            
+        }
+
+    // write new ids to store
+    for ( TInt i = 0; i < aEntryIds.Count(); i++ )
+        {
+        out.WriteInt32L( aEntryIds[i] );        
+        }
+    
+    out.CommitL();
+    CleanupStack::PopAndDestroy( &out );
+    
+    store->CommitL();
+    CleanupStack::PopAndDestroy( &previousIds );
+    CleanupStack::PopAndDestroy( store );
+    }
+
+// ---------------------------------------------------------------------------
+void CCreatorEngine::ReadEntryIdsFromStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid )
+    {
+    LOGSTRING("Creator: CCreatorEngine::ReadEntryIdsFromStoreL");
+    CDictionaryFileStore* store = FileStoreLC();
+    User::LeaveIfNull( store );
+    if ( store->IsPresentL( aModuleUid ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, aModuleUid );
+        TFileName fullPath;
+        TInt err( KErrNone );
+        TUint32 id( KErrNone ); 
+        while ( !err )
+            {
+            TRAP( err, id = in.ReadUint32L() );  // will leave with KErrEof
+            if ( !err )
+                {
+                aEntryIds.Append( id );
+                }
+            }
+        CleanupStack::PopAndDestroy( &in );
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+// ---------------------------------------------------------------------------
+void CCreatorEngine::WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid )
+    {
+    LOGSTRING("Creator: CCreatorEngine::WriteEntryIdsToStoreL");
+    CDictionaryFileStore* store = FileStoreLC();
+    User::LeaveIfNull( store );
+    
+    // backup previous ids from store
+    // otherwise they would be overwritten when calling out.WriteL
+    RArray<TUint32> previousIds;
+    CleanupClosePushL( previousIds );
+    
+    if ( store->IsPresentL( aModuleUid ) )
+        {
+        RDictionaryReadStream in;
+        in.OpenLC( *store, aModuleUid );
+        TInt err( KErrNone );
+        TUint32 id( KErrNone );
+        while ( !err ) 
+            {
+            TRAP( err, id = in.ReadUint32L() ); // will leave with KErrEof
+            if ( !err )
+                {
+                previousIds.Append( id );
+                }
+            }
+        CleanupStack::PopAndDestroy( &in );
+        }
+    
+    RDictionaryWriteStream out;       
+    out.AssignLC( *store, aModuleUid );
+    
+    // restore previous ids to store
+    for ( TInt i = 0; i < previousIds.Count(); i++ )
+        {
+        out.WriteUint32L( previousIds[i] );            
+        }
+
+    // write new ids to store
+    for ( TInt i = 0; i < aEntryIds.Count(); i++ )
+        {
+        out.WriteUint32L( aEntryIds[i] );        
+        }
+    
+    out.CommitL();
+    CleanupStack::PopAndDestroy( &out );
+    
+    store->CommitL();
+    CleanupStack::PopAndDestroy( &previousIds );
+    CleanupStack::PopAndDestroy( store );
+    }
+
+// ---------------------------------------------------------------------------
+void CCreatorEngine::RemoveStoreL( const TUid aModuleUid )
+    {
+    LOGSTRING("Creator: CCreatorEngine::RemoveStoreL");
+    CDictionaryFileStore* store = FileStoreLC();
+    User::LeaveIfNull( store );
+    if ( store->IsPresentL( aModuleUid ) )
+        {        
+        // entries of this module should be deleted by now,
+        // remove the Creator internal registry for this module
+        store->Remove( aModuleUid );
+        store->CommitL();
+        }
+    CleanupStack::PopAndDestroy( store );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorEngine::GenerateSourceImageFileL(
+    const CCreatorEngine::TTestDataPath aFileType,
+    const TDesC& aFileName )
+    {
+    LOGSTRING("Creator: CCreatorEngine::GenerateSourceImageFileL");
+    
+    // Peek file size
+    RFile file;
+    TInt fileSize( 0 );
+    // Using png file as the source file
+    TFileName fileName = TestDataPathL( CCreatorEngine::EPNG_15kB );
+    User::LeaveIfError( file.Open( iEnv->FsSession(),
+                                   fileName,
+                                   EFileRead | EFileShareAny ) );
+    CleanupClosePushL( file );
+    User::LeaveIfError( file.Size( fileSize ) );
+    CleanupStack::PopAndDestroy( &file );
+    
+    // Using heap variables, because bitmaps 
+    // may reserve large amount of memory.
+    
+    // Read data from the file
+    RFileReadStream ws;    
+    User::LeaveIfError( ws.Open( iEnv->FsSession(),
+                                 fileName,
+                                 EFileStream | EFileRead | EFileShareAny ) );
+    CleanupClosePushL( ws );
+    delete iBitmapData;
+    iBitmapData = NULL;
+    iBitmapData = HBufC8::NewL( fileSize );
+    TPtr8 dataPtr = iBitmapData->Des();
+    ws.ReadL( dataPtr, fileSize );
+    CleanupStack::PopAndDestroy( &ws );
+       
+    // Create decoder for the data
+    delete iDecoder;
+    iDecoder = NULL;
+    iDecoder = CImageDecoder::DataNewL( iEnv->FsSession(), dataPtr );
+    iFrameinfo = iDecoder->FrameInfo();
+    
+    // Create bitmap handle for the source image
+    iBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError( iBitmap->Create( iFrameinfo.iFrameCoordsInPixels.Size(), EColor16M ) );
+    
+    // Convert the data from the file into bitmap format (inmemory)  
+    CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+    iDecoder->Convert( &waiter->iStatus, *iBitmap );
+    waiter->StartAndWait();
+    delete iDecoder;
+    iDecoder = NULL;
+    delete iBitmapData;
+    iBitmapData = NULL;
+    if ( iUserCancelled )
+        {
+        CancelComplete();
+        User::Leave( KErrCancel );
+        }
+    User::LeaveIfError( waiter->Result() );
+    
+    // Define the target dimensions and image quality
+    // so that the generated file size will match required size.
+    // Quality and scaling factors are defined experimentally.
+    delete iScaler;
+    iScaler = NULL;
+    iScaler = CBitmapScaler::NewL();
+    iScaledBitmap = new (ELeave) CFbsBitmap();
+    // use original size as base
+    TSize scaledSize( iFrameinfo.iFrameCoordsInPixels.Size() );
+    delete iFrameImageData;
+    iFrameImageData = NULL;
+    iFrameImageData = CFrameImageData::NewL();
+    TBuf8<64> mimeType;
+    TJpegImageData* jpegImageData( NULL );
+    TBmpImageData* bmpImageData( NULL );
+    switch ( aFileType )
+        {
+        case CCreatorEngine::EJPEG_25kB:
+            // QualityFactor = 93 and size factor = 2 -> 25kB jpeg file
+            mimeType.Copy( _L8("image/jpeg") );
+            jpegImageData = new (ELeave) TJpegImageData;
+            // Set some format specific data
+            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
+            jpegImageData->iQualityFactor = 93; // 0..100
+            // ownership passed to iFrameImageData after AppendImageData
+            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
+            scaledSize.iHeight *= 2;
+            scaledSize.iWidth *= 2;
+            break;
+        case CCreatorEngine::EJPEG_200kB:
+            {
+            mimeType.Copy( _L8("image/jpeg") );
+            jpegImageData = new (ELeave) TJpegImageData;
+            // Set some format specific data
+            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
+#ifdef __WINS__
+            // QualityFactor = 95 and size factor = 7 -> 196kB jpeg file
+            jpegImageData->iQualityFactor = 95; // 0..100
+            scaledSize.iHeight *= 7;
+            scaledSize.iWidth *= 7;
+#else
+            // In hw the image compression seems to work
+            // more efficiently. Need to set greater values.
+            jpegImageData->iQualityFactor = 100; // 0..100
+            scaledSize.iHeight *= 7;
+            scaledSize.iWidth *= 7;
+            // 100, 7, 7 -> 213kB
+#endif
+            // ownership passed to iFrameImageData after AppendImageData
+            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
+            break;
+            }
+        case CCreatorEngine::EJPEG_500kB:
+            {
+            mimeType.Copy( _L8("image/jpeg") );
+            jpegImageData = new (ELeave) TJpegImageData;
+            // Set some format specific data
+            jpegImageData->iSampleScheme = TJpegImageData::EColor444;
+#ifdef __WINS__
+            // QualityFactor = 99 and size factor = 8 -> 514kB jpeg file
+            jpegImageData->iQualityFactor = 99; // 0..100
+            scaledSize.iHeight *= 8;
+            scaledSize.iWidth *= 8;
+#else
+            // In hw the image compression seems to work
+            // more efficiently. Need to set greater values. 
+            jpegImageData->iQualityFactor = 100; // 0..100
+            scaledSize.iHeight *= 13;
+            scaledSize.iWidth *= 13;
+            // 100, 13, 13 -> 535kB
+#endif
+            // ownership passed to iFrameImageData after AppendImageData
+            User::LeaveIfError( iFrameImageData->AppendImageData( jpegImageData ) );
+            break;
+            }
+        case CCreatorEngine::EBMP_25kB:
+            {
+            // bit depyh 8 and 11/10 size factor -> 25kB bmp
+            mimeType.Copy( _L8("image/bmp") );
+            bmpImageData = new (ELeave) TBmpImageData;
+            bmpImageData->iBitsPerPixel = 8;
+            // ownership passed to iFrameImageData after AppendImageData
+            User::LeaveIfError( iFrameImageData->AppendImageData( bmpImageData ) );
+            scaledSize.iHeight *= 11;
+            scaledSize.iWidth *= 11;
+            scaledSize.iHeight /= 10;
+            scaledSize.iWidth /= 10;
+            break;
+            }
+        case CCreatorEngine::EGIF_2kB:
+            {
+            // size factor 1/2 -> 2560B gif
+            mimeType.Copy( _L8("image/gif") );
+            // GIF encoder is not configurable, only the size matters here
+            scaledSize.iHeight /= 2;
+            scaledSize.iWidth /= 2;
+            break;
+            }
+        default: break;
+        }
+
+    // Scale to reach target size
+    User::LeaveIfError( iScaledBitmap->Create( scaledSize, EColor16M ) );
+    iScaler->Scale( &waiter->iStatus, *iBitmap, *iScaledBitmap );
+    waiter->StartAndWait();
+    delete iBitmap;
+    iBitmap = NULL;
+    delete iScaler;
+    iScaler = NULL;
+    if ( iUserCancelled )
+        {
+        CancelComplete();
+        User::Leave( KErrCancel );
+        }
+    User::LeaveIfError( waiter->Result() );
+    
+    // Encode to target format
+    delete iEncoder;
+    iEncoder = NULL;
+    // Creating CImageEncoder opens the target file
+    iEncoder = CImageEncoder::FileNewL( iEnv->FsSession(), aFileName, mimeType );
+
+    // Do the conversion to target format, this will write to the file
+    iEncoder->Convert( &waiter->iStatus, *iScaledBitmap, iFrameImageData );
+    waiter->StartAndWait();
+    delete iEncoder;
+    iEncoder = NULL;
+    delete iFrameImageData;
+    iFrameImageData = NULL;
+    delete iScaledBitmap;
+    iScaledBitmap = NULL;
+    if ( iUserCancelled )
+        {
+        CancelComplete();
+        User::Leave( KErrCancel );
+        }
+    User::LeaveIfError( waiter->Result() );
+    CleanupStack::PopAndDestroy( waiter );
+    }
+
+//----------------------------------------------------------------------------
+void CCreatorEngine::GenereteSourceTextFileL( const TDesC& aFileName, TInt aSize )
+    {
+    LOGSTRING("Creator: CCreatorEngine::GenereteSourceTextFileL");
+    RFile txtFile;
+    _LIT8( KTestContent, "Testing... ");
+    _LIT8( KTestContentCRLF, "\r\n");
+    txtFile.Create( iEnv->FsSession(),
+                    aFileName,
+                    EFileStreamText | EFileWrite | EFileShareAny );
+    CleanupClosePushL( txtFile );
+    for ( TInt i = 1; i*KTestContent().Length() < aSize; i++ )
+        {
+        User::LeaveIfError( txtFile.Write( KTestContent ) );
+        if ( !( i % 10 ) ) // linefeed for every 10th
+            {
+            User::LeaveIfError( txtFile.Write( KTestContentCRLF ) );
+            }
+        }
+    CleanupStack::PopAndDestroy( &txtFile );
+    }
+
+//----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <hbprogressdialog.h>
+#include <hbmessagebox.h>
+
+#include <hbpopup.h>
+
+#include <QString>
+#include <QDate>
+
+#include <e32std.h>
+#include <e32base.h>
+
+#include "creator.hrh" // for command ids
+#include "notifications.h"
+#include "enginewrapper.h"
+#include "engine.h"
+#include "mainview.h"
+
+
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::EngineWrapper()
+: iEngine(0), iProgressDialog(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::~EngineWrapper()
+{
+    if (iEngine != 0) {
+        delete iEngine;
+    }
+    if (iProgressDialog != 0) {
+        delete iProgressDialog;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::init()
+{
+    TRAPD(err, iEngine = CCreatorEngine::NewL(this));
+    if(err != KErrNone) {
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+MemoryDetails EngineWrapper::GetMemoryDetails()
+{
+    TMemoryDetails tMemoryDetails = iEngine->GetMemoryDetails();
+    MemoryDetails memoryDetails;
+
+    // Convert TMemoryDetails to MemoryDetails 
+    memoryDetails.mCFree  = QString((QChar*)tMemoryDetails.iCFree.Ptr(), tMemoryDetails.iCFree.Length());
+	memoryDetails.mDFree  = QString((QChar*)tMemoryDetails.iDFree.Ptr(), tMemoryDetails.iDFree.Length());
+	memoryDetails.mEFree  = QString((QChar*)tMemoryDetails.iEFree.Ptr(), tMemoryDetails.iEFree.Length());
+	memoryDetails.mHFree  = QString((QChar*)tMemoryDetails.iHFree.Ptr(), tMemoryDetails.iHFree.Length());
+	
+	memoryDetails.mCSize  = QString((QChar*)tMemoryDetails.iCSize.Ptr(), tMemoryDetails.iCSize.Length());
+	memoryDetails.mDSize  = QString((QChar*)tMemoryDetails.iDSize.Ptr(), tMemoryDetails.iDSize.Length());
+		memoryDetails.mHSize  = QString((QChar*)tMemoryDetails.iHSize.Ptr(), tMemoryDetails.iHSize.Length());
+	
+	if (tMemoryDetails.iENotAvailable == EFalse) {
+		memoryDetails.mESize  = QString((QChar*)tMemoryDetails.iESize.Ptr(), tMemoryDetails.iESize.Length());
+		memoryDetails.mENotAvailable = false;
+	}
+	else {
+		memoryDetails.mENotAvailable = true;
+	}
+	return memoryDetails;
+}
+
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowErrorMessage(const TDesC& aErrorMessage)
+{
+    QString errorMessage((QChar*)aErrorMessage.Ptr(),aErrorMessage.Length());
+    Notifications::error(errorMessage);
+ 
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowNote(const TDesC& aNoteMessage, TInt aResourceId)
+{
+    QString note((QChar*)aNoteMessage.Ptr(),aNoteMessage.Length());
+    Notifications::showGlobalNote(note, HbMessageBox::MessageTypeInformation, HbPopup::ConfirmationNoteTimeout);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowProgressBar(const TDesC& aPrompt, int aMax)
+{
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+    iProgressDialog = Notifications::showProgressBar(text, aMax);
+	connect(iProgressDialog, SIGNAL(cancelled()), this, SLOT(ProgressDialogCancelled()));
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::IncrementProgressbarValue()
+{
+    iProgressDialog->setProgressValue(iProgressDialog->progressValue() + 1);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::CloseProgressbar()
+{
+    delete iProgressDialog;
+    iProgressDialog = 0;
+}
+
+// ---------------------------------------------------------------------------
+
+TBool EngineWrapper::EntriesQueryDialog(TInt& aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero)
+    {
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+    bool err = Notifications::entriesQueryDialog(aNumberOfEntries, text, aAcceptsZero);
+	return err;
+    }
+	
+// ---------------------------------------------------------------------------	
+
+TBool EngineWrapper::TimeQueryDialog(TTime aTime, const TDesC& aPrompt)
+    {
+    // TTime to QDate
+    TBuf<20> timeString;
+    _LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3");
+    TRAP_IGNORE( aTime.FormatL(timeString, KDateString) );
+    QString temp = QString::fromUtf16(timeString.Ptr(), timeString.Length());
+    temp.replace(QChar('/'), QChar('-'));
+    QDate date = QDate::fromString(temp, "dd-MM-yyyy");
+
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+    bool err = Notifications::timeQueryDialog(date, text);
+	return err;
+    }
+
+TBool EngineWrapper::YesNoQueryDialog(const TDesC& aPrompt)
+{
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+    return Notifications::yesNoQueryDialog(text);	
+}
+ 
+// ---------------------------------------------------------------------------	
+
+bool EngineWrapper::ExecuteOptionsMenuCommand(int commandId)
+{
+	TInt err = KErrNone;
+	if (commandId == ECmdCreateFromFile) {
+		TRAP(err, iEngine->RunScriptL());
+	}
+	else if (commandId == ECmdSelectRandomDataFile) {
+		TFileName filename;
+		TBool ret = EFalse;
+		TRAP(err, ret = iEngine->GetRandomDataFilenameL(filename));
+		if (err != KErrNone) {
+			Notifications::error("Error in getting random data.");
+			return false;
+		}		
+		if (ret == true) {
+			TRAP(err, iEngine->GetRandomDataFromFileL(filename));
+		}
+	}
+    else {
+		TRAP(err, iEngine->ExecuteOptionsMenuCommandL(commandId));
+	}
+	// error handling
+    if(err != KErrNone) {
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------	
+
+bool EngineWrapper::PopupListDialog(const TDesC& aPrompt, CDesCArray* aFileNameArray, TInt& aIndex) 
+{
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+	QStringList itemList;
+
+	for (int i = 0; i < aFileNameArray->Count(); i++) {
+		itemList.append(QString::fromUtf16(
+				  aFileNameArray->MdcaPoint(i).Ptr(),
+				  aFileNameArray->MdcaPoint(i).Length()));
+	}
+	// TODO: HbSelectionDialog handle close & user choice
+	Notifications::popupListDialog(text, itemList, HbAbstractItemView::SingleSelection);
+	return false;
+}
+
+// ---------------------------------------------------------------------------	
+
+bool EngineWrapper::DirectoryQueryDialog(const TDesC& aPrompt, TFileName& aDirectory)
+{
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+	QString directory = QString((QChar*)aDirectory.Ptr(), aDirectory.Length());
+	bool ret = Notifications::directoryQueryDialog(text, directory);
+	if (ret == true) {
+		aDirectory = TFileName(directory.utf16());
+	}
+	return ret;
+
+}
+
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ProgressDialogCancelled()
+{
+	CloseProgressbar();
+	TRAPD(err, iEngine->ProgressDialogCancelledL());
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Error in operation cancel.");
+    }	
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt& aIndex)
+{
+	bool ret = false;
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+	QStringList itemList;
+	
+	switch (aId) {
+		case R_CONTACT_CREATION_TYPE_QUERY: {
+			itemList << "Default fields" << "Define...";
+			break;
+		}
+		case R_GROUP_CREATION_TYPE_QUERY: {
+			itemList << "Random" << "Define...";
+			break;
+		}
+		case R_MESSAGE_TYPE_QUERY: {
+			itemList << "SMS" << "MMS" << "AMS" << "Email" << "Smart Message" << "IR Message" << "BT Message";
+			break;
+		}
+		case R_FOLDER_TYPE_QUERY: {
+			itemList << "Inbox" << "Drafts" << "Outbox" << "Sent";
+			break;
+		}
+		case R_UNREAD_QUERY: {
+			itemList << "Read" << "New";
+			break;
+		}
+		case R_ATTACHMENT_MULTI_SELECTION_QUERY: {
+			Notifications::error("Not supported resource id."); 
+			break;
+		}
+		case R_AMS_ATTACHMENT_SINGLE_SELECTION_QUERY: {
+			itemList << "AMR 20kB";
+			break;
+		}
+		case R_ATTACHMENT_SINGLE_SELECTION_QUERY: {
+			itemList << "JPEG 25kB" << "JPEG 300kB" << "JPEG 500kB" << "PNG 15kB" << "GIF 2kB" << "RNG 1kB" 
+			<< "MIDI 10kB" << "WAVE 20kB" << "AMR 20kB" << "Excel 15kB" << "Word 20kB" << "PowerPoint 40kB" 
+			<< "Text 10kB" << "Text 70kB" << "3GPP 70kB" << "MP3 250kB" << "AAC 100kB" << "RM 95kB";
+			break;
+		}
+		default: {
+			Notifications::error("Error in resource id.");
+			return ret;
+		}
+	}
+    // TODO: HbSelectionDialog handle close & user choice
+    Notifications::popupListDialog(text, itemList, HbAbstractItemView::SingleSelection);
+    return false;
+
+}
+
+bool EngineWrapper::ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aIndexes)
+{
+	bool ret = false;
+	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+	QStringList itemList;
+	QList<int> indexes;
+	if (aId == R_ATTACHMENT_MULTI_SELECTION_QUERY) {
+		itemList << "None" << "JPEG 25kB" << "JPEG 300kB" << "JPEG 500kB" << "PNG 15kB" << "GIF 2kB" << "RNG 1kB" 
+			<< "MIDI 10kB" << "WAVE 20kB" << "AMR 20kB" << "Excel 15kB" << "Word 20kB" << "PowerPoint 40kB" 
+			<< "Text 10kB" << "Text 70kB" << "3GPP 70kB" << "MP3 250kB" << "AAC 100kB" << "RM 95kB";
+
+		//ret = Notifications::popupListDialog(text, itemList, indexes);
+		// TODO: HbSelectionDialog handle close & user choice
+		Notifications::popupListDialog(text, itemList, HbAbstractItemView::MultiSelection);
+
+		if (ret == true) {
+			aIndexes->Reset();
+			for (int i = 0; i < indexes.count(); i++) {
+				aIndexes->AppendL(indexes.at(i));
+			}
+		}
+	}
+	return ret;			
+}
+
+void EngineWrapper::CloseCreatorApp()
+{
+	MainView::closeApp();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbview.h>
+
+#include "mainview.h"
+#include "enginewrapper.h"
+
+int main(int argc, char *argv[])
+{
+	
+    
+
+    HbApplication app(argc, argv);
+    HbMainWindow mainWindow;
+    
+    //Create main view
+    MainView* view = new MainView(mainWindow);
+
+    //initialize main view
+    view->init(app);
+	
+	// Add View to main window and reveal it.
+    mainWindow.addView(view);
+    mainWindow.show();
+    
+    int result = app.exec();
+   
+    return result;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,658 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <hbview.h>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+#include <hblabel.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbtextedit.h>
+
+#include <QSignalMapper>
+#include <QGraphicsLinearLayout>
+
+#include "notifications.h"
+#include "enginewrapper.h"
+#include "mainview.h"
+#include "hbtoolbar.h"
+#include "creator.hrh" // for command ids
+
+// ---------------------------------------------------------------------------
+
+MainView::MainView(HbMainWindow &mainWindow):
+    mMainWindow(mainWindow)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+MainView::~MainView()
+{
+	delete mSm;
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::init(HbApplication &app)
+{
+    mEngineWrapper.init();
+    this->setTitle("Creator");
+    createMenu(app);
+    createMemoryInfoText();
+}
+
+void MainView::createMenu(HbApplication& app)
+{
+    HbMenu* menu = this->menu();
+
+    // signal mapper for identifying the different command actions  
+	// in executeCommand() handler function:
+    mSm = new QSignalMapper(this);
+    connect(mSm, SIGNAL(mapped(int)), this, SLOT(executeMenuCommand(int)));
+    
+    if (menu != NULL) {
+
+		// Run script menu item:
+		mActionRunScript = menu->addAction("Run script"); 
+		connect(mActionRunScript, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionRunScript, ECmdCreateFromFile);	
+
+		// Calendar sub-menu items:
+		HbMenu* calendarSubMenu = new HbMenu("Calendar");
+		menu->addMenu(calendarSubMenu);
+		mActionCalendarAppointments = calendarSubMenu->addAction("Appointments");
+		mActionCalendarEvents = calendarSubMenu->addAction("Events");
+		mActionCalendarAnniversaries = calendarSubMenu->addAction("Anniversaries");
+		mActionCalendarTodos = calendarSubMenu->addAction("Todos");
+		mActionCalendarReminders = calendarSubMenu->addAction("Reminders");
+		
+		connect(mActionCalendarAppointments, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionCalendarAppointments, ECmdCreateCalendarEntryAppointments);
+
+		connect(mActionCalendarEvents, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionCalendarEvents, ECmdCreateCalendarEntryEvents);
+
+		connect(mActionCalendarAnniversaries, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionCalendarAnniversaries, ECmdCreateCalendarEntryAnniversaries);
+
+		connect(mActionCalendarTodos, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionCalendarTodos, ECmdCreateCalendarEntryToDos);
+
+		connect(mActionCalendarReminders, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionCalendarReminders, ECmdCreateCalendarEntryReminders);		
+/*		
+		// Browser sub-menu items:
+		HbMenu* browserSubMenu = new HbMenu("Browser");
+		menu->addMenu(browserSubMenu);
+		mActionBrowserBookmark = browserSubMenu->addAction("Bookmarks");
+		mActionBrowserBmarkFolder = browserSubMenu->addAction("Bookmark folders");
+		mActionBrowserSavedPages = browserSubMenu->addAction("Saved pages");
+		mActionBrowserSavedPageFolders = browserSubMenu->addAction("Saved page folders");
+
+		connect(mActionBrowserBookmark, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionBrowserBookmark, ECmdCreateBrowserBookmarkEntries);
+
+		connect(mActionBrowserBmarkFolder, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionBrowserBmarkFolder, ECmdCreateBrowserBookmarkFolderEntries);
+
+		connect(mActionBrowserSavedPages, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionBrowserSavedPages, ECmdCreateBrowserSavedPageEntries);
+
+		connect(mActionBrowserSavedPageFolders, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionBrowserSavedPageFolders, ECmdCreateBrowserSavedPageFolderEntries);	
+*/
+		// Files sub-menu items:
+		HbMenu* filesSubMenu = new HbMenu("Files");
+		menu->addMenu(filesSubMenu);
+		
+		mActionFilesEmptyFolder = filesSubMenu->addAction("Empty folder");
+		
+		connect(mActionFilesEmptyFolder, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesEmptyFolder, ECmdCreateFileEntryEmptyFolder);
+		
+		mActionFilesJpeg25 = filesSubMenu->addAction("JPEG 25kB");
+		connect(mActionFilesJpeg25, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJpeg25, ECmdCreateFileEntryJPEG_25kB);
+
+		mActionFilesJpeg200 = filesSubMenu->addAction("JPEG 200kB");
+		connect(mActionFilesJpeg200, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJpeg200, ECmdCreateFileEntryJPEG_200kB);
+
+		mActionFilesJpeg500 = filesSubMenu->addAction("JPEG 500kB");
+		connect(mActionFilesJpeg500, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJpeg500, ECmdCreateFileEntryJPEG_500kB);		
+
+		mActionFilesPng15 = filesSubMenu->addAction("PNG 15kB");
+		connect(mActionFilesPng15, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesPng15, ECmdCreateFileEntryPNG_15kB);
+		
+		mActionFilesGif2 = filesSubMenu->addAction("GIF 2kB");
+		connect(mActionFilesGif2, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesGif2, ECmdCreateFileEntryGIF_2kB);
+		
+		mActionFilesBmp25 = filesSubMenu->addAction("BMP 25kB");
+		connect(mActionFilesBmp25, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesBmp25, ECmdCreateFileEntryBMP_25kB);
+		
+		mActionFilesJp265 = filesSubMenu->addAction("JP2 65kB");
+		connect(mActionFilesJp265, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJp265, ECmdCreateFileEntryJP2_65kB);
+		
+		mActionFilesSvg15 = filesSubMenu->addAction("SVG 15kB");
+		connect(mActionFilesSvg15, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesSvg15, ECmdCreateFileEntrySVG_15kB);
+		
+		mActionFilesTif25 = filesSubMenu->addAction("TIF 25kB");
+		connect(mActionFilesTif25, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesTif25, ECmdCreateFileEntryTIF_25kB);
+		
+		mActionFilesRng1 = filesSubMenu->addAction("RNG 1kB");
+		connect(mActionFilesRng1, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesRng1, ECmdCreateFileEntryRNG_1kB);		
+		
+		mActionFilesMidi10 = filesSubMenu->addAction("MIDI 10kB");
+		connect(mActionFilesMidi10, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesMidi10, ECmdCreateFileEntryMIDI_10kB);
+		
+		mActionFilesWave20 = filesSubMenu->addAction("WAVE 20kB");
+		connect(mActionFilesWave20, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesWave20, ECmdCreateFileEntryWAV_20kB);
+
+		mActionFilesAmr20 = filesSubMenu->addAction("AMR 20kB");
+		connect(mActionFilesAmr20, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesAmr20, ECmdCreateFileEntryAMR_20kB);		
+
+		mActionFilesExcel15 = filesSubMenu->addAction("Excel 15kB");
+		connect(mActionFilesExcel15, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesExcel15, ECmdCreateFileEntryXLS_15kB);
+
+		mActionFilesWord20 = filesSubMenu->addAction("Word 20kB");
+		connect(mActionFilesWord20, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesWord20, ECmdCreateFileEntryDOC_20kB);		
+
+		mActionFilesPPoint40 = filesSubMenu->addAction("PowerPoint 40kB");
+		connect(mActionFilesPPoint40, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesPPoint40, ECmdCreateFileEntryPPT_40kB);		
+
+		mActionFilesText10 = filesSubMenu->addAction("Text 10kB");
+		connect(mActionFilesText10, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesText10, ECmdCreateFileEntryTXT_10kB);		
+
+		mActionFilesText70 = filesSubMenu->addAction("Text 70kB");
+		connect(mActionFilesText70, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesText70, ECmdCreateFileEntryTXT_70kB);
+
+		mActionFilesHtml20 = filesSubMenu->addAction("HTML 20kB");
+		connect(mActionFilesHtml20, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesHtml20, ECmdCreateFileEntryHTML_20kB);		
+
+		mActionFilesMxmf40 = filesSubMenu->addAction("MXMF 40kB");
+		connect(mActionFilesMxmf40, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesMxmf40, ECmdCreateFileEntryMXMF_40kB);	
+		
+		mActionFilesRam1 = filesSubMenu->addAction("RAM 1kB");
+		connect(mActionFilesRam1, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesRam1, ECmdCreateFileEntryRAM_1kB);			
+
+		mActionFilesJad1 = filesSubMenu->addAction("JAD 1kB");
+		connect(mActionFilesJad1, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJad1, ECmdCreateFileEntryJAD_1kB);			
+
+		mActionFilesJar10 = filesSubMenu->addAction("JAR 10kB");
+		connect(mActionFilesJar10, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesJar10, ECmdCreateFileEntryJAR_10kB);
+
+		mActionFilesVcf1 = filesSubMenu->addAction("VCF 1kB");
+		connect(mActionFilesVcf1, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesVcf1, ECmdCreateFileEntryVCF_1kB);
+		
+		mActionFilesVcs1 = filesSubMenu->addAction("VCS 1kB");
+		connect(mActionFilesVcs1, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesVcs1, ECmdCreateFileEntryVCS_1kB);
+		
+		mActionFilesSisx10 = filesSubMenu->addAction("SISX 10kB");
+		connect(mActionFilesSisx10, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesSisx10, ECmdCreateFileEntrySISX_10kB);
+
+		mActionFiles3Gpp70 = filesSubMenu->addAction("3GPP 70kB");
+		connect(mActionFiles3Gpp70, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFiles3Gpp70, ECmdCreateFileEntry3GPP_70kB);
+
+		mActionFilesMp3250 = filesSubMenu->addAction("MP3 250kB");
+		connect(mActionFilesMp3250, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesMp3250, ECmdCreateFileEntryMP3_250kB);	
+
+		mActionFilesAAC100 = filesSubMenu->addAction("AAC 100kB");
+		connect(mActionFilesAAC100, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesAAC100, ECmdCreateFileEntryAAC_100kB);	
+
+		mActionFilesSwf15 = filesSubMenu->addAction("SWF 15kB");
+		connect(mActionFilesSwf15, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesSwf15, ECmdCreateFileEntrySWF_15kB);	
+
+		mActionFilesMp4200 = filesSubMenu->addAction("MP4 200kB");
+		connect(mActionFilesMp4200, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesMp4200, ECmdCreateFileEntryMP4_200kB);	
+
+		mActionFilesRm95 = filesSubMenu->addAction("RM 95kB");
+		connect(mActionFilesRm95, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesRm95, ECmdCreateFileEntryRM_95kB);	
+
+		mActionFilesWma50 = filesSubMenu->addAction("WMA 50kB");
+		connect(mActionFilesWma50, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesWma50, ECmdCreateFileEntryWMA_50kB);			
+
+		mActionFilesWmv200 = filesSubMenu->addAction("WMV 200kB");
+		connect(mActionFilesWmv200, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionFilesWmv200, ECmdCreateFileEntryWMV_200kB);	
+		
+		// Logs sub-menu items:	
+		HbMenu* logsSubMenu = new HbMenu("Logs");
+		menu->addMenu(logsSubMenu);
+        
+		mActionLogsMissedCalls = logsSubMenu->addAction("Missed calls");
+		connect(mActionLogsMissedCalls, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionLogsMissedCalls, ECmdCreateLogEntryMissedCalls);
+
+		mActionLogsReceivedCalls = logsSubMenu->addAction("Received calls");
+		connect(mActionLogsReceivedCalls, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionLogsReceivedCalls, ECmdCreateLogEntryReceivedCalls);
+
+		mActionLogsDialledNumbers = logsSubMenu->addAction("Dialled numbers");
+		connect(mActionLogsDialledNumbers, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionLogsDialledNumbers, ECmdCreateLogEntryDialledNumbers);	
+
+		// Messaging sub-menu items:	
+		HbMenu* messageSubMenu = new HbMenu("Messaging");
+		menu->addMenu(messageSubMenu);
+        
+		mActionMessageMailboxes = messageSubMenu->addAction("Mailboxes");
+		connect(mActionMessageMailboxes, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMessageMailboxes, ECmdCreateMessagingEntryMailboxes);
+
+		mActionMessages = messageSubMenu->addAction("Messages");
+		connect(mActionMessages, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMessages, ECmdCreateMessagingEntryMessages);		
+		
+		// Misc sub-menu items:	
+		HbMenu* miscSubMenu = new HbMenu("Misc");
+		menu->addMenu(miscSubMenu);
+        
+		//mActionMiscConnection = miscSubMenu->addAction("Connection methods");
+		//mActionMiscImps = miscSubMenu->addAction("IMPS servers");
+		mActionMiscNotes = miscSubMenu->addAction("Notes");
+		//mActionMiscLandmarks = miscSubMenu->addAction("Landmarks");
+/*    
+		connect(mActionMiscConnection, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMiscConnection, ECmdCreateMiscEntryAccessPoints);
+
+		connect(mActionMiscImps, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMiscImps, ECmdCreateMiscEntryIMPSServers);
+*/
+		connect(mActionMiscNotes, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMiscNotes, ECmdCreateMiscEntryNotes);
+/*
+		connect(mActionMiscLandmarks, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionMiscLandmarks, ECmdCreateMiscEntryLandmarks);
+*/
+		// Phonebook sub-menu items:	
+		HbMenu* phonebookSubMenu = new HbMenu("Phonebook");
+		menu->addMenu(phonebookSubMenu);
+        
+		mActionPhonebookContacts = phonebookSubMenu->addAction("Contacts");
+		connect(mActionPhonebookContacts, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionPhonebookContacts, ECmdCreatePhoneBookEntryContacts);
+
+		mActionPhonebookGroups = phonebookSubMenu->addAction("Groups");
+		connect(mActionPhonebookGroups, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionPhonebookGroups, ECmdCreatePhoneBookEntryGroups);	
+		
+		// Delete sub-menu items: 
+		HbMenu* deleteSubMenu = new HbMenu("Delete");
+		menu->addMenu(deleteSubMenu);
+
+		HbMenu* deleteAllSubMenu = new HbMenu("All items");
+		deleteSubMenu->addMenu(deleteAllSubMenu);
+        
+		mActionDeleteAllItems = deleteAllSubMenu->addAction("All");
+		connect(mActionDeleteAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteAllItems, ECmdDeleteAllEntries);
+
+		mActionDeleteCreatorItems = deleteAllSubMenu->addAction("By Creator");
+		connect(mActionDeleteCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteCreatorItems, ECmdDeleteAllCreatorEntries);
+		
+		HbMenu* deleteCalendarSubMenu = new HbMenu("Calendar entries");
+		deleteSubMenu->addMenu(deleteCalendarSubMenu);
+        
+		mActionDeleteCalAllItems = deleteCalendarSubMenu->addAction("All");
+		connect(mActionDeleteCalAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteCalAllItems, ECmdDeleteCalendarEntries);
+
+		mActionDeleteCalCreatorItems = deleteCalendarSubMenu->addAction("By Creator");
+		connect(mActionDeleteCalCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteCalCreatorItems, ECmdDeleteCreatorCalendarEntries);
+/*
+		HbMenu* deleteBookmarksSubMenu = new HbMenu("Br bookmarks");
+		deleteSubMenu->addMenu(deleteBookmarksSubMenu);
+        
+		mActionDeleteBookmarkAllItems = deleteBookmarksSubMenu->addAction("All");
+		connect(mActionDeleteBookmarkAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteBookmarkAllItems, ECmdDeleteBrowserBookmarks);
+
+		mActionDeleteBookmarkCreatorItems = deleteBookmarksSubMenu->addAction("By Creator");
+		connect(mActionDeleteBookmarkCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteBookmarkCreatorItems, ECmdDeleteCreatorBrowserBookmarks);
+
+		HbMenu* deleteBookmarkFoldersSubMenu = new HbMenu("Br bookmark folders");
+		deleteSubMenu->addMenu(deleteBookmarkFoldersSubMenu);
+        
+		mActionDeleteBookmarkFolderAllItems = deleteBookmarkFoldersSubMenu->addAction("All");
+		connect(mActionDeleteBookmarkFolderAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteBookmarkFolderAllItems, ECmdDeleteBrowserBookmarkFolders);
+
+		mActionDeleteBookmarkFolderCreatorItems = deleteBookmarkFoldersSubMenu->addAction("By Creator");
+		connect(mActionDeleteBookmarkFolderCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteBookmarkFolderCreatorItems, ECmdDeleteCreatorBrowserBookmarkFolders);		
+
+		HbMenu* deleteSavedPagesSubMenu = new HbMenu("Br saved pages");
+		deleteSubMenu->addMenu(deleteSavedPagesSubMenu);
+        
+		mActionDeleteSavedPagesAllItems = deleteSavedPagesSubMenu->addAction("All");
+		connect(mActionDeleteSavedPagesAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteSavedPagesAllItems, ECmdDeleteBrowserSavedPages);
+
+		mActionDeleteSavedPagesCreatorItems = deleteSavedPagesSubMenu->addAction("By Creator");
+		connect(mActionDeleteSavedPagesCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteSavedPagesCreatorItems, ECmdDeleteCreatorBrowserSavedPages);	
+
+		HbMenu* deleteSavedPagesFolderSubMenu = new HbMenu("Br saved page folders");
+		deleteSubMenu->addMenu(deleteSavedPagesFolderSubMenu);
+        
+		mActionDeleteSavedPagesFolderAllItems = deleteSavedPagesFolderSubMenu->addAction("All");
+		connect(mActionDeleteSavedPagesFolderAllItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteSavedPagesFolderAllItems, ECmdDeleteBrowserSavedPageFolders);
+
+		mActionDeleteSavedPagesFolderCreatorItems = deleteSavedPagesFolderSubMenu->addAction("By Creator");
+		connect(mActionDeleteSavedPagesFolderCreatorItems, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteSavedPagesFolderCreatorItems, ECmdDeleteCreatorBrowserSavedPageFolders);	
+*/
+		HbMenu* deleteFilesSubMenu = new HbMenu("Files");
+		deleteSubMenu->addMenu(deleteFilesSubMenu);
+
+		mActionDeleteFiles = deleteFilesSubMenu->addAction("By Creator");
+		connect(mActionDeleteFiles, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteFiles, ECmdDeleteCreatorFiles);			
+		
+		HbMenu* deleteLogsSubMenu = new HbMenu("Logs");
+		deleteSubMenu->addMenu(deleteLogsSubMenu);
+
+		mActionDeleteLogsAll = deleteLogsSubMenu->addAction("All");
+		connect(mActionDeleteLogsAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteLogsAll, ECmdDeleteLogs);
+		
+		mActionDeleteLogsByCreator = deleteLogsSubMenu->addAction("By Creator");
+		connect(mActionDeleteLogsByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteLogsByCreator, ECmdDeleteCreatorLogs);
+
+		HbMenu* deleteMessagesSubMenu = new HbMenu("Messages");
+		deleteSubMenu->addMenu(deleteMessagesSubMenu);
+
+		mActionDeleteMessagesAll = deleteMessagesSubMenu->addAction("All");
+		connect(mActionDeleteMessagesAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteMessagesAll, ECmdDeleteMessages);
+		
+		mActionDeleteMessagesByCreator = deleteMessagesSubMenu->addAction("By Creator");
+		connect(mActionDeleteMessagesByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteMessagesByCreator, ECmdDeleteCreatorMessages);
+/*
+		HbMenu* deleteConnMethsSubMenu = new HbMenu("Connection methods");
+		deleteSubMenu->addMenu(deleteConnMethsSubMenu);
+
+		mActionDeleteConnMethsAll = deleteConnMethsSubMenu->addAction("All");
+		connect(mActionDeleteConnMethsAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteConnMethsAll, ECmdDeleteMessages);
+		
+		mActionDeleteConnMethsByCreator = deleteConnMethsSubMenu->addAction("By Creator");
+		connect(mActionDeleteConnMethsByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteConnMethsByCreator, ECmdDeleteCreatorMessages);
+
+		HbMenu* deleteImpsSubMenu = new HbMenu("IMPS servers");
+		deleteSubMenu->addMenu(deleteImpsSubMenu);
+
+		mActionDeleteImpsAll = deleteImpsSubMenu->addAction("All");
+		connect(mActionDeleteImpsAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteImpsAll, ECmdDeleteIMPSs);
+		
+		mActionDeleteImpsByCreator = deleteImpsSubMenu->addAction("By Creator");
+		connect(mActionDeleteImpsByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteImpsByCreator, ECmdDeleteCreatorIMPSs);		
+*/		
+		HbMenu* deleteNotesSubMenu = new HbMenu("Notes");
+		deleteSubMenu->addMenu(deleteNotesSubMenu);
+
+		mActionDeleteNotes = deleteNotesSubMenu->addAction("All");
+		connect(mActionDeleteNotes, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteNotes, ECmdDeleteNotes);
+/*
+		HbMenu* deleteLandmarksSubMenu = new HbMenu("Landmarks");
+		deleteSubMenu->addMenu(deleteLandmarksSubMenu);
+
+		mActionDeleteLandmarksAll = deleteLandmarksSubMenu->addAction("All");
+		connect(mActionDeleteLandmarksAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteLandmarksAll, ECmdDeleteLandmarks);
+		
+		mActionDeleteLandmarksByCreator = deleteLandmarksSubMenu->addAction("By Creator");
+		connect(mActionDeleteLandmarksByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteLandmarksByCreator, ECmdDeleteCreatorLandmarks);
+*/
+		HbMenu* deleteContactsSubMenu = new HbMenu("Contacts");
+		deleteSubMenu->addMenu(deleteContactsSubMenu);
+
+		mActionDeleteContactsAll = deleteContactsSubMenu->addAction("All");
+		connect(mActionDeleteContactsAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteContactsAll, ECmdDeleteContacts);
+		
+		mActionDeleteContactsByCreator = deleteContactsSubMenu->addAction("By Creator");
+		connect(mActionDeleteContactsByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteContactsByCreator, ECmdDeleteCreatorContacts);
+
+		HbMenu* deleteContactGroupsSubMenu = new HbMenu("Contact groups");
+		deleteSubMenu->addMenu(deleteContactGroupsSubMenu);
+
+		mActionDeleteContactGroupsAll = deleteContactGroupsSubMenu->addAction("All");
+		connect(mActionDeleteContactGroupsAll, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteContactGroupsAll, ECmdDeleteContactGroups);
+		
+		mActionDeleteContactGroupsByCreator = deleteContactGroupsSubMenu->addAction("By Creator");
+		connect(mActionDeleteContactGroupsByCreator, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionDeleteContactGroupsByCreator, ECmdDeleteCreatorContactGroups);		
+/*		
+		// select random data file:
+		mActionSelectRandomFile = menu->addAction("Select random data file"); 
+		connect(mActionSelectRandomFile, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mActionSelectRandomFile, ECmdSelectRandomDataFile);	
+*/		
+		// About & exit menu items:
+		mActionAbout = menu->addAction("About Creator");
+        connect(mActionAbout, SIGNAL( triggered() ), this, SLOT( showAboutPopup() ) );
+    
+        mActionExit = menu->addAction("Exit");
+        connect(mActionExit, SIGNAL(triggered()), &app, SLOT( quit() ) );
+
+        this->setMenu(menu);
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::createMemoryInfoText()
+{
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical, this);
+
+    // get memory details from engine;
+    mMemoryDetails = mEngineWrapper.GetMemoryDetails();
+	
+    if (layout != NULL) {
+        HbTextEdit* edit = new HbTextEdit(this);
+        if(edit != NULL) {
+			if (mMemoryDetails.mENotAvailable == false) {
+            edit->setPlainText(QString("\n\nFree RAM Memory:\n %1 of %2 kB \n\nFree disk memory: \nC: %3 of %4 kB \nD: %5 of %6 kB \nE: %7 of %8 kB")
+					.arg(mMemoryDetails.mHFree).arg(mMemoryDetails.mHSize)
+					.arg(mMemoryDetails.mCFree).arg(mMemoryDetails.mCSize)
+					.arg(mMemoryDetails.mDFree).arg(mMemoryDetails.mDSize)
+					.arg(mMemoryDetails.mEFree).arg(mMemoryDetails.mESize));
+			}
+			else {
+			edit->setPlainText(QString("\n\nFree RAM Memory:\n %1 of %2 kB \n\nFree disk memory: \nC: %3 of %4 kB \nD: %5 of %6 kB \nE: %7")
+					.arg(mMemoryDetails.mHFree).arg(mMemoryDetails.mHSize)
+					.arg(mMemoryDetails.mCFree).arg(mMemoryDetails.mCSize)
+					.arg(mMemoryDetails.mDFree).arg(mMemoryDetails.mDSize)
+					.arg(mMemoryDetails.mEFree));
+			}
+            edit->setReadOnly(true);
+            //edit->setCursorHidden(true);
+            //edit->setAttribute(Qt::WA_InputMethodEnabled, false);
+            layout->addItem(edit);
+            layout->setContentsMargins(5, 5, 5, 5);
+            this->setLayout(layout);
+        }
+        
+    }
+    
+}
+
+
+// ---------------------------------------------------------------------------
+
+void MainView::showAboutPopup()
+{
+	Notifications::about();
+
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::executeMenuCommand(int cmd)
+{
+    switch (cmd) {
+		case ECmdCreateFromFile:
+		case ECmdCreateCalendarEntryAppointments:
+		case ECmdCreateCalendarEntryEvents:
+		case ECmdCreateCalendarEntryAnniversaries:
+		case ECmdCreateCalendarEntryToDos:
+		case ECmdCreateCalendarEntryReminders:
+		case ECmdCreateBrowserBookmarkEntries:
+        case ECmdCreateBrowserBookmarkFolderEntries:
+        case ECmdCreateBrowserSavedPageEntries:
+        case ECmdCreateBrowserSavedPageFolderEntries: 
+		case ECmdCreateFileEntryEmptyFolder:
+	    case ECmdCreateFileEntry3GPP_70kB:
+	    case ECmdCreateFileEntryAAC_100kB:
+	    case ECmdCreateFileEntryAMR_20kB:
+	    case ECmdCreateFileEntryBMP_25kB:
+	    case ECmdCreateFileEntryDeck_1kB:
+	    case ECmdCreateFileEntryDOC_20kB:
+	    case ECmdCreateFileEntryGIF_2kB:
+	    case ECmdCreateFileEntryHTML_20kB:
+	    case ECmdCreateFileEntryJAD_1kB:
+	    case ECmdCreateFileEntryJAR_10kB:
+	    case ECmdCreateFileEntryJP2_65kB:
+	    case ECmdCreateFileEntryJPEG_200kB:
+	    case ECmdCreateFileEntryJPEG_25kB:
+	    case ECmdCreateFileEntryJPEG_500kB:
+	    case ECmdCreateFileEntryMIDI_10kB:
+	    case ECmdCreateFileEntryMP3_250kB:
+	    case ECmdCreateFileEntryMP4_200kB:
+	    case ECmdCreateFileEntryMXMF_40kB:
+	    case ECmdCreateFileEntryPNG_15kB:
+	    case ECmdCreateFileEntryPPT_40kB:
+	    case ECmdCreateFileEntryRAM_1kB:
+	    case ECmdCreateFileEntryRM_95kB:
+	    case ECmdCreateFileEntryRNG_1kB:
+	    case ECmdCreateFileEntrySVG_15kB:
+	    case ECmdCreateFileEntrySWF_15kB:
+	    case ECmdCreateFileEntryTIF_25kB:
+	    case ECmdCreateFileEntryTXT_10kB:
+	    case ECmdCreateFileEntryTXT_70kB:
+	    case ECmdCreateFileEntryVCF_1kB:
+	    case ECmdCreateFileEntryVCS_1kB:
+	    case ECmdCreateFileEntryWAV_20kB:
+	    case ECmdCreateFileEntryXLS_15kB:
+	    case ECmdCreateFileEntrySISX_10kB:
+	    case ECmdCreateFileEntryWMA_50kB:
+	    case ECmdCreateFileEntryWMV_200kB:
+	    case ECmdCreateLogEntryMissedCalls:
+	    case ECmdCreateLogEntryReceivedCalls:
+	    case ECmdCreateLogEntryDialledNumbers:
+	    case ECmdCreateMessagingEntryMailboxes:
+	    case ECmdCreateMessagingEntryMessages:		
+        case ECmdCreateMiscEntryAccessPoints:
+		case ECmdCreateMiscEntryIMPSServers:
+		case ECmdCreateMiscEntryNotes:
+		case ECmdCreateMiscEntryLandmarks:		
+		case ECmdCreatePhoneBookEntryContacts:
+	    case ECmdCreatePhoneBookEntryGroups:
+		case ECmdDeleteAllEntries:
+	    case ECmdDeleteAllCreatorEntries:
+	    case ECmdDeleteContacts:
+        case ECmdDeleteCreatorContacts:
+        case ECmdDeleteContactGroups:
+        case ECmdDeleteCreatorContactGroups:
+        case ECmdDeleteCalendarEntries:
+        case ECmdDeleteCreatorCalendarEntries:
+        case ECmdDeleteBrowserBookmarks:
+        case ECmdDeleteCreatorBrowserBookmarks:
+        case ECmdDeleteBrowserBookmarkFolders:
+        case ECmdDeleteCreatorBrowserBookmarkFolders:
+        case ECmdDeleteBrowserSavedPages:
+        case ECmdDeleteCreatorBrowserSavedPages:
+        case ECmdDeleteBrowserSavedPageFolders:
+        case ECmdDeleteCreatorBrowserSavedPageFolders:
+        case ECmdDeleteCreatorFiles:
+        case ECmdDeleteLogs:
+        case ECmdDeleteCreatorLogs:
+        case ECmdDeleteMessages:
+        case ECmdDeleteCreatorMessages:
+        case ECmdDeleteMailboxes:
+        case ECmdDeleteCreatorMailboxes:
+        case ECmdDeleteIAPs:
+        case ECmdDeleteCreatorIAPs:
+        case ECmdDeleteIMPSs:
+        case ECmdDeleteCreatorIMPSs:
+        case ECmdDeleteNotes:
+        case ECmdDeleteLandmarks:
+        case ECmdDeleteCreatorLandmarks:
+		case ECmdSelectRandomDataFile: {
+			mEngineWrapper.ExecuteOptionsMenuCommand(cmd);
+            break;
+        }
+        default: {
+            Notifications::error(QString("Unsupported command: %1").arg(cmd));
+            break;
+        }
+    }
+}
+
+void MainView::closeApp()
+{
+	qApp->quit();
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/notifications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <hbmessagebox.h>
+#include <hblabel.h>
+#include <hbaction.h>
+#include <hbpopup.h>
+#include <hblineedit.h>
+#include <hbvalidator.h>
+#include <hbabstractitemview.h>
+#include <hbprogressdialog.h>
+
+#include <QString>
+#include <QDate>
+#include <QRegExp>
+
+#include "notifications.h"
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout )
+{
+    HbMessageBox *messageBox = new HbMessageBox(type);
+    messageBox->setText(text);
+    if(label.length())
+        {
+        HbLabel *header = new HbLabel(label, messageBox);
+        messageBox->setHeadingWidget(header);
+        }
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(timeout);
+    messageBox->open();
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::about()
+{
+    showMessageBox(HbMessageBox::MessageTypeInformation,
+        "Version 6.0.0 - April 23rd 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.",
+        "About Creator", 
+        HbPopup::NoTimeout
+        );
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::error(const QString& errorMessage)
+{
+    showMessageBox(HbMessageBox::MessageTypeWarning, errorMessage, QString("Error"), 3000);
+}
+
+
+// ---------------------------------------------------------------------------
+
+HbProgressDialog* Notifications::showProgressBar(const QString& text, int max)
+{
+	HbProgressDialog *note = new HbProgressDialog(HbProgressDialog::ProgressDialog);
+    note->setText(text);
+    note->setMaximum(max);
+    note->show();
+    return note;
+
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout)
+{
+    showMessageBox(type, text, QString("Creator"), timeout);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Notifications::entriesQueryDialog(int& numberOfEntries, const QString& text, bool acceptsZero)
+{
+	bool err = false;
+	HbDialog *popup = new HbDialog();
+    popup->setDismissPolicy(HbPopup::TapOutside);
+    popup->setTimeout(HbPopup::NoTimeout);
+	
+	HbLabel *title = new HbLabel();
+    HbLineEdit *edit = new HbLineEdit();
+	HbAction *actionOk = new HbAction("Ok");
+	HbAction *actionCancel = new HbAction("Cancel");
+	
+	title->setPlainText(text);
+	popup->setHeadingWidget(title);
+	popup->setContentWidget(edit);
+	
+	HbValidator *validator = new HbValidator();
+	QString tmp;
+    if (acceptsZero == false) {
+		tmp.append("[1-9]{1}\\d{1,4}");
+	}
+	else {
+		tmp.append("^[0-9]{5}");
+	}
+        
+	QRegExp rxBasic(tmp);
+	validator->addField(new QRegExpValidator(rxBasic, 0), "");
+    edit->setValidator(validator);
+	edit->setText(QString::number(numberOfEntries));
+	edit->setSelection(0, QString::number(numberOfEntries).length());
+	
+	popup->setPrimaryAction(actionOk);
+    popup->setSecondaryAction(actionCancel);
+
+    // Launch popup syncronously
+    popup->setAttribute(Qt::WA_DeleteOnClose);
+    // TODO: handle dialog close & user input
+    popup->open();
+
+	// continue if ok selected and valid user input exists in line editor
+    /*if (action && action->text() == "Ok" && edit->text() != "") {
+		numberOfEntries = edit->text().toInt(&err, 10);
+	}*/
+	return err;
+}
+
+// ---------------------------------------------------------------------------
+bool Notifications::timeQueryDialog(QDate& date, const QString& text)
+{
+	bool err = false;
+    HbDialog *popup = new HbDialog();
+    popup->setDismissPolicy(HbPopup::TapOutside);
+    popup->setTimeout(HbPopup::NoTimeout);
+	
+	HbLabel *title = new HbLabel();
+    HbLineEdit *edit = new HbLineEdit();
+	HbAction *actionOk = new HbAction("Ok");
+	HbAction *actionCancel = new HbAction("Cancel");
+    
+	title->setPlainText(text);
+	popup->setHeadingWidget(title);
+	popup->setContentWidget(edit);
+
+    HbValidator *validator =new HbValidator;
+    QString dateString("(0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/](19|20)\\d\\d");
+	QRegExp rxDate(dateString);
+	validator->addField(new QRegExpValidator(rxDate, 0), "");
+    edit->setValidator(validator);
+	edit->setText(date.toString());
+	edit->setSelection(0, date.toString().length());
+
+    
+	popup->setPrimaryAction(actionOk);
+    popup->setSecondaryAction(actionCancel);
+
+    // Launch popup syncronously
+    popup->setAttribute(Qt::WA_DeleteOnClose);
+    // TODO: handle dialog close & user input
+    popup->open();
+
+	// continue if ok selected and valid user input exists in line editor
+    /*if (action && action->text() == "Ok" && edit->text() != "") {
+		date = QDate::fromString(edit->text());
+        err = true;
+	}*/
+	return err;    
+}
+
+// ---------------------------------------------------------------------------
+
+bool Notifications::yesNoQueryDialog(const QString& text)
+{
+    HbMessageBox::question(text, 0, 0);
+    return false;
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::popupListDialog(const QString& text, QStringList& items, HbAbstractItemView::SelectionMode mode, QObject* receiver, const char* member)
+{
+	HbSelectionDialog *dlg = new HbSelectionDialog;
+	dlg->setHeadingWidget(new HbLabel(text, dlg));
+	dlg->setStringItems(items);
+	dlg->setSelectionMode(mode); 
+	dlg->setAttribute(Qt::WA_DeleteOnClose);
+	dlg->open(receiver, member);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Notifications::directoryQueryDialog(const QString& text, QString& directory)
+{
+	bool err = false;
+    HbDialog *popup = new HbDialog();
+    popup->setDismissPolicy(HbPopup::TapOutside);
+    popup->setTimeout(HbPopup::NoTimeout);
+	
+	HbLabel *title = new HbLabel();
+    HbLineEdit *edit = new HbLineEdit();
+	HbAction *actionOk = new HbAction("Ok");
+	HbAction *actionCancel = new HbAction("Cancel");
+	
+	title->setPlainText(text);
+	popup->setHeadingWidget(title);
+	popup->setContentWidget(edit);
+	edit->setMaxLength(256);
+	edit->setText(directory);
+	edit->setSelection(0, directory.length());
+	
+	popup->setPrimaryAction(actionOk);
+    popup->setSecondaryAction(actionCancel);
+
+    // Launch popup syncronously
+    popup->setAttribute(Qt::WA_DeleteOnClose);
+    // TODO: handle dialog close & user input
+    popup->open();
+
+	// continue if ok selected and valid user input exists in line editor
+    /*if (action && action->text() == "Ok" && edit->text() != "") {
+		directory = edit->text();
+		err = true;
+	}*/
+	return err;
+}
+
+// ---------------------------------------------------------------------------
--- a/creator/symbian_version.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Symbian version configuration file 
-*
-*/
-
-#ifndef __SYMBIAN_VERSION_HRH
-#define __SYMBIAN_VERSION_HRH
-
-// S60 and Symbian version number enumeration definitions
-
-#define S60_30                                              30
-#define S60_31                                              31
-#define S60_32                                              32
-#define S60_50                                              50
-#define S60_51                                              91
-#define S60_52                                              92
-#define SYMBIAN_1                                           50
-#define SYMBIAN_2                                           91
-#define SYMBIAN_3                                           92
-#define SYMBIAN_4                                           101
-
-
-/**
- * Defines the S60 or Symbian version used by this component. This flag can be
- * used to variate the source code based on the SDK in use. The value of the
- * flag should be always changed to reflect the current build environment.
- */
-#define SYMBIAN_VERSION_SUPPORT                              SYMBIAN_4
-
-
-#endif  // __SYMBIAN_VERSION_HRH
--- a/filebrowser/data/filebrowser.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1599 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-NAME MATT
-
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <avkon.mbg>
-#include <CommonDialogs.hrh>
-#include <CommonDialogs.rh>
-#include <pathconfiguration.hrh>
-
-#include "FB.hrh"
-#include <data_caging_paths_strings.hrh>
-#include <appinfo.rh>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    #include <filebrowser_extraicons.mbg> // for r_filebrowser_toolbar_info_extension
-#endif
-
-
-// ---------------------------------------------------------
-//   
-//    Define the resource file signature 
-//    This resource should be empty.
-//
-// ---------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//   
-//    Default Document Name
-//
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name { buf=""; }
-
-// ---------------------------------------------------------
-//   
-//    Define default menu and CBA key.
-//
-// ---------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    custom_app_info_extension = r_filebrowser_toolbar_info_extension;
-#endif
-    }
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-
-RESOURCE EIK_APP_INFO_EXT r_filebrowser_toolbar_info_extension
-    {
-    popup_toolbar = r_filebrowser_toolbar;
-    }
-
-RESOURCE AVKON_TOOLBAR r_filebrowser_toolbar
-    {
-    lines = 1;
-    flags = KAknToolbarFixed ;
-
-    items =
-        {
-        TBAR_CTRL
-            {
-            type = EAknCtButton;
-            id = EFileBrowserCmdFileBack;
-            control = AVKON_BUTTON
-                {
-                flags = 0;
-                states =
-                    {
-                    AVKON_BUTTON_STATE
-                        {
-                        helptxt = "Up one level";
-                        bmpfile = APP_BITMAP_DIR"\\filebrowser_extraicons.mif";
-                        bmpid = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_folder_parent;
-                        bmpmask = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_folder_parent_mask;
-                        }
-                    };
-                };
-            },
-        TBAR_CTRL
-            {
-            type = EAknCtButton;
-            id = EFileBrowserCmdFileSearch;
-            control = AVKON_BUTTON
-                {
-                flags = 0;
-                states =
-                    {
-                    AVKON_BUTTON_STATE
-                        {
-                        helptxt = "Open/Close filter view";
-                        bmpfile = APP_BITMAP_DIR"\\filebrowser_extraicons.mif";
-                        bmpid = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_find;
-                        bmpmask = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_find_mask;
-                        }
-                    };
-                };
-            },
-        TBAR_CTRL
-            {
-            type = EAknCtButton;
-            id = EFileBrowserCmdEditSelect;
-            control = AVKON_BUTTON
-                {
-                flags = KAknButtonReportOnLongPress;
-                states =
-                    {
-                    AVKON_BUTTON_STATE
-                        {
-                        helptxt = "Select/Unselect item";
-                        bmpfile = APP_BITMAP_DIR"\\filebrowser_extraicons.mif";
-                        bmpid = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_selection;
-                        bmpmask = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_selection_mask;
-                        },
-                    AVKON_BUTTON_STATE
-                        {
-                        helptxt = "Select/Unselect item";
-                        bmpfile = APP_BITMAP_DIR"\\filebrowser_extraicons.mif";
-                        bmpid = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_selection_active;
-                        bmpmask = EMbmFilebrowser_extraiconsQgn_indi_tb_filebrowser_selection_active_mask;
-                        }
-                    };
-                };
-            }
-        };
-    }
-#endif
-
-//----------------------------------------------------
-//   
-//    r_filebrowser_hotkeys
-//
-//----------------------------------------------------
-//
-RESOURCE HOTKEYS r_filebrowser_hotkeys
-    {
-    control=
-        {
-        HOTKEY { command=EAknCmdExit; key='e'; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_filebrowser_view_filelist
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_filebrowser_view_filelist
-    {
-    hotkeys=r_filebrowser_hotkeys;
-    menubar=r_filebrowser_menubar_view_filelist;  
-    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
-    }
-
-//----------------------------------------------------
-//   
-//    r_filebrowser_menubar_view_filelist
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_filebrowser_menubar_view_filelist
-    {
-    titles=
-        {
-        MENU_TITLE { menu_pane=r_filebrowser_app_menu; txt="App"; },
-        MENU_TITLE { menu_pane=r_filebrowser_view_filelist_menu; txt="View"; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_filebrowser_view_filelist_menu
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_filebrowser_view_filelist_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=EFileBrowserCmdFile; txt="File"; cascade=r_filebrowser_file_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdEdit; txt="Edit"; cascade=r_filebrowser_edit_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdView; txt="View"; cascade=r_filebrowser_view_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdmin; txt="Disk admin"; cascade=r_filebrowser_diskadmin_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdTools; txt="Tools"; cascade=r_filebrowser_tools_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdSettings; txt="Settings"; },
-        MENU_ITEM { command=EFileBrowserCmdAbout; txt="About"; },
-        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_file_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileBack; txt="Back/Move up (<-)"; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpen; txt="Open"; cascade=r_filebrowser_file_open_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpenDrive; txt="Open drive (->)"; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpenDirectory; txt="Open directory (->)"; },
-        MENU_ITEM { command=EFileBrowserCmdFileView; txt="View"; cascade=r_filebrowser_file_view_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdFileEdit; txt="Edit"; cascade=r_filebrowser_file_edit_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdFileSearch; txt="Search..."; },
-        MENU_ITEM { command=EFileBrowserCmdFileSendTo; txt="Send to"; },
-        MENU_ITEM { command=EFileBrowserCmdFileNew; txt="New"; cascade=r_filebrowser_file_new_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdFileDelete; txt="Delete"; },
-        MENU_ITEM { command=EFileBrowserCmdFileRename; txt="Rename"; },
-        MENU_ITEM { command=EFileBrowserCmdFileTouch; txt="Touch"; },
-        MENU_ITEM { command=EFileBrowserCmdFileProperties; txt="Properties"; },
-        MENU_ITEM { command=EFileBrowserCmdFileChecksums; txt="Checksums"; cascade=r_filebrowser_file_checksums_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdFileSetAttributes; txt="Set attributes..."; },
-        MENU_ITEM { command=EFileBrowserCmdFileCompress; txt="Compress with GZip"; },
-        MENU_ITEM { command=EFileBrowserCmdFileDecompress; txt="Decompress with GZip"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_file_open_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileOpenApparc; txt="AppArc"; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpenDocHandlerEmbed; txt="DocHandler embed"; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpenDocHandlerStandAlone; txt="DocHandler stand-alone"; },
-        MENU_ITEM { command=EFileBrowserCmdFileOpenFileService; txt="Choose a file service..."; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_file_view_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileViewText; txt="As text"; },
-        MENU_ITEM { command=EFileBrowserCmdFileViewHex; txt="As hex"; }
-        };
-    }
-    
-RESOURCE MENU_PANE r_filebrowser_file_edit_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileEditText; txt="As text"; },
-        MENU_ITEM { command=EFileBrowserCmdFileEditHex; txt="As hex"; }
-        };
-    }
-        
-RESOURCE MENU_PANE r_filebrowser_file_new_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileNewFile; txt="File"; },
-        MENU_ITEM { command=EFileBrowserCmdFileNewDirectory; txt="Directory"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_file_checksums_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileChecksumsMD5; txt="MD5"; },
-        MENU_ITEM { command=EFileBrowserCmdFileChecksumsMD2; txt="MD2"; },
-        MENU_ITEM { command=EFileBrowserCmdFileChecksumsSHA1; txt="SHA-1"; }
-        };
-    }
-RESOURCE MENU_PANE r_filebrowser_edit_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdSnapShot; txt="Snap shot to E:"; },
-        MENU_ITEM { command=EFileBrowserCmdEditCut; txt="Cut"; },
-        MENU_ITEM { command=EFileBrowserCmdEditCopy; txt="Copy"; },
-        MENU_ITEM { command=EFileBrowserCmdEditPaste; txt="Paste"; },
-        MENU_ITEM { command=EFileBrowserCmdEditCopyToFolder; txt="Copy to folder..."; },
-        MENU_ITEM { command=EFileBrowserCmdEditMoveToFolder; txt="Move to folder..."; },
-        MENU_ITEM { command=EFileBrowserCmdEditSelect; txt="Select"; },
-        MENU_ITEM { command=EFileBrowserCmdEditUnselect; txt="Unselect"; },
-        MENU_ITEM { command=EFileBrowserCmdEditSelectAll; txt="Select all"; },
-        MENU_ITEM { command=EFileBrowserCmdEditUnselectAll; txt="Unselect all"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_view_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdViewSort; txt="Sort"; cascade=r_filebrowser_view_sort_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdViewOrder; txt="Order"; cascade=r_filebrowser_view_order_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdViewFilterEntries; txt="Filter entries"; },
-        MENU_ITEM { command=EFileBrowserCmdViewRefresh; txt="Refresh"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_view_sort_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdViewSortByName; txt="By name"; flags = EEikMenuItemRadioStart | EEikMenuItemSymbolOn; },
-        MENU_ITEM { command=EFileBrowserCmdViewSortByExtension; txt="By extension"; flags = EEikMenuItemRadioMiddle; },
-        MENU_ITEM { command=EFileBrowserCmdViewSortByDate; txt="By date"; flags = EEikMenuItemRadioMiddle; },
-        MENU_ITEM { command=EFileBrowserCmdViewSortBySize; txt="By size"; flags = EEikMenuItemRadioEnd; }
-        };
-    }
-    
-RESOURCE MENU_PANE r_filebrowser_view_order_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdViewOrderAscending; txt="Ascending"; flags = EEikMenuItemRadioStart | EEikMenuItemSymbolOn; },
-        MENU_ITEM { command=EFileBrowserCmdViewOrderDescending; txt="Descending"; flags = EEikMenuItemRadioEnd; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_diskadmin_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminSetDrivePassword; txt="Set drive password"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminUnlockDrive; txt="Unlock drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminClearDrivePassword; txt="Clear drive password"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminEraseDrivePassword; txt="Erase drive password"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminFormatDrive; txt="Format drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminQuickFormatDrive; txt="Quick format drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminCheckDisk; txt="Check disk"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminScanDrive; txt="Scan drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminSetDriveName; txt="Set drive name"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminSetDriveVolumeLabel; txt="Set drive volume label"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminEjectDrive; txt="Eject drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminDismountFileSystem; txt="Dismount drive"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminEraseMBR; txt="Erase MBR"; },
-        MENU_ITEM { command=EFileBrowserCmdDiskAdminDrivePartition; txt="Partition drive"; }
-        };
-    }
-    
-RESOURCE MENU_PANE r_filebrowser_tools_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsInstalledApps; txt="All apps to a text file"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsAllFiles; txt="All files to a text file"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsAvkonIconCache; txt="Avkon icon cache"; cascade=r_filebrowser_tools_avkoniconcache_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdToolsDisableExtErrors; txt="Disable extended errors"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgStoreWalk; txt="Dump msg. store walk"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsEditDataTypes; txt="Edit data types"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsEnableExtErrors; txt="Enable extended errors"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsErrorSimulate; txt="Error simulate"; cascade=r_filebrowser_tools_errorsimulate_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdToolsLocalConnectivity; txt="Local connectivity"; cascade=r_filebrowser_tools_localconnectivity_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgAttachments; txt="Message attachments"; cascade=r_filebrowser_tools_msgattachments_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMemoryInfo; txt="Memory info"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsSecureBackup; txt="Secure backup"; cascade=r_filebrowser_tools_securebackup_submenu; },
-        MENU_ITEM { command=EFileBrowserCmdToolsSetDebugMask; txt="Set debug mask"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsOpenFiles; txt="Show open files here"; }
-        };
-    }    
-
-RESOURCE MENU_PANE r_filebrowser_tools_avkoniconcache_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsAvkonIconCacheEnable; txt="Enable"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsAvkonIconCacheDisable; txt="Clear and disable"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_tools_errorsimulate_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsErrorSimulateLeave; txt="Leave"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsErrorSimulatePanic; txt="Panic"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsErrorSimulateException; txt="Exception"; }
-        };
-    }
-        
-RESOURCE MENU_PANE r_filebrowser_tools_localconnectivity_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsLocalConnectivityActivateInfrared; txt="Activate infrared"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsLocalConnectivityLaunchBTUI; txt="Launch BT UI"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsLocalConnectivityLaunchUSBUI; txt="Launch USB UI"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_tools_msgattachments_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgAttachmentsInbox; txt="Inbox"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgAttachmentsDrafts; txt="Drafts"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgAttachmentsSentItems; txt="Sent items"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsMsgAttachmentsOutbox; txt="Outbox"; }
-        };
-    }        
-
-RESOURCE MENU_PANE r_filebrowser_tools_securebackup_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdToolsSecureBackupStartBackup; txt="Start backup"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsSecureBackupStartRestore; txt="Start restore"; },
-        MENU_ITEM { command=EFileBrowserCmdToolsSecureBackupStop; txt="Stop"; }
-        };
-    } 
-            
-//----------------------------------------------------
-//   
-//    r_filebrowser_app_menu
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_filebrowser_app_menu
-    {
-    items=
-        {
-        };
-    }
-
-//----------------------------------------------------
-//
-//    r_filebrowser_settings_dialog
-//    Dialog for setting list
-//
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_filebrowser_settings_dialog
-    {
-    flags =
-        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
-        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
-        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
-    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtSettingListBox;
-            id = EFileBrowserSettingItemList;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = LISTBOX
-                {
-                flags = EAknListBoxSelectionList;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-//    r_filebrowser_settings_menubar
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_filebrowser_settings_menubar
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_filebrowser_settings_menupane;
-            txt = " ";   // dummy
-            }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_settings_menupane
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdSettingsChange;
-            txt = "Change";
-            },
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdSettingsExit;
-            txt = "Exit";
-            }
-        };
-    }
-
-//----------------------------------------------------
-//    r_filebrowser_fileviewer_dialog
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_filebrowser_fileviewer_dialog
-    {
-    flags =
-        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
-        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
-        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
-    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EFileViewerDialogControl;
-            id = EFileEditorDialogId;
-            }
-        };
-    }
-
-//----------------------------------------------------
-//    r_filebrowser_fileeditor_dialog
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_filebrowser_fileeditor_dialog
-    {
-    flags =
-        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
-        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
-        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
-    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-    }
-
-//----------------------------------------------------
-//    r_filebrowser_fileviewer_menubar
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_filebrowser_fileviewer_menubar
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_filebrowser_fileviewer_menupane;
-            txt = " ";   // dummy
-            }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_fileviewer_menupane
-    {
-    items =
-        {
-        MENU_ITEM { command = EFileBrowserCmdFileEditorViewAsText; txt = "View as text"; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorViewAsHex; txt = "View as hex"; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorExit; txt = "Exit"; }
-        };
-    }
-    
-//----------------------------------------------------
-//    r_filebrowser_fileeditor_menubar
-//----------------------------------------------------
-//
-
-RESOURCE MENU_BAR r_filebrowser_fileeditor_menubar
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_filebrowser_fileeditor_menupane;
-            txt = " ";   // dummy
-            }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_fileeditor_menupane
-    {
-    items =
-        {
-        MENU_ITEM { command = EFileBrowserCmdFileEditorSave; txt = "Save"; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorSaveAs; txt = "Save as..."; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorSaveFormat; txt = "Save format"; cascade=r_filebrowser_fileeditor_saveformat_submenu; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorEditAsText; txt = "Edit as text"; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorEditAsHex; txt = "Edit as hex"; },
-        MENU_ITEM { command = EFileBrowserCmdFileEditorExit; txt = "Exit"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_fileeditor_saveformat_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=EFileBrowserCmdFileEditorSaveFormatANSIASCII; txt="ANSI/ASCII"; flags = EEikMenuItemRadioStart | EEikMenuItemSymbolOn; },
-        MENU_ITEM { command=EFileBrowserCmdFileEditorSaveFormatUTF8; txt="UTF-8"; flags = EEikMenuItemRadioMiddle; },
-        MENU_ITEM { command=EFileBrowserCmdFileEditorSaveFormatUTF16LE; txt="UTF-16 LE"; flags = EEikMenuItemRadioMiddle; },
-        MENU_ITEM { command=EFileBrowserCmdFileEditorSaveFormatUTF16BE; txt="UTF-16 BE"; flags = EEikMenuItemRadioEnd; }
-        };
-    }
-    
-//----------------------------------------------------
-//   
-//    Setting item resources
-//
-//----------------------------------------------------
-//
-RESOURCE POPUP_SETTING_LIST r_popup_setting_list_editor
-	{
-	}
-
-
-//
-// resources for display mode selection
-//
-RESOURCE TBUF r_displaymodeselection_setting_title
-    {
-    buf = "Display mode";
-    }
-RESOURCE AVKON_SETTING_PAGE r_displaymodeselection_setting_page
-	{
-    number = EAknSettingPageNoOrdinalDisplayed; 
-	type = EAknCtPopupSettingList;
-	editor_resource_id = r_popup_setting_list_editor;
-	}
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_displaymodeselection_setting_texts
-	{
-	setting_texts_resource = r_displaymodeselection_text_array;
-	}
-RESOURCE ARRAY r_displaymodeselection_text_array
-	{
-	items =
-		{
-		AVKON_ENUMERATED_TEXT { value=EDisplayModeFullScreen; text = "Full screen"; },
-		AVKON_ENUMERATED_TEXT { value=EDisplayModeNormal; text = "Normal"; }
-		};
-	}
-
-
-//
-// resources for file view mode selection
-//
-RESOURCE TBUF r_fileviewmodeselection_setting_title
-    {
-    buf = "File view";
-    }
-RESOURCE AVKON_SETTING_PAGE r_fileviewmodeselection_setting_page
-	{
-    number = EAknSettingPageNoOrdinalDisplayed; 
-	type = EAknCtPopupSettingList;
-	editor_resource_id = r_popup_setting_list_editor;
-	}
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_fileviewmodeselection_setting_texts
-	{
-	setting_texts_resource = r_fileviewmodeselection_text_array;
-	}
-RESOURCE ARRAY r_fileviewmodeselection_text_array
-	{
-	items =
-		{
-		AVKON_ENUMERATED_TEXT { value=EFileViewModeSimple; text = "Simple"; },
-		AVKON_ENUMERATED_TEXT { value=EFileViewModeExtended; text = "Extended"; }
-		};
-	}
-
-
-//
-// resources for binary selections
-//
-RESOURCE TBUF r_showsubdirectoryinfoselection_setting_title
-    {
-    buf = "Show subdirectory info";
-    }
-RESOURCE TBUF r_showassociatediconsselection_setting_title
-    {
-    buf = "Show associated icons";
-    }
-RESOURCE TBUF r_rememberlastpathselection_setting_title
-    {
-    buf = "Remember folder on exit"; 
-    }
-RESOURCE TBUF r_rememberfolderselection_setting_title
-    {
-    buf = "Remember last folder";
-    }
-RESOURCE TBUF r_enabletoolbar_setting_title
-    {
-    buf = "Show toolbar";
-    }
-RESOURCE TBUF r_supportnetworkdrivesselection_setting_title
-    {
-    buf = "Support net drives";
-    }
-RESOURCE TBUF r_bypassplatformsecurityselection_setting_title
-    {
-    buf = "Bypass plat. security";
-    }
-RESOURCE TBUF R_REMOVEFILELOCKSSELECTION_SETTING_TITLE
-    {
-    buf = "Unlock files via SB";
-    }        
-RESOURCE TBUF R_IGNOREPROTECTIONATTSSELECTION_SETTING_TITLE
-    {
-    buf = "Ign. protection atts";
-    } 
-RESOURCE TBUF R_REMOVEROMWRITEPROTECTIONSELECTION_SETTING_TITLE
-    {
-    buf = "No RO-att copy from Z:";
-    } 
-RESOURCE AVKON_SETTING_PAGE r_binary_setting_page
-    {   
-    number = EAknSettingPageNoOrdinalDisplayed;
-    type = EAknCtPopupSettingList;
-	editor_resource_id = r_popup_setting_list_editor;
-    }
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_yesno_binaryselection_texts
-	{
-	setting_texts_resource = r_yesno_binaryselection_text_array;
-	}
-RESOURCE ARRAY r_yesno_binaryselection_text_array
-	{
-	items =
-		{
-		AVKON_ENUMERATED_TEXT { value=0; text = "No"; },
-		AVKON_ENUMERATED_TEXT { value=1; text = "Yes"; }
-		};
-	}
-		
-  
-// ---------------------------------------------------------
-//   
-//   r_filebrowser_about_dialog
-//   About dialog - show version and copyright info etc.
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_filebrowser_about_dialog
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                label = "About FileBrowser";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                message = "Version 4.5.2 - 10th December 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_general_confirmation_query
-//   
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_general_confirmation_query
-	{
-	flags = EGeneralQueryFlags;
-	buttons = R_AVKON_SOFTKEYS_YES_NO;
-	items =
-		{
-		DLG_LINE
-			{
-			type = EAknCtQuery;
-			id = EGeneralQuery;
-			control = AVKON_CONFIRMATION_QUERY
-				{
-				layout = EConfirmationQueryLayout;
-				};
-			}
-		};
-	}
-
-// ---------------------------------------------------------
-//   
-//   r_general_text_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_text_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout = EDataLayout;
-                control = EDWIN
-                    {
-                    width = 256;
-                    lines = 3;
-                    maxlength = 256;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_general_numeric_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_numeric_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = ENumberLayout;
-                control = AVKON_INTEGER_EDWIN
-                    {
-                    min = -999999;
-                    max = 999999;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_general_progress_note
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_progress_note
-    {
-    flags = EAknProgressNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = EFileBrowserProgressNote;
-            control = AVKON_NOTE
-                {
-                layout = EProgressLayout;
-                singular_label = "Processing";
-                };
-            }
-        };
-    }
-    
-// ---------------------------------------------------------
-//   
-//   r_general_wait_note
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_wait_note
-    {
-    flags = EAknWaitNoteFlags | EEikDialogFlagNotifyEsc;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = EFileBrowserWaitNote;
-            control= AVKON_NOTE 
-                { 
-                layout = EWaitLayout;
-                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
-                };
-            }
-        };
-    }
-    
-// ---------------------------------------------------------
-//   
-//   r_entry_overwrite_type_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_entry_overwrite_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_entry_overwrite_type_query_array;
-					};
-				heading = "Overwrite?";				
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_entry_overwrite_type_query_array
-	{
-	items =
-		{
-		LBUF {txt = "Overwrite all"; },
-		LBUF {txt = "Skip all existing"; },
-		LBUF {txt = "Gen. unique filenames"; },
-		LBUF {txt = "Query postfix"; }
-		};
-	}
-
-// ---------------------------------------------------------
-//   
-//   r_app_selection_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_app_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					};
-				heading = "Choose app:";				
-			    };
-            }
-        };
-    }        
-
-// ---------------------------------------------------------
-//   
-//   r_copy_to_folder_selection_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_copy_to_folder_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSingleGraphicPopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					};
-				heading = "Copy To";				
-			    };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_move_to_folder_selection_query
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_move_to_folder_selection_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSingleGraphicPopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					};
-				heading = "Move To";				
-			    };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_memoryinfo_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_memoryinfo_dialog
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                label = "Memory info";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                message = ".";
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_checksums_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_checksums_dialog
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                label = "Checksums";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                message = ".";
-                };
-            }
-        };
-    }
-    
-// ---------------------------------------------------------
-//   r_attribute_editor_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_attribute_editor_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_attribute_editor_form;
-    }
-
-RESOURCE FORM r_attribute_editor_form
-    {
-    flags = EEikFormEditModeOnly;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Archive";
-            id = EFileBrowserAttributeEditorSetArchive;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_attribute_editor_attmode_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Hidden";
-            id = EFileBrowserAttributeEditorSetHidden;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_attribute_editor_attmode_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Read only";
-            id = EFileBrowserAttributeEditorSetReadOnly;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_attribute_editor_attmode_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "System";
-            id = EFileBrowserAttributeEditorSetSystem;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_attribute_editor_attmode_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Recurse";
-            id = EFileBrowserAttributeEditorSetRecurse;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_attribute_editor_recurse_textarray;
-                active = 0;    
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_attribute_editor_attmode_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Skip"; },
-        LBUF { txt = "On"; },
-        LBUF { txt = "Off"; }
-        };
-    }    
-
-RESOURCE ARRAY r_attribute_editor_recurse_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Recursive"; },
-        LBUF { txt = "Non-recursive"; }
-        };
-    } 
-
-// ---------------------------------------------------------
-//   r_search_query_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_search_query_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_search_query_form;
-    }
-
-RESOURCE FORM r_search_query_form
-    {
-    flags = EEikFormEditModeOnly;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Search dir";
-            id = EFileBrowserSearchQuerySearchDir;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Wildcards";
-            id = EFileBrowserSearchQueryWildCards;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Has string";
-            id = EFileBrowserSearchQueryTextInFile;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Recurse";
-            id = EFileBrowserSearchQueryRecurse;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_search_query_recurse_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Min size";
-            id = EFileBrowserSearchQueryMinSize;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Max size";
-            id = EFileBrowserSearchQueryMaxSize;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtDateEditor;
-            prompt = "Min date";
-            id = EFileBrowserSearchQueryMinDate;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = DATE_EDITOR
-                {
-                minDate = DATE { day =  0; month =  0; year = 1980; };    
-                maxDate = DATE { day = 30; month = 11; year = 2060; };    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtDateEditor;
-            prompt = "Max date";
-            id = EFileBrowserSearchQueryMaxDate;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = DATE_EDITOR
-                {
-                minDate = DATE { day =  0; month =  0; year = 1980; };    
-                maxDate = DATE { day = 30; month = 11; year = 2060; };    
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_search_query_recurse_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Non-recursive"; },
-        LBUF { txt = "Recursive"; }
-        };
-    } 
-
-// ---------------------------------------------------------
-//   r_data_types_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_data_types_dialog
-    {
-    flags =
-        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
-        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
-        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
-    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtSingleGraphicListBox;
-            id = EFileBrowserDataTypesList;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = LISTBOX
-                {
-                flags = EAknListBoxSelectionList;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-//    r_filebrowser_data_types_menubar
-//----------------------------------------------------
-//
-
-RESOURCE MENU_BAR r_filebrowser_data_types_menubar
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_filebrowser_data_types_menupane;
-            txt = " ";   // dummy
-            }
-        };
-    }
-
-RESOURCE MENU_PANE r_filebrowser_data_types_menupane
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdDataTypesChangeMapping;
-            txt = "Change mapping";
-            },
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdDataTypesSetDefaultMapping;
-            txt = "Set to default mapping";
-            },
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdDataTypesRefresh;
-            txt = "Refresh";
-            },
-        MENU_ITEM
-            {
-            command = EFileBrowserCmdDataTypesExit;
-            txt = "Exit";
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_data_type_priority_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_data_type_priority_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_data_type_priority_query_array;
-					};
-				heading = "Select priority";				
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_data_type_priority_query_array
-	{
-	items =
-		{
-		LBUF {txt = "Maximum"; },
-		LBUF {txt = "High"; },
-		LBUF {txt = "Normal"; },
-		LBUF {txt = "Low"; },
-		LBUF {txt = "Last resort"; }
-		};
-	}
-
-// ---------------------------------------------------------
-//   r_securebackup_state_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_securebackup_state_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_securebackup_state_query_array;
-					};
-				heading = "Select state";				
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_securebackup_state_query_array
-	{
-	items =
-		{
-		LBUF {txt = "Full"; },
-		LBUF {txt = "Partial"; }
-		};
-	}
-
-// ---------------------------------------------------------
-//   r_securebackup_type_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_securebackup_type_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_securebackup_type_query_array;
-					};
-				heading = "Select type";				
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_securebackup_type_query_array
-	{
-	items =
-		{
-		LBUF {txt = "Base (all data)"; },
-		LBUF {txt = "Increment"; }
-		};
-	}
-	
-// ---------------------------------------------------------
-//   r_partition_amount_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_partition_amount_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_partition_amount_query_array;
-					};
-				heading = "Partitions?";
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_partition_amount_query_array
-	{
-	items =
-		{
-		LBUF {txt = "1"; },
-		LBUF {txt = "2"; },
-		LBUF {txt = "3"; },
-		LBUF {txt = "4"; }
-		};
-	} 	
-
-// ---------------------------------------------------------
-//   r_common_file_action_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_common_file_action_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = AVKON_LIST_QUERY_LIST
-					{
-					array_id = r_common_file_action_query_array;
-					};
-				heading = "";
-			    };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_common_file_action_query_array
-	{
-	items =
-		{
-		LBUF {txt = "View as text/hex"; },
-		LBUF {txt = "Open w/ AppArc"; },
-		LBUF {txt = "Open w/ DocH. embed"; }
-		};
-	} 
-		        
-// ---------------------------------------------------------
-//   
-// RESOURCE LOCALISABLE_APP_INFO r_filebrowser_localisable_app_info
-//
-// ---------------------------------------------------------
-//
-RESOURCE LOCALISABLE_APP_INFO r_filebrowser_localisable_app_info
-    {
-    short_caption = "FileBrowser";
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = "FileBrowser";
-
-        number_of_icons = 1;
-
-        // Note for ROM-based apps it is recommended to add the drive letter
-        // icon_file = "z:"APP_BITMAP_DIR"\\myapp_aif.mif";
-        icon_file = APP_BITMAP_DIR"\\filebrowser_aif.mif";
-        };
-    }
--- a/filebrowser/data/filebrowser_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include <filebrowser.rsg>
-#include <appinfo.rh>
-#include <data_caging_paths_strings.hrh>
-
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x102828D6
-
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "FileBrowser";
-    localisable_resource_file = APP_RESOURCE_DIR"\\FileBrowser";
-    localisable_resource_id = R_FILEBROWSER_LOCALISABLE_APP_INFO;
-    group_name = "RnD Tools";    
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FB.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,277 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSER_HRH
+#define FILEBROWSER_HRH
+
+enum TFileBrowserCommandIds
+    {
+    EFileBrowserCmdFile = 1,
+    EFileBrowserCmdFileBack,
+    EFileBrowserCmdFileOpen,
+    EFileBrowserCmdFileOpenApparc,
+    EFileBrowserCmdFileOpenDocHandlerEmbed,
+    EFileBrowserCmdFileOpenDocHandlerStandAlone,
+    EFileBrowserCmdFileOpenFileService,
+    EFileBrowserCmdFileOpenDrive,
+    EFileBrowserCmdFileOpenDirectory,
+    EFileBrowserCmdFileView,
+    EFileBrowserCmdFileViewText,
+    EFileBrowserCmdFileViewHex,
+    EFileBrowserCmdFileEdit,
+    EFileBrowserCmdFileEditText,
+    EFileBrowserCmdFileEditHex,
+    EFileBrowserCmdFileSearch,
+    EFileBrowserCmdFileSendTo,
+    EFileBrowserCmdFileNew,
+    EFileBrowserCmdFileNewFile,
+    EFileBrowserCmdFileNewDirectory,
+    EFileBrowserCmdFileDelete,
+    EFileBrowserCmdFileRename,
+    EFileBrowserCmdFileTouch,
+    EFileBrowserCmdFileProperties,
+    EFileBrowserCmdFileChecksums,
+    EFileBrowserCmdFileChecksumsMD5,
+    EFileBrowserCmdFileChecksumsMD2,
+    EFileBrowserCmdFileChecksumsSHA1,
+    EFileBrowserCmdFileSetAttributes,
+    EFileBrowserCmdFileCompress,
+    EFileBrowserCmdFileDecompress,
+    EFileBrowserCmdEdit,
+    EFileBrowserCmdSnapShot,
+    EFileBrowserCmdEditCut,
+    EFileBrowserCmdEditCopy,    
+    EFileBrowserCmdEditPaste,
+    EFileBrowserCmdEditCopyToFolder,    
+    EFileBrowserCmdEditMoveToFolder,
+    EFileBrowserCmdEditSelect,    
+    EFileBrowserCmdEditUnselect,
+    EFileBrowserCmdEditSelectAll,    
+    EFileBrowserCmdEditUnselectAll,
+    EFileBrowserCmdView,
+    EFileBrowserCmdViewSort,
+    EFileBrowserCmdViewSortByName,
+    EFileBrowserCmdViewSortByExtension,
+    EFileBrowserCmdViewSortByDate,
+    EFileBrowserCmdViewSortBySize,
+    EFileBrowserCmdViewOrder,
+    EFileBrowserCmdViewOrderAscending,
+    EFileBrowserCmdViewOrderDescending,
+    EFileBrowserCmdViewFilterEntries,
+    EFileBrowserCmdViewRefresh,
+    EFileBrowserCmdDiskAdmin,    
+    EFileBrowserCmdDiskAdminSetDrivePassword,    
+    EFileBrowserCmdDiskAdminUnlockDrive,    
+    EFileBrowserCmdDiskAdminClearDrivePassword,    
+    EFileBrowserCmdDiskAdminEraseDrivePassword,    
+    EFileBrowserCmdDiskAdminFormatDrive,    
+    EFileBrowserCmdDiskAdminQuickFormatDrive,    
+    EFileBrowserCmdDiskAdminCheckDisk,    
+    EFileBrowserCmdDiskAdminScanDrive,    
+    EFileBrowserCmdDiskAdminSetDriveName,    
+    EFileBrowserCmdDiskAdminSetDriveVolumeLabel,    
+    EFileBrowserCmdDiskAdminEraseMBR,
+    EFileBrowserCmdDiskAdminDrivePartition,    
+    EFileBrowserCmdDiskAdminEjectDrive,    
+    EFileBrowserCmdDiskAdminDismountFileSystem,    
+    EFileBrowserCmdTools,    
+    EFileBrowserCmdToolsAllFiles,
+    EFileBrowserCmdToolsAvkonIconCache,
+    EFileBrowserCmdToolsAvkonIconCacheEnable,
+    EFileBrowserCmdToolsAvkonIconCacheDisable,    
+    EFileBrowserCmdToolsDisableExtErrors,    
+    EFileBrowserCmdToolsEditDataTypes,
+    EFileBrowserCmdToolsEnableExtErrors,
+    EFileBrowserCmdToolsErrorSimulate,
+    EFileBrowserCmdToolsErrorSimulateLeave,
+    EFileBrowserCmdToolsErrorSimulatePanic,
+    EFileBrowserCmdToolsErrorSimulateException,    
+    EFileBrowserCmdToolsLocalConnectivity,    
+    EFileBrowserCmdToolsLocalConnectivityActivateInfrared,    
+    EFileBrowserCmdToolsLocalConnectivityLaunchBTUI,    
+    EFileBrowserCmdToolsLocalConnectivityLaunchUSBUI,    
+    EFileBrowserCmdToolsInstalledApps,    
+    EFileBrowserCmdToolsOpenFiles,    
+    EFileBrowserCmdToolsMsgAttachments,    
+    EFileBrowserCmdToolsMsgAttachmentsInbox,    
+    EFileBrowserCmdToolsMsgAttachmentsDrafts,    
+    EFileBrowserCmdToolsMsgAttachmentsSentItems,    
+    EFileBrowserCmdToolsMsgAttachmentsOutbox,    
+    EFileBrowserCmdToolsMsgStoreWalk,
+    EFileBrowserCmdToolsSecureBackup,    
+    EFileBrowserCmdToolsSecureBackupStartBackup,    
+    EFileBrowserCmdToolsSecureBackupStartRestore,    
+    EFileBrowserCmdToolsSecureBackupStop,    
+    EFileBrowserCmdToolsSetDebugMask,    
+    EFileBrowserCmdToolsMemoryInfo,    
+    EFileBrowserCmdSettings,
+    EFileBrowserCmdAbout,
+    EFileBrowserCmdSettingsChange,
+    EFileBrowserCmdSettingsExit,
+    EFileBrowserCmdSettingsBack,
+    EFileBrowserSettingItemList,
+    EFileBrowserCmdDataTypesChangeMapping,
+    EFileBrowserCmdDataTypesSetDefaultMapping,
+    EFileBrowserCmdDataTypesRefresh,
+    EFileBrowserCmdDataTypesExit,
+    EFileBrowserCmdDataTypesBack,
+    EFileBrowserDataTypesList,
+    EFileBrowserProgressNote,
+    EFileBrowserWaitNote,
+    EFileBrowserAttributeEditorSetArchive,
+    EFileBrowserAttributeEditorSetHidden,
+    EFileBrowserAttributeEditorSetReadOnly,
+    EFileBrowserAttributeEditorSetSystem,
+    EFileBrowserAttributeEditorSetRecurse,
+    EFileBrowserSearchQuerySearchDir,
+    EFileBrowserSearchQueryWildCards,
+    EFileBrowserSearchQueryTextInFile,
+    EFileBrowserSearchQueryMinSize,
+    EFileBrowserSearchQueryMaxSize,
+    EFileBrowserSearchQueryMinDate,
+    EFileBrowserSearchQueryMaxDate,
+    EFileBrowserSearchQueryRecurse,
+    EFileBrowserCmdFileEditorViewAsText,
+    EFileBrowserCmdFileEditorViewAsHex,
+    EFileBrowserCmdFileEditorSave,
+    EFileBrowserCmdFileEditorSaveAs,
+    EFileBrowserCmdFileEditorSaveFormat,
+    EFileBrowserCmdFileEditorSaveFormatANSIASCII,
+    EFileBrowserCmdFileEditorSaveFormatUTF8,
+    EFileBrowserCmdFileEditorSaveFormatUTF16LE,
+    EFileBrowserCmdFileEditorSaveFormatUTF16BE,
+    EFileBrowserCmdFileEditorEditAsText,
+    EFileBrowserCmdFileEditorEditAsHex,
+    EFileBrowserCmdFileEditorExit,
+    EFileBrowserFileOpCommandAttribs,
+    EFileBrowserFileOpCommandCopy,
+    EFileBrowserFileOpCommandMove,
+    EFileBrowserFileOpCommandRename,
+    EFileBrowserFileOpCommandDelete,
+    EFileBrowserFileOpCommandDriveSnapShot
+    };
+
+enum TFileBrowserFixedIconIds
+    {
+    EFixedIconMarking = 0,
+    EFixedIconEmpty,    
+    EFixedIconPhoneMemory,    
+    EFixedIconMemoryCard,    
+    EFixedIconMemoryCardDisabled,    
+    EFixedIconFolder,    
+    EFixedIconFolderSub,    
+    EFixedIconFolderCurrent,
+    EFixedIconListLength // this should be last   
+    };
+
+enum TFileBrowserEntryOverwriteActions
+    {
+    EFileActionOverwriteAll = 0,
+    EFileActionSkipAllExisting,    
+    EFileActionGenerateUniqueFilenames,
+    EFileActionQueryPostFix   
+    };
+
+enum TFileBrowserSecureBackupState
+    {
+    ESecureBackupStateFull = 0,
+    ESecureBackupStatePartial    
+    };
+
+enum TFileBrowserSecureBackupType
+    {
+    ESecureBackupTypeBase = 0,
+    ESecureBackupTypeIncremental    
+    };
+    
+enum TFileBrowserDataTypePriorities
+    {
+    EDataTypePriorityMaximum = 0,
+    EDataTypePriorityHigh,    
+    EDataTypePriorityNormal,
+    EDataTypePriorityLow,
+    EDataTypePriorityLastResort   
+    };
+
+enum TFileBrowserCommonFileActions
+    {
+    ECommonFileActionViewAsTextHex = 0,
+    ECommonFileActionOpenWithApparc,    
+    ECommonFileActionOpenWithDocHandlerEmbed   
+    };
+                     
+enum TFileBrowserSettingListTabs
+    {
+    ETabGeneral = 0,
+    ETabFileOps    
+    };
+    
+enum TFileBrowserSettingListIds
+    {
+    ESettingListDisplayModeSelection = 0,
+    ESettingListFileViewModeSelection,
+    ESettingListShowSubdirectoryInfoSelection,
+    ESettingListShowAssociatedIconsSelection,
+    ESettingListRememberLastPathSelection,
+    ESettingListRememberFolderSelection,
+    ESettingListEnableToolbar,
+
+    ESettingListSupportNetworkDrivesSelection,
+    ESettingListBypassPlatformSecuritySelection,
+    ESettingListRemoveFileLocksSelection,
+    ESettingListIgnoreProtectionsAttsSelection,
+    ESettingListRemoveROMWriteProtectionSelection
+    };
+
+enum TFileBrowserSettingDisplayModes
+    {
+    EDisplayModeFullScreen = 0,
+    EDisplayModeNormal
+    };
+
+enum TFileBrowserSettingFileViewModes
+    {
+    EFileViewModeSimple = 0,
+    EFileViewModeExtended
+    };
+
+enum TFileBrowserFileEditorModes
+    {
+    EFileEditorViewAsText = 0,
+    EFileEditorViewAsHex,
+    EFileEditorEditAsText,
+    EFileEditorEditAsHex
+    };
+
+enum
+    {
+    EFileViewerDialogControl = 0x5FEC
+    };
+
+enum
+    {
+    EFileEditorDialogId = 1
+    };
+
+enum TFileBrowserCmdFileChecksums
+    {
+    EFileChecksumsMD5 = 0,
+    EFileChecksumsMD2,
+    EFileChecksumsSHA1
+    };
+
+#endif      // FILEBROWSER_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBFileOps.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1160 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include "FBFileOps.h"
+#include "FBFileUtils.h"
+#include "engine.h"
+#include "FBTraces.h"
+
+#ifndef FILEBROWSER_LITE
+  #include "FBFileOpClient.h"
+#endif  
+
+#include <f32file.h>
+#include <bautils.h>
+#include <eikenv.h>
+#include <babackup.h>
+
+const TInt KSecureBackupStartDelay = 750000;
+const TInt KSecureBackupLoopDelay = 100000;
+const TInt KSecureBackupEndDelay = 200000;
+const TInt KMaxFileLockAttempts = 3;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+CFileBrowserFileOps* CFileBrowserFileOps::NewL(CEngine* aEngine)
+	{
+	CFileBrowserFileOps* self = new(ELeave) CFileBrowserFileOps(aEngine);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// --------------------------------------------------------------------------------------------
+
+CFileBrowserFileOps::CFileBrowserFileOps(CEngine* aEngine) : iEngine(aEngine)
+	{
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileOps::ConstructL()
+	{
+	iRecursiveState = EFileOpInvalid;
+	iSecureBackUpActive = EFalse;
+	iFileCommandActivatedSecureBackup = EFalse;
+	
+    User::LeaveIfError(iFs.Connect());
+    iFileMan = CFileMan::NewL( iFs, this );
+	}
+
+// --------------------------------------------------------------------------------------------
+
+CFileBrowserFileOps::~CFileBrowserFileOps()
+	{
+	if (iSBEClient)
+	    delete iSBEClient;
+	
+    #ifndef FILEBROWSER_LITE	
+        if (iFileOpClient)
+            delete iFileOpClient;
+    #endif	
+
+    delete iFileMan;
+    iFs.Close();    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::ActivateSecureBackUpViaFileOp()
+    {
+    iFileManObserverResult = MFileManObserver::EContinue;
+    // if already activate by a file command, return ok
+    if (iFileCommandActivatedSecureBackup)
+        return KErrNone;
+    else
+        {
+        // if secure backup is already active, disable it first, because it may in wrong state
+        if (iSecureBackUpActive)
+            DeActivateSecureBackUp();
+        }
+    
+    // try to activate full secure backup
+    TInt err = ActivateSecureBackUp(conn::EBURBackupFull, conn::EBackupBase);
+    
+    if (err == KErrNone)
+        iFileCommandActivatedSecureBackup = ETrue;
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DeActivateSecureBackUpViaFileOp()
+    {
+    TInt err(KErrGeneral);
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    // if activate by a file command, try to reactivate it
+    if (iFileCommandActivatedSecureBackup)
+        {
+        err = DeActivateSecureBackUp();
+        
+        // even if it fails, forget the state
+        iFileCommandActivatedSecureBackup = EFalse;
+        }
+
+    return err;
+    }    
+    
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::ActivateSecureBackUp(conn::TBURPartType aPartType, conn::TBackupIncType aBackupIncType)
+    {
+    iFileManObserverResult = MFileManObserver::EContinue;
+    // check for invalid parameters
+    if (aPartType == conn::EBURNormal || aBackupIncType == conn::ENoBackup)
+        User::Panic(_L("Inv.Usage.SE"), 532);
+    
+    TInt err(KErrNone);
+    
+    if (!iSBEClient)
+        {
+        TRAP(err, iSBEClient = conn::CSBEClient::NewL());
+        if (err != KErrNone)
+            return err;
+        }
+    
+    TDriveList driveList;
+    err = iFs.DriveList(driveList);
+    
+    if (err == KErrNone)
+        {
+        // make sure that the application has a system status to prevent getting shut down events
+        iEngine->EikonEnv()->SetSystem(ETrue);
+    
+        // activating secure back up removes locks from files which respect this fuctionality                
+        TRAP(err, iSBEClient->SetBURModeL(driveList, aPartType, aBackupIncType));
+        
+        if (err == KErrNone)
+            {
+            iSecureBackUpActive = ETrue;
+            User::After(KSecureBackupStartDelay); // a short delay to wait to activate
+            }
+        }
+
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DeActivateSecureBackUp()
+    {
+    TInt err(KErrNone);
+    
+    if (!iSBEClient)
+        {
+        TRAP(err, iSBEClient = conn::CSBEClient::NewL());
+        if (err != KErrNone)
+            return err;
+        
+        // make sure that the application has a system status
+        iEngine->EikonEnv()->SetSystem(ETrue);
+        }
+        
+    TDriveList driveList;
+    err = iFs.DriveList(driveList);
+    
+    if (err == KErrNone)
+        {
+        // deactivate secure backup
+        TRAP(err, iSBEClient->SetBURModeL(driveList, conn::EBURNormal, conn::ENoBackup));
+        
+        User::After(KSecureBackupEndDelay); // a short delay to wait to deactivate
+
+        // system status not needed anymore
+        iEngine->EikonEnv()->SetSystem(EFalse);
+        }
+    
+    iSecureBackUpActive = EFalse;
+
+    return err;
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFindEntries(const TDesC& aFileName, const TDesC& aPath)
+    {
+    TFindFile fileFinder(iFs);
+    CDir* dir;
+    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
+
+    while (err == KErrNone && iFileManObserverResult != MFileManObserver::ECancel)
+        {
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+
+            if (entry.iName.Length() && aPath.Length())
+                {
+                // parse the entry
+                TParse parsedName;
+                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
+                
+                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
+                    {
+                    // get full source path
+                    TFileName fullSourcePath = parsedName.FullName();
+                    if (entry.IsDir())
+                        fullSourcePath.Append(_L("\\"));
+                    
+                    // call the file operation command
+                    switch(iRecursiveState)
+                        {
+                        case EFileOpAttribs:
+                            {
+                            // the same attribs command can be given for both directories and files
+                            FileOpAttribs(fullSourcePath, iUint1, iUint2, iTime1, iUint3);
+                            }
+                            break;
+
+                        case EFileOpCopy:
+                            {
+                            // calculate length of new entries added to the original source path
+                            TUint newEntriesLength = fullSourcePath.Length() - iBuf1.Length();
+                            
+                            // get pointer description to the rightmost data
+                            TPtr16 newEntriesPtr = fullSourcePath.RightTPtr(newEntriesLength);
+                            
+                            // generate target path
+                            TFileName fullTargetPath = iBuf2;
+                            fullTargetPath.Append(newEntriesPtr);
+                            
+                            if (entry.IsDir())
+                                {
+                                // if it is a directory entry, just create it based on the entry's attributes
+                                FileOpMkDirAll(fullTargetPath, entry.iAtt);
+                                }
+                            else
+                                {
+                                // otherwise copy the file
+                                FileOpCopy(fullSourcePath, fullTargetPath, iUint1);
+                                }
+                            }
+                            break;
+
+                        case EFileOpDelete:
+                            {
+                            if (entry.IsDir())
+                                {
+                                // for directories call rmdir    
+                                FileOpRmDir(fullSourcePath, iUint1);
+                                }
+                            else
+                                {
+                                // for files call the normal file deletion operation    
+                                FileOpDeleteFile(fullSourcePath, iUint1);
+                                }
+                            }
+                            break;
+                                                    
+                        default:
+                            User::Panic (_L("FileOpRecurs"), 775);
+                            break;
+                        }                        
+                    }
+                }
+                if ( iFileManObserverResult == MFileManObserver::ECancel ) break;
+            }
+
+        delete dir;
+        dir = NULL;
+        if ( iFileManObserverResult != MFileManObserver::ECancel )
+            {
+            err = fileFinder.FindWild(dir);
+            }
+        }
+
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFindEntriesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
+	{
+    TInt err(KErrNone);
+
+    // it is logical to scan upwards when deleting and changing attributes
+    CDirScan::TScanDirection scanDirection = CDirScan::EScanUpTree;
+    
+    // when copying files, it is more logical to move downwards
+    if (iRecursiveState == EFileOpCopy)
+        scanDirection = CDirScan::EScanDownTree;
+    
+    
+    CDirScan* scan = CDirScan::NewLC(iFs);
+    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst, scanDirection);
+    CDir* dir = NULL;
+
+    for(;;)
+        {
+        TRAP(err, scan->NextL(dir));
+        if (!dir  || (err != KErrNone))
+            break;
+
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+            
+            if (entry.IsDir())
+                {
+                TFileName path(scan->FullPath());
+                
+                if (path.Length())
+                    {
+                    path.Append(entry.iName);
+                    path.Append(_L("\\"));
+                    DoFindEntries(aFileName, path);
+                    }
+                }
+            if ( iFileManObserverResult == MFileManObserver::ECancel )
+                {
+                break;
+                }
+            }
+        delete(dir);
+        if ( iFileManObserverResult == MFileManObserver::ECancel )
+            {
+            break;
+            }
+        }
+
+    CleanupStack::PopAndDestroy(scan);
+    return err;
+    }
+    
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::Copy(const TFileEntry& aSourceEntry, const TDesC& aTargetFullName, TUint aSwitch, TBool aDeleteSource) 
+    {
+    iOperationError = KErrNone;
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    TFileName sourcePath = aSourceEntry.iPath;
+    sourcePath.Append(aSourceEntry.iEntry.iName);
+    
+    TInt err(KErrNone);
+
+    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
+        {
+        // find all files recursively and run the operation for them
+        iRecursiveState = EFileOpCopy;
+        sourcePath.Append(_L("\\"));
+        
+        TFileName targetPath = aTargetFullName;
+        targetPath.Append(_L("\\"));
+        
+        // remove the recursion flag because we will implement our own recursion
+        TUint newSwitch(aSwitch);
+        newSwitch &= ~CFileMan::ERecurse;
+    
+        iBuf1.Copy(sourcePath);
+        iBuf2.Copy(targetPath);
+        iUint1 = newSwitch;
+        
+        // create initial directory - if it does not succeed, do not even try to continue
+        err = FileOpMkDirAll(targetPath, aSourceEntry.iEntry.iAtt);
+        
+        if (iOperationError == KErrNone)
+            {
+            TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
+            if ( iFileManObserverResult != MFileManObserver::ECancel )
+                {
+                TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
+                }
+            }
+        }
+
+    else if (aSourceEntry.iEntry.IsDir())
+        {
+        TFileName targetPath = aTargetFullName;
+        targetPath.Append(_L("\\"));
+        
+        // just create a directory based on the file attributes of the source directory
+        err = FileOpMkDirAll(targetPath, aSourceEntry.iEntry.iAtt);
+        }
+        
+    else
+        {
+        // remove a recursion flag if present (this should never happen, but some extra error checking)
+        if (aSwitch & CFileMan::ERecurse)
+            aSwitch &= ~CFileMan::ERecurse;    
+            
+        // do the operation for a file entry
+        err = FileOpCopy(sourcePath, aTargetFullName, aSwitch);
+        }
+    
+        
+    // delete source if needed and copy succeeded without any errors (== move operation)
+    if ( aDeleteSource && iOperationError == KErrNone &&
+         iFileManObserverResult != MFileManObserver::ECancel )
+        {
+        err = Delete(aSourceEntry, aSwitch);    
+        }
+    
+    if ( !iOperationError && iFileManObserverResult == MFileManObserver::ECancel )
+        {
+        iOperationError = KErrCancel;
+        }
+        
+    return iOperationError; 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch) 
+    {
+    TInt err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
+
+    // if locked, unlock the file and retry
+    if (iEngine->Settings().iRemoveFileLocks && err == KErrInUse)
+        {
+        // try to remove the file lock by activating secure backup mode
+        if (ActivateSecureBackUpViaFileOp() == KErrNone)
+            {
+            // try the operation several times
+            for (TInt i=0; i<KMaxFileLockAttempts; i++)
+                {
+                err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
+                
+                if (err != KErrInUse)
+                    break;
+                else
+                    User::After(KSecureBackupLoopDelay);
+                }
+            }
+        }
+
+    // if access denied, then try to remove the target path and try again
+    if (iEngine->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied && BaflUtils::FileExists(iFs, aTargetFullName))
+        {
+        if (FileOpDeleteFile(aTargetFullName, 0) == KErrNone)
+            {
+            err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
+            }
+        }
+
+    // if the file already exists, it is not an error    
+    if (err == KErrAlreadyExists)
+        err = KErrNone;
+    
+    
+    // if copying from a ROM drive, remove the writing protection flag
+    if (iEngine->Settings().iRemoveROMWriteProrection && err == KErrNone && aSourceFullName.Length() > 3 && (aSourceFullName[0]=='z' || aSourceFullName[0]=='Z'))
+        {
+        FileOpAttribs(aTargetFullName, 0, KEntryAttReadOnly, 0, 0);
+        }
+    
+    
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+
+    LOGSTRING4("FileBrowser: FileOpCopy %S -> %S, err=%d", &aSourceFullName, &aTargetFullName, err);
+        
+    return err; 
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch) 
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+            
+        return iFileOpClient->Copy(aSourceFullName, aTargetFullName, aSwitch);
+        }
+    else
+        {
+    #endif
+        //CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+        //TInt result = iFileMan->Copy( aSourceFullName, aTargetFullName, aSwitch, waiter->iStatus );
+        //waiter->StartAndWait();
+        //if ( !result ) result = waiter->Result();
+        //CleanupStack::PopAndDestroy( waiter );
+        TInt result = iFileMan->Copy( aSourceFullName, aTargetFullName, aSwitch );
+        return result;
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::Rename(const TFileEntry& aSourceEntry, const TDesC& aNew, TUint aSwitch)
+    {
+    iOperationError = KErrNone;
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    TFileName sourcePath = aSourceEntry.iPath;
+    sourcePath.Append(aSourceEntry.iEntry.iName);
+    
+    if (aSourceEntry.iEntry.IsDir())
+        {
+        // do the operation for a directory entry
+        FileOpRename(sourcePath, aNew, aSwitch);
+        }
+    else
+        {
+        // do the operation for a file
+        FileOpRename(sourcePath, aNew, aSwitch);
+        }
+
+    return iOperationError; 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch)
+    {
+    TBool setBackROFlag(EFalse);
+
+    TInt err = DoFileOpRename(aName, aNew, aSwitch);
+
+    // if locked, unlock the file and retry
+    if (iEngine->Settings().iRemoveFileLocks && err == KErrInUse)
+        {
+        // try to remove the file lock by activating secure backup mode
+        if (ActivateSecureBackUpViaFileOp() == KErrNone)
+            {
+            // try the operation several times
+            for (TInt i=0; i<KMaxFileLockAttempts; i++)
+                {
+                err = DoFileOpRename(aName, aNew, aSwitch);
+                
+                if (err != KErrInUse)
+                    break;
+                else
+                    User::After(KSecureBackupLoopDelay);
+                }
+            }
+        }
+
+    // if write protected, remove protection and retry
+    else if (iEngine->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied)
+        {
+        // remove write protection and try again
+        if (FileOpAttribs(aName, 0, KEntryAttReadOnly, 0, 0) == KErrNone)
+            {
+            err = DoFileOpRename(aName, aNew, aSwitch);
+            
+            setBackROFlag = ETrue;
+            }
+        }
+
+    // if still access denied, then try to remove the target path and try again
+    if (iEngine->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied && BaflUtils::FileExists(iFs, aNew))
+        {
+        if (FileOpDeleteFile(aNew, 0) == KErrNone)
+            {
+            err = DoFileOpRename(aName, aNew, aSwitch);
+            }
+        }
+
+    // set back the read only flag
+    if (setBackROFlag)
+        FileOpAttribs(aName, KEntryAttReadOnly, 0, 0, 0);
+            
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+
+    LOGSTRING3("FileBrowser: FileOpRename %S, err=%d", &aName, err);
+        
+    return err; 
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch)
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->Rename(aName, aNew, aSwitch);
+        }
+    else
+        {
+    #endif
+        return iFileMan->Rename(aName, aNew, aSwitch);
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::Attribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
+    {
+    iOperationError = KErrNone;
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    TFileName sourcePath = aSourceEntry.iPath;
+    sourcePath.Append(aSourceEntry.iEntry.iName);
+    
+    TInt err(KErrNone);
+
+    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
+        {
+        // do the operation for a current directory entry
+        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
+
+        // find all files recursively and run the operation for them
+        iRecursiveState = EFileOpAttribs;
+        sourcePath.Append(_L("\\"));
+    
+        iBuf1.Copy(sourcePath);
+        iUint1 = aSetMask;
+        iUint2 = aClearMask;
+        iTime1 = aTime;
+        iUint3 = 0;
+        
+        TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
+        TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
+        }
+
+    else if (aSourceEntry.iEntry.IsDir())
+        {
+        //sourcePath.Append(_L("\\"));   // <-- do not apply!
+    
+        // do the operation for a directory entry
+        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
+        }
+            
+    else
+        {
+        // do the operation for a file entry
+        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
+        }
+
+    return iOperationError;     
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+TInt CFileBrowserFileOps::FileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
+    {
+    TInt err = DoFileOpAttribs(aName, aSetMask, aClearMask, aTime, aSwitch);
+
+    // if locked, unlock the file and retry
+    if (iEngine->Settings().iRemoveFileLocks && err == KErrInUse)
+        {
+        // try to remove the file lock by activating secure backup mode
+        if (ActivateSecureBackUpViaFileOp() == KErrNone)
+            {
+            // try the operation several times
+            for (TInt i=0; i<KMaxFileLockAttempts; i++)
+                {
+                err = DoFileOpAttribs(aName, aSetMask, aClearMask, aTime, aSwitch);
+                
+                if (err != KErrInUse)
+                    break;
+                else
+                    User::After(KSecureBackupLoopDelay);
+                }
+            }
+        }
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+
+    LOGSTRING3("FileBrowser: FileOpAttribs %S, err=%d", &aName, err);
+        
+    return err;    
+    }
+    
+// --------------------------------------------------------------------------------------------
+    
+TInt CFileBrowserFileOps::DoFileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->Attribs(aName, aSetMask, aClearMask, aTime, aSwitch);
+        }
+    else
+        {
+    #endif
+        return iFileMan->Attribs(aName, aSetMask, aClearMask, aTime, aSwitch);
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::Delete(const TFileEntry& aSourceEntry, TUint aSwitch) 
+    {
+    iOperationError = KErrNone;
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    TFileName sourcePath = aSourceEntry.iPath;
+    sourcePath.Append(aSourceEntry.iEntry.iName);
+    
+    TInt err(KErrNone);
+
+    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
+        {
+        // find all files recursively and run the operation for them
+        iRecursiveState = EFileOpDelete;
+        sourcePath.Append(_L("\\"));
+    
+        iBuf1.Copy(sourcePath);
+        iUint1 = 0;
+        
+        TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
+        if ( iFileManObserverResult != MFileManObserver::ECancel )
+            {
+            TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
+            }
+        
+        if ( iFileManObserverResult != MFileManObserver::ECancel )
+            {
+            // do the operation for a current directory entry as well
+            err = FileOpRmDir(sourcePath, 0);
+            }
+        }
+
+    else if (aSourceEntry.iEntry.IsDir())
+        {
+        sourcePath.Append(_L("\\"));
+    
+        // do the operation for a directory entry
+        err = FileOpRmDir(sourcePath, 0);
+        }
+
+    else
+        {
+        // do the operation for a file entry
+        err = FileOpDeleteFile(sourcePath, 0);
+        }
+    if ( !iOperationError && iFileManObserverResult == MFileManObserver::ECancel )
+        {
+        iOperationError = KErrCancel;
+        }
+    return iOperationError; 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpDeleteFile(const TDesC& aName, TUint aSwitch) 
+    {
+    TInt err = DoFileOpDeleteFile(aName, aSwitch);
+
+    // if locked, unlock the file and retry
+    if (iEngine->Settings().iRemoveFileLocks && err == KErrInUse)
+        {
+        // try to remove the file lock by activating secure backup mode
+        if (ActivateSecureBackUpViaFileOp() == KErrNone)
+            {
+            // try the operation several times
+            for (TInt i=0; i<KMaxFileLockAttempts; i++)
+                {
+                err = DoFileOpDeleteFile(aName, aSwitch);
+                
+                if (err != KErrInUse)
+                    break;
+                else
+                    User::After(KSecureBackupLoopDelay);
+                }
+            }
+        }
+
+    // if write protected or system file, remove protections and retry
+    else if (iEngine->Settings().iIgnoreProtectionsAtts && (err == KErrAccessDenied || err == KErrNotFound))
+        {
+        // remove protections  and try again
+        if (FileOpAttribs(aName, 0, KEntryAttReadOnly|KEntryAttSystem|KEntryAttHidden, 0, 0) == KErrNone)
+            {
+            err = DoFileOpDeleteFile(aName, aSwitch);
+            }
+        }
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+
+    LOGSTRING3("FileBrowser: FileOpDeleteFile %S, err=%d", &aName, err);
+        
+    return err; 
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFileOpDeleteFile(const TDesC& aName, TUint aSwitch) 
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->Delete(aName, aSwitch);
+        }
+    else
+        {
+    #endif
+//        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+//        TInt result = iFileMan->Delete( aName, aSwitch, waiter->iStatus );
+//        waiter->StartAndWait();
+//        if ( iFileManObserverResult == MFileManObserver::ECancel ) result = KErrCancel;
+//        if ( !result ) result = waiter->Result();
+//        CleanupStack::PopAndDestroy( waiter );
+		TInt result = iFileMan->Delete( aName, aSwitch );
+        return result;
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpRmDir(const TDesC& aName, TUint aSwitch) 
+    {
+    TInt err = DoFileOpRmDir(aName, aSwitch);
+
+    // if write protected or system directory, remove protections and retry
+    if (iEngine->Settings().iIgnoreProtectionsAtts && (err == KErrAccessDenied || err == KErrInUse))
+        {
+        // remove protections and try again
+        if (FileOpAttribs(aName.Left(aName.Length()-1), 0, KEntryAttReadOnly|KEntryAttSystem|KEntryAttHidden, 0, 0) == KErrNone)
+            {
+            err = DoFileOpRmDir(aName, aSwitch);
+            }
+        }
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+
+    LOGSTRING3("FileBrowser: FileOpRmDir %S, err=%d", &aName, err);
+        
+    return err; 
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFileOpRmDir(const TDesC& aDirName, TUint aSwitch)
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->RmDir(aDirName, aSwitch);
+        }
+    else
+        {
+    #endif
+        if ( aSwitch & CFileMan::ERecurse )
+            {
+//            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+//            TInt result = iFileMan->RmDir( aDirName, waiter->iStatus );
+//            waiter->StartAndWait();
+//            if ( iFileManObserverResult == MFileManObserver::ECancel ) result = KErrCancel;
+//            if ( !result ) result = waiter->Result();
+//            CleanupStack::PopAndDestroy( waiter);
+            TInt result = iFileMan->RmDir( aDirName );
+            return result;
+            }
+        else
+            return iFs.RmDir(aDirName);    
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+   }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::MkDirAll(const TDesC& aPath, TInt aSetAtts, TBool aQuickOperation) 
+    {
+    iFileManObserverResult = MFileManObserver::EContinue;
+    if (aQuickOperation)
+        return DoFileOpMkDirAll(aPath);
+    else
+        return FileOpMkDirAll(aPath, aSetAtts);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpMkDirAll(const TDesC& aPath, TInt aSetAtts) 
+    {
+    TInt err = DoFileOpMkDirAll(aPath);
+
+    // if the directory already exists, it is not an error    
+    if (err == KErrAlreadyExists)
+        err = KErrNone;
+    
+    
+    // set attributes for directory just created
+    if (aSetAtts > 0 && err == KErrNone && aPath.Length() > 3)
+        {
+        // a path has a trailing backslash so it needs to be removed before the call
+        err = FileOpAttribs(aPath.Left(aPath.Length()-1), aSetAtts, 0, 0, 0);
+        }
+    
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+    
+    LOGSTRING3("FileBrowser: FileOpMkDirAll %S, err=%d", &aPath, err);
+    
+    return err;
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DoFileOpMkDirAll(const TDesC& aPath) 
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->MkDirAll(aPath);
+        }
+    else
+        {
+    #endif
+        return iFs.MkDirAll(aPath);
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::CreateEmptyFile(const TDesC& aName) 
+    {
+    return DoFileOpCreateEmptyFile(aName);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::FileOpCreateEmptyFile(const TDesC& aName) 
+    {
+    TInt err = DoFileOpCreateEmptyFile(aName);
+
+    // remember the "lowest" error
+    if (err < iOperationError)
+        iOperationError = err;
+    
+    LOGSTRING3("FileBrowser: FileOpCreateEmptyFile %S, err=%d", &aName, err);
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+TInt CFileBrowserFileOps::DoFileOpCreateEmptyFile(const TDesC& aName) 
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();   
+
+        return iFileOpClient->CreateEmptyFile(aName);
+        }
+    else
+        {
+    #endif
+        TInt err(KErrNone);
+            
+        RFile newFile;
+        err = newFile.Create(iFs, aName, EFileShareExclusive);
+        if (err == KErrNone)
+            err = newFile.Flush(); 
+        newFile.Close();
+        
+        return err; 
+    #ifndef FILEBROWSER_LITE
+        }    
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::DriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter)
+    {
+    TInt err(KErrNone);
+    iFileManObserverResult = MFileManObserver::EContinue;
+    
+    // remember old settings and force them to be true for this operation
+    TBool currentRemoveFileLocksValue = iEngine->Settings().iRemoveFileLocks;
+    TBool currentIgnoreProtectionAttsValue = iEngine->Settings().iIgnoreProtectionsAtts;
+    TBool currentRemoveROMWriteProrection = iEngine->Settings().iRemoveROMWriteProrection;
+    iEngine->Settings().iRemoveFileLocks = ETrue;
+    iEngine->Settings().iIgnoreProtectionsAtts = ETrue;
+    iEngine->Settings().iRemoveROMWriteProrection = ETrue;
+
+    
+    TFileName sourceDir;
+    sourceDir.Append(aSourceDriveLetter);
+    sourceDir.Append(_L(":"));
+
+    _LIT(KTargetDir, "%c:\\SnapShot_%c_drive");
+    TFileName targetDir;
+    targetDir.Format(KTargetDir, TUint(aTargetDriveLetter), TUint(aSourceDriveLetter));            
+
+    // remove any existing content, first get TEntry
+    TEntry entry;
+    err = iFs.Entry(targetDir, entry);
+
+    // entry directory exists, delete it
+    if (err == KErrNone && entry.IsDir())
+        {
+        TFileName targetRoot;
+        targetRoot.Append(aTargetDriveLetter);
+        targetRoot.Append(_L(":\\"));
+
+        TFileEntry targetEntry;
+        targetEntry.iPath = targetRoot;
+        targetEntry.iEntry = entry;
+
+        err = Delete(targetEntry, CFileMan::ERecurse);                
+        }
+        
+    // do not care if removing succeeded or not, just continue with copying    
+    TEntry fakeEntry;
+    fakeEntry.iAtt |= KEntryAttDir;
+
+    TFileEntry sourceEntry;
+    sourceEntry.iPath = sourceDir;
+    sourceEntry.iEntry = fakeEntry;
+
+    err = Copy(sourceEntry, targetDir, CFileMan::ERecurse|CFileMan::EOverWrite);                
+
+
+    // restore back settings
+    iEngine->Settings().iRemoveFileLocks = currentRemoveFileLocksValue;
+    iEngine->Settings().iIgnoreProtectionsAtts = currentIgnoreProtectionAttsValue;    
+    iEngine->Settings().iRemoveROMWriteProrection = currentRemoveROMWriteProrection;    
+
+
+    return iOperationError;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::EraseMBR(TUint aDriveNumber) 
+    {
+    #ifndef FILEBROWSER_LITE
+
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();
+        
+        return iFileOpClient->EraseMBR(aDriveNumber);
+
+    #else
+        return KErrNotSupported;
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileOps::PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions) 
+    {
+    #ifndef FILEBROWSER_LITE
+
+        if (!iFileOpClient)
+            iFileOpClient = CFBFileOpClient::NewL();
+        
+        return iFileOpClient->PartitionDrive(aDriveNumber, aNumberOfPartitions);
+
+    #else
+        return KErrNotSupported
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+
+MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManStarted()
+    {
+    return iFileManObserverResult;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManOperation()
+    {
+    return iFileManObserverResult;
+    }
+// --------------------------------------------------------------------------------------------
+
+MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManEnded()
+    {
+    return iFileManObserverResult;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileOps::CancelOp()
+    {
+#ifndef FILEBROWSER_LITE
+
+    if ( iEngine->Settings().iBypassPlatformSecurity )
+        {
+        if ( !iFileOpClient )
+            iFileOpClient = CFBFileOpClient::NewL();
+        
+        iFileOpClient->CancelOp();
+        }
+
+    // we need this information even when using iFileOpClient
+    // to be able to not execute aggregate operations 
+    iFileManObserverResult = MFileManObserver::ECancel;
+    
+#else
+    iFileManObserverResult = MFileManObserver::ECancel;
+#endif
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBFileOps.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSER_FILEOPS_H
+#define FILEBROWSER_FILEOPS_H
+
+// INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include <connect/sbeclient.h>
+
+// FORWARD DECLARATIONS
+class TFileEntry;
+class CFBFileOpClient;
+class CFileMan;
+class CEngine;
+class CSBEClient;
+
+
+class CFileBrowserFileOps : public CBase,
+                            public MFileManObserver 
+	{
+private:
+    enum TRecursiveOperation
+    	{
+    	EFileOpInvalid = -1,
+    	EFileOpCopy,
+    	EFileOpMove,
+    	EFileOpRename,
+    	EFileOpAttribs,
+    	EFileOpDelete,
+    	EFileOpMkDirAll,
+    	EFileOpCreateEmptyFile,
+    	EFileOpEraseMBR,
+    	EFileOpPartitionDrive
+    	};
+public:
+	static CFileBrowserFileOps* NewL(CEngine* aEngine);
+	~CFileBrowserFileOps();
+
+public: // From MFileManObserver
+    
+    TControl NotifyFileManStarted();
+    TControl NotifyFileManOperation();
+    TControl NotifyFileManEnded();
+    
+private:
+	CFileBrowserFileOps(CEngine* aEngine);
+	void ConstructL();
+
+public:
+    TInt ActivateSecureBackUpViaFileOp();
+    TInt DeActivateSecureBackUpViaFileOp();
+    TInt ActivateSecureBackUp(conn::TBURPartType aPartType=conn::EBURBackupFull, conn::TBackupIncType aBackupIncType=conn::EBackupBase);
+    TInt DeActivateSecureBackUp();
+    TInt Copy(const TFileEntry& aSourceEntry, const TDesC& aTargetFullName, TUint aSwitch=CFileMan::EOverWrite, TBool aDeleteSource=EFalse); 
+    TInt Rename(const TFileEntry& aSourceEntry, const TDesC& aNew, TUint aSwitch=CFileMan::EOverWrite); 
+    TInt Attribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch=0); 
+    TInt Delete(const TFileEntry& aSourceEntry, TUint aSwitch=0); 
+    TInt MkDirAll(const TDesC& aPath, TInt aSetAtts=0, TBool aQuickOperation=EFalse); 
+    TInt CreateEmptyFile(const TDesC& aName); 
+    TInt DriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter); 
+    TInt EraseMBR(TUint aDriveNumber); 
+    TInt PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions);
+    void CancelOp();
+
+private:
+    TInt DoFindEntries(const TDesC& aFileName, const TDesC& aPath);
+    TInt DoFindEntriesRecursiveL(const TDesC& aFileName, const TDesC& aPath);    
+
+    TInt FileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); 
+    TInt DoFileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); 
+
+    TInt FileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch); 
+    TInt DoFileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch); 
+
+    TInt FileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
+    TInt DoFileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
+
+    TInt FileOpDeleteFile(const TDesC& aName, TUint aSwitch); 
+    TInt DoFileOpDeleteFile(const TDesC& aName, TUint aSwitch); 
+
+    TInt FileOpRmDir(const TDesC& aDirName, TUint aSwitch); 
+    TInt DoFileOpRmDir(const TDesC& aDirName, TUint aSwitch); 
+
+    TInt FileOpMkDirAll(const TDesC& aPath, TInt aSetAtts=0); 
+    TInt DoFileOpMkDirAll(const TDesC& aPath); 
+
+    TInt FileOpCreateEmptyFile(const TDesC& aName); 
+    TInt DoFileOpCreateEmptyFile(const TDesC& aName); 
+
+public:
+    inline TBool SecureBackUpActive() { return iSecureBackUpActive; }
+    inline TBool FileCommandActivatedSecureBackup() { return iFileCommandActivatedSecureBackup; }
+
+private:
+    TInt                            iRecursiveState;
+    CEngine*                        iEngine;
+    CFBFileOpClient*                iFileOpClient;
+    CFileMan*                       iFileMan;
+    RFs                             iFs;
+    TInt                            iOperationError;
+    conn::CSBEClient*               iSBEClient;
+    TBool                           iSecureBackUpActive;
+    TBool                           iFileCommandActivatedSecureBackup;
+
+    TFileName   iBuf1;
+    TFileName   iBuf2;
+    TUint       iUint1;
+    TUint       iUint2;
+    TUint       iUint3;
+    TTime       iTime1;
+    MFileManObserver::TControl iFileManObserverResult;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBFileUtils.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,4723 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include "FBFileUtils.h"
+#include "FBFileOps.h"
+#include "engine.h"
+#include "FB.hrh"
+#include <filebrowser.rsg>
+
+#include <textresolver.h> 
+#include <eikprogi.h>
+#include <f32file.h>
+#include <eikfutil.h>
+#include <apparc.h>
+#include <eikenv.h>
+#include <bautils.h>
+#include <gulicon.h>
+#include <aknconsts.h>
+#include <babackup.h> 
+#include <aknmemorycardui.mbg>
+#include <sendui.h>
+#include <CMessageData.h>
+#include <ezgzip.h>
+#include <e32hal.h>
+#include <pathinfo.h>
+#include <apgcli.h>
+#include <apmstd.h>
+#include <apgtask.h>
+#include <apacmdln.h>
+#include <DocumentHandler.h>
+#include <msvapi.h>
+#include <msvids.h>
+#include <msvstd.h>
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <cmsvattachment.h>
+#include <hash.h>
+//#include <sbeclient.h>
+#include <e32property.h>
+#if (!defined __SERIES60_30__ && !defined __SERIES60_31__) 
+#include <driveinfo.h>
+#endif // !defined __SERIES60_30__ && !defined __SERIES60_31__
+
+#ifndef __SERIES60_30__
+//  #include <akniconconfig.h>
+#endif
+
+//_LIT(KGZipExt, ".gz");
+_LIT8(KFileNewLine, "\r\n");
+const TInt KForcedFormatTimeout = 1000000;
+
+// copied from coreapplicationuisdomainpskeys.h
+const TUid KPSUidCoreApplicationUIs = { 0x101F8767 };
+const TUint32 KCoreAppUIsMmcRemovedWithoutEject = 0x00000109;
+enum TCoreAppUIsMmcRemovedWithoutEject
+    {
+    ECoreAppUIsEjectCommandUsedUninitialized = 0,
+    ECoreAppUIsEjectCommandNotUsed,
+    ECoreAppUIsEjectCommandUsed,
+    ECoreAppUIsEjectCommandUsedToDrive // Low 16-bits contain this value and high 16-bits TDriveNumber to eject
+    };
+const TInt KDriveLetterStringLength = 3; // e.g. C:\
+
+// ================= MEMBER FUNCTIONS =======================
+
+CFileBrowserFileUtils* CFileBrowserFileUtils::NewL(CEngine* aEngine)
+	{
+	CFileBrowserFileUtils* self = new(ELeave) CFileBrowserFileUtils(aEngine);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// --------------------------------------------------------------------------------------------
+
+CFileBrowserFileUtils::CFileBrowserFileUtils(CEngine* aEngine) : CActive(EPriorityStandard), iEngine(aEngine)
+	{
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ConstructL()
+	{
+    User::LeaveIfError(iTimer.CreateLocal());
+    User::LeaveIfError(iFs.Connect());
+    User::LeaveIfError(iTz.Connect());
+    
+    iState = EIdle;
+    iListingMode = ENormalEntries;
+
+    iSortMode = EFileBrowserCmdViewSortByName;
+    iOrderMode = EFileBrowserCmdViewOrderAscending;
+    iCurrentPath = KNullDesC;
+    
+    iFileOps = CFileBrowserFileOps::NewL(iEngine);
+    
+    iDriveEntryList = new(ELeave) CDriveEntryList(8);
+    iFileEntryList = new(ELeave) CFileEntryList(64);
+    iFindFileEntryList = new(ELeave) CFileEntryList(64);
+    iAppIconList = new(ELeave) CAppIconList(16);
+    iClipBoardList = new(ELeave) CFileEntryList(64);
+    iCurrentSelectionList = new(ELeave) CFileEntryList(64);
+
+    iDocHandler = CDocumentHandler::NewL();
+    iDocHandler->SetExitObserver(this);
+    
+    // set defaults to the search settings
+    iSearchAttributes.iSearchDir = KNullDesC;
+    iSearchAttributes.iWildCards = _L("*.jpg");
+    iSearchAttributes.iTextInFile = KNullDesC;
+    iSearchAttributes.iMinSize = 0;
+    iSearchAttributes.iMaxSize = 999999999;
+    iSearchAttributes.iMinDate = TDateTime(1980, EJanuary,   0,0,0,0,0);
+    iSearchAttributes.iMaxDate = TDateTime(2060, EDecember, 30,0,0,0,0);
+    iSearchAttributes.iRecurse = ETrue;
+    
+    // init the command array
+    iCommandArray = new(ELeave) CCommandArray(64);
+        
+    // get current path from settings
+    if (iEngine->Settings().iRememberLastPath)
+        {
+        TFileName settingPath = iEngine->Settings().iLastPath;
+        if (BaflUtils::PathExists(iFs, settingPath))
+            iCurrentPath = settingPath;
+        
+        if (iCurrentPath != KNullDesC)
+            GetDriveListL();
+        }
+
+    CActiveScheduler::Add(this);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CFileBrowserFileUtils::~CFileBrowserFileUtils()
+	{
+	Cancel();
+	
+	// save current path from settings
+    if (iEngine->Settings().iRememberLastPath)
+        {
+        iEngine->Settings().iLastPath = iCurrentPath;
+        TRAP_IGNORE(iEngine->SaveSettingsL(EFalse));
+        }
+
+//    if (iWaitDialog)
+//        TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); 
+//     
+//    if (iProgressDialog)
+//        TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
+    
+        delete iFileOps;
+
+        delete iDocHandler;
+	
+//	if (iOpenFileService)
+//	    delete iOpenFileService;
+	
+        delete iCurrentSelectionList;
+        delete iClipBoardList;
+        delete iAppIconList;
+        delete iFindFileEntryList;
+        delete iFileEntryList;
+        delete iDriveEntryList;
+
+        delete iFileMan;
+
+        if (iCommandArray)
+            {
+            ResetCommandArray();
+            delete iCommandArray;
+            }
+
+        iTz.Close();
+        iFs.Close();
+        iTimer.Close();
+        }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DoCancel()
+	{
+    iTimer.Cancel();
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::StartExecutingCommandsL(const TDesC& /*aLabel*/)
+    {
+    if (iCommandArray->Count() >= 2)
+        {
+        // init progress bar
+//        iProgressDialog = new(ELeave) CAknProgressDialog((reinterpret_cast<CEikDialog**>(&iProgressDialog)), ETrue);
+//        iProgressDialog->SetCallback(this);
+//        iProgressDialog->PrepareLC(R_GENERAL_PROGRESS_NOTE);
+//        iProgressDialog->SetCurrentLabelL( EAknCtNote, aLabel );
+//        iProgressInfo = iProgressDialog->GetProgressInfoL();
+//        iProgressInfo->SetFinalValue( CommandArrayCount() );
+//        iProgressDialog->RunLD();
+//        iProgressDialog->MakeVisible( ETrue );        
+        }
+    else if (iCommandArray->Count() >= 1)
+        {
+        // init wait dialog
+//        iWaitDialog = new(ELeave) CAknWaitDialog((reinterpret_cast<CEikDialog**>(&iWaitDialog)), ETrue);
+//        iWaitDialog->SetCallback(this);
+//        iWaitDialog->PrepareLC(R_GENERAL_WAIT_NOTE);
+//        iWaitDialog->SetTextL( aLabel );
+//        iWaitDialog->RunLD();
+        }
+    else
+        {
+        // no commands, just do nothing
+        return;
+        }
+
+
+    // start with the first operation
+    iCurrentEntry = 0;
+    iSucceededOperations = 0;
+    iFailedOperations = 0;
+
+    // starts executing commands
+    ExecuteCommand();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ExecuteCommand()
+    {
+    // make sure the engine isn't active, should never happen
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("FileUtils:IsActive"), 333));
+
+    // execute a command after a very short delay (25ms)
+    iTimer.After(iStatus, 25);
+    SetActive();
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+void CFileBrowserFileUtils::RunL()
+    {
+    TInt err(KErrNone);
+    TInt currentCommand = iCommandArray->At(iCurrentEntry).iCommandId;
+
+    // execute a command from the queue
+    switch(currentCommand)
+        {
+        case EFileBrowserFileOpCommandAttribs:
+            {
+            CCommandParamsAttribs* params = static_cast<CCommandParamsAttribs*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->Attribs(params->iSourceEntry, params->iSetMask, params->iClearMask, params->iTime, params->iSwitch);
+            }
+            break;
+            
+        case EFileBrowserFileOpCommandCopy:
+            {
+            CCommandParamsCopyOrMove* params = static_cast<CCommandParamsCopyOrMove*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->Copy(params->iSourceEntry, params->iTargetPath, params->iSwitch);
+            }
+            break;
+            
+        case EFileBrowserFileOpCommandMove:
+            {
+            CCommandParamsCopyOrMove* params = static_cast<CCommandParamsCopyOrMove*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->Copy(params->iSourceEntry, params->iTargetPath, params->iSwitch, ETrue);
+            }
+            break;
+                
+        case EFileBrowserFileOpCommandRename:
+            {
+            CCommandParamsRename* params = static_cast<CCommandParamsRename*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->Rename(params->iSourceEntry, params->iTargetPath, params->iSwitch);
+            }
+            break;
+
+        case EFileBrowserFileOpCommandDelete:
+            {
+            CCommandParamsDelete* params = static_cast<CCommandParamsDelete*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->Delete(params->iSourceEntry, params->iSwitch);
+            }
+            break;
+
+        case EFileBrowserFileOpCommandDriveSnapShot:
+            {
+            CCommandParamsDriveSnapShot* params = static_cast<CCommandParamsDriveSnapShot*>(iCommandArray->At(iCurrentEntry).iParameters);
+            err = iFileOps->DriveSnapShot(params->iSourceDriveLetter, params->iTargetDriveLetter);
+            }
+            break;
+                                                
+        default:
+            User::Panic (_L("Unknown command"), 400);
+            break;
+        }
+
+    
+    if (err == KErrNone)
+        {
+        iSucceededOperations++;
+        }
+    else if ( err != KErrCancel )
+        {
+        iFailedOperations++;
+        }
+        
+    iLastError = err;            
+
+    // check for more commands in queue
+    TRAP_IGNORE( CheckForMoreCommandsL() );
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::RunError(TInt aError)
+    {
+    _LIT(KMessage, "Command error %d");
+    TBuf<128> noteMsg;
+    noteMsg.Format(KMessage, aError);
+            
+    iEngine->EikonEnv()->InfoMsg(noteMsg);
+    
+    TRAP_IGNORE( CheckForMoreCommandsL() );
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::CheckForMoreCommandsL()
+    {
+    //LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL");
+    
+    // update the progress bar
+    if (iProgressInfo)
+        iProgressInfo->IncrementAndDraw(1);
+
+	// check if we have more commands to be executed
+	if (iCurrentEntry >= CommandArrayCount() - 1)
+		{
+        //LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL all done");
+
+        // all done, free resources
+        ResetCommandArray();
+        
+        // deactive secure backup if it was activated by a file command
+        iFileOps->DeActivateSecureBackUpViaFileOp();
+
+        // dismiss any wait/progress dialogs        
+//        if (iWaitDialog)
+//            {
+//            TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); 
+//            iWaitDialog = NULL;
+//            }
+//        if (iProgressDialog)
+//            {
+//            TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
+//            iProgressDialog = NULL;
+//            }
+
+
+        // show result note
+        if ( iSucceededOperations == 0 && iFailedOperations == 0 )
+            {
+            // single operation cancelled -> show nothing
+            }
+        else if (iSucceededOperations == 1 && iFailedOperations == 0)    
+            {
+//            _LIT(KMessage, "Operation succeeded");
+//            iEngine->FileBrowserUI()->ShowConfirmationNote(KMessage);
+            }
+        else if (iSucceededOperations > 0 && iFailedOperations == 0)    
+            {
+//            _LIT(KMessage, "%d operations succeeded");
+//            TBuf<128> noteMsg;
+//            noteMsg.Format(KMessage, iSucceededOperations);
+//            iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg);
+            }
+        else if (iSucceededOperations == 0 && iFailedOperations > 1)    
+            {
+            _LIT(KMessage, "%d operations failed");
+            TBuf<128> noteMsg;
+            noteMsg.Format(KMessage, iFailedOperations);
+
+            iEngine->FileBrowserUI()->ShowErrorNote(noteMsg);
+            }
+        else if (iSucceededOperations > 0 && iFailedOperations > 0)    
+            {
+            _LIT(KMessage, "%d operations succeeded, %d failed");
+            TBuf<128> noteMsg;
+            noteMsg.Format(KMessage, iSucceededOperations, iFailedOperations);
+
+            iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+            }
+        else    
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(iLastError, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+
+		}
+	else
+		{
+		// maintain requests
+		iCurrentEntry++;
+
+        //LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
+
+        ExecuteCommand();
+		}
+    }    
+// --------------------------------------------------------------------------------------------
+
+// This callback function is called when cancel button of the progress bar was pressed
+void CFileBrowserFileUtils::DialogDismissedL(TInt aButtonId)
+    {
+//    iProgressDialog = NULL;
+//    iProgressInfo = NULL;
+//    iWaitDialog = NULL;
+    
+    // check if cancel button was pressed
+    if (aButtonId == EAknSoftkeyCancel)
+        {
+        // cancel the active object, command executer 
+        Cancel();
+        
+        iFileOps->CancelOp();
+        
+        ResetCommandArray();
+
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Cancelled"), _L(""));
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::AppendToCommandArrayL(TInt aCommand, CCommandParamsBase* aParameters)
+    {
+    if (iCommandArray)
+        iCommandArray->AppendL( TCommand(aCommand, aParameters) );
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::CommandArrayCount() const
+    {
+    TInt count(0);
+    
+    if (iCommandArray)
+        count = iCommandArray->Count();
+    
+    return count;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ResetCommandArray()
+    {
+    // delete params first
+    for (TInt i=0; i<CommandArrayCount(); i++)
+        {
+        if ( iCommandArray->At(i).iParameters )
+            {
+            delete iCommandArray->At(i).iParameters;
+            iCommandArray->At(i).iParameters = NULL;
+            }
+        }
+
+    // reset the entries
+    iCommandArray->Reset();
+    }
+                    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::HandleSettingsChangeL()
+    {
+	// TODO
+
+//    if (iEngine->FileListContainer())
+//        {
+//        iEngine->FileListContainer()->SetScreenLayoutL(iEngine->Settings().iDisplayMode);
+//        iEngine->FileListContainer()->CreateListBoxL(iEngine->Settings().iFileViewMode);
+        //iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+        RefreshViewL();
+//        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetSortModeL(TInt aSortMode)
+    {
+    iSortMode = aSortMode;
+    RefreshViewL();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetOrderModeL(TInt aOrderMode)
+    {
+    iOrderMode = aOrderMode;
+    RefreshViewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CFileBrowserFileUtils::HandleOfferKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
+    {
+	// TODO
+	/*
+    if(aType != EEventKey)
+        return EKeyWasNotConsumed;
+    
+    TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift) ||
+                            (aKeyEvent.iModifiers & EModifierLeftShift) ||
+                            (aKeyEvent.iModifiers & EModifierRightShift);
+    TBool controlKeyPressed = (aKeyEvent.iModifiers & EModifierCtrl) || 
+                              (aKeyEvent.iModifiers & EModifierRightCtrl); 
+    
+    // handle left arrow key press
+    if (aKeyEvent.iCode == EKeyLeftArrow)
+        {
+        MoveUpOneLevelL();
+        return EKeyWasConsumed;
+        }
+    
+    // handle right arrow key press
+    else if (aKeyEvent.iCode == EKeyRightArrow)
+        {
+        if (IsDriveListViewActive() && iDriveEntryList->Count() > 0)
+            {
+            MoveDownToDirectoryL();
+            return EKeyWasConsumed;
+            }
+        else if (iFileEntryList->Count() > 0)
+            {
+            MoveDownToDirectoryL();
+            return EKeyWasConsumed;
+            }        
+        }    
+
+    // skip OK/Enter keys when shift or ctrl is pressed because those are needed by the listbox
+    else if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) && (shiftKeyPressed || controlKeyPressed))
+        {
+        return EKeyWasNotConsumed;
+        }
+    
+    // handle OK/Enter keys
+    else if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
+        {
+        if (IsDriveListViewActive() && iDriveEntryList->Count() > 0)
+            {
+            MoveDownToDirectoryL();
+            return EKeyWasConsumed;
+            }
+        else if (iFileEntryList->Count() > 0)
+            {
+            TFileEntry fileEntry = iFileEntryList->At(iEngine->FileListContainer()->CurrentListBoxItemIndex());
+            
+            if (fileEntry.iEntry.IsDir())
+                MoveDownToDirectoryL();
+            else
+                OpenCommonFileActionQueryL();
+            
+            return EKeyWasConsumed;
+            } 
+        }
+    
+    // handle Delete/Backspace keys
+    else if (!iEngine->FileListContainer()->SearchField() && (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete) &&
+             !iEngine->FileUtils()->IsCurrentDriveReadOnly() && !iEngine->FileUtils()->IsDriveListViewActive())
+        {
+        DeleteL();
+        return EKeyWasConsumed;
+        }
+    */                      
+    return EKeyWasNotConsumed;
+    }        
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::RefreshViewL()
+    {
+	// TODO
+
+//    if (iEngine->FileListContainer())
+//        {
+        // update navi pane text        
+//        if (iListingMode == ENormalEntries)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+//        else if (iListingMode == ESearchResults)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Search results"));
+//        else if (iListingMode == EOpenFiles)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Open files"));
+//        else if (iListingMode == EMsgAttachmentsInbox)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Inbox"));
+//        else if (iListingMode == EMsgAttachmentsDrafts)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Drafts"));
+//        else if (iListingMode == EMsgAttachmentsSentItems)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Sent Items"));
+//        else if (iListingMode == EMsgAttachmentsOutbox)
+//            iEngine->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Outbox"));
+//
+//        // create a list box if it doesn't already exist
+//        if (!iEngine->FileListContainer()->ListBox())
+//            iEngine->FileListContainer()->CreateListBoxL(iEngine->Settings().iFileViewMode);
+//
+//        // clear selections if any
+//        iEngine->FileListContainer()->ListBox()->ClearSelection();
+//
+//        // make sure that the search field is disabled
+//        iEngine->FileListContainer()->DisableSearchFieldL();
+        
+        // read directory listing
+        GenerateDirectoryDataL();
+        
+//        // set an icon array
+//        iEngine->FileListContainer()->SetListBoxIconArrayL(GenerateIconArrayL());
+//
+//        // set text items
+//        iEngine->FileListContainer()->SetListBoxTextArrayL(GenerateItemTextArrayL());
+
+//        // make sure that the current item index is not out of array
+//        if (iEngine->FileListContainer()->CurrentListBoxItemIndex() == -1 && // -1 is a hardcoded value meaning that no current item index
+//                iEngine->FileListContainer()->ListBox()->Model()->NumberOfItems() > 0)
+//            iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex( iEngine->FileListContainer()->ListBox()->Model()->NumberOfItems() - 1 );
+//
+//        }
+    
+//        iEngine->FileListContainer()->UpdateToolbar();
+
+        }
+    
+// --------------------------------------------------------------------------------------------
+
+/*CAknIconArray* CFileBrowserFileUtils::GenerateIconArrayL(TBool aGenerateNewBasicIconArray)
+    {
+	// TODO
+	
+    CAknIconArray* iconArray = NULL;
+
+    if (aGenerateNewBasicIconArray)
+        {
+        iconArray = new(ELeave) CAknIconArray(16);    
+        }
+    else
+        {
+        if (iEngine->FileListContainer())
+            iconArray = iEngine->FileListContainer()->ListBoxIconArrayL();
+        
+        if (!iconArray)    
+            iconArray = new(ELeave) CAknIconArray(16);
+        }
+
+        
+    CleanupStack::PushL(iconArray);
+    
+    // generate basic items if not already existing
+    if (iconArray->Count() < EFixedIconListLength)
+        {
+        // reset arrays
+        iconArray->Reset();
+        iAppIconList->Reset();
+        
+        // get default control color
+        TRgb defaultColor;
+        defaultColor = iEngine->EikonEnv()->Color(EColorControlText);
+        
+        // create a color icon of the marking indicator
+        CFbsBitmap* markBitmap = NULL;
+        CFbsBitmap* markBitmapMask = NULL;
+
+        AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
+                KAknsIIDQgnIndiMarkedAdd,
+                KAknsIIDQsnIconColors,
+                EAknsCIQsnIconColorsCG13,
+                markBitmap,
+                markBitmapMask,
+                AknIconUtils::AvkonIconFileName(),
+                EMbmAvkonQgn_indi_marked_add,
+                EMbmAvkonQgn_indi_marked_add_mask,
+                defaultColor
+                );
+         
+        // 0 marking indicator
+        CGulIcon* markIcon = CGulIcon::NewL(markBitmap, markBitmapMask);
+        iconArray->AppendL(markIcon);                       
+
+        // 1 empty
+        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
+                                  EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask, KAknsIIDQgnPropEmpty);
+        // 2 phone memory
+        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
+                                  EMbmAvkonQgn_prop_phone_memc, EMbmAvkonQgn_prop_phone_memc_mask, KAknsIIDQgnPropPhoneMemc);
+        // 3 memory card
+        AppendGulIconToIconArrayL(iconArray, KMemoryCardUiBitmapFile,
+                                  EMbmAknmemorycarduiQgn_prop_mmc_memc, EMbmAknmemorycarduiQgn_prop_mmc_memc_mask, KAknsIIDQgnPropMmcMemc);
+        // 4 memory card disabled
+        AppendGulIconToIconArrayL(iconArray, KMemoryCardUiBitmapFile,
+                                  EMbmAknmemorycarduiQgn_prop_mmc_non, EMbmAknmemorycarduiQgn_prop_mmc_non_mask, KAknsIIDQgnPropMmcNon);
+        // 5 folder
+        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
+                                  EMbmAvkonQgn_prop_folder_small, EMbmAvkonQgn_prop_folder_small_mask, KAknsIIDQgnPropFolderSmall);
+        // 6 folder with subfolders
+        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
+                                  EMbmAvkonQgn_prop_folder_sub_small, EMbmAvkonQgn_prop_folder_sub_small_mask, KAknsIIDQgnPropFolderSubSmall);
+        // 7 current folder
+        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
+                                  EMbmAvkonQgn_prop_folder_current, EMbmAvkonQgn_prop_folder_current_mask, KAknsIIDQgnPropFolderCurrent);
+        }
+
+    // append custom icons if not in drive list view and setting is enabled
+    if (!aGenerateNewBasicIconArray && !IsDriveListViewActive() && iEngine->Settings().iShowAssociatedIcons)
+        {
+        // init id counter
+        TInt idCounter(EFixedIconListLength + iAppIconList->Count());
+        
+        // loop all items in the file list
+        for (TInt i=0; i<iFileEntryList->Count(); i++)
+            {
+            TFileEntry& fileEntry = iFileEntryList->At(i);
+
+            // just check for normal files            
+            if (!fileEntry.iEntry.IsDir())     
+                {
+                TUid appUid = GetAppUid(fileEntry);
+                TInt iconId = AppIconIdForUid(appUid);
+                
+                if (appUid != KNullUid && iconId == KErrNotFound)
+                    {
+                    // icon not found from the icon array, generate it
+                    CFbsBitmap* bitmap = NULL;
+                    CFbsBitmap* mask = NULL;
+                    CGulIcon* appIcon = NULL;
+        
+                    TRAPD(err, 
+                        AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), appUid, EAknsAppIconTypeList, bitmap, mask);
+                        appIcon = CGulIcon::NewL(bitmap, mask);
+                        CleanupStack::Pop(2); //bitmap, mask
+                        );
+                         
+                    if (err == KErrNone)
+                        {
+                        TAppIcon appIconEntry;
+                        appIconEntry.iId = idCounter;
+                        appIconEntry.iUid = appUid;
+                        
+                        appIcon->SetBitmapsOwnedExternally(EFalse);
+                        iconArray->AppendL(appIcon);
+                        iAppIconList->AppendL(appIconEntry);
+
+                        fileEntry.iIconId = idCounter;
+                                                
+                        idCounter++;      
+                        }
+                    else
+                        {
+                        delete bitmap;
+                        delete mask;
+		
+                        TAppIcon appIconEntry;
+                        appIconEntry.iId = EFixedIconEmpty;
+                        appIconEntry.iUid = appUid;
+                        
+                        iAppIconList->AppendL(appIconEntry);
+                        }
+                    }
+
+                else if (appUid != KNullUid && iconId >= 0)
+                    {
+                    // we already have already generated an icon for this uid, use it
+                    fileEntry.iIconId = iconId;
+                    }
+                }
+            }
+        }
+
+    CleanupStack::Pop(); //iconArray
+	return iconArray;
+    
+	}
+*/
+// --------------------------------------------------------------------------------------------
+
+//void CFileBrowserFileUtils::AppendGulIconToIconArrayL(CAknIconArray* aIconArray, const TDesC& aIconFile, TInt aIconId, TInt aMaskId, const TAknsItemID aAknsItemId)
+//    {
+//    CGulIcon* icon = AknsUtils::CreateGulIconL(
+//            AknsUtils::SkinInstance(),
+//            aAknsItemId,
+//            aIconFile,
+//            aIconId,
+//            aMaskId);
+//    CleanupStack::PushL(icon);
+//	
+//	icon->SetBitmapsOwnedExternally(EFalse);
+//	aIconArray->AppendL(icon);
+//	
+//	CleanupStack::Pop(); //icon          
+//    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::AppIconIdForUid(TUid aUid)
+    {
+    TInt result(KErrNotFound);
+    
+    for (TInt i=0; i<iAppIconList->Count(); i++)
+        {
+        if (iAppIconList->At(i).iUid == aUid)
+            {
+            result = iAppIconList->At(i).iId;
+            break;
+            }
+        }
+    
+    return result;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TUid CFileBrowserFileUtils::GetAppUid(TFileEntry aFileEntry)
+    {
+    TFileName fullPath;
+    fullPath.Copy(aFileEntry.iPath);
+    fullPath.Append(aFileEntry.iEntry.iName);
+    
+    TParse parsedName;
+    parsedName.Set(fullPath, NULL, NULL);
+
+    // this will boost performance in \sys\bin folder    
+    if (parsedName.Ext().CompareF(_L(".dll")) == 0 || parsedName.Ext().CompareF(_L(".rsc")) == 0)
+        return KNullUid;
+    
+    TInt err1(KErrNone), err2(KErrNone);
+    TUid appUid;
+    TDataType dataType;
+    TBool isProgram;
+    
+    err1 = iEngine->LsSession().AppForDocument(fullPath, appUid, dataType);
+    err2 = iEngine->LsSession().IsProgram(fullPath, isProgram);
+        
+    if (err1 == KErrNone && err2 == KErrNone)
+        {
+        if (isProgram)
+            {
+            // get the real app Uid from the app list
+            TApaAppInfo appInfo;
+            iEngine->LsSession().GetAllApps();
+
+            while (iEngine->LsSession().GetNextApp(appInfo) == KErrNone)
+                {
+                if (fullPath.CompareF(appInfo.iFullName) == 0)
+                    return appInfo.iUid;
+                }
+            }
+        else
+            {
+            // return the app Uid associated for it
+            return appUid;
+            }            
+        }
+
+    return KNullUid;
+    }
+
+
+CFileEntryList* CFileBrowserFileUtils::FileEntries() const
+{
+    return iFileEntryList;
+}
+CDriveEntryList* CFileBrowserFileUtils::DriveEntries() const
+{
+    return iDriveEntryList;
+}
+
+//// --------------------------------------------------------------------------------------------
+//
+//CDesCArray* CFileBrowserFileUtils::GenerateItemTextArrayL()
+//    {
+//    iTextArray = new(ELeave) CDesCArrayFlat(64);
+////    CleanupStack::PushL(textArray);
+//
+//    if (IsDriveListViewActive())
+//        {
+//        _LIT(KSimpleDriveEntry, "%d\t%c: <%S>\t\t");
+//        _LIT(KExtendedDriveEntry, "%d\t%c: <%S>\t%LD / %LD kB\t");
+//
+//        for (TInt i=0; i<iDriveEntryList->Count(); i++)
+//            {
+//            TFileName textEntry;
+//            TDriveEntry driveEntry = iDriveEntryList->At(i);
+//
+//            if (iEngine->Settings().iFileViewMode == EFileViewModeSimple)
+//                {
+//                textEntry.Format(KSimpleDriveEntry, driveEntry.iIconId, TUint(driveEntry.iLetter), &driveEntry.iMediaTypeDesc);
+//                }
+//            else if (iEngine->Settings().iFileViewMode == EFileViewModeExtended)
+//                {
+//                textEntry.Format(KExtendedDriveEntry, driveEntry.iIconId, TUint(driveEntry.iLetter), &driveEntry.iMediaTypeDesc, driveEntry.iVolumeInfo.iFree/1024, driveEntry.iVolumeInfo.iSize/1024);
+//                }
+//
+//            iTextArray->AppendL(textEntry);
+//            }
+//        }
+//
+//    else
+//        {
+//        _LIT(KSimpleFileEntry, "%d\t%S\t\t");
+//        _LIT(KExtendedFileEntry, "%d\t%S\t%S\t");
+//
+//        for (TInt i=0; i<iFileEntryList->Count(); i++)
+//            {
+//            TFileName textEntry;
+//            TFileEntry fileEntry = iFileEntryList->At(i);
+//
+//            // format text line entries
+//            if (iEngine->Settings().iFileViewMode == EFileViewModeSimple)
+//                {
+//                textEntry.Format(KSimpleFileEntry, fileEntry.iIconId, &fileEntry.iEntry.iName);
+//                }
+//            else if (iEngine->Settings().iFileViewMode == EFileViewModeExtended)
+//                {
+//                TBuf<128> extraData;
+//
+//                // append entry date
+//                TTime entryModified = fileEntry.iEntry.iModified;
+//                if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
+//                    {
+//                    entryModified = fileEntry.iEntry.iModified;
+//                    }
+//
+//                _LIT(KCurrentDate,"%D%M%*Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+//                entryModified.FormatL(extraData, KCurrentDate);
+//
+//                // for a directory append number of entries and for a file the file size
+//                if (fileEntry.iEntry.IsDir() && fileEntry.iDirEntries >= 0)
+//                    {
+//                    extraData.Append(_L(" - "));
+//                    extraData.AppendNum(fileEntry.iDirEntries);
+//
+//                    if (fileEntry.iDirEntries == 1)
+//                        extraData.Append(_L(" entry"));
+//                    else
+//                        extraData.Append(_L(" entries"));
+//                    }
+//
+//                // normal file entry
+//                else if (!fileEntry.iEntry.IsDir())
+//                    {
+//                    extraData.Append(_L(" - "));
+//
+//                    if (fileEntry.iEntry.iSize < 1024)
+//                        {
+//                        extraData.AppendNum(fileEntry.iEntry.iSize);
+//                        extraData.Append(_L(" B"));
+//                        }
+//                    else if (fileEntry.iEntry.iSize < 1024*1024)
+//                        {
+//                        TReal sizeKB = (TReal)fileEntry.iEntry.iSize / 1024;
+//                        extraData.AppendNum(sizeKB, TRealFormat(KDefaultRealWidth, 1));
+//                        extraData.Append(_L(" kB"));
+//                        }
+//                    else
+//                        {
+//                        TReal sizeMB = (TReal)fileEntry.iEntry.iSize / (1024*1024);
+//                        extraData.AppendNum(sizeMB, TRealFormat(KDefaultRealWidth, 1));
+//                        extraData.Append(_L(" MB"));
+//                        }
+//                    }
+//
+//                // append attribute flags if any
+//                TBuf<4> atts;
+//                if (fileEntry.iEntry.IsArchive())
+//                    atts.Append(_L("A"));
+//                if (fileEntry.iEntry.IsHidden())
+//                    atts.Append(_L("H"));
+//                if (fileEntry.iEntry.IsReadOnly())
+//                    atts.Append(_L("R"));
+//                if (fileEntry.iEntry.IsSystem())
+//                    atts.Append(_L("S"));
+//
+//                if (atts.Length() > 0)
+//                    {
+//                    extraData.Append(_L(" - ["));
+//                    extraData.Append(atts);
+//                    extraData.Append(_L("]"));
+//                    }
+//
+//                // format
+//                textEntry.Format(KExtendedFileEntry, fileEntry.iIconId, &fileEntry.iEntry.iName, &extraData);
+//                }
+//
+//            iTextArray->AppendL(textEntry);
+//            }
+//        }
+//
+////    CleanupStack::Pop(); //textArray
+//    return iTextArray;
+//    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::GenerateDirectoryDataL()
+    {
+    if (iListingMode == ENormalEntries)
+        {
+        if (IsDriveListViewActive())
+            GetDriveListL();    
+        else
+            GetDirectoryListingL();        
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::GetDriveListL()
+    {
+    TDriveList driveList;
+    
+    // get drive listing depending of the support for network drives
+    if (iEngine->Settings().iSupportNetworkDrives)
+        {
+        #ifndef __SERIES60_30__
+            #ifndef __SERIES60_31__
+                User::LeaveIfError(iFs.DriveList(driveList, KDriveAttAll));
+            #endif
+        #else    
+            User::LeaveIfError(iFs.DriveList(driveList));
+        #endif        
+        }
+    else
+        {
+        User::LeaveIfError(iFs.DriveList(driveList));
+        }
+    
+    iDriveEntryList->Reset();        
+    
+    for (TInt i=0; i<KMaxDrives; i++)
+        {
+        if (driveList[i])
+            {
+            TDriveEntry driveEntry;
+            
+            // set default icon
+            driveEntry.iIconId = EFixedIconPhoneMemory;
+
+            // get drive letter and number 
+            driveEntry.iLetter = 'A' + i;
+            iFs.CharToDrive(driveEntry.iLetter, driveEntry.iNumber);
+            
+            // get volume info and check errors
+            if (iFs.Volume(driveEntry.iVolumeInfo, driveEntry.iNumber) == KErrNone)
+                {
+                // set media type descriptor
+                TInt mediaType = driveEntry.iVolumeInfo.iDrive.iType;
+                TBool extMountable( EFalse );
+                
+                if (mediaType == EMediaNotPresent)
+                    driveEntry.iMediaTypeDesc = _L("Not present");
+                else if (mediaType ==EMediaUnknown )
+                    driveEntry.iMediaTypeDesc = _L("Unknown");
+                else if (mediaType ==EMediaFloppy )
+                    driveEntry.iMediaTypeDesc = _L("Floppy");
+                else if (mediaType == EMediaHardDisk)
+                    driveEntry.iMediaTypeDesc = _L("Mass storage");
+                else if (mediaType == EMediaCdRom)
+                    driveEntry.iMediaTypeDesc = _L("CD-ROM");
+                else if (mediaType == EMediaRam)
+                    driveEntry.iMediaTypeDesc = _L("RAM");
+                else if (mediaType == EMediaFlash)
+                    driveEntry.iMediaTypeDesc = _L("Flash");
+                else if (mediaType == EMediaRom)
+                    driveEntry.iMediaTypeDesc = _L("ROM");
+                else if (mediaType == EMediaRemote)
+                    driveEntry.iMediaTypeDesc = _L("Remote");
+                else if (mediaType == EMediaNANDFlash)
+                    driveEntry.iMediaTypeDesc = _L("NAND flash");
+                
+                // get real size of the ROM drive
+                if (mediaType == EMediaRom)
+                    {
+                    TMemoryInfoV1Buf ramMemory;
+                    UserHal::MemoryInfo(ramMemory);
+                    driveEntry.iVolumeInfo.iSize = ramMemory().iTotalRomInBytes;
+                    }
+                
+                // set attribute descripitions
+                if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatNotSupported)
+                    driveEntry.iAttributesDesc.Append(_L("Battery not supported"));
+                else if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatGood)
+                    driveEntry.iAttributesDesc.Append(_L("Battery good"));
+                else if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatLow)
+                    driveEntry.iAttributesDesc.Append(_L("Battery low"));
+                else
+                    driveEntry.iAttributesDesc.Append(_L("Battery state unknown"));
+                
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttLocal)
+                    driveEntry.iAttributesDesc.Append(_L(" + Local"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRom)
+                    driveEntry.iAttributesDesc.Append(_L(" + ROM"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRedirected)
+                    driveEntry.iAttributesDesc.Append(_L("+ Redirected"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttSubsted)
+                    driveEntry.iAttributesDesc.Append(_L(" + Substed"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttInternal)
+                    driveEntry.iAttributesDesc.Append(_L(" + Internal"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable)
+                    {
+                    driveEntry.iAttributesDesc.Append(_L(" + Removable"));
+#if (!defined __SERIES60_30__ && !defined __SERIES60_31__)
+                    TUint drvStatus( 0 );
+                    if ( !DriveInfo::GetDriveStatus( iFs, driveEntry.iNumber, drvStatus ) &&
+                         drvStatus & DriveInfo::EDriveExternallyMountable &&
+                         drvStatus & DriveInfo::EDriveInternal )
+                        {
+                        extMountable = ETrue;
+                        // iMediaTypeDesc already set as "Mass storage" 
+                        }
+                    else
+                        {
+                        driveEntry.iMediaTypeDesc = _L("Memory card");
+                        }
+#else
+                    driveEntry.iMediaTypeDesc = _L("Memory card");
+#endif
+                    }
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemote)
+                    driveEntry.iAttributesDesc.Append(_L(" + Remote"));
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttTransaction)
+                    driveEntry.iAttributesDesc.Append(_L(" + Transaction"));
+                                
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttVariableSize)
+                    driveEntry.iAttributesDesc.Append(_L(" + Variable size"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttDualDensity)
+                    driveEntry.iAttributesDesc.Append(_L(" + Dual density"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttFormattable)
+                    driveEntry.iAttributesDesc.Append(_L(" + Formattable"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttWriteProtected)
+                    driveEntry.iAttributesDesc.Append(_L(" + Write protected"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLockable)
+                    driveEntry.iAttributesDesc.Append(_L(" + Lockable"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked)
+                    driveEntry.iAttributesDesc.Append(_L(" + Locked"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword)
+                    driveEntry.iAttributesDesc.Append(_L(" + Has password"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttReadWhileWrite)
+                    driveEntry.iAttributesDesc.Append(_L(" + Read while write"));
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttDeleteNotify)
+                    driveEntry.iAttributesDesc.Append(_L(" + Supports DeleteNotify"));
+                
+                
+                // mark a removable media with memory card icon
+                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable && !extMountable)
+                    {
+                    if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAbsent)
+                        {                
+                        driveEntry.iIconId = EFixedIconMemoryCardDisabled;
+                        }                 
+                    else
+                        {                
+                        driveEntry.iIconId = EFixedIconMemoryCard;
+                        } 
+                    }
+                }   
+            
+            // if this fails, likely it's a memory card which is not present
+            else
+                {
+                TVolumeInfo volumeInfo;
+                volumeInfo.iSize = 0;
+                volumeInfo.iFree = 0;
+                volumeInfo.iDrive.iDriveAtt = KDriveAttRemovable;
+                volumeInfo.iDrive.iMediaAtt = KMediaAttWriteProtected;
+                driveEntry.iVolumeInfo = volumeInfo;
+
+                driveEntry.iMediaTypeDesc = _L("Not ready");
+                driveEntry.iIconId = EFixedIconMemoryCardDisabled;
+                }
+            
+            if ( iPrevFolderName != KNullDesC && iPrevFolderName[0] == driveEntry.iLetter )
+                {
+                iPrevFolderIndex = iDriveEntryList->Count();
+                }
+            
+            iDriveEntryList->AppendL(driveEntry);
+            }
+        }
+    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::GetDirectoryListingL()
+    {
+    iFileEntryList->Reset();
+
+    TInt sortMode(ESortByName);
+    if (iSortMode == EFileBrowserCmdViewSortByExtension)    
+        sortMode = ESortByExt; 
+    else if (iSortMode == EFileBrowserCmdViewSortBySize)    
+        sortMode = ESortBySize; 
+    else if (iSortMode == EFileBrowserCmdViewSortByDate)    
+        sortMode = ESortByDate; 
+    
+    TInt orderMode(EAscending);
+    if (iOrderMode == EFileBrowserCmdViewOrderDescending)    
+        orderMode = EDescending; 
+    
+    CDir* dir = NULL;
+    if (iFs.GetDir(iCurrentPath, KEntryAttMatchMask, sortMode | orderMode | EDirsFirst, dir) == KErrNone)
+        {
+        CleanupStack::PushL(dir);
+        
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TFileEntry fileEntry;
+            fileEntry.iPath = iCurrentPath;
+            fileEntry.iEntry = (*dir)[i];
+            fileEntry.iDirEntries = KErrNotFound;
+            fileEntry.iIconId = EFixedIconEmpty;
+            
+            if ( iPrevFolderName != KNullDesC && iPrevFolderName == fileEntry.iEntry.iName )
+                {
+                iPrevFolderIndex = i;
+                }
+            
+            // check for directory entries
+            if (fileEntry.iEntry.IsDir())
+                {
+                fileEntry.iIconId = EFixedIconFolder;
+
+                TFileName subPath = fileEntry.iPath;
+                subPath.Append(fileEntry.iEntry.iName);
+                subPath.Append(_L("\\"));
+                                
+                // get number of entries in this directory if extended info about sub directories enabled
+                if (iEngine->Settings().iShowSubDirectoryInfo && iEngine->Settings().iFileViewMode == EFileViewModeExtended)
+                    {
+                    CDir* subDir = NULL;
+                    if (iFs.GetDir(subPath, KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
+                        {
+                        fileEntry.iDirEntries = subDir->Count();
+                        delete subDir;    
+                        }
+                    }
+                
+                // apply subfolder icon for known directories (speed improvement)
+                if (subPath[0]=='Z' && (subPath.CompareF(_L("Z:\\data\\"))==0 || subPath.CompareF(_L("Z:\\Nokia\\"))==0
+                    || subPath.Compare(_L("Z:\\private\\"))==0 || subPath.Compare(_L("Z:\\resource\\"))==0
+                    || subPath.Compare(_L("Z:\\sys\\"))==0 || subPath.Compare(_L("Z:\\system\\"))==0))
+                    {
+                    fileEntry.iIconId = EFixedIconFolderSub;
+                    }
+                else if (subPath[0]=='Z' && (subPath.CompareF(_L("Z:\\sys\\bin\\"))==0))
+                    {
+                    // normal folder icon for these ones
+                    fileEntry.iIconId = EFixedIconFolder;
+                    }
+                else
+                    {
+                    // check if this folder has subdirectories
+                    CDir* subDir = NULL;
+                    if (iFs.GetDir(subPath, KEntryAttDir|KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
+                        {
+                        for (TInt j=0; j<subDir->Count(); j++)
+                            {
+                            TEntry entry = (*subDir)[j];
+
+                            if (entry.IsDir())
+                                {
+                                fileEntry.iIconId = EFixedIconFolderSub;
+                                break;    
+                                }
+                            }
+
+                        delete subDir;    
+                        }                    
+                    }
+                }
+
+            iFileEntryList->AppendL(fileEntry);
+            }
+        
+        CleanupStack::PopAndDestroy(); //dir    
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::MoveUpOneLevelL()
+    {
+    iPrevFolderIndex = KErrNotFound;
+    iPrevFolderName.Zero();
+    
+    // change back to normal mode or move up
+    if (iListingMode != ENormalEntries)
+        {
+        iListingMode = ENormalEntries;
+        }
+    else
+        {
+        // do nothing if displaying drive list view
+        if (IsDriveListViewActive())
+            return;
+        
+        if (iCurrentPath.Length() <= KDriveLetterStringLength)
+            {
+            if ( iCurrentPath.Length() > 0 )
+                {
+                iPrevFolderName.Append( iCurrentPath[0] );
+                }
+            // move to drive list view if the current path is already short enough
+            iCurrentPath = KNullDesC;
+            }
+        else
+            {
+            // move one directory up
+            TInt marker(iCurrentPath.Length());
+            
+            // find second last dir marker
+            for (TInt i=iCurrentPath.Length()-2; i>=0; i--)
+                {
+                if (iCurrentPath[i] == '\\')
+                    {
+                    marker = i;
+                    break;
+                    }
+                    
+                }
+            
+            // update iPrevDir with the directory name that we just left 
+            iPrevFolderName.Copy( iCurrentPath.RightTPtr( iCurrentPath.Length() -  marker - 1 ) );
+            iPrevFolderName.Delete( iPrevFolderName.Length() -1, 2 ); // remove extra '\\'
+            
+            iCurrentPath = iCurrentPath.LeftTPtr(marker+1);
+            }    
+        }
+
+//    if (iEngine->FileListContainer())
+//        {
+        //iEngine->FileListContainer()->DisableSearchFieldL();
+        //iEngine->FileListContainer()->ListBox()->ClearSelection();
+        //iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
+        //iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+//        }
+    
+    // update view
+    RefreshViewL();
+    
+    if ( iEngine->Settings().iRememberFolderSelection &&
+         iEngine->FileListContainer() && iPrevFolderIndex > KErrNotFound )
+        {
+        
+//        TInt visibleItems = iEngine->FileListContainer()->ListBox()->Rect().Height() /
+//                            iEngine->FileListContainer()->ListBox()->ItemHeight()
+//                            - 1; // for the title row
+//
+//        // By default, the selected item would be the last visible item on the listbox.
+//        // We want the selected item be displayed at the middle of the listbox, so we
+//        // select one of the successor items first to scroll down a bit
+//        iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(
+//            Min( iEngine->FileListContainer()->ListBox()->Model()->ItemTextArray()->MdcaCount() -1,
+//                 iPrevFolderIndex + visibleItems / 2 ) );
+//
+//        // ...and after that we select the the correct item.
+//        iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex( iPrevFolderIndex );
+        
+        // update view
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::MoveDownToDirectoryL(TInt aIndex)
+    {
+
+    // change back to normal mode
+    if (iListingMode != ENormalEntries)
+        {
+        iListingMode = ENormalEntries;
+        }
+    
+    if (aIndex >= 0)
+        {
+        TBool needsRefresh(EFalse);
+
+        if (IsDriveListViewActive())
+            {
+            // currently in a drive list view, move to root of selected drive
+            if (iDriveEntryList->Count() > aIndex)
+                {
+                TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+                
+                iCurrentPath.Append(driveEntry.iLetter);    
+                iCurrentPath.Append(_L(":\\"));
+                
+                needsRefresh = ETrue;    
+                }
+            }
+        else
+            {
+            // otherwise just append the new directory
+            if (iFileEntryList->Count() > aIndex)
+                {
+                TFileEntry fileEntry = iFileEntryList->At(aIndex);
+                
+                if (fileEntry.iEntry.IsDir())
+                    {
+                    iCurrentPath.Copy(fileEntry.iPath);
+                    iCurrentPath.Append(fileEntry.iEntry.iName);
+                    iCurrentPath.Append(_L("\\"));
+
+                    needsRefresh = ETrue;    
+                    }
+                }
+            }
+
+        if (needsRefresh /*&& iEngine->FileListContainer()*/)
+            {
+            //iEngine->FileListContainer()->DisableSearchFieldL();
+            //iEngine->FileListContainer()->ListBox()->ClearSelection();
+            //iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
+            //iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+
+            // update view
+            RefreshViewL();
+            }
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::IsCurrentDriveReadOnly()
+    {
+    if (iListingMode !=ENormalEntries || iCurrentPath.Length() < 2)
+        return EFalse;
+    else
+        {
+        for (TInt i=0; i<iDriveEntryList->Count(); i++)
+            {
+            TDriveEntry driveEntry = iDriveEntryList->At(i);
+            
+            if (driveEntry.iLetter == iCurrentPath[0])
+                {
+                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt == KMediaAttWriteProtected || driveEntry.iVolumeInfo.iDrive.iMediaAtt == KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt == KDriveAbsent)
+                    return ETrue;    
+                else
+                    return EFalse;
+                }
+            }
+        }
+
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::IsItemDirectory(TInt aCurrentItemIndex)
+    {
+    if (aCurrentItemIndex < 0)
+        {
+        return EFalse;
+        }
+    else
+        {
+        if (iFileEntryList->Count() > aCurrentItemIndex)
+            {
+            TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex) ;
+            return fileEntry.iEntry.IsDir();
+            }
+        else
+            {
+            return EFalse;
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::SetSelectedItemsOrCurrentItemL(const CArrayFix<TInt>* selectionIndexes,
+                                                           CFileEntryList* aFileEntryList)
+    {
+    aFileEntryList->Reset();
+
+    // by default use selected items
+    if (selectionIndexes && selectionIndexes->Count() > 0)
+        {
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+
+        for (TInt i=0; i<iFileEntryList->Count(); i++)
+            {
+            ref = i;
+
+            if (selectionIndexes->Find(ref, key, index) == 0)
+                {
+                aFileEntryList->AppendL(iFileEntryList->At(i));
+                }
+            }
+        }
+    return aFileEntryList->Count();
+    }
+
+// --------------------------------------------------------------------------------------------
+//TInt CFileBrowserFileUtils::GetSelectedItemsOrCurrentItemL(CFileEntryList* aFileEntryList)
+//    {
+//    aFileEntryList->Reset();
+//
+//    const CArrayFix<TInt>* selectionIndexes = iEngine->GetSelectedIndices();
+//    // by default use selected items
+//    if (selectionIndexes && selectionIndexes->Count() > 0)
+//        {
+//        TInt ref(0);
+//        TKeyArrayFix key(0, ECmpTUint16);
+//        TInt index(0);
+//
+//        for (TInt i=0; i<iFileEntryList->Count(); i++)
+//            {
+//            ref = i;
+//
+//            if (selectionIndexes->Find(ref, key, index) == 0)
+//                {
+//                aFileEntryList->AppendL(iFileEntryList->At(i));
+//                }
+//            }
+//        }
+//
+//    // or if none selected, use the current item index
+//    else
+//        {
+////        TInt currentItemIndex = iEngine->FileListContainer()->CurrentListBoxItemIndex();
+//        TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+//        if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
+//            {
+//            aFileEntryList->AppendL(iFileEntryList->At(currentItemIndex));
+//            }
+//        }
+//
+//    return aFileEntryList->Count();
+//    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::ClipboardCutL(const CArrayFix<TInt>* aSelectionIndices)
+    {
+	
+    iClipBoardMode = EClipBoardModeCut;
+    //TInt operations = GetSelectedItemsOrCurrentItemL(iClipBoardList);
+    TInt operations = SetSelectedItemsOrCurrentItemL(aSelectionIndices, iClipBoardList);
+    return operations;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::ClipboardCopyL(const CArrayFix<TInt>* aSelectionIndices)
+    {
+    iClipBoardMode = EClipBoardModeCopy;
+    //TInt operations = GetSelectedItemsOrCurrentItemL(iClipBoardList);
+    TInt operations = SetSelectedItemsOrCurrentItemL(aSelectionIndices, iClipBoardList);
+    return operations;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ClipboardPasteL(const TOverwriteOptions &aOverwriteOptions)
+    {
+    if (iClipBoardMode == EClipBoardModeCut)
+        {
+        DoCopyToFolderL(iClipBoardList, iCurrentPath, aOverwriteOptions, ETrue );
+        iClipBoardList->Reset();
+        }
+    else if (iClipBoardMode == EClipBoardModeCopy)
+        {
+        DoCopyToFolderL(iClipBoardList, iCurrentPath, aOverwriteOptions, EFalse);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::SetCurrentSelection(const CArrayFix<TInt>* aSelectionIndices)
+    {
+    TInt operations = SetSelectedItemsOrCurrentItemL(aSelectionIndices, iCurrentSelectionList);
+    return operations;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::CopyToFolderL(TFileName aTargetDir,
+                                          const TOverwriteOptions &aOverwriteOptions,
+                                          TBool aMove)
+    {
+
+    //	TFileName destinationFolder;
+
+    // generate an icon array
+    // CAknIconArray* iconArray = GenerateIconArrayL(ETrue);
+    //    CleanupStack::PushL(iconArray);
+
+    // run folder selection dialog
+    //    CFileBrowserDestinationFolderSelectionDlg* dlg = CFileBrowserDestinationFolderSelectionDlg::NewL(destinationFolder, iDriveEntryList, iconArray);
+
+    // get entry list
+    //CFileEntryList* entryList = new(ELeave) CFileEntryList(32);
+    //GetSelectedItemsOrCurrentItemL(entryList);
+    //CleanupStack::PushL(entryList);
+
+    // do the file operations
+    //DoCopyToFolderL(entryList, aTargetDir, aOverwriteOptions, aMove);
+    DoCopyToFolderL(iCurrentSelectionList, aTargetDir, aOverwriteOptions, aMove);
+
+    //CleanupStack::PopAndDestroy(); // entryList
+
+    //    CleanupStack::Pop(); //iconArray
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::IsDestinationEntriesExists(const TDesC& aTargetDir)
+    {
+    TBool someEntryExists(EFalse);
+    if (iCurrentSelectionList && iCurrentSelectionList->Count() > 0)
+        {
+        // check if some destination entries also exists
+        for (TInt i=0; i<iCurrentSelectionList->Count(); i++)
+            {
+            TFileEntry fileEntry = iCurrentSelectionList->At(i);
+
+            TFileName targetEntry = aTargetDir;
+            targetEntry.Append(fileEntry.iEntry.iName);
+
+            if (fileEntry.iEntry.IsDir())
+                {
+                targetEntry.Append(_L("\\"));
+
+                if (BaflUtils::PathExists(iFs, targetEntry))
+                    {
+                    someEntryExists = ETrue;
+                    break;
+                    }
+                }
+            else
+                {
+                if (BaflUtils::FileExists(iFs, targetEntry))
+                    {
+                    someEntryExists = ETrue;
+                    break;
+                    }
+                }
+            }
+        }
+    return someEntryExists;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DoCopyToFolderL(CFileEntryList* aEntryList,
+                                            const TDesC& aTargetDir,
+                                            const TOverwriteOptions &aOverwriteOptions,
+                                            TBool aDeleteSource)
+    {
+    if (aEntryList && aEntryList->Count() > 0)
+        {
+        if (aOverwriteOptions.iDoFileOperations)
+            {
+            // set correct command id depending if we are copying or moving
+            TInt commandId(EFileBrowserFileOpCommandCopy);
+            if (aDeleteSource)
+                commandId = EFileBrowserFileOpCommandMove;
+            
+            // do the file operations for each entry
+            for (TInt i=0; i<aEntryList->Count(); i++)
+                {
+                TFileEntry fileEntry = aEntryList->At(i);
+                
+                TFileName targetEntry = aTargetDir;
+                targetEntry.Append(fileEntry.iEntry.iName);
+                
+                if (aOverwriteOptions.iQueryIndex == EFileActionGenerateUniqueFilenames)
+                    {
+                    CApaApplication::GenerateFileName(iFs, targetEntry);
+                    }
+                else if (aOverwriteOptions.iQueryIndex == EFileActionQueryPostFix)
+                    {
+                    targetEntry.Append(aOverwriteOptions.iPostFix);
+                    }
+
+                
+                // append the new command to the command array
+                if (fileEntry.iEntry.IsDir())
+                    {
+                    AppendToCommandArrayL(commandId,
+                                          new(ELeave)CCommandParamsCopyOrMove(fileEntry, targetEntry, aOverwriteOptions.iOverWriteFlags|CFileMan::ERecurse)
+                                         );
+                    }
+                else
+                    {
+                    AppendToCommandArrayL(commandId,
+                                          new(ELeave)CCommandParamsCopyOrMove(fileEntry, targetEntry, aOverwriteOptions.iOverWriteFlags)
+                                         );
+                    }
+
+                }
+
+            // execute all operations
+            if (aDeleteSource)
+                StartExecutingCommandsL(_L("Moving"));
+            else
+                StartExecutingCommandsL(_L("Copying"));
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DeleteL()
+    {
+    // do the file operations for each entry
+    for (TInt i=0; i<iCurrentSelectionList->Count(); i++)
+        {
+        TFileEntry fileEntry = iCurrentSelectionList->At(i);
+
+        // append the new command to the command array
+        if (fileEntry.iEntry.IsDir())
+            {
+            AppendToCommandArrayL(EFileBrowserFileOpCommandDelete,
+                                  new(ELeave)CCommandParamsDelete(fileEntry, CFileMan::ERecurse)
+                                 );
+            }
+        else
+            {
+            AppendToCommandArrayL(EFileBrowserFileOpCommandDelete,
+                                  new(ELeave)CCommandParamsDelete(fileEntry, 0)
+                                 );
+            }
+
+        }
+
+    // execute all operations
+    StartExecutingCommandsL(_L("Deleting"));
+    }
+
+
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::SelectionHasDirs()
+{
+    TBool isDir(EFalse);
+
+    // check if any directories and ask recursion
+    for (TInt i=0; i<iCurrentSelectionList->Count(); i++)
+        {
+        TFileEntry fileEntry = iCurrentSelectionList->At(i);
+
+        if (fileEntry.iEntry.IsDir())
+            {
+            isDir = ETrue;
+            break;
+            }
+        }
+    return isDir;
+}
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::TouchL(TBool aRecurse)
+    {
+    // now go through all entries
+    for (TInt i=0; i<iCurrentSelectionList->Count(); i++)
+        {
+        TFileEntry fileEntry = iCurrentSelectionList->At(i);
+
+        // touch to current time
+        TTime now;
+        now.UniversalTime();
+
+
+        // append the new command to the command array
+        if (fileEntry.iEntry.IsDir() && aRecurse)
+            {
+            AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
+                                  new(ELeave)CCommandParamsAttribs(fileEntry, NULL, NULL, now, CFileMan::ERecurse)
+                                 );
+            }
+        else
+            {
+            AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
+                                  new(ELeave)CCommandParamsAttribs(fileEntry, NULL, NULL, now, 0)
+                                 );
+            }
+        }
+
+    // execute all operations
+    StartExecutingCommandsL(_L("Touching"));
+    }
+
+TBool CFileBrowserFileUtils::TargetExists(const TInt aIndex, const TFileName &newName)
+    {
+    TBool alreadyExists(EFalse);
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+
+        TFileEntry fileEntry = iFileEntryList->At(aIndex);
+        TFileName targetEntry = fileEntry.iPath;
+        targetEntry.Append(newName);
+        if (fileEntry.iEntry.IsDir())
+            {
+            //targetEntry.Append(_L("\\"));
+            alreadyExists = BaflUtils::PathExists(iFs, targetEntry);
+            }
+        else
+            {
+            alreadyExists = BaflUtils::FileExists(iFs, targetEntry);
+            }
+        }
+    return alreadyExists;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::RenameL(const TInt aIndex, const TFileName &newName)
+    {
+        if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+            TFileEntry fileEntry = iFileEntryList->At(aIndex);
+
+            TFileName targetEntry = fileEntry.iPath;
+            targetEntry.Append(newName);
+
+            // append the new command to the command array
+            AppendToCommandArrayL(EFileBrowserFileOpCommandRename,
+                                  new(ELeave)CCommandParamsRename(fileEntry, targetEntry, CFileMan::EOverWrite)
+                                 );
+        }
+    // execute all operations done from caller
+    // StartExecutingCommandsL(_L("Renaming"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetAttributesL()
+    {
+//    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
+//    GetSelectedItemsOrCurrentItemL(entries);
+//    CleanupStack::PushL(entries);
+//
+//    if (entries->Count() > 0)
+//        {
+//        TFileName naviText = _L("Multiple entries");
+//
+//        TUint setAttMask(0);
+//        TUint clearAttMask(0);
+//        //TBool recurse(EFalse);
+//
+//        // set default masks if only one file selected
+//        if (entries->Count() == 1)
+//            {
+//            TFileEntry fileEntry = entries->At(0);
+//
+//            naviText.Copy(fileEntry.iEntry.iName);
+//
+//            if (fileEntry.iEntry.IsArchive())
+//                setAttMask |= KEntryAttArchive;
+//            else
+//                clearAttMask |= KEntryAttArchive;
+//
+//            if (fileEntry.iEntry.IsHidden())
+//                setAttMask |= KEntryAttHidden;
+//            else
+//                clearAttMask |= KEntryAttHidden;
+//
+//            if (fileEntry.iEntry.IsReadOnly())
+//                setAttMask |= KEntryAttReadOnly;
+//            else
+//                clearAttMask |= KEntryAttReadOnly;
+//
+//            if (fileEntry.iEntry.IsSystem())
+//                setAttMask |= KEntryAttSystem;
+//            else
+//                clearAttMask |= KEntryAttSystem;
+//            }
+//
+        //iEngine->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
+        //iEngine->FileListContainer()->SetNaviPaneTextL(naviText);
+
+        //CFileBrowserAttributeEditorDlg* dlg = CFileBrowserAttributeEditorDlg::NewL(setAttMask, clearAttMask, recurse);
+        //TBool dlgResult = dlg->RunEditorLD();
+
+        //iEngine->FileListContainer()->SetScreenLayoutL(iEngine->Settings().iDisplayMode);
+        //iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);        
+//
+//        if (dlgResult && (setAttMask > 0 || clearAttMask > 0))
+//            {
+//            for (TInt i=0; i<entries->Count(); i++)
+//                {
+//                TFileEntry fileEntry = entries->At(i);
+//
+//                // append the new command to the command array
+//                if (fileEntry.iEntry.IsDir() && recurse)
+//                    {
+//                    AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
+//                                          new(ELeave)CCommandParamsAttribs(fileEntry, setAttMask, clearAttMask, fileEntry.iEntry.iModified, CFileMan::ERecurse)
+//                                         );
+//                    }
+//                else
+//                    {
+//                    AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
+//                                          new(ELeave)CCommandParamsAttribs(fileEntry, setAttMask, clearAttMask, fileEntry.iEntry.iModified, 0)
+//                                         );
+//                    }
+//                }
+//
+//            // execute all operations
+//            StartExecutingCommandsL(_L("Changing attributes"));
+//            }
+//
+//        }
+//
+//    CleanupStack::PopAndDestroy(); //entries
+    }
+       
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SearchL()
+    {
+//    iEngine->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
+//    iEngine->FileListContainer()->SetNaviPaneTextL(KNullDesC);
+//
+//    iSearchAttributes.iSearchDir = iCurrentPath;
+//
+//    CFileBrowserSearchQueryDlg* dlg = CFileBrowserSearchQueryDlg::NewL(iSearchAttributes);
+//    TBool dlgResult = dlg->RunQueryLD();
+//
+//    iEngine->FileListContainer()->SetScreenLayoutL(iEngine->Settings().iDisplayMode);
+//    iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+//
+//    if (dlgResult)
+//        {
+//        iEngine->EikonEnv()->BusyMsgL(_L("** Searching **"), TGulAlignment(EHCenterVTop));
+//
+//        iFileEntryList->Reset();
+//
+//        // if search dir is empty, find from all drives
+//        if (iSearchAttributes.iSearchDir == KNullDesC)
+//            {
+//            for (TInt i=0; i<iDriveEntryList->Count(); i++)
+//                {
+//                TDriveEntry driveEntry = iDriveEntryList->At(i);
+//
+//                TBuf<10> driveRoot;
+//                driveRoot.Append(driveEntry.iLetter);
+//                driveRoot.Append(_L(":\\"));
+//
+//                DoSearchFiles(iSearchAttributes.iWildCards, driveRoot);
+//
+//                if (iSearchAttributes.iRecurse)
+//                    DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, driveRoot);
+//
+//                }
+//
+//            }
+//
+//        // otherwise just search from the selected directory
+//        else
+//            {
+//            DoSearchFiles(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
+//
+//            if (iSearchAttributes.iRecurse)
+//                DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
+//            }
+//
+//        iEngine->EikonEnv()->BusyMsgCancel();
+//
+//        TInt operations = iFileEntryList->Count();
+//
+//        iListingMode = ESearchResults;
+//        iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
+//        RefreshViewL();
+//
+//        _LIT(KMessage, "%d entries found");
+//        TFileName noteMsg;
+//        noteMsg.Format(KMessage, operations);
+//
+//        iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+//        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::DoSearchFiles(const TDesC& aFileName, const TDesC& aPath)
+    {
+    TFindFile fileFinder(iFs);
+    CDir* dir;
+    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
+
+    while (err == KErrNone)
+        {
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+            
+            TTime entryModified = entry.iModified;
+            // convert from universal time
+            if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
+                {
+                entryModified = entry.iModified;
+                }
+            if ((entry.IsDir() && entryModified >= iSearchAttributes.iMinDate && entryModified <= iSearchAttributes.iMaxDate) ||
+                (!entry.IsDir() &&entry.iSize >= iSearchAttributes.iMinSize && entry.iSize <= iSearchAttributes.iMaxSize &&
+                 entryModified >= iSearchAttributes.iMinDate && entryModified <= iSearchAttributes.iMaxDate))
+                {
+                TParse parsedName;
+                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
+                
+                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
+                    {
+                    TFileEntry fileEntry;
+                    fileEntry.iPath = parsedName.DriveAndPath();
+                    fileEntry.iEntry = entry;
+                    fileEntry.iDirEntries = KErrNotFound;
+                    
+                    TBool appendToArray(EFalse);
+                    
+                    // append directories always
+                    if (entry.IsDir() && !iSearchAttributes.iTextInFile.Length())
+                        {
+                        fileEntry.iIconId = EFixedIconFolder;
+                        appendToArray = ETrue;    
+                        }
+                    
+                    // normal file
+                    else
+                        {
+                        fileEntry.iIconId = EFixedIconEmpty;
+                        
+                        // check if a string needs to be found inside the file
+                        if (iSearchAttributes.iTextInFile.Length())
+                            {
+                            // currently only 8-bit searching, so convert from 16-bit
+                            TBuf8<256> searchText;
+                            searchText.Copy(iSearchAttributes.iTextInFile);
+                            
+                            // specify buffer size and create a buffer
+                            const TInt KReadBufSize = 1024*1024;
+                            HBufC8* buffer = HBufC8::NewLC(KReadBufSize);
+                            TPtr8 bufferPtr = buffer->Des();
+
+                            // open the file for reading
+                            RFile file;
+                            if (file.Open(iFs, parsedName.FullName(), EFileRead) == KErrNone)
+                                {
+                                TInt currentPos(0);
+                                
+                                for (;;)
+                                    {
+                                    // read from the file
+                                    file.Read(currentPos, bufferPtr, KReadBufSize);
+
+                                    // stop looping if the read buffer isn't long enough
+                                    if (bufferPtr.Length() < searchText.Length())
+                                        {
+                                        break;
+                                        }
+                                        
+                                    // try to find the text
+                                    if (bufferPtr.FindF(searchText) >= 0)
+                                        {
+                                        // match found!
+                                        appendToArray = ETrue;
+                                        break;
+                                        }
+                                        
+                                    // calculate the next position
+                                    currentPos += KReadBufSize - searchText.Length();    
+                                    }
+                                
+                                file.Close();
+                                }
+                            
+                            CleanupStack::PopAndDestroy(); //buffer
+                            }
+                        else
+                            {
+                            appendToArray = ETrue;
+                            }
+                        }
+
+                    if (appendToArray)
+                        TRAP(err, iFileEntryList->AppendL(fileEntry));    
+                    }
+                }
+            }
+
+        delete dir;
+        err = fileFinder.FindWild(dir);
+        }
+
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::DoSearchFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
+	{
+    TInt err(KErrNone);
+    CDirScan* scan = CDirScan::NewLC(iFs);
+    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst);
+    CDir* dir = NULL;
+
+    for(;;)
+        {
+        TRAP(err, scan->NextL(dir));
+        if (!dir  || (err != KErrNone))
+            break;
+
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+            
+            if (entry.IsDir())
+                {
+                TFileName path(scan->FullPath());
+                
+                if (path.Length())
+                    {
+                    path.Append(entry.iName);
+                    path.Append(_L("\\"));
+                    DoSearchFiles(aFileName, path);
+                    }
+                }
+            }
+        delete(dir);
+        }
+
+    CleanupStack::PopAndDestroy(scan);
+    return err;
+    }
+         
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::NewFileL(const TFileName &aNewFileName)
+    {
+    TFileName fullPath = iCurrentPath;
+    fullPath.Append(aNewFileName);
+
+    TParse nameParser;
+    TInt err = nameParser.SetNoWild(fullPath, NULL, NULL);
+
+    if (err == KErrNone)
+        {
+        // do not try to recreate the file if it already exists
+        if (BaflUtils::PathExists(iFs, nameParser.DriveAndPath()))
+            {
+            err = iFileOps->CreateEmptyFile(fullPath);
+            }
+        else
+            err = KErrAlreadyExists;
+        }
+
+    if (err == KErrNone)
+        {
+        iEngine->FileBrowserUI()->ShowConfirmationNote(_L("New file created"));
+        }
+
+    else if (err == KErrAlreadyExists)
+        {
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("File already exists"), _L(""));
+        }
+
+    else
+        {
+        CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+        iEngine->FileBrowserUI()->ShowErrorNote( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+        CleanupStack::PopAndDestroy();  //textResolver
+        }
+
+    RefreshViewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::NewDirectoryL(const TFileName &aNewDirectoryName)
+    {       
+    TFileName fullPath = iCurrentPath;
+    fullPath.Append(aNewDirectoryName);
+    fullPath.Append(_L("\\"));
+
+    TInt err = iFileOps->MkDirAll(fullPath, 0, ETrue);
+
+    if (err == KErrNone)
+        {
+        iEngine->FileBrowserUI()->ShowConfirmationNote(_L("New directory created"));
+        }
+
+    else if (err == KErrAlreadyExists)
+        {
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Directory already exists"), _L(""));
+        }
+
+    else
+        {
+        CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+        iEngine->FileBrowserUI()->ShowErrorNote( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+        CleanupStack::PopAndDestroy();  //textResolver
+        }
+
+    RefreshViewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SendToL()
+    {
+//    CFileEntryList* entries = new(ELeave) CFileEntryList(32);
+//    GetSelectedItemsOrCurrentItemL(entries);
+//    CleanupStack::PushL(entries);
+//
+//    TInt operations(0);
+//
+//    CSendUi* sendUi = CSendUi::NewL();
+//    CleanupStack::PushL(sendUi);
+//    CMessageData* messageData = CMessageData::NewL();
+//    CleanupStack::PushL(messageData);
+//
+//    for (TInt i=0; i<entries->Count(); i++)
+//        {
+//        TFileEntry fileEntry = entries->At(i);
+//
+//        // only supported for normal file entries
+//        if (!fileEntry.iEntry.IsDir())
+//            {
+//            TFileName fullPath = fileEntry.iPath;
+//            fullPath.Append(fileEntry.iEntry.iName);
+//
+//            messageData->AppendAttachmentL(fullPath);
+//            operations++;
+//
+//            }
+//        }
+//
+//    if (operations > 0)
+//        {
+//        sendUi->ShowQueryAndSendL(messageData, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments));
+//
+//        // I guess this note is not needed..
+////        _LIT(KMessage, "%d entries sent");
+////        TFileName noteMsg;
+////        noteMsg.Format(KMessage, operations);
+////
+////        iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg);
+//        }
+//    else
+//        {
+//        _LIT(KMessage, "Nothing to send");
+//        iEngine->FileBrowserUI()->ShowInformationNote(KMessage, _L(""));
+//        }
+//
+//    CleanupStack::PopAndDestroy(3); // entries, sendUi, messageData
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::CompressL()
+    {
+//    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
+//    GetSelectedItemsOrCurrentItemL(entries);
+//    CleanupStack::PushL(entries);
+//
+//    for (TInt i=0; i<entries->Count(); i++)
+//        {
+//        TFileEntry fileEntry = entries->At(i);
+//
+//        TFileName sourceEntry = fileEntry.iPath;
+//        sourceEntry.Append(fileEntry.iEntry.iName);
+//
+//        TFileName targetEntry = sourceEntry;
+//        targetEntry.Append(KGZipExt);
+//
+//        TFileName targetEntryShort;
+//        targetEntryShort.Copy(fileEntry.iEntry.iName);
+//        targetEntryShort.Append(KGZipExt);
+//
+//        if (BaflUtils::FileExists(iFs, targetEntry))
+//            {
+//            _LIT(KMessage, "%S already exists");
+//            TFileName noteMsg;
+//            noteMsg.Format(KMessage, &targetEntryShort);
+//
+//            iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+//            }
+//        else
+//            {
+//            TRAPD(err,
+//                RFile inputFile;
+//                User::LeaveIfError(inputFile.Open(iFs, sourceEntry, EFileStream | EFileRead | EFileShareAny));
+//                CleanupClosePushL(inputFile);
+//
+//                CEZFileToGZip* gZip = CEZFileToGZip::NewLC(iFs, targetEntry, inputFile);
+//
+//                while (gZip->DeflateL())
+//                    ;
+//
+//                CleanupStack::PopAndDestroy(2); //inputFile, gZip
+//                );
+//
+//             if (err == KErrNone)
+//                {
+//                _LIT(KMessage, "%S created succesfully");
+//                TFileName noteMsg;
+//                noteMsg.Format(KMessage, &targetEntryShort);
+//
+//                iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg);
+//                }
+//             else
+//                {
+//                _LIT(KMessage, "Unable to create %S");
+//                TFileName noteMsg;
+//                noteMsg.Format(KMessage, &targetEntryShort);
+//
+//                iEngine->FileBrowserUI()->ShowErrorNote(noteMsg);
+//                }
+//
+//            RefreshViewL();
+//            }
+//        }
+//
+//    CleanupStack::PopAndDestroy(); //entries
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DecompressL()
+    {
+//    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
+//    GetSelectedItemsOrCurrentItemL(entries);
+//    CleanupStack::PushL(entries);
+//
+//    for (TInt i=0; i<entries->Count(); i++)
+//        {
+//        TFileEntry fileEntry = entries->At(i);
+//
+//        TFileName sourceEntry = fileEntry.iPath;
+//        sourceEntry.Append(fileEntry.iEntry.iName);
+//
+//        TFileName targetEntry;
+//        TFileName targetEntryShort;
+//
+//        TInt sourceNameLen = fileEntry.iEntry.iName.Length();
+//        TInt gZipExtLen = KGZipExt().Length();
+//
+//        if (sourceNameLen > gZipExtLen && sourceEntry.Right(gZipExtLen).CompareF(KGZipExt) == 0)
+//            {
+//            targetEntry = sourceEntry.Left(sourceEntry.Length() - gZipExtLen);
+//            targetEntryShort = fileEntry.iEntry.iName.Left(sourceNameLen - gZipExtLen);
+//
+//            if (BaflUtils::FileExists(iFs, targetEntry))
+//                {
+//                _LIT(KMessage, "%S already exists");
+//                TFileName noteMsg;
+//                noteMsg.Format(KMessage, &targetEntryShort);
+//
+//                iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+//                }
+//            else
+//                {
+//                TRAPD(err,
+//                    RFile outputFile;
+//                    User::LeaveIfError(outputFile.Create(iFs, targetEntry, EFileStream | EFileWrite | EFileShareExclusive));
+//                    CleanupClosePushL(outputFile);
+//
+//                    CEZGZipToFile* gZip = CEZGZipToFile::NewLC(iFs, sourceEntry, outputFile);
+//
+//                    while (gZip->InflateL())
+//                        ;
+//
+//                    CleanupStack::PopAndDestroy(2); //outputFile, gZip
+//                    );
+//
+//                 if (err == KErrNone)
+//                    {
+//                    _LIT(KMessage, "%S decompressed succesfully");
+//                    TFileName noteMsg;
+//                    noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
+//
+//                    iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg);
+//                    }
+//                 else
+//                    {
+//                    _LIT(KMessage, "Unable to decompress %S");
+//                    TFileName noteMsg;
+//                    noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
+//
+//                    iEngine->FileBrowserUI()->ShowErrorNote(noteMsg);
+//                    }
+//
+//                RefreshViewL();
+//                }
+//            }
+//        else
+//            {
+//            _LIT(KMessage, "%S does not have %S extension");
+//            TFileName noteMsg;
+//            noteMsg.Format(KMessage, &fileEntry.iEntry.iName, &KGZipExt);
+//
+//            iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+//            }
+//        }
+//
+//    CleanupStack::PopAndDestroy(); //entries
+    }
+
+// --------------------------------------------------------------------------------------------
+
+bool CFileBrowserFileUtils::PropertiesL(TInt aCurrentItemIndex, CDesCArray* entryLines, TFileName &titleText)
+    {
+
+    TBool showDialog(EFalse);
+    
+    _LIT(KPropertiesEntryStr,       "%S\t%S");
+    _LIT(KPropertiesEntryInt,       "%S\t%d");
+    _LIT(KPropertiesEntryUintHex,   "%S\t0x%x");
+    
+    _LIT(KDateFormat,               "%D%M%Y%/0%1%/1%2%/2%3%/3");
+    _LIT(KTimeFormat,               "%-B%:0%J%:1%T%:2%S%:3%+B");
+    
+    _LIT(KMediaType,                "Media");
+    _LIT(KAttributes,               "Atts");
+    _LIT(KVolumeName,               "Name");
+    _LIT(KUniqueID,                 "ID");
+    _LIT(KNumberOfEntries,          "Entries");
+    _LIT(KNumberOfFiles,            "Files");
+    _LIT(KUsed,                     "Used (B)");
+    _LIT(KFree,                     "Free (B)");
+    _LIT(KSize,                     "Size (B)");
+    _LIT(KPath,                     "Path");
+    _LIT(KDate,                     "Date");
+    _LIT(KTime,                     "Time");
+    _LIT(KMimeType,                 "Mime");
+    _LIT(KOpensWith,                "Opens");
+ 
+
+    // create an array for the items
+//    CDesCArray* entryLines = new(ELeave) CDesCArrayFlat(16);
+//    CleanupStack::PushL(entryLines);
+//    TFileName titleText;
+    
+    // just get current item
+//    TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+    
+    if (IsDriveListViewActive() && iDriveEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+        // it is a drive entry
+        TDriveEntry driveEntry = iDriveEntryList->At(aCurrentItemIndex);
+        TFileName textEntry;
+        
+        // set title
+        titleText.Append(driveEntry.iLetter);
+        titleText.Append(_L(":"));
+        
+        // media type
+        textEntry.Format(KPropertiesEntryStr, &KMediaType, &driveEntry.iMediaTypeDesc);
+        entryLines->AppendL(textEntry);
+
+        // attributes
+        textEntry.Format(KPropertiesEntryStr, &KAttributes, &driveEntry.iAttributesDesc);
+        entryLines->AppendL(textEntry);
+
+        // volume name
+        if (driveEntry.iVolumeInfo.iName.Length())
+            {
+            textEntry.Format(KPropertiesEntryStr, &KVolumeName, &driveEntry.iVolumeInfo.iName);
+            entryLines->AppendL(textEntry);
+            }
+
+        // unique id
+        textEntry.Format(KPropertiesEntryUintHex, &KUniqueID, driveEntry.iVolumeInfo.iUniqueID);
+        entryLines->AppendL(textEntry);
+        
+        // number of files
+        if (iEngine->Settings().iShowSubDirectoryInfo)
+            {
+            iFindFileEntryList->Reset();
+            
+            TBuf<10> driveRoot;
+            driveRoot.Append(driveEntry.iLetter);
+            driveRoot.Append(_L(":\\"));
+
+            DoFindFiles(_L("*"), driveRoot);
+            DoFindFilesRecursiveL(_L("*"), driveRoot);
+            
+            textEntry.Format(KPropertiesEntryInt, &KNumberOfFiles, iFindFileEntryList->Count());
+            entryLines->AppendL(textEntry);
+            
+            iFindFileEntryList->Reset();
+            }
+      
+        // used
+        TBuf<32> usedBuf;
+        usedBuf.AppendNum(driveEntry.iVolumeInfo.iSize-driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
+        textEntry.Format(KPropertiesEntryStr, &KUsed, &usedBuf);
+        entryLines->AppendL(textEntry);        
+
+        // free
+        TBuf<32> freeBuf;
+        freeBuf.AppendNum(driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
+        textEntry.Format(KPropertiesEntryStr, &KFree, &freeBuf);
+        entryLines->AppendL(textEntry);
+                
+        // size
+        TBuf<32> sizeBuf;
+        sizeBuf.AppendNum(driveEntry.iVolumeInfo.iSize, TRealFormat(KDefaultRealWidth, 0));
+        textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
+        entryLines->AppendL(textEntry);   
+
+        showDialog = ETrue;
+        }
+    
+    else if (iFileEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+        // it is a file or a directory entry
+        TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex);
+        TFileName textEntry;
+        
+        // set title
+        titleText.Append(fileEntry.iEntry.iName);
+        
+        // path
+        textEntry.Format(KPropertiesEntryStr, &KPath, &fileEntry.iPath);
+        entryLines->AppendL(textEntry);
+
+        // date
+        TTime entryModified = fileEntry.iEntry.iModified;
+        
+        // convert from universal time
+        if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
+            {
+            entryModified = fileEntry.iEntry.iModified; // use universal time
+            }
+        
+        TBuf<32> dateBuf;
+        entryModified.FormatL(dateBuf, KDateFormat);
+        textEntry.Format(KPropertiesEntryStr, &KDate, &dateBuf);
+        entryLines->AppendL(textEntry);
+
+        // time
+        TBuf<32> timeBuf;
+        entryModified.FormatL(timeBuf, KTimeFormat);
+        textEntry.Format(KPropertiesEntryStr, &KTime, &timeBuf);
+        entryLines->AppendL(textEntry);
+
+        if (!fileEntry.iEntry.IsDir())
+            {
+            // size
+            TBuf<32> sizeBuf;
+            sizeBuf.AppendNum(fileEntry.iEntry.iSize, TRealFormat(KDefaultRealWidth, 0));
+            textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
+            entryLines->AppendL(textEntry);            
+            }
+        else if (fileEntry.iEntry.IsDir() && iEngine->Settings().iShowSubDirectoryInfo)
+            {
+            iFindFileEntryList->Reset();
+            
+            TFileName fullPath;
+            fullPath.Append(fileEntry.iPath);
+            fullPath.Append(fileEntry.iEntry.iName);
+            fullPath.Append(_L("\\"));
+            
+            // number of entries
+            CDir* subDir = NULL;
+            if (iFs.GetDir(fullPath, KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
+                {
+                CleanupStack::PushL(subDir);
+                textEntry.Format(KPropertiesEntryInt, &KNumberOfEntries, subDir->Count());
+                entryLines->AppendL(textEntry);
+                CleanupStack::PopAndDestroy(); //subDir 
+                }
+            
+            // number of files
+            DoFindFiles(_L("*"), fullPath);
+            DoFindFilesRecursiveL(_L("*"), fullPath);
+            textEntry.Format(KPropertiesEntryInt, &KNumberOfFiles, iFindFileEntryList->Count());
+            entryLines->AppendL(textEntry);
+            
+            // size
+            TInt64 size(0);
+            for (TInt i=0; i<iFindFileEntryList->Count(); i++)
+                {
+                TFileEntry fileEntry = iFindFileEntryList->At(i);
+                size += fileEntry.iEntry.iSize;
+                }
+            
+            TBuf<32> sizeBuf;
+            sizeBuf.AppendNum(size, TRealFormat(KDefaultRealWidth, 0));
+            textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
+            entryLines->AppendL(textEntry); 
+            
+            iFindFileEntryList->Reset();            
+            }
+        
+        // attributes
+        TBuf<32> attBuf;
+        if (fileEntry.iEntry.IsArchive())
+            attBuf.Append(_L("Arc "));
+        if (fileEntry.iEntry.IsHidden())
+            attBuf.Append(_L("Hid "));
+        if (fileEntry.iEntry.IsReadOnly())
+            attBuf.Append(_L("R/O "));
+        if (fileEntry.iEntry.IsSystem())
+            attBuf.Append(_L("Sys"));
+        textEntry.Format(KPropertiesEntryStr, &KAttributes, &attBuf);
+        entryLines->AppendL(textEntry);            
+
+        if (!fileEntry.iEntry.IsDir())
+            {
+            // mime type
+            TFileName fullPath = fileEntry.iPath;
+            fullPath.Append(fileEntry.iEntry.iName);
+            TDataType dataType;
+            TUid appUid;
+            if (iEngine->LsSession().AppForDocument(fullPath, appUid, dataType) == KErrNone)
+                {
+                TBuf<128> mimeTypeBuf;
+                mimeTypeBuf.Copy(dataType.Des8());
+                if (mimeTypeBuf == KNullDesC)
+                    mimeTypeBuf.Copy(_L("N/A"));
+                textEntry.Format(KPropertiesEntryStr, &KMimeType, &mimeTypeBuf);
+                entryLines->AppendL(textEntry); 
+                }
+
+            // opens with
+            TApaAppInfo appInfo;
+            if (iEngine->LsSession().GetAppInfo(appInfo, appUid) == KErrNone)
+                {
+                TFileName opensWithBuf;
+                _LIT(KOpensWithFormat, "%S (0x%08X)");
+                opensWithBuf.Format(KOpensWithFormat, &appInfo.iCaption, appInfo.iUid);
+                textEntry.Format(KPropertiesEntryStr, &KOpensWith, &opensWithBuf);
+                entryLines->AppendL(textEntry); 
+                }
+            }
+        
+        showDialog = ETrue;
+        }   
+    return showDialog;
+
+//    if (showDialog)
+//        {
+//        CAknSingleHeadingPopupMenuStyleListBox* listBox = new(ELeave) CAknSingleHeadingPopupMenuStyleListBox;
+//        CleanupStack::PushL(listBox);
+//
+//        CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuDoubleWindow);
+//        CleanupStack::PushL(popupList);
+//
+//        listBox->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
+//        listBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
+//        listBox->CreateScrollBarFrameL(ETrue);
+//        listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+//        listBox->Model()->SetItemTextArray(entryLines);
+//        listBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
+//        listBox->HandleItemAdditionL();
+//
+//        popupList->SetTitleL(titleText);
+//        popupList->ExecuteLD();
+//
+//        CleanupStack::Pop(); // popupList
+//        CleanupStack::PopAndDestroy(); // listBox
+//        }
+//
+//        CleanupStack::PopAndDestroy(); //entryLines
+	}
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::OpenWithApparcL(TFileName aFileName)
+    {
+       
+        TFileName fullPath = aFileName;
+        TInt err1(KErrNone), err2(KErrNone);
+        TUid appUid;
+        TDataType dataType;
+        TBool isProgram;
+        
+	
+        err1 = iEngine->LsSession().AppForDocument(fullPath, appUid, dataType);
+        err2 = iEngine->LsSession().IsProgram(fullPath, isProgram);
+        
+        if (err1 == KErrNone && err2 == KErrNone)
+            {
+            if (appUid != KNullUid)
+                {
+                // found an app, run using it
+                TApaTaskList taskList(CEikonEnv::Static()->WsSession());
+                TApaTask task = (taskList.FindApp(appUid));
+                if (task.Exists())
+                    {
+                    User::LeaveIfError(task.SwitchOpenFile(fullPath));
+                    task.BringToForeground();
+                    }
+                else
+                    {
+                    TThreadId id;
+                    iEngine->LsSession().StartDocument(fullPath, appUid, id, RApaLsSession::ESwitchFiles);
+                    }
+                }
+            else if (isProgram)
+                {
+                LaunchProgramL(fullPath);
+                }            
+            }
+        //}   
+    }
+	
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::HandleServerAppExit(TInt aReason)
+	{
+//	if (iOpenFileService)
+//		{
+//		delete iOpenFileService;
+//		iOpenFileService = NULL;
+//		}
+	MAknServerAppExitObserver::HandleServerAppExit(aReason);
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed)
+    {
+        TFileName fullPath = aFileName;
+        RFile sharableFile;
+        iDocHandler->OpenTempFileL(fullPath, sharableFile);
+        CleanupClosePushL(sharableFile);
+        TDataType dataType;
+        if (aEmbed) 
+            {
+    	    iDocHandler->OpenFileEmbeddedL(sharableFile, dataType);
+            }
+        else
+            {
+    	    iDocHandler->OpenFileL(sharableFile, dataType);
+            }
+        CleanupStack::PopAndDestroy();  //sharableFile
+    //    }   
+    }
+
+	// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::OpenWithFileServiceL(TInt aCurrentItemIndex)
+    {
+    if (iFileEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+        TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex);
+        
+        TFileName fullPath = fileEntry.iPath;
+        fullPath.Append(fileEntry.iEntry.iName);
+
+    	TBool itemSelected(EFalse);
+        RFile sharableFile;
+//        TUid appUidExtracted;
+        
+        TRAPD(err,
+           
+        	// use doc handler to get a sharable file handle
+            iDocHandler->OpenTempFileL(fullPath, sharableFile);
+            CleanupClosePushL(sharableFile);
+            
+            // find the data type
+            TDataRecognitionResult dataType;
+        	User::LeaveIfError(iEngine->LsSession().RecognizeData(sharableFile, dataType));
+
+        	// get all apps that support OpenFileService for this datatype
+        	CApaAppServiceInfoArray* apps = iEngine->LsSession().GetServiceImplementationsLC(KOpenServiceUid, dataType.iDataType);
+        	TArray<TApaAppServiceInfo> appServiceInfos = apps->Array();
+    	
+        	if (appServiceInfos.Count() > 0)
+        		{
+        		// build an array of the app names
+        		CDesCArray* names = new (ELeave) CDesCArrayFlat(16);
+        		CleanupStack::PushL(names);
+        		for (TInt ii=0; ii<appServiceInfos.Count(); ii++)
+        			{
+        			TUid appUid = appServiceInfos[ii].Uid();
+        			TApaAppInfo appInfo;
+        			if (iEngine->LsSession().GetAppInfo(appInfo, appUid) == KErrNone)
+        				{
+        				names->AppendL(appInfo.iCaption);
+        				}
+        			else
+        				{
+        				TBuf<10> buf;
+        				buf.Format(_L("0x%08x"), appUid);
+        				names->AppendL(buf);
+        				}
+        			}
+    		
+        		// use a list query to select the app
+//        		TInt index(0);
+//        		CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
+//        		dlg->PrepareLC(R_APP_SELECTION_QUERY);
+//        		dlg->SetItemTextArray(names);
+//        		dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
+//
+//        		if(dlg->RunLD())
+//        			{
+//        			// extract the chosen UID
+//        			appUidExtracted = appServiceInfos[index].Uid();
+//        			itemSelected = ETrue;
+//        			}
+    		
+        		CleanupStack::PopAndDestroy(); // names
+        		}
+
+            if (itemSelected)
+                {
+                // start OpenFileService for the selected app
+                CAiwGenericParamList& paramList = iDocHandler->InParamListL();
+                
+//                if (iOpenFileService)
+//                    {
+//                    delete iOpenFileService;
+//                    iOpenFileService = NULL;
+//                    }
+
+//                iOpenFileService = CAknOpenFileService::NewL(appUidExtracted, sharableFile, this, &paramList);
+                }
+
+            CleanupStack::PopAndDestroy(2); // sharableFile, apps
+
+            ); // TRAPD
+
+        if (err != KErrNone)
+            {
+            _LIT(KMessage, "No file service available for %S");
+            TFileName noteMsg;
+            noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
+            
+            iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+            }
+        }   
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::FileExists(const TDesC& aPath)
+    {
+    return BaflUtils::FileExists(iFs, aPath);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::LaunchProgramL(const TDesC& aPath)
+    {
+    CApaCommandLine* commandLine = CApaCommandLine::NewLC();
+    commandLine->SetExecutableNameL(aPath);
+    commandLine->SetCommandL(EApaCommandRun);
+    TInt err = iEngine->LsSession().StartApp(*commandLine);
+    CleanupStack::PopAndDestroy(); //commandLine
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::MemoryInfoPopupL()
+    {
+    _LIT(KUsedBytesEntry, "Used: %S bytes\n");
+    _LIT(KFreeBytesEntry, "Free: %S bytes\n");
+    _LIT(KSizeBytesEntry, "Size: %S bytes\n");
+        
+    HBufC* messageBuf = HBufC::NewLC(2048);
+    TPtr messagePtr = messageBuf->Des();
+    TBuf<128> entryLine;
+
+    // RAM
+    TMemoryInfoV1Buf ramMemory;
+    UserHal::MemoryInfo(ramMemory);
+    messagePtr.Append(_L("RAM\n"));
+
+    // used
+    TBuf<32> usedBuf;
+    usedBuf.AppendNum(ramMemory().iMaxFreeRamInBytes-ramMemory().iFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
+    entryLine.Format(KUsedBytesEntry, &usedBuf);
+    messagePtr.Append(entryLine);        
+
+    // free
+    TBuf<32> freeBuf;
+    freeBuf.AppendNum(ramMemory().iFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
+    entryLine.Format(KFreeBytesEntry, &freeBuf);
+    messagePtr.Append(entryLine);
+            
+    // size
+    TBuf<32> sizeBuf;
+    sizeBuf.AppendNum(ramMemory().iMaxFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
+    entryLine.Format(KSizeBytesEntry, &sizeBuf);
+    messagePtr.Append(entryLine); 
+    
+    // All drives
+    for (TInt i=0; i<iDriveEntryList->Count(); i++)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(i);
+
+        messagePtr.Append(_L("\n"));
+        messagePtr.Append(driveEntry.iLetter);
+        messagePtr.Append(_L(":\n"));
+
+        // used
+        TBuf<32> usedBuf;
+        usedBuf.AppendNum(driveEntry.iVolumeInfo.iSize-driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
+        entryLine.Format(KUsedBytesEntry, &usedBuf);
+        messagePtr.Append(entryLine);        
+
+        // free
+        TBuf<32> freeBuf;
+        freeBuf.AppendNum(driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
+        entryLine.Format(KFreeBytesEntry, &freeBuf);
+        messagePtr.Append(entryLine);
+                
+        // size
+        TBuf<32> sizeBuf;
+        sizeBuf.AppendNum(driveEntry.iVolumeInfo.iSize, TRealFormat(KDefaultRealWidth, 0));
+        entryLine.Format(KSizeBytesEntry, &sizeBuf);
+        messagePtr.Append(entryLine); 
+        }
+
+//    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+//    dialog->PrepareLC(R_MEMORYINFO_DIALOG);
+//    dialog->SetMessageTextL(messagePtr);
+//    dialog->RunLD();
+    
+    CleanupStack::PopAndDestroy(); //messageBuf
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ShowFileCheckSumsL(TInt aCurrentItemIndex, TInt aType)
+    {
+    if (iFileEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+        TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex);
+        TFileName fullPath = fileEntry.iPath;
+        fullPath.Append(fileEntry.iEntry.iName);
+        
+        // try to open the file for reading
+        RFile fileP;
+        TInt err = fileP.Open(iEngine->EikonEnv()->FsSession(), fullPath, EFileRead|EFileShareReadersOnly);
+        
+        if (err == KErrNone)
+            {
+            CleanupClosePushL(fileP);
+
+            TBuf<128> checkSum;
+            HBufC* messageBuf = HBufC::NewLC(2048);
+            TPtr messagePtr = messageBuf->Des();
+            
+            // get MD5 checksum
+            if (aType == EFileChecksumsMD5)
+                {
+                CMD5* md5 = CMD5::NewL();
+                CleanupStack::PushL(md5);
+                HBufC8* md5Buf = MessageDigestInHexLC(md5, fileP);
+                checkSum.Copy(*md5Buf);
+                messagePtr.Append(_L("MD5\n"));
+                messagePtr.Append(checkSum);
+                CleanupStack::PopAndDestroy(2); // md5, md5Buf
+                }
+
+            // get MD2 checksum
+            else if (aType == EFileChecksumsMD2)
+                {                
+                CMD2* md2 = CMD2::NewL();
+                CleanupStack::PushL(md2);
+                HBufC8* md2Buf = MessageDigestInHexLC(md2, fileP);
+                checkSum.Copy(*md2Buf);
+                messagePtr.Append(_L("MD2\n"));
+                messagePtr.Append(checkSum);
+                CleanupStack::PopAndDestroy(2); // md2, md2Buf
+                }
+
+            // get SHA-1 checksum
+            else if (aType == EFileChecksumsSHA1)
+                {
+                CSHA1* sha1 = CSHA1::NewL();
+                CleanupStack::PushL(sha1);
+                HBufC8* sha1Buf = MessageDigestInHexLC(sha1, fileP);
+                checkSum.Copy(*sha1Buf);
+                messagePtr.Append(_L("SHA-1\n"));
+                messagePtr.Append(checkSum);
+                CleanupStack::PopAndDestroy(2); // sha1, sha1Buf
+                }
+            
+            else
+                {
+                User::Panic(_L("Inv.CS.Type"), 723);
+                }
+                            
+            // show dialog
+            iEngine->FileBrowserUI()->ShowInformationNote(messagePtr, fileEntry.iEntry.iName);
+
+            CleanupStack::PopAndDestroy(2); // messageBuf, fileP
+            }
+        else
+            {
+            // open failed, show an error note
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+HBufC8* CFileBrowserFileUtils::MessageDigestInHexLC(CMessageDigest* aMD, RFile& aFile)
+    {
+    // seek to file start
+    TInt startPos(0);
+    aFile.Seek(ESeekStart, startPos);
+
+    // create result buffer
+    HBufC8* result = HBufC8::NewLC(128);
+
+    const TInt KBufSize(1024);
+    TInt fileSize(0);
+    TInt fileOffset(0);
+
+    // get file size
+    aFile.Size(fileSize);
+
+    HBufC8* buf = HBufC8::NewMaxLC(KBufSize);
+    TPtr8 bufPtr(buf->Des());
+
+    // read to buffer
+    while (fileOffset < fileSize - KBufSize)
+        {
+        aFile.Read(bufPtr, KBufSize);
+        aMD->Hash(bufPtr);
+        fileOffset += bufPtr.Length();
+        }
+
+    aFile.Read(bufPtr, fileSize - fileOffset);
+    bufPtr.SetLength(fileSize - fileOffset);
+    
+    // get final message digest
+    TPtrC8 hashedSig(aMD->Final(bufPtr));
+    
+    // change size of the result buffer
+    result->ReAllocL(hashedSig.Length() * 2);
+    TPtr8 resultPtr = result->Des();
+
+    // convert to hex format
+    for (TInt i=0; i<hashedSig.Length(); i++)
+        {
+        resultPtr.AppendFormat(_L8("%+02x"), hashedSig[i]);
+        }
+                    
+    CleanupStack::PopAndDestroy(); // buf
+    
+    return result;
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetErrRdL(TBool aEnable)
+    {
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        TInt err(KErrNone);
+        
+        if (aEnable)
+            {
+            // make sure that the directory exists
+            iFileOps->MkDirAll(KErrRdPath);        
+
+            // create the file
+            err = iFileOps->CreateEmptyFile(KErrRdPath);
+            }
+        else    
+            {
+            // get TEntry of ErrRd
+            TEntry entry;
+            err = iFs.Entry(KErrRdPath, entry);
+            
+            if (err == KErrNone)
+                {
+                TFileEntry fileEntry;
+                fileEntry.iPath = KErrRdDir;
+                fileEntry.iEntry = entry;
+                
+                err = iFileOps->Delete(fileEntry);                
+                }
+            }        
+
+        // update view
+        RefreshViewL(); 
+    
+        if (err == KErrNone)    
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("State changed"));
+            }
+        else    
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Cannot change the state"));
+            }        
+        }
+    else
+        {
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Enable \"bypass platform security\" from the settings first"), _L(""));
+        }
+    #else
+        aEnable = aEnable;
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Not supported in lite version"), _L(""));
+    #endif
+    }
+
+// --------------------------------------------------------------------------------------------
+
+//void CFileBrowserFileUtils::EnableAvkonIconCacheL(TBool aEnable)
+//    {
+//#ifndef __SERIES60_30__
+//    if (AknIconConfig::EnableAknIconSrvCache(aEnable) == KErrNone)
+//        {
+//        iEngine->FileBrowserUI()->ShowConfirmationNote(_L("State changed"));
+//        }
+//    else
+//        {
+//        iEngine->FileBrowserUI()->ShowErrorNote(_L("Unknown error occured"));
+//        }
+// #else
+//    aEnable = aEnable;
+//    iEngine->FileBrowserUI()->ShowInformationNote(_L("Not supported in S60 3.0"), _L(""));
+// #endif
+// 
+//    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SimulateLeaveL(TInt aLeaveCode)
+    {
+    User::Leave(aLeaveCode);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SimulatePanicL(const TDesC& aPanicCategory, TInt aPanicCode)
+    {
+    User::Panic(aPanicCategory, aPanicCode);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SimulateExceptionL(TInt aExceptionCode)
+    {
+    User::RaiseException((TExcType)aExceptionCode);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TUint32 CFileBrowserFileUtils::GetDebugMask()
+    {
+    return UserSvr::DebugMask();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetDebugMaskL(TUint32 aDbgMask)
+    {
+    User::SetDebugMask(aDbgMask);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::WriteAllAppsL()
+    {
+    _LIT(KAllAppsFileName, "AllApps.txt");
+    TFileName allAppsPath = PathInfo::PhoneMemoryRootPath();
+    allAppsPath.Append(KAllAppsFileName);
+
+    RFile file;
+    if (file.Replace(iFs, allAppsPath, EFileWrite) == KErrNone)
+        {
+        CleanupClosePushL(file);
+        
+        CDesC8Array* appsArray = new(ELeave) CDesC8ArrayFlat(192);
+        CleanupStack::PushL(appsArray);
+        
+        TBuf8<KMaxFileName> fileEntry;
+        TBuf8<KMaxFileName> appFullPath;
+        _LIT8(KAppEntryFormat, "%S (0x%08X)%S");
+        TApaAppInfo appInfo;
+
+        iEngine->LsSession().GetAllApps();        
+
+        while (iEngine->LsSession().GetNextApp(appInfo) == KErrNone)
+            {
+            appFullPath.Copy(appInfo.iFullName);
+            fileEntry.Format(KAppEntryFormat, &appFullPath, appInfo.iUid, &KFileNewLine);
+            appsArray->AppendL(fileEntry);    
+            }
+        
+        appsArray->Sort();
+        
+        for (TInt i=0; i<appsArray->Count(); i++)
+            {
+            file.Write(appsArray->MdcaPoint(i));
+            }
+        
+        CleanupStack::PopAndDestroy(2); //appsArray, file
+        
+        _LIT(KMessage, "App list written to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allAppsPath);
+
+        iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg, ETrue); // NoTimeout
+        }
+    else
+        {
+        _LIT(KMessage, "Failed writing to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allAppsPath);
+
+        iEngine->FileBrowserUI()->ShowErrorNote(noteMsg, ETrue); // NoTimeout
+        }    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::WriteAllFilesL()
+    {
+    _LIT(KAllFilesFileName, "AllFiles.txt");
+    TFileName allFilesPath = PathInfo::PhoneMemoryRootPath();
+    allFilesPath.Append(KAllFilesFileName);
+
+    RFile file;
+    if (file.Replace(iFs, allFilesPath, EFileWrite) == KErrNone)
+        {
+        CleanupClosePushL(file);
+        iFindFileEntryList->Reset();
+        
+        iEngine->EikonEnv()->BusyMsgL(_L("** Generating **"), TGulAlignment(EHCenterVTop));
+        
+        for (TInt i=0; i<iDriveEntryList->Count(); i++)
+            {
+            TDriveEntry driveEntry = iDriveEntryList->At(i);
+
+            TBuf<10> driveRoot;
+            driveRoot.Append(driveEntry.iLetter);
+            driveRoot.Append(_L(":\\"));
+
+            // current dir
+            DoFindFiles(_L("*"), driveRoot);
+            
+            // recurse into sub directories
+            DoFindFilesRecursiveL(_L("*"), driveRoot);
+            }
+        
+        // write entries
+        TBuf8<KMaxFileName> writeBuf;
+        for (TInt i=0; i<iFindFileEntryList->Count(); i++)
+            {
+            TFileEntry fileEntry = iFindFileEntryList->At(i);
+            
+            writeBuf.Copy(fileEntry.iPath);
+            writeBuf.Append(fileEntry.iEntry.iName);
+            writeBuf.Append(KFileNewLine);
+            
+            file.Write(writeBuf);
+            }
+        
+        iEngine->EikonEnv()->BusyMsgCancel();
+        
+        CleanupStack::PopAndDestroy(); //file
+        iFindFileEntryList->Reset();
+        
+        _LIT(KMessage, "File list written to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allFilesPath);
+
+        iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg, ETrue); // NoTimeout
+        }
+    else
+        {
+        _LIT(KMessage, "Failed writing to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allFilesPath);
+
+        iEngine->FileBrowserUI()->ShowErrorNote(noteMsg, ETrue); // NoTimeout
+        }    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::DoFindFiles(const TDesC& aFileName, const TDesC& aPath)
+    {
+    TFindFile fileFinder(iFs);
+    CDir* dir;
+    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
+
+    while (err == KErrNone)
+        {
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+
+            // ignore any directory entries
+            if (!entry.IsDir() && entry.iName.Length() && aPath.Length())
+                {
+                TParse parsedName;
+                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
+                
+                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
+                    {
+                    TFileEntry fileEntry;
+                    fileEntry.iPath = parsedName.DriveAndPath();
+                    fileEntry.iEntry = entry;
+                    fileEntry.iDirEntries = KErrNotFound;
+                    fileEntry.iIconId = EFixedIconEmpty;
+                    
+                    TRAP(err, iFindFileEntryList->AppendL(fileEntry));             
+                    }
+                }
+            }
+
+        delete dir;
+        dir = NULL;
+        err = fileFinder.FindWild(dir);
+        }
+
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CFileBrowserFileUtils::DoFindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
+	{
+    TInt err(KErrNone);
+    CDirScan* scan = CDirScan::NewLC(iFs);
+    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst);
+    CDir* dir = NULL;
+
+    for(;;)
+        {
+        TRAP(err, scan->NextL(dir));
+        if (!dir  || (err != KErrNone))
+            break;
+
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+            
+            if (entry.IsDir())
+                {
+                TFileName path(scan->FullPath());
+                
+                if (path.Length())
+                    {
+                    path.Append(entry.iName);
+                    path.Append(_L("\\"));
+                    DoFindFiles(aFileName, path);
+                    }
+                }
+            }
+        delete(dir);
+        }
+
+    CleanupStack::PopAndDestroy(scan);
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ListOpenFilesL()
+    {
+    iFileEntryList->Reset();
+
+    CFileList* dir = NULL;
+    TOpenFileScan fileScan(iFs);
+    fileScan.NextL(dir);
+    
+    while (dir)
+        {
+        for (TInt i=0; i<dir->Count(); i++)
+            {
+            TEntry entry = (*dir)[i];
+            TFileName fullPath;
+
+            // TOpenFileScan does not return drive letters for the entries, so try to guess it
+            if (entry.iName.Length() > 2 && entry.iName[1] != ':')
+                {
+                for (TInt i=0; i<iDriveEntryList->Count(); i++)
+                    {
+                    TDriveEntry driveEntry = iDriveEntryList->At(i);
+                    
+                    TFileName guessPath;
+                    guessPath.Append(driveEntry.iLetter);
+                    guessPath.Append(_L(":"));
+                    guessPath.Append(entry.iName);
+                    
+                    // check if the file exists
+                    if (BaflUtils::FileExists(iFs, guessPath))
+                        {
+                        // if it's on read only drive, then take it or check if it's really in use
+                        TBool readOnlyDrive(ETrue);
+                        BaflUtils::DiskIsReadOnly(iFs, guessPath, readOnlyDrive);
+                        
+                        if (readOnlyDrive || iFs.SetEntry(guessPath, entry.iModified, NULL, NULL) == KErrInUse)
+                            {
+                            fullPath = guessPath;
+                            break;
+                            }
+                        }
+                    }
+                }
+            else
+                {
+                fullPath = entry.iName;   
+                }
+
+            TParse nameParser;
+            if (fullPath.Length() && nameParser.SetNoWild(fullPath, NULL, NULL) == KErrNone)
+                {
+                entry.iName = nameParser.NameAndExt();
+                
+                TFileEntry fileEntry;
+                fileEntry.iPath = nameParser.DriveAndPath();
+                fileEntry.iEntry = entry;
+                fileEntry.iDirEntries = KErrNotFound;
+                fileEntry.iIconId = EFixedIconEmpty;
+                
+                iFileEntryList->AppendL(fileEntry);                
+                }
+            }
+            
+        delete dir;
+        dir = NULL;
+        fileScan.NextL(dir);
+        }
+
+    TInt operations = iFileEntryList->Count();
+    
+    iListingMode = EOpenFiles;
+	// TODO
+    //iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
+    RefreshViewL();            
+
+    _LIT(KMessage, "%d open files found");
+    TFileName noteMsg;
+    noteMsg.Format(KMessage, operations);
+
+    iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ListMessageAttachmentsL(TInt aType)
+    {
+    iFileEntryList->Reset();
+
+    CMsvSession* session = CMsvSession::OpenSyncL(*this);
+    CleanupStack::PushL(session);
+    
+    CMsvEntry* context = NULL;
+    
+    if (aType == EFileBrowserCmdToolsMsgAttachmentsInbox)
+        context = session->GetEntryL(KMsvGlobalInBoxIndexEntryId);
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsDrafts)
+        context = session->GetEntryL(KMsvDraftEntryId);
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsSentItems)
+        context = session->GetEntryL(KMsvSentEntryId);
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsOutbox)
+        context = session->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+    else
+        User::Panic(_L("MsgAtt.Mode"), 100);
+    
+    CleanupStack::PushL(context);
+    
+    CDesCArray* attPaths = new(ELeave) CDesCArrayFlat(128);
+    CleanupStack::PushL(attPaths);
+    
+    // read attachment paths
+    ReadAttachmentPathsRecursiveL(session, context, attPaths);
+    
+    // create file entries of the paths
+    for (TInt i=0; i<attPaths->MdcaCount(); i++)
+        {
+        TFileEntry fileEntry;
+        TEntry entry;
+        TParse nameParser;
+        
+        if (attPaths->MdcaPoint(i).Length() &&
+            nameParser.SetNoWild(attPaths->MdcaPoint(i), NULL, NULL) == KErrNone &&
+            iFs.Entry(attPaths->MdcaPoint(i), entry) == KErrNone)
+            {
+            TFileEntry fileEntry;
+            fileEntry.iPath = nameParser.DriveAndPath();
+            fileEntry.iEntry = entry;
+            fileEntry.iDirEntries = KErrNotFound;
+            fileEntry.iIconId = EFixedIconEmpty;
+
+            iFileEntryList->AppendL(fileEntry);                
+            }
+        }
+    
+    CleanupStack::PopAndDestroy(3); //session, context, attPaths
+            
+    TInt operations = iFileEntryList->Count();
+    
+    if (aType == EFileBrowserCmdToolsMsgAttachmentsInbox)
+        iListingMode = EMsgAttachmentsInbox;
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsDrafts)
+        iListingMode = EMsgAttachmentsDrafts;
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsSentItems)
+        iListingMode = EMsgAttachmentsSentItems;
+    else if (aType == EFileBrowserCmdToolsMsgAttachmentsOutbox)
+        iListingMode = EMsgAttachmentsOutbox;
+	
+    // TODO
+    //iEngine->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
+    RefreshViewL();            
+
+    _LIT(KMessage, "%d files found");
+    TFileName noteMsg;
+    noteMsg.Format(KMessage, operations);
+
+    iEngine->FileBrowserUI()->ShowInformationNote(noteMsg, _L(""));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ReadAttachmentPathsRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, CDesCArray* aAttPaths)
+    {
+    CMsvEntrySelection* entrySelection = aContext->ChildrenL(); 
+    CleanupStack::PushL(entrySelection);
+    
+    for (TInt i=0; i<entrySelection->Count(); i++)
+        {
+        CMsvEntry* entry = aSession->GetEntryL((*entrySelection)[i]);
+        CleanupStack::PushL(entry);
+        
+        CMsvStore* store = NULL;
+        TRAPD(err, store = entry->ReadStoreL());
+        
+        if (err == KErrNone)
+            {
+            CleanupStack::PushL(store);
+
+            for (TInt j=0; j<store->AttachmentManagerL().AttachmentCount(); j++)
+                {
+                CMsvAttachment* attachment = store->AttachmentManagerL().GetAttachmentInfoL(j);
+                CleanupStack::PushL(attachment);
+                
+                aAttPaths->AppendL(attachment->FilePath());
+                
+                CleanupStack::PopAndDestroy(); //attachment
+                }
+            CleanupStack::PopAndDestroy(); // store
+            }
+
+        // recurse into children
+        if (entry->Count() > 0)
+            {
+            ReadAttachmentPathsRecursiveL(aSession, entry, aAttPaths);
+            }
+
+        CleanupStack::PopAndDestroy(); // entry
+        }      
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::WriteMsgStoreWalkL()
+    {
+    _LIT(KAllAppsFileName, "MsgStoreWalk.txt");
+    TFileName allAppsPath = PathInfo::PhoneMemoryRootPath();
+    allAppsPath.Append(KAllAppsFileName);
+
+    if (iMsgStoreWalkFile.Replace(iFs, allAppsPath, EFileWrite) == KErrNone)
+        {
+        CMsvSession* session = CMsvSession::OpenSyncL(*this);
+        CleanupStack::PushL(session);
+        
+        CMsvEntry* context = session->GetEntryL(KMsvRootIndexEntryId);
+        CleanupStack::PushL(context);
+        
+        iMsgStoreWalkFile.Write(_L8("id  service_id  related_id  type  mtm  date  size  error  biotype  mtmdata1  mtmdata2  mtmdata3  description  details\r\n\r\n"));
+        
+        // write details about the root entry
+        DoWriteMessageEntryInfoL(context, iMsgStoreWalkFile, 0);
+        
+        // get and write info recursively
+        TInt level(1);        
+        WriteMessageEntryInfoRecursiveL(session, context, iMsgStoreWalkFile, level);
+
+        CleanupStack::PopAndDestroy(2); //session, context
+        
+        iMsgStoreWalkFile.Flush();
+        iMsgStoreWalkFile.Close();
+        
+        _LIT(KMessage, "Msg. store walk written to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allAppsPath);
+
+        iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg, ETrue); // NoTimeout
+        }
+    else
+        {
+        _LIT(KMessage, "Failed writing to %S");
+        TFileName noteMsg;
+        noteMsg.Format(KMessage, &allAppsPath);
+
+        iEngine->FileBrowserUI()->ShowErrorNote(noteMsg, ETrue); // NoTimeout
+        }    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::WriteMessageEntryInfoRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, RFile& aFile, TInt& aLevel)
+    {
+    CMsvEntrySelection* entrySelection = aContext->ChildrenL(); 
+    CleanupStack::PushL(entrySelection);
+    
+    for (TInt i=0; i<entrySelection->Count(); i++)
+        {
+        CMsvEntry* entry = aSession->GetEntryL((*entrySelection)[i]);
+        CleanupStack::PushL(entry);
+        
+        DoWriteMessageEntryInfoL(entry, aFile, aLevel);
+
+        // recurse into children
+        if (entry->Count() > 0)
+            {
+            aLevel++;
+            WriteMessageEntryInfoRecursiveL(aSession, entry, aFile, aLevel);
+            aLevel--;
+            }
+
+        CleanupStack::PopAndDestroy(); // entry
+        }      
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DoWriteMessageEntryInfoL(CMsvEntry* aContext, RFile& aFile, TInt aLevel)
+    {
+    TMsvEntry messageEntry = aContext->Entry();
+    
+    for (TInt j=0; j<aLevel; j++)
+        {
+        aFile.Write(_L8("     "));
+        }
+
+    TBuf8<256> desc;
+    desc.Copy(messageEntry.iDescription);
+
+    TBuf8<256> details;
+    details.Copy(messageEntry.iDetails);
+
+    _LIT8(KLine, "-> %d  %d  %d  %d  %d  %Ld  %d  %d  %d  %d  %d  %d  %S  %S\r\n");
+    TBuf8<1024> buf;
+    buf.Format(KLine, messageEntry.Id(), messageEntry.iServiceId, messageEntry.iRelatedId, messageEntry.iType.iUid,
+        messageEntry.iMtm.iUid, messageEntry.iDate.Int64(), messageEntry.iSize, messageEntry.iError, messageEntry.iBioType,
+        messageEntry.iMtmData1, messageEntry.iMtmData2, messageEntry.iMtmData3, &desc, &details);
+
+    aFile.Write(buf);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::FileEditorL(TInt aCurrentItemIndex, TInt /*aType*/)
+    {
+    // TODO
+    // just get current item 
+    //TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+    
+    if (iFileEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+        TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex);
+        
+        // only valid for files
+        if (!fileEntry.iEntry.IsDir())
+            {
+            TFileName fullPath = fileEntry.iPath;
+            fullPath.Append(fileEntry.iEntry.iName);
+
+//            iEngine->FileListContainer()->SetNaviPaneTextL(fileEntry.iEntry.iName);
+//
+//            TInt editorMode(0);
+//
+//            if (aType == EFileBrowserCmdFileViewText)
+//                editorMode = EFileEditorViewAsText;
+//            else if (aType == EFileBrowserCmdFileViewHex)
+//                editorMode = EFileEditorViewAsHex;
+//            else if (aType == EFileBrowserCmdFileEditText)
+//                editorMode = EFileEditorEditAsText;
+//            else if (aType == EFileBrowserCmdFileEditHex)
+//                editorMode = EFileEditorEditAsHex;
+//            else
+//                User::Panic(_L("Inv.Ed.Mode"), 843);
+//
+//            // launch dialog
+//            CFileBrowserFileEditorDlg* dlg = CFileBrowserFileEditorDlg::NewL(fullPath, editorMode);
+//            dlg->RunDlgLD();
+//
+//            iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
+//
+//            if (aType == EFileBrowserCmdFileEditText || aType == EFileBrowserCmdFileEditHex)
+//                {
+//                RefreshViewL();
+//                }
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CFileBrowserFileUtils::DriveSnapShotPossible()
+    {
+//    // TODO
+//    // check that E-drive is available
+//    TBool EDriveIsOK(EFalse);
+//
+//    for (TInt i=0; i<iDriveEntryList->Count(); i++)
+//        {
+//        TDriveEntry driveEntry = iDriveEntryList->At(i);
+//
+//        if (driveEntry.iNumber == EDriveE)
+//            {
+//            if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAbsent)
+//                EDriveIsOK = EFalse;
+//            else
+//                EDriveIsOK = ETrue;
+//            }
+//        }
+//
+//    if (!EDriveIsOK)
+//        return EFalse;
+//
+//    // get current item
+//    TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+//
+//    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
+//        {
+//        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
+//
+//        // drive snapshot not possible when E-drive is highlighted, since that's where we are copying
+//        if (driveEntry.iNumber == EDriveE)
+//            return EFalse;
+//        else
+//            return ETrue;
+//        }
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DriveSnapShotL()
+    {
+//    if (iEngine->Settings().iBypassPlatformSecurity)
+//        {
+//        // get current item
+//        TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+//
+//        if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
+//            {
+//            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
+//
+//            TChar sourceDriveLetter = driveEntry.iLetter;
+//            TChar targetDriveLetter = 'E';  // hardcoded drive letter, could be better if would be queried from the user
+//
+//            // append to the command array
+//            AppendToCommandArrayL(EFileBrowserFileOpCommandDriveSnapShot,
+//                                  new(ELeave)CCommandParamsDriveSnapShot(sourceDriveLetter, targetDriveLetter)
+//                                 );
+//
+//            // execute the operation
+//            StartExecutingCommandsL(_L("Copying"));
+//            }
+//        }
+//    else
+//        {
+//        iEngine->FileBrowserUI()->ShowInformationNote(_L("Enable \"bypass platform security\" from the settings first"), _L(""));
+//        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetDrivePasswordL(TInt aIndex,
+                                              const TFileName &aOldPassword,
+                                              const TFileName &aNewPassword)
+    {    
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TMediaPassword oldPassword;
+        TMediaPassword newPassword;
+
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        ConvertCharsToPwd(aOldPassword, oldPassword);
+        ConvertCharsToPwd(aNewPassword, newPassword);
+
+        // set the password, does not actually lock the drive
+        TInt err = iFs.LockDrive(driveEntry.iNumber, oldPassword, newPassword, ETrue);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Password set"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::UnlockDriveL(TInt aIndex, const TFileName &aOldPassword)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        TMediaPassword oldPassword;
+        ConvertCharsToPwd(aOldPassword, oldPassword);
+
+        // unlock the drive
+        TInt err = iFs.UnlockDrive(driveEntry.iNumber, oldPassword, ETrue) == KErrNone;
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Drive unlocked"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ClearDrivePasswordL(TInt aIndex, const TFileName &aOldPassword)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        TMediaPassword oldPassword;
+
+        ConvertCharsToPwd(aOldPassword, oldPassword);
+
+        // clear the password from the drive
+        TInt err = iFs.ClearPassword(driveEntry.iNumber, oldPassword);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Password cleared"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::EraseDrivePasswordL(TInt aIndex)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+        
+        // erase the password from the drive
+        TInt err(KErrNone);
+        err = iFs.ErasePassword(driveEntry.iNumber);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Password erased"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Cannot erase, you may have to format the drive first"));
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::FormatDriveL(TInt aIndex, TBool aQuickFormat)
+    {    
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        TInt err(KErrNone);
+        TInt formatCount(0);
+
+        TBuf<10> driveRoot;
+        driveRoot.Append(driveEntry.iLetter);
+        driveRoot.Append(_L(":"));
+
+        TUint formatMode(0);
+        if (aQuickFormat)
+            formatMode = ESpecialFormat|EQuickFormat;
+        else
+            formatMode = ESpecialFormat|EFullFormat;
+
+        // set as system application to prevent getting shut down events
+        iEngine->EikonEnv()->SetSystem(ETrue);
+
+        // first close any open applications
+        CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
+        CleanupStack::PushL(BSWrapper);
+
+        TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+        BSWrapper->NotifyBackupOperationL(atts);
+
+        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+        BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
+        waiter->StartAndWait();
+        CleanupStack::PopAndDestroy(); //waiter
+
+        // some delay to make sure all applications have been closed
+        User::After(1000000);
+
+        // format the drive
+        RFormat format;
+        err = format.Open(iFs, driveRoot, formatMode, formatCount);
+
+        // Forced format for locked card
+        if ( err == KErrLocked )
+            {
+            // Erase password and try again
+            err = iFs.ErasePassword( driveEntry.iNumber );
+            if ( !err )
+                {
+                err = format.Open(iFs, driveRoot, formatMode, formatCount);
+                }
+            }
+
+        if( err != KErrNone &&  err != KErrLocked )
+            {
+//            CAknQueryDialog* lockQuery = CAknQueryDialog::NewL();
+//            if ( lockQuery->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Memory card in use by other application. Proceed anyway?")))
+            // TODO Dialog should be opened in UI part
+            if (iEngine->FileBrowserUI()->ShowConfirmationQuery(_L("Memory card in use by other application. Proceed anyway?")))
+                {
+                // If format could not be started, someone is still keeping
+                // files open on media. Let's try to dismount file system, then
+                // remount with own extension embedded and try again.
+
+                TFullName fsName;
+                err = iFs.FileSystemName( fsName, driveEntry.iNumber );
+
+                if ( err == KErrNone && fsName.Length() > 0 )
+                    {
+                    // Prevent SysAp shutting down applications
+                    RProperty::Set(
+                        KPSUidCoreApplicationUIs,
+                        KCoreAppUIsMmcRemovedWithoutEject,
+                        ECoreAppUIsEjectCommandUsed );
+
+                    TRequestStatus stat;
+                    iFs.NotifyDismount( driveEntry.iNumber, stat, EFsDismountForceDismount );
+                    User::WaitForRequest( stat );
+
+                    // Unfortunately, at the moment we have to wait until clients have received
+                    // notification about card dismount. Otherwise at least causes problems with
+                    // theme selected from card. In future clients should use new notify-API.
+                    User::After( KForcedFormatTimeout );
+
+                    // Let's set priority higher than normally. This is done to decrease the chance
+                    // that someone reopens files on memory card after mandatory file system
+                    // remounting hence preventing formatting again.
+                    TThreadPriority priority( RThread().Priority() );
+                    RThread().SetPriority( EPriorityAbsoluteHigh );
+
+                    // Mount file system back...
+                    err = iFs.MountFileSystem( fsName, driveEntry.iNumber );
+                    err = format.Open(iFs, driveRoot, formatMode, formatCount);
+                    RThread().SetPriority( priority );
+                    }
+                }
+            }
+
+
+        if (err == KErrNone)
+            {
+            // needs to be implemented with active objects
+            // CAknProgressDialog* dlg = new(ELeave) CAknProgressDialog(formatCount, 1, 1, NULL);
+            // dlg->SetTone(CAknNoteDialog::ENoTone);
+            // dlg->ExecuteLD(R_FORMAT_PROGRESS_NOTE);
+
+            while (formatCount && err == KErrNone)
+                {
+                err = format.Next(formatCount);
+                }
+            }
+
+        format.Close();
+
+        // restart closed applications
+        TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+        BSWrapper->NotifyBackupOperationL(atts2);
+        BSWrapper->RestartAll();
+        CleanupStack::PopAndDestroy(); //BSWrapper
+
+        // system status not needed anymore
+        iEngine->EikonEnv()->SetSystem(EFalse);
+
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Format succeeded"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::EraseMBRL(TInt aIndex)
+    {
+    // TODO
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {        
+        if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+            {
+            TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+            TInt err(KErrNone);
+
+            iEngine->FileBrowserUI()->ShowInformationNote(_L("Please wait, this may take 30 seconds"), _L(""));
+
+            // set as system application to prevent getting shut down events
+            iEngine->EikonEnv()->SetSystem(ETrue);
+
+            // first close any open applications
+            CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
+            CleanupStack::PushL(BSWrapper);
+
+            TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+            BSWrapper->NotifyBackupOperationL(atts);
+
+            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+            BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
+            waiter->StartAndWait();
+            CleanupStack::PopAndDestroy(); //waiter
+
+            // some delay to make sure all applications have been closed
+            User::After(1000000);
+
+
+            // do the erase MBR operation
+            err = iFileOps->EraseMBR(driveEntry.iNumber);
+
+
+            // restart closed applications
+            TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+            BSWrapper->NotifyBackupOperationL(atts2);
+            BSWrapper->RestartAll();
+            CleanupStack::PopAndDestroy(); //BSWrapper
+
+            // system status not needed anymore
+            iEngine->EikonEnv()->SetSystem(EFalse);
+
+
+            if (err == KErrNone)
+                {
+                iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Erase MBR succeeded"));
+                }
+            else if (err == KErrNotSupported)
+                {
+                iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+                }
+            else
+                {
+                CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+                iEngine->FileBrowserUI()->ShowErrorNote(
+                        textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+                CleanupStack::PopAndDestroy();  //textResolver
+                }
+
+            RefreshViewL();
+            }
+        }
+    else
+        {
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Enable \"bypass platform security\" from the settings first"), _L(""));
+        }
+    #else
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Not supported in lite version"), _L(""));
+    #endif
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::PartitionDriveL(TInt aIndex, TBool aEraseMBR, TInt aAmountOfPartitions)
+    {
+    // TODO
+    #ifndef FILEBROWSER_LITE
+    if (iEngine->Settings().iBypassPlatformSecurity)
+        {
+        if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+            {
+            TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+            TInt err(KErrNone);
+
+            iEngine->FileBrowserUI()->ShowInformationNote(_L("Please wait, this may take 30 seconds"), _L(""));
+
+            // set as system application to prevent getting shut down events
+            iEngine->EikonEnv()->SetSystem(ETrue);
+
+            // first close any open applications
+            CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
+            CleanupStack::PushL(BSWrapper);
+
+            TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
+            BSWrapper->NotifyBackupOperationL(atts);
+
+            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
+            BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
+            waiter->StartAndWait();
+            CleanupStack::PopAndDestroy(); //waiter
+
+            // some delay to make sure all applications have been closed
+            User::After(1000000);
+
+            // do the erase operation
+            if (aEraseMBR)
+                {
+                err = iFileOps->EraseMBR(driveEntry.iNumber);
+
+                if (err != KErrNone)
+                    {
+                    iEngine->FileBrowserUI()->ShowErrorNote(_L("Erase MBR failed"));
+                    }
+
+                User::After(500000);
+                }
+
+
+            // do the partition operation
+            err = iFileOps->PartitionDrive(driveEntry.iNumber, aAmountOfPartitions);
+
+
+            // restart closed applications
+            TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
+            BSWrapper->NotifyBackupOperationL(atts2);
+            BSWrapper->RestartAll();
+            CleanupStack::PopAndDestroy(); //BSWrapper
+
+            // system status not needed anymore
+            iEngine->EikonEnv()->SetSystem(EFalse);
+
+
+            if (err == KErrNone)
+                {
+                iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Partition succeeded"));
+                }
+            else if (err == KErrNotSupported)
+                {
+                iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+                }
+            else
+                {
+                CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+                iEngine->FileBrowserUI()->ShowErrorNote(
+                        textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+                CleanupStack::PopAndDestroy();  //textResolver
+                }
+
+            RefreshViewL();
+            }
+        }
+    else
+        {
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Enable \"bypass platform security\" from the settings first"), _L(""));
+        }
+    #else
+        iEngine->FileBrowserUI()->ShowInformationNote(_L("Not supported in lite version"), _L(""));
+    #endif
+	}
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::CheckDiskL(TInt aIndex)
+    {    
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+        
+        TBuf<10> driveRoot;
+        driveRoot.Append(driveEntry.iLetter);
+        driveRoot.Append(_L(":"));
+        
+        // check disk
+        TInt err = iFs.CheckDisk(driveRoot);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Integrity of the disk is ok"));
+            }
+        else if (err == KErrNotReady)
+            {
+            iEngine->FileBrowserUI()->ShowInformationNote(_L("Disk is empty"), _L(""));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Disk is corrupted"));
+            }        
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ScanDriveL(TInt aIndex)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        TBuf<10> driveRoot;
+        driveRoot.Append(driveEntry.iLetter);
+        driveRoot.Append(_L(":"));
+
+        // scan disk
+        TInt err = iFs.ScanDrive(driveRoot);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Run succesfully"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::GetDriveName(TInt aIndex, TFileName &aDriveName)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        // get existing drive name
+        iFs.GetDriveName(driveEntry.iNumber, aDriveName);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetDriveNameL(TInt aIndex, const TFileName &aDriveName)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        // set drive name
+        TInt err = iFs.SetDriveName(driveEntry.iNumber, aDriveName);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Name changed"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::GetDriveVolumeLabel(TInt aIndex, TFileName &aVolumeLabel)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        // get existing volume label
+        aVolumeLabel.Copy(driveEntry.iVolumeInfo.iName);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SetDriveVolumeLabelL(TInt aIndex, const TFileName &aVolumeLabel)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        // set volume label
+        TInt err = iFs.SetVolumeLabel(aVolumeLabel, driveEntry.iNumber);
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Volume label changed"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::EjectDriveL(TInt aIndex)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+        
+        TInt err(KErrNone);
+        
+        // get current filesystem name
+        TFileName fileSystemName;
+        err = iFs.FileSystemName(fileSystemName, driveEntry.iNumber);
+        
+        if (err == KErrNone)
+            {
+            // Prevent SysAp shutting down applications
+            RProperty::Set(
+                KPSUidCoreApplicationUIs,
+                KCoreAppUIsMmcRemovedWithoutEject,
+                ECoreAppUIsEjectCommandUsed );
+            
+            // dismount the file system
+            err = iFs.DismountFileSystem(fileSystemName, driveEntry.iNumber);
+            
+            if (err == KErrNone)
+                {
+                // remount the file system
+                err = iFs.MountFileSystem(fileSystemName, driveEntry.iNumber);
+                
+                if (err == KErrInUse)
+                    {
+                    // try to remount after a while if locked
+                    User::After(1000000);
+                    err = iFs.MountFileSystem(fileSystemName, driveEntry.iNumber);
+                    }                
+                }
+            }
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Ejected succesfully"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }              
+
+        RefreshViewL();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::DismountFileSystemL(TInt aIndex)
+    {
+    if (iDriveEntryList->Count() > aIndex && aIndex >= 0)
+        {
+        TDriveEntry driveEntry = iDriveEntryList->At(aIndex);
+
+        TInt err(KErrNone);
+
+        // get current filesystem name
+        TFileName fileSystemName;
+        err = iFs.FileSystemName(fileSystemName, driveEntry.iNumber);
+
+        if (err == KErrNone)
+            {
+            // Prevent SysAp shutting down applications
+            RProperty::Set(
+                KPSUidCoreApplicationUIs,
+                KCoreAppUIsMmcRemovedWithoutEject,
+                ECoreAppUIsEjectCommandUsed );
+
+            // dismount the file system
+            err = iFs.DismountFileSystem(fileSystemName, driveEntry.iNumber);
+            }
+
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Dismounted succesfully"));
+            }
+        else if (err == KErrNotSupported)
+            {
+            iEngine->FileBrowserUI()->ShowErrorNote(_L("Not supported for this drive"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }
+
+        RefreshViewL();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::ConvertCharsToPwd(const TDesC& aWord, TDes8& aConverted) const
+    {
+    aConverted.FillZ(aConverted.MaxLength());
+    aConverted.Zero();
+    
+    if (aWord.Length())
+        {
+        aConverted.Copy( (TUint8*)(&aWord[0]), aWord.Size() );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::EditDataTypesL()
+    {
+	// TODO
+	/*
+    iEngine->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
+    iEngine->FileListContainer()->SetNaviPaneTextL(KNullDesC);
+    
+    CFileBrowserDataTypesDlg* dlg = CFileBrowserDataTypesDlg::NewL();
+    dlg->RunQueryLD();
+
+    iEngine->FileListContainer()->SetScreenLayoutL(iEngine->Settings().iDisplayMode);
+    iEngine->FileListContainer()->SetNaviPaneTextL(iCurrentPath);  
+	*/	
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::SecureBackupL(TInt aType)
+    {
+    TInt err(KErrNone);
+    TInt showStatus(EFalse);
+    
+    if (aType == EFileBrowserCmdToolsSecureBackupStartBackup || aType == EFileBrowserCmdToolsSecureBackupStartRestore)
+        {
+//        TInt queryIndexState(0);
+//        TInt queryIndexType(0);
+        
+//        CAknListQueryDialog* listQueryDlgState = new(ELeave) CAknListQueryDialog(&queryIndexState);
+//        if (listQueryDlgState->ExecuteLD(R_SECUREBACKUP_STATE_QUERY))
+//            {
+//
+//            CAknListQueryDialog* listQueryDlgType = new(ELeave) CAknListQueryDialog(&queryIndexType);
+//            if (listQueryDlgType->ExecuteLD(R_SECUREBACKUP_TYPE_QUERY))
+//                {
+//                conn::TBURPartType partType = conn::EBURNormal;
+//                conn::TBackupIncType backupIncType = conn::ENoBackup;
+//                
+//                if (aType == EFileBrowserCmdToolsSecureBackupStartBackup)
+//                    {
+//                    if (queryIndexState == ESecureBackupStateFull)
+//                        partType = conn::EBURBackupFull;
+//                    else if (queryIndexState == ESecureBackupStatePartial)
+//                        partType = conn::EBURBackupPartial;
+//                    }
+//                else if (aType == EFileBrowserCmdToolsSecureBackupStartRestore)
+//                    {
+//                    if (queryIndexState == ESecureBackupStateFull)
+//                        partType = conn::EBURRestoreFull;
+//                    else if (queryIndexState == ESecureBackupStatePartial)
+//                        partType = conn::EBURRestorePartial;
+//                    }
+//                    
+//                if (queryIndexType == ESecureBackupTypeBase)
+//                    backupIncType = conn::EBackupBase;
+//                else if (queryIndexType == ESecureBackupTypeIncremental)    
+//                    backupIncType = conn::EBackupIncrement;    
+//
+//                // start secure backup
+//                err = iFileOps->ActivateSecureBackUp(partType, backupIncType);
+//                showStatus = ETrue;
+//                }
+//            }
+        }
+
+    else if (aType == EFileBrowserCmdToolsSecureBackupStop)
+        {
+        err = iFileOps->DeActivateSecureBackUp();
+        showStatus = ETrue;
+        }
+
+    else
+        User::Panic(_L("Sec.br.mode"), 101);
+    
+    
+    if (showStatus)
+        {
+        if (err == KErrNone)
+            {
+            iEngine->FileBrowserUI()->ShowConfirmationNote(_L("Succeeded"));
+            }
+        else
+            {
+            CTextResolver* textResolver = CTextResolver::NewLC(*iEngine->EikonEnv());
+
+            iEngine->FileBrowserUI()->ShowErrorNote(
+                    textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );
+
+            CleanupStack::PopAndDestroy();  //textResolver
+            }  
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CFileBrowserFileUtils::OpenCommonFileActionQueryL(TInt aCurrentItemIndex)
+    {
+    // TODO
+    // just get current item
+//    TInt currentItemIndex = iEngine->QueryCurrentItemIndex();
+
+    if (iFileEntryList->Count() > aCurrentItemIndex && aCurrentItemIndex >= 0)
+        {
+//        TInt queryIndex(0);
+//
+//        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
+//
+//        if (listQueryDlg->ExecuteLD(R_COMMON_FILE_ACTION_QUERY))
+//            {
+//            if (queryIndex == ECommonFileActionViewAsTextHex)
+//                {
+//                TFileEntry fileEntry = iFileEntryList->At(aCurrentItemIndex);
+//
+//                TFileName fullPath = fileEntry.iPath;
+//                fullPath.Append(fileEntry.iEntry.iName);
+//
+//                TInt viewerType(EFileBrowserCmdFileViewHex);
+//
+//                // check from mime type if it's text
+//                TDataType dataType;
+//                TUid appUid;
+//                if (iEngine->LsSession().AppForDocument(fullPath, appUid, dataType) == KErrNone)
+//                    {
+//                    TBuf<128> mimeTypeBuf;
+//                    mimeTypeBuf.Copy(dataType.Des8());
+//                    if (mimeTypeBuf == KNullDesC)
+//                        mimeTypeBuf.Copy(_L("N/A"));
+//
+//                    if (mimeTypeBuf.CompareF(_L("text/plain")) == 0)
+//                        viewerType = EFileBrowserCmdFileViewText;
+//                    }
+//
+//                FileEditorL(viewerType);
+//                }
+//
+//            else if (queryIndex == ECommonFileActionOpenWithApparc)
+//                {
+//                // TODO
+//                //OpenWithApparcL();
+//                }
+//
+//            else if (queryIndex == ECommonFileActionOpenWithDocHandlerEmbed)
+//                {
+//                // TODO
+//                //OpenWithDocHandlerL(ETrue);
+//                }
+//
+//            else
+//                User::Panic(_L("Unk.Com.Act"), 221);
+//            }
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+	            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBFileUtils.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,421 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSER_FILEUTILS_H
+#define FILEBROWSER_FILEUTILS_H
+
+// INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+#include <w32std.h>
+#include <badesca.h>
+#include <coedef.h>
+#include <AknServerApp.h>
+#include <msvapi.h>
+#include <AknProgressDialog.h>
+#include <tz.h>
+
+_LIT(KIRAppPath, "z:\\sys\\bin\\irapp.exe");
+_LIT(KBTAppPath, "z:\\sys\\bin\\btui.exe");
+_LIT(KUSBAppPath, "z:\\sys\\bin\\usbclasschangeui.exe");
+_LIT(KErrRdPath, "c:\\resource\\ErrRd");
+_LIT(KErrRdDir, "c:\\resource\\");
+
+
+// FORWARD DECLARATIONS
+class CEngine;
+class CFileBrowserFileOps;
+class CAknIconArray;
+class TAknsItemID;
+class CDocumentHandler;
+//class CAknWaitDialog;
+//class CAknProgressDialog;
+class CEikProgressInfo;
+class CFBFileOpClient;
+//class CAknProgressDialog;
+class CEikProgressInfo;
+class CAknOpenFileService;
+class CMessageDigest;
+
+// CLASS DECLARATIONS
+
+class TSearchAttributes
+	{
+public:
+    TFileName       iSearchDir;
+    TFileName       iWildCards;
+    TFileName       iTextInFile;
+    TUint           iMinSize;
+    TUint           iMaxSize;
+    TTime           iMinDate;
+    TTime           iMaxDate;
+    TBool           iRecurse;
+	};
+
+class TDriveEntry
+	{
+public:
+    TChar           iLetter;
+    TInt            iNumber;
+    TVolumeInfo     iVolumeInfo;
+    TBuf<64>        iMediaTypeDesc;
+    TBuf<128>       iAttributesDesc;
+    TInt            iIconId;
+	};
+
+class TFileEntry
+	{
+public:
+    TFileName       iFullName;	
+    TFileName       iPath;
+    TEntry          iEntry;
+    TInt            iDirEntries;
+    TInt            iIconId;
+	};
+
+class TAppIcon
+	{
+public:
+    TInt            iId;
+    TUid            iUid;
+	};
+
+typedef CArrayFixSeg<TDriveEntry> CDriveEntryList;
+typedef CArrayFixSeg<TFileEntry> CFileEntryList;
+typedef CArrayFixSeg<TAppIcon> CAppIconList;
+
+class TSearchResults
+    {
+public:
+    TInt iNumberOfFoundFiles;
+    //CFileEntryList iFoundFilesList;
+    };
+
+class TOverwriteOptions
+    {
+public:
+    TBool iDoFileOperations/*(ETrue)*/;
+    TInt iQueryIndex/*(0)*/;
+    TFileName iPostFix;
+    TInt iOverWriteFlags/* = CFileMan::EOverWrite*/;
+    };
+
+class CCommandParamsBase : public CBase
+    {
+    };
+
+class CCommandParamsAttribs : public CCommandParamsBase
+    {
+public:
+    TFileEntry iSourceEntry;
+    TUint iSetMask;
+    TUint iClearMask;
+    TTime iTime;
+    TUint iSwitch;
+public:
+    CCommandParamsAttribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) : iSourceEntry(aSourceEntry), iSetMask(aSetMask), iClearMask(aClearMask), iTime(aTime), iSwitch(aSwitch) {}
+    };
+    
+class CCommandParamsCopyOrMove : public CCommandParamsBase
+    {
+public:
+    TFileEntry iSourceEntry;
+    TFileName iTargetPath;
+    TUint iSwitch;
+public:
+    CCommandParamsCopyOrMove(const TFileEntry& aSourceEntry, const TDesC& aTargetPath, TUint aSwitch) : iSourceEntry(aSourceEntry), iTargetPath(aTargetPath), iSwitch(aSwitch) {}
+    };
+        
+class CCommandParamsRename : public CCommandParamsBase
+    {
+public:
+    TFileEntry iSourceEntry;
+    TFileName iTargetPath;
+    TUint iSwitch;
+public:
+    CCommandParamsRename(const TFileEntry& aSourceEntry, const TDesC& aTargetPath, TUint aSwitch) : iSourceEntry(aSourceEntry), iTargetPath(aTargetPath), iSwitch(aSwitch) {}
+    };
+
+class CCommandParamsDelete : public CCommandParamsBase
+    {
+public:
+    TFileEntry iSourceEntry;
+    TUint iSwitch;
+public:
+    CCommandParamsDelete(const TFileEntry& aSourceEntry, TUint aSwitch) : iSourceEntry(aSourceEntry), iSwitch(aSwitch) {}
+    };
+
+class CCommandParamsDriveSnapShot : public CCommandParamsBase
+    {
+public:
+    TInt iSourceDriveLetter;
+    TInt iTargetDriveLetter;
+public:
+    CCommandParamsDriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter) : iSourceDriveLetter(aSourceDriveLetter), iTargetDriveLetter(aTargetDriveLetter) {}
+    };
+    
+class TCommand
+    {
+public:
+    TInt iCommandId;
+    CCommandParamsBase* iParameters;
+public:
+    TCommand(TInt aCommandId, CCommandParamsBase* aParameters) : iCommandId(aCommandId), iParameters(aParameters) {}
+    };
+
+typedef CArrayFixSeg<TCommand> CCommandArray;
+
+
+
+class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver, public MProgressDialogCallback 
+	{
+private:
+    enum TState // active object states
+    	{
+    	EIdle = 0,              // do nothing
+    	};
+
+    enum TClipBoardMode
+    	{
+    	EClipBoardModeCut = 0,
+    	EClipBoardModeCopy
+    	};
+
+    enum TListingMode
+    	{
+    	ENormalEntries = 0,
+    	ESearchResults,
+    	EOpenFiles,
+    	EMsgAttachmentsInbox,
+    	EMsgAttachmentsDrafts,
+    	EMsgAttachmentsSentItems,
+    	EMsgAttachmentsOutbox
+    	};
+    	    	
+public:
+	static CFileBrowserFileUtils* NewL(CEngine* aEngine);
+	~CFileBrowserFileUtils();
+
+private:
+	CFileBrowserFileUtils(CEngine* aEngine);
+	void ConstructL();
+
+private: // from CActive
+	void RunL();
+    TInt RunError(TInt aError);
+	void DoCancel();
+
+private: // from MAknServerAppExitObserver
+    void HandleServerAppExit(TInt aReason);
+
+private: // from MMsvSessionObserver
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+
+private:  //from MProgressDialogCallback
+    void DialogDismissedL(TInt aButtonId);  
+    
+public: // command handling
+    void StartExecutingCommandsL(const TDesC& aLabel);
+private: // command handling
+    void ExecuteCommand();
+    void CheckForMoreCommandsL();
+    void AppendToCommandArrayL(TInt aCommand, CCommandParamsBase* aParameters);
+    TInt CommandArrayCount() const;
+    void ResetCommandArray();       
+
+private: // misc functionality
+    void GenerateDirectoryDataL();
+    void GetDriveListL();
+    void GetDirectoryListingL();
+//    CAknIconArray* GenerateIconArrayL(TBool aGenerateNewBasicIconArray=EFalse);
+//    void AppendGulIconToIconArrayL(CAknIconArray* aIconArray, const TDesC& aIconFile, TInt aIconId, TInt aMaskId, const TAknsItemID aAknsItemId);
+    TInt AppIconIdForUid(TUid aUid);
+    TUid GetAppUid(TFileEntry aFileEntry);
+//    CDesCArray* GenerateItemTextArrayL();
+//    TInt GetSelectedItemsOrCurrentItemL(CFileEntryList* aFileEntryList);
+    TInt SetSelectedItemsOrCurrentItemL(const CArrayFix<TInt>* selectionIndexes,
+                                        CFileEntryList* aFileEntryList);
+
+//    TBool IsDestinationEntriesExists(const CFileEntryList* aEntryList, const TDesC& aTargetDir);
+    void DoCopyToFolderL(CFileEntryList* aEntryList, const TDesC& aTargetDir, const TOverwriteOptions &aOverwriteOptions, TBool aDeleteSource);
+    TInt DoSearchFiles(const TDesC& aFileName, const TDesC& aPath);
+    TInt DoSearchFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
+    TInt DoFindFiles(const TDesC& aFileName, const TDesC& aPath);
+    TInt DoFindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
+    void ReadAttachmentPathsRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, CDesCArray* aAttPaths);
+    void WriteMessageEntryInfoRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, RFile& aFile, TInt& aLevel);
+    void DoWriteMessageEntryInfoL(CMsvEntry* aContext, RFile& aFile, TInt aLevel);
+    void ConvertCharsToPwd(const TDesC& aWord, TDes8& aConverted) const;
+    HBufC8* MessageDigestInHexLC(CMessageDigest* aMD, RFile& aFile);
+    void OpenCommonFileActionQueryL(TInt aCurrentItemIndex);
+    
+public: // public interfaces
+    TKeyResponse HandleOfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+    void HandleSettingsChangeL();
+    void SetSortModeL(TInt aSortMode);
+    void SetOrderModeL(TInt aOrderMode);
+    void RefreshViewL();
+    TBool IsCurrentDriveReadOnly();
+    TBool IsItemDirectory(TInt aCurrentItemIndex);
+    void MoveUpOneLevelL();
+    void MoveDownToDirectoryL(TInt aIndex);
+    TInt ClipboardCutL(const CArrayFix<TInt>* aSelectionIndices);
+    TInt ClipboardCopyL(const CArrayFix<TInt>* aSelectionIndices);
+    void ClipboardPasteL(const TOverwriteOptions &aOverwriteOptions);
+    TInt SetCurrentSelection(const CArrayFix<TInt>* aSelectionIndices);
+    void CopyToFolderL(TFileName aTargetDir, const TOverwriteOptions &aOverwriteOptions, TBool aMove=EFalse);
+    void DeleteL();
+    TBool SelectionHasDirs();
+    void TouchL(TBool aRecurse);
+    void RenameL(const TInt aIndex, const TFileName &newName);
+    void SetAttributesL();
+    void SearchL();
+    void NewFileL(const TFileName &aNewFileName);
+    void NewDirectoryL(const TFileName &aNewDirectoryName);
+    void SendToL();
+    void CompressL();
+    void DecompressL();
+    bool PropertiesL(TInt currentItemIndex, CDesCArray* entryLines, TFileName &titleText);
+    void OpenWithApparcL(TFileName aFileName);
+    void OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed);
+    void OpenWithFileServiceL(TInt aCurrentItemIndex);
+    TBool FileExists(const TDesC& aPath);
+    TInt LaunchProgramL(const TDesC& aPath);
+    void MemoryInfoPopupL();
+    void ShowFileCheckSumsL(TInt aCurrentItemIndex, TInt aType);
+    void SetErrRdL(TBool aEnable);
+//    void EnableAvkonIconCacheL(TBool aEnable);
+    void SimulateLeaveL(TInt aLeaveCode);
+    void SimulatePanicL(const TDesC& aPanicCategory, TInt aPanicCode);
+    void SimulateExceptionL(TInt aExceptionCode);
+    TUint32 GetDebugMask();
+    void SetDebugMaskL(TUint32 aDbgMask);
+    void WriteAllAppsL();
+    void WriteAllFilesL();
+    void ListOpenFilesL();
+    void ListMessageAttachmentsL(TInt aType);
+    void WriteMsgStoreWalkL();
+    void FileEditorL(TInt aCurrentItemIndex, TInt aType);
+    void SetDrivePasswordL(TInt aIndex, const TFileName &aOldPassword, const TFileName &aNewPassword);
+    void UnlockDriveL(TInt aIndex, const TFileName &aOldPassword);
+    void ClearDrivePasswordL(TInt aIndex, const TFileName &aOldPassword);
+    void EraseDrivePasswordL(TInt aIndex);
+    void FormatDriveL(TInt aIndex, TBool aQuickFormat);
+    void CheckDiskL(TInt aIndex);
+    void ScanDriveL(TInt aIndex);
+    void SetDriveNameL(TInt aIndex, const TFileName &aDriveName);
+    void SetDriveVolumeLabelL(TInt aIndex, const TFileName &aVolumeLabel);
+    void EjectDriveL(TInt aIndex);
+    void DismountFileSystemL(TInt aIndex);
+    void EraseMBRL(TInt aIndex);
+    void PartitionDriveL(TInt aIndex, TBool aEraseMBR, TInt aAmountOfPartitions);
+    TBool DriveSnapShotPossible();
+    void DriveSnapShotL();
+    void EditDataTypesL();
+    void SecureBackupL(TInt aType);
+
+    TBool IsDestinationEntriesExists(const TDesC& aTargetDir);
+    TBool TargetExists(const TInt aIndex, const TFileName &newName);
+    void GetDriveName(TInt aIndex, TFileName &aDriveName);
+    void GetDriveVolumeLabel(TInt aIndex, TFileName &aVolumeLabel);
+
+    CFileEntryList* FileEntries() const;
+    CDriveEntryList* DriveEntries() const;   
+    
+public:    
+    inline TInt SortMode() { return iSortMode; }
+    inline TInt OrderMode() { return iOrderMode; }
+    inline CFileEntryList* ClipBoardList() { return iClipBoardList; }
+    inline CFileEntryList* CurrentSelectionList() { return iCurrentSelectionList; }
+    inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC && iListingMode==ENormalEntries; }
+    inline TBool IsNormalModeActive() { return iListingMode==ENormalEntries; }
+    inline TFileName CurrentPath() { return iCurrentPath; }
+	
+    inline TSearchAttributes GetSearchAttributes(){ return iSearchAttributes; };
+    inline void ChangeAttributes(TSearchAttributes attributes) { iSearchAttributes = attributes; };
+    inline TSearchResults SearchResults(){ return iFileSearchResults; };
+    inline CFileEntryList* FoundFiles() { return iFileEntryList; };
+	
+private:
+    TState                          iState;
+    CEngine*                        iEngine;
+    CFileBrowserFileOps*            iFileOps;
+//    CAknWaitDialog*                 iWaitDialog;
+//    CAknProgressDialog*             iProgressDialog;
+    CEikProgressInfo*               iProgressInfo;
+    CCommandArray*                  iCommandArray;
+    TInt                            iCurrentEntry;
+    TInt                            iSucceededOperations;
+    TInt                            iFailedOperations;
+    TInt                            iLastError;
+    RTimer                          iTimer;
+    RFs                             iFs;
+    TListingMode                    iListingMode;
+    CFileMan*                       iFileMan;
+    TInt                            iViewMode;
+    TFileName                       iCurrentPath;
+    TInt                            iSortMode;
+    TInt                            iOrderMode;
+    TInt                            iClipboardMode;
+    CDesCArray*                     iClipboardPaths;
+    CDriveEntryList*                iDriveEntryList;
+    CFileEntryList*                 iFileEntryList;
+    CFileEntryList*                 iFindFileEntryList;
+    CAppIconList*                   iAppIconList;
+    TClipBoardMode                  iClipBoardMode;
+    CFileEntryList*                 iClipBoardList;
+    CFileEntryList*                 iCurrentSelectionList;
+    TSearchAttributes               iSearchAttributes;
+    CDocumentHandler*               iDocHandler;
+    CAknOpenFileService*            iOpenFileService;
+    RFile                           iMsgStoreWalkFile;
+    TInt                            iPrevFolderIndex;
+    TFileName                       iPrevFolderName;
+    RTz                             iTz;
+    TSearchResults                  iFileSearchResults;
+    CDesCArray*                     iTextArray;
+    };
+
+
+// utility class for waiting for asychronous requests
+class CAsyncWaiter : public CActive
+	{
+public:
+	static CAsyncWaiter* NewL( TInt aPriority = EPriorityStandard );
+	static CAsyncWaiter* NewLC( TInt aPriority = EPriorityStandard );
+	~CAsyncWaiter();
+	
+	void StartAndWait();
+	TInt Result() const;
+	
+private:
+	CAsyncWaiter( TInt aPriority );
+	
+	// from CActive
+	void RunL();
+	void DoCancel();
+	
+private:
+    CActiveSchedulerWait iWait;
+	TInt iError;
+	};
+	
+	
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBStd.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSER_STD_H
+#define FILEBROWSER_STD_H
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <e32base.h>
+
+LOCAL_C inline TBool IsQHD(const TSize& aSize) { return ((aSize.iWidth==640 && aSize.iHeight==360) || (aSize.iWidth==360 && aSize.iHeight==640)); }
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/FBTraces.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSER_TRACES_H
+#define FILEBROWSER_TRACES_H
+
+#include <e32def.h>
+
+
+// ---------------------------------------------------------------------------
+// You can change these logging method values below! Recompile the application to take changes effect.
+
+    // logging methods
+    // 0 = No logging
+    // 1 = Flogger
+    // 2 = RDebug
+    // 3 = Flogger and RDebug
+    
+    #ifndef _DEBUG
+        
+        // Logging method for UREL/release builds:
+        #define FILEBROWSER_LOGGING_METHOD  0
+
+    #else
+
+        // Logging method for UDEB/debug builds:
+        #define FILEBROWSER_LOGGING_METHOD  2
+
+    #endif    
+    
+
+
+// ---------------------------------------------------------------------------
+// Do not make any changes to lines below...
+
+    #if FILEBROWSER_LOGGING_METHOD == 1 || FILEBROWSER_LOGGING_METHOD == 3
+
+        #include <flogger.h>
+        _LIT(KLogFolder,"Launcher");
+        _LIT(KLogFile,"Launcher_Trace.txt");
+
+    #endif
+
+    #if FILEBROWSER_LOGGING_METHOD == 2 || FILEBROWSER_LOGGING_METHOD == 3
+
+        #include <e32debug.h>
+
+    #endif
+
+
+    #if FILEBROWSER_LOGGING_METHOD == 0
+    
+        #define LOGTEXT(AAA)
+        #define LOGSTRING(AAA)
+        #define LOGSTRING2(AAA,BBB)
+        #define LOGSTRING3(AAA,BBB,CCC)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD)
+    
+    
+    #elif FILEBROWSER_LOGGING_METHOD == 1
+    
+        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+   
+    #elif FILEBROWSER_LOGGING_METHOD == 2
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
+    
+    #elif FILEBROWSER_LOGGING_METHOD == 3
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+
+    #endif
+
+// ---------------------------------------------------------------------------
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/engine.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,478 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+
+#include "engine.h"
+
+//#include "FBApp.h"
+#include "FB.hrh"
+#include "FBFileUtils.h"
+#include "FBStd.h"
+//#include <filebrowser.rsg>
+
+#include <eikenv.h>
+#include <coeutils.h>
+#include <bautils.h>
+#include <apaid.h>
+#include <s32file.h>
+
+// hash key selection related includes
+#ifndef __SERIES60_30__
+  #include <centralrepository.h>
+  #include <AknFepInternalCRKeys.h>
+  #include <AvkonInternalCRKeys.h>
+  #include <e32property.h> 
+#endif
+
+// CONSTANTS
+// UID of the application
+const TUid KUidFileBrowser = { 0x102828D6 };
+
+const TInt KSettingsDrive = EDriveC;
+_LIT(KSettingsFileName, "filebrowser_settings.ini");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CEngine* CEngine::NewL(MFileBrowserUI *aFileBrowserUI)
+    {
+    CEngine* self = new(ELeave) CEngine;
+    CleanupStack::PushL(self);
+    self->ConstructL(aFileBrowserUI);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CEngine::CEngine()
+    : iFileUtils(NULL)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ConstructL(MFileBrowserUI *aFileBrowserUI)
+    {
+    iFileBrowserUI = aFileBrowserUI;
+    iEnv = CEikonEnv::Static();
+    User::LeaveIfError(iLs.Connect());
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CEngine::~CEngine()
+    {
+	if (iFileUtils != NULL)
+	    delete iFileUtils;
+
+	iLs.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::ActivateEngineL()
+    {
+    TRAP_IGNORE( LoadSettingsL() );
+
+    iFileUtils = CFileBrowserFileUtils::NewL(this);
+
+    // get hash key selection value
+    GetHashKeySelectionStatus();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::DeActivateEngineL()
+    {
+    }
+	
+// --------------------------------------------------------------------------------------------
+
+//void CEngine::SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer)
+//    {
+//    iFileListContainer = aFileListContainer;
+//    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue)
+    {
+    if (aDicFS->IsPresentL(aUid))
+        {
+        RDictionaryReadStream in;
+        in.OpenLC(*aDicFS, aUid);
+        aValue = in.ReadInt16L();
+        CleanupStack::PopAndDestroy(); // in        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue)
+    {
+    if (aDicFS->IsPresentL(aUid))
+        {
+        RDictionaryReadStream in;
+        in.OpenLC(*aDicFS, aUid);
+        TInt bufLength = in.ReadInt16L();   // get length of descriptor
+        in.ReadL(aValue, bufLength);        // get the descriptor itself
+        CleanupStack::PopAndDestroy(); // in
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue)
+    {
+    RDictionaryWriteStream out;
+    out.AssignLC(*aDicFS, aUid);
+    out.WriteInt16L(aValue);
+    out.CommitL(); 	
+    CleanupStack::PopAndDestroy(1);// out
+    }
+
+// ---------------------------------------------------------------------------
+
+void CEngine::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue)
+    {
+    RDictionaryWriteStream out;
+    out.AssignLC(*aDicFS, aUid);
+    out.WriteInt16L(aValue.Length());       // write length of the descriptor
+    out.WriteL(aValue, aValue.Length());    // write the descriptor itself
+    out.CommitL(); 	
+    CleanupStack::PopAndDestroy(1);// out
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CEngine::LoadSettingsL()
+    {
+    const TSize screenSize = iEnv->ScreenDevice()->SizeInPixels();
+
+    // set defaults
+    iSettings.iDisplayMode = EDisplayModeFullScreen;
+    iSettings.iFileViewMode = IsQHD(screenSize) ? EFileViewModeExtended : EFileViewModeSimple;
+    iSettings.iShowSubDirectoryInfo = EFalse;
+    iSettings.iShowAssociatedIcons = EFalse;
+    iSettings.iRememberLastPath = EFalse;
+    iSettings.iLastPath = KNullDesC;
+    iSettings.iRememberFolderSelection = ETrue;
+#if 0 // TODO
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        iSettings.iEnableToolbar = ETrue;
+        }
+    else
+        {
+        iSettings.iEnableToolbar = EFalse;
+        }
+#else
+    iSettings.iEnableToolbar = EFalse;
+#endif
+#endif // TODO
+
+    iSettings.iSupportNetworkDrives = EFalse;
+    iSettings.iBypassPlatformSecurity = EFalse;
+    iSettings.iRemoveFileLocks = ETrue;
+    iSettings.iIgnoreProtectionsAtts = ETrue;
+    iSettings.iRemoveROMWriteProrection = ETrue;
+
+    // build specific defaults
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+    iSettings.iSupportNetworkDrives = ETrue;
+#endif 
+
+
+    // make sure that the private path of this app in c-drive exists
+    iEnv->FsSession().CreatePrivatePath( KSettingsDrive ); // c:\\private\\102828d6\\
+    
+    // handle settings always in the private directory 
+    if (iEnv->FsSession().SetSessionToPrivate( KSettingsDrive ) == KErrNone)
+        {
+        // open or create a dictionary file store
+        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iEnv->FsSession(), KSettingsFileName, KUidFileBrowser);
+
+        LoadDFSValueL(settingsStore, KFBSettingDisplayMode,                 iSettings.iDisplayMode);
+        LoadDFSValueL(settingsStore, KFBSettingFileViewMode,                iSettings.iFileViewMode);
+        LoadDFSValueL(settingsStore, KFBSettingShowSubDirectoryInfo,        iSettings.iShowSubDirectoryInfo);
+        LoadDFSValueL(settingsStore, KFBSettingShowAssociatedIcons,         iSettings.iShowAssociatedIcons);
+        LoadDFSValueL(settingsStore, KFBSettingRememberLastPath,            iSettings.iRememberLastPath);
+        LoadDFSValueL(settingsStore, KFBSettingLastPath,                    iSettings.iLastPath);
+        LoadDFSValueL(settingsStore, KFBSettingFolderSelection,             iSettings.iRememberFolderSelection);
+        LoadDFSValueL(settingsStore, KFBSettingEnableToolbar,               iSettings.iEnableToolbar);
+
+        LoadDFSValueL(settingsStore, KFBSettingSupportNetworkDrives,        iSettings.iSupportNetworkDrives);
+        LoadDFSValueL(settingsStore, KFBSettingBypassPlatformSecurity,      iSettings.iBypassPlatformSecurity);
+        LoadDFSValueL(settingsStore, KFBSettingRemoveFileLocks,             iSettings.iRemoveFileLocks);
+        LoadDFSValueL(settingsStore, KFBSettingIgnoreProtectionsAtts,       iSettings.iIgnoreProtectionsAtts);
+        LoadDFSValueL(settingsStore, KFBSettingRemoveROMWriteProtection,    iSettings.iRemoveROMWriteProrection);
+
+        CleanupStack::PopAndDestroy(); // settingsStore         
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::SaveSettingsL(TBool aNotifyModules)
+    {
+    // handle settings always in c:\\private\\102828d6\\
+    if (iEnv->FsSession().SetSessionToPrivate( KSettingsDrive ) == KErrNone)
+        {
+        // delete existing store to make sure that it is clean and not eg corrupted
+        if (BaflUtils::FileExists(iEnv->FsSession(), KSettingsFileName))
+            {
+            iEnv->FsSession().Delete(KSettingsFileName);
+            }
+        
+        // create a dictionary file store
+        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iEnv->FsSession(), KSettingsFileName, KUidFileBrowser);
+
+        SaveDFSValueL(settingsStore, KFBSettingDisplayMode,                 iSettings.iDisplayMode);
+        SaveDFSValueL(settingsStore, KFBSettingFileViewMode,                iSettings.iFileViewMode);
+        SaveDFSValueL(settingsStore, KFBSettingShowSubDirectoryInfo,        iSettings.iShowSubDirectoryInfo);
+        SaveDFSValueL(settingsStore, KFBSettingShowAssociatedIcons,         iSettings.iShowAssociatedIcons);
+        SaveDFSValueL(settingsStore, KFBSettingRememberLastPath,            iSettings.iRememberLastPath);
+        SaveDFSValueL(settingsStore, KFBSettingLastPath,                    iSettings.iLastPath);
+        SaveDFSValueL(settingsStore, KFBSettingFolderSelection,             iSettings.iRememberFolderSelection);
+        SaveDFSValueL(settingsStore, KFBSettingEnableToolbar,               iSettings.iEnableToolbar);
+
+        SaveDFSValueL(settingsStore, KFBSettingSupportNetworkDrives,        iSettings.iSupportNetworkDrives);
+        SaveDFSValueL(settingsStore, KFBSettingBypassPlatformSecurity,      iSettings.iBypassPlatformSecurity);
+        SaveDFSValueL(settingsStore, KFBSettingRemoveFileLocks,             iSettings.iRemoveFileLocks);
+        SaveDFSValueL(settingsStore, KFBSettingIgnoreProtectionsAtts,       iSettings.iIgnoreProtectionsAtts);
+        SaveDFSValueL(settingsStore, KFBSettingRemoveROMWriteProtection,    iSettings.iRemoveROMWriteProrection);
+        
+        settingsStore->CommitL();
+        CleanupStack::PopAndDestroy(); // settingsStore             
+        }
+
+    // update changes to modules
+    if (aNotifyModules)
+        {
+        //iScreenCapture->HandleSettingsChangeL();
+        if (iFileUtils != NULL) 
+			{
+			iFileUtils->HandleSettingsChangeL();
+			}
+        //iFileListContainer->HandleSettingsChangeL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::GetHashKeySelectionStatus()
+    {
+    TBool hashKeySelectionInUse(EFalse);
+    
+#ifndef __SERIES60_30__
+    
+    // get hash key selection value
+    TRAP_IGNORE(
+        CRepository* repository = CRepository::NewLC(KCRUidAknFep);
+        repository->Get(KAknFepHashKeySelection, hashKeySelectionInUse);
+        CleanupStack::PopAndDestroy();
+    );
+    
+    // even if hash key selection is in use, ignore the value in qwerty mode
+    if (hashKeySelectionInUse)
+        {
+        TBool qwertyMode(EFalse);
+        RProperty qwertyModeStatusProperty;
+        qwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive);
+        qwertyModeStatusProperty.Get(qwertyMode);
+        qwertyModeStatusProperty.Close();
+        
+        if (qwertyMode)
+            hashKeySelectionInUse = EFalse;        
+        }
+
+#endif
+
+    iIsHashKeySelectionInUse = hashKeySelectionInUse;
+    }
+    	
+// --------------------------------------------------------------------------------------------
+
+TInt CEngine::LaunchSettingsDialogL()
+    {
+	TInt retValue = KErrNone;
+	// TODO:
+    // set to normal mode
+    //iFileListContainer->SetScreenLayoutL(EDisplayModeNormal);
+    //iFileListContainer->DeleteNaviPane();
+    //iFileListContainer->HideToolbar();
+    
+    // launch the dialog and save settings
+    //CFileBrowserSettingViewDlg* dlg = CFileBrowserSettingViewDlg::NewL(iSettings);
+    //TInt retValue = dlg->ExecuteLD(R_FILEBROWSER_SETTINGS_DIALOG);        
+    //FileListContainer()->CreateEmptyNaviPaneLabelL();
+    TRAP_IGNORE(SaveSettingsL());
+    return retValue;
+    }
+	
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CAsyncWaiter* CAsyncWaiter::NewL(TInt aPriority)
+	{
+	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
+	return self;
+	}
+
+CAsyncWaiter* CAsyncWaiter::NewLC(TInt aPriority)
+	{
+	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
+	CleanupStack::PushL(self);
+	return self;
+	}
+	
+CAsyncWaiter::CAsyncWaiter(TInt aPriority) : CActive(aPriority)
+	{
+	CActiveScheduler::Add(this);
+	}	
+
+CAsyncWaiter::~CAsyncWaiter()
+	{
+	Cancel();
+	}
+	
+void CAsyncWaiter::StartAndWait()
+	{
+        iStatus = KRequestPending;
+        SetActive();
+        iWait.Start();
+	}
+	
+TInt CAsyncWaiter::Result() const
+	{
+	return iError;
+	}
+	
+void CAsyncWaiter::RunL()
+	{
+	iError = iStatus.Int();
+	//CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+	iWait.AsyncStop();
+	}
+	
+void CAsyncWaiter::DoCancel()
+	{
+	iError = KErrCancel;
+    if( iStatus == KRequestPending )
+        {
+        TRequestStatus* s=&iStatus;
+        User::RequestComplete( s, KErrCancel );
+        }
+
+    //CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+	iWait.AsyncStop();
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::OpenWithApparcL(TFileName aFileName)
+        {
+	if (iFileUtils != NULL) 
+		{
+		iFileUtils->OpenWithApparcL(aFileName);
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed)
+        {
+	if (iFileUtils != NULL) 
+		{
+		iFileUtils->OpenWithDocHandlerL(aFileName, aEmbed);
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+
+//TInt CEngine::QueryCurrentItemIndex()
+//	{
+//        return iFileBrowserUI->QueryCurrentItemIndex();
+//	}
+
+// --------------------------------------------------------------------------------------------	
+
+TSearchAttributes CEngine::GetSearchAttributes()
+	{
+	if (iFileUtils != NULL) 
+		{
+		return iFileUtils->GetSearchAttributes();
+		} 
+	else
+		{
+		return TSearchAttributes(); 
+		}
+	}
+
+// --------------------------------------------------------------------------------------------	
+
+void CEngine::ChangeAttributes(TSearchAttributes attributes) 
+	{ 
+	if (iFileUtils != NULL) 
+		{
+		iFileUtils->ChangeAttributes(attributes); 
+		}
+	}
+
+// --------------------------------------------------------------------------------------------	
+
+TSearchResults CEngine::SearchResults() 
+	{ 
+	if (iFileUtils != NULL) 
+		{
+		return iFileUtils->SearchResults(); 
+		}
+	else
+		{
+		return TSearchResults();
+		}
+	}
+
+// --------------------------------------------------------------------------------------------	
+
+CFileEntryList* CEngine::FoundFiles() 
+	{ 
+	if (iFileUtils != NULL) 
+		{
+		return iFileUtils->FoundFiles(); 
+		}
+	else 
+		{
+		return NULL;
+		}
+	}
+	
+// --------------------------------------------------------------------------------------------	
+
+void CEngine::SearchL() 
+	{ 
+	if (iFileUtils != NULL) 
+		{
+		TRAP_IGNORE(iFileUtils->SearchL()); 
+		}
+	}
+	
+// --------------------------------------------------------------------------------------------	
+	
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/engine/engine.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __ENGINE_H__
+#define __ENGINE_H__
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <apgcli.h>
+#include <CAknMemorySelectionSettingPage.h>
+#include "FBFileUtils.h"
+
+// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
+const TUid KFBSettingDisplayMode                   = { 0x00 };
+const TUid KFBSettingFileViewMode                  = { 0x01 };
+const TUid KFBSettingShowSubDirectoryInfo          = { 0x02 };
+const TUid KFBSettingShowAssociatedIcons           = { 0x03 };
+const TUid KFBSettingRememberLastPath              = { 0x04 };
+const TUid KFBSettingLastPath                      = { 0x05 };
+
+const TUid KFBSettingSupportNetworkDrives          = { 0x06 };
+const TUid KFBSettingBypassPlatformSecurity        = { 0x07 };
+const TUid KFBSettingRemoveFileLocks               = { 0x08 };
+const TUid KFBSettingIgnoreProtectionsAtts         = { 0x09 };
+const TUid KFBSettingRemoveROMWriteProtection      = { 0x0A };
+
+const TUid KFBSettingFolderSelection               = { 0x0B };
+const TUid KFBSettingEnableToolbar                 = { 0x0C };
+
+
+// FORWARD DECLARATIONS
+class CFileBrowserFileListContainer;
+class CFileBrowserScreenCapture;
+class CFileBrowserFileUtils;
+class CEikonEnv;
+class CAknGlobalConfirmationQuery;
+class CDictionaryFileStore;
+class MFileBrowserUI;
+
+// CLASS DECLARATIONS
+
+class TFileBrowserSettings
+    {
+public:
+    TInt                                        iDisplayMode;
+    TInt                                        iFileViewMode;
+    TBool                                       iShowSubDirectoryInfo;
+    TBool                                       iShowAssociatedIcons;
+    TBool                                       iRememberLastPath;
+    TFileName                                   iLastPath;
+    TBool                                       iRememberFolderSelection;
+    TBool                                       iEnableToolbar;
+
+    TBool                                       iSupportNetworkDrives;
+    TBool                                       iBypassPlatformSecurity;
+    TBool                                       iRemoveFileLocks;
+    TBool                                       iIgnoreProtectionsAtts;
+    TBool                                       iRemoveROMWriteProrection;
+    };
+
+// INFERFACE FOR COMMUNICATION WITH UI
+
+class MFileBrowserUI
+{
+public:
+    /**
+      * Method from getting current index
+      * @return current index.
+      */
+//    virtual TInt QueryCurrentItemIndex() = 0;
+
+    /**
+     * Shows info message with text
+     * @param A aText text to be shown in message body.
+     * @param A aTitle text to be shown in message title.
+     * @return None.
+     */
+    virtual void ShowInformationNote(const TDesC &aDescText, const TDesC &aDescTitle) = 0;
+
+    /**
+     * Shows error message with error text
+     * @param aText An error text to be shown in message.
+     * @return None.
+     */
+    virtual void ShowErrorNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
+
+    /**
+     * Shows confirmation message with text
+     * @param aText An text to be shown in message.
+     * @return None.
+     */
+    virtual void ShowConfirmationNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
+
+//    /**
+//     * Shows progress bar with text
+//     * @param aText A text to be shown at top of the progress bar.
+//     * @param aMinimum A minimum progress bar value.
+//     * @param aMaximum A maximum progress bar value.
+//     * @return None.
+//     */
+//    virtual void ShowProgressBar(const TDesC& aText, TInt aMinimum, TInt aMaximum ) = 0;
+//
+//    /**
+//     * Sets progress bar value
+//     * @param aValue A value between min and max value of the progress bar range
+//     * @return None.
+//     */
+//    virtual void SetProgressBarValue(TInt aValue) = 0;
+//
+//    /**
+//     * Hides progress bar
+//     * @return None.
+//     */
+//    virtual void HideProgressBar() = 0;
+//
+//    /**
+//     * Shows wait dialog with text
+//     * @param aText A text to be shown at top of the wait bar.
+//     * @return None.
+//     */
+//    virtual void ShowWaitDialog(const TDesC& aText) = 0;
+//
+//    /**
+//     * Hides wait dialog
+//     * @return None.
+//     */
+//    virtual void HideWaitDialog() = 0;
+
+    /**
+     * Shows confirmation dialog
+     * @param aFileName String contaning file name and path
+     * @return ETrue if user pressed OK button, otherwise EFalse.
+     */
+    virtual TBool ShowConfirmationQuery(const TDesC& aDescText) = 0;
+
+};
+
+class CEngine : public CBase
+    {
+public:
+    static CEngine* NewL(MFileBrowserUI *aFileBrowserUI);
+    ~CEngine();
+
+private:
+    CEngine();
+    void ConstructL(MFileBrowserUI *aFileBrowserUI);
+    void LoadSettingsL();
+    void GetHashKeySelectionStatus();
+    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
+    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
+    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
+    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
+
+public:
+    void ActivateEngineL();
+    void DeActivateEngineL();
+    void SaveSettingsL(TBool aNotifyModules=ETrue);
+//    void SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer);
+    TInt LaunchSettingsDialogL();
+    inline TFileBrowserSettings& Settings() { return iSettings; }
+    inline CEikonEnv* EikonEnv() { return iEnv; }
+    inline RApaLsSession& LsSession() { return iLs; }
+    inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
+    inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
+    inline MFileBrowserUI* FileBrowserUI() { return iFileBrowserUI; }
+    inline CFileBrowserFileListContainer* FileListContainer() { return iFileListContainer; }
+    inline TBool IsHashKeySelectionInUse() { return iIsHashKeySelectionInUse; }
+
+    void OpenWithApparcL(TFileName aFileName);
+    void OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed);
+//    TInt QueryCurrentItemIndex();
+//    CArrayFix<TInt> *GetSelectedIndices();
+    TSearchAttributes GetSearchAttributes();
+    void ChangeAttributes(TSearchAttributes attributes);
+    TSearchResults SearchResults();
+    CFileEntryList* FoundFiles();	
+    void SearchL();
+
+private:
+    MFileBrowserUI                  *iFileBrowserUI;
+    CFileBrowserFileListContainer   *iFileListContainer;
+    CFileBrowserScreenCapture       *iScreenCapture;
+    CFileBrowserFileUtils           *iFileUtils;
+    CEikonEnv*                      iEnv;
+    TFileBrowserSettings            iSettings;
+    RApaLsSession                   iLs;
+    TBool                           iIsHashKeySelectionInUse; 
+    };
+   
+
+#endif // __ENGINE_H__
--- a/filebrowser/envpatcher/EnvPatcher.pl	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,544 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-# 
-# Description:
-# Environment Patcher - Patches older S60 SDKs for supporting
-# tricks in newer platforms
-#
-
-
-require v5.6.1;	
-
-use File::Copy;
-use strict;
-
-# check amount of commandline options is valid
-if (@ARGV != 1)
-{
-    print "Usage: EnvPatcher <EPOCROOT>\n";
-    exit 1;
-}
-
-
-# get epocroot and convert, convert \ -> /
-(my $epocroot = $ARGV[0]) =~ s{\\}{/}g;
-
-# remove any trailing forward slashes
-$epocroot =~ s/\/$//;
-
-
-# create variables for paths
-my $e32toolsdir = $epocroot."/epoc32/tools";
-my $e32includedir = $epocroot."/epoc32/include";
-my $e32includeoemdir = $e32includedir."/oem";
-my $platformpathspath = $e32includedir."/platform_paths.hrh";
-my $domainplatformpathspath = $e32includedir."/domain/osextensions/platform_paths.hrh";
-my $mmppmpath = $e32toolsdir."/mmp.pm";
-my $pathutlpmpath = $e32toolsdir."/pathutl.pm";
-my $prepfilepmpath = $e32toolsdir."/prepfile.pm";
-
-# variables for hacked content
-my $dependshack = "\t\t\tif (/^DEPENDS\$/o) {\r\n\t\t\t\tnext LINE;  # Ignore DEPENDS keyword, not needed by ABLD\r\n\t\t\t}\r\n";
-my $smpsafehack = "\t\tif (/^SMPSAFE\$/o) {\r\n\t\t\tnext LINE;  # Ignore SMPSAFE keyword, not needed by older environments\r\n\t\t}\r\n";
-my $forwardslashhack = "\t\t# EnvPatcher forwardslash hack begins\r\n\t\t\$_=~s{/}{\\\\}g;   # convert all forward slashes to backslashes\r\n\t\t# EnvPatcher forwardslash hack ends\r\n\r\n";
-my $coreibyexportsupport = "\r\n// Following definition is used for exporting tools and stubs IBY files to\r\n// Core image.\r\n#define CORE_IBY_EXPORT_PATH(path,exported)  /epoc32/rom/include/##exported\r\n";
-
-
-# check epoc32\tools exists
-unless (-d $e32toolsdir)
-{
-    print "$e32toolsdir not found, please check valid epocroot has been given!\n";
-    exit 1;
-}
-
-# check epoc32\include exists
-unless (-d $e32includedir)
-{
-    print "$e32includedir not found, please check valid epocroot has been given!\n";
-    exit 1;
-}
-
-
-# create epoc32\include\oem if it does not exist
-unless (-d $e32includeoemdir)
-{
-    mkdir $e32includeoemdir or die;
-    print "Missing directory $e32includeoemdir created succesfully.\n";
-}
-
-
-# check if epoc32\include\domain\osextensions\platform_paths.hrh exists
-if (-e $domainplatformpathspath)
-{
-    # show an error if the file does not have any platform macros
-    unless (string_exists_in_file($domainplatformpathspath, "OS_LAYER_SYSTEMINCLUDE"))
-    {
-        print "ERROR: $domainplatformpathspath does not have SF macros.\n";
-        print "Please check your environment, if you have S60 3.2 OEM or newer, please get the latest version!\n";
-        exit 2;
-    }
-}
-
-
-# check if epoc32\include\platform_paths.hrh exists
-if (-e $platformpathspath)
-{
-    print "$platformpathspath already exists, not checking it.\n";    
-}
-else
-{
-    # create the file missing file
-    create_default_platform_paths_hrh();
-    print "Missing file $platformpathspath created succesfully.\n";    
-}
-
-
-# check if CORE_IBY_EXPORT_PATH macro exist in the platform_paths.hrh
-unless (string_exists_in_file($platformpathspath, "CORE_IBY_EXPORT_PATH"))
-{
-    # read content of the platform_paths.hrh
-    my @filecontent = read_file_to_array($platformpathspath);  
-
-    my $match_found = 0;
-    my $i = 0;
-    my $match_found_pos = 0;
-    
-    # find the position where the include guards start (this should be a safe position)
-    foreach (@filecontent)
-    {
-        if ($_ =~ /#define PLATFORM_PATHS_HRH/)
-        {
-            $match_found = 1;
-            $match_found_pos = $i;
-            last;
-        } 
-
-        $i++;
-    }
-    
-    if ($match_found)
-    {
-        # insert the patched content to the file
-        splice(@filecontent, $match_found_pos+1, 0, $coreibyexportsupport);
-        
-        # write the modified array to the file
-        write_file_from_array($platformpathspath, @filecontent);
-    
-        print "Platform_paths.hrh updated to support CORE_IBY_EXPORT_PATH macro.\n";
-    }
-    else
-    {
-        print "WARNING: $platformpathspath is corrupted or not supported!\n";    
-    }
-}
- 
-    
-# check if epoc32\tools\mmp.pm exists
-if (-e $mmppmpath)
-{
-    # check if DEPENDS keyword already exists in the file
-    if (string_exists_in_file($mmppmpath, "DEPENDS"))
-    {
-        print "The SDK can already handle DEPENDS keyword in a MMP file.\n";        
-    }
-    else
-    {
-        # read content of the mmp.pm file
-        my @filecontent = read_file_to_array($mmppmpath);
-        
-        my $match_found = 0;
-        my $i = 0;
-        my $match_found_pos = 0;
-        
-        # loop through the array to find the correct place
-        foreach (@filecontent)
-        {
-            if ($_ =~ /Unrecognised Resource Keyword/)
-            {
-                $match_found = 1;
-                $match_found_pos = $i;
-                last;
-            } 
-
-            $i++;
-        }
-        
-        if ($match_found)
-        {
-            # insert the patched content to the file
-            splice(@filecontent, $match_found_pos-1, 0, $dependshack);
-            
-            # write the modified array to the file
-            write_file_from_array($mmppmpath, @filecontent);
-        
-            print "Mmp.pm patched with DEPENDS keyword hack.\n";
-        }
-        else
-        {
-            print "ERROR: Unable to find correct place from $mmppmpath for patching!\n";
-            print "Your SDK environment probably is not supported by this script!\n";
-            exit(2);    
-        }
-    }
-
-    # check if SMPSAFE keyword already exists in the file
-    if (string_exists_in_file($mmppmpath, "SMPSAFE"))
-    {
-        print "The SDK can already handle SMPSAFE keyword in a MMP file.\n";        
-    }
-    else
-    {
-        # read content of the mmp.pm file
-        my @filecontent = read_file_to_array($mmppmpath);
-        
-        my $match_found = 0;
-        my $i = 0;
-        my $match_found_pos = 0;
-        
-        # loop through the array to find the correct place
-        foreach (@filecontent)
-        {
-            if ($_ =~ /Unrecognised Keyword/)
-            {
-                $match_found = 1;
-                $match_found_pos = $i;
-                last;
-            } 
-
-            $i++;
-        }
-        
-        if ($match_found)
-        {
-            # insert the patched content to the file
-            splice(@filecontent, $match_found_pos, 0, $smpsafehack);
-            
-            # write the modified array to the file
-            write_file_from_array($mmppmpath, @filecontent);
-        
-            print "Mmp.pm patched with SMPSAFE keyword hack.\n";
-        }
-        else
-        {
-            print "ERROR: Unable to find correct place from $mmppmpath for patching!\n";
-            print "Your SDK environment probably is not supported by this script!\n";
-            exit(2);    
-        }
-    }
-}
-else
-{
-    print "WARNING: $mmppmpath not found, this environment is not supported!\n";
-}
-
-
-# check if epoc32\tools\pathutl.pm exists
-if (-e $pathutlpmpath)
-{
-    # check if "sub Path_Norm" already exists in the pathutil.pm file
-    # if it does not exists, then we need to patch prepfile.pm
-    if (string_exists_in_file($pathutlpmpath, "sub Path_Norm"))
-    {
-        print "The SDK is non Symbian OS 9.1, no need to add forward slash hack.\n";        
-    }
-    else
-    {
-        # check if prepfile.pm has already been patched
-        if (string_exists_in_file($prepfilepmpath, "EnvPatcher forwardslash hack"))
-        {        
-            print "The SDK has already been patched with forwardslash hack.\n";         
-        }
-        else
-        {    
-            # read content of the prepfile.pm file
-            my @filecontent = read_file_to_array($prepfilepmpath);  
-    
-            my $match_found = 0;
-            my $i = 0;
-            my $match_found_pos = 0;
-            
-            # loop through the array to find the correct place
-            foreach (@filecontent)
-            {
-                if ($_ =~ /# skip blank lines/)
-                {
-                    $match_found = 1;
-                    $match_found_pos = $i;
-                    last;
-                } 
-    
-                $i++;
-            }
-            
-            if ($match_found)
-            {
-                # insert the patched content to the file
-                splice(@filecontent, $match_found_pos+6, 0, $forwardslashhack);
-                
-                # write the modified array to the file
-                write_file_from_array($prepfilepmpath, @filecontent);
-            
-                print "Prepfile.pm patched with forward slash hack.\n";
-            }
-            else
-            {
-                print "ERROR: Unable to find correct place from $prepfilepmpath for patching!\n";
-                print "Your SDK environment probably is not supported by this script!\n";
-                exit(2);    
-            }
-        }
-    }    
-}
-else
-{
-    print "WARNING: $pathutlpmpath not found, this environment is not supported!\n";
-}
- 
- 
- 
-# checks if string exists in the file    
-sub string_exists_in_file
-{
-    my $filepath = $_[0];
-    my $findstring = $_[1];
-    my $match_found = 0;     
-
-    open(FILE, "<", $filepath) or die "Failed to open $filepath for reading!";
-
-    # loop through the file for occurances
-    while (<FILE>)
-    {
-        if ($_ =~ /$findstring/)
-        {
-            $match_found = 1;
-            last;
-        } 
-    }
-
-    close FILE;
-    
-    return $match_found;
-}
-
-
-# reads lines from a file to an array    
-sub read_file_to_array
-{
-    my $filepath = $_[0];
-
-    open(FILE, "<", $filepath) or die "Failed to open $filepath for reading!";
-    my @data = <FILE>;
-    close FILE;
-    
-    return(@data);
-}
-
-
-# writes lines from an array to a file
-sub write_file_from_array
-{
-    my ($filepath, @data) = @_;
-    
-    # take a backup of the file
-    copy ($filepath, $filepath."EnvPatcher") or die "Cannot take backup of $filepath to $filepath.EnvPatcher";
-        
-    open(FILE, ">", $filepath) or die "Failed to open $filepath for writing!";
-
-    # write the array to file
-    foreach my $line (@data)
-    {
-        print FILE "$line";
-    }
-
-    close FILE;
-}
-
-sub create_default_platform_paths_hrh
-{
-    # the file does not exist, so create the missing file
-    open(FILE, ">", $platformpathspath) or die "Failed to open $platformpathspath for writing!\n";
-    
-    print FILE <<ENDOFTHEFILE;
-#ifndef PLATFORM_PATHS_HRH
-#define PLATFORM_PATHS_HRH
-
-/**
-* ---------------------------------------
-* Location, where the applications layer specific public headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define APP_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define APP_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the applications layer specific platform headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define APP_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define APP_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the middleware layer specific public headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define MW_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define MW_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the middleware layer specific platform headers should be exported
-* ---------------------------------------
-*/
-#define MW_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define MW_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the os layer specific public headers should be exported
-* ---------------------------------------
-*/
-#define  OSEXT_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define  OS_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the os specific platform headers should be exported
-* ---------------------------------------
-*/
-#define OSEXT_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define OS_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the  cenrep excel sheets should be exported
-* Deprecated: should no longer be used. Kept for compability.
-* ---------------------------------------
-*/
-#define CENREP_XLS_EXPORT_PATH(exported) /epoc32/tools/cenrep/data/src/##exported
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be 
-* used in the mmp-files that are part of the applications-layer. It includes all 
-* the needed directories from the /epoc32/include, that are valid ones for the 
-* application-layer components. 
-*
-* Applications layer is the last one in the list, since most likely the most of 
-* the headers come from middleware or os-layer  => thus they are first.
-*/
-#define APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
- 
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the middleware-layer. It includes all 
-* the needed directories from the /epoc32/include, that are valid ones for the 
-* middleware-layer components. 
-*/
-#define MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the  osextensions-layer. It includes all
-* the needed directories from the /epoc32/include, that are valid ones for the
-* os-layer components. 
-*/
-#define OS_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
-
-
-// Below statement is Deprecated and the OS_LAYER_SYSTEMINCLUDE-macro has to be
-// used.
-#define OSEXT_LAYER_SYSTEMINCLUDE OS_LAYER_SYSTEMINCLUDE
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the os-layer. This is intended 
-* to be only used by those components which need to use in their mmp-file either
-* kern_ext.mmh or nkern_ext.mmh. Reason is that those
-* 2 files already contain the /epoc32/include  as system include path.
-* 
-*/
-#define OS_LAYER_KERNEL_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/oem
-
-
-// Below statement is Deprecated and the OS_LAYER_KERNEL_SYSTEMINCLUDE-macro 
-// has to be used.
-#define OSEXT_LAYER_KERNEL_SYSTEMINCLUDE OS_LAYER_KERNEL_SYSTEMINCLUDE
-
-/**
-****************************************************************************
-* Definitions that also define the paths to the layer specific source directories.
-****************************************************************************
-*/
-/**
-* The below 3 macros define the paths to the layer-specific source dirs.
-* See usage on top of this hrh-file, these are used the same way as 
-* for instance the OS_LAYER_DOMAIN_EXPORT_PATH
-* Deprecated: is not allowed to be using in Symbian Foundation
-*/
-#define APP_LAYER_SOURCE_PATH(rest)    /s60/app/##rest
-#define MW_LAYER_SOURCE_PATH(rest)     /s60/mw/##rest
-#define OSEXT_LAYER_SOURCE_PATH(rest)  /s60/osext/##rest
-
-/**
-****************************************************************************
-* Definitions to export IBY files to different folders where they will be taken 
-* to ROM image
-****************************************************************************
-*/
-// Following definition is used for exporting tools and stubs IBY files to 
-// Core image.
-#define CORE_IBY_EXPORT_PATH(path,exported)  /epoc32/rom/include/##exported
-
-/**
-* ---------------------------------------
-* Macros for Configuration tool migration. 
-* The below macros define the location under epoc32, where the confml 
-* (Configuration Markup Language) and crml (Central Repository Markup Language) 
-* files should be exported.
-* ---------------------------------------
-*/
-#define CONFML_EXPORT_PATH(file,category)           /epoc32/rom/config/confml_data/##category##/##file
-#define CRML_EXPORT_PATH(file,category)             /epoc32/rom/config/confml_data/##category##/##file
-#define GCFML_EXPORT_PATH(file,category)            /epoc32/rom/config/confml_data/##category##/##file
-#define CONFML_CONFIG_EXPORT_PATH(file,category)    /epoc32/rom/config/confml_data/##category##/config/##file
-
-#define APP_LAYER_CONFML(exported) 	                CONFML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_CRML(exported)                    CRML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_GCFML(exported)                   GCFML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_CONFML_CONFIG(exported)           CONFML_CONFIG_EXPORT_PATH(exported,s60)
-                                                    
-#define MW_LAYER_CONFML(exported)                   CONFML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_CRML(exported)                     CRML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_GCFML(exported)                    GCFML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_CONFML_CONFIG(exported)            CONFML_CONFIG_EXPORT_PATH(exported,s60)
-       
-// Deprecate: Use the OS_LAYER_* macros instead of OSEXT_LAYER_*                                             
-#define OSEXT_LAYER_CONFML(exported)                CONFML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_CRML(exported)                  CRML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_GCFML(exported)                 GCFML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_CONFML_CONFIG(exported)         CONFML_CONFIG_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CONFML(exported)                   CONFML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CRML(exported)                     CRML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_GCFML(exported)                    GCFML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CONFML_CONFIG(exported)            CONFML_CONFIG_EXPORT_PATH(exported,s60)
-
-#endif  // end of PLATFORM_PATHS_HRH
-
-ENDOFTHEFILE
-
-    close FILE;    
-}
--- a/filebrowser/envpatcher/ReadMe.txt	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-Environment Patcher v1.0.1
-==========================
-
-Updated: 12th November 2009
-
-
-Introduction:
--------------
-This tool can be used to patch your S60 SDK environment so that the tricks and
-macros introduced in the latest SDKs can be used in a public SDK and older
-OEM releases.
-
-This tool can perform the following tasks:
-- Adds support for forward slashes in paths in bld.inf/.mmp files in S60 3.0 
-- Removes an unncessary warning about DEPENDS and SMPSAFE resource keywords in
-  an .mmp file
-- Creates a missing epoc32\include\platform_paths.hrh file for supporting
-  platform macros introduced since S60 3.2 OEM and Symbian Foundation releases
-- Modifies epoc32\include\platform_paths.hrh for missing macros   
-- Creates a missing epoc32\include\oem directory to suppress a possible warning
-
-
-Usage:
-------
-EnvPatcher.pl <EPOCROOT>
-
-Where EPOCROOT is the path to the root of the SDK, for example:
-  EnvPatcher.pl c:\Symbian\9.1\S60_3rd_MR
-  EnvPatcher.pl z:\
-
-
-Requirements:
--------------
-- S60 SDK (public or OEM), version 3.0 or newer
-- Perl 5.6.1 or newer
-
-
-
-
-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 "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/filebrowser.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+TEMPLATE = subdirs
+
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG
+
+SUBDIRS = group \
+          ui
--- a/filebrowser/fileopclient/inc/FBFileOpClient.h	Mon May 03 12:32:02 2010 +0300
+++ b/filebrowser/fileopclient/inc/FBFileOpClient.h	Fri May 14 15:53:02 2010 +0300
@@ -29,11 +29,11 @@
 // CLASS DECLARATIONS
 
 class RFBFileOpServerSession : public RSessionBase
-	{
+    {
 public:
-	TInt Connect();
+    TInt Connect();
 	
-	void Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch, TRequestStatus& aStatus);
+    void Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch, TRequestStatus& aStatus);
     TInt Rename(const TDesC& anOld, const TDesC& aNew, TUint aSwitch); 
     TInt Attribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
     void RmDir(const TDesC& aDirName, TUint aSwitch, TRequestStatus& aStatus); 
@@ -45,9 +45,9 @@
     TInt CancelOp();
 
 private:
-	TVersion Version() const;
-	TPckgBuf<TFileOpArgs> iPckgBuf;
-	};
+    TVersion Version() const;
+    TPckgBuf<TFileOpArgs> iPckgBuf;
+    };
 
 
 class CFBFileOpClient : public CBase
@@ -55,7 +55,7 @@
 public:
     IMPORT_C static CFBFileOpClient* NewL();
     IMPORT_C ~CFBFileOpClient();
-	IMPORT_C TInt Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); 
+    IMPORT_C TInt Copy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch);
     IMPORT_C TInt Rename(const TDesC& anOld, const TDesC& aNew, TUint aSwitch); 
     IMPORT_C TInt Attribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
     IMPORT_C TInt RmDir(const TDesC& aDirName, TUint aSwitch); 
--- a/filebrowser/group/ReleaseNotes_FileBrowser.txt	Mon May 03 12:32:02 2010 +0300
+++ b/filebrowser/group/ReleaseNotes_FileBrowser.txt	Fri May 14 15:53:02 2010 +0300
@@ -1,7 +1,7 @@
 ===============================================================================
 
-RELEASE NOTES - FILEBROWSER v4.5.2
-RELEASED 10th December 2009
+RELEASE NOTES - FILEBROWSER v5.0.0
+RELEASED 23th April 2010
 
 SUPPORTS S60 3.0+
 
@@ -37,10 +37,9 @@
 
 ===============================================================================
 
-What's New in v4.5.2
+What's New in v5.0.0
 ====================
-- Fix: UI layout problems fixed
-- Fix: Filebrowser crashes with too long filenames
+- Orbit UI
 
 ===============================================================================
 
@@ -110,6 +109,11 @@
 Version History:
 ================
 
+Version 4.5.2 - 10th December 2009
+-----------------------------
+- Fix: UI layout problems fixed
+- Fix: Filebrowser crashes with too long filenames
+
 Version 4.5.1 - 15th May 2009
 -----------------------------
 - Fix: Refreshing display does not work well when starting FileBrowser
--- a/filebrowser/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-#ifndef FILEBROWSER_LITE
-  #include "../fileopserver/group/bld.inf"
-  #include "../fileopclient/group/bld.inf"
-#endif
-
-PRJ_EXPORTS
-../group/backup_registration.xml    Z:/private/102828D6/backup_registration.xml
-../rom/filebrowser.iby CORE_IBY_EXPORT_PATH(tools,filebrowser.iby)
-
-
-PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
-  gnumakefile filebrowser_icons_aif.mk
-  gnumakefile filebrowser_extraicons.mk
-
-  #ifdef MARM
-  gnumakefile filebrowser_stub_sis.mk
-  #endif
-#endif
-
-filebrowser.mmp
-
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE filebrowser_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_filebrowser
-  END
-
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE filebrowser_extraicons.mif
-  OPTION HEADERFILE filebrowser_extraicons.mbg
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_indi_tb_filebrowser_folder_parent -c8,8 qgn_indi_tb_filebrowser_find -c8,8 qgn_indi_tb_filebrowser_selection -c8,8 qgn_indi_tb_filebrowser_selection_active
-  END
-  
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME FileBrowser_stub
-  END
-  #endif  
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/bld_generic.inf	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+#ifndef FILEBROWSER_LITE
+  #include "../fileopserver/group/bld.inf"
+  #include "../fileopclient/group/bld.inf"
+#endif
+
+PRJ_EXPORTS
+../group/backup_registration.xml    Z:/private/102828D6/backup_registration.xml
+../rom/filebrowser.iby CORE_IBY_EXPORT_PATH(tools,filebrowser.iby)
+
+
+PRJ_MMPFILES
+#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+
+  #ifdef MARM
+  gnumakefile filebrowser_stub_sis.mk
+  #endif
+#endif
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
+  PRJ_EXTENSIONS
+
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME FileBrowser_stub
+  END
+  #endif  
+#endif
--- a/filebrowser/group/filebrowser.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-TARGET            FileBrowser.exe
-TARGETTYPE        exe
-EPOCSTACKSIZE     0x5000
-EPOCHEAPSIZE      0x10000 0x2000000  // Min 64kB, Max 32MB
-
-UID               0x100039CE 0x102828D6
-
-VENDORID          VID_DEFAULT
-CAPABILITY        CAP_APPLICATION AllFiles DiskAdmin
-
-SMPSAFE
-
-LANG              SC
-
-
-START RESOURCE    ../data/filebrowser.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../data/filebrowser_reg.rss
-DEPENDS           filebrowser.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE     /epoc32/include/connect
-USERINCLUDE       ../inc
-#ifndef FILEBROWSER_LITE 
-  USERINCLUDE       ../fileopclient/inc 
-#endif
-SOURCEPATH        ../src
-
-
-SOURCE            FBApp.cpp
-SOURCE            FBDocument.cpp 
-SOURCE            FBAppUi.cpp
-SOURCE            FBFileListView.cpp 
-SOURCE            FBFileListContainer.cpp 
-SOURCE            FBModel.cpp
-SOURCE            FBSettingViewDlg.cpp
-SOURCE            FBFileUtils.cpp
-SOURCE            FBFileOps.cpp
-SOURCE            FBFileDlgs.cpp
-SOURCE            FBFileEditor.cpp
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  SOURCE            FBToolbar.cpp
-#endif
-
-LIBRARY           euser.lib
-LIBRARY           apparc.lib
-LIBRARY           cone.lib 
-LIBRARY           eikcore.lib  
-LIBRARY           avkon.lib 
-LIBRARY           aknnotify.lib
-LIBRARY           ws32.lib
-LIBRARY           fbscli.lib
-LIBRARY           ImageConversion.lib
-LIBRARY           PlatformEnv.lib
-LIBRARY           CommonDialogs.lib
-LIBRARY           eikcoctl.lib
-LIBRARY           aknskins.lib
-LIBRARY           apgrfx.lib
-LIBRARY           efsrv.lib
-LIBRARY           CommonEngine.lib
-LIBRARY           bafl.lib
-LIBRARY           CentralRepository.lib
-LIBRARY           mediaclientaudio.lib
-LIBRARY           estor.lib
-LIBRARY           gdi.lib
-LIBRARY           eikctl.lib
-LIBRARY           eikcdlg.lib
-LIBRARY           eikdlg.lib
-LIBRARY           aknicon.lib
-LIBRARY           egul.lib
-LIBRARY           commonui.lib
-LIBRARY           apmime.lib
-LIBRARY           sendui.lib
-LIBRARY           msgs.lib
-LIBRARY           ezlib.lib
-LIBRARY           cdlengine.lib 
-LIBRARY           remconcoreapi.lib
-LIBRARY           remconinterfacebase.lib
-LIBRARY           sbeclient.lib
-LIBRARY           hash.lib
-LIBRARY           etext.lib
-LIBRARY           charconv.lib
-LIBRARY           AknLayout2Scalable.lib
-LIBRARY           tzclient.lib
-
-#ifndef FILEBROWSER_LITE
-  LIBRARY           filebrowserfileopclient.lib
-#endif
-
-// End of File
--- a/filebrowser/group/filebrowser_extraicons.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\filebrowser_extraicons.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\filebrowser_extraicons.mbg
-
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN :
-	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
-	@if exist $(HEADERFILENAME) erase $(HEADERFILENAME)
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-RESOURCE : $(ICONTARGETFILENAME)
-
-$(ICONTARGETFILENAME) (HEADERFILENAME) : ..\icons\qgn_indi_tb_filebrowser_folder_parent.svg ..\icons\qgn_indi_tb_filebrowser_find.svg ..\icons\qgn_indi_tb_filebrowser_selection.svg ..\icons\qgn_indi_tb_filebrowser_selection_active.svg
-	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
-		/c8,8 ..\icons\qgn_indi_tb_filebrowser_folder_parent.svg \
-		/c8,8 ..\icons\qgn_indi_tb_filebrowser_find.svg \
-		/c8,8 ..\icons\qgn_indi_tb_filebrowser_selection.svg \
-		/c8,8 ..\icons\qgn_indi_tb_filebrowser_selection_active.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME) && \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/filebrowser/group/filebrowser_icons_aif.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\filebrowser_aif.mif
-
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN :
-	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-RESOURCE : $(ICONTARGETFILENAME)
-
-$(ICONTARGETFILENAME) : ..\icons\qgn_menu_filebrowser.svg
-	mifconv $(ICONTARGETFILENAME) \
-		/c8,8 ..\icons\qgn_menu_filebrowser.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/group.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_platforms += "$${LITERAL_HASH}include \"bld_generic.inf\""
--- a/filebrowser/helpertools/snapshot_compare_dirs.pl	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-use strict;
-
-use Getopt::Std;
-use Digest::MD5 qw( md5 );
-use File::Basename;
-use File::Copy;
-use File::Find;
-use File::Path;
-
-my @changed_files=();
-my $dir_1_length;
-my $dir_2_length;
-my $directory1;
-my $directory2;
-my %list1=();
-my %list2=();
-my %opts=();
-my $switch= 0;
-my $result_dir;
-
-###################################################
-##  usage()                                      ##
-##  Prints the usage                             ##
-###################################################
-sub usage
-{
-  print "\nUsage\n\tsnapshot_compare_dirs.pl -1 <original dir> -2 <updated dir>  -r <result dir>\n";
-  print "\nWhere\n\t-1  Original directory\n\t-2  Updated directory\n\t-r  Result directory\n";
-  exit;
-}
-
-###################################################
-##  get_param()                                  ##
-##  Gets command line parameters                 ##
-###################################################
-sub get_param
-{
-  getopts('h1:2:r:', \%opts);
-
-  if ( $opts{'h'} ) {
-    usage();
-  }
-
-  if ( $opts{'1'} ) {
-    $directory1 = $opts{'1'};
-    if ( ! -d $directory1 ) {
-      print "\nError:\t Directory \"$directory1\" doesn't exist\n";
-      exit;
-    }
-  } else {
-    usage();
-  }
-
-  if ( $opts{'2'} ) {
-    $directory2 = $opts{'2'};
-    if ( ! -d $directory2 ) {
-      print "\nError:\t Directory \"$directory2\" doesn't exist\n";
-      exit;
-    }
-  } else {
-    usage();
-  }
-
-  if ( $opts{'r'} ) {
-    $result_dir = $opts{'r'};
-    if ( ! -d $result_dir ) {
-        mkdir $result_dir;
-    }
-  } else {
-    usage();
-  }
-
-}
-
-###################################################
-##  calculate_hash()  Reads file content and     ##
-##                    calculates MD5 hash        ##
-###################################################
-sub calculate_hash
-{
-  my ( $file_name ) = @_;
-
-  open( FILE, $file_name ) or die "Error: Cannot open $file_name\n";
-  my @file_stat = stat FILE;
-  binmode( FILE );
-
-  my ( $buffer, $hash_value );
-  read( FILE, $buffer, $file_stat[7] );
-
-  close FILE;
-
-  $hash_value = md5( $buffer );
-
-  return $hash_value;
-}
-
-###################################################
-##  copy_file()                                  ##
-##  Copies files with same directory structure   ##
-###################################################
-sub copy_file
-{
-    my ( $file1, $file2 ) = @_;
-    my $dir_name = dirname( $file2 );
-
-    mkpath( $dir_name, 0, 0777 );
-
-    copy( $file1, $file2 );
-}
-
-###################################################
-##  process_files()                              ##
-##  Indexes files                                ##
-###################################################
-sub process_files
-{
-  my $file = $File::Find::name;
-
-  if ( -f $file ) {
-    if ($switch eq 0 ) {
-      $file = substr( $file, $dir_1_length );
-      $list1{$file} = 1;;
-    } else {
-      $file = substr( $file, $dir_2_length );
-      $list2{$file} = 1;
-    }
-  }
-}
-
-###################################################
-##  main()                                       ##
-##  Main function                                ##
-###################################################
-sub main
-{
-  get_param();
-
-  $dir_1_length = length( $directory1 );
-  $dir_2_length = length( $directory2 );
-
-  print "Info:\tProcessing files. This may take some time\n";
-
-  $switch = 0;
-  find( \&process_files, $directory1 );
-
-  $switch = 1;
-  find( \&process_files, $directory2 );
-
-  print "Info:\tFiles only exist in \"$directory2\" :\n\n";
-  my $counter = 0;
-  my $file;
-  my $key;
-  my $hash1;
-  my $hash2;
-
-  foreach $key ( sort keys %list2 ){
-    if ( $list1{$key} ne 1 ) {
-       $key =~ s/\//\\/g;
-       print "\t$key\n";
-       copy_file( "$directory2$key", "$result_dir$key" );
-       $counter++;
-    } else {
-       $hash1 = calculate_hash("$directory1$key");
-       $hash2 = calculate_hash("$directory2$key");
-       if ($hash1 ne $hash2) {
-         push @changed_files, $key;
-       }
-    }
-  }
-
-  print "\nInfo:\tTotal $counter new file(s)\n";
-
-  print "\nInfo:\tList of the changed file\n";
-
-  $counter = 0;
-
-  foreach $file ( @changed_files ){
-      $counter++;
-      print "\t$file\n";
-  }
-
-  print "\nInfo:\tTotal $counter file(s) changed\n";
-  print "Info:\tNote: Only new files are copied to $result_dir\n";
-}
-
-main();
--- a/filebrowser/inc/FB.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_HRH
-#define FILEBROWSER_HRH
-
-enum TFileBrowserCommandIds
-    {
-    EFileBrowserCmdFile = 1,
-    EFileBrowserCmdFileBack,
-    EFileBrowserCmdFileOpen,
-    EFileBrowserCmdFileOpenApparc,
-    EFileBrowserCmdFileOpenDocHandlerEmbed,
-    EFileBrowserCmdFileOpenDocHandlerStandAlone,
-    EFileBrowserCmdFileOpenFileService,
-    EFileBrowserCmdFileOpenDrive,
-    EFileBrowserCmdFileOpenDirectory,
-    EFileBrowserCmdFileView,
-    EFileBrowserCmdFileViewText,
-    EFileBrowserCmdFileViewHex,
-    EFileBrowserCmdFileEdit,
-    EFileBrowserCmdFileEditText,
-    EFileBrowserCmdFileEditHex,
-    EFileBrowserCmdFileSearch,
-    EFileBrowserCmdFileSendTo,
-    EFileBrowserCmdFileNew,
-    EFileBrowserCmdFileNewFile,
-    EFileBrowserCmdFileNewDirectory,
-    EFileBrowserCmdFileDelete,
-    EFileBrowserCmdFileRename,
-    EFileBrowserCmdFileTouch,
-    EFileBrowserCmdFileProperties,
-    EFileBrowserCmdFileChecksums,
-    EFileBrowserCmdFileChecksumsMD5,
-    EFileBrowserCmdFileChecksumsMD2,
-    EFileBrowserCmdFileChecksumsSHA1,
-    EFileBrowserCmdFileSetAttributes,
-    EFileBrowserCmdFileCompress,
-    EFileBrowserCmdFileDecompress,
-    EFileBrowserCmdEdit,
-    EFileBrowserCmdSnapShot,
-    EFileBrowserCmdEditCut,
-    EFileBrowserCmdEditCopy,    
-    EFileBrowserCmdEditPaste,
-    EFileBrowserCmdEditCopyToFolder,    
-    EFileBrowserCmdEditMoveToFolder,
-    EFileBrowserCmdEditSelect,    
-    EFileBrowserCmdEditUnselect,
-    EFileBrowserCmdEditSelectAll,    
-    EFileBrowserCmdEditUnselectAll,
-    EFileBrowserCmdView,
-    EFileBrowserCmdViewSort,
-    EFileBrowserCmdViewSortByName,
-    EFileBrowserCmdViewSortByExtension,
-    EFileBrowserCmdViewSortByDate,
-    EFileBrowserCmdViewSortBySize,
-    EFileBrowserCmdViewOrder,
-    EFileBrowserCmdViewOrderAscending,
-    EFileBrowserCmdViewOrderDescending,
-    EFileBrowserCmdViewFilterEntries,
-    EFileBrowserCmdViewRefresh,
-    EFileBrowserCmdDiskAdmin,    
-    EFileBrowserCmdDiskAdminSetDrivePassword,    
-    EFileBrowserCmdDiskAdminUnlockDrive,    
-    EFileBrowserCmdDiskAdminClearDrivePassword,    
-    EFileBrowserCmdDiskAdminEraseDrivePassword,    
-    EFileBrowserCmdDiskAdminFormatDrive,    
-    EFileBrowserCmdDiskAdminQuickFormatDrive,    
-    EFileBrowserCmdDiskAdminCheckDisk,    
-    EFileBrowserCmdDiskAdminScanDrive,    
-    EFileBrowserCmdDiskAdminSetDriveName,    
-    EFileBrowserCmdDiskAdminSetDriveVolumeLabel,    
-    EFileBrowserCmdDiskAdminEraseMBR,
-    EFileBrowserCmdDiskAdminDrivePartition,    
-    EFileBrowserCmdDiskAdminEjectDrive,    
-    EFileBrowserCmdDiskAdminDismountFileSystem,    
-    EFileBrowserCmdTools,    
-    EFileBrowserCmdToolsAllFiles,
-    EFileBrowserCmdToolsAvkonIconCache,
-    EFileBrowserCmdToolsAvkonIconCacheEnable,
-    EFileBrowserCmdToolsAvkonIconCacheDisable,    
-    EFileBrowserCmdToolsDisableExtErrors,    
-    EFileBrowserCmdToolsEditDataTypes,
-    EFileBrowserCmdToolsEnableExtErrors,
-    EFileBrowserCmdToolsErrorSimulate,
-    EFileBrowserCmdToolsErrorSimulateLeave,
-    EFileBrowserCmdToolsErrorSimulatePanic,
-    EFileBrowserCmdToolsErrorSimulateException,    
-    EFileBrowserCmdToolsLocalConnectivity,    
-    EFileBrowserCmdToolsLocalConnectivityActivateInfrared,    
-    EFileBrowserCmdToolsLocalConnectivityLaunchBTUI,    
-    EFileBrowserCmdToolsLocalConnectivityLaunchUSBUI,    
-    EFileBrowserCmdToolsInstalledApps,    
-    EFileBrowserCmdToolsOpenFiles,    
-    EFileBrowserCmdToolsMsgAttachments,    
-    EFileBrowserCmdToolsMsgAttachmentsInbox,    
-    EFileBrowserCmdToolsMsgAttachmentsDrafts,    
-    EFileBrowserCmdToolsMsgAttachmentsSentItems,    
-    EFileBrowserCmdToolsMsgAttachmentsOutbox,    
-    EFileBrowserCmdToolsMsgStoreWalk,
-    EFileBrowserCmdToolsSecureBackup,    
-    EFileBrowserCmdToolsSecureBackupStartBackup,    
-    EFileBrowserCmdToolsSecureBackupStartRestore,    
-    EFileBrowserCmdToolsSecureBackupStop,    
-    EFileBrowserCmdToolsSetDebugMask,    
-    EFileBrowserCmdToolsMemoryInfo,    
-    EFileBrowserCmdSettings,
-    EFileBrowserCmdAbout,
-    EFileBrowserCmdSettingsChange,
-    EFileBrowserCmdSettingsExit,
-    EFileBrowserCmdSettingsBack,
-    EFileBrowserSettingItemList,
-    EFileBrowserCmdDataTypesChangeMapping,
-    EFileBrowserCmdDataTypesSetDefaultMapping,
-    EFileBrowserCmdDataTypesRefresh,
-    EFileBrowserCmdDataTypesExit,
-    EFileBrowserCmdDataTypesBack,
-    EFileBrowserDataTypesList,
-    EFileBrowserProgressNote,
-    EFileBrowserWaitNote,
-    EFileBrowserAttributeEditorSetArchive,
-    EFileBrowserAttributeEditorSetHidden,
-    EFileBrowserAttributeEditorSetReadOnly,
-    EFileBrowserAttributeEditorSetSystem,
-    EFileBrowserAttributeEditorSetRecurse,
-    EFileBrowserSearchQuerySearchDir,
-    EFileBrowserSearchQueryWildCards,
-    EFileBrowserSearchQueryTextInFile,
-    EFileBrowserSearchQueryMinSize,
-    EFileBrowserSearchQueryMaxSize,
-    EFileBrowserSearchQueryMinDate,
-    EFileBrowserSearchQueryMaxDate,
-    EFileBrowserSearchQueryRecurse,
-    EFileBrowserCmdFileEditorViewAsText,
-    EFileBrowserCmdFileEditorViewAsHex,
-    EFileBrowserCmdFileEditorSave,
-    EFileBrowserCmdFileEditorSaveAs,
-    EFileBrowserCmdFileEditorSaveFormat,
-    EFileBrowserCmdFileEditorSaveFormatANSIASCII,
-    EFileBrowserCmdFileEditorSaveFormatUTF8,
-    EFileBrowserCmdFileEditorSaveFormatUTF16LE,
-    EFileBrowserCmdFileEditorSaveFormatUTF16BE,
-    EFileBrowserCmdFileEditorEditAsText,
-    EFileBrowserCmdFileEditorEditAsHex,
-    EFileBrowserCmdFileEditorExit,
-    EFileBrowserFileOpCommandAttribs,
-    EFileBrowserFileOpCommandCopy,
-    EFileBrowserFileOpCommandMove,
-    EFileBrowserFileOpCommandRename,
-    EFileBrowserFileOpCommandDelete,
-    EFileBrowserFileOpCommandDriveSnapShot
-    };
-
-enum TFileBrowserFixedIconIds
-    {
-    EFixedIconMarking = 0,
-    EFixedIconEmpty,    
-    EFixedIconPhoneMemory,    
-    EFixedIconMemoryCard,    
-    EFixedIconMemoryCardDisabled,    
-    EFixedIconFolder,    
-    EFixedIconFolderSub,    
-    EFixedIconFolderCurrent,
-    EFixedIconListLength // this should be last   
-    };
-
-enum TFileBrowserEntryOverwriteActions
-    {
-    EFileActionOverwriteAll = 0,
-    EFileActionSkipAllExisting,    
-    EFileActionGenerateUniqueFilenames,
-    EFileActionQueryPostFix   
-    };
-
-enum TFileBrowserSecureBackupState
-    {
-    ESecureBackupStateFull = 0,
-    ESecureBackupStatePartial    
-    };
-
-enum TFileBrowserSecureBackupType
-    {
-    ESecureBackupTypeBase = 0,
-    ESecureBackupTypeIncremental    
-    };
-    
-enum TFileBrowserDataTypePriorities
-    {
-    EDataTypePriorityMaximum = 0,
-    EDataTypePriorityHigh,    
-    EDataTypePriorityNormal,
-    EDataTypePriorityLow,
-    EDataTypePriorityLastResort   
-    };
-
-enum TFileBrowserCommonFileActions
-    {
-    ECommonFileActionViewAsTextHex = 0,
-    ECommonFileActionOpenWithApparc,    
-    ECommonFileActionOpenWithDocHandlerEmbed   
-    };
-                     
-enum TFileBrowserSettingListTabs
-    {
-    ETabGeneral = 0,
-    ETabFileOps    
-    };
-    
-enum TFileBrowserSettingListIds
-    {
-    ESettingListDisplayModeSelection = 0,
-    ESettingListFileViewModeSelection,
-    ESettingListShowSubdirectoryInfoSelection,
-    ESettingListShowAssociatedIconsSelection,
-    ESettingListRememberLastPathSelection,
-    ESettingListRememberFolderSelection,
-    ESettingListEnableToolbar,
-
-    ESettingListSupportNetworkDrivesSelection,
-    ESettingListBypassPlatformSecuritySelection,
-    ESettingListRemoveFileLocksSelection,
-    ESettingListIgnoreProtectionsAttsSelection,
-    ESettingListRemoveROMWriteProtectionSelection
-    };
-
-enum TFileBrowserSettingDisplayModes
-    {
-    EDisplayModeFullScreen = 0,
-    EDisplayModeNormal
-    };
-
-enum TFileBrowserSettingFileViewModes
-    {
-    EFileViewModeSimple = 0,
-    EFileViewModeExtended
-    };
-
-enum TFileBrowserFileEditorModes
-    {
-    EFileEditorViewAsText = 0,
-    EFileEditorViewAsHex,
-    EFileEditorEditAsText,
-    EFileEditorEditAsHex
-    };
-
-enum
-    {
-    EFileViewerDialogControl = 0x5FEC
-    };
-
-enum
-    {
-    EFileEditorDialogId = 1
-    };
-
-#endif      // FILEBROWSER_HRH
--- a/filebrowser/inc/FBApp.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERAPP_H
-#define FILEBROWSERAPP_H
-
-// INCLUDES
-#include <aknapp.h>
-
-// CONSTANTS
-// UID of the application
-const TUid KUidFileBrowser = { 0x102828D6 };
-
-// CLASS DECLARATION
-
-/**
-* CFileBrowserApp application class.
-* Provides factory to create concrete document object.
-* 
-*/
-class CFileBrowserApp : public CAknApplication
-    {
-    
-    public: // Functions from base classes
-        /**
-        * From CApaApplication, overridden to enable INI file support.
-        * @return A pointer to the dictionary store
-        */
-    CDictionaryStore* OpenIniFileLC(RFs& aFs) const;
-    private:
-
-        /**
-        * From CApaApplication, creates CFileBrowserDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-        
-        /**
-        * From CApaApplication, returns application's UID (KUidFileBrowser).
-        * @return The value of KUidFileBrowser.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBAppUi.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERAPPUI_H
-#define FILEBROWSERAPPUI_H
-
-// INCLUDES
-#include <eikapp.h>
-#include <eikdoc.h>
-#include <e32std.h>
-#include <coeccntx.h>
-#include <aknViewAppUi.h>
-#include <akntabgrp.h>
-#include <aknnavide.h>
-#include "FBStd.h"
-
-// FORWARD DECLARATIONS
-class CFileBrowserFileListContainer;
-class CFileBrowserModel;
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-
-// CLASS DECLARATION
-
-
-class CFileBrowserAppUi : public CAknViewAppUi
-    {
-    public: // // Constructors and destructor
-
-        /**
-        * EPOC default constructor.
-        */      
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */      
-        ~CFileBrowserAppUi();
-        
-    public: // New functions
-
-    public: // Functions from base classes
-        void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
-
-    private:
-        // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-    private:
-        /**
-        * From CEikAppUi, takes care of command handling.
-        * @param aCommand command to be handled
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From CEikAppUi, handles key events.
-        * @param aKeyEvent Event to handled.
-        * @param aType Type of the key event. 
-        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
-        */
-        virtual TKeyResponse HandleKeyEventL(
-            const TKeyEvent& aKeyEvent,TEventCode aType);
-
-    private: //Data
-        CFileBrowserModel*    iModel;
-
-    };
-
-#endif
-
-// End of File
--- a/filebrowser/inc/FBDocument.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERDOCUMENT_H
-#define FILEBROWSERDOCUMENT_H
-
-// INCLUDES
-#include <AknDoc.h>
-   
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CEikAppUi;
-class CFileBrowserModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CFileBrowserDocument application class.
-*/
-class CFileBrowserDocument : public CAknDocument
-    {
-    public: // Constructors and destructor
-        /**
-        * Two-phased constructor.
-        */
-        static CFileBrowserDocument* NewL(CEikApplication& aApp);
-
-        /**
-        * Destructor.
-        */
-        virtual ~CFileBrowserDocument();
-
-    public: // New functions
-
-    public:	// from CEikDocument
-	CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
-    protected:  // New functions
-
-    protected:  // Functions from base classes
-
-    private:
-
-        /**
-        * EPOC default constructor.
-        */
-        CFileBrowserDocument(CEikApplication& aApp);
-        void ConstructL();
-
-    private:
-
-        /**
-        * From CEikDocument, create CFileBrowserAppUi "App UI" object.
-        */
-        CEikAppUi* CreateAppUiL();
-
-    public:
-        CFileBrowserModel* Model();
-
-    private:
-        CFileBrowserModel* iModel;
-
-    };
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBFileDlgs.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_FILEDLGS_H
-#define FILEBROWSER_FILEDLGS_H
-
-
-//  INCLUDES
-#include "FBFileUtils.h"
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include <aknlistquerydialog.h>
-#include <apgcli.h>
-
-
-//  FORWARD DECLARATIONS
-class CAknIconArray;
-class CAknSingleGraphicStyleListBox;
-
-
-//  CLASS DEFINITIONS
-
-class CFileBrowserDestinationFolderSelectionDlg : public CAknListQueryDialog
-    {
-public:
-    static CFileBrowserDestinationFolderSelectionDlg* NewL(TDes& aReturnPath, CDriveEntryList* aDriveEntryList, CAknIconArray* aIconArray);
-    virtual ~CFileBrowserDestinationFolderSelectionDlg();
-
-private: // Constructors
-    CFileBrowserDestinationFolderSelectionDlg(TDes& aReturnPath, CAknIconArray* aIconArray);
-    void ConstructL(CDriveEntryList* aDriveEntryList);        
-
-protected:  // From CEikDialog
-    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
-    void PreLayoutDynInitL();
-    void PostLayoutDynInitL();
-    TBool OkToExitL(TInt aButtonId);    
-
-protected:  // From CCoeControl
-    //void HandlePointerEventL(const TPointerEvent &aPointerEvent); 
-
-private: // New methods
-    void MoveUpOneLevelL();
-    void MoveDownToDirectoryL();
-    void RefreshViewL();
-    inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC; }
-    
-public:  // New methods
-    TBool RunCopyDlgLD();
-    TBool RunMoveDlgLD();
-
-private: // Data
-    TInt                            iSelectedIndex;
-    TBuf<16>                        iLSKActionText;
-    TDes&                           iReturnPath;
-    RFs                             iFs;
-    CDriveEntryList*                iDriveEntryList;
-    CFileEntryList*                 iFileEntryList;
-    CAknIconArray*                  iIconArray;
-    TFileName                       iCurrentPath;
-    //TPoint                          iDragStartPoint;
-    //TBool                           iIsDragging;
-    };
-
-
-class CFileBrowserAttributeEditorDlg : public CAknForm
-    {
-public:
-    static CFileBrowserAttributeEditorDlg* NewL(TUint& aSetAttMask, TUint& aClearAttMask, TBool& aRecurse);
-    virtual ~CFileBrowserAttributeEditorDlg();
-
-private: // Constructors
-    CFileBrowserAttributeEditorDlg(TUint& aSetAttMask, TUint& aClearAttMask, TBool& aRecurse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    
-public:  // New methods
-    TBool RunEditorLD();
-
-private: // Data
-    TUint&                          iSetAttMask;
-    TUint&                          iClearAttMask;
-    TBool&                          iRecurse;
-    };
-
-
-class CFileBrowserSearchQueryDlg : public CAknForm
-    {
-public:
-    static CFileBrowserSearchQueryDlg* NewL(TSearchAttributes& aSearchAttributes);
-    virtual ~CFileBrowserSearchQueryDlg();
-
-private: // Constructors
-    CFileBrowserSearchQueryDlg(TSearchAttributes& aSearchAttributes);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    
-public:  // New methods
-    TBool RunQueryLD();
-
-private: // Data
-    TSearchAttributes&              iSearchAttributes;
-    };
-
-
-class CFileBrowserDataTypesDlg : public CAknDialog, public MEikListBoxObserver
-    {
-public:
-    static CFileBrowserDataTypesDlg* NewL();
-    virtual ~CFileBrowserDataTypesDlg();
-
-public: // From MEikListBoxObserver
-    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-public: // From CAknDialog
-    void ProcessCommandL(TInt aCommandId);
-        
-private: // Constructors
-    CFileBrowserDataTypesDlg();
-    void ConstructL();        
-
-protected: // From CEikDialog
-    void PreLayoutDynInitL();
-    TBool OkToExitL(TInt aButtonId); 
-    
-public:  // New methods
-    void GetDataTypesL();
-    void ChangeMappingL();
-    void SetDefaultMappingL();
-    TBool RunQueryLD();
-
-private: // Data
-    CAknSingleGraphicStyleListBox*          iListBox;
-    RApaLsSession                           iLs;
-    CDataTypeArray*                         iDTArray;  
-    };
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBFileEditor.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_FILEVIEWERDLG_H
-#define FILEBROWSER_FILEVIEWERDLG_H
-
-//  INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include <AknDialog.h>
-#include <eiksbobs.h>
-
-//  FORWARD DECLARATIONS
-class CFileBrowserFileEditorViewControl;
-class CEikEdwin;
-class CParaFormat;
-class CEikScrollBarFrame;
-
-
-//  CLASS DEFINITIONS
-
-class CFileBrowserFileEditorDlg : public CAknDialog
-    {
-public:
-    static CFileBrowserFileEditorDlg* NewL(const TDesC& aFileName, TInt aMode);
-    virtual ~CFileBrowserFileEditorDlg();
-
-private: // Constructors
-    CFileBrowserFileEditorDlg(const TDesC& aFileName, TInt aMode);
-    void ConstructL();        
-
-protected: // From CAknDialog
-    void ProcessCommandL(TInt aCommandId);
-    void PreLayoutDynInitL();
-    void PostLayoutDynInitL();
-        
-protected: // From CEikDialog
-    void SetSizeAndPosition(const TSize& aSize);
-    SEikControlInfo CreateCustomControlL(TInt aControlType);
-
-protected: // From MEikMenuObserver
-    void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-public:  // New methods
-    TBool RunDlgLD();
-
-private:  // New methods
-    void OpenFileLC(RFile& aFile, const TDesC& aFileName);
-    void LoadFileL();    
-    void GetTextFileMode(RFile& aFile, TInt& aFileSize);
-    HBufC16* ConvertBuf8ToBuf16L(HBufC8* aBuf8);
-    HBufC8* ConvertBuf16ToBuf8L(HBufC16* aBuf16);
-    void SaveEditorDataL(TBool aQueryNewName=EFalse);
-    TBool IsHexChar(TInt aCh);
-
-private: // Data
-    CFileBrowserFileEditorViewControl*  iViewer;
-    CEikEdwin*                          iTextEditor;
-    CParaFormat*                        iEditorPF;
-    TFileName			                iFileName;
-    TInt                                iActiveMode;
-    TInt                                iTextFormat;
-    };
-
-
-
-class CFileBrowserFileEditorViewControl : public CCoeControl, MEikScrollBarObserver
-    {
-public:
-    virtual ~CFileBrowserFileEditorViewControl();
-
-public: // Constructors
-    CFileBrowserFileEditorViewControl();
-    void ConstructL();        
-
-protected: // From CCoeControl
-    void Draw(const TRect& aRect) const; 
-    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
-    TSize MinimumSize();
-    CCoeControl* ComponentControl(TInt aIndex) const;
-    TInt CountComponentControls() const;    
-    void HandleResourceChange(TInt aType);
-    TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
-
-protected: // From MEikScrollBarObserver
-    void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType);
-
-public: // New methods
-    void FormatAsTextL(HBufC16* aBuf=NULL);
-    void FormatAsHexL(HBufC8* aBuf=NULL);
-
-private: // New methods
-    void InitVariables();
-    void ResetVariables(TBool aResetData=ETrue);
-    void UpdateScrollBarL();
-    
-private: // Data
-    TInt			        iActiveMode;
-    TRect                   iViewerRect;
-    TInt                    iDrawingWidth;
-    TInt                    iLeftDrawingPosition;
-    TReal                   iX_factor;
-    TReal                   iY_factor;
-    TInt                    iNumberOfLinesFitsScreen;
-    CEikScrollBarFrame*     iScrollBarFrame;
-    CFont*                  iFont;
-    TInt                    iCurrentLine;
-    TInt                    iTotalNumberOfLines;
-    
-    HBufC8*                 iHexesBuffer;
-    TInt                    iHexGrougWidth;
-    TInt                    iAmountOfHexesFitsHorizontally;
-    
-    HBufC16*                iTextBuf;
-    CArrayFix<TPtrC>*       iWrappedTextArray;
-    };
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBFileListContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERMAINCONTAINER_H
-#define FILEBROWSERMAINCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <eiklbo.h>
-
-// FORWARD DECLARATIONS
-class CFileBrowserModel;
-class CEikTextListBox;
-class CAknSearchField;
-class CAknNavigationControlContainer;
-class CAknNavigationDecorator;
-class CAknIconArray;
-class CAknInfoPopupNoteController;
-class CFont;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    class CFileBrowserToolbar;
-#endif
-
-// CLASS DECLARATIONS
-
-class CFileBrowserFileListContainer : public CCoeControl, MCoeControlObserver, MEikListBoxObserver
-    {
-public:
-    void ConstructL(const TRect& aRect);
-    ~CFileBrowserFileListContainer();
-
-private:
-    void SizeChanged();
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl(TInt aIndex) const;
-    void Draw(const TRect& aRect) const;
-    void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
-    void HandleResourceChange(TInt aType);
-    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); // From MEikListBoxObserver
-    void HandlePointerEventL(const TPointerEvent &aPointerEvent);
-
-public:
-	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
-    void CreateEmptyNaviPaneLabelL();
-    void DeleteNaviPane();
-    void CreateListBoxL(TInt aFileViewMode);
-    TInt CurrentListBoxItemIndex();
-    const CArrayFix<TInt>* ListBoxSelectionIndexes();
-    TInt ListBoxSelectionIndexesCount();
-    TInt ListBoxNumberOfVisibleItems();
-    CAknIconArray* ListBoxIconArrayL();
-    void SetListBoxIconArrayL(CAknIconArray* aIconArray);
-    void SetListBoxTextArrayL(CDesCArray* aTextArray);
-    void EnableSearchFieldL();
-    TBool IsSearchFieldEnabled();
-    void DisableSearchFieldL();
-    void SetScreenLayoutL(TInt aLayoutMode);
-    void SetNaviPaneTextL(const TDesC& aText);
-    inline CEikTextListBox* ListBox() { return iListBox; }
-    inline CAknSearchField* SearchField() { return iSearchField; }
-    void HandleSettingsChangeL();
-    void HideToolbar();
-    void UpdateToolbar();
-
-private:
-    CFileBrowserModel*                  iModel;
-    CEikTextListBox*                    iListBox;
-    CAknSearchField*                    iSearchField;
-    CAknNavigationControlContainer*     iNaviContainer;
-    CAknNavigationDecorator*            iNaviDecorator;
-    CAknInfoPopupNoteController*        iInfoPopup;
-    TInt                                iFileViewMode;
-    TPoint                              iDragStartPoint;
-    TBool                               iIsDragging;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    CFileBrowserToolbar*                iToolbar;
-#endif
-    };
-
-
-class CSimpleFileViewListBox : public CAknSingleGraphicStyleListBox
-    {
-private:
-    ~CSimpleFileViewListBox();
-    void ReleaseFonts();
-    void SizeChanged();
-    void SizeChangedL();
-private:
-    CFont*     iFont;
-    };
-
-
-class CExtendedFileViewListBox : public CAknDoubleGraphicStyleListBox
-    {
-private:    
-    ~CExtendedFileViewListBox();
-    void ReleaseFonts();
-    void SizeChanged();
-    void SizeChangedL();
-private:
-    CFont*     iFont1;
-    CFont*     iFont2;
-    };
-    
-#endif
-
-// End of File
\ No newline at end of file
--- a/filebrowser/inc/FBFileListView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERMAINVIEW_H
-#define FILEBROWSERMAINVIEW_H
-
-// INCLUDES
-#include <aknview.h>
-#include <remconcoreapitargetobserver.h>
-
-#include "FBStd.h"
-
-
-
-// CONSTANTS
-// UID of view
-const TUid KFileListViewUID = {1};
-
-
-// FORWARD DECLARATIONS
-class CFileBrowserFileListContainer;
-class CFileBrowserModel;
-class CRemConInterfaceSelector;
-class CRemConCoreApiTarget;
-
-
-// CLASS DECLARATION
-
-/**
-*  CFileBrowserFileListView view class.
-* 
-*/
-class CFileBrowserFileListView : public CAknView, public MRemConCoreApiTargetObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * EPOC default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CFileBrowserFileListView();
-
-    public: // Functions from base classes
-        
-        /**
-        * From ?base_class ?member_description
-        */
-        TUid Id() const;
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleClientRectChange();
-
-    private:
-        // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-    private:
-        // From MRemConCoreApiTargetObserver
-        void MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct);
-        
-    private:
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CFileBrowserFileListContainer*  iContainer;
-        CFileBrowserModel*              iModel;
-        CRemConInterfaceSelector*       iRemConSelector;
-        CRemConCoreApiTarget*           iRemConTarget;        
-    };
-
-#endif
-
-// End of File
--- a/filebrowser/inc/FBFileOps.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_FILEOPS_H
-#define FILEBROWSER_FILEOPS_H
-
-// INCLUDES
-#include <e32base.h>
-#include <f32file.h>
-#include <connect/sbeclient.h>
-
-// FORWARD DECLARATIONS
-class TFileEntry;
-class CFBFileOpClient;
-class CFileMan;
-class CFileBrowserModel;
-class CSBEClient;
-
-
-class CFileBrowserFileOps : public CBase,
-                            public MFileManObserver 
-	{
-private:
-    enum TRecursiveOperation
-    	{
-    	EFileOpInvalid = -1,
-    	EFileOpCopy,
-    	EFileOpMove,
-    	EFileOpRename,
-    	EFileOpAttribs,
-    	EFileOpDelete,
-    	EFileOpMkDirAll,
-    	EFileOpCreateEmptyFile,
-    	EFileOpEraseMBR,
-    	EFileOpPartitionDrive
-    	};
-public:
-	static CFileBrowserFileOps* NewL(CFileBrowserModel* aModel);
-	~CFileBrowserFileOps();
-
-public: // From MFileManObserver
-    
-    TControl NotifyFileManStarted();
-    TControl NotifyFileManOperation();
-    TControl NotifyFileManEnded();
-    
-private:
-	CFileBrowserFileOps(CFileBrowserModel* aModel);
-	void ConstructL();
-
-public:
-    TInt ActivateSecureBackUpViaFileOp();
-    TInt DeActivateSecureBackUpViaFileOp();
-    TInt ActivateSecureBackUp(conn::TBURPartType aPartType=conn::EBURBackupFull, conn::TBackupIncType aBackupIncType=conn::EBackupBase);
-    TInt DeActivateSecureBackUp();
-    TInt Copy(const TFileEntry& aSourceEntry, const TDesC& aTargetFullName, TUint aSwitch=CFileMan::EOverWrite, TBool aDeleteSource=EFalse); 
-    TInt Rename(const TFileEntry& aSourceEntry, const TDesC& aNew, TUint aSwitch=CFileMan::EOverWrite); 
-    TInt Attribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch=0); 
-    TInt Delete(const TFileEntry& aSourceEntry, TUint aSwitch=0); 
-    TInt MkDirAll(const TDesC& aPath, TInt aSetAtts=0, TBool aQuickOperation=EFalse); 
-    TInt CreateEmptyFile(const TDesC& aName); 
-    TInt DriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter); 
-    TInt EraseMBR(TUint aDriveNumber); 
-    TInt PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions);
-    void CancelOp();
-
-private:
-    TInt DoFindEntries(const TDesC& aFileName, const TDesC& aPath);
-    TInt DoFindEntriesRecursiveL(const TDesC& aFileName, const TDesC& aPath);    
-
-    TInt FileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); 
-    TInt DoFileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch); 
-
-    TInt FileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch); 
-    TInt DoFileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch); 
-
-    TInt FileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
-    TInt DoFileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch); 
-
-    TInt FileOpDeleteFile(const TDesC& aName, TUint aSwitch); 
-    TInt DoFileOpDeleteFile(const TDesC& aName, TUint aSwitch); 
-
-    TInt FileOpRmDir(const TDesC& aDirName, TUint aSwitch); 
-    TInt DoFileOpRmDir(const TDesC& aDirName, TUint aSwitch); 
-
-    TInt FileOpMkDirAll(const TDesC& aPath, TInt aSetAtts=0); 
-    TInt DoFileOpMkDirAll(const TDesC& aPath); 
-
-    TInt FileOpCreateEmptyFile(const TDesC& aName); 
-    TInt DoFileOpCreateEmptyFile(const TDesC& aName); 
-
-public:
-    inline TBool SecureBackUpActive() { return iSecureBackUpActive; }
-    inline TBool FileCommandActivatedSecureBackup() { return iFileCommandActivatedSecureBackup; }
-
-private:
-    TInt                            iRecursiveState;
-    CFileBrowserModel*              iModel;
-    CFBFileOpClient*                iFileOpClient;
-    CFileMan*                       iFileMan;
-    RFs                             iFs;
-    TInt                            iOperationError;
-    conn::CSBEClient*               iSBEClient;
-    TBool                           iSecureBackUpActive;
-    TBool                           iFileCommandActivatedSecureBackup;
-
-    TFileName   iBuf1;
-    TFileName   iBuf2;
-    TUint       iUint1;
-    TUint       iUint2;
-    TUint       iUint3;
-    TTime       iTime1;
-    MFileManObserver::TControl iFileManObserverResult;
-    };
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBFileUtils.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_FILEUTILS_H
-#define FILEBROWSER_FILEUTILS_H
-
-// INCLUDES
-#include <e32base.h>
-#include <f32file.h>
-#include <w32std.h>
-#include <badesca.h>
-#include <coedef.h>
-#include <AknServerApp.h>
-#include <msvapi.h>
-#include <AknProgressDialog.h> 
-#include <tz.h>
-
-_LIT(KIRAppPath, "z:\\sys\\bin\\irapp.exe");
-_LIT(KBTAppPath, "z:\\sys\\bin\\btui.exe");
-_LIT(KUSBAppPath, "z:\\sys\\bin\\usbclasschangeui.exe");
-_LIT(KErrRdPath, "c:\\resource\\ErrRd");
-_LIT(KErrRdDir, "c:\\resource\\");
-
-
-// FORWARD DECLARATIONS
-class CFileBrowserModel;
-class CFileBrowserFileOps;
-class CAknIconArray;
-class TAknsItemID;
-class CDocumentHandler;
-class CAknWaitDialog;
-class CAknProgressDialog;
-class CEikProgressInfo;
-class CFBFileOpClient;
-class CAknProgressDialog;
-class CEikProgressInfo;
-class CAknOpenFileService;
-class CMessageDigest;
-
-// CLASS DECLARATIONS
-
-class TSearchAttributes
-	{
-public:
-    TFileName       iSearchDir;
-    TFileName       iWildCards;
-    TFileName       iTextInFile;
-    TUint           iMinSize;
-    TUint           iMaxSize;
-    TTime           iMinDate;
-    TTime           iMaxDate;
-    TBool           iRecurse;
-	};
-
-class TDriveEntry
-	{
-public:
-    TChar           iLetter;
-    TInt            iNumber;
-    TVolumeInfo     iVolumeInfo;
-    TBuf<64>        iMediaTypeDesc;
-    TBuf<128>       iAttributesDesc;
-    TInt            iIconId;
-	};
-
-class TFileEntry
-	{
-public:
-    TFileName       iPath;
-    TEntry          iEntry;
-    TInt            iDirEntries;
-    TInt            iIconId;
-	};
-
-class TAppIcon
-	{
-public:
-    TInt            iId;
-    TUid            iUid;
-	};
-
-typedef CArrayFixSeg<TDriveEntry> CDriveEntryList;
-typedef CArrayFixSeg<TFileEntry> CFileEntryList;
-typedef CArrayFixSeg<TAppIcon> CAppIconList;
-
-
-class CCommandParamsBase : public CBase
-    {
-    };
-
-class CCommandParamsAttribs : public CCommandParamsBase
-    {
-public:
-    TFileEntry iSourceEntry;
-    TUint iSetMask;
-    TUint iClearMask;
-    TTime iTime;
-    TUint iSwitch;
-public:
-    CCommandParamsAttribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) : iSourceEntry(aSourceEntry), iSetMask(aSetMask), iClearMask(aClearMask), iTime(aTime), iSwitch(aSwitch) {}
-    };
-    
-class CCommandParamsCopyOrMove : public CCommandParamsBase
-    {
-public:
-    TFileEntry iSourceEntry;
-    TFileName iTargetPath;
-    TUint iSwitch;
-public:
-    CCommandParamsCopyOrMove(const TFileEntry& aSourceEntry, const TDesC& aTargetPath, TUint aSwitch) : iSourceEntry(aSourceEntry), iTargetPath(aTargetPath), iSwitch(aSwitch) {}
-    };
-        
-class CCommandParamsRename : public CCommandParamsBase
-    {
-public:
-    TFileEntry iSourceEntry;
-    TFileName iTargetPath;
-    TUint iSwitch;
-public:
-    CCommandParamsRename(const TFileEntry& aSourceEntry, const TDesC& aTargetPath, TUint aSwitch) : iSourceEntry(aSourceEntry), iTargetPath(aTargetPath), iSwitch(aSwitch) {}
-    };
-
-class CCommandParamsDelete : public CCommandParamsBase
-    {
-public:
-    TFileEntry iSourceEntry;
-    TUint iSwitch;
-public:
-    CCommandParamsDelete(const TFileEntry& aSourceEntry, TUint aSwitch) : iSourceEntry(aSourceEntry), iSwitch(aSwitch) {}
-    };
-
-class CCommandParamsDriveSnapShot : public CCommandParamsBase
-    {
-public:
-    TInt iSourceDriveLetter;
-    TInt iTargetDriveLetter;
-public:
-    CCommandParamsDriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter) : iSourceDriveLetter(aSourceDriveLetter), iTargetDriveLetter(aTargetDriveLetter) {}
-    };
-    
-class TCommand
-    {
-public:
-    TInt iCommandId;
-    CCommandParamsBase* iParameters;
-public:
-    TCommand(TInt aCommandId, CCommandParamsBase* aParameters) : iCommandId(aCommandId), iParameters(aParameters) {}
-    };
-
-typedef CArrayFixSeg<TCommand> CCommandArray;
-
-
-
-class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver, public MProgressDialogCallback 
-	{
-private:
-    enum TState // active object states
-    	{
-    	EIdle = 0,              // do nothing
-    	};
-
-    enum TClipBoardMode
-    	{
-    	EClipBoardModeCut = 0,
-    	EClipBoardModeCopy
-    	};
-
-    enum TListingMode
-    	{
-    	ENormalEntries = 0,
-    	ESearchResults,
-    	EOpenFiles,
-    	EMsgAttachmentsInbox,
-    	EMsgAttachmentsDrafts,
-    	EMsgAttachmentsSentItems,
-    	EMsgAttachmentsOutbox
-    	};
-    	    	
-public:
-	static CFileBrowserFileUtils* NewL(CFileBrowserModel* aModel);
-	~CFileBrowserFileUtils();
-
-private:
-	CFileBrowserFileUtils(CFileBrowserModel* aModel);
-	void ConstructL();
-
-private: // from CActive
-	void RunL();
-    TInt RunError(TInt aError);
-	void DoCancel();
-
-private: // from MAknServerAppExitObserver
-    void HandleServerAppExit(TInt aReason);
-
-private: // from MMsvSessionObserver
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-private:  //from MProgressDialogCallback
-    void DialogDismissedL(TInt aButtonId);  
-    
-private: // command handling
-    void StartExecutingCommandsL(const TDesC& aLabel);
-    void ExecuteCommand();
-    void CheckForMoreCommandsL();
-    void AppendToCommandArrayL(TInt aCommand, CCommandParamsBase* aParameters);
-    TInt CommandArrayCount() const;
-    void ResetCommandArray();       
-
-private: // misc functionality
-    void GenerateDirectoryDataL();
-    void GetDriveListL();
-    void GetDirectoryListingL();
-    CAknIconArray* GenerateIconArrayL(TBool aGenerateNewBasicIconArray=EFalse);
-    void AppendGulIconToIconArrayL(CAknIconArray* aIconArray, const TDesC& aIconFile, TInt aIconId, TInt aMaskId, const TAknsItemID aAknsItemId);
-    TInt AppIconIdForUid(TUid aUid);
-    TUid GetAppUid(TFileEntry aFileEntry);
-    CDesCArray* GenerateItemTextArrayL();
-    TInt GetSelectedItemsOrCurrentItemL(CFileEntryList* aFileEntryList);
-    void DoCopyToFolderL(CFileEntryList* aEntryList, const TDesC& aTargetDir, TBool aDeleteSource);
-    TInt DoSearchFiles(const TDesC& aFileName, const TDesC& aPath);
-    TInt DoSearchFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
-    TInt DoFindFiles(const TDesC& aFileName, const TDesC& aPath);
-    TInt DoFindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
-    void ReadAttachmentPathsRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, CDesCArray* aAttPaths);
-    void WriteMessageEntryInfoRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, RFile& aFile, TInt& aLevel);
-    void DoWriteMessageEntryInfoL(CMsvEntry* aContext, RFile& aFile, TInt aLevel);
-    void ConvertCharsToPwd(TDesC& aWord, TDes8& aConverted) const;
-    HBufC8* MessageDigestInHexLC(CMessageDigest* aMD, RFile& aFile);
-    void OpenCommonFileActionQueryL();
-    
-public: // public interfaces
-    TKeyResponse HandleOfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-    void HandleSettingsChangeL();
-    void SetSortModeL(TInt aSortMode);
-    void SetOrderModeL(TInt aOrderMode);
-    void RefreshViewL();
-    TBool IsCurrentDriveReadOnly();
-    TBool IsCurrentItemDirectory();
-    void MoveUpOneLevelL();
-    void MoveDownToDirectoryL();
-    void ClipboardCutL();
-    void ClipboardCopyL();
-    void ClipboardPasteL();
-    void CopyToFolderL(TBool aMove=EFalse);
-    void DeleteL();
-    void TouchL();
-    void RenameL();
-    void SetAttributesL();
-    void SearchL();
-    void NewFileL();
-    void NewDirectoryL();
-    void SendToL();
-    void CompressL();
-    void DecompressL();
-    void PropertiesL();
-    void OpenWithApparcL();
-    void OpenWithDocHandlerL(TBool aEmbed);
-    void OpenWithFileServiceL();
-    TBool FileExists(const TDesC& aPath);
-    TInt LaunchProgramL(const TDesC& aPath);
-    void MemoryInfoPopupL();
-    void ShowFileCheckSumsL(TInt aType);
-    void SetErrRdL(TBool aEnable);
-    void EnableAvkonIconCacheL(TBool aEnable);
-    void SimulateLeaveL();
-    void SimulatePanicL();
-    void SimulateExceptionL();
-    void SetDebugMaskL();
-    void WriteAllAppsL();
-    void WriteAllFilesL();
-    void ListOpenFilesL();
-    void ListMessageAttachmentsL(TInt aType);
-    void WriteMsgStoreWalkL();
-    void FileEditorL(TInt aType);
-    void SetDrivePasswordL();
-    void UnlockDriveL();
-    void ClearDrivePasswordL();
-    void EraseDrivePasswordL();
-    void FormatDriveL(TBool aQuickFormat);
-    void CheckDiskL();
-    void ScanDriveL();
-    void SetDriveNameL();
-    void SetDriveVolumeLabelL();
-    void EjectDriveL();
-    void DismountFileSystemL();
-    void EraseMBRL();
-    void PartitionDriveL();
-    TBool DriveSnapShotPossible();
-    void DriveSnapShotL();
-    void EditDataTypesL();
-    void SecureBackupL(TInt aType);
-    
-public:    
-    inline TInt SortMode() { return iSortMode; }
-    inline TInt OrderMode() { return iOrderMode; }
-    inline CFileEntryList* ClipBoardList() { return iClipBoardList; }
-    inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC && iListingMode==ENormalEntries; }
-    inline TBool IsNormalModeActive() { return iListingMode==ENormalEntries; }
-
-private:
-	TState                          iState;
-    CFileBrowserModel*              iModel;
-    CFileBrowserFileOps*            iFileOps;
-    CAknWaitDialog*                 iWaitDialog;
-    CAknProgressDialog*             iProgressDialog;
-    CEikProgressInfo*               iProgressInfo;
-    CCommandArray*                  iCommandArray;
-    TInt                            iCurrentEntry;
-    TInt                            iSucceededOperations;
-    TInt                            iFailedOperations;
-    TInt                            iLastError;
-    RTimer                          iTimer;
-	RFs                             iFs;
-	TListingMode                    iListingMode;
-	CFileMan*                       iFileMan;
-	TInt                            iViewMode;
-    TFileName                       iCurrentPath;
-    TInt                            iSortMode;
-    TInt                            iOrderMode;
-    TInt                            iClipboardMode;
-    CDesCArray*                     iClipboardPaths;
-    CDriveEntryList*                iDriveEntryList;
-    CFileEntryList*                 iFileEntryList;
-    CFileEntryList*                 iFindFileEntryList;
-    CAppIconList*                   iAppIconList;
-    TClipBoardMode                  iClipBoardMode;
-    CFileEntryList*                 iClipBoardList;
-    TSearchAttributes               iSearchAttributes;
-    CDocumentHandler*               iDocHandler;
-    CAknOpenFileService*		    iOpenFileService;
-    RFile                           iMsgStoreWalkFile;
-    TInt                            iPrevFolderIndex;
-    TFileName                       iPrevFolderName;
-    RTz                             iTz;
-    };
-
-
-// utility class for waiting for asychronous requests
-class CAsyncWaiter : public CActive
-	{
-public:
-	static CAsyncWaiter* NewL( TInt aPriority = EPriorityStandard );
-	static CAsyncWaiter* NewLC( TInt aPriority = EPriorityStandard );
-	~CAsyncWaiter();
-	
-	void StartAndWait();
-	TInt Result() const;
-	
-private:
-	CAsyncWaiter( TInt aPriority );
-	
-	// from CActive
-	void RunL();
-	void DoCancel();
-	
-private:
-    CActiveSchedulerWait iWait;
-	TInt iError;
-	};
-	
-	
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBModel.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef __FILEBROWSER_MODEL_H__
-#define __FILEBROWSER_MODEL_H__
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <apgcli.h>
-#include <CAknMemorySelectionSettingPage.h>
-
-
-// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
-const TUid KFBSettingDisplayMode                   = { 0x00 };
-const TUid KFBSettingFileViewMode                  = { 0x01 };
-const TUid KFBSettingShowSubDirectoryInfo          = { 0x02 };
-const TUid KFBSettingShowAssociatedIcons           = { 0x03 };
-const TUid KFBSettingRememberLastPath              = { 0x04 };
-const TUid KFBSettingLastPath                      = { 0x05 };
-
-const TUid KFBSettingSupportNetworkDrives          = { 0x06 };
-const TUid KFBSettingBypassPlatformSecurity        = { 0x07 };
-const TUid KFBSettingRemoveFileLocks               = { 0x08 };
-const TUid KFBSettingIgnoreProtectionsAtts         = { 0x09 };
-const TUid KFBSettingRemoveROMWriteProtection      = { 0x0A };
-
-const TUid KFBSettingFolderSelection               = { 0x0B };
-const TUid KFBSettingEnableToolbar                 = { 0x0C };
-
-
-// FORWARD DECLARATIONS
-class CFileBrowserFileListContainer;
-class CFileBrowserScreenCapture;
-class CFileBrowserFileUtils;
-class CEikonEnv;
-class CAknGlobalConfirmationQuery;
-class CDictionaryFileStore;
-
-// CLASS DECLARATIONS
-
-class TFileBrowserSettings
-    {
-public:
-    TInt                                        iDisplayMode;
-    TInt                                        iFileViewMode;
-    TBool                                       iShowSubDirectoryInfo;
-    TBool                                       iShowAssociatedIcons;
-    TBool                                       iRememberLastPath;
-    TFileName                                   iLastPath;
-    TBool                                       iRememberFolderSelection;
-    TBool                                       iEnableToolbar;
-
-    TBool                                       iSupportNetworkDrives;
-    TBool                                       iBypassPlatformSecurity;
-    TBool                                       iRemoveFileLocks;
-    TBool                                       iIgnoreProtectionsAtts;
-    TBool                                       iRemoveROMWriteProrection;
-    };
-
-
-class CFileBrowserModel : public CBase
-	{
-public:
-	static CFileBrowserModel* NewL();
-	~CFileBrowserModel();
-
-private:
-	CFileBrowserModel();
-	void ConstructL();
-    void LoadSettingsL();
-    void GetHashKeySelectionStatus();
-    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
-    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
-    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
-    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
-
-public:
-    void ActivateModelL();
-    void DeActivateModelL();
-    void SaveSettingsL(TBool aNotifyModules=ETrue);
-    void SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer);
-    TInt LaunchSettingsDialogL();
-    inline TFileBrowserSettings& Settings() { return iSettings; }
-    inline CEikonEnv* EikonEnv() { return iEnv; }
-    inline RApaLsSession& LsSession() { return iLs; }
-    inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
-    inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
-    inline CFileBrowserFileListContainer* FileListContainer() { return iFileListContainer; }
-    inline TBool IsHashKeySelectionInUse() { return iIsHashKeySelectionInUse; }
-
-private:
-    CFileBrowserFileListContainer*  iFileListContainer;
-    CFileBrowserScreenCapture*      iScreenCapture;
-    CFileBrowserFileUtils*          iFileUtils;
-    CEikonEnv*                      iEnv;
-    TFileBrowserSettings            iSettings;
-    RApaLsSession                   iLs;
-    TBool                           iIsHashKeySelectionInUse; 
-    };
-   
-
-#endif // __FILEBROWSER_MODEL_H__
\ No newline at end of file
--- a/filebrowser/inc/FBSettingViewDlg.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_SETTINGVIEWDLG_H
-#define FILEBROWSER_SETTINGVIEWDLG_H
-
-//  INCLUDES
-#include <AknDialog.h>
-#include <eiklbo.h>
-#include <AknTabObserver.h> 
-#include <akntabgrp.h>
-
-//  FORWARD DECLARATIONS
-class CAknSettingItemArray;
-class CAknSettingStyleListBox;
-class CAknNavigationControlContainer;
-class CAknNavigationDecorator;
-class CAknTabGroup; 
-class TFileBrowserSettings;
-
-
-//  CLASS DEFINITIONS
-
-class CFileBrowserSettingViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
-    {
-public:
-    static CFileBrowserSettingViewDlg* NewL(TFileBrowserSettings& aSettings);
-    virtual ~CFileBrowserSettingViewDlg();
-
-public: // From MEikListBoxObserver
-    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-public: // From MAknTabObserver
-    void TabChangedL(TInt aIndex); 
-
-public: // From CAknDialog
-    void ProcessCommandL(TInt aCommandId);
-
-protected: // From CEikDialog
-    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
-    void PreLayoutDynInitL();
-    TBool OkToExitL(TInt aButtonId);    
-
-private: // New methods
-    void ShowSettingPageL(TBool aCalledFromMenu);
-    void SetVisibilitiesOfSettingItemsL();
-    void UpdateListBoxL();
-    void AddSettingItemL(TInt aId, TInt aTitleResource, TInt aSettingPageResource, TInt aAssociatedResource, TInt aOrdinal);
-
-private: // Constructors
-    CFileBrowserSettingViewDlg(TFileBrowserSettings& aSettings);
-    void ConstructL();        
-
-private: // Data
-    CAknSettingItemArray*               iSettingItemArray;
-    CAknSettingStyleListBox*            iListBox;
-    CAknNavigationControlContainer*     iNaviContainer;
-    CAknNavigationDecorator*            iDecoratedTabGroup;
-    CAknTabGroup*                       iTabGroup;
-    TFileBrowserSettings&               iSettings;
-    };
-
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBStd.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_STD_H
-#define FILEBROWSER_STD_H
-
-#include <e32cmn.h>
-#include <e32std.h>
-#include <e32base.h>
-
-LOCAL_C inline TBool IsQHD(const TSize& aSize) { return ((aSize.iWidth==640 && aSize.iHeight==360) || (aSize.iWidth==360 && aSize.iHeight==640)); }
-
-#endif
-
-// End of File
-
--- a/filebrowser/inc/FBToolbar.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSERTOOLBAR_H
-#define FILEBROWSERTOOLBAR_H
-
-
-#include <aknappui.h>
-#include <akntoolbarobserver.h>
-#include <coecobs.h>    // MCoeControlObserver
-
-#ifdef RD_CALEN_ENHANCED_MSK
-#include <BADESCA.H> // for CDesCArrayFlat 
-#endif
-
-//Forward declarations 
-class CAknToolbar;
-class CAknButton;
-class CCoeControl;
-class CAknView;
-class CFileBrowserModel;
-class CAknInfoPopupNoteController;
-
-class CFileBrowserToolbar : public CBase, 
-                            public MAknToolbarObserver,
-                            public MCoeControlObserver
-    {
-    public:
-        /**
-         * 1st phase constructor
-         */
-        static CFileBrowserToolbar* NewL();
-
-        /**
-         * 1st phase constructor
-         */
-        static CFileBrowserToolbar* NewLC();
-
-        /**
-         * Destructor
-         */
-        ~CFileBrowserToolbar();
-
-        /**
-         * 2nd phase constructor
-         */
-        void ConstructL();
-
-    public:
-        // from MAknToolbarObserver
-
-        /**
-         * From MAknToolbarObserver
-         */
-        void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
-
-        /**
-         * Handling toolbar key events
-         */
-        void OfferToolbarEventL( TInt aCommand );
-
-    public:
-        // from MCoeControlObserver
-
-        /**
-         * Handles toolbar event
-         */
-        void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
-    
-    public:
-        // New functions
-
-        /**
-         * Updates the toolbar state to default state
-         */
-        void ResetState();
-
-        /**
-         * Enables the display of toolbar
-         */
-        void ShowToolbarL();
-
-        /**
-         * Disables the display of toolbar
-         */
-        void HideToolbarL();
-
-        /**
-         * Returns whether the toolbar is shown or not
-         */
-        TBool IsShown();
-        
-        const TRect Rect() const;
-
-    private:
-        // New functions
-        CFileBrowserToolbar();
-        
-    // private:
-    public:
-        CFileBrowserModel* iModel;
-        CAknToolbar* iViewerToolbar;
-        TBool iShown;
-        TInt iFirstSelectionIndex;
-        TInt iLastSelectionIndex;
-        CAknInfoPopupNoteController* iInfoPopup;
-        CAknButton* iSelectbutton;
-    };
-
-#endif // FILEBROWSERTOOLBAR_H
-
-// End of File
--- a/filebrowser/inc/FBTraces.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef FILEBROWSER_TRACES_H
-#define FILEBROWSER_TRACES_H
-
-#include <e32def.h>
-
-
-// ---------------------------------------------------------------------------
-// You can change these logging method values below! Recompile the application to take changes effect.
-
-    // logging methods
-    // 0 = No logging
-    // 1 = Flogger
-    // 2 = RDebug
-    // 3 = Flogger and RDebug
-    
-    #ifndef _DEBUG
-        
-        // Logging method for UREL/release builds:
-        #define FILEBROWSER_LOGGING_METHOD  0
-
-    #else
-
-        // Logging method for UDEB/debug builds:
-        #define FILEBROWSER_LOGGING_METHOD  2
-
-    #endif    
-    
-
-
-// ---------------------------------------------------------------------------
-// Do not make any changes to lines below...
-
-    #if FILEBROWSER_LOGGING_METHOD == 1 || FILEBROWSER_LOGGING_METHOD == 3
-
-        #include <flogger.h>
-        _LIT(KLogFolder,"Launcher");
-        _LIT(KLogFile,"Launcher_Trace.txt");
-
-    #endif
-
-    #if FILEBROWSER_LOGGING_METHOD == 2 || FILEBROWSER_LOGGING_METHOD == 3
-
-        #include <e32debug.h>
-
-    #endif
-
-
-    #if FILEBROWSER_LOGGING_METHOD == 0
-    
-        #define LOGTEXT(AAA)
-        #define LOGSTRING(AAA)
-        #define LOGSTRING2(AAA,BBB)
-        #define LOGSTRING3(AAA,BBB,CCC)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD)
-    
-    
-    #elif FILEBROWSER_LOGGING_METHOD == 1
-    
-        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-   
-    #elif FILEBROWSER_LOGGING_METHOD == 2
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
-    
-    #elif FILEBROWSER_LOGGING_METHOD == 3
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-
-    #endif
-
-// ---------------------------------------------------------------------------
-
-#endif
--- a/filebrowser/rom/filebrowser.iby	Mon May 03 12:32:02 2010 +0300
+++ b/filebrowser/rom/filebrowser.iby	Fri May 14 15:53:02 2010 +0300
@@ -16,25 +16,28 @@
 */
 
 
-#ifndef __FILEBROWSER_IBY__
-#define __FILEBROWSER_IBY__
+#ifndef __ORBITFILEBROWSER_IBY__
+#define __ORBITFILEBROWSER_IBY__
 
 S60_APP_EXE(FileBrowser)
-S60_APP_AIF_ICONS(FileBrowser)
+//S60_APP_AIF_ICONS(FileBrowser)
 S60_APP_RESOURCE(FileBrowser)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,FileBrowser_ExtraIcons)
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(FileBrowser)
-#else
-  S60_APP_AIF_RSC(FileBrowser)
-#endif
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,FileBrowser)
+
+//#ifdef S60_UPGRADABLE_APP_REG_RSC
+//  S60_UPGRADABLE_APP_REG_RSC(FileBrowser)
+//#else
+//  S60_APP_AIF_RSC(FileBrowser)
+//#endif
+data=ZPRIVATE\10003a3f\import\APPS\FileBrowser_reg.RSC Private\10003a3f\import\Apps\FileBrowser_reg.rsc
 
 #ifndef FILEBROWSER_LITE
 file=ABI_DIR\BUILD_DIR\FileBrowserFileOpServer.exe      PROGRAMS_DIR\FileBrowserFileOpServer.exe
 file=ABI_DIR\BUILD_DIR\FileBrowserFileOpClient.dll      SHARED_LIB_DIR\FileBrowserFileOpClient.dll
 #endif
 
-data=ZPRIVATE\102828D6\backup_registration.xml        	private\102828D6\backup_registration.xml
+data=ZPRIVATE\102828D6\backup_registration.xml          private\102828D6\backup_registration.xml
 data=ZSYSTEM\Install\FileBrowser_stub.sis               \system\install\FileBrowser_stub.sis
 
-#endif // __FILEBROWSER_IBY__
+
+#endif // __ORBITFILEBROWSER_IBY__
--- a/filebrowser/sis/FileBrowser_S60-30.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"FileBrowser"},(0x102828D6),4,5,2,TYPE=SA
-
-; Supports S60 v 3.0
-[0x101F7961], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\FileBrowser.exe"-"!:\sys\bin\FileBrowser.exe"
-"\epoc32\data\z\Resource\apps\FileBrowser_aif.mif"-"!:\Resource\Apps\FileBrowser_aif.mif"
-"\epoc32\data\z\Resource\apps\FileBrowser_ExtraIcons.mif"-"!:\Resource\Apps\FileBrowser_ExtraIcons.mif"
-"\epoc32\data\z\Resource\apps\FileBrowser.rsc"-"!:\Resource\Apps\FileBrowser.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\FileBrowser_reg.rsc"-"!:\private\10003a3f\import\apps\FileBrowser_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\102828D6\backup_registration.xml"
-
-; remove the following two entrys for lite version
-"\epoc32\RELEASE\armv5\UREL\FileBrowserFileOpServer.exe"-"!:\sys\bin\FileBrowserFileOpServer.exe"
-"\epoc32\RELEASE\armv5\UREL\FileBrowserFileOpClient.dll"-"!:\sys\bin\FileBrowserFileOpClient.dll"
Binary file filebrowser/sis/FileBrowser_S60-30.sis has changed
--- a/filebrowser/sis/FileBrowser_S60-50.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"FileBrowser"},(0x102828D6),4,5,2,TYPE=SA
-
-; Supports S60 v 5.0
-[0x1028315F], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\FileBrowser.exe"-"!:\sys\bin\FileBrowser.exe"
-"\epoc32\data\z\Resource\apps\FileBrowser_aif.mif"-"!:\Resource\Apps\FileBrowser_aif.mif"
-"\epoc32\data\z\Resource\apps\FileBrowser_ExtraIcons.mif"-"!:\Resource\Apps\FileBrowser_ExtraIcons.mif"
-"\epoc32\data\z\Resource\apps\FileBrowser.rsc"-"!:\Resource\Apps\FileBrowser.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\FileBrowser_reg.rsc"-"!:\private\10003a3f\import\apps\FileBrowser_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\102828D6\backup_registration.xml"
-
-; remove the following two entrys for lite version
-"\epoc32\RELEASE\armv5\UREL\FileBrowserFileOpServer.exe"-"!:\sys\bin\FileBrowserFileOpServer.exe"
-"\epoc32\RELEASE\armv5\UREL\FileBrowserFileOpClient.dll"-"!:\sys\bin\FileBrowserFileOpClient.dll"
Binary file filebrowser/sis/FileBrowser_S60-50.sis has changed
--- a/filebrowser/sis/FileBrowser_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/filebrowser/sis/FileBrowser_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -29,7 +29,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\FileBrowser.exe"
-""-"z:\Resource\Apps\FileBrowser_aif.mif"
+""-"z:\Resource\Apps\FileBrowser.mif"
 ""-"z:\Resource\Apps\FileBrowser.rsc"
 ""-"z:\private\10003a3f\import\apps\FileBrowser_reg.rsc"
 ""-"z:\private\102828D6\backup_registration.xml"
--- a/filebrowser/src/FBApp.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBApp.h"
-#include "FBDocument.h"
-
-#include <eikstart.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CFileBrowserApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CFileBrowserApp::AppDllUid() const
-    {
-    return KUidFileBrowser;
-    }
-
-// ---------------------------------------------------------
-// CDictionaryStore* CFileBrowserApp::OpenIniFileLC(RFs& aFs) const
-// overrides CAknApplication::OpenIniFileLC to enable INI file support
-// ---------------------------------------------------------
-//
-CDictionaryStore* CFileBrowserApp::OpenIniFileLC(RFs& aFs) const
-{
-    return CEikApplication::OpenIniFileLC(aFs);
-}
-   
-// ---------------------------------------------------------
-// CFileBrowserApp::CreateDocumentL()
-// Creates CFileBrowserDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CFileBrowserApp::CreateDocumentL()
-    {
-    return CFileBrowserDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CFileBrowserApp;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-   
-
-// End of File  
-
--- a/filebrowser/src/FBAppUi.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBAppUi.h"
-#include "FBFileListView.h"
-#include "FB.hrh"
-#include "FBModel.h"
-#include "FBDocument.h"
-#include <filebrowser.rsg>
-
-#include <avkon.hrh>
-#include <AknQueryDialog.h>
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CFileBrowserAppUi::ConstructL()
-// ?implementation_description
-// ----------------------------------------------------------
-//
-void CFileBrowserAppUi::ConstructL()
-    {
-    BaseConstructL(EAknEnableSkin);
-
-    iModel = static_cast<CFileBrowserDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-
-    CFileBrowserFileListView* fileListView = new (ELeave) CFileBrowserFileListView;
-    CleanupStack::PushL( fileListView );
-    fileListView->ConstructL();
-    AddViewL( fileListView );           // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();                // fileListView
-
-    SetDefaultViewL(*fileListView);
-
-    // notify the model that everything has been constructed
-    iModel->ActivateModelL();
-    }
-
-// ----------------------------------------------------
-// CFileBrowserAppUi::~CFileBrowserAppUi()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CFileBrowserAppUi::~CFileBrowserAppUi()
-    {
-    // notify the model that app ui will be deconstructed
-    if (iModel)
-        TRAP_IGNORE(iModel->DeActivateModelL());
-    }
-
-// ------------------------------------------------------------------------------
-// CFileBrowserAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ------------------------------------------------------------------------------
-//
-void CFileBrowserAppUi::DynInitMenuPaneL(
-    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
-    {
-    }
-
-// ----------------------------------------------------
-// CFileBrowserAppUi::HandleKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-// ?implementation_description
-// ----------------------------------------------------
-//
-TKeyResponse CFileBrowserAppUi::HandleKeyEventL(
-    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
-    {
-    return EKeyWasNotConsumed;
-    }
-
-// ----------------------------------------------------
-// CFileBrowserAppUi::HandleCommandL(TInt aCommand)
-// ?implementation_description
-// ----------------------------------------------------
-//
-void CFileBrowserAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch ( aCommand )
-        {
-        // a normal way to close an application
-        case EAknCmdExit:
-        case EEikCmdExit: 
-			{
-            Exit();
-			}
-            break;
-
-        default:
-            break;      
-        }
-    }
-
-// ----------------------------------------------------
-// CFileBrowserAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
-// ?implementation_description
-// ----------------------------------------------------
-//
-void CFileBrowserAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
-    {
-    //if (iModel->ScreenCapture()->HandleKeyCaptureEventsL(aEvent))
-      	CAknViewAppUi::HandleWsEventL(aEvent, aDestination);  //continue the event loop if needed
-    }
-
-// End of File  
--- a/filebrowser/src/FBDocument.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBDocument.h"
-#include "FBAppUi.h"
-#include "FBModel.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// constructor
-CFileBrowserDocument::CFileBrowserDocument(CEikApplication& aApp)
-: CAknDocument(aApp)    
-    {
-    }
-
-// destructor
-CFileBrowserDocument::~CFileBrowserDocument()
-    {
-    delete iModel;
-    }
-
-// EPOC default constructor can leave.
-void CFileBrowserDocument::ConstructL()
-    {
-    iModel = CFileBrowserModel::NewL();
-    }
-
-// Two-phased constructor.
-CFileBrowserDocument* CFileBrowserDocument::NewL(
-        CEikApplication& aApp)     // CFileBrowserApp reference
-    {
-    CFileBrowserDocument* self = new (ELeave) CFileBrowserDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-    }
-    
-// ----------------------------------------------------
-// CFileBrowserDocument::CreateAppUiL()
-// constructs CFileBrowserAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CFileBrowserDocument::CreateAppUiL()
-    {
-    return new (ELeave) CFileBrowserAppUi;
-    }
-
-// ----------------------------------------------------
-// CFileBrowserDocument::OpenFileL
-// Overrides CAknDocument::OpenFileL to support document file
-// ----------------------------------------------------
-//
-CFileStore* CFileBrowserDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
-    {
-    return CEikDocument::OpenFileL(aDoOpen, aFilename, aFs);
-    }
-
-
-// ----------------------------------------------------
-
-CFileBrowserModel* CFileBrowserDocument::Model()
-    {
-    return iModel;
-    }
-
-// ----------------------------------------------------
-
-// End of File  
--- a/filebrowser/src/FBFileDlgs.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1115 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBFileDlgs.h"
-#include "FBFileUtils.h"
-#include "FB.hrh"
-#include "FBStd.h"
-#include <filebrowser.rsg>
-
-#include <aknlistquerydialog.h>
-#include <AknIconArray.h>
-#include <aknlists.h>
-#include <eikbtgpc.h> 
-#include <akntitle.h>
-#include <AknPopupFieldText.h>
-#include <aknnotewrappers.h> 
-#include <eikfutil.h>
-#include <eikclbd.h> 
-
-const TInt KAttOn = 1;
-const TInt KAttOff = 2;
-const TInt KAttEnableRecursion = 0;
-const TInt KAttDisableRecursion = 1;
-const TInt64 KAlmostaDayInMicroSeconds = 86399999999;
- 
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CFileBrowserDestinationFolderSelectionDlg* CFileBrowserDestinationFolderSelectionDlg::NewL(
-    TDes& aReturnPath, CDriveEntryList* aDriveEntryList, CAknIconArray* aIconArray)
-    {
-    CFileBrowserDestinationFolderSelectionDlg* self = new(ELeave) CFileBrowserDestinationFolderSelectionDlg(aReturnPath, aIconArray);
-    CleanupStack::PushL(self);
-    self->ConstructL(aDriveEntryList);
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserDestinationFolderSelectionDlg::~CFileBrowserDestinationFolderSelectionDlg()
-    {
-    delete iFileEntryList;
-    delete iDriveEntryList;
-    
-    iFs.Close();
-
-    iEikonEnv->InfoMsgCancel();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserDestinationFolderSelectionDlg::CFileBrowserDestinationFolderSelectionDlg(
-    TDes& aReturnPath, CAknIconArray* aIconArray) : CAknListQueryDialog(&iSelectedIndex),
-    iReturnPath(aReturnPath), iIconArray(aIconArray)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::ConstructL(CDriveEntryList* aDriveEntryList)
-    {
-    User::LeaveIfError( iFs.Connect() );
-    iDriveEntryList = new(ELeave) CDriveEntryList(8);
-    iFileEntryList = new(ELeave) CFileEntryList(32);
-    iCurrentPath = KNullDesC;
-    
-    //iIsDragging = EFalse;
-    //EnableDragEvents();
-    
-    // get only writeable drives
-    for (TInt i=0; i<aDriveEntryList->Count(); i++)
-        {
-        TDriveEntry driveEntry = aDriveEntryList->At(i);
-        
-        if (driveEntry.iVolumeInfo.iDrive.iMediaAtt != KMediaAttWriteProtected && driveEntry.iVolumeInfo.iDrive.iMediaAtt != KMediaAttLocked && driveEntry.iVolumeInfo.iDrive.iDriveAtt != KDriveAbsent)
-            {
-            iDriveEntryList->AppendL(driveEntry);
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-/*
-void CFileBrowserDestinationFolderSelectionDlg::HandlePointerEventL(const TPointerEvent &aPointerEvent)
-    {
-    // detect direction of dragging by comparing the start and finish points
-    
-    if (aPointerEvent.iType == TPointerEvent::EButton1Down)
-        {
-        iDragStartPoint = aPointerEvent.iPosition;
-        iIsDragging = EFalse;
-        }
-    else if (aPointerEvent.iType == TPointerEvent::EDrag)
-        {
-        iIsDragging = ETrue;
-        
-        return;
-        }
-    else if (aPointerEvent.iType == TPointerEvent::EButton1Up)
-        {
-        if (iIsDragging)
-            {
-            const TInt KDelta = iDragStartPoint.iX - aPointerEvent.iPosition.iX;
-            const TInt KThreshold = 30;
-            
-            if (KDelta < -KThreshold) // dragging to right
-                {
-                // "emulate" right key press
-                
-                TKeyEvent keyEvent;
-                keyEvent.iCode = EKeyRightArrow;
-                keyEvent.iModifiers = 0;
-                
-                TEventCode type = EEventKey;
-        
-                OfferKeyEventL(keyEvent, type);
-                
-                return;
-                }
-            else if (KDelta > KThreshold) // dragging to left
-                {
-                // "emulate" left key press
-                
-                TKeyEvent keyEvent;
-                keyEvent.iCode = EKeyLeftArrow;
-                keyEvent.iModifiers = 0;
-                
-                TEventCode type = EEventKey;
-        
-                OfferKeyEventL(keyEvent, type);
-                
-                return;
-                }            
-            }
-        iIsDragging = EFalse;
-        }
-    else
-        {
-        iIsDragging = EFalse;        
-        }
-
-    CAknListQueryDialog::HandlePointerEventL(aPointerEvent);    
-    }
-*/
-       
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CFileBrowserDestinationFolderSelectionDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-    
-    if (aKeyEvent.iCode == EKeyLeftArrow && !IsDriveListViewActive())
-        {
-        MoveUpOneLevelL(); 
-        return EKeyWasConsumed;    
-        }
-    else if (aKeyEvent.iCode == EKeyRightArrow && ((ListBox()->CurrentItemIndex() > 0 && !IsDriveListViewActive()) || IsDriveListViewActive()))
-        {
-        MoveDownToDirectoryL();    
-        return EKeyWasConsumed;    
-        }
-    else if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)    
-        {
-        if (IsDriveListViewActive())
-            {
-            MoveDownToDirectoryL();    
-            return EKeyWasConsumed;    
-            }            
-        else if (ListBox()->CurrentItemIndex() == 0)
-            {
-            TryExitL(EAknSoftkeyOk);    
-            return EKeyWasConsumed;    
-            }
-        else if (ListBox()->CurrentItemIndex() > 0)
-            {
-            MoveDownToDirectoryL();    
-            return EKeyWasConsumed;    
-            }            
-        }
-
-    TKeyResponse result = CAknDialog::OfferKeyEventL(aKeyEvent, aType);
-    
-    // update LSK label
-    if (!IsDriveListViewActive())
-        {
-        if (ListBox()->CurrentItemIndex() == 0)
-            {
-            ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, iLSKActionText);
-            ButtonGroupContainer().DrawNow();                
-            }
-        else
-            {
-            ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, _L("Open dir"));
-            ButtonGroupContainer().DrawNow();                
-            }
-        }
-
-    return result;    
-    }    
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::PreLayoutDynInitL()
-    {
-    CAknListQueryDialog::PreLayoutDynInitL();
-
-    static_cast<CEikFormattedCellListBox*>(ListBox())->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::PostLayoutDynInitL()
-    {
-    CAknListQueryDialog::PostLayoutDynInitL();
-    
-    SetIconArrayL(static_cast<CArrayPtr<CGulIcon>*>(iIconArray)); 
-    
-    RefreshViewL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserDestinationFolderSelectionDlg::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == GetLeftCBAShortKeyPress())
-        {
-        if (IsDriveListViewActive())
-            {
-            MoveDownToDirectoryL();    
-            return EFalse;    
-            }            
-        else if (ListBox()->CurrentItemIndex() == 0)
-            {
-            // close the dialog
-            iReturnPath = iCurrentPath;    
-            return ETrue;    
-            }
-        else if (ListBox()->CurrentItemIndex() > 0)
-            {
-            MoveDownToDirectoryL();    
-            return EFalse;    
-            } 
-        else
-            return EFalse;
-        }    
-    else if (aButtonId == GetRightCBAShortKeyPress())
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::MoveUpOneLevelL()
-    {
-    if (iCurrentPath.Length() <= 3)
-        {
-        // move to drive list view is the current path is already short enough
-        iCurrentPath = KNullDesC;
-        }
-    else
-        {
-        // move one directory up
-        TInt marker(iCurrentPath.Length());
-        
-        // find second last dir marker
-        for (TInt i=iCurrentPath.Length()-2; i>=0; i--)
-            {
-            if (iCurrentPath[i] == '\\')
-                {
-                marker = i;
-                break;
-                }
-                
-            }
-        iCurrentPath = iCurrentPath.LeftTPtr(marker+1);
-        }    
-
-    // update view
-    RefreshViewL();        
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::MoveDownToDirectoryL()
-    {
-    TInt index = ListBox()->CurrentItemIndex();
-    
-    if (index >= 0)
-        {
-        if (IsDriveListViewActive())
-            {
-            // currently in a drive list view, move to root of selected drive
-            if (iDriveEntryList->Count() > index)
-                {
-                TDriveEntry driveEntry = iDriveEntryList->At(index);
-                
-                iCurrentPath.Append(driveEntry.iLetter);    
-                iCurrentPath.Append(_L(":\\"));
-                }
-            }
-        else
-            {
-            // this needed because we have an extra item in the listbox
-            index--;
-
-            // append the new directory
-            if (iFileEntryList->Count() > index)
-                {
-                TFileEntry fileEntry = iFileEntryList->At(index);
-                
-                if (fileEntry.iEntry.IsDir())
-                    {
-                    iCurrentPath.Append(fileEntry.iEntry.iName);
-                    iCurrentPath.Append(_L("\\"));
-                    }
-                }
-            }
-                   
-        // update view
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDestinationFolderSelectionDlg::RefreshViewL()
-    {
-    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(16);
-    
-    if (IsDriveListViewActive())
-        {
-        _LIT(KSimpleDriveEntry, "%d\t%c: <%S>\t\t");
-
-        for (TInt i=0; i<iDriveEntryList->Count(); i++)
-            {
-            TFileName textEntry;
-            TDriveEntry driveEntry = iDriveEntryList->At(i);
-            
-            textEntry.Format(KSimpleDriveEntry, driveEntry.iIconId, TUint(driveEntry.iLetter), &driveEntry.iMediaTypeDesc);
-            
-            textArray->AppendL(textEntry);
-            }
-
-        // set default LSK label
-        ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, _L("Open drive"));
-        ButtonGroupContainer().DrawNow();
-        }
-    
-    else
-        {
-        // first get the directory list
-        iFileEntryList->Reset();
-            
-        CDir* dir = NULL;
-        if (iFs.GetDir(iCurrentPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst, dir) == KErrNone)
-            {
-            CleanupStack::PushL(dir);
-            
-            for (TInt i=0; i<dir->Count(); i++)
-                {
-                TFileEntry fileEntry;
-                fileEntry.iPath = iCurrentPath;
-                fileEntry.iEntry = (*dir)[i];
-                fileEntry.iDirEntries = KErrNotFound;
-                fileEntry.iIconId = EFixedIconEmpty;
-                
-                // check for directory entries
-                if (fileEntry.iEntry.IsDir())
-                    {
-                    fileEntry.iIconId = EFixedIconFolder;
-                    
-                    TFileName subPath = fileEntry.iPath;
-                    subPath.Append(fileEntry.iEntry.iName);
-                    subPath.Append(_L("\\"));
-
-                    // check if any sub directories                
-                    CDir* subDir = NULL;
-                    if (iFs.GetDir(subPath, KEntryAttDir|KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
-                        {
-                        fileEntry.iDirEntries = subDir->Count();
-
-                        for (TInt j=0; j<subDir->Count(); j++)
-                            {
-                            TEntry entry = (*subDir)[j];
-
-                            if (entry.IsDir())
-                                {
-                                fileEntry.iIconId = EFixedIconFolderSub;
-                                break;    
-                                }
-                            }
-
-                        delete subDir;    
-                        }
-                    }
-
-                iFileEntryList->AppendL(fileEntry);
-                }
-            
-            CleanupStack::PopAndDestroy(); //dir    
-            }        
-        
-         
-        _LIT(KSimpleFileEntry, "%d\t%S\t\t");
-
-        
-        // append current folder item
-        TParse nameParser;
-        TInt err = nameParser.SetNoWild(iCurrentPath.LeftTPtr(iCurrentPath.Length()-1), NULL, NULL);
-        TFileName currentFolderName = nameParser.Name();
-        if (currentFolderName == KNullDesC)
-            currentFolderName.Copy(_L("[root level]"));
-
-        TFileName currentDirTextEntry;
-        currentDirTextEntry.Format(KSimpleFileEntry, EFixedIconFolderCurrent, &currentFolderName);
-        textArray->AppendL(currentDirTextEntry);
-
-
-        for (TInt i=0; i<iFileEntryList->Count(); i++)
-            {
-            TFileName textEntry;
-            TFileEntry fileEntry = iFileEntryList->At(i);
-            
-            textEntry.Format(KSimpleFileEntry, fileEntry.iIconId, &fileEntry.iEntry.iName);
-            
-            textArray->AppendL(textEntry);
-            }
-
-         // set default LSK label
-        ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, iLSKActionText);
-        ButtonGroupContainer().DrawNow();
-        }
-
-    if (iCurrentPath == KNullDesC)
-        iEikonEnv->InfoMsgWithDuration(_L("<- up dir  down dir ->"), TTimeIntervalMicroSeconds32(KMaxTInt));
-    else
-        iEikonEnv->InfoMsgWithDuration(iCurrentPath, TTimeIntervalMicroSeconds32(KMaxTInt));
-   
-    SetItemTextArray(textArray);
-    SetOwnershipType(ELbmOwnsItemArray);
-    ListBox()->HandleItemAdditionL();
-    Layout();
-    ListBox()->SetCurrentItemIndex(0);
-    DrawNow();
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-TBool CFileBrowserDestinationFolderSelectionDlg::RunCopyDlgLD()
-    {
-    iLSKActionText.Copy(_L("Copy"));
-    return ExecuteLD(R_COPY_TO_FOLDER_SELECTION_QUERY); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserDestinationFolderSelectionDlg::RunMoveDlgLD()
-    {
-    iLSKActionText.Copy(_L("Move"));
-    return ExecuteLD(R_MOVE_TO_FOLDER_SELECTION_QUERY); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CAknQueryDialog::GetLeftCBAShortKeyPress()
-    {
-    return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(0)));
-    }
-
-// --------------------------------------------------------------------------------------------
-  
-TInt CAknQueryDialog::GetRightCBAShortKeyPress()
-    {
-    return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(2)));
-    }
-       
-        
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-
-CFileBrowserAttributeEditorDlg* CFileBrowserAttributeEditorDlg::NewL(TUint& aSetAttMask, TUint& aClearAttMask, TBool& aRecurse)
-    {
-    CFileBrowserAttributeEditorDlg* self = new(ELeave) CFileBrowserAttributeEditorDlg(aSetAttMask, aClearAttMask, aRecurse);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserAttributeEditorDlg::~CFileBrowserAttributeEditorDlg()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserAttributeEditorDlg::CFileBrowserAttributeEditorDlg(TUint& aSetAttMask, TUint& aClearAttMask, TBool& aRecurse) :
-    iSetAttMask(aSetAttMask), iClearAttMask(aClearAttMask), iRecurse(aRecurse)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserAttributeEditorDlg::ConstructL()
-    {
-    CAknForm::ConstructL();
-
-    // set title text
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Set attributes") );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserAttributeEditorDlg::PreLayoutDynInitL()
-    {
-    CAknForm::PreLayoutDynInitL();
-    
-    // set default LSK label
-    ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, _L("Save"));
-
-    // load values
-    CAknPopupFieldText* archivePopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetArchive));
-    CAknPopupFieldText* hiddenPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetHidden));
-    CAknPopupFieldText* readOnlyPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetReadOnly));
-    CAknPopupFieldText* systemPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetSystem));
-    CAknPopupFieldText* recursePopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetRecurse));
-    
-    if (iSetAttMask & KEntryAttArchive)
-        archivePopup->SetCurrentValueIndex(KAttOn);
-    else if (iClearAttMask & KEntryAttArchive)
-        archivePopup->SetCurrentValueIndex(KAttOff);
-    
-    if (iSetAttMask & KEntryAttHidden)
-        hiddenPopup->SetCurrentValueIndex(KAttOn);
-    else if (iClearAttMask & KEntryAttHidden)
-        hiddenPopup->SetCurrentValueIndex(KAttOff);
-    
-    if (iSetAttMask & KEntryAttReadOnly)
-        readOnlyPopup->SetCurrentValueIndex(KAttOn);
-    else if (iClearAttMask & KEntryAttReadOnly)
-        readOnlyPopup->SetCurrentValueIndex(KAttOff);
-    
-    if (iSetAttMask & KEntryAttSystem)
-        systemPopup->SetCurrentValueIndex(KAttOn);
-    else if (iClearAttMask & KEntryAttSystem)
-        systemPopup->SetCurrentValueIndex(KAttOff);
-    
-    if (iRecurse)
-        recursePopup->SetCurrentValueIndex(KAttEnableRecursion);
-    else
-        recursePopup->SetCurrentValueIndex(KAttDisableRecursion);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserAttributeEditorDlg::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // save changes
-        CAknPopupFieldText* archivePopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetArchive));
-        CAknPopupFieldText* hiddenPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetHidden));
-        CAknPopupFieldText* readOnlyPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetReadOnly));
-        CAknPopupFieldText* systemPopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetSystem));
-        CAknPopupFieldText* recursePopup = static_cast<CAknPopupFieldText*>(Control(EFileBrowserAttributeEditorSetRecurse));
-
-        iSetAttMask = 0;
-        iClearAttMask = 0;
-        
-        if (archivePopup->CurrentValueIndex() == KAttOn)
-            iSetAttMask |= KEntryAttArchive;
-        else if (archivePopup->CurrentValueIndex() == KAttOff)
-            iClearAttMask |= KEntryAttArchive;
-        
-        if (hiddenPopup->CurrentValueIndex() == KAttOn)
-            iSetAttMask |= KEntryAttHidden;
-        else if (hiddenPopup->CurrentValueIndex() == KAttOff)
-            iClearAttMask |= KEntryAttHidden;
-        
-        if (readOnlyPopup->CurrentValueIndex() == KAttOn)
-            iSetAttMask |= KEntryAttReadOnly;
-        else if (readOnlyPopup->CurrentValueIndex() == KAttOff)
-            iClearAttMask |= KEntryAttReadOnly;
-                
-        if (systemPopup->CurrentValueIndex() == KAttOn)
-            iSetAttMask |= KEntryAttSystem;
-        else if (systemPopup->CurrentValueIndex() == KAttOff)
-            iClearAttMask |= KEntryAttSystem;
-
-        if (recursePopup->CurrentValueIndex() == KAttEnableRecursion)
-            iRecurse = ETrue;
-        else if (recursePopup->CurrentValueIndex() == KAttDisableRecursion)
-            iRecurse = EFalse;
-        }
-    
-    return ETrue;
-    }       
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserAttributeEditorDlg::RunEditorLD()
-    {
-    return ExecuteLD(R_ATTRIBUTE_EDITOR_FORM_DIALOG);
-    }
-      
-       
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-
-CFileBrowserSearchQueryDlg* CFileBrowserSearchQueryDlg::NewL(TSearchAttributes& aSearchAttributes)
-    {
-    CFileBrowserSearchQueryDlg* self = new(ELeave) CFileBrowserSearchQueryDlg(aSearchAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserSearchQueryDlg::~CFileBrowserSearchQueryDlg()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserSearchQueryDlg::CFileBrowserSearchQueryDlg(TSearchAttributes& aSearchAttributes) :
-    iSearchAttributes(aSearchAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSearchQueryDlg::ConstructL()
-    {
-    CAknForm::ConstructL();
-
-    // set title text
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Search") );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSearchQueryDlg::PreLayoutDynInitL()
-    {
-    CAknForm::PreLayoutDynInitL();
-    
-    // set default LSK label
-    ButtonGroupContainer().SetCommandL(0, EAknSoftkeyOk, _L("Search"));
-
-    // load values
-    CEikEdwin* searchDir = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQuerySearchDir));
-    CEikEdwin* wildCards = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQueryWildCards));
-    CEikEdwin* textInFile = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQueryTextInFile));
-    CEikNumberEditor* minSize = static_cast<CEikNumberEditor*>(Control(EFileBrowserSearchQueryMinSize));
-    CEikNumberEditor* maxSize = static_cast<CEikNumberEditor*>(Control(EFileBrowserSearchQueryMaxSize));
-    CEikDateEditor* minDate = static_cast<CEikDateEditor*>(Control(EFileBrowserSearchQueryMinDate));
-    CEikDateEditor* maxDate = static_cast<CEikDateEditor*>(Control(EFileBrowserSearchQueryMaxDate));
-    CAknPopupFieldText* recurse = static_cast<CAknPopupFieldText*>(Control(EFileBrowserSearchQueryRecurse));
-
-    searchDir->SetTextL(&iSearchAttributes.iSearchDir);
-    wildCards->SetTextL(&iSearchAttributes.iWildCards);
-    textInFile->SetTextL(&iSearchAttributes.iTextInFile);
-    minSize->SetNumber(iSearchAttributes.iMinSize);
-    maxSize->SetNumber(iSearchAttributes.iMaxSize);
-    minDate->SetDate(iSearchAttributes.iMinDate);
-    maxDate->SetDate(iSearchAttributes.iMaxDate);
-    recurse->SetCurrentValueIndex(iSearchAttributes.iRecurse);
-    }
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserSearchQueryDlg::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // save changes
-        CEikEdwin* searchDir = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQuerySearchDir));
-        CEikEdwin* wildCards = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQueryWildCards));
-        CEikEdwin* textInFile = static_cast<CEikEdwin*>(Control(EFileBrowserSearchQueryTextInFile));
-        CEikNumberEditor* minSize = static_cast<CEikNumberEditor*>(Control(EFileBrowserSearchQueryMinSize));
-        CEikNumberEditor* maxSize = static_cast<CEikNumberEditor*>(Control(EFileBrowserSearchQueryMaxSize));
-        CEikDateEditor* minDate = static_cast<CEikDateEditor*>(Control(EFileBrowserSearchQueryMinDate));
-        CEikDateEditor* maxDate = static_cast<CEikDateEditor*>(Control(EFileBrowserSearchQueryMaxDate));
-        CAknPopupFieldText* recurse = static_cast<CAknPopupFieldText*>(Control(EFileBrowserSearchQueryRecurse));
-
-        // get the current value of search dir and make sure it has a trailing backslash
-        TFileName searchDirBuf;
-        searchDir->GetText(searchDirBuf);
-        if (searchDirBuf.Length() && searchDirBuf[searchDirBuf.Length()-1] != '\\')
-            searchDirBuf.Append('\\');
-
-        // check that the path is valid
-        if (searchDirBuf.Length() && !EikFileUtils::PathExists(searchDirBuf))
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Given search directory does not exists"));
-            
-            return EFalse;
-            }
-
-        iSearchAttributes.iSearchDir = searchDirBuf; 
-        wildCards->GetText(iSearchAttributes.iWildCards);
-        textInFile->GetText(iSearchAttributes.iTextInFile);
-        iSearchAttributes.iMinSize = minSize->Number();
-        iSearchAttributes.iMaxSize = maxSize->Number();
-        iSearchAttributes.iMinDate = minDate->Date();
-        iSearchAttributes.iMaxDate = maxDate->Date();
-        // Adjust the MaxDate to the end of the day:
-        iSearchAttributes.iMaxDate += TTimeIntervalMicroSeconds( KAlmostaDayInMicroSeconds );
-        iSearchAttributes.iRecurse = recurse->CurrentValueIndex();
-        }
-    
-    return ETrue;
-    }       
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserSearchQueryDlg::RunQueryLD()
-    {
-    return ExecuteLD(R_SEARCH_QUERY_FORM_DIALOG);
-    }
-  
-       
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-
-CFileBrowserDataTypesDlg* CFileBrowserDataTypesDlg::NewL()
-    {
-    CFileBrowserDataTypesDlg* self = new(ELeave) CFileBrowserDataTypesDlg();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserDataTypesDlg::~CFileBrowserDataTypesDlg()
-    {
-    delete iDTArray;
-    
-    iLs.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserDataTypesDlg::CFileBrowserDataTypesDlg()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::ConstructL()
-    {
-    // construct a menu bar
-    CAknDialog::ConstructL(R_FILEBROWSER_DATA_TYPES_MENUBAR);
-
-    // set title text
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Data types") );
-    
-    User::LeaveIfError(iLs.Connect());
-    
-    iDTArray = new(ELeave) CDataTypeArray(32);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            // reserved for future extensions;
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::ProcessCommandL(TInt aCommandId)
-    {
-    CAknDialog::ProcessCommandL(aCommandId);
-
-    switch (aCommandId)
-        {
-        case EFileBrowserCmdDataTypesChangeMapping:
-            ChangeMappingL();
-            break;
-        case EFileBrowserCmdDataTypesSetDefaultMapping:
-            SetDefaultMappingL();
-            break;
-        case EFileBrowserCmdDataTypesRefresh:
-            GetDataTypesL();
-            break;
-        case EFileBrowserCmdDataTypesExit:
-            TryExitL(EAknCmdExit);
-            break;
-        default:
-            break;
-        }
-    } 
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::PreLayoutDynInitL()
-    {
-    CAknDialog::PreLayoutDynInitL();
-
-    iListBox = static_cast<CAknSingleGraphicStyleListBox*>( Control(EFileBrowserDataTypesList) );
-    iListBox->SetContainerWindowL(*this);
-    iListBox->View()->SetListEmptyTextL(_L("No data types"));
-
-    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-        
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-    
-    iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-
-    GetDataTypesL(); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::GetDataTypesL()
-    {
-    // get an instance of the listbox's item array
-	MDesCArray* tempArray = iListBox->Model()->ItemTextArray();
-	CDesCArray* listBoxArray = (CDesCArray*)tempArray;
-	listBoxArray->Reset();
-	
-	// create an icon array
-	CAknIconArray* iconArray = new(ELeave) CAknIconArray(32);
-    CleanupStack::PushL(iconArray);
-
-    // get data types
-    iDTArray->Reset();
-    User::LeaveIfError(iLs.GetSupportedDataTypesL(*iDTArray));
-    
-    // sort the array
-    TKeyArrayFix key(0, ECmpFolded8);  // iDataType is located in offset 0 and contain 8-bit descriptor
-    iDTArray->Sort(key);
-
-    
-    // loop each data type
-    for (TInt i=0; i<iDTArray->Count(); i++)
-        {
-        TDataType& dt = iDTArray->At(i);
-        
-        // get app uid which handles this data type
-        TUid appUid;
-        TInt err = iLs.AppForDataType(dt, appUid);
-        
-        // generate icon which is the app icon which handles this mime type
-        CFbsBitmap* bitmap = NULL;
-        CFbsBitmap* mask = NULL;
-        CGulIcon* appIcon = NULL;
-        
-        TRAPD(err2, 
-            AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), appUid, EAknsAppIconTypeList, bitmap, mask);
-            appIcon = CGulIcon::NewL(bitmap, mask);
-            CleanupStack::Pop(2); //bitmap, mask
-            );
-                         
-        // append to the icon array    
-        appIcon->SetBitmapsOwnedExternally(EFalse);
-        iconArray->AppendL(appIcon);
-        
-        TFileName entry;
-        entry.AppendNum(i);
-        entry.Append(_L("\t"));
-        entry.Append(dt.Des());
-        entry.Append(_L("  <<"));
-        
-
-        // get caption of the handling app
-        TFileName appCaption;
-        
-        if (err || err2 || appUid == KNullUid)
-            entry.Append(_L("none"));
-        else
-            {
-            TApaAppInfo appInfo;
-            
-            if (iLs.GetAppInfo(appInfo, appUid) == KErrNone)
-                entry.Append(appInfo.iCaption);
-            else
-                entry.Append(_L("none"));
-            }
-        
-        entry.Append(_L(">>"));
-
-        listBoxArray->AppendL( entry );
-        }
-
-
-    // clear any previous icon array
-    CAknIconArray* oldIconArray = static_cast<CAknIconArray*>(iListBox->ItemDrawer()->ColumnData()->IconArray());
-    if (oldIconArray)
-        delete oldIconArray;
-
-    
-    CleanupStack::Pop(); //iconArray
-
-    // updates the listbox
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
-    iListBox->HandleItemAdditionL();    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::ChangeMappingL()
-    {
-    TInt currentItemIndex = iListBox->CurrentItemIndex();
-    
-    if (iDTArray->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        // create list of TApaAppInfo
-        CArrayFixFlat<TApaAppInfo>* appInfoArray = new(ELeave) CArrayFixFlat<TApaAppInfo>(64);
-        CleanupStack::PushL(appInfoArray);
-
-        // get list of applications
-        TApaAppInfo appInfo;
-        User::LeaveIfError(iLs.GetAllApps());
-
-        while (iLs.GetNextApp(appInfo) == KErrNone)
-            {
-            appInfoArray->AppendL(appInfo);
-            }
-
-        // sort the array
-        TKeyArrayFix key(_FOFF(TApaAppInfo,iCaption), ECmpFolded16);
-        appInfoArray->Sort(key);
-
-        // create a popup with listbox
-        CAknSingleGraphicPopupMenuStyleListBox* listBox = new(ELeave) CAknSingleGraphicPopupMenuStyleListBox();
-        CleanupStack::PushL(listBox);
-        CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuGraphicWindow );
-        CleanupStack::PushL(popupList);
-        listBox->ConstructL( popupList, 0 );
-        listBox->CreateScrollBarFrameL(ETrue);
-        listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        listBox->View()->SetListEmptyTextL(_L("No apps"));
-        listBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);        
-        listBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-        popupList->SetTitleL(_L("Select app"));
-        popupList->EnableFind();
-
-
-        // get an instance of the listbox's item array
-    	MDesCArray* tempArray = listBox->Model()->ItemTextArray();
-    	CDesCArray* listBoxArray = (CDesCArray*)tempArray;
-
-    	// create an icon array
-    	CAknIconArray* iconArray = new(ELeave) CAknIconArray(32);
-        CleanupStack::PushL(iconArray);
-        
-        // loop each app info
-        for (TInt i=0; i<appInfoArray->Count(); i++)
-            {
-                   
-            // get icon of this app
-            CFbsBitmap* bitmap = NULL;
-            CFbsBitmap* mask = NULL;
-            CGulIcon* appIcon = NULL;
-            
-            TRAP_IGNORE( 
-                AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), appInfoArray->At(i).iUid, EAknsAppIconTypeList, bitmap, mask);
-                appIcon = CGulIcon::NewL(bitmap, mask);
-                CleanupStack::Pop(2); //bitmap, mask
-                );
-                             
-            // append to the icon array    
-            appIcon->SetBitmapsOwnedExternally(EFalse);
-            iconArray->AppendL(appIcon);            
-            
-            TFileName entry;
-            entry.AppendNum(i);
-            entry.Append(_L("\t"));
-            entry.Append(appInfoArray->At(i).iCaption);
-            
-            listBoxArray->AppendL(entry);
-            }
-
-
-        CleanupStack::Pop(); //iconArray
-
-        // updates the listbox
-        listBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
-        listBox->HandleItemAdditionL(); 
-
-    
-        // execute the popup to query the application
-        if (popupList->ExecuteLD())
-            {
-
-            // query priority
-            TInt queryIndex(0);
-            CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
-
-            if (listQueryDlg->ExecuteLD(R_DATA_TYPE_PRIORITY_QUERY))
-                {
-                TInt32 selectedPriority(0);
-                
-                if (queryIndex == EDataTypePriorityMaximum)
-                    selectedPriority = KDataTypeUnTrustedPriorityThreshold;
-                else if (queryIndex == EDataTypePriorityHigh)
-                    selectedPriority = KDataTypePriorityHigh;
-                else if (queryIndex == EDataTypePriorityNormal)
-                    selectedPriority = KDataTypePriorityNormal;
-                else if (queryIndex == EDataTypePriorityLow)
-                    selectedPriority = KDataTypePriorityLow;
-                else
-                    selectedPriority = KDataTypePriorityLastResort;
-                
-                
-                TApaAppInfo& selectedAppInfo = appInfoArray->At(listBox->CurrentItemIndex());
-
-                if (iLs.InsertDataMapping(iDTArray->At(currentItemIndex), selectedPriority, selectedAppInfo.iUid) == KErrNone)
-                    {
-                    GetDataTypesL();
-
-                    CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                    note->ExecuteLD(_L("Mapping changed"));
-                    }
-                else
-                    {
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(_L("Unable to change mapping"));
-                    }  
-                }
-            }
-
-        CleanupStack::Pop(); // popupList
-        CleanupStack::PopAndDestroy(2); // listBox, appInfoArray
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserDataTypesDlg::SetDefaultMappingL()
-    {
-    TInt currentItemIndex = iListBox->CurrentItemIndex();
-    
-    if (iDTArray->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        if (iLs.DeleteDataMapping(iDTArray->At(currentItemIndex)) == KErrNone)
-            {
-            GetDataTypesL();
-            
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("Restored default"));
-            }
-        else
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Nothing to restore"));
-            }
-        }
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserDataTypesDlg::OkToExitL(TInt aButtonId)
-    {
-    return CAknDialog::OkToExitL(aButtonId);
-    }
-           
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserDataTypesDlg::RunQueryLD()
-    {
-    return ExecuteLD(R_DATA_TYPES_DIALOG);
-    }
-       
-// --------------------------------------------------------------------------------------------
-      
-// End of File
-
--- a/filebrowser/src/FBFileEditor.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1300 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBFileEditor.h"
-#include "FBStd.h"
-#include "FB.hrh"
-#include <filebrowser.rsg>
-
-#include <utf.h>
-#include <eikedwin.h>
-#include <eikrted.h>
-#include <txtrich.h>
-#include <eikspane.h>
-#include <avkon.hrh> 
-#include <akntitle.h>
-#include <AknUtils.h> 
-#include <AknBidiTextUtils.h>
-#include <aknnotewrappers.h>
-#include <eiksbfrm.h>
-#include <AknDef.h>
-#include <layoutmetadata.cdl.h>
-
-const TUint KLeftMargin = 2;
-const TUint KRightMargin = 2;
-const TUint KHexSeparatorMargin = 4;
-
-const TInt KEditorFontHeight = 117;
-const TInt KViewerFontHeight = 117;
-const TInt KEditorFontHeightQHD = 100;
-const TInt KViewerFontHeightQHD = 100;
-
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-CFileBrowserFileEditorDlg* CFileBrowserFileEditorDlg::NewL(const TDesC& aFileName, TInt aMode)
-    {
-    CFileBrowserFileEditorDlg* self = new(ELeave) CFileBrowserFileEditorDlg(aFileName, aMode);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileEditorDlg::~CFileBrowserFileEditorDlg()
-    {
-    if (iEditorPF)
-        delete iEditorPF;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileEditorDlg::CFileBrowserFileEditorDlg(const TDesC& aFileName, TInt aMode) :
-    iFileName(aFileName), iActiveMode(aMode)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::ConstructL()
-    {
-    // construct a menu bar
-    if (iActiveMode == EFileEditorEditAsText || iActiveMode == EFileEditorEditAsHex)
-        CAknDialog::ConstructL(R_FILEBROWSER_FILEEDITOR_MENUBAR);
-    else
-        CAknDialog::ConstructL(R_FILEBROWSER_FILEVIEWER_MENUBAR);
-    
-    iTextFormat = EFileBrowserCmdFileEditorSaveFormatANSIASCII;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::PreLayoutDynInitL()
-    {
-    CAknDialog::PreLayoutDynInitL();
-    
-    // set title text
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("File editor") );
-    
-    
-    // init edwin editor component
-    if (iActiveMode == EFileEditorEditAsText || iActiveMode == EFileEditorEditAsHex)
-        {
-        CCoeControl* control = CreateLineByTypeL(KNullDesC, EFileEditorDialogId, EEikCtEdwin, NULL);
-        iTextEditor = static_cast<CEikEdwin*>(control);
-        iTextEditor->SetMopParent(this);
-        iTextEditor->ConstructL(EEikEdwinOwnsWindow|EEikEdwinNoHorizScrolling|EEikEdwinInclusiveSizeFixed|EEikEdwinNoAutoSelection, 0, 0, 0 );
-        iTextEditor->CreateTextViewL();
-        iTextEditor->SetAknEditorFlags(EAknEditorFlagEnableScrollBars);
-        iTextEditor->CreateScrollBarFrameL();
-        iTextEditor->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        iTextEditor->ForceScrollBarUpdateL(); 
-        iTextEditor->SetBackgroundColorL(KRgbWhite);
-        iTextEditor->SetFocus(ETrue);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::PostLayoutDynInitL()
-    {
-    CAknDialog::PostLayoutDynInitL();
-    
-    // modify layout of the texteditor
-    if (iActiveMode == EFileEditorEditAsText || iActiveMode == EFileEditorEditAsHex)
-        {
-        CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-        const TSize screenSize = dev->SizeInPixels();
-        
-        // Set the font of the editor
-        TFontSpec fontSpec = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont)->FontSpecInTwips();
-        fontSpec.iHeight = IsQHD(screenSize) ? KEditorFontHeightQHD : KEditorFontHeight; // set height
-        
-        TCharFormat cf(fontSpec.iTypeface.iName, fontSpec.iHeight);
-        cf.iFontPresentation.iTextColor = KRgbBlack; 
-
-        TCharFormatMask cfm;
-        cfm.SetAll();
-
-        CCharFormatLayer *charFL = CCharFormatLayer::NewL(cf, cfm);
-        iTextEditor->SetCharFormatLayer(charFL);
-
-        if (iEditorPF)
-            {
-            delete iEditorPF;
-            iEditorPF = NULL;
-            }
-
-        iEditorPF = CParaFormat::NewL();
-        iEditorPF->iLineSpacingInTwips = IsQHD(screenSize) ? KEditorFontHeightQHD : KEditorFontHeight;
-        iEditorPF->iFillColor = KRgbWhite;
-
-        TParaFormatMask pfm;
-        pfm.SetAll();
-
-        CParaFormatLayer *paraFL = CParaFormatLayer::NewL(iEditorPF, pfm);
-        iTextEditor->SetParaFormatLayer(paraFL);
-        
-
-        // set size of the editor
-        TRect rect = Rect();
-        iTextEditor->SetRect(rect);
-        //iTextEditor->Size().iWidth - (CEikScrollBar::DefaultScrollBarBreadth());
-        }
-
-    // load the file to editor or viewer
-    LoadFileL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::OpenFileLC(RFile& aFile, const TDesC& aFileName)
-    {
-    TInt err = aFile.Open(CEikonEnv::Static()->FsSession(), aFileName, EFileRead|EFileShareReadersOnly);
-    
-    if (err == KErrInUse)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("The file is in use, cannot open"));
-        User::Leave(KErrNone);
-        }
-    else if (err != KErrNone)
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("Cannot open the file"));
-        User::Leave(KErrNone);
-        }
-    else
-        {
-        // opened succesfully, add to cleanup stack
-        CleanupClosePushL(aFile);
-        }     
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::GetTextFileMode(RFile& aFile, TInt& aFileSize)
-    {
-    iTextFormat = EFileBrowserCmdFileEditorSaveFormatANSIASCII;
-
-    // if we are working with text files, check the type first   
-    if (iActiveMode == EFileEditorEditAsText || iActiveMode == EFileEditorViewAsText)
-        {
-        TBuf8<4> BOM;
-
-        // first check for UTF-16
-        if (aFileSize >= 2 && aFile.Read(0, BOM, 2) == KErrNone)
-            {
-            if (BOM.Length()==2 && BOM[0]==0xFF && BOM[1]==0xFE)
-                {
-                iTextFormat = EFileBrowserCmdFileEditorSaveFormatUTF16LE;
-                aFileSize -= 2;
-                return;
-                }
-            else if (BOM.Length()==2 && BOM[0]==0xFE && BOM[1]==0xFF)
-                {
-                iTextFormat = EFileBrowserCmdFileEditorSaveFormatUTF16BE;
-                aFileSize -= 2;
-                return;
-                }
-            }       
-
-        // then check for UTF-8
-        if (aFileSize >= 3 && aFile.Read(0, BOM, 3) == KErrNone)
-            {
-            if (BOM.Length()==3 && BOM[0]==0xEF && BOM[1]==0xBB && BOM[2]==0xBF)
-                {
-                iTextFormat = EFileBrowserCmdFileEditorSaveFormatUTF8;
-                aFileSize -= 3;
-                return;
-                }
-            }
-            
-        
-        // none of those, seek back to beginning
-        TInt pos(0);
-        aFile.Seek(ESeekStart, pos);
-        }    
-    }
-
-
-// --------------------------------------------------------------------------------------------
-
-HBufC16* CFileBrowserFileEditorDlg::ConvertBuf8ToBuf16L(HBufC8* aBuf8)
-    {
-    __ASSERT_ALWAYS(aBuf8 != NULL, User::Panic(_L("Emp.Buf."),942));
-
-    HBufC16* buf16 = NULL;
-    TPtr8 buf8Ptr(aBuf8->Des()); 
-
-    if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatANSIASCII)
-        {
-        // simple conversion
-        buf16 = HBufC16::NewMaxL(aBuf8->Length());
-        buf16->Des().Copy(aBuf8->Des());
-        }
-    
-    else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF8)
-        {
-        // use the conversion service
-        buf16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L(aBuf8->Des());
-        }            
-
-    else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE || iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-        {
-        buf16 = HBufC16::NewL(aBuf8->Length());
-        buf16->Des().Copy(KNullDesC);
-        
-        HBufC16* oneUniCodeChar = HBufC16::NewMaxLC(1);
-        TUint16* oneUniCodeCharPtr = &oneUniCodeChar->Des()[0];
-       
-        for (TInt i=0; i<buf8Ptr.Length(); i+=2)
-            {
-            // get two 8-bit values and pack them to one 16-bit character depending of endianess
-
-            if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE)
-                {
-                oneUniCodeCharPtr[0] = TUint16((buf8Ptr[i+1] << 8) + buf8Ptr[i]);
-                }
-            else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-                {
-                oneUniCodeCharPtr[0] = TUint16((buf8Ptr[i] << 8) + buf8Ptr[i+1]);
-                }
-            
-            // append to buffer
-            buf16->Des().Append( oneUniCodeChar->Des() );
-            }
-        
-        CleanupStack::PopAndDestroy(); // oneUniCodeChar
-        } 
-    
-    return buf16; //ownership of buf16 will transferred to the caller           
-    }
-
-// --------------------------------------------------------------------------------------------
-
-HBufC8* CFileBrowserFileEditorDlg::ConvertBuf16ToBuf8L(HBufC16* aBuf16)
-    {
-    __ASSERT_ALWAYS(aBuf16 != NULL, User::Panic(_L("Emp.Buf."),943));
-
-    HBufC8* buf8 = NULL;
-    TPtr16 buf16Ptr(aBuf16->Des()); 
-
-    if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatANSIASCII)
-        {
-        // simple conversion
-        buf8 = HBufC8::NewMaxL(aBuf16->Length());
-        buf8->Des().Copy(aBuf16->Des());
-        }
-    
-    else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF8)
-        {
-        // use the conversion service
-        buf8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L(aBuf16->Des());
-        }            
-
-    else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE || iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-        {
-        buf8 = HBufC8::NewL(aBuf16->Length()*2);
-        buf8->Des().Copy(KNullDesC);
-
-        TUint16* charPtr = NULL;
-        TBuf8<2> twoChars;
-        twoChars.Copy(_L8("XX"));        
-       
-        for (TInt i=0; i<aBuf16->Length(); i++)
-            {
-            charPtr = &aBuf16->Des()[i];
-            
-            // get 16-bit character to two variables
-            if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE)
-                {
-                twoChars[0] = TUint8(charPtr[0]);
-                twoChars[1] = TUint8(charPtr[0] << 8);
-                }
-            else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-                {
-                twoChars[0] = TUint8(charPtr[0] << 8);
-                twoChars[1] = TUint8(charPtr[0]);
-                }
-
-            // append to the buffer
-            buf8->Des().Append(twoChars);
-
-            } // for
-            
-        } // else if
-    
-    return buf8; //ownership of buf8 will transferred to the caller           
-    }                
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::LoadFileL()
-    {
-    // open the file for reading
-    RFile fileP;
-    OpenFileLC(fileP, iFileName);
-    
-    // get file size
-    TInt fileSize(0);
-    User::LeaveIfError(fileP.Size(fileSize));
-
-    // read BOM from file
-    GetTextFileMode(fileP, fileSize);
-
-    
-    // editor related file loading
-    if (iActiveMode == EFileEditorEditAsText || iActiveMode == EFileEditorEditAsHex)
-        {
-        // make sure that there is currently no text in the editor 
-        iTextEditor->Text()->Reset();
-
-        // set character handling related cases for the editor
-        if (iActiveMode == EFileEditorEditAsText)
-            {
-            iTextEditor->SetOnlyASCIIChars(EFalse);
-            iTextEditor->SetAknEditorCase(EAknEditorTextCase);
-            }
-        else if (iActiveMode == EFileEditorEditAsHex)
-            {
-            iTextEditor->SetOnlyASCIIChars(ETrue);
-            iTextEditor->SetAknEditorCase(EAknEditorUpperCase);
-            }  
-            
-        const TInt KBufSize(1024);
-        TInt fileOffset(0);
-        TInt printOffset(0);
-
-        HBufC8* buf = HBufC8::NewLC(KBufSize);
-        TPtr8 bufPtr(buf->Des());
-        TChar ch;
-        _LIT(KHex, "%02x");
-        TBuf<3> hexBuf;
-
-        // read to buffer and supply the editor
-        while (fileOffset < fileSize)
-            {
-            // read to buffer
-            User::LeaveIfError( fileP.Read(bufPtr, KBufSize) );
-            
-            // handle in text format
-            if (iActiveMode == EFileEditorEditAsText)
-                {
-                HBufC16* buf16 = ConvertBuf8ToBuf16L(buf);
-                CleanupStack::PushL(buf16);
-                TPtr16 buf16Ptr(buf16->Des());
-
-                // replace any line breaks and append to the editor
-                for (TInt i=0; i<buf16Ptr.Length(); i++)
-                    {
-                    ch = buf16Ptr[i] != '\n' ? (TChar)buf16Ptr[i] : (TChar)CEditableText::ELineBreak;
-                    iTextEditor->Text()->InsertL(printOffset, ch);
-                    printOffset++;
-                    }
-                
-                CleanupStack::PopAndDestroy(); // buf16
-                }
-            
-            // or handle in hex format
-            else if (iActiveMode == EFileEditorEditAsHex)
-                {
-                for (TInt i=0; i<bufPtr.Length(); i++)
-                    {
-                    hexBuf.Format(KHex, bufPtr[i]);
-                    hexBuf.UpperCase();
-                    hexBuf.Append(_L(" "));                    
-                    iTextEditor->Text()->InsertL(printOffset, hexBuf);
-                    printOffset += 3;
-                    }
-                }
-            
-            fileOffset += bufPtr.Length();
-            }
-                
-        CleanupStack::PopAndDestroy(); // buf
-
-        // make sure that the cursor position is in the beginning 
-        iTextEditor->SetCursorPosL(0, EFalse);
-        iTextEditor->NotifyNewDocumentL();
-        iTextEditor->UpdateScrollBarsL();
-        }
-
-
-    // viewer related file loading
-    else if (iActiveMode == EFileEditorViewAsText || iActiveMode == EFileEditorViewAsHex)
-        {
-        // load the entire file to buffer
-        HBufC8* buf = HBufC8::NewLC(fileSize);
-        TPtr8 bufPtr(buf->Des());
-        
-        User::LeaveIfError( fileP.Read(bufPtr, fileSize) );
-        
-        // send the buffer to viewer
-        if (iActiveMode == EFileEditorViewAsText)
-            {
-            HBufC16* buf16 = ConvertBuf8ToBuf16L(buf);
-            CleanupStack::PopAndDestroy(); // buf
-            iViewer->FormatAsTextL(buf16);
-            }
-
-        else if (iActiveMode == EFileEditorViewAsHex)
-            {
-            iViewer->FormatAsHexL(buf);
-            CleanupStack::Pop(); // buf
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); // fileP
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::SaveEditorDataL(TBool aQueryNewName)
-    {
-    TBool doSave(ETrue);
-    CPlainText* docText = iTextEditor->Text();
-    TInt docLength = docText->DocumentLength();
-    
-    TFileName fileName;
-    fileName.Copy(iFileName);
-    
-    // check that format of the file is valid
-    if (iActiveMode == EFileEditorEditAsHex)
-        {
-        // check every 3rd char is a space
-        for (TInt i=2; i<docLength; i+=3)
-            {
-            TPtrC docPtr = docText->Read(i, 1);
-            if (docPtr.Length() < 1 || docPtr[0] != ' ')
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Separate hex blocks with space!"));
-                return;                
-                }
-            }
-        
-        // check for valid chars
-        for (TInt i=0; i<docLength; i+=3)
-            {
-            TPtrC docPtr = docText->Read(i, 2);
-            if (docPtr.Length() < 2 || !IsHexChar(docPtr[0]) || !IsHexChar(docPtr[1]))
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Use only hex characters!"));
-                return;                
-                }
-            }
-        }
-    
-    
-    // query new file name
-    if (aQueryNewName)
-        {
-        CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(fileName);
-        textQuery->SetPromptL(_L("Full path:"));
-        
-        if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-            {
-            doSave = ETrue;
-            }
-        else
-            {
-            doSave = EFalse;
-            }
-        }
-
-
-    // continue with writing
-    if (doSave)        
-        {
-        RFile fileP;
-        TInt err = fileP.Replace(CEikonEnv::Static()->FsSession(), fileName, EFileWrite);
-            
-        if (err == KErrNone)    
-            {
-            CleanupClosePushL(fileP);
-            
-            const TInt KBufSize(1002);
-            TInt fileOffset(0);        
-            TInt docOffset(0);
-            TLex converter;
-            TUint hexValue(0);
-            
-            // write BOM for text files
-            if (iActiveMode == EFileEditorEditAsText)
-                {
-                if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE)
-                    {
-                    TBuf8<2> BOM;
-                    BOM.Append(0xFF);
-                    BOM.Append(0xFE);
-                    
-                    if (fileP.Write(0, BOM, 2) == KErrNone)
-                        fileOffset += 2;
-                    }
-                
-                else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-                    {
-                    TBuf8<2> BOM;
-                    BOM.Append(0xFE);
-                    BOM.Append(0xFF);
-                    
-                    if (fileP.Write(0, BOM, 2) == KErrNone)
-                        fileOffset += 2;
-                    }
-                                  
-                else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF8)
-                    {
-                    TBuf8<3> BOM;
-                    BOM.Append(0xEF);
-                    BOM.Append(0xBB);
-                    BOM.Append(0xBF);
-                    
-                    if (fileP.Write(0, BOM, 3) == KErrNone)
-                        fileOffset += 3;
-                    }                
-                }
-            
-            
-            HBufC8* buf = HBufC8::NewLC(KBufSize * 2);
-            TPtr8 bufPtr(buf->Des());      
-          
-            while (docOffset < docLength)
-                {
-                // get text from storage
-                TPtrC docPtr = docText->Read(docOffset, KBufSize);
-                bufPtr.Copy(KNullDesC);
-
-                if (iActiveMode == EFileEditorEditAsText)
-                    {
-                    HBufC16* convBuf = HBufC16::NewLC(docPtr.Length());
-                    convBuf->Des().Copy(KNullDesC);
-                    
-                     // convert to line breaks first
-                    for (TInt i=0; i<docPtr.Length(); i++)
-                        {
-                        if (docPtr[i] == CEditableText::EParagraphDelimiter) // skip extra char from the editor
-                            continue;    
-                        else if (docPtr[i] == CEditableText::ELineBreak)
-                            convBuf->Des().Append('\n');
-                        else
-                            convBuf->Des().Append(docPtr[i]);
-                        }
- 
-                    HBufC8* buf8 = ConvertBuf16ToBuf8L(convBuf);
-                    
-                    // make sure the sizes are correct
-                    if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatANSIASCII || iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF8)
-                        {
-                        bufPtr.Copy(buf8->Des().Left(convBuf->Length())); 
-                        }
-                    else if (iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16LE || iTextFormat == EFileBrowserCmdFileEditorSaveFormatUTF16BE)
-                        {
-                        bufPtr.Copy(buf8->Des().Left(convBuf->Length()*2)); 
-                        }
-                    
-                    delete buf8;
-                    buf8 = NULL;
-
-                    CleanupStack::PopAndDestroy(); // convBuf
-                    }
-                    
-                else if (iActiveMode == EFileEditorEditAsHex)
-                    {
-                    for (TInt i=0; i<docPtr.Length(); i+=3)
-                        {
-                        if (i+1 >= docPtr.Length() - 1)
-                            break;
-                        
-                        TBuf<3> buf2;
-                        buf2.Append(docPtr[i]);
-                        buf2.Append(docPtr[i+1]);
-
-                        // convert from hex to decimal
-                        converter.Assign(buf2);
-                        if (converter.Val(hexValue, EHex) == KErrNone)
-                            {
-                            bufPtr.Append(hexValue);
-                            }
-                        }                    
-                    }
-                
-                // write to a file
-                err = fileP.Write(fileOffset, bufPtr, bufPtr.Length());
-                if (err != KErrNone)
-                    break;
-                
-                docOffset += docPtr.Length();
-                fileOffset += bufPtr.Length();
-                }
-            
-           CleanupStack::PopAndDestroy(2); // buf, fileP
-            }
-        
-        if (err == KErrNone)
-            {
-            // remember the new file name if save was succesfull
-            iFileName.Copy(fileName);
-            
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("Saved succesfully"));
-            } 
-        else if (err == KErrInUse)
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("The file is in use, cannot write"));
-            User::Leave(KErrNone);
-            }
-        else
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Cannot write to the file"));
-            User::Leave(KErrNone);
-            }
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileEditorDlg::IsHexChar(TInt aCh)
-    {
-    if (aCh >= '0' && aCh <= '9')
-        return ETrue;
-    else if (aCh >= 'a' && aCh <= 'f')
-        return ETrue;
-    else if (aCh >= 'A' && aCh <= 'F')
-        return ETrue;
-    else
-        return EFalse;
-    }
-      
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::ProcessCommandL(TInt aCommandId)
-    {
-    CAknDialog::ProcessCommandL(aCommandId);
-
-    switch (aCommandId)
-        {
-        case EFileBrowserCmdFileEditorViewAsText:
-            {
-            iActiveMode = EFileEditorViewAsText;
-            LoadFileL();
-            }
-            break;
-
-        case EFileBrowserCmdFileEditorViewAsHex:
-            {
-            iActiveMode = EFileEditorViewAsHex;
-            LoadFileL();
-            }
-            break;
-
-//
-        case EFileBrowserCmdFileEditorSave:
-            {
-            SaveEditorDataL();
-            }
-            break;
-            
-        case EFileBrowserCmdFileEditorSaveAs:
-            {
-            SaveEditorDataL(ETrue);
-            }
-            break;
-
-        case EFileBrowserCmdFileEditorSaveFormatANSIASCII:
-        case EFileBrowserCmdFileEditorSaveFormatUTF8:
-        case EFileBrowserCmdFileEditorSaveFormatUTF16LE:
-        case EFileBrowserCmdFileEditorSaveFormatUTF16BE:
-            {
-            iTextFormat = aCommandId;
-            }
-            break;
-            
-        case EFileBrowserCmdFileEditorEditAsText:
-            {
-            iActiveMode = EFileEditorEditAsText;
-            LoadFileL();
-            }
-            break;
-
-        case EFileBrowserCmdFileEditorEditAsHex:
-            {
-            iActiveMode = EFileEditorEditAsHex;
-            LoadFileL();
-            }
-            break;
-
-//                        
-        case EFileBrowserCmdFileEditorExit:
-            TryExitL(EAknCmdExit);
-            break;
-
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_FILEBROWSER_FILEVIEWER_MENUPANE)
-        {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEditorViewAsText, iActiveMode == EFileEditorViewAsText);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEditorViewAsHex, iActiveMode == EFileEditorViewAsHex);
-        }
-    else if (aResourceId == R_FILEBROWSER_FILEEDITOR_MENUPANE)
-        {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEditorEditAsText, iActiveMode == EFileEditorEditAsText);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEditorEditAsHex, iActiveMode == EFileEditorEditAsHex);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEditorSaveFormat, iActiveMode == EFileEditorEditAsHex);
-        }
-	else if (aResourceId == R_FILEBROWSER_FILEEDITOR_SAVEFORMAT_SUBMENU)
-	    {
-        aMenuPane->SetItemButtonState(iTextFormat, EEikMenuItemSymbolOn);
-	    }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-SEikControlInfo CFileBrowserFileEditorDlg::CreateCustomControlL(TInt aControlType)
-    {
-    SEikControlInfo controlInfo;
-    controlInfo.iControl = NULL;
-    controlInfo.iTrailerTextId = 0;
-    controlInfo.iFlags = 0;
-
-    if (aControlType == EFileViewerDialogControl)
-        {
-        // create a control
-        iViewer = new(ELeave) CFileBrowserFileEditorViewControl();
-        iViewer->SetMopParent(this);
-        iViewer->ConstructL();
-
-        controlInfo.iControl = iViewer;
-        }
-        
-    return controlInfo;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorDlg::SetSizeAndPosition(const TSize& /*aSize*/)
-    {
-    // fill whole window
-    TRect mainPaneRect;
-    TRect naviPaneRect;
-
-    if (Layout_Meta_Data::IsLandscapeOrientation() ||
-        iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        }
-    else
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-        mainPaneRect.iTl.iY = naviPaneRect.Height();   
-        }
-            
-    SetRect(mainPaneRect);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileEditorDlg::RunDlgLD()
-    {
-    if (iActiveMode == EFileEditorViewAsText || iActiveMode == EFileEditorViewAsHex)
-        return ExecuteLD(R_FILEBROWSER_FILEVIEWER_DIALOG);
-    else
-        return ExecuteLD(R_FILEBROWSER_FILEEDITOR_DIALOG);
-    }
-       
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileEditorViewControl::~CFileBrowserFileEditorViewControl()
-    {
-    ResetVariables();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileEditorViewControl::CFileBrowserFileEditorViewControl()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::ConstructL()
-    {
-    CreateWindowL();
-    SetBlank();
-    SetRect(Rect());
-    ActivateL();
-    
-    iTotalNumberOfLines = 0;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TSize CFileBrowserFileEditorViewControl::MinimumSize()
-    {
-    TRect mainPaneRect;
-    TRect naviPaneRect;
-    
-    if (Layout_Meta_Data::IsLandscapeOrientation() ||
-        iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        }
-    else
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-        mainPaneRect.iTl.iY = naviPaneRect.Height();   
-        }
-
-    return mainPaneRect.Size();
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CFileBrowserFileEditorViewControl::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-    
-    // normally scroll only one line
-    TInt scrollLines(1); 
-    
-    // with special keys scroll iNumberOfLinesFitsScreen-1 lines instead
-    if (aKeyEvent.iCode == EKeyIncVolume || aKeyEvent.iCode=='#' || aKeyEvent.iCode == EKeyDecVolume || aKeyEvent.iCode=='*')
-        scrollLines = iNumberOfLinesFitsScreen-1;
-    
-    
-    if (aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyIncVolume || aKeyEvent.iCode=='#')
-        {
-        if (iCurrentLine > 0)
-            {
-            iCurrentLine -= scrollLines;
-            
-            if (iCurrentLine < 0)
-                iCurrentLine = 0;
-            
-            UpdateScrollBarL();
-            DrawNow();
-            }
-
-        return EKeyWasConsumed;
-        }
-    
-    else if (aKeyEvent.iCode == EKeyDownArrow || aKeyEvent.iCode == EKeyDecVolume || aKeyEvent.iCode=='*')
-        {
-        if (iActiveMode == EFileEditorViewAsText)
-            {
-            // no need to scroll text if it fits to the screen
-            if (iTotalNumberOfLines <= iNumberOfLinesFitsScreen)
-                return EKeyWasConsumed;
-
-            iCurrentLine += scrollLines;
-
-            // adjust the last line to end of the screen            
-            if (iCurrentLine > iTotalNumberOfLines - iNumberOfLinesFitsScreen)
-                iCurrentLine = iTotalNumberOfLines - iNumberOfLinesFitsScreen;            
-            }
-        else if (iActiveMode == EFileEditorViewAsHex)
-            {
-            iCurrentLine += scrollLines;
-
-            // last line can be first line on the screen            
-            if (iCurrentLine > iTotalNumberOfLines - 1)
-                iCurrentLine = iTotalNumberOfLines - 1;              
-            }
-            
-        UpdateScrollBarL();
-        DrawNow();
-        
-        return EKeyWasConsumed;
-        }
-    
-    return EKeyWasNotConsumed;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::FormatAsTextL(HBufC16* aBuf)
-    {
-    if (aBuf == NULL)    
-        ResetVariables(EFalse);
-    else
-        ResetVariables();
-    
-    InitVariables();
-    iActiveMode = EFileEditorViewAsText;
-    
-    // store the bugger
-    if (aBuf != NULL)
-        iTextBuf = aBuf;
-    
-    iWrappedTextArray = new(ELeave) CArrayFixFlat<TPtrC>(32);
-    
-    // wrap to array
-    AknTextUtils::WrapToArrayL(iTextBuf->Des(), iDrawingWidth, *iFont, *iWrappedTextArray);
-    iTotalNumberOfLines = iWrappedTextArray->Count();
-
-    // count amount of lines fits to screen
-    iNumberOfLinesFitsScreen = TInt(iViewerRect.Height() / (iFont->HeightInPixels()));
-
-    // update scroll bars
-    UpdateScrollBarL();
-
-    // update the screen
-    DrawNow();    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::FormatAsHexL(HBufC8* aBuf)
-    {
-    if (aBuf == NULL)    
-        ResetVariables(EFalse);
-    else
-        ResetVariables();
-    
-    InitVariables();
-    iActiveMode = EFileEditorViewAsHex;
-    
-    // store the buffer
-    if (aBuf != NULL)
-        iHexesBuffer = aBuf;
-    
-    // calculate amount of hex values fits to the screen
-    TUint charWidth = iFont->CharWidthInPixels('X');
-    iHexGrougWidth = charWidth*2 + TInt (KHexSeparatorMargin*iX_factor);
-    iAmountOfHexesFitsHorizontally = TUint( iDrawingWidth / iHexGrougWidth );
-
-    // calculate total number of files
-    iTotalNumberOfLines = iHexesBuffer->Length() / iAmountOfHexesFitsHorizontally + 1;
-
-    // count amount of lines fits to screen
-    iNumberOfLinesFitsScreen = TInt(iViewerRect.Height() / iFont->HeightInPixels()) - 1;
-
-    // update scroll bars
-    UpdateScrollBarL();
-
-    // update the screen
-    DrawNow();      
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::InitVariables()
-    {
-    iCurrentLine = 0;
-
-    // calculate layout data
-    TRect mainPaneRect;
-    TRect naviPaneRect;
-    
-    if (Layout_Meta_Data::IsLandscapeOrientation() ||
-        iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        }
-    else
-        {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-        mainPaneRect.iTl.iY = naviPaneRect.Height();   
-        }
-
-    iViewerRect = TRect(mainPaneRect.Size());
-
-    iX_factor = TReal(iViewerRect.Width()) / 176;
-    iY_factor = TReal(iViewerRect.Height()) / 144;
-
-
-    // define drawing width, some extra space needed for double span scrolling bar
-    if (AknLayoutUtils::LayoutMirrored())  // scroll bar on 'left'
-        {
-        iLeftDrawingPosition = KLeftMargin + 12;
-        iDrawingWidth = TUint( iViewerRect.Width() - iLeftDrawingPosition*iX_factor - (KRightMargin*iX_factor)); 
-        }
-    else // scroll bar on 'right'
-        {
-        iLeftDrawingPosition = KLeftMargin;  
-        iDrawingWidth = TUint( iViewerRect.Width() - iLeftDrawingPosition*iX_factor - (KRightMargin*iX_factor + 7*iX_factor)); 
-        } 
-
-
-    // set font
-    CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-    const TSize screenSize = dev->SizeInPixels();
-    
-    TFontSpec fontSpec = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont)->FontSpecInTwips();
-    fontSpec.iHeight = IsQHD(screenSize) ? KViewerFontHeightQHD : KViewerFontHeight; // set height
-    dev->GetNearestFontInTwips(iFont, fontSpec);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::ResetVariables(TBool aResetData)
-    {
-    if (iScrollBarFrame)
-        {
-        delete iScrollBarFrame;
-        iScrollBarFrame = NULL;
-        }
-        
-    if (iHexesBuffer && aResetData)
-        {
-        delete iHexesBuffer;
-        iHexesBuffer = NULL;
-        }    
-
-    if (iWrappedTextArray)
-        {
-        delete iWrappedTextArray;
-        iWrappedTextArray = NULL;
-        }
-
-    if (iTextBuf && aResetData)
-        {
-        delete iTextBuf;
-        iTextBuf = NULL;
-        }
-
-    if (iFont)
-        {
-        CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-        dev->ReleaseFont(iFont);
-        iFont = NULL;
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::UpdateScrollBarL()
-    {
-    TRect rect(iViewerRect);
-    
-    // init the scroll bar    
-    if (!iScrollBarFrame)
-        {
-        iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, this, ETrue);
-        iScrollBarFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse);            
-        iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
-        iScrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        }       
-
-
-    // update values
-	TEikScrollBarModel horizontalBar;
-    TEikScrollBarModel verticalBar;
-
-    if (iActiveMode == EFileEditorViewAsText)
-        {    
-        verticalBar.iThumbPosition = iCurrentLine;
-        verticalBar.iScrollSpan = iTotalNumberOfLines - iNumberOfLinesFitsScreen + 1;
-        verticalBar.iThumbSpan = 1;
-        }
-    
-    else if (iActiveMode == EFileEditorViewAsHex)
-        {    
-        verticalBar.iThumbPosition = iCurrentLine;
-        verticalBar.iScrollSpan = iTotalNumberOfLines;
-        verticalBar.iThumbSpan = 1;
-        }
-        
-    TEikScrollBarFrameLayout layout;
-	layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
-
-    // do not let scrollbar values overflow
-    if (verticalBar.iThumbPosition + verticalBar.iThumbSpan > verticalBar.iScrollSpan)
-        verticalBar.iThumbPosition = verticalBar.iScrollSpan - verticalBar.iThumbSpan;
-	
-    TAknDoubleSpanScrollBarModel horizontalDSBar(horizontalBar);
-    TAknDoubleSpanScrollBarModel verticalDSBar(verticalBar);
-   
-    iScrollBarFrame->TileL(&horizontalDSBar, &verticalDSBar, rect, rect, layout);        
-    iScrollBarFrame->SetVFocusPosToThumbPos(verticalDSBar.FocusPosition());
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.Clear(aRect);
-    gc.SetPenColor(KRgbBlack);
-    gc.UseFont(iFont);
-    
-    TInt fontHeight = iFont->HeightInPixels();
-
-    if (iActiveMode == EFileEditorViewAsText)
-        {
-        // draw the text
-        for (TInt i=0; i<iNumberOfLinesFitsScreen; i++)
-            {
-            // check for bounds and draw
-            if (iCurrentLine >= 0 && iTotalNumberOfLines > i+iCurrentLine)
-                gc.DrawText(iWrappedTextArray->At(i+iCurrentLine), TPoint(TInt(iLeftDrawingPosition*iX_factor), TInt(fontHeight*(i+1))));
-            }        
-        }
-
-    else if (iActiveMode == EFileEditorViewAsHex)
-        {
-        TInt hexesOffSet = iCurrentLine * iAmountOfHexesFitsHorizontally; 
-        TInt topLineHeight = 2*iY_factor + fontHeight;
-        
-        // draw the top line
-        gc.SetPenColor(KRgbWhite);
-        
-        gc.SetBrushColor(KRgbBlue);
-        gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-        if (AknLayoutUtils::LayoutMirrored())  // scroll bar on 'left'
-            {
-            gc.DrawRect(TRect((KLeftMargin + 12)*iX_factor, 0, aRect.iBr.iX, topLineHeight));
-            }
-        else // scroll bar on 'right'
-            {
-            gc.DrawRect(TRect(0, 0, aRect.iBr.iX-(KRightMargin*iX_factor + 7*iX_factor), topLineHeight));
-            } 
-
-        TBuf<128> topLineBuf;
-        topLineBuf.AppendNum(hexesOffSet);
-        topLineBuf.Append(_L(": "));
-        
-        for (TInt i=0; i<iAmountOfHexesFitsHorizontally; i++)
-            {
-            TInt pos = hexesOffSet + i;
-            
-            if (pos < iHexesBuffer->Des().Length())
-                {
-                topLineBuf.Append(iHexesBuffer->Des()[pos]);
-                }
-            }
- 
-        gc.DrawText(topLineBuf, TPoint(TInt(iLeftDrawingPosition*iX_factor), TInt(fontHeight)));
-
- 
-        // draw hex values
-        gc.SetPenColor(KRgbBlack);
-        for (TInt i=0; i<iNumberOfLinesFitsScreen; i++)
-            {
-            for (TInt j=0; j<iAmountOfHexesFitsHorizontally; j++)
-                {
-                TInt pos = hexesOffSet + i*iAmountOfHexesFitsHorizontally + j;
-                
-                if (pos >= iHexesBuffer->Des().Length())
-                    return;
-                
-                TUint8* ptr = &iHexesBuffer->Des()[pos];
-                
-                _LIT(KHex, "%02x");
-                TBuf<5> hexBuf;
-                hexBuf.Format(KHex, ptr[0]);
-                hexBuf.UpperCase();
-
-                gc.DrawText(hexBuf, TPoint(TInt(iLeftDrawingPosition*iX_factor + j*iHexGrougWidth), TInt(topLineHeight + fontHeight*(i+1))));
-                }
-            }         
-        }
-
-    gc.DiscardFont();
-    }
-  
-// --------------------------------------------------------------------------------------------
-
-CCoeControl* CFileBrowserFileEditorViewControl::ComponentControl(TInt aIndex) const
-	{
-	if (aIndex == 0 && iScrollBarFrame)
-	    return iScrollBarFrame->VerticalScrollBar();
-	else
-	    return NULL;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileEditorViewControl::CountComponentControls() const
-	{
-	if (iScrollBarFrame)
-	    return 1;
-	else
-	    return 0;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
-    {
-    if ((aEventType == EEikScrollPageDown) || (aEventType == EEikScrollPageUp) || 
-       (aEventType == EEikScrollThumbDragVert) || (aEventType == EEikScrollUp) ||
-       (aEventType == EEikScrollDown))
-        {
-        iCurrentLine = aScrollBar->ThumbPosition();
-        UpdateScrollBarL();
-        DrawNow();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-TTypeUid::Ptr CFileBrowserFileEditorViewControl::MopSupplyObject(TTypeUid aId)
-    {
-    return CCoeControl::MopSupplyObject(aId);
-    }
-	   
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileEditorViewControl::HandleResourceChange(TInt aType)
-    {
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        SetRect(Rect());
-        ActivateL();
-        
-        // reformat the text
-        if (iActiveMode == EFileEditorViewAsText)
-            {
-            FormatAsTextL();
-            }
-        else if (iActiveMode == EFileEditorViewAsHex)
-            {
-            FormatAsHexL();
-            }
-        }
-    else
-        {
-        CCoeControl::HandleResourceChange(aType);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-// End of File
-
--- a/filebrowser/src/FBFileListContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1133 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBFileListContainer.h"
-#include "FB.hrh"
-#include "FBDocument.h"
-#include "FBAppUi.h"
-#include "FBModel.h"
-#include "FBFileUtils.h"
-#include "FBStd.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    #include "FBToolbar.h"
-#endif
-
-#include <w32std.h>
-#include <AknDef.h>
-#include <AknUtils.h> 
-#include <eikspane.h>
-#include <akntitle.h>
-#include <aknnavilabel.h>
-#include <aknlists.h>
-#include <aknsfld.h>
-#include <eikclbd.h>
-#include <eiktxlbm.h>
-#include <AknsListBoxBackgroundControlContext.h>
-#include <AknInfoPopupNoteController.h>
-#include <AknIconArray.h>
-#include <layoutmetadata.cdl.h>
-
-_LIT(KEmptyDirectory, "No entries");
-_LIT(KNoMatches, "No matches");
-
-const TInt KSimpleViewFontHeight = 127;
-const TInt KExtendedViewFontHeight1 = 127;
-const TInt KExtendedViewFontHeight2 = 105;
-
-const TInt KSimpleViewFontHeightQHD = 120;
-const TInt KExtendedViewFontHeight1QHD = 115;
-const TInt KExtendedViewFontHeight2QHD = 90;
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-void CFileBrowserFileListContainer::ConstructL(const TRect& /*aRect*/)
-    {
-    iModel = static_cast<CFileBrowserDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    iModel->SetFileListContainer(this);
-    
-    iFileViewMode = -1;
-    iIsDragging = EFalse;
-    
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __SERIES60_32__)
-    iToolbar = CFileBrowserToolbar::NewL();
-    if ( iModel->Settings().iEnableToolbar && 
-         AknLayoutUtils::PenEnabled() )
-        {
-        iToolbar->ShowToolbarL();        
-        }
-    else
-        {
-        iToolbar->HideToolbarL();
-        }
-#endif
-    
-    CreateWindowL();
-    Window().SetShadowDisabled(EFalse);
-    SetBlank();
-
-    SetScreenLayoutL(iModel->Settings().iDisplayMode);
-    
-    CreateEmptyNaviPaneLabelL();
-    
-    iModel->FileUtils()->RefreshViewL();
-
-    EnableDragEvents();
-    
-    ActivateL();
-    
-    iInfoPopup = CAknInfoPopupNoteController::NewL();
-    iInfoPopup->SetTimePopupInView(5000);
-    iInfoPopup->SetTimeDelayBeforeShow(500);
-    iInfoPopup->SetTextL(_L("TIP: Use left arrow key or touch drag to left to move up in the directory structure."));
-    iInfoPopup->ShowInfoPopupNote();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileListContainer::~CFileBrowserFileListContainer()
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    delete iToolbar;
-#endif
-    delete iInfoPopup;
-    
-    DeleteNaviPane();
-
-    if (iSearchField)
-        delete iSearchField;
-    
-    if (iListBox)
-        delete iListBox;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::CreateEmptyNaviPaneLabelL()
-    {
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-
-    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
-    iNaviDecorator = iNaviContainer->CreateNavigationLabelL();
-    iNaviContainer->PushL(*iNaviDecorator);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::DeleteNaviPane()
-    {
-    if (iNaviContainer)
-        {
-        iNaviContainer->Pop(iNaviDecorator);
-        }
-    
-    if (iNaviDecorator)
-        {
-        delete iNaviDecorator;
-        iNaviDecorator = NULL;
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.Clear(aRect);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HandleControlEventL(
-    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CFileBrowserFileListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    // open search field with alpha digit numbers
-    if (aType == EEventKeyDown && !iSearchField && aKeyEvent.iScanCode < EStdKeyF1 && TChar(aKeyEvent.iScanCode).IsAlphaDigit())
-        {
-        EnableSearchFieldL();
-        
-        if (iSearchField)
-            {
-            //static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->DeferredSendKeyEventToFepL(aKeyEvent.iCode);
-            return EKeyWasConsumed;
-            }
-        }
-    
-    // close search field with clear-button if it's empty
-    if (iSearchField && aKeyEvent.iCode == EKeyBackspace)
-        {
-           TFileName searchText;
-           iSearchField->GetSearchText(searchText);
-           
-           if (searchText == KNullDesC)
-               {
-               DisableSearchFieldL();
-               return EKeyWasConsumed; 
-               }
-        }
-
-    // check file/directory handling related cases
-    if (iModel->FileUtils()->HandleOfferKeyEventL(aKeyEvent, aType) == EKeyWasConsumed)
-        return EKeyWasConsumed;
-    
-    TKeyResponse result = EKeyWasNotConsumed;
-
-    if (iSearchField && iListBox)
-        {
-        // find items with all event codes (that's the reason why there is EEventKey instead of aType)
-        TBool needsRefresh(EFalse);
-        result = AknFind::HandleFindOfferKeyEventL(aKeyEvent, EEventKey, this, iListBox, iSearchField, EFalse, needsRefresh);
-        
-        if (needsRefresh)
-            DrawNow();
-        }
-
-    // scroll one page up/down with volume keys
-    if (result == EKeyWasNotConsumed && iListBox && iListBox->Model()->NumberOfItems() > 0 && (aKeyEvent.iCode == EKeyIncVolume || (aKeyEvent.iCode=='#' && !iModel->IsHashKeySelectionInUse())))
-        {
-        CListBoxView::TSelectionMode selectionMode = CListBoxView::ENoSelection;
-        CListBoxView::TCursorMovement moveto = CListBoxView::ECursorPrevScreen;
-        
-        iListBox->View()->MoveCursorL(moveto, selectionMode);
-      
-        iListBox->SetCurrentItemIndex(iListBox->CurrentItemIndex()); 
-        iListBox->DrawDeferred();
-
-        return EKeyWasConsumed;
-        
-        }
-    else if (result == EKeyWasNotConsumed && iListBox && iListBox->Model()->NumberOfItems() > 0 && (aKeyEvent.iCode == EKeyDecVolume || aKeyEvent.iCode=='*'))
-        {
-        CListBoxView::TSelectionMode selectionMode = CListBoxView::ENoSelection;
-        CListBoxView::TCursorMovement moveto = CListBoxView::ECursorNextScreen;
-        
-        if (iListBox->CurrentItemIndex() >= iListBox->Model()->NumberOfItems() - iListBox->View()->NumberOfItemsThatFitInRect(iListBox->View()->ViewRect()))
-            moveto = CListBoxView::ECursorLastItem;
-        
-        iListBox->View()->MoveCursorL(moveto, selectionMode);
-
-        iListBox->SetCurrentItemIndex(iListBox->CurrentItemIndex()); 
-        iListBox->DrawDeferred();
-
-        return EKeyWasConsumed;
-        }
-
-    // offer key event to the listbox if not already consumed
-    else if (result == EKeyWasNotConsumed && iListBox)
-        return iListBox->OfferKeyEventL(aKeyEvent, aType);
-    else
-        return result;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            {
-            // "emulate" enter key press and send it to file utils for prosessing
-            
-            TKeyEvent keyEvent;
-            keyEvent.iCode = EKeyEnter;
-            keyEvent.iModifiers = 0;
-            
-            TEventCode type = EEventKey;
-    
-            iModel->FileUtils()->HandleOfferKeyEventL(keyEvent, type);          
-            }
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HandlePointerEventL(const TPointerEvent &aPointerEvent)
-    {
-    // detect direction of dragging by comparing the start and finish points
-    
-    if (aPointerEvent.iType == TPointerEvent::EButton1Down)
-        {
-        iDragStartPoint = aPointerEvent.iPosition;
-        iIsDragging = EFalse;
-        }
-    else if (aPointerEvent.iType == TPointerEvent::EDrag)
-        {
-        iIsDragging = ETrue;
-        
-        return;
-        }
-    else if (aPointerEvent.iType == TPointerEvent::EButton1Up)
-        {
-        if (iIsDragging)
-            {
-            const TInt KDelta = iDragStartPoint.iX - aPointerEvent.iPosition.iX;
-            const TInt KThreshold = 30;
-            
-            if (KDelta < -KThreshold) // dragging to right
-                {
-                // "emulate" right key press and send it to file utils for prosessing
-                
-                TKeyEvent keyEvent;
-                keyEvent.iCode = EKeyRightArrow;
-                keyEvent.iModifiers = 0;
-                
-                TEventCode type = EEventKey;
-        
-                iModel->FileUtils()->HandleOfferKeyEventL(keyEvent, type);
-                
-                return;
-                }
-            else if (KDelta > KThreshold) // dragging to left
-                {
-                // "emulate" left key press and send it to file utils for prosessing
-                
-                TKeyEvent keyEvent;
-                keyEvent.iCode = EKeyLeftArrow;
-                keyEvent.iModifiers = 0;
-                
-                TEventCode type = EEventKey;
-        
-                iModel->FileUtils()->HandleOfferKeyEventL(keyEvent, type);
-                
-                return;
-                }            
-            }
-        iIsDragging = EFalse;
-        }
-    else
-        {
-        iIsDragging = EFalse;        
-        }
-
-    CCoeControl::HandlePointerEventL(aPointerEvent);
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::CreateListBoxL(TInt aFileViewMode)
-    {
-    iFileViewMode = aFileViewMode;
-    
-    if (iSearchField)
-        DisableSearchFieldL();
-    
-    if (iListBox)
-        {
-        delete iListBox;
-        iListBox = NULL;    
-        }
-    
-    if (iFileViewMode == EFileViewModeSimple)
-        {
-        iListBox = new(ELeave) CSimpleFileViewListBox;
-        }
-    else     
-        {
-        iListBox = new(ELeave) CExtendedFileViewListBox;
-        }
-        
-                
-    iListBox->SetContainerWindowL(*this);
-    iListBox->ConstructL(this, EAknListBoxMarkableList);
-    
-    iListBox->View()->SetListEmptyTextL(KEmptyDirectory);
-        
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-
-    // make sure listbox has correct size
-    SizeChanged();
-
-    iListBox->ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileListContainer::CurrentListBoxItemIndex()
-    {
-    if (iListBox && iSearchField)
-        {
-        TInt currentItemIndex = iListBox->CurrentItemIndex();
-        
-        if (currentItemIndex >= 0)
-            return static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->FilteredItemIndex(currentItemIndex);
-        else
-            return KErrNotFound;
-        }
-    else if (iListBox)
-        {
-        return iListBox->CurrentItemIndex();
-        }
-    else
-        return KErrNotFound;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-const CArrayFix<TInt>* CFileBrowserFileListContainer::ListBoxSelectionIndexes()
-    {
-    if (iListBox && iSearchField)
-        {
-        TRAP_IGNORE( static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->UpdateSelectionIndexesL() ); // !!!
-        return static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->SelectionIndexes();
-        }
-    else if (iListBox)
-        {
-        const CListBoxView::CSelectionIndexArray* indices = iListBox->SelectionIndexes();
-        return static_cast<const CArrayFix<TInt>*>(indices);
-        }
-    else
-        return NULL;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileListContainer::ListBoxSelectionIndexesCount()
-    {
-    if (iListBox && iSearchField)
-        {
-        TRAP_IGNORE( static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->UpdateSelectionIndexesL() ); // !!!
-        return static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->SelectionIndexes()->Count();
-        }
-    else if (iListBox)
-        {
-        return iListBox->SelectionIndexes()->Count();
-        }
-    else
-        return KErrNotFound;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileListContainer::ListBoxNumberOfVisibleItems()
-    {
-    if (iListBox && iSearchField)
-        {
-        return static_cast<CAknFilteredTextListBoxModel*>(iListBox->Model())->Filter()->FilteredNumberOfItems();
-        }
-    else if (iListBox)
-        {
-        return iListBox->Model()->NumberOfItems();
-        }
-    else
-        return KErrNotFound;
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-CAknIconArray* CFileBrowserFileListContainer::ListBoxIconArrayL()
-    {
-    if (iListBox)
-        { 
-        if (iFileViewMode == EFileViewModeSimple)
-            {
-            return static_cast<CAknIconArray*>(static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->IconArray());
-            }
-        else if (iFileViewMode == EFileViewModeExtended)
-            {
-            return static_cast<CAknIconArray*>(static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->IconArray());
-            }
-        }
-
-    return NULL;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::SetListBoxIconArrayL(CAknIconArray* aIconArray)
-    {
-    if (iListBox)
-        { 
-        if (iFileViewMode == EFileViewModeSimple)
-            {
-            //CArrayPtr<CGulIcon>* currentIconArray = static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->IconArray();
-            //delete currentIconArray;
-            //currentIconArray = NULL;       
-            static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->SetIconArray(aIconArray);
-            }
-        else if (iFileViewMode == EFileViewModeExtended)
-            {
-            //CArrayPtr<CGulIcon>* currentIconArray = static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->IconArray();
-            //delete currentIconArray;
-            //currentIconArray = NULL;       
-            static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->SetIconArray(aIconArray);
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::SetListBoxTextArrayL(CDesCArray* aTextArray)
-    {
-    if (iListBox)
-        {    
-        iListBox->Model()->SetItemTextArray(aTextArray);
-        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-        iListBox->HandleItemAdditionL();
-        iListBox->UpdateScrollBarsL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::EnableSearchFieldL()
-    {
-    if (iListBox && !iSearchField && iListBox->Model()->NumberOfItems() > 0)
-        {
-        iSearchField = CAknSearchField::NewL(*this, CAknSearchField::ESearch, NULL, KMaxFileName);
-        
-        iSearchField->SetObserver(this);
-        iSearchField->SetFocus(ETrue);
-        iSearchField->MakeVisible(ETrue);
-        iSearchField->ResetL();
-        
-        iListBox->View()->SetListEmptyTextL(KNoMatches);
-        
-        // enable filtering
-        ((CAknFilteredTextListBoxModel*)iListBox->Model())->CreateFilterL(iListBox, iSearchField);
-        
-        SizeChanged();   
-
-        // update cba
-        CEikButtonGroupContainer* cbaGroup = CEikButtonGroupContainer::Current();
-        cbaGroup->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_CANCEL);
-        cbaGroup->DrawNow();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileListContainer::IsSearchFieldEnabled()
-    {
-    return iSearchField != NULL;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::DisableSearchFieldL()
-    {
-    if (iSearchField)
-        {
-        iSearchField->MakeVisible( EFalse );
-        iSearchField->SetFocusing( EFalse );
-        
-        delete iSearchField;
-        iSearchField = NULL;  
-
-        iListBox->View()->SetListEmptyTextL(KEmptyDirectory);
-
-        // disable filtering
-        ((CAknFilteredTextListBoxModel*)iListBox->Model())->RemoveFilter();
-
-        SizeChanged();
-        DrawNow();
-
-        // update cba
-        CEikButtonGroupContainer* cbaGroup = CEikButtonGroupContainer::Current();
-        cbaGroup->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT);
-        cbaGroup->DrawNow();
-        
-        // Clear selections because using filter causes selections to go out of sync
-        UpdateToolbar();
-        AknSelectionService::HandleMarkableListProcessCommandL( EAknUnmarkAll, iListBox );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileListContainer::CountComponentControls() const
-    {
-    TInt controls(0);
-
-    if (iListBox)
-        controls++;
-    
-    if (iSearchField)
-        controls++;
-    
-    return controls;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CCoeControl* CFileBrowserFileListContainer::ComponentControl(TInt aIndex) const
-    {
-    switch (aIndex)
-        {
-        case 0:
-            {
-            return iListBox;
-            }
-        case 1:
-            {
-            return iSearchField;
-            }
-        default:
-            {
-            return NULL;
-            }
-        }
-    }    
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::SetScreenLayoutL(TInt aLayoutMode)
-    {
-    // make sure that the search field has been disabled
-    DisableSearchFieldL();
-
-    // make sure that the title of the application is correct
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("FileBrowser") );
-    
-    // change the layout mode
-    if (aLayoutMode == EDisplayModeFullScreen)
-        sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_SMALL);
-    else
-        sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
-    
-    // update layout
-    HandleResourceChange(KEikDynamicLayoutVariantSwitch);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::SetNaviPaneTextL(const TDesC& aText)
-    {
-    if (iNaviDecorator)
-        {
-        delete iNaviDecorator;
-        iNaviDecorator = NULL;
-        }
-    
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    iNaviDecorator = iNaviContainer->CreateMessageLabelL(aText);
-    iNaviContainer->PushL(*iNaviDecorator);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::SizeChanged()
-    {
-    if (iListBox && iSearchField)
-        {
-        TSize findPaneSize;
-        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EFindPane, findPaneSize);
-
-        TRect mainPaneRect;
-        TRect naviPaneRect;
-
-        if (Layout_Meta_Data::IsLandscapeOrientation() ||
-            iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                // Get location of softkeys 
-                AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); 
-                if ( cbaLocation == AknLayoutUtils::EAknCbaLocationBottom ) 
-                    { 
-                    // here there is the BSK mode
-                    mainPaneRect.iBr.iX -= iToolbar->Rect().Width();
-                    findPaneSize.iWidth -= iToolbar->Rect().Width();
-                    }
-                }
-#endif
-            }
-        else
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-            mainPaneRect.iTl.iY = naviPaneRect.Height();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                mainPaneRect.iBr.iY -= iToolbar->Rect().Height();
-                }
-#endif
-            }
-        
-        mainPaneRect.iBr.iY -= findPaneSize.iHeight;  
-
-        TRect listBoxRect(mainPaneRect.Size());
-        iListBox->SetRect(listBoxRect);
-
-        if (iFileViewMode == EFileViewModeSimple)
-            {        
-            CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-            listBoxContext->SetRect(listBoxRect);
-            }
-        else if (iFileViewMode == EFileViewModeExtended)
-            {        
-            CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-            listBoxContext->SetRect(listBoxRect);
-            }        
-
-        iSearchField->SetRect(TRect(TPoint(0,mainPaneRect.Height()), findPaneSize));
-        
-        if (iSearchField->IsVisible() && iListBox->IsVisible())
-            iSearchField->SetLinePos(2);
-
-        }
-        
-    else if (iListBox)
-        {
-        TRect mainPaneRect;
-        TRect naviPaneRect;
-
-        if (Layout_Meta_Data::IsLandscapeOrientation() ||
-            iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                // Get location of softkeys 
-                AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); 
-                if ( cbaLocation == AknLayoutUtils::EAknCbaLocationBottom ) 
-                    { 
-                    // here there is the BSK mode
-                    mainPaneRect.iBr.iX -= iToolbar->Rect().Width();
-                    }
-                }
-#endif
-            }
-        else
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-            mainPaneRect.iTl.iY = naviPaneRect.Height();
-            
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                mainPaneRect.iBr.iY -= iToolbar->Rect().Height();
-                }
-#endif
-            }
-        
-        TRect listBoxRect(mainPaneRect.Size());
-        iListBox->SetRect(listBoxRect);
-
-        if (iFileViewMode == EFileViewModeSimple)
-            {        
-            CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-            listBoxContext->SetRect(listBoxRect);
-            }
-        else if (iFileViewMode == EFileViewModeExtended)
-            {        
-            CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-            listBoxContext->SetRect(listBoxRect);
-            }
-        }
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HandleResourceChange(TInt aType)
-    {
-    CCoeControl::HandleResourceChange(aType);
-
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        TRect mainPaneRect;
-        TRect naviPaneRect;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __SERIES60_32__)
-        TBool needToCutSearchFieldLength( EFalse );
-#endif
-        
-        if (Layout_Meta_Data::IsLandscapeOrientation() ||
-            iEikonEnv->AppUiFactory()->StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_SMALL)
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __SERIES60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                // Get location of softkeys 
-                AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); 
-                if ( cbaLocation == AknLayoutUtils::EAknCbaLocationBottom ) 
-                    { 
-                    // here there is the BSK mode
-                    mainPaneRect.iBr.iX -= iToolbar->Rect().Width();
-                    needToCutSearchFieldLength = ETrue;
-                    }
-                }
-#endif
-            }
-        else
-            {
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ENaviPane, naviPaneRect);
-            mainPaneRect.iTl.iY = naviPaneRect.Height();
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __SERIES60_32__)
-            if ( iToolbar && iModel->Settings().iEnableToolbar )
-                {
-                iToolbar->ShowToolbarL();
-                mainPaneRect.iBr.iY -= iToolbar->Rect().Height();
-                }
-#endif
-            }
-
-        SetRect(mainPaneRect);
-
-        if (iListBox && iSearchField)
-            {
-            TSize findPaneSize;
-            AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EFindPane, findPaneSize);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __SERIES60_32__)
-            if ( needToCutSearchFieldLength )
-                {
-                findPaneSize.iWidth -= iToolbar->Rect().Width();
-                }
-#endif
-            mainPaneRect.iBr.iY -= findPaneSize.iHeight;
-            
-            TRect listBoxRect(mainPaneRect.Size());
-            iListBox->SetRect(listBoxRect);
-            
-            if (iFileViewMode == EFileViewModeSimple)
-                {        
-                CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-                listBoxContext->SetRect(listBoxRect);
-                }
-            else if (iFileViewMode == EFileViewModeExtended)
-                {        
-                CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-                listBoxContext->SetRect(listBoxRect);
-                }    
-            
-            iSearchField->SetRect(TRect(TPoint(0,mainPaneRect.Height()), findPaneSize));
-            
-            if (iSearchField->IsVisible() && iListBox->IsVisible())
-                iSearchField->SetLinePos(2);
-        
-            TRAP_IGNORE(iListBox->UpdateScrollBarsL());
-            }        
-        else if (iListBox)
-            {
-            TRect listBoxRect(mainPaneRect.Size());
-            iListBox->SetRect(listBoxRect);
-            
-            if (iFileViewMode == EFileViewModeSimple)
-                {        
-                CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikColumnListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-                listBoxContext->SetRect(listBoxRect);
-                }
-            else if (iFileViewMode == EFileViewModeExtended)
-                {        
-                CAknsListBoxBackgroundControlContext* listBoxContext = static_cast<CAknsListBoxBackgroundControlContext*>(static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->ColumnData()->SkinBackgroundContext());
-                listBoxContext->SetRect(listBoxRect);
-                }    
-            
-            TRAP_IGNORE(iListBox->UpdateScrollBarsL());
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HandleSettingsChangeL()
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    if ( iModel->Settings().iEnableToolbar )
-        {
-        if ( AknLayoutUtils::PenEnabled() )
-            {
-            if ( !iToolbar )
-                {
-                iToolbar = CFileBrowserToolbar::NewL();
-                }
-            iToolbar->ShowToolbarL();
-            }
-        }
-    else
-        {
-        HideToolbar();
-        }
-    SizeChanged();
-#endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::HideToolbar()
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    if ( iToolbar && iToolbar->IsShown() )
-        {
-        iToolbar->HideToolbarL();
-        }
-#endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileListContainer::UpdateToolbar()
-    {
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    if ( iToolbar && iToolbar->IsShown() )
-        {
-        iToolbar->ResetState();
-        }
-#endif    
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CSimpleFileViewListBox::~CSimpleFileViewListBox()
-    {
-    ReleaseFonts();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CSimpleFileViewListBox::ReleaseFonts()
-    {
-    if (iFont)
-        {
-        CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-        dev->ReleaseFont(iFont);
-        iFont = NULL;   
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-void CSimpleFileViewListBox::SizeChanged()
-    {
-    // call the base class function first
-    CAknSingleGraphicStyleListBox::SizeChanged();
-
-    // customize the list box
-    TRAP_IGNORE(SizeChangedL());
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CSimpleFileViewListBox::SizeChangedL()
-    {
-    // disable separator line
-    ItemDrawer()->ColumnData()->SetSeparatorLinePosition(ENoLine);
-
-    // enable marquee
-    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-
-    // get font
-    ReleaseFonts();
-    CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-    const TSize screenSize = dev->SizeInPixels();
-
-    TFontSpec fontSpec = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont)->FontSpecInTwips();
-    fontSpec.iHeight = IsQHD(screenSize) ? KSimpleViewFontHeightQHD : KSimpleViewFontHeight;
-    dev->GetNearestFontInTwips(iFont, fontSpec);
-    
-    // set fonts
-    ItemDrawer()->ColumnData()->SetColumnFontL(0, iFont);
-    ItemDrawer()->ColumnData()->SetColumnFontL(1, iFont);
-    ItemDrawer()->ColumnData()->SetColumnFontL(2, iFont);
-    ItemDrawer()->ColumnData()->SetColumnFontL(3, iFont);
-
-    // set row height
-    TInt rowHeight = iFont->HeightInPixels()+4;    
-    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
-    itemCellSize.iHeight = rowHeight; 
-    SetItemHeightL(rowHeight);
-    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
-    
-    // set icon sizes
-    TInt normalIconSize = rowHeight * 0.9;
-    TInt markingIconSize = rowHeight * 0.8;
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(2, TSize(markingIconSize,markingIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(markingIconSize,markingIconSize));
-
-    // set column widths
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0, normalIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1, itemCellSize.iWidth-normalIconSize-markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(2, markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(3, markingIconSize);
-
-    // set baseline for the text
-    ItemDrawer()->ColumnData()->SetColumnBaselinePosL(1, iFont->HeightInPixels()-iFont->BaselineOffsetInPixels()-1);
-
-    // set margins
-    TMargins iconMargins;
-    iconMargins.iBottom = 0;
-    iconMargins.iLeft = 0;
-    iconMargins.iRight = 0;
-    iconMargins.iTop = 0;
-
-    TMargins textMargins;
-    textMargins.iBottom = 0;
-    textMargins.iLeft = markingIconSize * 0.15;
-    textMargins.iRight = markingIconSize * 0.15;
-    textMargins.iTop = 0;
-
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(0, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(1, textMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(2, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(3, iconMargins);
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CExtendedFileViewListBox::~CExtendedFileViewListBox()
-    {
-    ReleaseFonts();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CExtendedFileViewListBox::ReleaseFonts()
-    {
-    if (iFont1)
-        {
-        CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-        dev->ReleaseFont(iFont1);
-        iFont1 = NULL;     
-        }
-
-    if (iFont2)
-        {
-        CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-        dev->ReleaseFont(iFont2);
-        iFont2 = NULL;      
-        }        
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CExtendedFileViewListBox::SizeChanged()
-    {
-    // call the base class function first
-    CAknDoubleGraphicStyleListBox::SizeChanged();
-
-    // customize the list box
-    TRAP_IGNORE(SizeChangedL());
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CExtendedFileViewListBox::SizeChangedL()
-    {
-    // disable separator line
-    ItemDrawer()->ColumnData()->SetSeparatorLinePosition(ENoLine);
-
-    // enable marquee
-    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-    
-    // get fonts
-    ReleaseFonts();
-    CGraphicsDevice* dev = iCoeEnv->ScreenDevice();
-    const TSize screenSize = dev->SizeInPixels();
-    
-    TFontSpec fontSpec1 = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont)->FontSpecInTwips();
-    fontSpec1.iHeight = IsQHD(screenSize) ? KExtendedViewFontHeight1QHD : KExtendedViewFontHeight1;
-    dev->GetNearestFontInTwips(iFont1, fontSpec1);
-
-    TFontSpec fontSpec2 = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont)->FontSpecInTwips();
-    fontSpec2.iHeight = IsQHD(screenSize) ? KExtendedViewFontHeight2QHD : KExtendedViewFontHeight2;
-    dev->GetNearestFontInTwips(iFont2, fontSpec2);    
-
-        
-    // set fonts
-    ItemDrawer()->ColumnData()->SetSubCellFontL(0, iFont1);
-    ItemDrawer()->ColumnData()->SetSubCellFontL(1, iFont1);
-    ItemDrawer()->ColumnData()->SetSubCellFontL(2, iFont2);
-    ItemDrawer()->ColumnData()->SetSubCellFontL(3, iFont1);
-    ItemDrawer()->ColumnData()->SetSubCellFontL(4, iFont1);
-
-    // set row height
-    TInt rowHeight1 = iFont1->HeightInPixels()+3;    
-    TInt rowHeight2 = iFont2->HeightInPixels()+3;    
-    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
-    itemCellSize.iHeight = rowHeight1+rowHeight2; 
-    SetItemHeightL(rowHeight1+rowHeight2);
-    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
-
-    
-    // set icon sizes
-    TInt normalIconSize = rowHeight1 * 0.9;
-    TInt markingIconSize = rowHeight1 * 0.8;
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(markingIconSize,markingIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(4, TSize(markingIconSize,markingIconSize));
-
-    // set sub cell sizes
-    ItemDrawer()->ColumnData()->SetSubCellSizeL(0, TSize(normalIconSize,rowHeight1+rowHeight2));
-    ItemDrawer()->ColumnData()->SetSubCellSizeL(1, TSize(itemCellSize.iWidth-normalIconSize-markingIconSize,rowHeight1));
-    ItemDrawer()->ColumnData()->SetSubCellSizeL(2, TSize(itemCellSize.iWidth-normalIconSize-markingIconSize,rowHeight2));
-    ItemDrawer()->ColumnData()->SetSubCellSizeL(3, TSize(markingIconSize,rowHeight1+rowHeight2));
-    ItemDrawer()->ColumnData()->SetSubCellSizeL(4, TSize(markingIconSize,rowHeight1+rowHeight2));
-
-    // set sub cell positions
-    ItemDrawer()->ColumnData()->SetSubCellPositionL(0, TPoint(0,0));
-    ItemDrawer()->ColumnData()->SetSubCellPositionL(1, TPoint(normalIconSize,0));
-    ItemDrawer()->ColumnData()->SetSubCellPositionL(2, TPoint(normalIconSize,rowHeight1));
-    ItemDrawer()->ColumnData()->SetSubCellPositionL(3, TPoint(itemCellSize.iWidth-normalIconSize-markingIconSize,0));
-    ItemDrawer()->ColumnData()->SetSubCellPositionL(4, TPoint(itemCellSize.iWidth-normalIconSize-markingIconSize,0));
-    
-    // set baselines for the texts
-    ItemDrawer()->ColumnData()->SetSubCellBaselinePosL(1, iFont1->HeightInPixels()-iFont1->BaselineOffsetInPixels()-1);
-    ItemDrawer()->ColumnData()->SetSubCellBaselinePosL(2, rowHeight1+iFont2->HeightInPixels()-iFont2->BaselineOffsetInPixels()-1);
-    
-    // set margins
-    TMargins iconMargins;
-    iconMargins.iBottom = rowHeight2;
-    iconMargins.iLeft = 0;
-    iconMargins.iRight = 0;
-    iconMargins.iTop = 0;
-
-    TMargins textMargins;
-    textMargins.iBottom = 0;
-    textMargins.iLeft = markingIconSize * 0.15;
-    textMargins.iRight = markingIconSize * 0.15;
-    textMargins.iTop = 0;
-
-    ItemDrawer()->ColumnData()->SetSubCellMarginsL(0, iconMargins);
-    ItemDrawer()->ColumnData()->SetSubCellMarginsL(1, textMargins);
-    ItemDrawer()->ColumnData()->SetSubCellMarginsL(2, textMargins);
-    ItemDrawer()->ColumnData()->SetSubCellMarginsL(3, iconMargins);
-    ItemDrawer()->ColumnData()->SetSubCellMarginsL(4, iconMargins);
-    }
-    
-// --------------------------------------------------------------------------------------------
-        
-// End of File  
--- a/filebrowser/src/FBFileListView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,763 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include <aknViewAppUi.h>
-#include <avkon.hrh>
-#include <apgtask.h>
-#include <aknmessagequerydialog.h> 
-#include <remconinterfaceselector.h>
-#include <remconcoreapitarget.h>
-
-#include <filebrowser.rsg>
-#include "FB.hrh"
-#include "FBFileListView.h"
-#include "FBFileListContainer.h"
-#include "FBDocument.h" 
-#include "FBModel.h"
-#include "FBFileUtils.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CFileBrowserFileListView::ConstructL()
-    {
-    BaseConstructL( R_FILEBROWSER_VIEW_FILELIST );
-    iModel = static_cast<CFileBrowserDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    
-    iRemConSelector = CRemConInterfaceSelector::NewL();
-    iRemConTarget = CRemConCoreApiTarget::NewL(*iRemConSelector, *this);
-    iRemConSelector->OpenTargetL();
-    }
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::~CFileBrowserFileListView()
-// ?implementation_description
-// ---------------------------------------------------------
-//
-CFileBrowserFileListView::~CFileBrowserFileListView()
-    {
-    delete iRemConSelector;
-
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        }
-
-    delete iContainer;
-    }
-
-// ---------------------------------------------------------
-// TUid CFileBrowserFileListView::Id()
-// ?implementation_description
-// ---------------------------------------------------------
-//
-TUid CFileBrowserFileListView::Id() const
-    {
-    return KFileListViewUID;
-    }
-
-// ---------------------------------------------------------
-// TUid CFileBrowserFileListView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-// ?implementation_description
-// ---------------------------------------------------------
-//
-
-void CFileBrowserFileListView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    TBool emptyListBox = iContainer->ListBoxNumberOfVisibleItems() == 0;
-    TBool driveListActive = iModel->FileUtils()->IsDriveListViewActive();
-    TBool normalModeActive = iModel->FileUtils()->IsNormalModeActive();
-    TBool currentDriveReadOnly = iModel->FileUtils()->IsCurrentDriveReadOnly();
-    TBool currentItemDirectory = iModel->FileUtils()->IsCurrentItemDirectory();
-    TBool listBoxSelections = iContainer->ListBoxSelectionIndexesCount() == 0;
-    TBool emptyClipBoard = iModel->FileUtils()->ClipBoardList()->Count() == 0;
-    TBool showSnapShot = iModel->FileUtils()->DriveSnapShotPossible();
-    
-    TBool hideEditMenu(EFalse);
-    if (driveListActive)
-        {
-        if (!showSnapShot || emptyListBox && emptyClipBoard)
-            hideEditMenu = ETrue;    
-        else
-            hideEditMenu = EFalse;
-        }
-    else
-        {
-        if (emptyListBox && emptyClipBoard)
-            hideEditMenu = ETrue;    
-        else
-            hideEditMenu = EFalse;
-        }
-    
-
-    if (aResourceId == R_FILEBROWSER_VIEW_FILELIST_MENU)
-	    {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEdit, hideEditMenu);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdDiskAdmin, !driveListActive);
-	    }    
-
-    else if (aResourceId == R_FILEBROWSER_FILE_SUBMENU)
-	    {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileBack, driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpen, emptyListBox || driveListActive || currentItemDirectory);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpenDrive, emptyListBox || !driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpenDirectory, emptyListBox || driveListActive || !currentItemDirectory);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, emptyListBox || !listBoxSelections || currentItemDirectory || driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileEdit, emptyListBox || !listBoxSelections || currentItemDirectory || driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, emptyListBox || driveListActive || currentItemDirectory);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileNew, driveListActive || currentDriveReadOnly);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileDelete, emptyListBox || driveListActive || currentDriveReadOnly);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileRename, emptyListBox || driveListActive || currentDriveReadOnly || !listBoxSelections);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileTouch, emptyListBox || driveListActive || currentDriveReadOnly);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileProperties, emptyListBox || !listBoxSelections);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileChecksums, emptyListBox || !listBoxSelections || currentItemDirectory || driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileSetAttributes, emptyListBox || driveListActive || currentDriveReadOnly);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileCompress, currentDriveReadOnly || emptyListBox || !listBoxSelections || currentItemDirectory || driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdFileDecompress, currentDriveReadOnly || emptyListBox || !listBoxSelections || currentItemDirectory || driveListActive);
-	    }
-    
-    else if (aResourceId == R_FILEBROWSER_EDIT_SUBMENU)
-	    {
-        TBool currentSelected = iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
-        TBool allSelected = iContainer->ListBox()->SelectionIndexes()->Count() == iContainer->ListBox()->Model()->NumberOfItems();
-        TBool noneSelected = iContainer->ListBox()->SelectionIndexes()->Count() == 0;
-        
-        aMenuPane->SetItemDimmed(EFileBrowserCmdSnapShot, !driveListActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditCut, driveListActive || currentDriveReadOnly || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditCopy, driveListActive || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditPaste, driveListActive || emptyClipBoard || currentDriveReadOnly);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditCopyToFolder, driveListActive || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditMoveToFolder, driveListActive || currentDriveReadOnly || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditSelect, driveListActive || currentSelected || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditUnselect, driveListActive || !currentSelected || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditSelectAll, driveListActive || allSelected || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdEditUnselectAll, driveListActive || noneSelected || emptyListBox);
-	    }
-
-	else if (aResourceId == R_FILEBROWSER_VIEW_SUBMENU)
-	    {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdViewSort, !normalModeActive || driveListActive || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdViewOrder, !normalModeActive || driveListActive || emptyListBox);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdViewRefresh, !normalModeActive);
-        aMenuPane->SetItemDimmed(EFileBrowserCmdViewFilterEntries, emptyListBox);
-	    }
-
-	else if (aResourceId == R_FILEBROWSER_VIEW_SORT_SUBMENU)
-	    {
-        aMenuPane->SetItemButtonState(iModel->FileUtils()->SortMode(), EEikMenuItemSymbolOn);
-	    }
-
-	else if (aResourceId == R_FILEBROWSER_VIEW_ORDER_SUBMENU)
-	    {
-        aMenuPane->SetItemButtonState(iModel->FileUtils()->OrderMode(), EEikMenuItemSymbolOn);
-	    }
-
-	else if (aResourceId == R_FILEBROWSER_TOOLS_SUBMENU)
-	    {
-	    TBool noLocalCon = !iModel->FileUtils()->FileExists(KIRAppPath) && !iModel->FileUtils()->FileExists(KBTAppPath) && !iModel->FileUtils()->FileExists(KUSBAppPath);
-	    
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsDisableExtErrors, !iModel->FileUtils()->FileExists(KErrRdPath));
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsEnableExtErrors, iModel->FileUtils()->FileExists(KErrRdPath));
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsLocalConnectivity, noLocalCon);
-	    }
-
-	else if (aResourceId == R_FILEBROWSER_TOOLS_LOCALCONNECTIVITY_SUBMENU)
-	    {
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsLocalConnectivityActivateInfrared, !iModel->FileUtils()->FileExists(KIRAppPath));
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsLocalConnectivityLaunchBTUI, !iModel->FileUtils()->FileExists(KBTAppPath));
-        aMenuPane->SetItemDimmed(EFileBrowserCmdToolsLocalConnectivityLaunchUSBUI, !iModel->FileUtils()->FileExists(KUSBAppPath));
-	    }	    
-    else
-        {
-        AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-        }
-    }
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct)
-// Used to handle multimedia keys
-// ---------------------------------------------------------
-//
-
-void CFileBrowserFileListView::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction /*aButtonAct*/)
-    {
-    switch(aOperationId)
-        {
-        case ERemConCoreApiVolumeUp:
-            {
-            // simulate a keyevent, so that it can be handled as all other key events
-            TKeyEvent keyEvent;
-            keyEvent.iCode = EKeyIncVolume;
-            keyEvent.iScanCode = 0;
-            keyEvent.iModifiers = 0;
-            keyEvent.iRepeats = 0;
-            
-            //TRAP_IGNORE( iContainer->OfferKeyEventL(keyEvent, EEventKey) );
-            
-            //RWsSession& wsSession=iCoeEnv->WsSession();
-            //wsSession.SimulateKeyEvent(keyEvent);
-            //wsSession.Flush();
-
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKeyDown);
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKey);
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKeyUp);
-            
-            break;
-            }
-        case ERemConCoreApiVolumeDown:
-            {
-            // simulate a keyevent, so that it can be handled as all other key events
-            TKeyEvent keyEvent;
-            keyEvent.iCode = EKeyDecVolume;
-            keyEvent.iScanCode = 0;
-            keyEvent.iModifiers = 0;
-            keyEvent.iRepeats = 0;
-                        
-            //TRAP_IGNORE( iContainer->OfferKeyEventL(keyEvent, EEventKey) );
-            
-            //RWsSession& wsSession=iCoeEnv->WsSession();
-            //wsSession.SimulateKeyEvent(keyEvent);
-            //wsSession.Flush();
-            
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKeyDown);
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKey);
-            iCoeEnv->SimulateKeyEventL(keyEvent,EEventKeyUp);
-            
-            break;
-            }
-        }
-    }
-
-  
-// ---------------------------------------------------------
-// CFileBrowserFileListView::HandleCommandL(TInt aCommand)
-// ?implementation_description
-// ---------------------------------------------------------
-//
-void CFileBrowserFileListView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-
-        case EFileBrowserCmdFileBack:
-            {
-            iModel->FileUtils()->MoveUpOneLevelL();
-            break;
-            }
-                    
-        case EFileBrowserCmdFileOpenApparc:
-            {
-            iModel->FileUtils()->OpenWithApparcL();
-            break;
-            }
-
-        case EFileBrowserCmdFileOpenDocHandlerEmbed:
-            {
-            iModel->FileUtils()->OpenWithDocHandlerL(ETrue);
-            break;
-            }
-
-        case EFileBrowserCmdFileOpenDocHandlerStandAlone:
-            {
-            iModel->FileUtils()->OpenWithDocHandlerL(EFalse);
-            break;
-            }
-
-        case EFileBrowserCmdFileOpenFileService:
-            {
-            iModel->FileUtils()->OpenWithFileServiceL();
-            break;
-            }
-            
-        case EFileBrowserCmdFileOpenDrive:
-        case EFileBrowserCmdFileOpenDirectory:
-            {
-            iModel->FileUtils()->MoveDownToDirectoryL();
-            break;
-            }
-
-        case EFileBrowserCmdFileViewText:
-        case EFileBrowserCmdFileViewHex:
-        case EFileBrowserCmdFileEditText:
-        case EFileBrowserCmdFileEditHex:
-            {
-            iModel->FileUtils()->FileEditorL(aCommand);
-            break;
-            }
-
-        case EFileBrowserCmdFileSearch:
-            {
-            iModel->FileListContainer()->HideToolbar();
-            iModel->FileUtils()->SearchL();
-            break;
-            }
-
-        case EFileBrowserCmdFileSendTo:
-            {
-            iModel->FileUtils()->SendToL();
-            break;
-            }
-
-        case EFileBrowserCmdFileNewFile:
-            {
-            iModel->FileUtils()->NewFileL();
-            break;
-            }
-
-        case EFileBrowserCmdFileNewDirectory:
-            {
-            iModel->FileUtils()->NewDirectoryL();
-            break;
-            }
-
-        case EFileBrowserCmdFileDelete:
-            {
-            iModel->FileUtils()->DeleteL();
-            break;
-            }
-
-        case EFileBrowserCmdFileRename:
-            {
-            iModel->FileUtils()->RenameL();
-            break;
-            }
-
-        case EFileBrowserCmdFileTouch:
-            {
-            iModel->FileUtils()->TouchL();
-            break;
-            }
-
-        case EFileBrowserCmdFileProperties:
-            {
-            iModel->FileUtils()->PropertiesL();
-            break;
-            }
-
-        case EFileBrowserCmdFileChecksumsMD5:
-        case EFileBrowserCmdFileChecksumsMD2:
-        case EFileBrowserCmdFileChecksumsSHA1:
-            {
-            iModel->FileUtils()->ShowFileCheckSumsL(aCommand);
-            break;
-            }
-            
-        case EFileBrowserCmdFileSetAttributes:
-            {
-            iModel->FileListContainer()->HideToolbar();
-            iModel->FileUtils()->SetAttributesL();
-            break;
-            }
-
-        case EFileBrowserCmdFileCompress:
-            {
-            iModel->FileUtils()->CompressL();
-            break;
-            }
-
-        case EFileBrowserCmdFileDecompress:
-            {
-            iModel->FileUtils()->DecompressL();
-            break;
-            }
-///        
-        case EFileBrowserCmdSnapShot:
-            {
-            iModel->FileUtils()->DriveSnapShotL();
-            break;
-            }
-            
-        case EFileBrowserCmdEditCut:
-            {
-            iModel->FileUtils()->ClipboardCutL();
-            break;
-            }
-
-        case EFileBrowserCmdEditCopy:
-            {
-            iModel->FileUtils()->ClipboardCopyL();
-            break;
-            }
-
-        case EFileBrowserCmdEditPaste:
-            {
-            iModel->FileUtils()->ClipboardPasteL();
-            break;
-            }
-
-        case EFileBrowserCmdEditCopyToFolder:
-            {
-            iModel->FileUtils()->CopyToFolderL();
-            break;
-            }
-
-        case EFileBrowserCmdEditMoveToFolder:
-            {
-            iModel->FileUtils()->CopyToFolderL(ETrue);
-            break;
-            }            
-
-        case EFileBrowserCmdEditSelect:
-            {
-            iModel->FileListContainer()->UpdateToolbar();
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iContainer->ListBox() );
-            break;
-            }
-
-        case EFileBrowserCmdEditUnselect:
-            {
-            iModel->FileListContainer()->UpdateToolbar();
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iContainer->ListBox() );
-            break;
-            }
-
-        case EFileBrowserCmdEditSelectAll:
-            {
-            iModel->FileListContainer()->UpdateToolbar();
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknMarkAll, iContainer->ListBox() );
-            break;
-            }
-            
-        case EFileBrowserCmdEditUnselectAll:
-            {
-            iModel->FileListContainer()->UpdateToolbar();
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknUnmarkAll, iContainer->ListBox() );
-            break;
-            }
-///
-        case EFileBrowserCmdViewSortByName:
-        case EFileBrowserCmdViewSortByExtension:
-        case EFileBrowserCmdViewSortByDate:
-        case EFileBrowserCmdViewSortBySize:
-            {
-            iModel->FileUtils()->SetSortModeL(aCommand);
-            break;
-            }
-
-        case EFileBrowserCmdViewOrderAscending:
-        case EFileBrowserCmdViewOrderDescending:
-            {
-            iModel->FileUtils()->SetOrderModeL(aCommand);
-            break;
-            }
-	
-        case EFileBrowserCmdViewFilterEntries:
-            {
-            iContainer->EnableSearchFieldL();
-            break;
-            }
-
-        case EFileBrowserCmdViewRefresh:
-            {
-            iModel->FileUtils()->RefreshViewL();
-            break;
-            }
-///
-        case EFileBrowserCmdDiskAdminSetDrivePassword:
-            {
-            iModel->FileUtils()->SetDrivePasswordL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminUnlockDrive:
-            {
-            iModel->FileUtils()->UnlockDriveL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminClearDrivePassword:
-            {
-            iModel->FileUtils()->ClearDrivePasswordL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminEraseDrivePassword:
-            {
-            iModel->FileUtils()->EraseDrivePasswordL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminFormatDrive:
-            {
-            iModel->FileUtils()->FormatDriveL(EFalse);
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminQuickFormatDrive:
-            {
-            iModel->FileUtils()->FormatDriveL(ETrue);
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminCheckDisk:
-            {
-            iModel->FileUtils()->CheckDiskL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminScanDrive:
-            {
-            iModel->FileUtils()->ScanDriveL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminSetDriveName:
-            {
-            iModel->FileUtils()->SetDriveNameL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminSetDriveVolumeLabel:
-            {
-            iModel->FileUtils()->SetDriveVolumeLabelL();
-            break;
-            }
-
-        case EFileBrowserCmdDiskAdminEjectDrive:
-            {
-            iModel->FileUtils()->EjectDriveL();
-            break;
-            }
-            
-        case EFileBrowserCmdDiskAdminDismountFileSystem:
-            {
-            iModel->FileUtils()->DismountFileSystemL();
-            break;
-            }
-            
-        case EFileBrowserCmdDiskAdminEraseMBR:
-            {
-            iModel->FileUtils()->EraseMBRL();
-            break;
-            }
-            
-        case EFileBrowserCmdDiskAdminDrivePartition:
-            {
-            iModel->FileUtils()->PartitionDriveL();
-            break;
-            }
-
-///
-        case EFileBrowserCmdToolsAllFiles:
-            {
-            iModel->FileUtils()->WriteAllFilesL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsAvkonIconCacheEnable:
-            {
-            iModel->FileUtils()->EnableAvkonIconCacheL(ETrue);
-            break;
-            }
-
-        case EFileBrowserCmdToolsAvkonIconCacheDisable:
-            {
-            iModel->FileUtils()->EnableAvkonIconCacheL(EFalse);
-            break;
-            }
-
-        case EFileBrowserCmdToolsEditDataTypes:
-            {
-            iModel->FileUtils()->EditDataTypesL();
-            break;
-            }
-                        
-        case EFileBrowserCmdToolsDisableExtErrors:
-            {
-            iModel->FileUtils()->SetErrRdL(EFalse);
-            break;
-            }
-
-        case EFileBrowserCmdToolsEnableExtErrors:
-            {
-            iModel->FileUtils()->SetErrRdL(ETrue);
-            break;
-            }
-
-        case EFileBrowserCmdToolsErrorSimulateLeave:
-            {
-            iModel->FileUtils()->SimulateLeaveL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsErrorSimulatePanic:
-            {
-            iModel->FileUtils()->SimulatePanicL();
-            break;
-            }
-        
-       case EFileBrowserCmdToolsErrorSimulateException:
-            {
-            iModel->FileUtils()->SimulateExceptionL();
-            break;
-            }
-                            
-        case EFileBrowserCmdToolsLocalConnectivityActivateInfrared:
-            {
-            iModel->FileUtils()->LaunchProgramL(KIRAppPath);
-            break;
-            }
-
-        case EFileBrowserCmdToolsLocalConnectivityLaunchBTUI:
-            {
-            iModel->FileUtils()->LaunchProgramL(KBTAppPath);
-            break;
-            }
-
-        case EFileBrowserCmdToolsLocalConnectivityLaunchUSBUI:
-            {
-            iModel->FileUtils()->LaunchProgramL(KUSBAppPath);
-            break;
-            }
-
-        case EFileBrowserCmdToolsInstalledApps:
-            {
-            iModel->FileUtils()->WriteAllAppsL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsOpenFiles:
-            {
-            iModel->FileUtils()->ListOpenFilesL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsSetDebugMask:
-            {
-            iModel->FileUtils()->SetDebugMaskL();
-            break;
-            }
-            
-        case EFileBrowserCmdToolsMsgAttachmentsInbox:
-        case EFileBrowserCmdToolsMsgAttachmentsDrafts:
-        case EFileBrowserCmdToolsMsgAttachmentsSentItems:
-        case EFileBrowserCmdToolsMsgAttachmentsOutbox:
-            {
-            iModel->FileUtils()->ListMessageAttachmentsL(aCommand);
-            break;
-            }
-
-        case EFileBrowserCmdToolsMsgStoreWalk:
-            {
-            iModel->FileUtils()->WriteMsgStoreWalkL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsMemoryInfo:
-            {
-            iModel->FileUtils()->MemoryInfoPopupL();
-            break;
-            }
-
-        case EFileBrowserCmdToolsSecureBackupStartBackup:
-        case EFileBrowserCmdToolsSecureBackupStartRestore:
-        case EFileBrowserCmdToolsSecureBackupStop:
-            {
-            iModel->FileUtils()->SecureBackupL(aCommand);
-            break;
-            }
-
-///
-        case EFileBrowserCmdSettings:
-            {
-            if (iModel->LaunchSettingsDialogL() == EAknCmdExit)
-                AppUi()->HandleCommandL( EEikCmdExit );
-            break;
-            }
-
-        case EFileBrowserCmdAbout:
-            {
-	        CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-            dialog->ExecuteLD(R_FILEBROWSER_ABOUT_DIALOG);
-            }
-            break;
- 
-         case EAknSoftkeyCancel:
-            {
-            iContainer->DisableSearchFieldL();
-            break;
-            }
-                   
-        case EAknSoftkeyExit:
-            {
-            AppUi()->HandleCommandL( EEikCmdExit );
-            break;
-            }
-
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CFileBrowserFileListView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::DoActivateL(...)
-// ?implementation_description
-// ---------------------------------------------------------
-//
-void CFileBrowserFileListView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CFileBrowserFileListContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-   }
-
-// ---------------------------------------------------------
-// CFileBrowserFileListView::HandleCommandL(TInt aCommand)
-// ?implementation_description
-// ---------------------------------------------------------
-//
-void CFileBrowserFileListView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        }
-    
-    delete iContainer;
-    iContainer = NULL;
-    }
-
-// End of File
-
--- a/filebrowser/src/FBFileOps.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1158 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBFileOps.h"
-#include "FBFileUtils.h"
-#include "FBModel.h"
-#include "FBTraces.h"
-
-#ifndef FILEBROWSER_LITE
-  #include "FBFileOpClient.h"
-#endif  
-
-#include <f32file.h>
-#include <bautils.h>
-#include <eikenv.h>
-#include <babackup.h>
-
-const TInt KSecureBackupStartDelay = 750000;
-const TInt KSecureBackupLoopDelay = 100000;
-const TInt KSecureBackupEndDelay = 200000;
-const TInt KMaxFileLockAttempts = 3;
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-CFileBrowserFileOps* CFileBrowserFileOps::NewL(CFileBrowserModel* aModel)
-	{
-	CFileBrowserFileOps* self = new(ELeave) CFileBrowserFileOps(aModel);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileOps::CFileBrowserFileOps(CFileBrowserModel* aModel) : iModel(aModel)
-	{
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileOps::ConstructL()
-	{
-	iRecursiveState = EFileOpInvalid;
-	iSecureBackUpActive = EFalse;
-	iFileCommandActivatedSecureBackup = EFalse;
-	
-    User::LeaveIfError(iFs.Connect());
-    iFileMan = CFileMan::NewL( iFs, this );
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileOps::~CFileBrowserFileOps()
-	{
-	if (iSBEClient)
-	    delete iSBEClient;
-	
-    #ifndef FILEBROWSER_LITE	
-        if (iFileOpClient)
-            delete iFileOpClient;
-    #endif	
-
-    delete iFileMan;
-    iFs.Close();    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::ActivateSecureBackUpViaFileOp()
-    {
-    iFileManObserverResult = MFileManObserver::EContinue;
-    // if already activate by a file command, return ok
-    if (iFileCommandActivatedSecureBackup)
-        return KErrNone;
-    else
-        {
-        // if secure backup is already active, disable it first, because it may in wrong state
-        if (iSecureBackUpActive)
-            DeActivateSecureBackUp();
-        }
-    
-    // try to activate full secure backup
-    TInt err = ActivateSecureBackUp(conn::EBURBackupFull, conn::EBackupBase);
-    
-    if (err == KErrNone)
-        iFileCommandActivatedSecureBackup = ETrue;
-    
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DeActivateSecureBackUpViaFileOp()
-    {
-    TInt err(KErrGeneral);
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    // if activate by a file command, try to reactivate it
-    if (iFileCommandActivatedSecureBackup)
-        {
-        err = DeActivateSecureBackUp();
-        
-        // even if it fails, forget the state
-        iFileCommandActivatedSecureBackup = EFalse;
-        }
-
-    return err;
-    }    
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::ActivateSecureBackUp(conn::TBURPartType aPartType, conn::TBackupIncType aBackupIncType)
-    {
-    iFileManObserverResult = MFileManObserver::EContinue;
-    // check for invalid parameters
-    if (aPartType == conn::EBURNormal || aBackupIncType == conn::ENoBackup)
-        User::Panic(_L("Inv.Usage.SE"), 532);
-    
-    TInt err(KErrNone);
-    
-    if (!iSBEClient)
-        {
-        TRAP(err, iSBEClient = conn::CSBEClient::NewL());
-        if (err != KErrNone)
-            return err;
-        }
-    
-    TDriveList driveList;
-    err = iFs.DriveList(driveList);
-    
-    if (err == KErrNone)
-        {
-        // make sure that the application has a system status to prevent getting shut down events
-        iModel->EikonEnv()->SetSystem(ETrue);
-    
-        // activating secure back up removes locks from files which respect this fuctionality                
-        TRAP(err, iSBEClient->SetBURModeL(driveList, aPartType, aBackupIncType));
-        
-        if (err == KErrNone)
-            {
-            iSecureBackUpActive = ETrue;
-            User::After(KSecureBackupStartDelay); // a short delay to wait to activate
-            }
-        }
-
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DeActivateSecureBackUp()
-    {
-    TInt err(KErrNone);
-    
-    if (!iSBEClient)
-        {
-        TRAP(err, iSBEClient = conn::CSBEClient::NewL());
-        if (err != KErrNone)
-            return err;
-        
-        // make sure that the application has a system status
-        iModel->EikonEnv()->SetSystem(ETrue);
-        }
-        
-    TDriveList driveList;
-    err = iFs.DriveList(driveList);
-    
-    if (err == KErrNone)
-        {
-        // deactivate secure backup
-        TRAP(err, iSBEClient->SetBURModeL(driveList, conn::EBURNormal, conn::ENoBackup));
-        
-        User::After(KSecureBackupEndDelay); // a short delay to wait to deactivate
-
-        // system status not needed anymore
-        iModel->EikonEnv()->SetSystem(EFalse);
-        }
-    
-    iSecureBackUpActive = EFalse;
-
-    return err;
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFindEntries(const TDesC& aFileName, const TDesC& aPath)
-    {
-    TFindFile fileFinder(iFs);
-    CDir* dir;
-    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
-
-    while (err == KErrNone && iFileManObserverResult != MFileManObserver::ECancel)
-        {
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-
-            if (entry.iName.Length() && aPath.Length())
-                {
-                // parse the entry
-                TParse parsedName;
-                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
-                
-                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
-                    {
-                    // get full source path
-                    TFileName fullSourcePath = parsedName.FullName();
-                    if (entry.IsDir())
-                        fullSourcePath.Append(_L("\\"));
-                    
-                    // call the file operation command
-                    switch(iRecursiveState)
-                        {
-                        case EFileOpAttribs:
-                            {
-                            // the same attribs command can be given for both directories and files
-                            FileOpAttribs(fullSourcePath, iUint1, iUint2, iTime1, iUint3);
-                            }
-                            break;
-
-                        case EFileOpCopy:
-                            {
-                            // calculate length of new entries added to the original source path
-                            TUint newEntriesLength = fullSourcePath.Length() - iBuf1.Length();
-                            
-                            // get pointer description to the rightmost data
-                            TPtr16 newEntriesPtr = fullSourcePath.RightTPtr(newEntriesLength);
-                            
-                            // generate target path
-                            TFileName fullTargetPath = iBuf2;
-                            fullTargetPath.Append(newEntriesPtr);
-                            
-                            if (entry.IsDir())
-                                {
-                                // if it is a directory entry, just create it based on the entry's attributes
-                                FileOpMkDirAll(fullTargetPath, entry.iAtt);
-                                }
-                            else
-                                {
-                                // otherwise copy the file
-                                FileOpCopy(fullSourcePath, fullTargetPath, iUint1);
-                                }
-                            }
-                            break;
-
-                        case EFileOpDelete:
-                            {
-                            if (entry.IsDir())
-                                {
-                                // for directories call rmdir    
-                                FileOpRmDir(fullSourcePath, iUint1);
-                                }
-                            else
-                                {
-                                // for files call the normal file deletion operation    
-                                FileOpDeleteFile(fullSourcePath, iUint1);
-                                }
-                            }
-                            break;
-                                                    
-                        default:
-                            User::Panic (_L("FileOpRecurs"), 775);
-                            break;
-                        }                        
-                    }
-                }
-                if ( iFileManObserverResult == MFileManObserver::ECancel ) break;
-            }
-
-        delete dir;
-        dir = NULL;
-        if ( iFileManObserverResult != MFileManObserver::ECancel )
-            {
-            err = fileFinder.FindWild(dir);
-            }
-        }
-
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFindEntriesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
-	{
-    TInt err(KErrNone);
-
-    // it is logical to scan upwards when deleting and changing attributes
-    CDirScan::TScanDirection scanDirection = CDirScan::EScanUpTree;
-    
-    // when copying files, it is more logical to move downwards
-    if (iRecursiveState == EFileOpCopy)
-        scanDirection = CDirScan::EScanDownTree;
-    
-    
-    CDirScan* scan = CDirScan::NewLC(iFs);
-    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst, scanDirection);
-    CDir* dir = NULL;
-
-    for(;;)
-        {
-        TRAP(err, scan->NextL(dir));
-        if (!dir  || (err != KErrNone))
-            break;
-
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-            
-            if (entry.IsDir())
-                {
-                TFileName path(scan->FullPath());
-                
-                if (path.Length())
-                    {
-                    path.Append(entry.iName);
-                    path.Append(_L("\\"));
-                    DoFindEntries(aFileName, path);
-                    }
-                }
-            if ( iFileManObserverResult == MFileManObserver::ECancel )
-                {
-                break;
-                }
-            }
-        delete(dir);
-        if ( iFileManObserverResult == MFileManObserver::ECancel )
-            {
-            break;
-            }
-        }
-
-    CleanupStack::PopAndDestroy(scan);
-    return err;
-    }
-    
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::Copy(const TFileEntry& aSourceEntry, const TDesC& aTargetFullName, TUint aSwitch, TBool aDeleteSource) 
-    {
-    iOperationError = KErrNone;
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    TFileName sourcePath = aSourceEntry.iPath;
-    sourcePath.Append(aSourceEntry.iEntry.iName);
-    
-    TInt err(KErrNone);
-
-    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
-        {
-        // find all files recursively and run the operation for them
-        iRecursiveState = EFileOpCopy;
-        sourcePath.Append(_L("\\"));
-        
-        TFileName targetPath = aTargetFullName;
-        targetPath.Append(_L("\\"));
-        
-        // remove the recursion flag because we will implement our own recursion
-        TUint newSwitch(aSwitch);
-        newSwitch &= ~CFileMan::ERecurse;
-    
-        iBuf1.Copy(sourcePath);
-        iBuf2.Copy(targetPath);
-        iUint1 = newSwitch;
-        
-        // create initial directory - if it does not succeed, do not even try to continue
-        err = FileOpMkDirAll(targetPath, aSourceEntry.iEntry.iAtt);
-        
-        if (iOperationError == KErrNone)
-            {
-            TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
-            if ( iFileManObserverResult != MFileManObserver::ECancel )
-                {
-                TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
-                }
-            }
-        }
-
-    else if (aSourceEntry.iEntry.IsDir())
-        {
-        TFileName targetPath = aTargetFullName;
-        targetPath.Append(_L("\\"));
-        
-        // just create a directory based on the file attributes of the source directory
-        err = FileOpMkDirAll(targetPath, aSourceEntry.iEntry.iAtt);
-        }
-        
-    else
-        {
-        // remove a recursion flag if present (this should never happen, but some extra error checking)
-        if (aSwitch & CFileMan::ERecurse)
-            aSwitch &= ~CFileMan::ERecurse;    
-            
-        // do the operation for a file entry
-        err = FileOpCopy(sourcePath, aTargetFullName, aSwitch);
-        }
-    
-        
-    // delete source if needed and copy succeeded without any errors (== move operation)
-    if ( aDeleteSource && iOperationError == KErrNone &&
-         iFileManObserverResult != MFileManObserver::ECancel )
-        {
-        err = Delete(aSourceEntry, aSwitch);    
-        }
-    
-    if ( !iOperationError && iFileManObserverResult == MFileManObserver::ECancel )
-        {
-        iOperationError = KErrCancel;
-        }
-        
-    return iOperationError; 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch) 
-    {
-    TInt err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
-
-    // if locked, unlock the file and retry
-    if (iModel->Settings().iRemoveFileLocks && err == KErrInUse)
-        {
-        // try to remove the file lock by activating secure backup mode
-        if (ActivateSecureBackUpViaFileOp() == KErrNone)
-            {
-            // try the operation several times
-            for (TInt i=0; i<KMaxFileLockAttempts; i++)
-                {
-                err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
-                
-                if (err != KErrInUse)
-                    break;
-                else
-                    User::After(KSecureBackupLoopDelay);
-                }
-            }
-        }
-
-    // if access denied, then try to remove the target path and try again
-    if (iModel->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied && BaflUtils::FileExists(iFs, aTargetFullName))
-        {
-        if (FileOpDeleteFile(aTargetFullName, 0) == KErrNone)
-            {
-            err = DoFileOpCopy(aSourceFullName, aTargetFullName, aSwitch);
-            }
-        }
-
-    // if the file already exists, it is not an error    
-    if (err == KErrAlreadyExists)
-        err = KErrNone;
-    
-    
-    // if copying from a ROM drive, remove the writing protection flag
-    if (iModel->Settings().iRemoveROMWriteProrection && err == KErrNone && aSourceFullName.Length() > 3 && (aSourceFullName[0]=='z' || aSourceFullName[0]=='Z'))
-        {
-        FileOpAttribs(aTargetFullName, 0, KEntryAttReadOnly, 0, 0);
-        }
-    
-    
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-
-    LOGSTRING4("FileBrowser: FileOpCopy %S -> %S, err=%d", &aSourceFullName, &aTargetFullName, err);
-        
-    return err; 
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFileOpCopy(const TDesC& aSourceFullName, const TDesC& aTargetFullName, TUint aSwitch) 
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-            
-        return iFileOpClient->Copy(aSourceFullName, aTargetFullName, aSwitch);
-        }
-    else
-        {
-    #endif
-        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-        TInt result = iFileMan->Copy( aSourceFullName, aTargetFullName, aSwitch, waiter->iStatus );
-        waiter->StartAndWait();
-        if ( !result ) result = waiter->Result();
-        CleanupStack::PopAndDestroy( waiter );
-        return result;
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::Rename(const TFileEntry& aSourceEntry, const TDesC& aNew, TUint aSwitch)
-    {
-    iOperationError = KErrNone;
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    TFileName sourcePath = aSourceEntry.iPath;
-    sourcePath.Append(aSourceEntry.iEntry.iName);
-    
-    if (aSourceEntry.iEntry.IsDir())
-        {
-        // do the operation for a directory entry
-        FileOpRename(sourcePath, aNew, aSwitch);
-        }
-    else
-        {
-        // do the operation for a file
-        FileOpRename(sourcePath, aNew, aSwitch);
-        }
-
-    return iOperationError; 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch)
-    {
-    TBool setBackROFlag(EFalse);
-
-    TInt err = DoFileOpRename(aName, aNew, aSwitch);
-
-    // if locked, unlock the file and retry
-    if (iModel->Settings().iRemoveFileLocks && err == KErrInUse)
-        {
-        // try to remove the file lock by activating secure backup mode
-        if (ActivateSecureBackUpViaFileOp() == KErrNone)
-            {
-            // try the operation several times
-            for (TInt i=0; i<KMaxFileLockAttempts; i++)
-                {
-                err = DoFileOpRename(aName, aNew, aSwitch);
-                
-                if (err != KErrInUse)
-                    break;
-                else
-                    User::After(KSecureBackupLoopDelay);
-                }
-            }
-        }
-
-    // if write protected, remove protection and retry
-    else if (iModel->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied)
-        {
-        // remove write protection and try again
-        if (FileOpAttribs(aName, 0, KEntryAttReadOnly, 0, 0) == KErrNone)
-            {
-            err = DoFileOpRename(aName, aNew, aSwitch);
-            
-            setBackROFlag = ETrue;
-            }
-        }
-
-    // if still access denied, then try to remove the target path and try again
-    if (iModel->Settings().iIgnoreProtectionsAtts && err == KErrAccessDenied && BaflUtils::FileExists(iFs, aNew))
-        {
-        if (FileOpDeleteFile(aNew, 0) == KErrNone)
-            {
-            err = DoFileOpRename(aName, aNew, aSwitch);
-            }
-        }
-
-    // set back the read only flag
-    if (setBackROFlag)
-        FileOpAttribs(aName, KEntryAttReadOnly, 0, 0, 0);
-            
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-
-    LOGSTRING3("FileBrowser: FileOpRename %S, err=%d", &aName, err);
-        
-    return err; 
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFileOpRename(const TDesC& aName, const TDesC& aNew, TUint aSwitch)
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->Rename(aName, aNew, aSwitch);
-        }
-    else
-        {
-    #endif
-        return iFileMan->Rename(aName, aNew, aSwitch);
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::Attribs(const TFileEntry& aSourceEntry, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
-    {
-    iOperationError = KErrNone;
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    TFileName sourcePath = aSourceEntry.iPath;
-    sourcePath.Append(aSourceEntry.iEntry.iName);
-    
-    TInt err(KErrNone);
-
-    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
-        {
-        // do the operation for a current directory entry
-        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
-
-        // find all files recursively and run the operation for them
-        iRecursiveState = EFileOpAttribs;
-        sourcePath.Append(_L("\\"));
-    
-        iBuf1.Copy(sourcePath);
-        iUint1 = aSetMask;
-        iUint2 = aClearMask;
-        iTime1 = aTime;
-        iUint3 = 0;
-        
-        TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
-        TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
-        }
-
-    else if (aSourceEntry.iEntry.IsDir())
-        {
-        //sourcePath.Append(_L("\\"));   // <-- do not apply!
-    
-        // do the operation for a directory entry
-        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
-        }
-            
-    else
-        {
-        // do the operation for a file entry
-        err = FileOpAttribs(sourcePath, aSetMask, aClearMask, aTime, 0);
-        }
-
-    return iOperationError;     
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-TInt CFileBrowserFileOps::FileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
-    {
-    TInt err = DoFileOpAttribs(aName, aSetMask, aClearMask, aTime, aSwitch);
-
-    // if locked, unlock the file and retry
-    if (iModel->Settings().iRemoveFileLocks && err == KErrInUse)
-        {
-        // try to remove the file lock by activating secure backup mode
-        if (ActivateSecureBackUpViaFileOp() == KErrNone)
-            {
-            // try the operation several times
-            for (TInt i=0; i<KMaxFileLockAttempts; i++)
-                {
-                err = DoFileOpAttribs(aName, aSetMask, aClearMask, aTime, aSwitch);
-                
-                if (err != KErrInUse)
-                    break;
-                else
-                    User::After(KSecureBackupLoopDelay);
-                }
-            }
-        }
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-
-    LOGSTRING3("FileBrowser: FileOpAttribs %S, err=%d", &aName, err);
-        
-    return err;    
-    }
-    
-// --------------------------------------------------------------------------------------------
-    
-TInt CFileBrowserFileOps::DoFileOpAttribs(const TDesC& aName, TUint aSetMask, TUint aClearMask, const TTime& aTime, TUint aSwitch) 
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->Attribs(aName, aSetMask, aClearMask, aTime, aSwitch);
-        }
-    else
-        {
-    #endif
-        return iFileMan->Attribs(aName, aSetMask, aClearMask, aTime, aSwitch);
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::Delete(const TFileEntry& aSourceEntry, TUint aSwitch) 
-    {
-    iOperationError = KErrNone;
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    TFileName sourcePath = aSourceEntry.iPath;
-    sourcePath.Append(aSourceEntry.iEntry.iName);
-    
-    TInt err(KErrNone);
-
-    if (aSourceEntry.iEntry.IsDir() && (aSwitch & CFileMan::ERecurse))
-        {
-        // find all files recursively and run the operation for them
-        iRecursiveState = EFileOpDelete;
-        sourcePath.Append(_L("\\"));
-    
-        iBuf1.Copy(sourcePath);
-        iUint1 = 0;
-        
-        TRAP(err, DoFindEntriesRecursiveL(_L("*"), sourcePath));    // recursively under directories of current directory entry
-        if ( iFileManObserverResult != MFileManObserver::ECancel )
-            {
-            TRAP(err, DoFindEntries(_L("*"), sourcePath));              // entries under current directory entry
-            }
-        
-        if ( iFileManObserverResult != MFileManObserver::ECancel )
-            {
-            // do the operation for a current directory entry as well
-            err = FileOpRmDir(sourcePath, 0);
-            }
-        }
-
-    else if (aSourceEntry.iEntry.IsDir())
-        {
-        sourcePath.Append(_L("\\"));
-    
-        // do the operation for a directory entry
-        err = FileOpRmDir(sourcePath, 0);
-        }
-
-    else
-        {
-        // do the operation for a file entry
-        err = FileOpDeleteFile(sourcePath, 0);
-        }
-    if ( !iOperationError && iFileManObserverResult == MFileManObserver::ECancel )
-        {
-        iOperationError = KErrCancel;
-        }
-    return iOperationError; 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpDeleteFile(const TDesC& aName, TUint aSwitch) 
-    {
-    TInt err = DoFileOpDeleteFile(aName, aSwitch);
-
-    // if locked, unlock the file and retry
-    if (iModel->Settings().iRemoveFileLocks && err == KErrInUse)
-        {
-        // try to remove the file lock by activating secure backup mode
-        if (ActivateSecureBackUpViaFileOp() == KErrNone)
-            {
-            // try the operation several times
-            for (TInt i=0; i<KMaxFileLockAttempts; i++)
-                {
-                err = DoFileOpDeleteFile(aName, aSwitch);
-                
-                if (err != KErrInUse)
-                    break;
-                else
-                    User::After(KSecureBackupLoopDelay);
-                }
-            }
-        }
-
-    // if write protected or system file, remove protections and retry
-    else if (iModel->Settings().iIgnoreProtectionsAtts && (err == KErrAccessDenied || err == KErrNotFound))
-        {
-        // remove protections  and try again
-        if (FileOpAttribs(aName, 0, KEntryAttReadOnly|KEntryAttSystem|KEntryAttHidden, 0, 0) == KErrNone)
-            {
-            err = DoFileOpDeleteFile(aName, aSwitch);
-            }
-        }
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-
-    LOGSTRING3("FileBrowser: FileOpDeleteFile %S, err=%d", &aName, err);
-        
-    return err; 
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFileOpDeleteFile(const TDesC& aName, TUint aSwitch) 
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->Delete(aName, aSwitch);
-        }
-    else
-        {
-    #endif
-        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-        TInt result = iFileMan->Delete( aName, aSwitch, waiter->iStatus );
-        waiter->StartAndWait();
-        if ( iFileManObserverResult == MFileManObserver::ECancel ) result = KErrCancel;
-        if ( !result ) result = waiter->Result();
-        CleanupStack::PopAndDestroy( waiter );
-        return result;
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpRmDir(const TDesC& aName, TUint aSwitch) 
-    {
-    TInt err = DoFileOpRmDir(aName, aSwitch);
-
-    // if write protected or system directory, remove protections and retry
-    if (iModel->Settings().iIgnoreProtectionsAtts && (err == KErrAccessDenied || err == KErrInUse))
-        {
-        // remove protections and try again
-        if (FileOpAttribs(aName.Left(aName.Length()-1), 0, KEntryAttReadOnly|KEntryAttSystem|KEntryAttHidden, 0, 0) == KErrNone)
-            {
-            err = DoFileOpRmDir(aName, aSwitch);
-            }
-        }
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-
-    LOGSTRING3("FileBrowser: FileOpRmDir %S, err=%d", &aName, err);
-        
-    return err; 
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFileOpRmDir(const TDesC& aDirName, TUint aSwitch)
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->RmDir(aDirName, aSwitch);
-        }
-    else
-        {
-    #endif
-        if ( aSwitch & CFileMan::ERecurse )
-            {
-            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-            TInt result = iFileMan->RmDir( aDirName, waiter->iStatus );
-            waiter->StartAndWait();
-            if ( iFileManObserverResult == MFileManObserver::ECancel ) result = KErrCancel;
-            if ( !result ) result = waiter->Result();
-            CleanupStack::PopAndDestroy( waiter);
-            return result;
-            }
-        else
-            return iFs.RmDir(aDirName);    
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-   }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::MkDirAll(const TDesC& aPath, TInt aSetAtts, TBool aQuickOperation) 
-    {
-    iFileManObserverResult = MFileManObserver::EContinue;
-    if (aQuickOperation)
-        return DoFileOpMkDirAll(aPath);
-    else
-        return FileOpMkDirAll(aPath, aSetAtts);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpMkDirAll(const TDesC& aPath, TInt aSetAtts) 
-    {
-    TInt err = DoFileOpMkDirAll(aPath);
-
-    // if the directory already exists, it is not an error    
-    if (err == KErrAlreadyExists)
-        err = KErrNone;
-    
-    
-    // set attributes for directory just created
-    if (aSetAtts > 0 && err == KErrNone && aPath.Length() > 3)
-        {
-        // a path has a trailing backslash so it needs to be removed before the call
-        err = FileOpAttribs(aPath.Left(aPath.Length()-1), aSetAtts, 0, 0, 0);
-        }
-    
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-    
-    LOGSTRING3("FileBrowser: FileOpMkDirAll %S, err=%d", &aPath, err);
-    
-    return err;
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DoFileOpMkDirAll(const TDesC& aPath) 
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->MkDirAll(aPath);
-        }
-    else
-        {
-    #endif
-        return iFs.MkDirAll(aPath);
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::CreateEmptyFile(const TDesC& aName) 
-    {
-    return DoFileOpCreateEmptyFile(aName);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::FileOpCreateEmptyFile(const TDesC& aName) 
-    {
-    TInt err = DoFileOpCreateEmptyFile(aName);
-
-    // remember the "lowest" error
-    if (err < iOperationError)
-        iOperationError = err;
-    
-    LOGSTRING3("FileBrowser: FileOpCreateEmptyFile %S, err=%d", &aName, err);
-    
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-TInt CFileBrowserFileOps::DoFileOpCreateEmptyFile(const TDesC& aName) 
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();   
-
-        return iFileOpClient->CreateEmptyFile(aName);
-        }
-    else
-        {
-    #endif
-        TInt err(KErrNone);
-            
-        RFile newFile;
-        err = newFile.Create(iFs, aName, EFileShareExclusive);
-        if (err == KErrNone)
-            err = newFile.Flush(); 
-        newFile.Close();
-        
-        return err; 
-    #ifndef FILEBROWSER_LITE
-        }    
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::DriveSnapShot(TChar aSourceDriveLetter, TChar aTargetDriveLetter)
-    {
-    TInt err(KErrNone);
-    iFileManObserverResult = MFileManObserver::EContinue;
-    
-    // remember old settings and force them to be true for this operation
-    TBool currentRemoveFileLocksValue = iModel->Settings().iRemoveFileLocks;
-    TBool currentIgnoreProtectionAttsValue = iModel->Settings().iIgnoreProtectionsAtts;
-    TBool currentRemoveROMWriteProrection = iModel->Settings().iRemoveROMWriteProrection;
-    iModel->Settings().iRemoveFileLocks = ETrue;
-    iModel->Settings().iIgnoreProtectionsAtts = ETrue;
-    iModel->Settings().iRemoveROMWriteProrection = ETrue;
-
-    
-    TFileName sourceDir;
-    sourceDir.Append(aSourceDriveLetter);
-    sourceDir.Append(_L(":"));
-
-    _LIT(KTargetDir, "%c:\\SnapShot_%c_drive");
-    TFileName targetDir;
-    targetDir.Format(KTargetDir, TUint(aTargetDriveLetter), TUint(aSourceDriveLetter));            
-
-    // remove any existing content, first get TEntry
-    TEntry entry;
-    err = iFs.Entry(targetDir, entry);
-
-    // entry directory exists, delete it
-    if (err == KErrNone && entry.IsDir())
-        {
-        TFileName targetRoot;
-        targetRoot.Append(aTargetDriveLetter);
-        targetRoot.Append(_L(":\\"));
-
-        TFileEntry targetEntry;
-        targetEntry.iPath = targetRoot;
-        targetEntry.iEntry = entry;
-
-        err = Delete(targetEntry, CFileMan::ERecurse);                
-        }
-        
-    // do not care if removing succeeded or not, just continue with copying    
-    TEntry fakeEntry;
-    fakeEntry.iAtt |= KEntryAttDir;
-
-    TFileEntry sourceEntry;
-    sourceEntry.iPath = sourceDir;
-    sourceEntry.iEntry = fakeEntry;
-
-    err = Copy(sourceEntry, targetDir, CFileMan::ERecurse|CFileMan::EOverWrite);                
-
-
-    // restore back settings
-    iModel->Settings().iRemoveFileLocks = currentRemoveFileLocksValue;
-    iModel->Settings().iIgnoreProtectionsAtts = currentIgnoreProtectionAttsValue;    
-    iModel->Settings().iRemoveROMWriteProrection = currentRemoveROMWriteProrection;    
-
-
-    return iOperationError;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::EraseMBR(TUint aDriveNumber) 
-    {
-    #ifndef FILEBROWSER_LITE
-
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();
-        
-        return iFileOpClient->EraseMBR(aDriveNumber);
-
-    #else
-        return KErrNotSupported;
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileOps::PartitionDrive(TUint aDriveNumber, TUint aNumberOfPartitions) 
-    {
-    #ifndef FILEBROWSER_LITE
-
-        if (!iFileOpClient)
-            iFileOpClient = CFBFileOpClient::NewL();
-        
-        return iFileOpClient->PartitionDrive(aDriveNumber, aNumberOfPartitions);
-
-    #else
-        return KErrNotSupported
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManStarted()
-    {
-    return iFileManObserverResult;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManOperation()
-    {
-    return iFileManObserverResult;
-    }
-// --------------------------------------------------------------------------------------------
-
-MFileManObserver::TControl CFileBrowserFileOps::NotifyFileManEnded()
-    {
-    return iFileManObserverResult;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileOps::CancelOp()
-    {
-#ifndef FILEBROWSER_LITE
-
-    if ( iModel->Settings().iBypassPlatformSecurity )
-        {
-        if ( !iFileOpClient )
-            iFileOpClient = CFBFileOpClient::NewL();
-        
-        iFileOpClient->CancelOp();
-        }
-
-    // we need this information even when using iFileOpClient
-    // to be able to not execute aggregate operations 
-    iFileManObserverResult = MFileManObserver::ECancel;
-    
-#else
-    iFileManObserverResult = MFileManObserver::ECancel;
-#endif
-    }
-
-// End of File
--- a/filebrowser/src/FBFileUtils.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5147 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBFileUtils.h"
-#include "FBFileOps.h"
-#include "FBModel.h"
-#include "FBFileDlgs.h"
-#include "FBFileEditor.h"
-#include "FBFileListContainer.h"
-#include "FB.hrh"
-#include <filebrowser.rsg>
-
-#include <textresolver.h> 
-#include <AknWaitDialog.h>
-#include <AknProgressDialog.h>
-#include <eikprogi.h>
-#include <f32file.h>
-#include <eikfutil.h>
-#include <apparc.h>
-#include <eikenv.h>
-#include <bautils.h>
-#include <AknIconArray.h>
-#include <gulicon.h>
-#include <AknsUtils.h>
-#include <AknsItemID.h>
-#include <aknconsts.h>
-#include <aknnotewrappers.h>
-#include <AknProgressDialog.h> 
-#include <aknPopup.h>
-#include <aknmessagequerydialog.h>
-#include <AknGlobalNote.h>
-#include <babackup.h> 
-#include <avkon.mbg>
-#include <aknmemorycardui.mbg>
-#include <sendui.h>
-#include <CMessageData.h>
-#include <ezgzip.h>
-#include <e32hal.h>
-#include <pathinfo.h>
-#include <apgcli.h>
-#include <apmstd.h>
-#include <apgtask.h>
-#include <apacmdln.h>
-#include <DocumentHandler.h>
-#include <AknOpenFileService.h>
-#include <msvapi.h>
-#include <msvids.h>
-#include <msvstd.h>
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <cmsvattachment.h>
-#include <hash.h>
-#include <connect/sbeclient.h>
-#include <e32property.h>
-#if (!defined __SERIES60_30__ && !defined __SERIES60_31__) 
-#include <driveinfo.h>
-#endif // !defined __SERIES60_30__ && !defined __SERIES60_31__
-
-#ifndef __SERIES60_30__
-  #include <akniconconfig.h>
-#endif
-
-_LIT(KGZipExt, ".gz");
-_LIT8(KFileNewLine, "\r\n");
-const TInt KForcedFormatTimeout = 1000000;
-
-// copied from coreapplicationuisdomainpskeys.h
-const TUid KPSUidCoreApplicationUIs = { 0x101F8767 };
-const TUint32 KCoreAppUIsMmcRemovedWithoutEject = 0x00000109;
-enum TCoreAppUIsMmcRemovedWithoutEject
-    {
-    ECoreAppUIsEjectCommandUsedUninitialized = 0,
-    ECoreAppUIsEjectCommandNotUsed,
-    ECoreAppUIsEjectCommandUsed,
-    ECoreAppUIsEjectCommandUsedToDrive // Low 16-bits contain this value and high 16-bits TDriveNumber to eject
-    };
-const TInt KDriveLetterStringLength = 3; // e.g. C:\
-
-// ================= MEMBER FUNCTIONS =======================
-
-CFileBrowserFileUtils* CFileBrowserFileUtils::NewL(CFileBrowserModel* aModel)
-	{
-	CFileBrowserFileUtils* self = new(ELeave) CFileBrowserFileUtils(aModel);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileUtils::CFileBrowserFileUtils(CFileBrowserModel* aModel) : CActive(EPriorityStandard), iModel(aModel)
-	{
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ConstructL()
-	{
-    User::LeaveIfError(iTimer.CreateLocal());
-    User::LeaveIfError(iFs.Connect());
-    User::LeaveIfError(iTz.Connect());
-    
-    iState = EIdle;
-    iListingMode = ENormalEntries;
-
-    iSortMode = EFileBrowserCmdViewSortByName;
-    iOrderMode = EFileBrowserCmdViewOrderAscending;
-    iCurrentPath = KNullDesC;
-    
-    iFileOps = CFileBrowserFileOps::NewL(iModel);
-    
-    iDriveEntryList = new(ELeave) CDriveEntryList(8);
-    iFileEntryList = new(ELeave) CFileEntryList(64);
-    iFindFileEntryList = new(ELeave) CFileEntryList(64);
-    iAppIconList = new(ELeave) CAppIconList(16);
-    iClipBoardList = new(ELeave) CFileEntryList(64);
-
-    iDocHandler = CDocumentHandler::NewL();
-    iDocHandler->SetExitObserver(this);
-    
-    // set defaults to the search settings
-    iSearchAttributes.iSearchDir = KNullDesC;
-    iSearchAttributes.iWildCards = _L("*.jpg");
-    iSearchAttributes.iTextInFile = KNullDesC;
-    iSearchAttributes.iMinSize = 0;
-    iSearchAttributes.iMaxSize = 999999999;
-    iSearchAttributes.iMinDate = TDateTime(1980, EJanuary,   0,0,0,0,0);
-    iSearchAttributes.iMaxDate = TDateTime(2060, EDecember, 30,0,0,0,0);
-    iSearchAttributes.iRecurse = ETrue;
-    
-    // init the command array
-    iCommandArray = new(ELeave) CCommandArray(64);
-        
-    // get current path from settings
-    if (iModel->Settings().iRememberLastPath)
-        {
-        TFileName settingPath = iModel->Settings().iLastPath;
-        if (BaflUtils::PathExists(iFs, settingPath))
-            iCurrentPath = settingPath;
-        
-        if (iCurrentPath != KNullDesC)
-            GetDriveListL();
-        }
-
-	CActiveScheduler::Add(this);
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserFileUtils::~CFileBrowserFileUtils()
-	{
-	Cancel();
-	
-	// save current path from settings
-    if (iModel->Settings().iRememberLastPath)
-        {
-        iModel->Settings().iLastPath = iCurrentPath;
-        TRAP_IGNORE(iModel->SaveSettingsL(EFalse));
-        }
-
-    if (iWaitDialog)
-        TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); 
-     
-    if (iProgressDialog)
-        TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
-    
-    delete iFileOps;    
-   
-	delete iDocHandler;
-	
-	if (iOpenFileService)
-	    delete iOpenFileService;
-	
-	delete iClipBoardList;
-	delete iAppIconList;
-	delete iFindFileEntryList;
-    delete iFileEntryList;
-    delete iDriveEntryList;
-    
-    delete iFileMan;
-    
-    if (iCommandArray)
-        {
-        ResetCommandArray();
-        delete iCommandArray;
-        }
-        
-    iTz.Close();
-	iFs.Close();
-	iTimer.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DoCancel()
-	{
-    iTimer.Cancel();
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::StartExecutingCommandsL(const TDesC& aLabel)
-    {
-    if (iCommandArray->Count() >= 2)
-        {
-        // init progress bar
-        iProgressDialog = new(ELeave) CAknProgressDialog((reinterpret_cast<CEikDialog**>(&iProgressDialog)), ETrue);
-        iProgressDialog->SetCallback(this);
-        iProgressDialog->PrepareLC(R_GENERAL_PROGRESS_NOTE);
-        iProgressDialog->SetCurrentLabelL( EAknCtNote, aLabel );
-        iProgressInfo = iProgressDialog->GetProgressInfoL();
-        iProgressInfo->SetFinalValue( CommandArrayCount() );
-        iProgressDialog->RunLD();
-        iProgressDialog->MakeVisible( ETrue );        
-        }
-    else if (iCommandArray->Count() >= 1)
-        {
-        // init wait dialog
-        iWaitDialog = new(ELeave) CAknWaitDialog((reinterpret_cast<CEikDialog**>(&iWaitDialog)), ETrue);
-        iWaitDialog->SetCallback(this);
-        iWaitDialog->PrepareLC(R_GENERAL_WAIT_NOTE);
-        iWaitDialog->SetTextL( aLabel );
-        iWaitDialog->RunLD();
-        }
-    else
-        {
-        // no commands, just do nothing
-        return;
-        }
-
-
-    // start with the first operation
-    iCurrentEntry = 0;
-    iSucceededOperations = 0;
-    iFailedOperations = 0;
-
-    // starts executing commands
-    ExecuteCommand();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ExecuteCommand()
-    {
-    // make sure the engine isn't active, should never happen
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("FileUtils:IsActive"), 333));
-
-    // execute a command after a very short delay (25ms)
-    iTimer.After(iStatus, 25);
-    SetActive();
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-void CFileBrowserFileUtils::RunL()
-    {
-    TInt err(KErrNone);
-    TInt currentCommand = iCommandArray->At(iCurrentEntry).iCommandId;
-
-    // execute a command from the queue
-    switch(currentCommand)
-        {
-        case EFileBrowserFileOpCommandAttribs:
-            {
-            CCommandParamsAttribs* params = static_cast<CCommandParamsAttribs*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->Attribs(params->iSourceEntry, params->iSetMask, params->iClearMask, params->iTime, params->iSwitch);
-            }
-            break;
-            
-        case EFileBrowserFileOpCommandCopy:
-            {
-            CCommandParamsCopyOrMove* params = static_cast<CCommandParamsCopyOrMove*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->Copy(params->iSourceEntry, params->iTargetPath, params->iSwitch);
-            }
-            break;
-            
-        case EFileBrowserFileOpCommandMove:
-            {
-            CCommandParamsCopyOrMove* params = static_cast<CCommandParamsCopyOrMove*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->Copy(params->iSourceEntry, params->iTargetPath, params->iSwitch, ETrue);
-            }
-            break;
-                
-        case EFileBrowserFileOpCommandRename:
-            {
-            CCommandParamsRename* params = static_cast<CCommandParamsRename*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->Rename(params->iSourceEntry, params->iTargetPath, params->iSwitch);
-            }
-            break;
-
-        case EFileBrowserFileOpCommandDelete:
-            {
-            CCommandParamsDelete* params = static_cast<CCommandParamsDelete*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->Delete(params->iSourceEntry, params->iSwitch);
-            }
-            break;
-
-        case EFileBrowserFileOpCommandDriveSnapShot:
-            {
-            CCommandParamsDriveSnapShot* params = static_cast<CCommandParamsDriveSnapShot*>(iCommandArray->At(iCurrentEntry).iParameters);
-            err = iFileOps->DriveSnapShot(params->iSourceDriveLetter, params->iTargetDriveLetter);
-            }
-            break;
-                                                
-        default:
-            User::Panic (_L("Unknown command"), 400);
-            break;
-        }
-
-    
-    if (err == KErrNone)
-        {
-        iSucceededOperations++;
-        }
-    else if ( err != KErrCancel )
-        {
-        iFailedOperations++;
-        }
-        
-    iLastError = err;            
-
-    // check for more commands in queue
-    TRAP_IGNORE( CheckForMoreCommandsL() );
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::RunError(TInt aError)
-    {
-    _LIT(KMessage, "Command error %d");
-    TBuf<128> noteMsg;
-    noteMsg.Format(KMessage, aError);
-            
-    iModel->EikonEnv()->InfoMsg(noteMsg);
-    
-    TRAP_IGNORE( CheckForMoreCommandsL() );
-    
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::CheckForMoreCommandsL()
-    {
-    //LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL");
-    
-    // update the progress bar
-    if (iProgressInfo)
-        iProgressInfo->IncrementAndDraw(1);
-
-	// check if we have more commands to be executed
-	if (iCurrentEntry >= CommandArrayCount() - 1)
-		{
-        //LOGSTRING("Creator: CCreatorEngine::CheckForMoreCommandsL all done");
-
-        // all done, free resources
-        ResetCommandArray();
-        
-        // deactive secure backup if it was activated by a file command
-        iFileOps->DeActivateSecureBackUpViaFileOp();
-
-        // dismiss any wait/progress dialogs        
-        if (iWaitDialog)
-            {
-            TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); 
-            iWaitDialog = NULL;
-            }
-        if (iProgressDialog)
-            {
-            TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
-            iProgressDialog = NULL;
-            }
-
-
-        // show result note
-        if ( iSucceededOperations == 0 && iFailedOperations == 0 )
-            {
-            // single operation cancelled -> show nothing
-            }
-        else if (iSucceededOperations == 1 && iFailedOperations == 0)    
-            {
-            _LIT(KMessage, "Operation succeeded");
-    		CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-    		note->ExecuteLD(KMessage);
-            }
-        else if (iSucceededOperations > 0 && iFailedOperations == 0)    
-            {
-            _LIT(KMessage, "%d operations succeeded");
-            TBuf<128> noteMsg;
-            noteMsg.Format(KMessage, iSucceededOperations);
-            
-    		CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-    		note->ExecuteLD(noteMsg);
-            }
-        else if (iSucceededOperations == 0 && iFailedOperations > 1)    
-            {
-            _LIT(KMessage, "%d operations failed");
-            TBuf<128> noteMsg;
-            noteMsg.Format(KMessage, iFailedOperations);
-            
-    		CAknErrorNote* note = new(ELeave) CAknErrorNote;
-    		note->ExecuteLD(noteMsg);
-            }
-        else if (iSucceededOperations > 0 && iFailedOperations > 0)    
-            {
-            _LIT(KMessage, "%d operations succeeded, %d failed");
-            TBuf<128> noteMsg;
-            noteMsg.Format(KMessage, iSucceededOperations, iFailedOperations);
-            
-    		CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    		note->ExecuteLD(noteMsg);
-            }
-        else    
-            {
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(iLastError, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver    
-            }
-
-        RefreshViewL();
-
-		}
-	else
-		{
-		// maintain requests
-		iCurrentEntry++;
-
-        //LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
-
-        ExecuteCommand();
-		}
-    }    
-// --------------------------------------------------------------------------------------------
-
-// This callback function is called when cancel button of the progress bar was pressed
-void CFileBrowserFileUtils::DialogDismissedL(TInt aButtonId)
-    {
-    iProgressDialog = NULL;
-    iProgressInfo = NULL;
-    iWaitDialog = NULL;
-    
-    // check if cancel button was pressed
-    if (aButtonId == EAknSoftkeyCancel)
-        {
-        // cancel the active object, command executer 
-        Cancel();
-        
-        iFileOps->CancelOp();
-        
-        ResetCommandArray();
-
-	    CAknInformationNote* note = new (ELeave) CAknInformationNote;
-	    note->ExecuteLD(_L("Cancelled"));
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::AppendToCommandArrayL(TInt aCommand, CCommandParamsBase* aParameters)
-    {
-    if (iCommandArray)
-        iCommandArray->AppendL( TCommand(aCommand, aParameters) );
-    else
-        User::Leave(KErrNotReady);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::CommandArrayCount() const
-    {
-    TInt count(0);
-    
-    if (iCommandArray)
-        count = iCommandArray->Count();
-    
-    return count;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ResetCommandArray()
-    {
-    // delete params first
-    for (TInt i=0; i<CommandArrayCount(); i++)
-        {
-        if ( iCommandArray->At(i).iParameters )
-            {
-            delete iCommandArray->At(i).iParameters;
-            iCommandArray->At(i).iParameters = NULL;
-            }
-        }
-
-    // reset the entries
-    iCommandArray->Reset();
-    }
-                    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::HandleSettingsChangeL()
-    {
-    if (iModel->FileListContainer())
-        {
-        iModel->FileListContainer()->SetScreenLayoutL(iModel->Settings().iDisplayMode); 
-        iModel->FileListContainer()->CreateListBoxL(iModel->Settings().iFileViewMode);
-        //iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetSortModeL(TInt aSortMode)
-    {
-    iSortMode = aSortMode;
-    RefreshViewL();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetOrderModeL(TInt aOrderMode)
-    {
-    iOrderMode = aOrderMode;
-    RefreshViewL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CFileBrowserFileUtils::HandleOfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-    
-    TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift) ||
-                            (aKeyEvent.iModifiers & EModifierLeftShift) ||
-                            (aKeyEvent.iModifiers & EModifierRightShift);
-    TBool controlKeyPressed = (aKeyEvent.iModifiers & EModifierCtrl) || 
-                              (aKeyEvent.iModifiers & EModifierRightCtrl); 
-    
-    // handle left arrow key press
-    if (aKeyEvent.iCode == EKeyLeftArrow)
-        {
-        MoveUpOneLevelL();
-        return EKeyWasConsumed;
-        }
-    
-    // handle right arrow key press
-    else if (aKeyEvent.iCode == EKeyRightArrow)
-        {
-        if (IsDriveListViewActive() && iDriveEntryList->Count() > 0)
-            {
-            MoveDownToDirectoryL();
-            return EKeyWasConsumed;
-            }
-        else if (iFileEntryList->Count() > 0)
-            {
-            MoveDownToDirectoryL();
-            return EKeyWasConsumed;
-            }        
-        }    
-
-    // skip OK/Enter keys when shift or ctrl is pressed because those are needed by the listbox
-    else if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) && (shiftKeyPressed || controlKeyPressed))
-        {
-        return EKeyWasNotConsumed;
-        }
-    
-    // handle OK/Enter keys
-    else if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
-        {
-        if (IsDriveListViewActive() && iDriveEntryList->Count() > 0)
-            {
-            MoveDownToDirectoryL();
-            return EKeyWasConsumed;
-            }
-        else if (iFileEntryList->Count() > 0)
-            {
-            TFileEntry fileEntry = iFileEntryList->At(iModel->FileListContainer()->CurrentListBoxItemIndex());
-            
-            if (fileEntry.iEntry.IsDir())
-                MoveDownToDirectoryL();
-            else
-                OpenCommonFileActionQueryL();
-            
-            return EKeyWasConsumed;
-            } 
-        }
-    
-    // handle Delete/Backspace keys
-    else if (!iModel->FileListContainer()->SearchField() && (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete) &&
-             !iModel->FileUtils()->IsCurrentDriveReadOnly() && !iModel->FileUtils()->IsDriveListViewActive())
-        {
-        DeleteL();
-        return EKeyWasConsumed;
-        }
-                          
-    return EKeyWasNotConsumed;
-    }        
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::RefreshViewL()
-    {
-    if (iModel->FileListContainer())
-        {
-        // update navi pane text        
-        if (iListingMode == ENormalEntries)
-            iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
-        else if (iListingMode == ESearchResults)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Search results"));
-        else if (iListingMode == EOpenFiles)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Open files"));
-        else if (iListingMode == EMsgAttachmentsInbox)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Inbox"));
-        else if (iListingMode == EMsgAttachmentsDrafts)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Drafts"));
-        else if (iListingMode == EMsgAttachmentsSentItems)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Sent Items"));
-        else if (iListingMode == EMsgAttachmentsOutbox)
-            iModel->FileListContainer()->SetNaviPaneTextL(_L("Attachments in Outbox"));
-
-        // create a list box if it doesn't already exist
-        if (!iModel->FileListContainer()->ListBox())
-            iModel->FileListContainer()->CreateListBoxL(iModel->Settings().iFileViewMode);
-        
-        // clear selections if any
-        iModel->FileListContainer()->ListBox()->ClearSelection();
-
-        // make sure that the search field is disabled
-        iModel->FileListContainer()->DisableSearchFieldL();
-        
-        // read directory listing
-        GenerateDirectoryDataL();
-        
-        // set an icon array
-        iModel->FileListContainer()->SetListBoxIconArrayL(GenerateIconArrayL());
-
-        // set text items
-        iModel->FileListContainer()->SetListBoxTextArrayL(GenerateItemTextArrayL());
-
-        // make sure that the current item index is not out of array
-        if (iModel->FileListContainer()->CurrentListBoxItemIndex() == -1 && // -1 is a hardcoded value meaning that no current item index
-                iModel->FileListContainer()->ListBox()->Model()->NumberOfItems() > 0)  
-            iModel->FileListContainer()->ListBox()->SetCurrentItemIndex( iModel->FileListContainer()->ListBox()->Model()->NumberOfItems() - 1 );    
-
-        }
-    
-        iModel->FileListContainer()->UpdateToolbar();
-    }   
-    
-// --------------------------------------------------------------------------------------------
-
-CAknIconArray* CFileBrowserFileUtils::GenerateIconArrayL(TBool aGenerateNewBasicIconArray)
-    {
-    CAknIconArray* iconArray = NULL;
-    
-    if (aGenerateNewBasicIconArray)
-        {
-        iconArray = new(ELeave) CAknIconArray(16);    
-        }
-    else
-        {
-        if (iModel->FileListContainer())
-            iconArray = iModel->FileListContainer()->ListBoxIconArrayL();
-        
-        if (!iconArray)    
-            iconArray = new(ELeave) CAknIconArray(16);
-        }
-
-        
-    CleanupStack::PushL(iconArray);
-    
-    // generate basic items if not already existing
-    if (iconArray->Count() < EFixedIconListLength)
-        {
-        // reset arrays
-        iconArray->Reset();
-        iAppIconList->Reset();
-        
-        // get default control color
-        TRgb defaultColor;
-        defaultColor = iModel->EikonEnv()->Color(EColorControlText);
-        
-        // create a color icon of the marking indicator
-        CFbsBitmap* markBitmap = NULL;
-        CFbsBitmap* markBitmapMask = NULL;
-
-        AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
-                KAknsIIDQgnIndiMarkedAdd,
-                KAknsIIDQsnIconColors,
-                EAknsCIQsnIconColorsCG13,
-                markBitmap,
-                markBitmapMask,
-                AknIconUtils::AvkonIconFileName(),
-                EMbmAvkonQgn_indi_marked_add,
-                EMbmAvkonQgn_indi_marked_add_mask,
-                defaultColor
-                );
-         
-        // 0 marking indicator
-        CGulIcon* markIcon = CGulIcon::NewL(markBitmap, markBitmapMask);
-        iconArray->AppendL(markIcon);                       
-
-        // 1 empty
-        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
-                                  EMbmAvkonQgn_prop_empty, EMbmAvkonQgn_prop_empty_mask, KAknsIIDQgnPropEmpty);
-        // 2 phone memory
-        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
-                                  EMbmAvkonQgn_prop_phone_memc, EMbmAvkonQgn_prop_phone_memc_mask, KAknsIIDQgnPropPhoneMemc);
-        // 3 memory card
-        AppendGulIconToIconArrayL(iconArray, KMemoryCardUiBitmapFile,
-                                  EMbmAknmemorycarduiQgn_prop_mmc_memc, EMbmAknmemorycarduiQgn_prop_mmc_memc_mask, KAknsIIDQgnPropMmcMemc);
-        // 4 memory card disabled
-        AppendGulIconToIconArrayL(iconArray, KMemoryCardUiBitmapFile,
-                                  EMbmAknmemorycarduiQgn_prop_mmc_non, EMbmAknmemorycarduiQgn_prop_mmc_non_mask, KAknsIIDQgnPropMmcNon);
-        // 5 folder
-        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
-                                  EMbmAvkonQgn_prop_folder_small, EMbmAvkonQgn_prop_folder_small_mask, KAknsIIDQgnPropFolderSmall);
-        // 6 folder with subfolders
-        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
-                                  EMbmAvkonQgn_prop_folder_sub_small, EMbmAvkonQgn_prop_folder_sub_small_mask, KAknsIIDQgnPropFolderSubSmall);
-        // 7 current folder
-        AppendGulIconToIconArrayL(iconArray, AknIconUtils::AvkonIconFileName(),
-                                  EMbmAvkonQgn_prop_folder_current, EMbmAvkonQgn_prop_folder_current_mask, KAknsIIDQgnPropFolderCurrent);
-        }
-
-    // append custom icons if not in drive list view and setting is enabled
-    if (!aGenerateNewBasicIconArray && !IsDriveListViewActive() && iModel->Settings().iShowAssociatedIcons)
-        {
-        // init id counter
-        TInt idCounter(EFixedIconListLength + iAppIconList->Count());
-        
-        // loop all items in the file list
-        for (TInt i=0; i<iFileEntryList->Count(); i++)
-            {
-            TFileEntry& fileEntry = iFileEntryList->At(i);
-
-            // just check for normal files            
-            if (!fileEntry.iEntry.IsDir())     
-                {
-                TUid appUid = GetAppUid(fileEntry);
-                TInt iconId = AppIconIdForUid(appUid);
-                
-                if (appUid != KNullUid && iconId == KErrNotFound)
-                    {
-                    // icon not found from the icon array, generate it
-                    CFbsBitmap* bitmap = NULL;
-                    CFbsBitmap* mask = NULL;
-                    CGulIcon* appIcon = NULL;
-        
-                    TRAPD(err, 
-                        AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), appUid, EAknsAppIconTypeList, bitmap, mask);
-                        appIcon = CGulIcon::NewL(bitmap, mask);
-                        CleanupStack::Pop(2); //bitmap, mask
-                        );
-                         
-                    if (err == KErrNone)
-                        {
-                        TAppIcon appIconEntry;
-                        appIconEntry.iId = idCounter;
-                        appIconEntry.iUid = appUid;
-                        
-                        appIcon->SetBitmapsOwnedExternally(EFalse);
-                        iconArray->AppendL(appIcon);
-                        iAppIconList->AppendL(appIconEntry);
-
-                        fileEntry.iIconId = idCounter;
-                                                
-                        idCounter++;      
-                        }
-                    else
-                        {
-                        delete bitmap;
-                        delete mask;
-		
-                        TAppIcon appIconEntry;
-                        appIconEntry.iId = EFixedIconEmpty;
-                        appIconEntry.iUid = appUid;
-                        
-                        iAppIconList->AppendL(appIconEntry);
-                        }
-                    }
-
-                else if (appUid != KNullUid && iconId >= 0)
-                    {
-                    // we already have already generated an icon for this uid, use it
-                    fileEntry.iIconId = iconId;
-                    }
-                }
-            }
-        }
-
-    CleanupStack::Pop(); //iconArray
-    return iconArray;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::AppendGulIconToIconArrayL(CAknIconArray* aIconArray, const TDesC& aIconFile, TInt aIconId, TInt aMaskId, const TAknsItemID aAknsItemId)
-    {
-    CGulIcon* icon = AknsUtils::CreateGulIconL(
-            AknsUtils::SkinInstance(),
-            aAknsItemId,
-            aIconFile,
-            aIconId,
-            aMaskId);
-    CleanupStack::PushL(icon);
-	
-	icon->SetBitmapsOwnedExternally(EFalse);
-	aIconArray->AppendL(icon);
-	
-	CleanupStack::Pop(); //icon          
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::AppIconIdForUid(TUid aUid)
-    {
-    TInt result(KErrNotFound);
-    
-    for (TInt i=0; i<iAppIconList->Count(); i++)
-        {
-        if (iAppIconList->At(i).iUid == aUid)
-            {
-            result = iAppIconList->At(i).iId;
-            break;
-            }
-        }
-    
-    return result;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TUid CFileBrowserFileUtils::GetAppUid(TFileEntry aFileEntry)
-    {
-    TFileName fullPath;
-    fullPath.Copy(aFileEntry.iPath);
-    fullPath.Append(aFileEntry.iEntry.iName);
-    
-    TParse parsedName;
-    parsedName.Set(fullPath, NULL, NULL);
-
-    // this will boost performance in \sys\bin folder    
-    if (parsedName.Ext().CompareF(_L(".dll")) == 0 || parsedName.Ext().CompareF(_L(".rsc")) == 0)
-        return KNullUid;
-    
-    TInt err1(KErrNone), err2(KErrNone);
-    TUid appUid;
-    TDataType dataType;
-    TBool isProgram;
-    
-    err1 = iModel->LsSession().AppForDocument(fullPath, appUid, dataType);
-    err2 = iModel->LsSession().IsProgram(fullPath, isProgram);
-        
-    if (err1 == KErrNone && err2 == KErrNone)
-        {
-        if (isProgram)
-            {
-            // get the real app Uid from the app list
-            TApaAppInfo appInfo;
-            iModel->LsSession().GetAllApps();
-
-            while (iModel->LsSession().GetNextApp(appInfo) == KErrNone)
-                {
-                if (fullPath.CompareF(appInfo.iFullName) == 0)
-                    return appInfo.iUid;
-                }
-            }
-        else
-            {
-            // return the app Uid associated for it
-            return appUid;
-            }            
-        }
-
-    return KNullUid;
-    }
-// --------------------------------------------------------------------------------------------
-
-CDesCArray* CFileBrowserFileUtils::GenerateItemTextArrayL()
-    {
-    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(64);
-    CleanupStack::PushL(textArray);
-
-    if (IsDriveListViewActive())
-        {
-        _LIT(KSimpleDriveEntry, "%d\t%c: <%S>\t\t");
-        _LIT(KExtendedDriveEntry, "%d\t%c: <%S>\t%LD / %LD kB\t");
-
-        for (TInt i=0; i<iDriveEntryList->Count(); i++)
-            {
-            TFileName textEntry;
-            TDriveEntry driveEntry = iDriveEntryList->At(i);
-            
-            if (iModel->Settings().iFileViewMode == EFileViewModeSimple)
-                {
-                textEntry.Format(KSimpleDriveEntry, driveEntry.iIconId, TUint(driveEntry.iLetter), &driveEntry.iMediaTypeDesc);
-                }
-            else if (iModel->Settings().iFileViewMode == EFileViewModeExtended)
-                {
-                textEntry.Format(KExtendedDriveEntry, driveEntry.iIconId, TUint(driveEntry.iLetter), &driveEntry.iMediaTypeDesc, driveEntry.iVolumeInfo.iFree/1024, driveEntry.iVolumeInfo.iSize/1024);
-                }
-            
-            textArray->AppendL(textEntry);
-            }
-        }
-    
-    else
-        {
-        _LIT(KSimpleFileEntry, "%d\t%S\t\t");
-        _LIT(KExtendedFileEntry, "%d\t%S\t%S\t");
-
-        for (TInt i=0; i<iFileEntryList->Count(); i++)
-            {
-            TBuf<KMaxPath+KMaxFileName> textEntry;
-            TFileEntry fileEntry = iFileEntryList->At(i);
-            
-            // format text line entries            
-            if (iModel->Settings().iFileViewMode == EFileViewModeSimple)
-                {
-                textEntry.Format(KSimpleFileEntry, fileEntry.iIconId, &fileEntry.iEntry.iName);
-                }
-            else if (iModel->Settings().iFileViewMode == EFileViewModeExtended)
-                {
-                TBuf<128> extraData;
-                
-                // append entry date
-                TTime entryModified = fileEntry.iEntry.iModified;
-                if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
-                    {
-                    entryModified = fileEntry.iEntry.iModified;
-                    }
-                
-                _LIT(KCurrentDate,"%D%M%*Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
-                entryModified.FormatL(extraData, KCurrentDate);
-
-                // for a directory append number of entries and for a file the file size
-                if (fileEntry.iEntry.IsDir() && fileEntry.iDirEntries >= 0)
-                    {
-                    extraData.Append(_L(" - "));
-                    extraData.AppendNum(fileEntry.iDirEntries);
-                    
-                    if (fileEntry.iDirEntries == 1)
-                        extraData.Append(_L(" entry"));
-                    else
-                        extraData.Append(_L(" entries"));
-                    }
-                
-                // normal file entry
-                else if (!fileEntry.iEntry.IsDir())
-                    {
-                    extraData.Append(_L(" - "));
-
-                    if (fileEntry.iEntry.iSize < 1024)
-                        {
-                        extraData.AppendNum(fileEntry.iEntry.iSize);
-                        extraData.Append(_L(" B"));
-                        }
-                    else if (fileEntry.iEntry.iSize < 1024*1024)
-                        {
-                        TReal sizeKB = (TReal)fileEntry.iEntry.iSize / 1024;
-                        extraData.AppendNum(sizeKB, TRealFormat(KDefaultRealWidth, 1));
-                        extraData.Append(_L(" kB"));
-                        }
-                    else
-                        {
-                        TReal sizeMB = (TReal)fileEntry.iEntry.iSize / (1024*1024);
-                        extraData.AppendNum(sizeMB, TRealFormat(KDefaultRealWidth, 1));
-                        extraData.Append(_L(" MB"));
-                        }
-                    }
-
-                // append attribute flags if any
-                TBuf<4> atts;
-                if (fileEntry.iEntry.IsArchive())
-                    atts.Append(_L("A"));
-                if (fileEntry.iEntry.IsHidden())
-                    atts.Append(_L("H"));
-                if (fileEntry.iEntry.IsReadOnly())
-                    atts.Append(_L("R"));
-                if (fileEntry.iEntry.IsSystem())
-                    atts.Append(_L("S"));
-                
-                if (atts.Length() > 0)
-                    {
-                    extraData.Append(_L(" - ["));    
-                    extraData.Append(atts);    
-                    extraData.Append(_L("]"));    
-                    }
-                
-                // format                
-                textEntry.Format(KExtendedFileEntry, fileEntry.iIconId, &fileEntry.iEntry.iName, &extraData);
-                }
-            
-            if( fileEntry.iEntry.iName.Length() + fileEntry.iPath.Length() <= KMaxFileName )
-                {
-                textArray->AppendL(textEntry);
-                }
-            else
-                {
-                // Too long filenames are deleted from the list
-                iFileEntryList->Delete(i--);                
-                }
-            }
-        }
-    
-    CleanupStack::Pop(); //textArray
-    return textArray;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::GenerateDirectoryDataL()
-    {
-    if (iListingMode == ENormalEntries)
-        {
-        if (IsDriveListViewActive())
-            GetDriveListL();    
-        else
-            GetDirectoryListingL();        
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::GetDriveListL()
-    {
-    TDriveList driveList;
-    
-    // get drive listing depending of the support for network drives
-    if (iModel->Settings().iSupportNetworkDrives)
-        {
-        #ifndef __SERIES60_30__
-            #ifndef __SERIES60_31__
-                User::LeaveIfError(iFs.DriveList(driveList, KDriveAttAll));
-            #endif
-        #else    
-            User::LeaveIfError(iFs.DriveList(driveList));
-        #endif        
-        }
-    else
-        {
-        User::LeaveIfError(iFs.DriveList(driveList));
-        }
-    
-    iDriveEntryList->Reset();        
-    
-    for (TInt i=0; i<KMaxDrives; i++)
-        {
-        if (driveList[i])
-            {
-            TDriveEntry driveEntry;
-            
-            // set default icon
-            driveEntry.iIconId = EFixedIconPhoneMemory;
-
-            // get drive letter and number 
-            driveEntry.iLetter = 'A' + i;
-            iFs.CharToDrive(driveEntry.iLetter, driveEntry.iNumber);
-            
-            // get volume info and check errors
-            if (iFs.Volume(driveEntry.iVolumeInfo, driveEntry.iNumber) == KErrNone)
-                {
-                // set media type descriptor
-                TInt mediaType = driveEntry.iVolumeInfo.iDrive.iType;
-                TBool extMountable( EFalse );
-                
-                if (mediaType == EMediaNotPresent)
-                    driveEntry.iMediaTypeDesc = _L("Not present");
-                else if (mediaType ==EMediaUnknown )
-                    driveEntry.iMediaTypeDesc = _L("Unknown");
-                else if (mediaType ==EMediaFloppy )
-                    driveEntry.iMediaTypeDesc = _L("Floppy");
-                else if (mediaType == EMediaHardDisk)
-                    driveEntry.iMediaTypeDesc = _L("Mass storage");
-                else if (mediaType == EMediaCdRom)
-                    driveEntry.iMediaTypeDesc = _L("CD-ROM");
-                else if (mediaType == EMediaRam)
-                    driveEntry.iMediaTypeDesc = _L("RAM");
-                else if (mediaType == EMediaFlash)
-                    driveEntry.iMediaTypeDesc = _L("Flash");
-                else if (mediaType == EMediaRom)
-                    driveEntry.iMediaTypeDesc = _L("ROM");
-                else if (mediaType == EMediaRemote)
-                    driveEntry.iMediaTypeDesc = _L("Remote");
-                else if (mediaType == EMediaNANDFlash)
-                    driveEntry.iMediaTypeDesc = _L("NAND flash");
-                
-                // get real size of the ROM drive
-                if (mediaType == EMediaRom)
-                    {
-                    TMemoryInfoV1Buf ramMemory;
-                    UserHal::MemoryInfo(ramMemory);
-                    driveEntry.iVolumeInfo.iSize = ramMemory().iTotalRomInBytes;
-                    }
-                
-                // set attribute descripitions
-                if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatNotSupported)
-                    driveEntry.iAttributesDesc.Append(_L("Battery not supported"));
-                else if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatGood)
-                    driveEntry.iAttributesDesc.Append(_L("Battery good"));
-                else if (driveEntry.iVolumeInfo.iDrive.iBattery == EBatLow)
-                    driveEntry.iAttributesDesc.Append(_L("Battery low"));
-                else
-                    driveEntry.iAttributesDesc.Append(_L("Battery state unknown"));
-                
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttLocal)
-                    driveEntry.iAttributesDesc.Append(_L(" + Local"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRom)
-                    driveEntry.iAttributesDesc.Append(_L(" + ROM"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRedirected)
-                    driveEntry.iAttributesDesc.Append(_L("+ Redirected"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttSubsted)
-                    driveEntry.iAttributesDesc.Append(_L(" + Substed"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttInternal)
-                    driveEntry.iAttributesDesc.Append(_L(" + Internal"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable)
-                    {
-                    driveEntry.iAttributesDesc.Append(_L(" + Removable"));
-#if (!defined __SERIES60_30__ && !defined __SERIES60_31__)
-                    TUint drvStatus( 0 );
-                    if ( !DriveInfo::GetDriveStatus( iFs, driveEntry.iNumber, drvStatus ) &&
-                         drvStatus & DriveInfo::EDriveExternallyMountable &&
-                         drvStatus & DriveInfo::EDriveInternal )
-                        {
-                        extMountable = ETrue;
-                        // iMediaTypeDesc already set as "Mass storage" 
-                        }
-                    else
-                        {
-                        driveEntry.iMediaTypeDesc = _L("Memory card");
-                        }
-#else
-                    driveEntry.iMediaTypeDesc = _L("Memory card");
-#endif
-                    }
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemote)
-                    driveEntry.iAttributesDesc.Append(_L(" + Remote"));
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttTransaction)
-                    driveEntry.iAttributesDesc.Append(_L(" + Transaction"));
-                                
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttVariableSize)
-                    driveEntry.iAttributesDesc.Append(_L(" + Variable size"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttDualDensity)
-                    driveEntry.iAttributesDesc.Append(_L(" + Dual density"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttFormattable)
-                    driveEntry.iAttributesDesc.Append(_L(" + Formattable"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttWriteProtected)
-                    driveEntry.iAttributesDesc.Append(_L(" + Write protected"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLockable)
-                    driveEntry.iAttributesDesc.Append(_L(" + Lockable"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked)
-                    driveEntry.iAttributesDesc.Append(_L(" + Locked"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword)
-                    driveEntry.iAttributesDesc.Append(_L(" + Has password"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttReadWhileWrite)
-                    driveEntry.iAttributesDesc.Append(_L(" + Read while write"));
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttDeleteNotify)
-                    driveEntry.iAttributesDesc.Append(_L(" + Supports DeleteNotify"));
-                
-                
-                // mark a removable media with memory card icon
-                if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable && !extMountable)
-                    {
-                    if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAbsent)
-                        {                
-                        driveEntry.iIconId = EFixedIconMemoryCardDisabled;
-                        }                 
-                    else
-                        {                
-                        driveEntry.iIconId = EFixedIconMemoryCard;
-                        } 
-                    }
-                }   
-            
-            // if this fails, likely it's a memory card which is not present
-            else
-                {
-                TVolumeInfo volumeInfo;
-                volumeInfo.iSize = 0;
-                volumeInfo.iFree = 0;
-                volumeInfo.iDrive.iDriveAtt = KDriveAttRemovable;
-                volumeInfo.iDrive.iMediaAtt = KMediaAttWriteProtected;
-                driveEntry.iVolumeInfo = volumeInfo;
-
-                driveEntry.iMediaTypeDesc = _L("Not ready");
-                driveEntry.iIconId = EFixedIconMemoryCardDisabled;
-                }
-            
-            if ( iPrevFolderName != KNullDesC && iPrevFolderName[0] == driveEntry.iLetter )
-                {
-                iPrevFolderIndex = iDriveEntryList->Count();
-                }
-            
-            iDriveEntryList->AppendL(driveEntry);
-            }
-        }
-    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::GetDirectoryListingL()
-    {
-    iFileEntryList->Reset();
-
-    TInt sortMode(ESortByName);
-    if (iSortMode == EFileBrowserCmdViewSortByExtension)    
-        sortMode = ESortByExt; 
-    else if (iSortMode == EFileBrowserCmdViewSortBySize)    
-        sortMode = ESortBySize; 
-    else if (iSortMode == EFileBrowserCmdViewSortByDate)    
-        sortMode = ESortByDate; 
-    
-    TInt orderMode(EAscending);
-    if (iOrderMode == EFileBrowserCmdViewOrderDescending)    
-        orderMode = EDescending; 
-    
-    CDir* dir = NULL;
-    if (iFs.GetDir(iCurrentPath, KEntryAttMatchMask, sortMode | orderMode | EDirsFirst, dir) == KErrNone)
-        {
-        CleanupStack::PushL(dir);
-        
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TFileEntry fileEntry;
-            fileEntry.iPath = iCurrentPath;
-            fileEntry.iEntry = (*dir)[i];
-            fileEntry.iDirEntries = KErrNotFound;
-            fileEntry.iIconId = EFixedIconEmpty;
-            
-            if ( iPrevFolderName != KNullDesC && iPrevFolderName == fileEntry.iEntry.iName )
-                {
-                iPrevFolderIndex = i;
-                }
-            
-            // check for directory entries
-            if (fileEntry.iEntry.IsDir())
-                {
-                fileEntry.iIconId = EFixedIconFolder;
-
-                TFileName subPath = fileEntry.iPath;
-                subPath.Append(fileEntry.iEntry.iName);
-                subPath.Append(_L("\\"));
-                                
-                // get number of entries in this directory if extended info about sub directories enabled
-                if (iModel->Settings().iShowSubDirectoryInfo && iModel->Settings().iFileViewMode == EFileViewModeExtended)
-                    {
-                    CDir* subDir = NULL;
-                    if (iFs.GetDir(subPath, KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
-                        {
-                        fileEntry.iDirEntries = subDir->Count();
-                        delete subDir;    
-                        }
-                    }
-                
-                // apply subfolder icon for known directories (speed improvement)
-                if (subPath[0]=='Z' && (subPath.CompareF(_L("Z:\\data\\"))==0 || subPath.CompareF(_L("Z:\\Nokia\\"))==0
-                    || subPath.Compare(_L("Z:\\private\\"))==0 || subPath.Compare(_L("Z:\\resource\\"))==0
-                    || subPath.Compare(_L("Z:\\sys\\"))==0 || subPath.Compare(_L("Z:\\system\\"))==0))
-                    {
-                    fileEntry.iIconId = EFixedIconFolderSub;
-                    }
-                else if (subPath[0]=='Z' && (subPath.CompareF(_L("Z:\\sys\\bin\\"))==0))
-                    {
-                    // normal folder icon for these ones
-                    fileEntry.iIconId = EFixedIconFolder;
-                    }
-                else
-                    {
-                    // check if this folder has subdirectories
-                    CDir* subDir = NULL;
-                    if (iFs.GetDir(subPath, KEntryAttDir|KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
-                        {
-                        for (TInt j=0; j<subDir->Count(); j++)
-                            {
-                            TEntry entry = (*subDir)[j];
-
-                            if (entry.IsDir())
-                                {
-                                fileEntry.iIconId = EFixedIconFolderSub;
-                                break;    
-                                }
-                            }
-
-                        delete subDir;    
-                        }                    
-                    }
-                }
-
-            iFileEntryList->AppendL(fileEntry);
-            }
-        
-        CleanupStack::PopAndDestroy(); //dir    
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::MoveUpOneLevelL()
-    {
-    iPrevFolderIndex = KErrNotFound;
-    iPrevFolderName.Zero();
-    
-    // change back to normal mode or move up
-    if (iListingMode != ENormalEntries)
-        {
-        iListingMode = ENormalEntries;
-        }
-    else
-        {
-        // do nothing if displaying drive list view
-        if (IsDriveListViewActive())
-            return;
-        
-        if (iCurrentPath.Length() <= KDriveLetterStringLength)
-            {
-            if ( iCurrentPath.Length() > 0 )
-                {
-                iPrevFolderName.Append( iCurrentPath[0] );
-                }
-            // move to drive list view if the current path is already short enough
-            iCurrentPath = KNullDesC;
-            }
-        else
-            {
-            // move one directory up
-            TInt marker(iCurrentPath.Length());
-            
-            // find second last dir marker
-            for (TInt i=iCurrentPath.Length()-2; i>=0; i--)
-                {
-                if (iCurrentPath[i] == '\\')
-                    {
-                    marker = i;
-                    break;
-                    }
-                    
-                }
-            
-            // update iPrevDir with the directory name that we just left 
-            iPrevFolderName.Copy( iCurrentPath.RightTPtr( iCurrentPath.Length() -  marker - 1 ) );
-            iPrevFolderName.Delete( iPrevFolderName.Length() -1, 2 ); // remove extra '\\'
-            
-            iCurrentPath = iCurrentPath.LeftTPtr(marker+1);
-            }    
-        }
-
-    if (iModel->FileListContainer())
-        {
-        //iModel->FileListContainer()->DisableSearchFieldL();
-        //iModel->FileListContainer()->ListBox()->ClearSelection();
-        iModel->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
-        //iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
-        }
-    
-    // update view
-    RefreshViewL();
-    
-    if ( iModel->Settings().iRememberFolderSelection &&
-         iModel->FileListContainer() && iPrevFolderIndex > KErrNotFound )
-        {
-        
-        TInt visibleItems = iModel->FileListContainer()->ListBox()->Rect().Height() /
-                            iModel->FileListContainer()->ListBox()->ItemHeight() 
-                            - 1; // for the title row
-
-        // By default, the selected item would be the last visible item on the listbox.
-        // We want the selected item be displayed at the middle of the listbox, so we
-        // select one of the successor items first to scroll down a bit
-        iModel->FileListContainer()->ListBox()->SetCurrentItemIndex( 
-            Min( iModel->FileListContainer()->ListBox()->Model()->ItemTextArray()->MdcaCount() -1,
-                 iPrevFolderIndex + visibleItems / 2 ) );
-        
-        // ...and after that we select the the correct item.
-        iModel->FileListContainer()->ListBox()->SetCurrentItemIndex( iPrevFolderIndex );
-        
-        // update view
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::MoveDownToDirectoryL()
-    {
-    // change back to normal mode
-    if (iListingMode != ENormalEntries)
-        {
-        iListingMode = ENormalEntries;
-        }
-    
-    TInt index = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (index >= 0)
-        {
-        TBool needsRefresh(EFalse);
-
-        if (IsDriveListViewActive())
-            {
-            // currently in a drive list view, move to root of selected drive
-            if (iDriveEntryList->Count() > index)
-                {
-                TDriveEntry driveEntry = iDriveEntryList->At(index);
-                
-                iCurrentPath.Append(driveEntry.iLetter);    
-                iCurrentPath.Append(_L(":\\"));
-                
-                needsRefresh = ETrue;    
-                }
-            }
-        else
-            {
-            // otherwise just append the new directory
-            if (iFileEntryList->Count() > index)
-                {
-                TFileEntry fileEntry = iFileEntryList->At(index);
-                
-                if (fileEntry.iEntry.IsDir())
-                    {
-                    iCurrentPath.Copy(fileEntry.iPath);
-                    iCurrentPath.Append(fileEntry.iEntry.iName);
-                    iCurrentPath.Append(_L("\\"));
-
-                    needsRefresh = ETrue;    
-                    }
-                }
-            }
-
-        if (needsRefresh && iModel->FileListContainer())
-            {
-            //iModel->FileListContainer()->DisableSearchFieldL();
-            //iModel->FileListContainer()->ListBox()->ClearSelection();
-            iModel->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
-            //iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
-
-            // update view
-            RefreshViewL();
-            }
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileUtils::IsCurrentDriveReadOnly()
-    {
-    if (iListingMode !=ENormalEntries || iCurrentPath.Length() < 2)
-        return EFalse;
-    else
-        {
-        for (TInt i=0; i<iDriveEntryList->Count(); i++)
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(i);
-            
-            if (driveEntry.iLetter == iCurrentPath[0])
-                {
-                if (driveEntry.iVolumeInfo.iDrive.iMediaAtt == KMediaAttWriteProtected || driveEntry.iVolumeInfo.iDrive.iMediaAtt == KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt == KDriveAbsent)
-                    return ETrue;    
-                else
-                    return EFalse;
-                }
-            }
-        }
-
-    return EFalse;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileUtils::IsCurrentItemDirectory()
-    {
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (currentItemIndex < 0)
-        return EFalse;
-    else
-        {
-        if (iFileEntryList->Count() > currentItemIndex)
-            {
-            TFileEntry fileEntry = iFileEntryList->At(currentItemIndex) ;   
-            return fileEntry.iEntry.IsDir();
-            }
-        else
-            return EFalse;
-        }
-    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::GetSelectedItemsOrCurrentItemL(CFileEntryList* aFileEntryList)
-    {
-    aFileEntryList->Reset();
-    
-    const CArrayFix<TInt>* selectionIndexes = iModel->FileListContainer()->ListBoxSelectionIndexes();
-
-    // by default use selected items
-    if (selectionIndexes && selectionIndexes->Count() > 0)
-        {
-        TInt ref(0);
-        TKeyArrayFix key(0, ECmpTUint16);
-        TInt index(0);
-
-        for (TInt i=0; i<iFileEntryList->Count(); i++)
-            {
-            ref = i;
-
-            if (selectionIndexes->Find(ref, key, index) == 0)  
-                {
-                aFileEntryList->AppendL(iFileEntryList->At(i));
-                }
-            }
-        }
-    
-    // or if none selected, use the current item index
-    else
-        {
-        TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-        
-        if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-            {
-            aFileEntryList->AppendL(iFileEntryList->At(currentItemIndex));
-            }
-        }  
-
-    return aFileEntryList->Count();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ClipboardCutL()
-    {
-    iClipBoardMode = EClipBoardModeCut;
-    TInt operations = GetSelectedItemsOrCurrentItemL(iClipBoardList);
-
-    _LIT(KMessage, "%d entries cut to clipboard");
-    TFileName noteMsg;
-    noteMsg.Format(KMessage, operations);
-    
-    CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    note->ExecuteLD(noteMsg);
-
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ClipboardCopyL()
-    {
-    iClipBoardMode = EClipBoardModeCopy;
-    TInt operations = GetSelectedItemsOrCurrentItemL(iClipBoardList);
-
-    _LIT(KMessage, "%d entries copied to clipboard");
-    TFileName noteMsg;
-    noteMsg.Format(KMessage, operations);
-    
-    CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    note->ExecuteLD(noteMsg);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ClipboardPasteL()
-    {
-    if (iClipBoardMode == EClipBoardModeCut)
-        {
-        DoCopyToFolderL(iClipBoardList, iCurrentPath, ETrue);
-        iClipBoardList->Reset();
-        }
-    else if (iClipBoardMode == EClipBoardModeCopy)
-        {
-        DoCopyToFolderL(iClipBoardList, iCurrentPath, EFalse);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::CopyToFolderL(TBool aMove)
-    {
-    TFileName destinationFolder;
-    
-    // generate an icon array
-    CAknIconArray* iconArray = GenerateIconArrayL(ETrue);
-    CleanupStack::PushL(iconArray);
-
-    // run folder selection dialog
-    CFileBrowserDestinationFolderSelectionDlg* dlg = CFileBrowserDestinationFolderSelectionDlg::NewL(destinationFolder, iDriveEntryList, iconArray);
-
-    TBool dialogOK(EFalse);
-    
-    if (aMove)
-        dialogOK = dlg->RunMoveDlgLD();
-    else
-        dialogOK = dlg->RunCopyDlgLD();
-    
-    if (dialogOK)
-        {
-        // get entry list
-        CFileEntryList* entryList = new(ELeave) CFileEntryList(32);
-        GetSelectedItemsOrCurrentItemL(entryList);
-        CleanupStack::PushL(entryList);
-
-        // do the file operations
-        if (aMove)
-            DoCopyToFolderL(entryList, destinationFolder, ETrue);
-        else
-            DoCopyToFolderL(entryList, destinationFolder, EFalse);
-
-        CleanupStack::PopAndDestroy(); // entryList   
-        }
-
-    CleanupStack::Pop(); //iconArray
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DoCopyToFolderL(CFileEntryList* aEntryList, const TDesC& aTargetDir, TBool aDeleteSource)
-    {
-    if (aEntryList && aEntryList->Count() > 0)
-        {
-        TBool someEntryExists(EFalse);
-        TBool doFileOperations(ETrue);
-        TInt queryIndex(0);
-        TFileName postFix;
-        TInt overWriteFlags = CFileMan::EOverWrite;
-
-        // check if some destination entries also exists
-        for (TInt i=0; i<aEntryList->Count(); i++)
-            {
-            TFileEntry fileEntry = aEntryList->At(i);
-            
-            TFileName targetEntry = aTargetDir;
-            targetEntry.Append(fileEntry.iEntry.iName);
-
-            if (fileEntry.iEntry.IsDir())
-                {
-                targetEntry.Append(_L("\\"));
-                
-                if (BaflUtils::PathExists(iFs, targetEntry))
-                    {
-                    someEntryExists = ETrue;
-                    break;
-                    }
-                }
-            else
-                {
-                if (BaflUtils::FileExists(iFs, targetEntry))
-                    {
-                    someEntryExists = ETrue;
-                    break;
-                    }
-                }
-            }        
-        
-        // show a query if existing entries
-        if (someEntryExists)
-            {
-            CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
-            
-            if (listQueryDlg->ExecuteLD(R_ENTRY_OVERWRITE_TYPE_QUERY))
-                {
-                if (queryIndex == EFileActionQueryPostFix)
-                    {
-                    CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(postFix);
-                    textQuery->SetPromptL(_L("Postfix:"));
-                    
-                    if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-                        {
-                            
-                        }
-                    else
-                        {
-                        doFileOperations = EFalse;    
-                        }
-                    }
-                else if (queryIndex == EFileActionSkipAllExisting)
-                    {
-                    overWriteFlags = 0;
-                    }
-                }
-            else
-                {
-                doFileOperations = EFalse;    
-                }
-            }
-        
-
-        if (doFileOperations)
-            {
-            // set correct command id depending if we are copying or moving
-            TInt commandId(EFileBrowserFileOpCommandCopy);
-            if (aDeleteSource)
-                commandId = EFileBrowserFileOpCommandMove;
-            
-            // do the file operations for each entry
-            for (TInt i=0; i<aEntryList->Count(); i++)
-                {
-                TFileEntry fileEntry = aEntryList->At(i);
-                
-                TFileName targetEntry = aTargetDir;
-                targetEntry.Append(fileEntry.iEntry.iName);
-                
-                if (queryIndex == EFileActionGenerateUniqueFilenames)
-                    {
-                    CApaApplication::GenerateFileName(iFs, targetEntry);
-                    }
-                else if (queryIndex == EFileActionQueryPostFix)
-                    {
-                    targetEntry.Append(postFix);
-                    }
-
-                
-                // append the new command to the command array
-                if (fileEntry.iEntry.IsDir())
-                    {
-                    AppendToCommandArrayL(commandId,
-                                          new(ELeave)CCommandParamsCopyOrMove(fileEntry, targetEntry, overWriteFlags|CFileMan::ERecurse)
-                                         );
-                    }
-                else
-                    {
-                    AppendToCommandArrayL(commandId,
-                                          new(ELeave)CCommandParamsCopyOrMove(fileEntry, targetEntry, overWriteFlags)
-                                         );
-                    }
-
-                }
-
-            // execute all operations
-            if (aDeleteSource)
-                StartExecutingCommandsL(_L("Moving"));
-            else
-                StartExecutingCommandsL(_L("Copying"));
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DeleteL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(32);
-    TInt operations = GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-
-    CAknQueryDialog* query = CAknQueryDialog::NewL();
-    _LIT(KQueryMessage, "Delete %d entries?");
-    TFileName queryMsg;
-    queryMsg.Format(KQueryMessage, operations);
-        
-    if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, queryMsg))
-        {
-        // do the file operations for each entry
-        for (TInt i=0; i<entries->Count(); i++)
-            {
-            TFileEntry fileEntry = entries->At(i);
-            
-            // append the new command to the command array
-            if (fileEntry.iEntry.IsDir())
-                {
-                AppendToCommandArrayL(EFileBrowserFileOpCommandDelete,
-                                      new(ELeave)CCommandParamsDelete(fileEntry, CFileMan::ERecurse)
-                                     );
-                }
-            else
-                {
-                AppendToCommandArrayL(EFileBrowserFileOpCommandDelete,
-                                      new(ELeave)CCommandParamsDelete(fileEntry, 0)
-                                     );
-                }
-
-            }
-
-        // execute all operations
-        StartExecutingCommandsL(_L("Deleting"));
-        }
-
-    CleanupStack::PopAndDestroy(); //entries
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::TouchL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(32);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-    
-    TBool recurse(EFalse);
-
-    // check if any directories and ask recursion
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-        
-        if (fileEntry.iEntry.IsDir())
-            {
-            CAknQueryDialog* query = CAknQueryDialog::NewL();
-            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Recurse touch for all selected dirs?")))
-                {
-                recurse = ETrue;
-                }
-            break;
-            }
-        }
-    
-    // now go through all entries    
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-
-        // touch to current time
-        TTime now;
-        now.UniversalTime();
-
-        
-        // append the new command to the command array
-        if (fileEntry.iEntry.IsDir() && recurse)
-            {
-            AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
-                                  new(ELeave)CCommandParamsAttribs(fileEntry, NULL, NULL, now, CFileMan::ERecurse)
-                                 );
-            }
-        else
-            {
-            AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
-                                  new(ELeave)CCommandParamsAttribs(fileEntry, NULL, NULL, now, 0)
-                                 );
-            }
-        }
-       
-    // execute all operations
-    StartExecutingCommandsL(_L("Touching"));
-
-    CleanupStack::PopAndDestroy(); //entries
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::RenameL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-    
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-        
-        TFileName newName = fileEntry.iEntry.iName;
-        
-        CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(newName);
-        textQuery->SetPromptL(_L("Enter new name:"));
-        
-        if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-            {
-            TFileName targetEntry = fileEntry.iPath;
-            targetEntry.Append(newName);
-            
-            TBool alreadyExists(EFalse);
-            TBool doRenameOperation(ETrue);
-            
-            if (fileEntry.iEntry.IsDir())
-                {
-                //targetEntry.Append(_L("\\"));
-                alreadyExists = BaflUtils::PathExists(iFs, targetEntry);
-                }
-            else    
-                {
-                alreadyExists = BaflUtils::FileExists(iFs, targetEntry);
-                }                
- 
-            if (alreadyExists)
-                {
-                CAknQueryDialog* query = CAknQueryDialog::NewL();
-                _LIT(KQueryMessage, "%S already exists, overwrite?");
-                TFileName queryMsg;
-                queryMsg.Format(KQueryMessage, &newName);
-                
-                if (!query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, queryMsg))
-                    {
-                    doRenameOperation = EFalse;                                    
-                    }
-                }
-
-            if (doRenameOperation)
-                {
-                // append the new command to the command array
-                AppendToCommandArrayL(EFileBrowserFileOpCommandRename,
-                                      new(ELeave)CCommandParamsRename(fileEntry, targetEntry, CFileMan::EOverWrite)
-                                     );
-                }
-            }
-        }
-
-    // execute all operations
-    StartExecutingCommandsL(_L("Renaming"));
-
-    CleanupStack::PopAndDestroy(); //entries
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetAttributesL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-    
-    if (entries->Count() > 0)
-        {
-        TFileName naviText = _L("Multiple entries");
-        
-        TUint setAttMask(0);
-        TUint clearAttMask(0);
-        TBool recurse(EFalse);
-        
-        // set default masks if only one file selected
-        if (entries->Count() == 1)
-            {
-            TFileEntry fileEntry = entries->At(0);
-            
-            naviText.Copy(fileEntry.iEntry.iName);
-            
-            if (fileEntry.iEntry.IsArchive())
-                setAttMask |= KEntryAttArchive;
-            else
-                clearAttMask |= KEntryAttArchive;
-            
-            if (fileEntry.iEntry.IsHidden())
-                setAttMask |= KEntryAttHidden;
-            else
-                clearAttMask |= KEntryAttHidden;
- 
-            if (fileEntry.iEntry.IsReadOnly())
-                setAttMask |= KEntryAttReadOnly;
-            else
-                clearAttMask |= KEntryAttReadOnly;
-
-            if (fileEntry.iEntry.IsSystem())
-                setAttMask |= KEntryAttSystem;
-            else
-                clearAttMask |= KEntryAttSystem;
-            }
-        
-        iModel->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
-        iModel->FileListContainer()->SetNaviPaneTextL(naviText);
-
-        CFileBrowserAttributeEditorDlg* dlg = CFileBrowserAttributeEditorDlg::NewL(setAttMask, clearAttMask, recurse);
-        TBool dlgResult = dlg->RunEditorLD();
-
-        iModel->FileListContainer()->SetScreenLayoutL(iModel->Settings().iDisplayMode);
-        iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);        
-        
-        if (dlgResult && (setAttMask > 0 || clearAttMask > 0))
-            {
-            for (TInt i=0; i<entries->Count(); i++)
-                {
-                TFileEntry fileEntry = entries->At(i);
- 
-                // append the new command to the command array
-                if (fileEntry.iEntry.IsDir() && recurse)
-                    {
-                    AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
-                                          new(ELeave)CCommandParamsAttribs(fileEntry, setAttMask, clearAttMask, fileEntry.iEntry.iModified, CFileMan::ERecurse)
-                                         );
-                    }
-                else
-                    {
-                    AppendToCommandArrayL(EFileBrowserFileOpCommandAttribs,
-                                          new(ELeave)CCommandParamsAttribs(fileEntry, setAttMask, clearAttMask, fileEntry.iEntry.iModified, 0)
-                                         );
-                    }
-                }
-
-            // execute all operations
-            StartExecutingCommandsL(_L("Changing attributes"));          
-            }
-        }
-    
-    CleanupStack::PopAndDestroy(); //entries
-    }
-       
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SearchL()
-    {
-    iModel->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
-    iModel->FileListContainer()->SetNaviPaneTextL(KNullDesC);
-    
-    iSearchAttributes.iSearchDir = iCurrentPath;
-    
-    CFileBrowserSearchQueryDlg* dlg = CFileBrowserSearchQueryDlg::NewL(iSearchAttributes);
-    TBool dlgResult = dlg->RunQueryLD();
-
-    iModel->FileListContainer()->SetScreenLayoutL(iModel->Settings().iDisplayMode);
-    iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);        
-    
-    if (dlgResult)
-        {
-        iModel->EikonEnv()->BusyMsgL(_L("** Searching **"), TGulAlignment(EHCenterVTop));
-
-        iFileEntryList->Reset();
-        
-        // if search dir is empty, find from all drives
-        if (iSearchAttributes.iSearchDir == KNullDesC)
-            {
-            for (TInt i=0; i<iDriveEntryList->Count(); i++)
-                {
-                TDriveEntry driveEntry = iDriveEntryList->At(i);
-
-                TBuf<10> driveRoot;
-                driveRoot.Append(driveEntry.iLetter);
-                driveRoot.Append(_L(":\\"));
-                
-                DoSearchFiles(iSearchAttributes.iWildCards, driveRoot);
-                
-                if (iSearchAttributes.iRecurse)
-                    DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, driveRoot);
-                
-                }
-            
-            }
-        
-        // otherwise just search from the selected directory
-        else
-            {
-            DoSearchFiles(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
-            
-            if (iSearchAttributes.iRecurse)
-                DoSearchFilesRecursiveL(iSearchAttributes.iWildCards, iSearchAttributes.iSearchDir);
-            }
-        
-        iModel->EikonEnv()->BusyMsgCancel();
-        
-        TInt operations = iFileEntryList->Count();
-        
-        iListingMode = ESearchResults;
-        iModel->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
-        RefreshViewL();            
-
-        _LIT(KMessage, "%d entries found");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, operations);
-        
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(noteMsg);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::DoSearchFiles(const TDesC& aFileName, const TDesC& aPath)
-    {
-    TFindFile fileFinder(iFs);
-    CDir* dir;
-    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
-
-    while (err == KErrNone)
-        {
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-            
-            TTime entryModified = entry.iModified;
-            // convert from universal time
-            if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
-                {
-                entryModified = entry.iModified;
-                }
-            if ((entry.IsDir() && entryModified >= iSearchAttributes.iMinDate && entryModified <= iSearchAttributes.iMaxDate) ||
-                (!entry.IsDir() &&entry.iSize >= iSearchAttributes.iMinSize && entry.iSize <= iSearchAttributes.iMaxSize &&
-                 entryModified >= iSearchAttributes.iMinDate && entryModified <= iSearchAttributes.iMaxDate))
-                {
-                TParse parsedName;
-                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
-                
-                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
-                    {
-                    TFileEntry fileEntry;
-                    fileEntry.iPath = parsedName.DriveAndPath();
-                    fileEntry.iEntry = entry;
-                    fileEntry.iDirEntries = KErrNotFound;
-                    
-                    TBool appendToArray(EFalse);
-                    
-                    // append directories always
-                    if (entry.IsDir() && !iSearchAttributes.iTextInFile.Length())
-                        {
-                        fileEntry.iIconId = EFixedIconFolder;
-                        appendToArray = ETrue;    
-                        }
-                    
-                    // normal file
-                    else
-                        {
-                        fileEntry.iIconId = EFixedIconEmpty;
-                        
-                        // check if a string needs to be found inside the file
-                        if (iSearchAttributes.iTextInFile.Length())
-                            {
-                            // currently only 8-bit searching, so convert from 16-bit
-                            TBuf8<256> searchText;
-                            searchText.Copy(iSearchAttributes.iTextInFile);
-                            
-                            // specify buffer size and create a buffer
-                            const TInt KReadBufSize = 1024*1024;
-                            HBufC8* buffer = HBufC8::NewLC(KReadBufSize);
-                            TPtr8 bufferPtr = buffer->Des();
-
-                            // open the file for reading
-                            RFile file;
-                            if (file.Open(iFs, parsedName.FullName(), EFileRead) == KErrNone)
-                                {
-                                TInt currentPos(0);
-                                
-                                for (;;)
-                                    {
-                                    // read from the file
-                                    file.Read(currentPos, bufferPtr, KReadBufSize);
-
-                                    // stop looping if the read buffer isn't long enough
-                                    if (bufferPtr.Length() < searchText.Length())
-                                        {
-                                        break;
-                                        }
-                                        
-                                    // try to find the text
-                                    if (bufferPtr.FindF(searchText) >= 0)
-                                        {
-                                        // match found!
-                                        appendToArray = ETrue;
-                                        break;
-                                        }
-                                        
-                                    // calculate the next position
-                                    currentPos += KReadBufSize - searchText.Length();    
-                                    }
-                                
-                                file.Close();
-                                }
-                            
-                            CleanupStack::PopAndDestroy(); //buffer
-                            }
-                        else
-                            {
-                            appendToArray = ETrue;
-                            }
-                        }
-
-                    if (appendToArray)
-                        TRAP(err, iFileEntryList->AppendL(fileEntry));    
-                    }
-                }
-            }
-
-        delete dir;
-        err = fileFinder.FindWild(dir);
-        }
-
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::DoSearchFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
-	{
-    TInt err(KErrNone);
-    CDirScan* scan = CDirScan::NewLC(iFs);
-    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst);
-    CDir* dir = NULL;
-
-    for(;;)
-        {
-        TRAP(err, scan->NextL(dir));
-        if (!dir  || (err != KErrNone))
-            break;
-
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-            
-            if (entry.IsDir())
-                {
-                TFileName path(scan->FullPath());
-                
-                if (path.Length())
-                    {
-                    path.Append(entry.iName);
-                    path.Append(_L("\\"));
-                    DoSearchFiles(aFileName, path);
-                    }
-                }
-            }
-        delete(dir);
-        }
-
-    CleanupStack::PopAndDestroy(scan);
-    return err;
-    }
-         
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::NewFileL()
-    {
-    TFileName newName;
-    
-    CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(newName);
-    textQuery->SetPromptL(_L("Enter filename:"));
-    
-    if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-        {
-        TFileName fullPath = iCurrentPath;
-        fullPath.Append(newName);
-        
-        TParse nameParser;
-        TInt err = nameParser.SetNoWild(fullPath, NULL, NULL);
-        
-        if (err == KErrNone)
-            {
-            // do not try to recreate the file if it already exists
-            if (BaflUtils::PathExists(iFs, nameParser.DriveAndPath()))
-                {
-                err = iFileOps->CreateEmptyFile(fullPath);
-                }
-            else
-                err = KErrAlreadyExists;
-            }
-
-        if (err == KErrNone)    
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("New file created"));    
-            }
-        
-        else if (err == KErrAlreadyExists)    
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("File already exists"));    
-            }            
-
-        else    
-            {
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver     
-            }
-
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::NewDirectoryL()
-    {    
-    TFileName newDirectory;
-    
-    CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(newDirectory);
-    textQuery->SetPromptL(_L("Enter directory name:"));
-    
-    if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-        {
-        TFileName fullPath = iCurrentPath;
-        fullPath.Append(newDirectory);
-        fullPath.Append(_L("\\"));
-        
-        TInt err = iFileOps->MkDirAll(fullPath, 0, ETrue);
-
-        if (err == KErrNone)    
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("New directory created"));    
-            }
-        
-        else if (err == KErrAlreadyExists)    
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Directory already exists"));    
-            }            
-
-        else    
-            {
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver     
-            }
-
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SendToL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(32);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-
-    TInt operations(0);
-
-    CSendUi* sendUi = CSendUi::NewL();
-    CleanupStack::PushL(sendUi);
-    CMessageData* messageData = CMessageData::NewL();
-    CleanupStack::PushL(messageData);            
-        
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-
-        // only supported for normal file entries
-        if (!fileEntry.iEntry.IsDir())
-            {
-            TFileName fullPath = fileEntry.iPath;
-            fullPath.Append(fileEntry.iEntry.iName);
-            
-            messageData->AppendAttachmentL(fullPath);
-            operations++;
-            
-            }
-        }
-    
-    if (operations > 0)
-        {
-        sendUi->ShowQueryAndSendL(messageData, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments));
-
-        // I guess this note is not needed..
-        /* 
-        _LIT(KMessage, "%d entries sent");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, operations);
-        
-        CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-        note->ExecuteLD(noteMsg);    
-        */
-        }
-    else
-        {
-        _LIT(KMessage, "Nothing to send");
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(KMessage);    
-        }        
-        
-    CleanupStack::PopAndDestroy(3); // entries, sendUi, messageData    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::CompressL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-    
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-        
-        TFileName sourceEntry = fileEntry.iPath;
-        sourceEntry.Append(fileEntry.iEntry.iName);
-        
-        TFileName targetEntry = sourceEntry;
-        targetEntry.Append(KGZipExt);
-        
-        TFileName targetEntryShort;
-        targetEntryShort.Copy(fileEntry.iEntry.iName);
-        targetEntryShort.Append(KGZipExt);
-        
-        if (BaflUtils::FileExists(iFs, targetEntry))
-            {
-            _LIT(KMessage, "%S already exists");
-            TFileName noteMsg;
-            noteMsg.Format(KMessage, &targetEntryShort);
-            
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(noteMsg);           
-            }
-        else
-            {
-            TRAPD(err,
-                RFile inputFile;
-                User::LeaveIfError(inputFile.Open(iFs, sourceEntry, EFileStream | EFileRead | EFileShareAny));
-                CleanupClosePushL(inputFile);
-                
-                CEZFileToGZip* gZip = CEZFileToGZip::NewLC(iFs, targetEntry, inputFile);
-
-                while (gZip->DeflateL())
-                    ;
-
-                CleanupStack::PopAndDestroy(2); //inputFile, gZip
-                );
-             
-             if (err == KErrNone)
-                {
-                _LIT(KMessage, "%S created succesfully");
-                TFileName noteMsg;
-                noteMsg.Format(KMessage, &targetEntryShort);
-                
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(noteMsg);
-                }
-             else
-                {
-                _LIT(KMessage, "Unable to create %S");
-                TFileName noteMsg;
-                noteMsg.Format(KMessage, &targetEntryShort);
-                
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(noteMsg);
-                }
-                
-            RefreshViewL();
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); //entries
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DecompressL()
-    {
-    CFileEntryList* entries = new(ELeave) CFileEntryList(16);
-    GetSelectedItemsOrCurrentItemL(entries);
-    CleanupStack::PushL(entries);
-    
-    for (TInt i=0; i<entries->Count(); i++)
-        {
-        TFileEntry fileEntry = entries->At(i);
-        
-        TFileName sourceEntry = fileEntry.iPath;
-        sourceEntry.Append(fileEntry.iEntry.iName);
-        
-        TFileName targetEntry;
-        TFileName targetEntryShort;
-
-        TInt sourceNameLen = fileEntry.iEntry.iName.Length();
-        TInt gZipExtLen = KGZipExt().Length();
-
-        if (sourceNameLen > gZipExtLen && sourceEntry.Right(gZipExtLen).CompareF(KGZipExt) == 0)
-            {
-            targetEntry = sourceEntry.Left(sourceEntry.Length() - gZipExtLen);
-            targetEntryShort = fileEntry.iEntry.iName.Left(sourceNameLen - gZipExtLen);
-            
-            if (BaflUtils::FileExists(iFs, targetEntry))
-                {
-                _LIT(KMessage, "%S already exists");
-                TFileName noteMsg;
-                noteMsg.Format(KMessage, &targetEntryShort);
-                
-                CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                note->ExecuteLD(noteMsg);           
-                }
-            else
-                {
-                TRAPD(err,
-                    RFile outputFile;
-                    User::LeaveIfError(outputFile.Create(iFs, targetEntry, EFileStream | EFileWrite | EFileShareExclusive));
-                    CleanupClosePushL(outputFile);
-                    
-                    CEZGZipToFile* gZip = CEZGZipToFile::NewLC(iFs, sourceEntry, outputFile);
-
-                    while (gZip->InflateL())
-                        ;            
-
-                    CleanupStack::PopAndDestroy(2); //outputFile, gZip
-                    );
-                 
-                 if (err == KErrNone)
-                    {
-                    _LIT(KMessage, "%S decompressed succesfully");
-                    TFileName noteMsg;
-                    noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
-                    
-                    CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                    note->ExecuteLD(noteMsg);
-                    }
-                 else
-                    {
-                    _LIT(KMessage, "Unable to decompress %S");
-                    TFileName noteMsg;
-                    noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
-                    
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(noteMsg);
-                    }
-                    
-                RefreshViewL();
-                }
-            }
-        else
-            {
-            _LIT(KMessage, "%S does not have %S extension");
-            TFileName noteMsg;
-            noteMsg.Format(KMessage, &fileEntry.iEntry.iName, &KGZipExt);
-            
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(noteMsg);              
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); //entries
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::PropertiesL()
-    {
-    TBool showDialog(EFalse);
-    
-    _LIT(KPropertiesEntryStr,       "%S\t%S");
-    _LIT(KPropertiesEntryInt,       "%S\t%d");
-    _LIT(KPropertiesEntryUintHex,   "%S\t0x%x");
-    
-    _LIT(KDateFormat,               "%D%M%Y%/0%1%/1%2%/2%3%/3");
-    _LIT(KTimeFormat,               "%-B%:0%J%:1%T%:2%S%:3%+B");
-    
-    _LIT(KMediaType,                "Media");
-    _LIT(KAttributes,               "Atts");
-    _LIT(KVolumeName,               "Name");
-    _LIT(KUniqueID,                 "ID");
-    _LIT(KNumberOfEntries,          "Entries");
-    _LIT(KNumberOfFiles,            "Files");
-    _LIT(KUsed,                     "Used (B)");
-    _LIT(KFree,                     "Free (B)");
-    _LIT(KSize,                     "Size (B)");
-    _LIT(KPath,                     "Path");
-    _LIT(KDate,                     "Date");
-    _LIT(KTime,                     "Time");
-    _LIT(KMimeType,                 "Mime");
-    _LIT(KOpensWith,                "Opens");
- 
-
-    // create an array for the items
-	CDesCArray* entryLines = new(ELeave) CDesCArrayFlat(16);
-	CleanupStack::PushL(entryLines);
-    TFileName titleText;
-    
-    // just get current item
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (IsDriveListViewActive() && iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        // it is a drive entry
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        TFileName textEntry;
-        
-        // set title
-        titleText.Append(driveEntry.iLetter);
-        titleText.Append(_L(":"));
-        
-        // media type
-        textEntry.Format(KPropertiesEntryStr, &KMediaType, &driveEntry.iMediaTypeDesc);
-        entryLines->AppendL(textEntry);
-
-        // attributes
-        textEntry.Format(KPropertiesEntryStr, &KAttributes, &driveEntry.iAttributesDesc);
-        entryLines->AppendL(textEntry);
-
-        // volume name
-        if (driveEntry.iVolumeInfo.iName.Length())
-            {
-            textEntry.Format(KPropertiesEntryStr, &KVolumeName, &driveEntry.iVolumeInfo.iName);
-            entryLines->AppendL(textEntry);
-            }
-
-        // unique id
-        textEntry.Format(KPropertiesEntryUintHex, &KUniqueID, driveEntry.iVolumeInfo.iUniqueID);
-        entryLines->AppendL(textEntry);
-        
-        // number of files
-        if (iModel->Settings().iShowSubDirectoryInfo)
-            {
-            iFindFileEntryList->Reset();
-            
-            TBuf<10> driveRoot;
-            driveRoot.Append(driveEntry.iLetter);
-            driveRoot.Append(_L(":\\"));
-
-            DoFindFiles(_L("*"), driveRoot);
-            DoFindFilesRecursiveL(_L("*"), driveRoot);
-            
-            textEntry.Format(KPropertiesEntryInt, &KNumberOfFiles, iFindFileEntryList->Count());
-            entryLines->AppendL(textEntry);
-            
-            iFindFileEntryList->Reset();
-            }
-      
-        // used
-        TBuf<32> usedBuf;
-        usedBuf.AppendNum(driveEntry.iVolumeInfo.iSize-driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
-        textEntry.Format(KPropertiesEntryStr, &KUsed, &usedBuf);
-        entryLines->AppendL(textEntry);        
-
-        // free
-        TBuf<32> freeBuf;
-        freeBuf.AppendNum(driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
-        textEntry.Format(KPropertiesEntryStr, &KFree, &freeBuf);
-        entryLines->AppendL(textEntry);
-                
-        // size
-        TBuf<32> sizeBuf;
-        sizeBuf.AppendNum(driveEntry.iVolumeInfo.iSize, TRealFormat(KDefaultRealWidth, 0));
-        textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
-        entryLines->AppendL(textEntry);   
-
-        showDialog = ETrue;
-        }
-    
-    else if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        // it is a file or a directory entry
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        TFileName textEntry;
-        
-        // set title
-        titleText.Append(fileEntry.iEntry.iName);
-        
-        // path
-        textEntry.Format(KPropertiesEntryStr, &KPath, &fileEntry.iPath);
-        entryLines->AppendL(textEntry);
-
-        // date
-        TTime entryModified = fileEntry.iEntry.iModified;
-        
-        // convert from universal time
-        if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
-            {
-            entryModified = fileEntry.iEntry.iModified; // use universal time
-            }
-        
-        TBuf<32> dateBuf;
-        entryModified.FormatL(dateBuf, KDateFormat);
-        textEntry.Format(KPropertiesEntryStr, &KDate, &dateBuf);
-        entryLines->AppendL(textEntry);
-
-        // time
-        TBuf<32> timeBuf;
-        entryModified.FormatL(timeBuf, KTimeFormat);
-        textEntry.Format(KPropertiesEntryStr, &KTime, &timeBuf);
-        entryLines->AppendL(textEntry);
-
-        if (!fileEntry.iEntry.IsDir())
-            {
-            // size
-            TBuf<32> sizeBuf;
-            sizeBuf.AppendNum(fileEntry.iEntry.iSize, TRealFormat(KDefaultRealWidth, 0));
-            textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
-            entryLines->AppendL(textEntry);            
-            }
-        else if (fileEntry.iEntry.IsDir() && iModel->Settings().iShowSubDirectoryInfo)
-            {
-            iFindFileEntryList->Reset();
-            
-            TFileName fullPath;
-            fullPath.Append(fileEntry.iPath);
-            fullPath.Append(fileEntry.iEntry.iName);
-            fullPath.Append(_L("\\"));
-            
-            // number of entries
-            CDir* subDir = NULL;
-            if (iFs.GetDir(fullPath, KEntryAttMatchMask, ESortNone | EDirsFirst, subDir) == KErrNone)
-                {
-                CleanupStack::PushL(subDir);
-                textEntry.Format(KPropertiesEntryInt, &KNumberOfEntries, subDir->Count());
-                entryLines->AppendL(textEntry);
-                CleanupStack::PopAndDestroy(); //subDir 
-                }
-            
-            // number of files
-            DoFindFiles(_L("*"), fullPath);
-            DoFindFilesRecursiveL(_L("*"), fullPath);
-            textEntry.Format(KPropertiesEntryInt, &KNumberOfFiles, iFindFileEntryList->Count());
-            entryLines->AppendL(textEntry);
-            
-            // size
-            TInt64 size(0);
-            for (TInt i=0; i<iFindFileEntryList->Count(); i++)
-                {
-                TFileEntry fileEntry = iFindFileEntryList->At(i);
-                size += fileEntry.iEntry.iSize;
-                }
-            
-            TBuf<32> sizeBuf;
-            sizeBuf.AppendNum(size, TRealFormat(KDefaultRealWidth, 0));
-            textEntry.Format(KPropertiesEntryStr, &KSize, &sizeBuf);
-            entryLines->AppendL(textEntry); 
-            
-            iFindFileEntryList->Reset();            
-            }
-        
-        // attributes
-        TBuf<32> attBuf;
-        if (fileEntry.iEntry.IsArchive())
-            attBuf.Append(_L("Arc "));
-        if (fileEntry.iEntry.IsHidden())
-            attBuf.Append(_L("Hid "));
-        if (fileEntry.iEntry.IsReadOnly())
-            attBuf.Append(_L("R/O "));
-        if (fileEntry.iEntry.IsSystem())
-            attBuf.Append(_L("Sys"));
-        textEntry.Format(KPropertiesEntryStr, &KAttributes, &attBuf);
-        entryLines->AppendL(textEntry);            
-
-        if (!fileEntry.iEntry.IsDir())
-            {
-            // mime type
-            TFileName fullPath = fileEntry.iPath;
-            fullPath.Append(fileEntry.iEntry.iName);
-            TDataType dataType;
-            TUid appUid;
-            if (iModel->LsSession().AppForDocument(fullPath, appUid, dataType) == KErrNone)
-                {
-                TBuf<128> mimeTypeBuf;
-                mimeTypeBuf.Copy(dataType.Des8());
-                if (mimeTypeBuf == KNullDesC)
-                    mimeTypeBuf.Copy(_L("N/A"));
-                textEntry.Format(KPropertiesEntryStr, &KMimeType, &mimeTypeBuf);
-                entryLines->AppendL(textEntry); 
-                }
-
-            // opens with
-            TApaAppInfo appInfo;
-            if (iModel->LsSession().GetAppInfo(appInfo, appUid) == KErrNone)
-                {
-                TFileName opensWithBuf;
-                _LIT(KOpensWithFormat, "%S (0x%08X)");
-                opensWithBuf.Format(KOpensWithFormat, &appInfo.iCaption, appInfo.iUid);
-                textEntry.Format(KPropertiesEntryStr, &KOpensWith, &opensWithBuf);
-                entryLines->AppendL(textEntry); 
-                }
-            }
-        
-        showDialog = ETrue;
-        }   
-
-
-    if (showDialog)
-        {
-        CAknSingleHeadingPopupMenuStyleListBox* listBox = new(ELeave) CAknSingleHeadingPopupMenuStyleListBox;
-        CleanupStack::PushL(listBox);
-        
-        CAknPopupList* popupList = CAknPopupList::NewL(listBox, R_AVKON_SOFTKEYS_OK_EMPTY, AknPopupLayouts::EMenuDoubleWindow);
-        CleanupStack::PushL(popupList);
-
-        listBox->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
-        listBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-        listBox->CreateScrollBarFrameL(ETrue);
-        listBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        listBox->Model()->SetItemTextArray(entryLines);
-        listBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
-        listBox->HandleItemAdditionL();
-        
-        popupList->SetTitleL(titleText);
-        popupList->ExecuteLD();
-        
-        CleanupStack::Pop(); // popupList
-        CleanupStack::PopAndDestroy(); // listBox
-        }
-
-    CleanupStack::PopAndDestroy(); //entryLines
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::OpenWithApparcL()
-    {
-    // just get current item
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        
-        TFileName fullPath = fileEntry.iPath;
-        fullPath.Append(fileEntry.iEntry.iName);
-        
-        TInt err1(KErrNone), err2(KErrNone);
-        TUid appUid;
-        TDataType dataType;
-        TBool isProgram;
-        
-        err1 = iModel->LsSession().AppForDocument(fullPath, appUid, dataType);
-        err2 = iModel->LsSession().IsProgram(fullPath, isProgram);
-        
-        if (err1 == KErrNone && err2 == KErrNone)
-            {
-            if (appUid != KNullUid)
-                {
-                // found an app, run using it
-                TApaTaskList taskList(iModel->EikonEnv()->WsSession());
-                TApaTask task = (taskList.FindApp(appUid));
-                if (task.Exists())
-                    {
-                    User::LeaveIfError(task.SwitchOpenFile(fullPath));
-                    task.BringToForeground();
-                    }
-                else
-                    {
-                    TThreadId id;
-                    iModel->LsSession().StartDocument(fullPath, appUid, id, RApaLsSession::ESwitchFiles);
-                    }
-                }
-            else if (isProgram)
-                {
-                LaunchProgramL(fullPath);
-                }            
-            }
-        }   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::HandleServerAppExit(TInt aReason)
-	{
-	if (iOpenFileService)
-		{
-		delete iOpenFileService;
-		iOpenFileService = NULL;
-		}
-	MAknServerAppExitObserver::HandleServerAppExit(aReason);
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::OpenWithDocHandlerL(TBool aEmbed)
-    {
-    // just get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        
-        TFileName fullPath = fileEntry.iPath;
-        fullPath.Append(fileEntry.iEntry.iName);
-
-        RFile sharableFile;
-        iDocHandler->OpenTempFileL(fullPath, sharableFile);
-        CleanupClosePushL(sharableFile);
-        TDataType dataType;
-        if (aEmbed)
-    	    iDocHandler->OpenFileEmbeddedL(sharableFile, dataType);
-        else
-    	    iDocHandler->OpenFileL(sharableFile, dataType);
-        CleanupStack::PopAndDestroy();  //sharableFile
-        }   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::OpenWithFileServiceL()
-    {
-    // just get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        
-        TFileName fullPath = fileEntry.iPath;
-        fullPath.Append(fileEntry.iEntry.iName);
-
-    	TBool itemSelected(EFalse);
-        RFile sharableFile;
-        TUid appUidExtracted;
-        
-        TRAPD(err,
-           
-        	// use doc handler to get a sharable file handle
-            iDocHandler->OpenTempFileL(fullPath, sharableFile);
-            CleanupClosePushL(sharableFile);
-            
-            // find the data type
-            TDataRecognitionResult dataType;
-        	User::LeaveIfError(iModel->LsSession().RecognizeData(sharableFile, dataType));
-
-        	// get all apps that support OpenFileService for this datatype
-        	CApaAppServiceInfoArray* apps = iModel->LsSession().GetServiceImplementationsLC(KOpenServiceUid, dataType.iDataType);
-        	TArray<TApaAppServiceInfo> appServiceInfos = apps->Array();
-    	
-        	if (appServiceInfos.Count() > 0)
-        		{
-        		// build an array of the app names
-        		CDesCArray* names = new (ELeave) CDesCArrayFlat(16);
-        		CleanupStack::PushL(names);
-        		for (TInt ii=0; ii<appServiceInfos.Count(); ii++)
-        			{
-        			TUid appUid = appServiceInfos[ii].Uid();
-        			TApaAppInfo appInfo;
-        			if (iModel->LsSession().GetAppInfo(appInfo, appUid) == KErrNone)
-        				{
-        				names->AppendL(appInfo.iCaption);
-        				}
-        			else
-        				{
-        				TBuf<10> buf;
-        				buf.Format(_L("0x%08x"), appUid);
-        				names->AppendL(buf);
-        				}
-        			}
-    		
-        		// use a list query to select the app
-        		TInt index(0);
-        		CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
-        		dlg->PrepareLC(R_APP_SELECTION_QUERY);
-        		dlg->SetItemTextArray(names);
-        		dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
-
-        		if(dlg->RunLD())
-        			{
-        			// extract the chosen UID
-        			appUidExtracted = appServiceInfos[index].Uid();
-        			itemSelected = ETrue;
-        			}
-    		
-        		CleanupStack::PopAndDestroy(); // names
-        		}
-
-            if (itemSelected)
-                {
-                // start OpenFileService for the selected app
-                CAiwGenericParamList& paramList = iDocHandler->InParamListL();
-                
-                if (iOpenFileService)
-                    {
-                    delete iOpenFileService;
-                    iOpenFileService = NULL;
-                    }
-
-                iOpenFileService = CAknOpenFileService::NewL(appUidExtracted, sharableFile, this, &paramList);
-                }
-
-            CleanupStack::PopAndDestroy(2); // sharableFile, apps
-
-            ); // TRAPD
-
-        if (err != KErrNone)
-            {
-            _LIT(KMessage, "No file service available for %S");
-            TFileName noteMsg;
-            noteMsg.Format(KMessage, &fileEntry.iEntry.iName);
-            
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(noteMsg);            
-            }
-        }   
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileUtils::FileExists(const TDesC& aPath)
-    {
-    return BaflUtils::FileExists(iFs, aPath);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::LaunchProgramL(const TDesC& aPath)
-    {
-    CApaCommandLine* commandLine = CApaCommandLine::NewLC();
-    commandLine->SetExecutableNameL(aPath);
-    commandLine->SetCommandL(EApaCommandRun);
-    TInt err = iModel->LsSession().StartApp(*commandLine);
-    CleanupStack::PopAndDestroy(); //commandLine
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::MemoryInfoPopupL()
-    {
-    _LIT(KUsedBytesEntry, "Used: %S bytes\n");
-    _LIT(KFreeBytesEntry, "Free: %S bytes\n");
-    _LIT(KSizeBytesEntry, "Size: %S bytes\n");
-        
-    HBufC* messageBuf = HBufC::NewLC(2048);
-    TPtr messagePtr = messageBuf->Des();
-    TBuf<128> entryLine;
-
-    // RAM
-    TMemoryInfoV1Buf ramMemory;
-    UserHal::MemoryInfo(ramMemory);
-    messagePtr.Append(_L("RAM\n"));
-
-    // used
-    TBuf<32> usedBuf;
-    usedBuf.AppendNum(ramMemory().iMaxFreeRamInBytes-ramMemory().iFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
-    entryLine.Format(KUsedBytesEntry, &usedBuf);
-    messagePtr.Append(entryLine);        
-
-    // free
-    TBuf<32> freeBuf;
-    freeBuf.AppendNum(ramMemory().iFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
-    entryLine.Format(KFreeBytesEntry, &freeBuf);
-    messagePtr.Append(entryLine);
-            
-    // size
-    TBuf<32> sizeBuf;
-    sizeBuf.AppendNum(ramMemory().iMaxFreeRamInBytes, TRealFormat(KDefaultRealWidth, 0));
-    entryLine.Format(KSizeBytesEntry, &sizeBuf);
-    messagePtr.Append(entryLine); 
-    
-    // All drives
-    for (TInt i=0; i<iDriveEntryList->Count(); i++)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(i);
-
-        messagePtr.Append(_L("\n"));
-        messagePtr.Append(driveEntry.iLetter);
-        messagePtr.Append(_L(":\n"));
-
-        // used
-        TBuf<32> usedBuf;
-        usedBuf.AppendNum(driveEntry.iVolumeInfo.iSize-driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
-        entryLine.Format(KUsedBytesEntry, &usedBuf);
-        messagePtr.Append(entryLine);        
-
-        // free
-        TBuf<32> freeBuf;
-        freeBuf.AppendNum(driveEntry.iVolumeInfo.iFree, TRealFormat(KDefaultRealWidth, 0));
-        entryLine.Format(KFreeBytesEntry, &freeBuf);
-        messagePtr.Append(entryLine);
-                
-        // size
-        TBuf<32> sizeBuf;
-        sizeBuf.AppendNum(driveEntry.iVolumeInfo.iSize, TRealFormat(KDefaultRealWidth, 0));
-        entryLine.Format(KSizeBytesEntry, &sizeBuf);
-        messagePtr.Append(entryLine); 
-        }
-
-    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-    dialog->PrepareLC(R_MEMORYINFO_DIALOG);
-    dialog->SetMessageTextL(messagePtr);
-    dialog->RunLD();
-    
-    CleanupStack::PopAndDestroy(); //messageBuf
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ShowFileCheckSumsL(TInt aType)
-    {
-     // get current item
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        TFileName fullPath = fileEntry.iPath;
-        fullPath.Append(fileEntry.iEntry.iName);
-        
-        // try to open the file for reading
-        RFile fileP;
-        TInt err = fileP.Open(iModel->EikonEnv()->FsSession(), fullPath, EFileRead|EFileShareReadersOnly);
-        
-        if (err == KErrNone)
-            {
-            CleanupClosePushL(fileP);
-
-            TBuf<128> checkSum;
-            HBufC* messageBuf = HBufC::NewLC(2048);
-            TPtr messagePtr = messageBuf->Des();
-            
-            // get MD5 checksum
-            if (aType == EFileBrowserCmdFileChecksumsMD5)
-                {
-                CMD5* md5 = CMD5::NewL();
-                CleanupStack::PushL(md5);
-                HBufC8* md5Buf = MessageDigestInHexLC(md5, fileP);
-                checkSum.Copy(*md5Buf);
-                messagePtr.Append(_L("MD5\n"));
-                messagePtr.Append(checkSum);
-                CleanupStack::PopAndDestroy(2); // md5, md5Buf
-                }
-
-            // get MD2 checksum
-            else if (aType == EFileBrowserCmdFileChecksumsMD2)
-                {                
-                CMD2* md2 = CMD2::NewL();
-                CleanupStack::PushL(md2);
-                HBufC8* md2Buf = MessageDigestInHexLC(md2, fileP);
-                checkSum.Copy(*md2Buf);
-                messagePtr.Append(_L("MD2\n"));
-                messagePtr.Append(checkSum);
-                CleanupStack::PopAndDestroy(2); // md2, md2Buf
-                }
-
-            // get SHA-1 checksum
-            else if (aType == EFileBrowserCmdFileChecksumsSHA1)
-                {
-                CSHA1* sha1 = CSHA1::NewL();
-                CleanupStack::PushL(sha1);
-                HBufC8* sha1Buf = MessageDigestInHexLC(sha1, fileP);
-                checkSum.Copy(*sha1Buf);
-                messagePtr.Append(_L("SHA-1\n"));
-                messagePtr.Append(checkSum);
-                CleanupStack::PopAndDestroy(2); // sha1, sha1Buf
-                }
-            
-            else
-                {
-                User::Panic(_L("Inv.CS.Type"), 723);
-                }
-                            
-            // show dialog
-            CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-            dialog->PrepareLC(R_CHECKSUMS_DIALOG);
-            dialog->SetMessageTextL(messagePtr);
-            dialog->SetHeaderTextL(fileEntry.iEntry.iName);
-            dialog->RunLD();
-    
-            CleanupStack::PopAndDestroy(2); // messageBuf, fileP
-            }
-        else
-            {
-            // open failed, show an error note
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver               
-            }
-            
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-HBufC8* CFileBrowserFileUtils::MessageDigestInHexLC(CMessageDigest* aMD, RFile& aFile)
-    {
-    // seek to file start
-    TInt startPos(0);
-    aFile.Seek(ESeekStart, startPos);
-
-    // create result buffer
-    HBufC8* result = HBufC8::NewLC(128);
-
-    const TInt KBufSize(1024);
-    TInt fileSize(0);
-    TInt fileOffset(0);
-
-    // get file size
-    aFile.Size(fileSize);
-
-    HBufC8* buf = HBufC8::NewMaxLC(KBufSize);
-    TPtr8 bufPtr(buf->Des());
-
-    // read to buffer
-    while (fileOffset < fileSize - KBufSize)
-        {
-        aFile.Read(bufPtr, KBufSize);
-        aMD->Hash(bufPtr);
-        fileOffset += bufPtr.Length();
-        }
-
-    aFile.Read(bufPtr, fileSize - fileOffset);
-    bufPtr.SetLength(fileSize - fileOffset);
-    
-    // get final message digest
-    TPtrC8 hashedSig(aMD->Final(bufPtr));
-    
-    // change size of the result buffer
-    result->ReAllocL(hashedSig.Length() * 2);
-    TPtr8 resultPtr = result->Des();
-
-    // convert to hex format
-    for (TInt i=0; i<hashedSig.Length(); i++)
-        {
-        resultPtr.AppendFormat(_L8("%+02x"), hashedSig[i]);
-        }
-                    
-    CleanupStack::PopAndDestroy(); // buf
-    
-    return result;
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetErrRdL(TBool aEnable)
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        TInt err(KErrNone);
-        
-        if (aEnable)
-            {
-            // make sure that the directory exists
-            iFileOps->MkDirAll(KErrRdPath);        
-
-            // create the file
-            err = iFileOps->CreateEmptyFile(KErrRdPath);
-            }
-        else    
-            {
-            // get TEntry of ErrRd
-            TEntry entry;
-            err = iFs.Entry(KErrRdPath, entry);
-            
-            if (err == KErrNone)
-                {
-                TFileEntry fileEntry;
-                fileEntry.iPath = KErrRdDir;
-                fileEntry.iEntry = entry;
-                
-                err = iFileOps->Delete(fileEntry);                
-                }
-            }        
-
-        // update view
-        RefreshViewL(); 
-    
-        if (err == KErrNone)    
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("State changed"));    
-            }
-        else    
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Cannot change the state"));    
-            }        
-        }
-    else
-        {
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Enable \"bypass platform security\" from the settings first"));          
-        }
-    #else
-        aEnable = aEnable;
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Not supported in lite version"));          
-    #endif
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::EnableAvkonIconCacheL(TBool aEnable)
-    {
-#ifndef __SERIES60_30__
-    if (AknIconConfig::EnableAknIconSrvCache(aEnable) == KErrNone)
-        {
-        CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-        note->ExecuteLD(_L("State changed"));        
-        }
-    else
-        {
-        CAknErrorNote* note = new(ELeave) CAknErrorNote;
-        note->ExecuteLD(_L("Unknown error occured"));        
-        }
- #else
-    aEnable = aEnable;
-    CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    note->ExecuteLD(_L("Not supported in S60 3.0"));  
- #endif
- 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SimulateLeaveL()
-    {
-    TInt leaveCode(-6);
-
-    CAknNumberQueryDialog* numberQuery = CAknNumberQueryDialog::NewL(leaveCode);
-    numberQuery->SetPromptL(_L("Leave code"));
-
-    if (numberQuery->ExecuteLD(R_GENERAL_NUMERIC_QUERY))    
-        {
-        User::Leave(leaveCode);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SimulatePanicL()
-    {
-    TInt panicCode(555);
-    TBuf<128> panicCategory;
-    panicCategory.Copy(_L("Test Category"));
-    
-    CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(panicCategory);
-    textQuery->SetPromptL(_L("Panic category"));
-    
-    if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-        {
-        CAknNumberQueryDialog* numberQuery = CAknNumberQueryDialog::NewL(panicCode);
-        numberQuery->SetPromptL(_L("Panic code"));
-
-        if (numberQuery->ExecuteLD(R_GENERAL_NUMERIC_QUERY))    
-            {
-            User::Panic(panicCategory, panicCode);
-            }        
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SimulateExceptionL()
-    {
-    TInt exceptionCode(0);
-
-    CAknNumberQueryDialog* numberQuery = CAknNumberQueryDialog::NewL(exceptionCode);
-    numberQuery->SetPromptL(_L("Exception code"));
-
-    if (numberQuery->ExecuteLD(R_GENERAL_NUMERIC_QUERY))    
-        {
-        User::RaiseException((TExcType)exceptionCode);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetDebugMaskL()
-    {
-    // get current debug mask
-    TUint32 dbgMask = UserSvr::DebugMask();
-    
-    // convert the value in hex format
-    TBuf<64> hexBuf;
-    hexBuf.Copy(_L("0x"));
-    hexBuf.AppendNum(dbgMask, EHex);
-    
-    // do the query
-    CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(hexBuf);
-    textQuery->SetPromptL(_L("Kernel debug mask in hex format"));
-
-    if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-        {
-        // check value
-        if (hexBuf.Length() > 2 && hexBuf[0]=='0' && hexBuf[1]=='x')
-            {
-            // remove 0x from the beginning
-            hexBuf.Copy(hexBuf.Right(hexBuf.Length()-2));
-            
-            // convert the string back to decimal
-            TLex converter;
-            converter.Assign(hexBuf);
-            
-            if (converter.Val(dbgMask, EHex) == KErrNone)
-                {
-                User::SetDebugMask(dbgMask);
-                
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Changed"));            
-                }
-            else
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Cannot convert value"));            
-                }        
-            }            
-        else        
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Not in hex format"));            
-            }
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::WriteAllAppsL()
-    {
-    _LIT(KAllAppsFileName, "AllApps.txt");
-    TFileName allAppsPath = PathInfo::PhoneMemoryRootPath();
-    allAppsPath.Append(KAllAppsFileName);
-
-    RFile file;
-    if (file.Replace(iFs, allAppsPath, EFileWrite) == KErrNone)
-        {
-        CleanupClosePushL(file);
-        
-        CDesC8Array* appsArray = new(ELeave) CDesC8ArrayFlat(192);
-        CleanupStack::PushL(appsArray);
-        
-        TBuf8<KMaxFileName> fileEntry;
-        TBuf8<KMaxFileName> appFullPath;
-        _LIT8(KAppEntryFormat, "%S (0x%08X)%S");
-        TApaAppInfo appInfo;
-
-        iModel->LsSession().GetAllApps();        
-
-        while (iModel->LsSession().GetNextApp(appInfo) == KErrNone)
-            {
-            appFullPath.Copy(appInfo.iFullName);
-            fileEntry.Format(KAppEntryFormat, &appFullPath, appInfo.iUid, &KFileNewLine);
-            appsArray->AppendL(fileEntry);    
-            }
-        
-        appsArray->Sort();
-        
-        for (TInt i=0; i<appsArray->Count(); i++)
-            {
-            file.Write(appsArray->MdcaPoint(i));
-            }
-        
-        CleanupStack::PopAndDestroy(2); //appsArray, file
-        
-        _LIT(KMessage, "App list written to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allAppsPath);
-        
-        CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }
-    else
-        {
-        _LIT(KMessage, "Failed writing to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allAppsPath);
-        
-        CAknErrorNote* note = new(ELeave) CAknErrorNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::WriteAllFilesL()
-    {
-    _LIT(KAllFilesFileName, "AllFiles.txt");
-    TFileName allFilesPath = PathInfo::PhoneMemoryRootPath();
-    allFilesPath.Append(KAllFilesFileName);
-
-    RFile file;
-    if (file.Replace(iFs, allFilesPath, EFileWrite) == KErrNone)
-        {
-        CleanupClosePushL(file);
-        iFindFileEntryList->Reset();
-        
-        iModel->EikonEnv()->BusyMsgL(_L("** Generating **"), TGulAlignment(EHCenterVTop));
-        
-        for (TInt i=0; i<iDriveEntryList->Count(); i++)
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(i);
-
-            TBuf<10> driveRoot;
-            driveRoot.Append(driveEntry.iLetter);
-            driveRoot.Append(_L(":\\"));
-
-            // current dir
-            DoFindFiles(_L("*"), driveRoot);
-            
-            // recurse into sub directories
-            DoFindFilesRecursiveL(_L("*"), driveRoot);
-            }
-        
-        // write entries
-        TBuf8<KMaxFileName> writeBuf;
-        for (TInt i=0; i<iFindFileEntryList->Count(); i++)
-            {
-            TFileEntry fileEntry = iFindFileEntryList->At(i);
-            
-            writeBuf.Copy(fileEntry.iPath);
-            writeBuf.Append(fileEntry.iEntry.iName);
-            writeBuf.Append(KFileNewLine);
-            
-            file.Write(writeBuf);
-            }
-        
-        iModel->EikonEnv()->BusyMsgCancel();
-        
-        CleanupStack::PopAndDestroy(); //file
-        iFindFileEntryList->Reset();
-        
-        _LIT(KMessage, "File list written to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allFilesPath);
-        
-        CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }
-    else
-        {
-        _LIT(KMessage, "Failed writing to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allFilesPath);
-        
-        CAknErrorNote* note = new(ELeave) CAknErrorNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::DoFindFiles(const TDesC& aFileName, const TDesC& aPath)
-    {
-    TFindFile fileFinder(iFs);
-    CDir* dir;
-    TInt err = fileFinder.FindWildByPath(aFileName, &aPath, dir);
-
-    while (err == KErrNone)
-        {
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-
-            // ignore any directory entries
-            if (!entry.IsDir() && entry.iName.Length() && aPath.Length())
-                {
-                TParse parsedName;
-                parsedName.Set(entry.iName, &fileFinder.File(), NULL);
-                
-                if (parsedName.Drive().Length() && aPath.Length() && parsedName.Drive()[0] == aPath[0])
-                    {
-                    TFileEntry fileEntry;
-                    fileEntry.iPath = parsedName.DriveAndPath();
-                    fileEntry.iEntry = entry;
-                    fileEntry.iDirEntries = KErrNotFound;
-                    fileEntry.iIconId = EFixedIconEmpty;
-                    
-                    TRAP(err, iFindFileEntryList->AppendL(fileEntry));             
-                    }
-                }
-            }
-
-        delete dir;
-        dir = NULL;
-        err = fileFinder.FindWild(dir);
-        }
-
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserFileUtils::DoFindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
-	{
-    TInt err(KErrNone);
-    CDirScan* scan = CDirScan::NewLC(iFs);
-    scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchMask, ESortByName | EAscending | EDirsFirst);
-    CDir* dir = NULL;
-
-    for(;;)
-        {
-        TRAP(err, scan->NextL(dir));
-        if (!dir  || (err != KErrNone))
-            break;
-
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-            
-            if (entry.IsDir())
-                {
-                TFileName path(scan->FullPath());
-                
-                if (path.Length())
-                    {
-                    path.Append(entry.iName);
-                    path.Append(_L("\\"));
-                    DoFindFiles(aFileName, path);
-                    }
-                }
-            }
-        delete(dir);
-        }
-
-    CleanupStack::PopAndDestroy(scan);
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ListOpenFilesL()
-    {
-    iFileEntryList->Reset();
-
-    CFileList* dir = NULL;
-    TOpenFileScan fileScan(iFs);
-    fileScan.NextL(dir);
-    
-    while (dir)
-        {
-        for (TInt i=0; i<dir->Count(); i++)
-            {
-            TEntry entry = (*dir)[i];
-            TFileName fullPath;
-
-            // TOpenFileScan does not return drive letters for the entries, so try to guess it
-            if (entry.iName.Length() > 2 && entry.iName[1] != ':')
-                {
-                for (TInt i=0; i<iDriveEntryList->Count(); i++)
-                    {
-                    TDriveEntry driveEntry = iDriveEntryList->At(i);
-                    
-                    TFileName guessPath;
-                    guessPath.Append(driveEntry.iLetter);
-                    guessPath.Append(_L(":"));
-                    guessPath.Append(entry.iName);
-                    
-                    // check if the file exists
-                    if (BaflUtils::FileExists(iFs, guessPath))
-                        {
-                        // if it's on read only drive, then take it or check if it's really in use
-                        TBool readOnlyDrive(ETrue);
-                        BaflUtils::DiskIsReadOnly(iFs, guessPath, readOnlyDrive);
-                        
-                        if (readOnlyDrive || iFs.SetEntry(guessPath, entry.iModified, NULL, NULL) == KErrInUse)
-                            {
-                            fullPath = guessPath;
-                            break;
-                            }
-                        }
-                    }
-                }
-            else
-                {
-                fullPath = entry.iName;   
-                }
-
-            TParse nameParser;
-            if (fullPath.Length() && nameParser.SetNoWild(fullPath, NULL, NULL) == KErrNone)
-                {
-                entry.iName = nameParser.NameAndExt();
-                
-                TFileEntry fileEntry;
-                fileEntry.iPath = nameParser.DriveAndPath();
-                fileEntry.iEntry = entry;
-                fileEntry.iDirEntries = KErrNotFound;
-                fileEntry.iIconId = EFixedIconEmpty;
-                
-                iFileEntryList->AppendL(fileEntry);                
-                }
-            }
-            
-        delete dir;
-        dir = NULL;
-        fileScan.NextL(dir);
-        }
-
-    TInt operations = iFileEntryList->Count();
-    
-    iListingMode = EOpenFiles;
-    iModel->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
-    RefreshViewL();            
-
-    _LIT(KMessage, "%d open files found");
-    TFileName noteMsg;
-    noteMsg.Format(KMessage, operations);
-    
-    CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    note->ExecuteLD(noteMsg);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ListMessageAttachmentsL(TInt aType)
-    {
-    iFileEntryList->Reset();
-
-    CMsvSession* session = CMsvSession::OpenSyncL(*this);
-    CleanupStack::PushL(session);
-    
-    CMsvEntry* context = NULL;
-    
-    if (aType == EFileBrowserCmdToolsMsgAttachmentsInbox)
-        context = session->GetEntryL(KMsvGlobalInBoxIndexEntryId);
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsDrafts)
-        context = session->GetEntryL(KMsvDraftEntryId);
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsSentItems)
-        context = session->GetEntryL(KMsvSentEntryId);
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsOutbox)
-        context = session->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
-    else
-        User::Panic(_L("MsgAtt.Mode"), 100);
-    
-    CleanupStack::PushL(context);
-    
-    CDesCArray* attPaths = new(ELeave) CDesCArrayFlat(128);
-    CleanupStack::PushL(attPaths);
-    
-    // read attachment paths
-    ReadAttachmentPathsRecursiveL(session, context, attPaths);
-    
-    // create file entries of the paths
-    for (TInt i=0; i<attPaths->MdcaCount(); i++)
-        {
-        TFileEntry fileEntry;
-        TEntry entry;
-        TParse nameParser;
-        
-        if (attPaths->MdcaPoint(i).Length() &&
-            nameParser.SetNoWild(attPaths->MdcaPoint(i), NULL, NULL) == KErrNone &&
-            iFs.Entry(attPaths->MdcaPoint(i), entry) == KErrNone)
-            {
-            TFileEntry fileEntry;
-            fileEntry.iPath = nameParser.DriveAndPath();
-            fileEntry.iEntry = entry;
-            fileEntry.iDirEntries = KErrNotFound;
-            fileEntry.iIconId = EFixedIconEmpty;
-
-            iFileEntryList->AppendL(fileEntry);                
-            }
-        }
-    
-    CleanupStack::PopAndDestroy(3); //session, context, attPaths
-            
-    TInt operations = iFileEntryList->Count();
-    
-    if (aType == EFileBrowserCmdToolsMsgAttachmentsInbox)
-        iListingMode = EMsgAttachmentsInbox;
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsDrafts)
-        iListingMode = EMsgAttachmentsDrafts;
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsSentItems)
-        iListingMode = EMsgAttachmentsSentItems;
-    else if (aType == EFileBrowserCmdToolsMsgAttachmentsOutbox)
-        iListingMode = EMsgAttachmentsOutbox;
-
-    iModel->FileListContainer()->ListBox()->SetCurrentItemIndex(0);
-    RefreshViewL();            
-
-    _LIT(KMessage, "%d files found");
-    TFileName noteMsg;
-    noteMsg.Format(KMessage, operations);
-    
-    CAknInformationNote* note = new(ELeave) CAknInformationNote;
-    note->ExecuteLD(noteMsg);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ReadAttachmentPathsRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, CDesCArray* aAttPaths)
-    {
-    CMsvEntrySelection* entrySelection = aContext->ChildrenL(); 
-    CleanupStack::PushL(entrySelection);
-    
-    for (TInt i=0; i<entrySelection->Count(); i++)
-        {
-        CMsvEntry* entry = aSession->GetEntryL((*entrySelection)[i]);
-        CleanupStack::PushL(entry);
-        
-        CMsvStore* store = NULL;
-        TRAPD(err, store = entry->ReadStoreL());
-        
-        if (err == KErrNone)
-            {
-            CleanupStack::PushL(store);
-
-            for (TInt j=0; j<store->AttachmentManagerL().AttachmentCount(); j++)
-                {
-                CMsvAttachment* attachment = store->AttachmentManagerL().GetAttachmentInfoL(j);
-                CleanupStack::PushL(attachment);
-                
-                aAttPaths->AppendL(attachment->FilePath());
-                
-                CleanupStack::PopAndDestroy(); //attachment
-                }
-            CleanupStack::PopAndDestroy(); // store
-            }
-
-        // recurse into children
-        if (entry->Count() > 0)
-            {
-            ReadAttachmentPathsRecursiveL(aSession, entry, aAttPaths);
-            }
-
-        CleanupStack::PopAndDestroy(); // entry
-        }      
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::WriteMsgStoreWalkL()
-    {
-    _LIT(KAllAppsFileName, "MsgStoreWalk.txt");
-    TFileName allAppsPath = PathInfo::PhoneMemoryRootPath();
-    allAppsPath.Append(KAllAppsFileName);
-
-    if (iMsgStoreWalkFile.Replace(iFs, allAppsPath, EFileWrite) == KErrNone)
-        {
-        CMsvSession* session = CMsvSession::OpenSyncL(*this);
-        CleanupStack::PushL(session);
-        
-        CMsvEntry* context = session->GetEntryL(KMsvRootIndexEntryId);
-        CleanupStack::PushL(context);
-        
-        iMsgStoreWalkFile.Write(_L8("id  service_id  related_id  type  mtm  date  size  error  biotype  mtmdata1  mtmdata2  mtmdata3  description  details\r\n\r\n"));
-        
-        // write details about the root entry
-        DoWriteMessageEntryInfoL(context, iMsgStoreWalkFile, 0);
-        
-        // get and write info recursively
-        TInt level(1);        
-        WriteMessageEntryInfoRecursiveL(session, context, iMsgStoreWalkFile, level);
-
-        CleanupStack::PopAndDestroy(2); //session, context
-        
-        iMsgStoreWalkFile.Flush();
-        iMsgStoreWalkFile.Close();
-        
-        _LIT(KMessage, "Msg. store walk written to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allAppsPath);
-        
-        CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }
-    else
-        {
-        _LIT(KMessage, "Failed writing to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allAppsPath);
-        
-        CAknErrorNote* note = new(ELeave) CAknErrorNote();
-        note->SetTimeout(CAknNoteDialog::ENoTimeout);
-        note->ExecuteLD(noteMsg);
-        }    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::WriteMessageEntryInfoRecursiveL(CMsvSession* aSession, CMsvEntry* aContext, RFile& aFile, TInt& aLevel)
-    {
-    CMsvEntrySelection* entrySelection = aContext->ChildrenL(); 
-    CleanupStack::PushL(entrySelection);
-    
-    for (TInt i=0; i<entrySelection->Count(); i++)
-        {
-        CMsvEntry* entry = aSession->GetEntryL((*entrySelection)[i]);
-        CleanupStack::PushL(entry);
-        
-        DoWriteMessageEntryInfoL(entry, aFile, aLevel);
-
-        // recurse into children
-        if (entry->Count() > 0)
-            {
-            aLevel++;
-            WriteMessageEntryInfoRecursiveL(aSession, entry, aFile, aLevel);
-            aLevel--;
-            }
-
-        CleanupStack::PopAndDestroy(); // entry
-        }      
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DoWriteMessageEntryInfoL(CMsvEntry* aContext, RFile& aFile, TInt aLevel)
-    {
-    TMsvEntry messageEntry = aContext->Entry();
-    
-    for (TInt j=0; j<aLevel; j++)
-        {
-        aFile.Write(_L8("     "));
-        }
-
-    TBuf8<256> desc;
-    desc.Copy(messageEntry.iDescription);
-
-    TBuf8<256> details;
-    details.Copy(messageEntry.iDetails);
-
-    _LIT8(KLine, "-> %d  %d  %d  %d  %d  %Ld  %d  %d  %d  %d  %d  %d  %S  %S\r\n");
-    TBuf8<1024> buf;
-    buf.Format(KLine, messageEntry.Id(), messageEntry.iServiceId, messageEntry.iRelatedId, messageEntry.iType.iUid,
-        messageEntry.iMtm.iUid, messageEntry.iDate.Int64(), messageEntry.iSize, messageEntry.iError, messageEntry.iBioType,
-        messageEntry.iMtmData1, messageEntry.iMtmData2, messageEntry.iMtmData3, &desc, &details);
-
-    aFile.Write(buf);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::FileEditorL(TInt aType)
-    {
-    // just get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-        
-        // only valid for files
-        if (!fileEntry.iEntry.IsDir())
-            {
-            TFileName fullPath = fileEntry.iPath;
-            fullPath.Append(fileEntry.iEntry.iName);
-
-            iModel->FileListContainer()->SetNaviPaneTextL(fileEntry.iEntry.iName);
-    
-            TInt editorMode(0);
-            
-            if (aType == EFileBrowserCmdFileViewText)
-                editorMode = EFileEditorViewAsText;
-            else if (aType == EFileBrowserCmdFileViewHex)
-                editorMode = EFileEditorViewAsHex;
-            else if (aType == EFileBrowserCmdFileEditText)
-                editorMode = EFileEditorEditAsText;
-            else if (aType == EFileBrowserCmdFileEditHex)
-                editorMode = EFileEditorEditAsHex;
-            else
-                User::Panic(_L("Inv.Ed.Mode"), 843);
-            
-            // launch dialog
-            CFileBrowserFileEditorDlg* dlg = CFileBrowserFileEditorDlg::NewL(fullPath, editorMode);
-            dlg->RunDlgLD();
-
-            iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);
-            
-            if (aType == EFileBrowserCmdFileEditText || aType == EFileBrowserCmdFileEditHex)
-                RefreshViewL();        
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserFileUtils::DriveSnapShotPossible()
-    {
-    // check that E-drive is available
-    TBool EDriveIsOK(EFalse);
-    
-    for (TInt i=0; i<iDriveEntryList->Count(); i++)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(i);
-        
-        if (driveEntry.iNumber == EDriveE)
-            {
-            if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked || driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAbsent)
-                EDriveIsOK = EFalse;
-            else
-                EDriveIsOK = ETrue;
-            }
-        }
-    
-    if (!EDriveIsOK)
-        return EFalse;
-    
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
- 
-        // drive snapshot not possible when E-drive is highlighted, since that's where we are copying
-        if (driveEntry.iNumber == EDriveE)
-            return EFalse;
-        else
-            return ETrue;
-        }
-    
-    return EFalse;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DriveSnapShotL()
-    {
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        // get current item 
-        TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-
-        if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-            
-            TChar sourceDriveLetter = driveEntry.iLetter;
-            TChar targetDriveLetter = 'E';  // hardcoded drive letter, could be better if would be queried from the user
-            
-            // append to the command array
-            AppendToCommandArrayL(EFileBrowserFileOpCommandDriveSnapShot,
-                                  new(ELeave)CCommandParamsDriveSnapShot(sourceDriveLetter, targetDriveLetter)
-                                 );
-                                 
-            // execute the operation
-            StartExecutingCommandsL(_L("Copying"));
-            }
-        }
-    else
-        {
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Enable \"bypass platform security\" from the settings first"));          
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetDrivePasswordL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TMediaPassword oldPassword;
-        TMediaPassword newPassword;
-        TFileName oldPassword16;
-        TFileName newPassword16;
-        
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        // query existing password if it already exists
-        if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword)
-            {
-            CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(oldPassword16);
-            textQuery->SetPromptL(_L("Existing password:"));
-            
-            if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-                {
-                ConvertCharsToPwd(oldPassword16, oldPassword);    
-                }
-            else
-                {
-                return;    
-                }            
-            }
-        
-        // query new password    
-        newPassword16.Copy(oldPassword16);
-        
-        CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(newPassword16);
-        textQuery->SetPromptL(_L("New password:"));
-        
-        if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-            {
-            ConvertCharsToPwd(newPassword16, newPassword);
-            
-            // set the password, does not actually lock the drive
-            TInt err = iFs.LockDrive(driveEntry.iNumber, oldPassword, newPassword, ETrue);
-            
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Password set"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }
-            
-            RefreshViewL();
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::UnlockDriveL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-
-        // check if the drive is locked
-        if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked)
-            {
-            TMediaPassword oldPassword;
-            TFileName oldPassword16;
-
-            CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(oldPassword16);
-            textQuery->SetPromptL(_L("Existing password:"));
-
-            if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-                {
-                ConvertCharsToPwd(oldPassword16, oldPassword);
-                
-                // unlock the drive
-                TInt err = iFs.UnlockDrive(driveEntry.iNumber, oldPassword, ETrue) == KErrNone;
-                
-                if (err == KErrNone)
-                    {
-                    CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                    note->ExecuteLD(_L("Drive unlocked"));                     
-                    }
-                else if (err == KErrNotSupported)
-                    {
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(_L("Not supported for this drive"));                     
-                    }
-                else
-                    {
-                    CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                        
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                    CleanupStack::PopAndDestroy();  //textResolver                       
-                    }
-                
-                RefreshViewL();
-                }
-            }
-        else
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("This drive is not locked"));             
-            }
-
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ClearDrivePasswordL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        // check if the drive has a password
-        if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword)
-            {
-            TMediaPassword oldPassword;
-            TFileName oldPassword16;
-
-            CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(oldPassword16);
-            textQuery->SetPromptL(_L("Existing password:"));
-
-            if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-                {
-                ConvertCharsToPwd(oldPassword16, oldPassword);
-                
-                // clear the password from the drive
-                TInt err = iFs.ClearPassword(driveEntry.iNumber, oldPassword);
-                
-                if (err == KErrNone)
-                    {
-                    CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                    note->ExecuteLD(_L("Password cleared"));                     
-                    }
-                else if (err == KErrNotSupported)
-                    {
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(_L("Not supported for this drive"));                     
-                    }
-                else
-                    {
-                    CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                        
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                    CleanupStack::PopAndDestroy();  //textResolver                       
-                    }
-                
-                RefreshViewL();
-                }
-            }
-        else
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("This drive has no password"));                     
-            }    
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::EraseDrivePasswordL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        // check if the drive has a password
-        if (driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword)
-            {
-            CAknQueryDialog* query = CAknQueryDialog::NewL();
-            
-            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you sure? All data can be lost!")))
-                {
-                // erase the password from the drive
-                TInt err(KErrNone);
-                err = iFs.ErasePassword(driveEntry.iNumber);
-                
-                if (err == KErrNone)
-                    {
-                    CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                    note->ExecuteLD(_L("Password erased"));                     
-                    }
-                else if (err == KErrNotSupported)
-                    {
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(_L("Not supported for this drive"));                     
-                    }
-                else
-                    {
-                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                    note->ExecuteLD(_L("Cannot erase, you may have to format the drive first"));                     
-                    }
-
-                RefreshViewL();
-                }
-            }
-        else
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("This drive has no password"));                     
-            }         
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::FormatDriveL(TBool aQuickFormat)
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        CAknQueryDialog* query = CAknQueryDialog::NewL();
-        
-        if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you sure? All data will be lost!")))
-            {
-            TInt err(KErrNone);
-            TInt formatCount(0);
-            
-            TBuf<10> driveRoot;
-            driveRoot.Append(driveEntry.iLetter);
-            driveRoot.Append(_L(":"));
-            
-            TUint formatMode(0);
-            if (aQuickFormat)
-                formatMode = ESpecialFormat|EQuickFormat;
-            else
-                formatMode = ESpecialFormat|EFullFormat;
-            
-            // set as system application to prevent getting shut down events
-            iModel->EikonEnv()->SetSystem(ETrue);
-            
-            // first close any open applications            
-            CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
-            CleanupStack::PushL(BSWrapper);
-
-            TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
-            BSWrapper->NotifyBackupOperationL(atts);
-            
-            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-            BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
-            waiter->StartAndWait();
-            CleanupStack::PopAndDestroy(); //waiter
-
-            // some delay to make sure all applications have been closed
-            User::After(1000000);
-
-            // format the drive
-            RFormat format;
-            err = format.Open(iFs, driveRoot, formatMode, formatCount);
-            
-            // Forced format for locked card
-            if ( err == KErrLocked )
-                {
-                // Erase password and try again
-                err = iFs.ErasePassword( driveEntry.iNumber );
-                if ( !err )
-                    {
-                    err = format.Open(iFs, driveRoot, formatMode, formatCount);
-                    }
-                }
-
-            if( err != KErrNone &&  err != KErrLocked )
-                {
-                CAknQueryDialog* lockQuery = CAknQueryDialog::NewL();
-                if ( lockQuery->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Memory card in use by other application. Proceed anyway?")))
-                    {
-                    // If format could not be started, someone is still keeping
-                    // files open on media. Let's try to dismount file system, then 
-                    // remount with own extension embedded and try again.
-
-                    TFullName fsName;
-                    err = iFs.FileSystemName( fsName, driveEntry.iNumber );
-
-                    if ( err == KErrNone && fsName.Length() > 0 )
-                        {
-                        // Prevent SysAp shutting down applications
-                        RProperty::Set(
-                            KPSUidCoreApplicationUIs,
-                            KCoreAppUIsMmcRemovedWithoutEject,
-                            ECoreAppUIsEjectCommandUsed );
-
-                        TRequestStatus stat;
-                        iFs.NotifyDismount( driveEntry.iNumber, stat, EFsDismountForceDismount );
-                        User::WaitForRequest( stat );
-
-                        // Unfortunately, at the moment we have to wait until clients have received 
-                        // notification about card dismount. Otherwise at least causes problems with 
-                        // theme selected from card. In future clients should use new notify-API.
-                        User::After( KForcedFormatTimeout );
-
-                        // Let's set priority higher than normally. This is done to decrease the chance 
-                        // that someone reopens files on memory card after mandatory file system 
-                        // remounting hence preventing formatting again.
-                        TThreadPriority priority( RThread().Priority() );
-                        RThread().SetPriority( EPriorityAbsoluteHigh );
-
-                        // Mount file system back...
-                        err = iFs.MountFileSystem( fsName, driveEntry.iNumber );
-                        err = format.Open(iFs, driveRoot, formatMode, formatCount);
-                        RThread().SetPriority( priority );
-                        }
-                    }
-                }
-            
-            
-            if (err == KErrNone)
-                {
-                // needs to be implemented with active objects
-                // CAknProgressDialog* dlg = new(ELeave) CAknProgressDialog(formatCount, 1, 1, NULL);
-                // dlg->SetTone(CAknNoteDialog::ENoTone);
-                // dlg->ExecuteLD(R_FORMAT_PROGRESS_NOTE);
-                
-                while (formatCount && err == KErrNone)
-                    {
-                    err = format.Next(formatCount);
-                    }
-                }
-
-            format.Close();
-
-            // restart closed applications
-            TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
-            BSWrapper->NotifyBackupOperationL(atts2);
-            BSWrapper->RestartAll();
-            CleanupStack::PopAndDestroy(); //BSWrapper
-
-            // system status not needed anymore
-            iModel->EikonEnv()->SetSystem(EFalse);
-                                    
-                                    
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Format succeeded"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }
-
-            RefreshViewL();
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::EraseMBRL()
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        // get current item 
-        TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-        
-        if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-            
-            CAknQueryDialog* query = CAknQueryDialog::NewL();
-            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you sure? Your media driver must support this!")))
-                {
-
-                CAknQueryDialog* query2 = CAknQueryDialog::NewL();
-                if (query2->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you really sure you know what are you doing ?!?")))
-                    {
-                    // warn if the selected drive is not detected as removable
-                    TBool proceed(EFalse);                    
-
-                    if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable)
-                        {
-                        proceed = ETrue;
-                        }
-                    else
-                        {
-                        CAknQueryDialog* query3 = CAknQueryDialog::NewL();
-                        if (query3->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Selected drive is not removable, really continue?")))
-                            proceed = ETrue;
-                        else
-                            proceed = EFalse;                        
-                        }
-                                    
-                    if (proceed)
-                        {
-                        TInt err(KErrNone);
-                        
-                        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                        note->ExecuteLD(_L("Please wait, this may take 30 seconds"));
-                        
-                        // set as system application to prevent getting shut down events
-                        iModel->EikonEnv()->SetSystem(ETrue);
-                        
-                        // first close any open applications            
-                        CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
-                        CleanupStack::PushL(BSWrapper);
-            
-                        TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
-                        BSWrapper->NotifyBackupOperationL(atts);
-                        
-                        CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-                        BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
-                        waiter->StartAndWait();
-                        CleanupStack::PopAndDestroy(); //waiter
-            
-                        // some delay to make sure all applications have been closed
-                        User::After(1000000);
-                        
-                        
-                        // do the erase MBR operation
-                        err = iFileOps->EraseMBR(driveEntry.iNumber);
-                        
-                        
-                        // restart closed applications
-                        TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
-                        BSWrapper->NotifyBackupOperationL(atts2);
-                        BSWrapper->RestartAll();
-                        CleanupStack::PopAndDestroy(); //BSWrapper
-            
-                        // system status not needed anymore
-                        iModel->EikonEnv()->SetSystem(EFalse);
-                                                
-                                                
-                        if (err == KErrNone)
-                            {
-                            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                            note->ExecuteLD(_L("Erase MBR succeeded"));                     
-                            }
-                        else if (err == KErrNotSupported)
-                            {
-                            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                            note->ExecuteLD(_L("Not supported for this drive"));                     
-                            }
-                        else
-                            {
-                            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                                
-                            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                            CleanupStack::PopAndDestroy();  //textResolver                       
-                            }
-            
-                        RefreshViewL();
-                        }
-                    }
-                }
-            }
-        }
-    else
-        {
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Enable \"bypass platform security\" from the settings first"));          
-        }
-    #else
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Not supported in lite version"));          
-    #endif
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::PartitionDriveL()
-    {
-    #ifndef FILEBROWSER_LITE
-    if (iModel->Settings().iBypassPlatformSecurity)
-        {
-        // get current item 
-        TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-        
-        if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-            
-            CAknQueryDialog* query = CAknQueryDialog::NewL();
-            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you sure? Your media driver must support this!")))
-                {
-
-                CAknQueryDialog* query2 = CAknQueryDialog::NewL();
-                if (query2->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you really sure you know what are you doing ?!?")))
-                    {
-                    // warn if the selected drive is not detected as removable
-                    TBool proceed(EFalse);                    
-
-                    if (driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable)
-                        {
-                        proceed = ETrue;
-                        }
-                    else
-                        {
-                        CAknQueryDialog* query3 = CAknQueryDialog::NewL();
-                        if (query3->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Selected drive is not removable, really continue?")))
-                            proceed = ETrue;
-                        else
-                            proceed = EFalse;                        
-                        }
-                                    
-                    if (proceed)
-                        {
-                        // query if erase mbr
-                        TBool eraseMBR(EFalse);
-                        
-                        CAknQueryDialog* query4 = CAknQueryDialog::NewL();
-                        if (query4->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Erase MBR first (normally needed)?")))
-                            {
-                            eraseMBR = ETrue;
-                            }
-                        
-                        
-                        // query amount of partitions from user
-                        TInt queryIndex(0);
-                        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
-
-                        if (listQueryDlg->ExecuteLD(R_PARTITION_AMOUNT_QUERY))
-                            {
-                            TInt amountOfPartitions = queryIndex + 1;  // selections are 1..4
-               
-                            TInt err(KErrNone);
-                            
-                            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                            note->ExecuteLD(_L("Please wait, this may take 30 seconds"));
-
-                            // set as system application to prevent getting shut down events
-                            iModel->EikonEnv()->SetSystem(ETrue);
-                            
-                            // first close any open applications            
-                            CBaBackupSessionWrapper* BSWrapper = CBaBackupSessionWrapper::NewL();
-                            CleanupStack::PushL(BSWrapper);
-                
-                            TBackupOperationAttributes atts(MBackupObserver::EReleaseLockNoAccess, MBackupOperationObserver::EStart);
-                            BSWrapper->NotifyBackupOperationL(atts);
-                            
-                            CAsyncWaiter* waiter = CAsyncWaiter::NewLC();
-                            BSWrapper->CloseAll( MBackupObserver::EReleaseLockNoAccess, waiter->iStatus );
-                            waiter->StartAndWait();
-                            CleanupStack::PopAndDestroy(); //waiter
-                
-                            // some delay to make sure all applications have been closed
-                            User::After(1000000);
-                            
-                            // do the erase operation
-                            if (eraseMBR)
-                                {
-                                err = iFileOps->EraseMBR(driveEntry.iNumber);
-                                
-                                if (err != KErrNone)
-                                    {
-                                    CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                                    note->ExecuteLD(_L("Erase MBR failed"));                     
-                                    }
-
-                                User::After(500000);
-                                }
-                            
-                            
-                            // do the partition operation
-                            err = iFileOps->PartitionDrive(driveEntry.iNumber, amountOfPartitions);
-                            
-                            
-                            // restart closed applications
-                            TBackupOperationAttributes atts2(MBackupObserver::ETakeLock, MBackupOperationObserver::EEnd);
-                            BSWrapper->NotifyBackupOperationL(atts2);
-                            BSWrapper->RestartAll();
-                            CleanupStack::PopAndDestroy(); //BSWrapper
-                
-                            // system status not needed anymore
-                            iModel->EikonEnv()->SetSystem(EFalse);
-                                                    
-                                                    
-                            if (err == KErrNone)
-                                {
-                                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                                note->ExecuteLD(_L("Partition succeeded"));                     
-                                }
-                            else if (err == KErrNotSupported)
-                                {
-                                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                                note->ExecuteLD(_L("Not supported for this drive"));                     
-                                }
-                            else
-                                {
-                                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                                    
-                                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                                CleanupStack::PopAndDestroy();  //textResolver                       
-                                }
-                
-                            RefreshViewL();
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    else
-        {
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Enable \"bypass platform security\" from the settings first"));          
-        }
-    #else
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Not supported in lite version"));          
-    #endif
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::CheckDiskL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        TBuf<10> driveRoot;
-        driveRoot.Append(driveEntry.iLetter);
-        driveRoot.Append(_L(":"));
-        
-        // check disk
-        TInt err = iFs.CheckDisk(driveRoot);
-
-        if (err == KErrNone)
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("Integrity of the disk is ok"));                     
-            }
-        else if (err == KErrNotReady)
-            {
-            CAknInformationNote* note = new(ELeave) CAknInformationNote;
-            note->ExecuteLD(_L("Disk is empty"));                     
-            }
-        else if (err == KErrNotSupported)
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Not supported for this drive"));                     
-            }
-        else
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Disk is corrupted"));                     
-            }        
-
-        RefreshViewL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ScanDriveL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        CAknQueryDialog* query = CAknQueryDialog::NewL();
-        
-        if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("This finds errors on disk and corrects them. Proceed?")))
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-            
-            TBuf<10> driveRoot;
-            driveRoot.Append(driveEntry.iLetter);
-            driveRoot.Append(_L(":"));
-            
-            // scan disk
-            TInt err = iFs.ScanDrive(driveRoot);
-
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Run succesfully"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }        
-
-            RefreshViewL();
-            }
-        }
-    }
-
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetDriveNameL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-
-        TFileName driveName;
-        
-        // get existing drive name
-        iFs.GetDriveName(driveEntry.iNumber, driveName);
-        
-        CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(driveName);
-        textQuery->SetPromptL(_L("New name:"));
-
-        if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-            {
-            // set drive name
-            TInt err = iFs.SetDriveName(driveEntry.iNumber, driveName);
-
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Name changed"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }              
-
-            RefreshViewL();
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SetDriveVolumeLabelL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-
-        // get existing volume label
-        TFileName volumeLabel;
-        volumeLabel.Copy(driveEntry.iVolumeInfo.iName);
-        
-        CAknTextQueryDialog* textQuery = CAknTextQueryDialog::NewL(volumeLabel);
-        textQuery->SetPromptL(_L("New volume label:"));
-
-        if (textQuery->ExecuteLD(R_GENERAL_TEXT_QUERY))
-            {
-            // set volume label
-            TInt err = iFs.SetVolumeLabel(volumeLabel, driveEntry.iNumber);
-
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Volume label changed"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }              
-
-            RefreshViewL();
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::EjectDriveL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-        
-        TInt err(KErrNone);
-        
-        // get current filesystem name
-        TFileName fileSystemName;
-        err = iFs.FileSystemName(fileSystemName, driveEntry.iNumber);
-        
-        if (err == KErrNone)
-            {
-            // Prevent SysAp shutting down applications
-            RProperty::Set(
-                KPSUidCoreApplicationUIs,
-                KCoreAppUIsMmcRemovedWithoutEject,
-                ECoreAppUIsEjectCommandUsed );
-            
-            // dismount the file system
-            err = iFs.DismountFileSystem(fileSystemName, driveEntry.iNumber);
-            
-            if (err == KErrNone)
-                {
-                // remount the file system
-                err = iFs.MountFileSystem(fileSystemName, driveEntry.iNumber);
-                
-                if (err == KErrInUse)
-                    {
-                    // try to remount after a while if locked
-                    User::After(1000000);
-                    err = iFs.MountFileSystem(fileSystemName, driveEntry.iNumber);
-                    }                
-                }
-            }
-
-        if (err == KErrNone)
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("Ejected succesfully"));                     
-            }
-        else if (err == KErrNotSupported)
-            {
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD(_L("Not supported for this drive"));                     
-            }
-        else
-            {
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver                       
-            }              
-
-        RefreshViewL();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::DismountFileSystemL()
-    {
-    // get current item 
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iDriveEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        CAknQueryDialog* query = CAknQueryDialog::NewL();
-        
-        if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, _L("Are you sure you know what are you doing?")))
-            {
-            TDriveEntry driveEntry = iDriveEntryList->At(currentItemIndex);
-            
-            TInt err(KErrNone);
-            
-            // get current filesystem name
-            TFileName fileSystemName;
-            err = iFs.FileSystemName(fileSystemName, driveEntry.iNumber);
-            
-            if (err == KErrNone)
-                {
-                // Prevent SysAp shutting down applications
-                RProperty::Set(
-                    KPSUidCoreApplicationUIs,
-                    KCoreAppUIsMmcRemovedWithoutEject,
-                    ECoreAppUIsEjectCommandUsed );
-                
-                // dismount the file system
-                err = iFs.DismountFileSystem(fileSystemName, driveEntry.iNumber);
-                }
-
-            if (err == KErrNone)
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(_L("Dismounted succesfully"));                     
-                }
-            else if (err == KErrNotSupported)
-                {
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(_L("Not supported for this drive"));                     
-                }
-            else
-                {
-                CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                    
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-                CleanupStack::PopAndDestroy();  //textResolver                       
-                }              
-
-            RefreshViewL();
-            }
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::ConvertCharsToPwd(TDesC& aWord, TDes8& aConverted) const
-    {
-    aConverted.FillZ(aConverted.MaxLength());
-    aConverted.Zero();
-    
-    if (aWord.Length())
-        {
-        aConverted.Copy( (TUint8*)(&aWord[0]), aWord.Size() );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::EditDataTypesL()
-    {
-    iModel->FileListContainer()->SetScreenLayoutL(EDisplayModeNormal);
-    iModel->FileListContainer()->SetNaviPaneTextL(KNullDesC);
-    
-    CFileBrowserDataTypesDlg* dlg = CFileBrowserDataTypesDlg::NewL();
-    dlg->RunQueryLD();
-
-    iModel->FileListContainer()->SetScreenLayoutL(iModel->Settings().iDisplayMode);
-    iModel->FileListContainer()->SetNaviPaneTextL(iCurrentPath);     
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::SecureBackupL(TInt aType)
-    {
-    TInt err(KErrNone);
-    TInt showStatus(EFalse);
-    
-    if (aType == EFileBrowserCmdToolsSecureBackupStartBackup || aType == EFileBrowserCmdToolsSecureBackupStartRestore)
-        {
-        TInt queryIndexState(0);
-        TInt queryIndexType(0);
-        
-        CAknListQueryDialog* listQueryDlgState = new(ELeave) CAknListQueryDialog(&queryIndexState);
-        if (listQueryDlgState->ExecuteLD(R_SECUREBACKUP_STATE_QUERY))
-            {
-
-            CAknListQueryDialog* listQueryDlgType = new(ELeave) CAknListQueryDialog(&queryIndexType);
-            if (listQueryDlgType->ExecuteLD(R_SECUREBACKUP_TYPE_QUERY))
-                {
-                conn::TBURPartType partType = conn::EBURNormal;
-                conn::TBackupIncType backupIncType = conn::ENoBackup;
-                
-                if (aType == EFileBrowserCmdToolsSecureBackupStartBackup)
-                    {
-                    if (queryIndexState == ESecureBackupStateFull)
-                        partType = conn::EBURBackupFull;
-                    else if (queryIndexState == ESecureBackupStatePartial)
-                        partType = conn::EBURBackupPartial;
-                    }
-                else if (aType == EFileBrowserCmdToolsSecureBackupStartRestore)
-                    {
-                    if (queryIndexState == ESecureBackupStateFull)
-                        partType = conn::EBURRestoreFull;
-                    else if (queryIndexState == ESecureBackupStatePartial)
-                        partType = conn::EBURRestorePartial;
-                    }
-                    
-                if (queryIndexType == ESecureBackupTypeBase)
-                    backupIncType = conn::EBackupBase;
-                else if (queryIndexType == ESecureBackupTypeIncremental)    
-                    backupIncType = conn::EBackupIncrement;    
-
-                // start secure backup
-                err = iFileOps->ActivateSecureBackUp(partType, backupIncType);
-                showStatus = ETrue;
-                }
-            }
-        }
-
-    else if (aType == EFileBrowserCmdToolsSecureBackupStop)
-        {
-        err = iFileOps->DeActivateSecureBackUp();
-        showStatus = ETrue;
-        }
-
-    else
-        User::Panic(_L("Sec.br.mode"), 101);
-    
-    
-    if (showStatus)
-        {
-        if (err == KErrNone)
-            {
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-            note->ExecuteLD(_L("Succeeded"));                     
-            }
-        else
-            {
-            CTextResolver* textResolver = CTextResolver::NewLC(*iModel->EikonEnv());     
-                
-            CAknErrorNote* note = new(ELeave) CAknErrorNote;
-            note->ExecuteLD( textResolver->ResolveErrorString(err, CTextResolver::ECtxNoCtxNoSeparator) );    
-
-            CleanupStack::PopAndDestroy();  //textResolver                       
-            }  
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserFileUtils::OpenCommonFileActionQueryL()
-    {
-    // just get current item
-    TInt currentItemIndex = iModel->FileListContainer()->CurrentListBoxItemIndex();
-    
-    if (iFileEntryList->Count() > currentItemIndex && currentItemIndex >= 0)
-        {
-        TInt queryIndex(0);
-        
-        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
-        
-        if (listQueryDlg->ExecuteLD(R_COMMON_FILE_ACTION_QUERY))
-            {
-            if (queryIndex == ECommonFileActionViewAsTextHex)
-                {
-                TFileEntry fileEntry = iFileEntryList->At(currentItemIndex);
-                
-                TFileName fullPath = fileEntry.iPath;
-                fullPath.Append(fileEntry.iEntry.iName);
-                
-                TInt viewerType(EFileBrowserCmdFileViewHex);
-                
-                // check from mime type if it's text
-                TDataType dataType;
-                TUid appUid;
-                if (iModel->LsSession().AppForDocument(fullPath, appUid, dataType) == KErrNone)
-                    {
-                    TBuf<128> mimeTypeBuf;
-                    mimeTypeBuf.Copy(dataType.Des8());
-                    if (mimeTypeBuf == KNullDesC)
-                        mimeTypeBuf.Copy(_L("N/A"));
-                    
-                    if (mimeTypeBuf.CompareF(_L("text/plain")) == 0)
-                        viewerType = EFileBrowserCmdFileViewText;
-                    }
-                    
-                FileEditorL(viewerType);   
-                }
-
-            else if (queryIndex == ECommonFileActionOpenWithApparc)
-                {
-                OpenWithApparcL();
-                }
-
-            else if (queryIndex == ECommonFileActionOpenWithDocHandlerEmbed)
-                {
-                OpenWithDocHandlerL(ETrue);
-                }
-
-            else
-                User::Panic(_L("Unk.Com.Act"), 221);    
-                            
-            }
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-	            
-// End of File
--- a/filebrowser/src/FBModel.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,376 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-
-#include "FBModel.h"
-#include "FBApp.h"
-#include "FB.hrh"
-#include "FBSettingViewDlg.h"
-#include "FBFileUtils.h"
-#include "FBFileListContainer.h"
-#include "FBStd.h"
-#include <filebrowser.rsg>
-
-#include <coeutils.h>
-#include <bautils.h>
-#include <apaid.h>
-#include <AknGlobalConfirmationQuery.h>
-#include <s32file.h>
-
-// hash key selection related includes
-#ifndef __SERIES60_30__
-  #include <centralrepository.h>
-  #include <AknFepInternalCRKeys.h>
-  #include <AvkonInternalCRKeys.h>
-  #include <e32property.h> 
-#endif
-
-const TInt KSettingsDrive = EDriveC;
-_LIT(KSettingsFileName, "filebrowser_settings.ini");
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CFileBrowserModel* CFileBrowserModel::NewL()
-	{
-	CFileBrowserModel* self = new(ELeave) CFileBrowserModel;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserModel::CFileBrowserModel()
-	{
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserModel::ConstructL()
-	{
-    iEnv = CEikonEnv::Static();
-    User::LeaveIfError(iLs.Connect());
-	}
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserModel::~CFileBrowserModel()
-	{
-	if (iFileUtils)
-	    delete iFileUtils;
-
-	iLs.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::ActivateModelL()
-	{
-    TRAP_IGNORE( LoadSettingsL() );
-
-    iFileUtils = CFileBrowserFileUtils::NewL(this);
-    
-    // get hash key selection value
-    GetHashKeySelectionStatus();
-	}
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::DeActivateModelL()
-	{
-	}
-	
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserModel::SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer)
-    {
-    iFileListContainer = aFileListContainer;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue)
-    {
-    if (aDicFS->IsPresentL(aUid))
-        {
-        RDictionaryReadStream in;
-        in.OpenLC(*aDicFS, aUid);
-        aValue = in.ReadInt16L();
-        CleanupStack::PopAndDestroy(); // in        
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue)
-    {
-    if (aDicFS->IsPresentL(aUid))
-        {
-        RDictionaryReadStream in;
-        in.OpenLC(*aDicFS, aUid);
-        TInt bufLength = in.ReadInt16L();   // get length of descriptor
-        in.ReadL(aValue, bufLength);        // get the descriptor itself
-        CleanupStack::PopAndDestroy(); // in
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue)
-    {
-    RDictionaryWriteStream out;
-    out.AssignLC(*aDicFS, aUid);
-    out.WriteInt16L(aValue);
-    out.CommitL(); 	
-    CleanupStack::PopAndDestroy(1);// out
-    }
-
-// ---------------------------------------------------------------------------
-
-void CFileBrowserModel::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue)
-    {
-    RDictionaryWriteStream out;
-    out.AssignLC(*aDicFS, aUid);
-    out.WriteInt16L(aValue.Length());       // write length of the descriptor
-    out.WriteL(aValue, aValue.Length());    // write the descriptor itself
-    out.CommitL(); 	
-    CleanupStack::PopAndDestroy(1);// out
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserModel::LoadSettingsL()
-    {
-    const TSize screenSize = iEnv->ScreenDevice()->SizeInPixels();
-
-    // set defaults
-    iSettings.iDisplayMode = EDisplayModeFullScreen;
-    iSettings.iFileViewMode = IsQHD(screenSize) ? EFileViewModeExtended : EFileViewModeSimple;
-    iSettings.iShowSubDirectoryInfo = EFalse;
-    iSettings.iShowAssociatedIcons = EFalse;
-    iSettings.iRememberLastPath = EFalse;
-    iSettings.iLastPath = KNullDesC;
-    iSettings.iRememberFolderSelection = ETrue;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        iSettings.iEnableToolbar = ETrue;
-        }
-    else
-        {
-        iSettings.iEnableToolbar = EFalse;
-        }
-#else
-    iSettings.iEnableToolbar = EFalse;
-#endif
-
-    iSettings.iSupportNetworkDrives = EFalse;
-    iSettings.iBypassPlatformSecurity = EFalse;
-    iSettings.iRemoveFileLocks = ETrue;
-    iSettings.iIgnoreProtectionsAtts = ETrue;
-    iSettings.iRemoveROMWriteProrection = ETrue;
-
-    // build specific defaults
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-    iSettings.iSupportNetworkDrives = ETrue;
-#endif 
-
-
-    // make sure that the private path of this app in c-drive exists
-    iEnv->FsSession().CreatePrivatePath( KSettingsDrive ); // c:\\private\\102828d6\\
-    
-    // handle settings always in the private directory 
-    if (iEnv->FsSession().SetSessionToPrivate( KSettingsDrive ) == KErrNone)
-        {
-        // open or create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iEnv->FsSession(), KSettingsFileName, KUidFileBrowser);
-
-        LoadDFSValueL(settingsStore, KFBSettingDisplayMode,                 iSettings.iDisplayMode);
-        LoadDFSValueL(settingsStore, KFBSettingFileViewMode,                iSettings.iFileViewMode);
-        LoadDFSValueL(settingsStore, KFBSettingShowSubDirectoryInfo,        iSettings.iShowSubDirectoryInfo);
-        LoadDFSValueL(settingsStore, KFBSettingShowAssociatedIcons,         iSettings.iShowAssociatedIcons);
-        LoadDFSValueL(settingsStore, KFBSettingRememberLastPath,            iSettings.iRememberLastPath);
-        LoadDFSValueL(settingsStore, KFBSettingLastPath,                    iSettings.iLastPath);
-        LoadDFSValueL(settingsStore, KFBSettingFolderSelection,             iSettings.iRememberFolderSelection);
-        LoadDFSValueL(settingsStore, KFBSettingEnableToolbar,               iSettings.iEnableToolbar);
-
-        LoadDFSValueL(settingsStore, KFBSettingSupportNetworkDrives,        iSettings.iSupportNetworkDrives);
-        LoadDFSValueL(settingsStore, KFBSettingBypassPlatformSecurity,      iSettings.iBypassPlatformSecurity);
-        LoadDFSValueL(settingsStore, KFBSettingRemoveFileLocks,             iSettings.iRemoveFileLocks);
-        LoadDFSValueL(settingsStore, KFBSettingIgnoreProtectionsAtts,       iSettings.iIgnoreProtectionsAtts);
-        LoadDFSValueL(settingsStore, KFBSettingRemoveROMWriteProtection,    iSettings.iRemoveROMWriteProrection);
-
-        CleanupStack::PopAndDestroy(); // settingsStore         
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserModel::SaveSettingsL(TBool aNotifyModules)
-    {
-    // handle settings always in c:\\private\\102828d6\\
-    if (iEnv->FsSession().SetSessionToPrivate( KSettingsDrive ) == KErrNone)
-        {
-        // delete existing store to make sure that it is clean and not eg corrupted
-        if (BaflUtils::FileExists(iEnv->FsSession(), KSettingsFileName))
-            {
-            iEnv->FsSession().Delete(KSettingsFileName);
-            }
-        
-        // create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iEnv->FsSession(), KSettingsFileName, KUidFileBrowser);
-
-        SaveDFSValueL(settingsStore, KFBSettingDisplayMode,                 iSettings.iDisplayMode);
-        SaveDFSValueL(settingsStore, KFBSettingFileViewMode,                iSettings.iFileViewMode);
-        SaveDFSValueL(settingsStore, KFBSettingShowSubDirectoryInfo,        iSettings.iShowSubDirectoryInfo);
-        SaveDFSValueL(settingsStore, KFBSettingShowAssociatedIcons,         iSettings.iShowAssociatedIcons);
-        SaveDFSValueL(settingsStore, KFBSettingRememberLastPath,            iSettings.iRememberLastPath);
-        SaveDFSValueL(settingsStore, KFBSettingLastPath,                    iSettings.iLastPath);
-        SaveDFSValueL(settingsStore, KFBSettingFolderSelection,             iSettings.iRememberFolderSelection);
-        SaveDFSValueL(settingsStore, KFBSettingEnableToolbar,               iSettings.iEnableToolbar);
-
-        SaveDFSValueL(settingsStore, KFBSettingSupportNetworkDrives,        iSettings.iSupportNetworkDrives);
-        SaveDFSValueL(settingsStore, KFBSettingBypassPlatformSecurity,      iSettings.iBypassPlatformSecurity);
-        SaveDFSValueL(settingsStore, KFBSettingRemoveFileLocks,             iSettings.iRemoveFileLocks);
-        SaveDFSValueL(settingsStore, KFBSettingIgnoreProtectionsAtts,       iSettings.iIgnoreProtectionsAtts);
-        SaveDFSValueL(settingsStore, KFBSettingRemoveROMWriteProtection,    iSettings.iRemoveROMWriteProrection);
-        
-        settingsStore->CommitL();
-        CleanupStack::PopAndDestroy(); // settingsStore             
-        }
-
-    // update changes to modules
-    if (aNotifyModules)
-        {
-        //iScreenCapture->HandleSettingsChangeL();
-        iFileUtils->HandleSettingsChangeL();
-        iFileListContainer->HandleSettingsChangeL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserModel::GetHashKeySelectionStatus()
-    {
-    TBool hashKeySelectionInUse(EFalse);
-    
-#ifndef __SERIES60_30__
-    
-    // get hash key selection value
-    TRAP_IGNORE(
-        CRepository* repository = CRepository::NewLC(KCRUidAknFep);
-        repository->Get(KAknFepHashKeySelection, hashKeySelectionInUse);
-        CleanupStack::PopAndDestroy();
-    );
-    
-    // even if hash key selection is in use, ignore the value in qwerty mode
-    if (hashKeySelectionInUse)
-        {
-        TBool qwertyMode(EFalse);
-        RProperty qwertyModeStatusProperty;
-        qwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive);
-        qwertyModeStatusProperty.Get(qwertyMode);
-        qwertyModeStatusProperty.Close();
-        
-        if (qwertyMode)
-            hashKeySelectionInUse = EFalse;        
-        }
-
-#endif
-
-    iIsHashKeySelectionInUse = hashKeySelectionInUse;
-    }
-    	
-// --------------------------------------------------------------------------------------------
-
-TInt CFileBrowserModel::LaunchSettingsDialogL()
-    {
-    // set to normal mode
-    iFileListContainer->SetScreenLayoutL(EDisplayModeNormal);
-    iFileListContainer->DeleteNaviPane();
-    iFileListContainer->HideToolbar();
-    
-    // launch the dialog and save settings
-    CFileBrowserSettingViewDlg* dlg = CFileBrowserSettingViewDlg::NewL(iSettings);
-    TInt retValue = dlg->ExecuteLD(R_FILEBROWSER_SETTINGS_DIALOG);        
-    FileListContainer()->CreateEmptyNaviPaneLabelL();
-    TRAP_IGNORE(SaveSettingsL());
-    return retValue;
-    }
-	
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CAsyncWaiter* CAsyncWaiter::NewL(TInt aPriority)
-	{
-	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
-	return self;
-	}
-
-CAsyncWaiter* CAsyncWaiter::NewLC(TInt aPriority)
-	{
-	CAsyncWaiter* self = new(ELeave) CAsyncWaiter(aPriority);
-	CleanupStack::PushL(self);
-	return self;
-	}
-	
-CAsyncWaiter::CAsyncWaiter(TInt aPriority) : CActive(aPriority)
-	{
-	CActiveScheduler::Add(this);
-	}	
-
-CAsyncWaiter::~CAsyncWaiter()
-	{
-	Cancel();
-	}
-	
-void CAsyncWaiter::StartAndWait()
-	{
-    iStatus = KRequestPending;
-    SetActive();
-    iWait.Start();
-	}
-	
-TInt CAsyncWaiter::Result() const
-	{
-	return iError;
-	}
-	
-void CAsyncWaiter::RunL()
-	{
-	iError = iStatus.Int();
-	CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-	}
-	
-void CAsyncWaiter::DoCancel()
-	{
-	iError = KErrCancel;
-    if( iStatus == KRequestPending )
-        {
-        TRequestStatus* s=&iStatus;
-        User::RequestComplete( s, KErrCancel );
-        }
-
-    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-	}
-
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/filebrowser/src/FBSettingViewDlg.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,463 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBSettingViewDlg.h"
-#include "FBModel.h"
-#include "FB.hrh"
-#include "FBStd.h"
-#include <filebrowser.rsg>
-
-#include <aknsettingitemlist.h>
-#include <CAknMemorySelectionSettingItem.h> 
-#include <aknlists.h>
-#include <akntitle.h>
-#include <aknnavi.h>
-#include <aknnavide.h>
-#include <StringLoader.h>
-#include <aknnotewrappers.h> 
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CFileBrowserSettingViewDlg* CFileBrowserSettingViewDlg::NewL(TFileBrowserSettings& aSettings)
-    {
-    CFileBrowserSettingViewDlg* self = new(ELeave) CFileBrowserSettingViewDlg(aSettings);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserSettingViewDlg::~CFileBrowserSettingViewDlg()
-    {
-    // restore default navi pane
-    if (iNaviContainer)
-        iNaviContainer->Pop();
-    
-    if (iSettingItemArray)
-        {
-        iSettingItemArray->ResetAndDestroy();
-        delete iSettingItemArray; 
-        }
-    
-    if (iDecoratedTabGroup)
-        delete iDecoratedTabGroup;   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CFileBrowserSettingViewDlg::CFileBrowserSettingViewDlg(TFileBrowserSettings& aSettings) : iSettings(aSettings)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::ConstructL()
-    {
-    // construct a menu bar
-    CAknDialog::ConstructL(R_FILEBROWSER_SETTINGS_MENUBAR);
-   
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    
-    // set empty navi pane label
-    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
-    iNaviContainer->PushDefaultL();
-    
-    // set title text
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Settings") );
-    
-    // create a tab group
-    iDecoratedTabGroup = iNaviContainer->CreateTabGroupL(this);
-    iTabGroup = static_cast<CAknTabGroup*>(iDecoratedTabGroup->DecoratedControl());
-    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs); 
-    
-    // add tabs
-    iTabGroup->AddTabL(ETabGeneral, _L("General"));
-    iTabGroup->AddTabL(ETabFileOps, _L("Operations"));
-    iTabGroup->SetActiveTabByIndex(ETabGeneral);
-    
-    iNaviContainer->PushL( *iDecoratedTabGroup );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            ShowSettingPageL(EFalse);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::TabChangedL(TInt /*aIndex*/)
-    {
-    iListBox->SetCurrentItemIndex(0);
-
-    SetVisibilitiesOfSettingItemsL();   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::ProcessCommandL(TInt aCommandId)
-    {
-    CAknDialog::ProcessCommandL(aCommandId);
-
-    switch (aCommandId)
-        {
-        case EFileBrowserCmdSettingsChange:
-            ShowSettingPageL(ETrue);
-            break;
-        case EFileBrowserCmdSettingsExit:
-            TryExitL(EAknCmdExit);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CFileBrowserSettingViewDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if (iTabGroup == NULL)
-        {
-        return EKeyWasNotConsumed;
-        }
-
-    TInt active = iTabGroup->ActiveTabIndex();
-    TInt count = iTabGroup->TabCount();
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-            if (active > 0)
-                {
-                active--;
-                iTabGroup->SetActiveTabByIndex(active);
-                TabChangedL(active); 
-                }
-            break;
-        
-        case EKeyRightArrow:
-            if((active + 1) < count)
-                {
-                active++;
-                iTabGroup->SetActiveTabByIndex(active);
-                TabChangedL(active); 
-                }
-            break;
-        }
-
-    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
-    }    
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::PreLayoutDynInitL()
-    {
-    iListBox = static_cast<CAknSettingStyleListBox*>( Control(EFileBrowserSettingItemList) );
-    iListBox->SetMopParent(this);
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-
-    iSettingItemArray = new(ELeave) CAknSettingItemArray(16, EFalse, 0);
-
-    CTextListBoxModel* model = iListBox->Model();
-    model->SetItemTextArray(iSettingItemArray);
-    model->SetOwnershipType(ELbmDoesNotOwnItemArray);
-
-    UpdateListBoxL();    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CFileBrowserSettingViewDlg::OkToExitL(TInt aButtonId)
-    {
-    return CAknDialog::OkToExitL(aButtonId);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::ShowSettingPageL(TInt aCalledFromMenu)
-    {
-    TInt listIndex = iListBox->CurrentItemIndex();
-    TInt realIndex = iSettingItemArray->ItemIndexFromVisibleIndex(listIndex);
-    CAknSettingItem* item = iSettingItemArray->At(realIndex);
-    item->EditItemL(aCalledFromMenu);
-    item->StoreL();
-    SetVisibilitiesOfSettingItemsL();
-    DrawNow();
-    
-    if (realIndex == ESettingListBypassPlatformSecuritySelection && iSettings.iBypassPlatformSecurity)
-        {
-        _LIT(KMessage, "Gives TCB rights to file operations, use at your own risk");
-        CAknInformationNote* note = new(ELeave) CAknInformationNote;
-        note->ExecuteLD(KMessage);    
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::SetVisibilitiesOfSettingItemsL()
-    {
-    if (iSettingItemArray->Count() > 0)
-        {
-        switch (iTabGroup->ActiveTabIndex())
-            {
-            case ETabGeneral:
-                {
-                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListShowSubdirectoryInfoSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListShowAssociatedIconsSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListRememberLastPathSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListRememberFolderSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListEnableToolbar])->SetHidden(EFalse);
-                
-                ((*iSettingItemArray)[ESettingListSupportNetworkDrivesSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListBypassPlatformSecuritySelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListRemoveFileLocksSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListIgnoreProtectionsAttsSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListRemoveROMWriteProtectionSelection])->SetHidden(ETrue);
-                }
-                break;
-            
-            case ETabFileOps:
-                {
-                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListShowSubdirectoryInfoSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListShowAssociatedIconsSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListRememberLastPathSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListRememberFolderSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListEnableToolbar])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListSupportNetworkDrivesSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListBypassPlatformSecuritySelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListRemoveFileLocksSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListIgnoreProtectionsAttsSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListRemoveROMWriteProtectionSelection])->SetHidden(EFalse);
-                }
-                break;            
-
-            default:
-                User::Panic(_L("TabIOOB"), 50);
-                break;
-            }
-            
-        #ifdef FILEBROWSER_LITE
-          ((*iSettingItemArray)[ESettingListBypassPlatformSecuritySelection])->SetHidden(ETrue);
-        #endif
-          
-        #if(defined __SERIES60_30__ || defined __SERIES60_31__ || defined __S60_32__)
-          ((*iSettingItemArray)[ESettingListEnableToolbar])->SetHidden(ETrue);
-        #else
-        if ( !AknLayoutUtils::PenEnabled() )
-            {
-            ((*iSettingItemArray)[ESettingListEnableToolbar])->SetHidden(ETrue);
-            }
-        #endif
-        
-        iSettingItemArray->RecalculateVisibleIndicesL();
-        iListBox->HandleItemAdditionL();
-        iListBox->UpdateScrollBarsL();
-        }
-    }   
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::UpdateListBoxL()
-    {
-    iSettingItemArray->ResetAndDestroy();
-    
-    // create items
-    TInt ordinal(0);
- 
-    AddSettingItemL(ESettingListDisplayModeSelection,
-                    R_DISPLAYMODESELECTION_SETTING_TITLE,
-                    R_DISPLAYMODESELECTION_SETTING_PAGE,
-                    R_DISPLAYMODESELECTION_SETTING_TEXTS,
-                    ordinal++);
-                    
-    AddSettingItemL(ESettingListFileViewModeSelection,
-                    R_FILEVIEWMODESELECTION_SETTING_TITLE,
-                    R_FILEVIEWMODESELECTION_SETTING_PAGE,
-                    R_FILEVIEWMODESELECTION_SETTING_TEXTS,
-                    ordinal++); 
-
-    AddSettingItemL(ESettingListShowSubdirectoryInfoSelection,
-                    R_SHOWSUBDIRECTORYINFOSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++); 
-
-    AddSettingItemL(ESettingListShowAssociatedIconsSelection,
-                    R_SHOWASSOCIATEDICONSSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++); 
- 
-    AddSettingItemL(ESettingListRememberLastPathSelection,
-                    R_REMEMBERLASTPATHSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++); 
-
-    AddSettingItemL(ESettingListRememberFolderSelection,
-                    R_REMEMBERFOLDERSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListEnableToolbar,
-                    R_ENABLETOOLBAR_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);
-    
-    AddSettingItemL(ESettingListSupportNetworkDrivesSelection,
-                    R_SUPPORTNETWORKDRIVESSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++); 
-                     
-    AddSettingItemL(ESettingListBypassPlatformSecuritySelection,
-                    R_BYPASSPLATFORMSECURITYSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++); 
- 
-    AddSettingItemL(ESettingListRemoveFileLocksSelection,
-                    R_REMOVEFILELOCKSSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListIgnoreProtectionsAttsSelection,
-                    R_IGNOREPROTECTIONATTSSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);   
-
-    AddSettingItemL(ESettingListRemoveROMWriteProtectionSelection,
-                    R_REMOVEROMWRITEPROTECTIONSELECTION_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);
-                                                              
-    SetVisibilitiesOfSettingItemsL(); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CFileBrowserSettingViewDlg::AddSettingItemL(TInt aId,
-                                                 TInt aTitleResource,
-                                                 TInt aSettingPageResource,
-                                                 TInt aAssociatedResource,
-                                                 TInt aOrdinal)
-    {
-    // create a setting item
-    CAknSettingItem* settingItem = NULL;
-    
-    switch (aId)
-        {
-        case ESettingListDisplayModeSelection:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDisplayMode);
-            break;
-            
-        case ESettingListFileViewModeSelection:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iFileViewMode);
-            break;
-
-        case ESettingListShowSubdirectoryInfoSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iShowSubDirectoryInfo);
-            break;  
-
-        case ESettingListShowAssociatedIconsSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iShowAssociatedIcons);
-            break;  
-            
-        case ESettingListRememberLastPathSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iRememberLastPath);
-            break;
-            
-        case ESettingListRememberFolderSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iRememberFolderSelection);
-            break;
-
-        case ESettingListEnableToolbar:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iEnableToolbar);
-            break;
-
-        case ESettingListSupportNetworkDrivesSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iSupportNetworkDrives);
-            break; 
-            
-        case ESettingListBypassPlatformSecuritySelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iBypassPlatformSecurity);
-            break;  
-
-        case ESettingListRemoveFileLocksSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iRemoveFileLocks);
-            break;  
-
-        case ESettingListIgnoreProtectionsAttsSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iIgnoreProtectionsAtts);
-            break;
-            
-        case ESettingListRemoveROMWriteProtectionSelection:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iRemoveROMWriteProrection);
-            break;            
-
-
-        default:
-            User::Panic(_L("NotSetItem"), 50);
-            break;
-        }
-        
-    CleanupStack::PushL(settingItem);
-
-    // get title text
-    HBufC* itemTitle = StringLoader::LoadLC(aTitleResource);
-
-    // construct the setting item
-    settingItem->ConstructL(EFalse, aOrdinal, *itemTitle, NULL, aSettingPageResource,
-                            EAknCtPopupSettingList, NULL, aAssociatedResource);
-
-    // append the setting item to settingitem array
-    iSettingItemArray->InsertL(aOrdinal, settingItem);
-
-    CleanupStack::PopAndDestroy(); //itemTitle
-    CleanupStack::Pop(); //settingItem
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-// End of File
-
--- a/filebrowser/src/FBToolbar.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,369 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "FBToolbar.h"
-
-#include <aknappui.h>
-#include <akntoolbar.h>
-#include <AknsUtils.h>
-#include <aknbutton.h>
-#include <akntouchpane.h>
-#include <gulicon.h>
-#include <eikapp.h>
-#include <StringLoader.h>
-#include <data_caging_path_literals.hrh>
-#include <layoutmetadata.cdl.h>
-#include <aknlayoutscalable_avkon.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <filebrowser.rsg>
-#include <AknInfoPopupNoteController.h>
-
-#include "FB.hrh"
-#include "FBDocument.h"
-#include "FBModel.h"
-#include "FBFileUtils.h"
-#include "FBFileListContainer.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CFileBrowserToolbar::NewL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-CFileBrowserToolbar* CFileBrowserToolbar::NewL(/* CAknView& aView*/ )
-    {
-    CFileBrowserToolbar* self = CFileBrowserToolbar::NewLC();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CFileBrowserToolbar::NewLC()
-// Creates and leaves on failure. 
-// -----------------------------------------------------------------------------
-//
-CFileBrowserToolbar* CFileBrowserToolbar::NewLC()
-    {
-    CFileBrowserToolbar* self = new ( ELeave )CFileBrowserToolbar();
-    CleanupStack::PushL( self );
-    self->ConstructL();               
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// CFileBrowserToolbar::~CFileBrowserToolbar()
-// removes the toolbar items when it leaves Editor/viewer plugin.
-// -----------------------------------------------------------------------------
-//
-CFileBrowserToolbar::~CFileBrowserToolbar()
-    {
-    delete iInfoPopup;
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        if ( iViewerToolbar )
-            {
-            iViewerToolbar->SetToolbarVisibility( EFalse );
-            TRAP_IGNORE( iViewerToolbar->DisableToolbarL(ETrue) );
-            }
-        }
-
-    if ( iViewerToolbar )
-        {
-        iViewerToolbar->HideItem( EFileBrowserCmdFileBack, ETrue, EFalse );
-        iViewerToolbar->HideItem( EFileBrowserCmdFileSearch, ETrue, EFalse );
-        iViewerToolbar->HideItem( EFileBrowserCmdEditSelect, ETrue, EFalse );
-        }
-    }
-// -----------------------------------------------------------------------------
-// CFileBrowserToolbar::CFileBrowserToolbar()
-// C++ construct function add items the toolbar.
-// -----------------------------------------------------------------------------
-//
-CFileBrowserToolbar::CFileBrowserToolbar() :
-    iFirstSelectionIndex( KErrNotFound ),
-    iLastSelectionIndex( KErrNotFound )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CFileBrowserToolbar::ConstructL()
-// C++ construct function add items the toolbar.
-// -----------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::ConstructL()
-    {
-    CAknAppUi* appUi = (CAknAppUi*)CEikonEnv::Static()->EikAppUi();
-    iModel = static_cast<CFileBrowserDocument*>(appUi->Document())->Model();
-
-    iViewerToolbar = appUi->CurrentFixedToolbar();
-    iSelectbutton = static_cast<CAknButton*>( iViewerToolbar->ControlOrNull( EFileBrowserCmdEditSelect ) );
-
-    if ( iViewerToolbar )
-        {
-        iShown = ETrue;
-        iViewerToolbar->SetObserver( this );
-        iViewerToolbar->SetToolbarObserver( this );
-        iViewerToolbar->SetWithSliding( ETrue );
-        iViewerToolbar->SetCloseOnAllCommands( EFalse );
-        iViewerToolbar->SetFocusing( EFalse );
-        }
-    iInfoPopup = CAknInfoPopupNoteController::NewL();
-    iInfoPopup->SetTimePopupInView(5000);
-    iInfoPopup->SetTimeDelayBeforeShow(500);
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::ResetState
-// Updates the toolbar 
-// ---------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::ResetState()
-    {
-    if ( AknLayoutUtils::PenEnabled() )
-        {
-        iSelectbutton->SetCurrentState( 0, ETrue );
-        iFirstSelectionIndex = KErrNotFound;
-        iLastSelectionIndex = KErrNotFound;
-        }
-    if ( iInfoPopup )
-        {
-        iInfoPopup->HideInfoPopupNote();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::DynInitToolbarL
-// Initialise before the display of the toolbar
-// ---------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::DynInitToolbarL( TInt /*aResourceId*/, CAknToolbar* /*aToolbar*/ )
-    {
-    ResetState();
-    iViewerToolbar->SetFocusing(EFalse);
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::ShowToolbar
-// Shows the toolbar
-// ---------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::ShowToolbarL()
-    {
-    if(AknLayoutUtils::PenEnabled() )
-        {
-        TRAP_IGNORE( iViewerToolbar->DisableToolbarL(EFalse) );
-        iViewerToolbar->SetToolbarVisibility(ETrue);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::ShowToolbar
-// Hides the Toolbar
-// ---------------------------------------------------------------------------
-//
-void  CFileBrowserToolbar::HideToolbarL()
-    {
-    // Undim the toolbar if dimmed
-    if(AknLayoutUtils::PenEnabled() )
-        {
-        TRAP_IGNORE( iViewerToolbar->DisableToolbarL(ETrue) );
-        iViewerToolbar->SetToolbarVisibility(EFalse);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::OfferToolbarEventL
-// Handling toolbar key events
-// ---------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::OfferToolbarEventL( TInt aCommand )
-    {
-    switch ( aCommand )
-        {
-        case EFileBrowserCmdFileBack:
-            {
-            iModel->FileUtils()->MoveUpOneLevelL();
-            break;
-            }
-        case EFileBrowserCmdFileSearch:
-            {
-            TBool emptyListBox = iModel->FileListContainer()->ListBoxNumberOfVisibleItems() == 0;
-            TBool searchFieldEnabled = iModel->FileListContainer()->IsSearchFieldEnabled();
-            if ( !emptyListBox && !searchFieldEnabled )
-                {
-                iModel->FileListContainer()->EnableSearchFieldL();
-                }
-            else if ( searchFieldEnabled )
-                {
-                iModel->FileListContainer()->DisableSearchFieldL();
-                }
-            break;
-            }
-        case EFileBrowserCmdEditSelect:
-            {
-            TBool emptyListBox = iModel->FileListContainer()->ListBoxNumberOfVisibleItems() == 0;
-            TBool driveListActive = iModel->FileUtils()->IsDriveListViewActive();
-            TBool allSelected = iModel->FileListContainer()->ListBox()->SelectionIndexes()->Count() == iModel->FileListContainer()->ListBox()->Model()->NumberOfItems();
-            TBool noneSelected = iModel->FileListContainer()->ListBox()->SelectionIndexes()->Count() == 0;
-            
-            if ( iViewerToolbar->EventModifiers() == CAknToolbar::ELongPressEnded )
-                {                
-                // handle long tap event 
-                iFirstSelectionIndex = KErrNotFound;
-                iLastSelectionIndex = KErrNotFound;
-                iSelectbutton->SetCurrentState( 0, ETrue );
-
-                if ( !( driveListActive || allSelected || emptyListBox ) )
-                    {
-                    AknSelectionService::HandleMarkableListProcessCommandL( EAknMarkAll, iModel->FileListContainer()->ListBox() );
-                    }
-                else if ( !( driveListActive || noneSelected || emptyListBox ) )
-                    {
-                    AknSelectionService::HandleMarkableListProcessCommandL( EAknUnmarkAll, iModel->FileListContainer()->ListBox() );
-                    }
-                }
-            else if ( iViewerToolbar->EventModifiers() != CAknToolbar::ELongPress )
-                {
-                // handle single tap event
-                TBool currentSelected = iModel->FileListContainer()->ListBox()->View()->ItemIsSelected(iModel->FileListContainer()->ListBox()->View()->CurrentItemIndex());                
-                
-                if ( !( driveListActive || emptyListBox ) )
-                    {
-                    if ( noneSelected && iFirstSelectionIndex == KErrNotFound )
-                        {
-                        iLastSelectionIndex = KErrNotFound;
-                        }
-                    
-                    if ( iFirstSelectionIndex == KErrNotFound )
-                        {
-                        // first item selected
-                        iFirstSelectionIndex = iModel->FileListContainer()->ListBox()->CurrentItemIndex();
-                        if ( currentSelected )
-                            {
-                            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iModel->FileListContainer()->ListBox() );
-                            }
-                        else
-                            {
-                            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iModel->FileListContainer()->ListBox() );
-                            }
-                        // Toolbar button updates its state (icon)
-                        iInfoPopup->SetTextL( _L("Select the last item.") );
-                        iInfoPopup->ShowInfoPopupNote();
-                        }
-                    else
-                        {
-                        iInfoPopup->HideInfoPopupNote();
-                        iLastSelectionIndex = iModel->FileListContainer()->ListBox()->CurrentItemIndex();
-                        if ( iLastSelectionIndex == iFirstSelectionIndex )
-                            {
-                            // the same item selected second time
-                            iFirstSelectionIndex = KErrNotFound;
-                            iLastSelectionIndex = KErrNotFound;
-                            if ( currentSelected )
-                                {
-                                AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iModel->FileListContainer()->ListBox() );
-                                }
-                            else
-                                {
-                                AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iModel->FileListContainer()->ListBox() );
-                                }
-                            // Toolbar button updates its state (icon)
-                            }
-                        else
-                            {
-                            // the last item selected, toggle the item selection between first and last 
-                            TInt skipFirstToggle(1);
-                            TInt skipLastToggle(0);
-                            TInt finalFocus = iLastSelectionIndex;
-                            if ( iFirstSelectionIndex > iLastSelectionIndex )
-                                {
-                                TInt tmp = iFirstSelectionIndex;
-                                iFirstSelectionIndex = iLastSelectionIndex;
-                                iLastSelectionIndex = tmp;
-                                skipFirstToggle = 0;
-                                skipLastToggle = 1;
-                                }
-                            for ( TInt i = iFirstSelectionIndex+skipFirstToggle; i <= iLastSelectionIndex-skipLastToggle ; i++ )
-                                {
-                                iModel->FileListContainer()->ListBox()->SetCurrentItemIndexAndDraw( i );
-                                TBool itemSelected = iModel->FileListContainer()->ListBox()->View()->ItemIsSelected(iModel->FileListContainer()->ListBox()->View()->CurrentItemIndex());
-                                if ( itemSelected )
-                                    {
-                                    TRAP_IGNORE( AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iModel->FileListContainer()->ListBox() ) );
-                                    }
-                                else
-                                    {
-                                    TRAP_IGNORE( AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iModel->FileListContainer()->ListBox() ) );
-                                    }
-                                }
-                            iFirstSelectionIndex = KErrNotFound;
-                            iLastSelectionIndex = KErrNotFound;
-                            iModel->FileListContainer()->ListBox()->SetCurrentItemIndexAndDraw( finalFocus );
-                            // Toolbar button updates its state (icon)
-                            }
-                        }
-                    }
-                else
-                    {
-                    iSelectbutton->SetCurrentState( 0, ETrue );
-                    }
-                }
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::HandleControlEventL
-// Handles toolbar event cannot contain any code
-// ---------------------------------------------------------------------------
-//
-void CFileBrowserToolbar::HandleControlEventL( CCoeControl* /*aControl*/,
-                                               TCoeEvent /*aEventType*/ )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::IsShown
-// Returns whether the toolbar is shown or not
-// ---------------------------------------------------------------------------
-//
-TBool CFileBrowserToolbar::IsShown()
-    {
-    return iShown;
-    }   
-
-// ---------------------------------------------------------------------------
-// CFileBrowserToolbar::Rect
-// 
-// ---------------------------------------------------------------------------
-//
-const TRect CFileBrowserToolbar::Rect() const
-    {
-    return iViewerToolbar->Rect();
-    }
-
-// End of File
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/driveentry.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef DRIVEENTRY_H
+#define DRIVEENTRY_H
+
+#include "FBFileUtils.h"
+#include <QString>
+#include <QDate>
+
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class DriveEntry {
+
+public:
+    
+    /**
+     * Constructor
+     */
+    DriveEntry(TDriveEntry aDriveEntry);
+    
+    /**
+     * Destructor
+     */
+    ~DriveEntry();
+    
+    /* Functions that are called from UI */
+public: 
+    QChar driveLetter();
+    int number();
+    QString mediaTypeString();
+    QString attributesString();
+    int iconId();
+    qint64 volumeInfoFree();
+    qint64 volumeInfoSize();
+
+private:
+    TDriveEntry mDriveEntry;
+    };
+
+#endif //DRIVEENTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/editorview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef EDITORVIEW_H
+#define EDITORVIEW_H
+
+#include <hbview.h>
+#include <hbmainwindow.h>
+//#include <QtGui>
+
+class HbTextEdit;
+class HbAction;
+
+class EditorView : public HbView
+{
+    Q_OBJECT
+
+public:
+    EditorView(HbMainWindow &mainWindow);
+    ~EditorView();
+    void open(const QString& fileName, bool flagReadOnly);
+
+signals:
+    void finished(bool ok);
+
+private slots:
+    void backButtonClicked();
+    void displayInText();
+    void displayInHex();
+    void updateMenu();
+
+    /*
+    void newFile();
+    bool save();
+    bool saveAs();
+    void about();
+    void documentWasModified();
+    */
+ 
+
+private:
+    void loadFile(const QString &fileName);
+    void createMenu();
+
+    /* Main Window of folderbrowser */
+    HbMainWindow &mMainWindow;
+    // editor
+    HbTextEdit *mTextEdit;
+    // if flag true, file is currently in hex format
+    bool mFileHex;
+    bool mFlagReadOnly;
+    QString mFileName;
+    QString mFileContent;
+
+    HbAction* mToTextAction;
+    HbAction* mToHexAction;
+    HbAction* mExitAction;
+	
+};
+
+#endif // EDITORVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/enginewrapper.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef ENGINEWRAPPER_H
+#define ENGINEWRAPPER_H
+
+#include "driveentry.h"
+#include "fileentry.h"
+#include "filebrowsersettings.h"
+
+#include "engine.h"
+#include "FBFileUtils.h"
+#include "FB.hrh"
+
+#include <QString>
+#include <QStringList>
+#include <QModelIndexList>
+
+class CEngine;
+class SearchAttributes;
+class SearchResults;
+class FileBrowserView;
+
+class QModelIndex;
+
+class OverwriteOptions
+{
+public:
+    OverwriteOptions() :
+            doFileOperations(true),
+            queryIndex(0),
+            overWriteFlags(CFileMan::EOverWrite)
+    {}
+
+    bool doFileOperations;
+    int queryIndex;
+    QString postFix;
+    int overWriteFlags;
+};
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class EngineWrapper : MFileBrowserUI {
+public:
+    
+    /**
+     * Constructor
+     */
+    EngineWrapper();
+    
+    /**
+     * Destructor
+     */
+    ~EngineWrapper();
+    
+    /**
+     * Initializes Engine Wrapper
+     * @return true if engine was started successfully
+     */
+    bool init();
+
+public: // from MFileBrowserUI
+    /* Functions that are called from engine: */
+    void ShowInformationNote(const TDesC &aDescText, const TDesC &aDescTitle);
+    void ShowErrorNote(const TDesC& aDescText, TBool aNoTimeout = EFalse);
+    void ShowConfirmationNote(const TDesC& aDescText, TBool aNoTimeout = EFalse);
+    TBool ShowConfirmationQuery(const TDesC& aDescText);
+
+public: 
+    /* Functions that are called from UI */
+    bool searchFiles();
+    SearchAttributes getFileSearchAttributes();
+    int setFileSearchAttributes(SearchAttributes attributes);
+    SearchResults getSearchResults();
+
+    FileBrowserSettings &settings() { return mSettings; }
+    const FileBrowserSettings &settings() const { return mSettings; }
+
+    void saveSettings(bool aNotifyModules = true);
+
+    void startExecutingCommands(const QString &aCommandsExecutionMessage);
+    void refreshView();
+//    TBool IsCurrentDriveReadOnly();
+//    TBool IsCurrentItemDirectory();
+    void moveUpOneLevel();
+    void moveDownToDirectory(const QModelIndex& index);
+    int clipboardCut(const QModelIndexList &aSelectionIndices);
+    int clipboardCopy(const QModelIndexList &aSelectionIndices);
+    void clipboardPaste(const OverwriteOptions &aOverwriteOptions);
+    void copyToFolder(const QString &aTargetDir, const OverwriteOptions &aOverwriteOptions, bool aMove);
+    void createNewFile(const QString &aNewFileName);
+    void createNewDirectory(const QString &aNewDirectoryName);
+    void deleteItems(const QModelIndexList& aSelectionIndices);
+    bool selectionHasDirs();
+    void rename(const QModelIndex& aIndex, const QString aNewName);
+    void touch(bool aRecurse);
+    void properties(const QModelIndex &aCurrentItemIndex, QStringList &aPropertyList, QString &aTitleText);
+
+    bool openAppArc(QString fileName);
+    bool openDocHandler(QString fileName, bool embeddedVal = false);
+
+    bool isDriveListViewActive();
+    bool isCurrentDriveReadOnly();
+    bool isClipBoardListInUse();
+    int itemCount() const;
+    DriveEntry getDriveEntry(const QModelIndex& aIndex) const;
+    FileEntry getFileEntry(const QModelIndex& aIndex) const;
+	
+    const CArrayFix<TInt> *convertSelectionList(const QModelIndexList &aSelectionIndices);
+    void setCurrentSelection(const QModelIndexList &aSelectionIndices);
+    bool isDestinationEntriesExists(const QModelIndexList &aSelectionIndices, QString aTargetDir);
+    bool targetExists(const QModelIndex& aIndex, const QString aNewName);
+    QString currentPath() const;
+    TOverwriteOptions convertOverwriteOptions(const OverwriteOptions &aOverwriteOptions);
+    bool hasDrivePassword(const QModelIndex &aIndex);
+    bool isDriveRemovable(const QModelIndex &aIndex);
+    bool isDriveLocked(const QModelIndex &aIndex);
+    void GetDriveName(const QModelIndex &aIndex, QString &aDriveName);
+    void GetDriveVolumeLabel(const QModelIndex &aIndex, QString &aDriveName);
+
+    void DiskAdminSetDrivePassword(const QModelIndex &aIndex, const QString &aOldPassword, const QString &aNewPassword);
+    void DiskAdminUnlockDrive(const QModelIndex &aIndex, const QString &aOldPassword);
+    void DiskAdminClearDrivePassword(const QModelIndex &aIndex, const QString &aOldPassword);
+    void DiskAdminEraseDrivePassword(const QModelIndex &aIndex);
+    void DiskAdminFormatDrive(const QModelIndex &aIndex, bool aQuickFormat);
+    void DiskAdminQuickFormatDrive(const QModelIndex &aIndex, bool aQuickFormat);
+    void DiskAdminCheckDisk(const QModelIndex &aIndex);
+    void DiskAdminScanDrive(const QModelIndex &aIndex);
+    void DiskAdminSetDriveName(const QModelIndex &aIndex, const QString &aDriveName);
+    void DiskAdminSetDriveVolumeLabel(const QModelIndex &aIndex, const QString &aVolumeLabel);
+    void DiskAdminEjectDrive(const QModelIndex &aIndex);
+    void DiskAdminDismountDrive(const QModelIndex &aIndex);
+    void DiskAdminEraseMBR(const QModelIndex &aIndex);
+    void DiskAdminPartitionDrive(const QModelIndex &aIndex, bool aEraseMBR, int aAmountOfPartitions);
+
+    void ToolsSetErrRd(bool aEnable);
+    bool ErrRdFileExists();
+
+    void ToolsErrorSimulateLeave(int aLeaveCode);
+    void ToolsErrorSimulatePanic(QString aPanicCategory, int aPanicCode);
+    void ToolsErrorSimulateException(int aExceptionCode);
+
+    quint32 getDebugMask();
+    void toolsSetDebugMask(quint32 aDbgMask);
+
+    void showFileCheckSums(const QModelIndex &aIndex, TFileBrowserCmdFileChecksums checksumType);
+
+private:
+    // FB engine
+    CEngine *mEngine;
+    // List of found files results for Ui
+    QStringList mFilesFound;
+    FileBrowserSettings mSettings;
+    };
+
+#endif //ENGINEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/filebrowsermainwindow.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSERMAINWINDOW_H_
+#define FILEBROWSERMAINWINDOW_H_
+
+#include <hbmainwindow.h>
+
+class HbApplication;
+class EngineWrapper;
+class FileBrowserView;
+class SettingsView;
+class EditorView;
+
+class FileBrowserMainWindow : public HbMainWindow
+    {
+    Q_OBJECT
+
+public:
+    explicit FileBrowserMainWindow(QWidget *parent = 0);
+    virtual ~FileBrowserMainWindow();
+    
+    void init();
+
+private slots:
+    void openFileBrowserView();
+    void openSettingsView();
+    void openEditorView(const QString &, bool);
+    
+private:
+    EngineWrapper* mEngineWrapper;
+    FileBrowserView* mFileBrowserView;
+    SettingsView* mSettingsView;
+    EditorView* mEditorView;
+    };
+
+#endif /* FILEBROWSERMAINWINDOW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/filebrowsermodel.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSERMODELH_H_
+#define FILEBROWSERMODELH_H_
+
+#include <QAbstractListModel>
+
+// Forward declarations
+class EngineWrapper;
+class QModelIndex;
+class QFileIconProvider;
+
+class FileBrowserModel : public QAbstractListModel
+{
+    Q_OBJECT
+
+public:
+    explicit FileBrowserModel(EngineWrapper *engineWrapper, QObject *parent = 0);
+    virtual ~FileBrowserModel();
+
+    int rowCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
+
+private:
+    EngineWrapper *mEngineWrapper;
+    QFileIconProvider *mFileIconProvider;
+};
+
+
+
+#endif /* FILEBROWSERMODELH_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/filebrowsersettings.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSERSETTINGS_H_
+#define FILEBROWSERSETTINGS_H_
+
+#include "engine.h"
+#include "enginewrapper.h"
+
+#include <QString>
+
+/**
+  * Settings class that is used for ui settings handling
+  */
+class FileBrowserSettings
+{
+public:
+    FileBrowserSettings(TFileBrowserSettings *aSettings) : mSettings(aSettings) { }
+    ~FileBrowserSettings() { }
+
+    int displayMode() const { return mSettings->iDisplayMode; }
+    void setDisplayMode(int displayMode) { mSettings->iDisplayMode = displayMode; }
+
+    int fileViewMode() const { return mSettings->iFileViewMode; }
+    void setFileViewMode(int fileViewMode) { mSettings->iFileViewMode = fileViewMode; }
+
+    bool showSubDirectoryInfo() const { return mSettings->iShowSubDirectoryInfo; }
+    void setShowSubDirectoryInfo(bool showSubDirectoryInfo) { mSettings->iShowSubDirectoryInfo = showSubDirectoryInfo; }
+
+    bool showAssociatedIcons() const { return mSettings->iShowAssociatedIcons; }
+    void setShowAssociatedIcons(bool showAssociatedIcons) { mSettings->iShowAssociatedIcons = showAssociatedIcons; }
+
+    bool rememberLastPath() const { return mSettings->iRememberLastPath; }
+    void setRememberLastPath(bool rememberLastPath) { mSettings->iRememberLastPath = rememberLastPath; }
+
+    QString lastPath() const { return QString((QChar*)mSettings->iLastPath.Ptr(),mSettings->iLastPath.Length()); }
+    void lastPath(const QString& lastPath) { mSettings->iLastPath = lastPath.utf16(); }
+
+    bool rememberFolderSelection() const { return mSettings->iRememberFolderSelection; }
+    void setRememberFolderSelection(bool rememberFolderSelection) { mSettings->iRememberFolderSelection = rememberFolderSelection; }
+
+    bool enableToolbar() const { return mSettings->iEnableToolbar; }
+    void setEnableToolbar(bool enableToolbar) { mSettings->iEnableToolbar = enableToolbar; }
+
+    bool supportNetworkDrives() const { return mSettings->iSupportNetworkDrives; }
+    void setSupportNetworkDrives(bool supportNetworkDrives) { mSettings->iSupportNetworkDrives = supportNetworkDrives; }
+
+    bool bypassPlatformSecurity() const { return mSettings->iBypassPlatformSecurity; }
+    void setBypassPlatformSecurity(bool bypassPlatformSecurity) { mSettings->iBypassPlatformSecurity = bypassPlatformSecurity; }
+
+    bool removeFileLocks() const { return mSettings->iRemoveFileLocks; }
+    void setRemoveFileLocks(bool removeFileLocks) { mSettings->iRemoveFileLocks = removeFileLocks; }
+
+    bool ignoreProtectionsAttributes() const { return mSettings->iIgnoreProtectionsAtts; }
+    void setIgnoreProtectionsAttributes(bool ignoreProtectionsAttributes) { mSettings->iIgnoreProtectionsAtts = ignoreProtectionsAttributes; }
+
+    bool removeROMWriteProrection() const { return mSettings->iRemoveROMWriteProrection; }
+    void setRemoveROMWriteProrection(bool removeROMWriteProrection) { mSettings->iRemoveROMWriteProrection = removeROMWriteProrection; }
+
+private:
+    TFileBrowserSettings *mSettings;
+};
+
+#endif /* FILEBROWSERSETTINGS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/filebrowserview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,315 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEBROWSERVIEWH_H_
+#define FILEBROWSERVIEWH_H_
+
+#include "menuaction.h"
+#include "enginewrapper.h"
+
+#include <HbView>
+#include <HbMainWindow>
+#include <HbApplication>
+
+#include <QDir>
+
+// Forward declarations
+class QFileInfo;
+class QSignalMapper;
+class QItemSelection;
+class QString;
+class QGraphicsLinearLayout;
+
+class HbListView;
+class HbListWidget;
+class HbToolBar;
+class HbLabel;
+class HbDialog;
+
+class FileBrowserMainWindow;
+class EditorView;
+class SearchView;
+class SettingsView;
+class EngineWrapper;
+class FileBrowserModel;
+
+class FileBrowserView : public HbView
+{
+    Q_OBJECT
+
+    enum resourceItem
+    {
+	FileItem,
+	Directory
+    };
+
+public:
+    explicit FileBrowserView(FileBrowserMainWindow &mainWindow);
+    virtual ~FileBrowserView();
+    void init(EngineWrapper *engineWrapper);
+    QModelIndex currentItemIndex();
+    QModelIndexList getSelectedItemsOrCurrentItem();
+
+public slots:
+
+private:
+    void fileOverwriteDialog();
+    void openListDialog(const QStringList& items, const QString &aTitleText, QObject* receiver, const char* member);
+
+    void diskAdmin(int cmd);
+    HbDialog *filePathQuery(const QString &headingText,
+                            const QString &text,
+                            const QString &primaryActionText,
+                            const QString &secondaryActionText);
+
+//    HbDialog *openTextQuery(const QString &headingText,
+//                            const QString &text,
+//                            const QString &primaryActionText,
+//                            const QString &secondaryActionText);
+
+    HbDialog *openNumberQuery(const QString &headingText,
+                              const QString &text,
+                              const QString &primaryActionText,
+                              const QString &secondaryActionText,
+                              int aMin = -99999,
+                              int aMax = 99999);
+
+    void openPropertyDialog(const QStringList& propertyList, const QString& title);
+
+//    QModelIndexList *getSelectedItemsOrCurrentItem();
+
+    void createToolBar();
+    // Menu related methods
+    void createMenu();
+    void createFileMenu();
+    void createEditMenu();
+    void createViewMenu();
+    void createDiskAdminMenu();
+    void createToolsMenu();
+
+    void createSelectionMenuItem();
+    void createSettingsMenuItem();
+    void createAboutMenuItem();
+    void createExitMenuItem();
+
+    void refreshList();
+    void populateFolderContent();
+
+private slots:
+    // menu action slots
+    // file menu
+    void fileBackMoveUp();
+    void fileOpenDrive();
+    void fileOpenDirectory();
+    void fileSearch();
+
+    void fileNewFile();
+    void doFileNewFile(HbAction *);
+
+    void fileNewDirectory();
+    void doFileNewDirectory(HbAction *);
+
+    void fileDelete();
+    void doFileDelete(HbAction *);
+
+    void fileRename();
+    void doFileRename(HbAction *);
+    void doFileRenameFileExist(HbAction *);
+
+    void fileTouch();
+    void doFileTouch(HbAction *);
+    void fileProperties();
+
+    void fileChecksumsMD5();
+    void fileChecksumsMD2();
+    void fileChecksumsSHA1();
+    void fileChecksums(TFileBrowserCmdFileChecksums checksumType);
+
+    void fileSetAttributes();
+
+    // edit menu
+    void editSnapShotToE();
+    void editCut();
+    void editCopy();
+    void editPaste();
+
+    void editCopyToFolder();
+    void doEditCopyToFolder(HbAction *);
+
+    void editMoveToFolder();
+    void doEditMoveToFolder(HbAction *);
+
+    void editSelect();
+    void editUnselect();
+    void editSelectAll();
+    void editUnselectAll();
+
+    // view menu
+    void viewFilterEntries();
+    void viewRefresh();
+
+    // disk admin menu
+    void diskAdminSetDrivePassword();
+    void diskAdminSetDrivePasswordNew(HbAction *);
+    void doDiskAdminSetDrivePassword(HbAction *);
+
+    void diskAdminUnlockDrive();
+    void doDiskAdminUnlockDrive(HbAction *action);
+
+    void diskAdminClearDrivePassword();
+    void doDiskAdminClearDrivePassword(HbAction *action);
+
+    void diskAdminEraseDrivePassword();
+    void doDiskAdminEraseDrivePassword(HbAction *);
+
+    void diskAdminFormatDrive();
+    void doDiskAdminFormatDrive(HbAction *);
+
+    void diskAdminQuickFormatDrive();
+    void doDiskAdminQuickFormatDrive(HbAction *);
+
+    void diskAdminCheckDisk();
+
+    void diskAdminScanDrive();
+    void doDiskAdminScanDrive(HbAction *);
+
+    void diskAdminSetDriveName();
+    void doDiskAdminSetDriveName(HbAction *action);
+
+    void diskAdminSetDriveVolumeLabel();
+    void doDiskAdminSetDriveVolumeLabel(HbAction*);
+
+    void diskAdminEjectDrive();
+    void diskAdminDismountDrive();
+    void doDiskAdminDismountDrive(HbAction *);
+
+    void diskAdminEraseMBR();
+    void doDiskAdminEraseMBR(HbAction *);
+    void doDiskAdminReallyEraseMBR(HbAction *);
+    void doDiskAdminNotRemovableReallyEraseMBR(HbAction *);
+    
+    void diskAdminPartitionDrive();
+    void diskAdminPartitionDriveProceed(HbAction *);
+    void diskAdminPartitionDriveReallyProceed(HbAction *);
+    void diskAdminPartitionDriveIsNotRemovable(HbAction *);
+    void diskAdminPartitionDriveEraseMbr(HbAction *);
+    void diskAdminPartitionDriveGetCount(HbAction*);
+
+    // tools menu
+    void toolsAllAppsToTextFile();
+    void toolsAllFilesToTextFile();
+    void toolsAvkonIconCacheEnable();
+    void toolsAvkonIconCacheDisable();
+
+    void toolsDisableExtendedErrors();
+    void toolsDumpMsgStoreWalk();
+    void toolsEditDataTypes();
+    void toolsEnableExtendedErrors ();
+
+    void toolsErrorSimulateLeave();
+    void doToolsErrorSimulateLeave(HbAction *action);
+
+    void toolsErrorSimulatePanic();
+    void doToolsErrorSimulatePanicCode(HbAction *action);
+    void doToolsErrorSimulatePanic(HbAction *action);
+
+    void toolsErrorSimulateException();
+    void doToolsErrorSimulateException(HbAction *);
+
+//    void toolsLocalConnectivityActivateInfrared();
+//    void toolsLocalConnectivityLaunchBTUI();
+//    void toolsLocalConnectivityLaunchUSBUI();
+    void toolsMessageInbox();
+    void toolsMessageDrafts();
+    void toolsMessageSentItems();
+    void toolsMessageOutbox();
+    void toolsMemoryInfo();
+    void toolsSecureBackStart();
+    void toolsSecureBackRestore();
+    void toolsSecureBackStop();
+    void toolsSetDebugMaskQuestion();
+    void toolsSetDebugMask(HbAction *);
+    void toolsShowOpenFilesHere();
+
+    // main menu items
+    void selectionModeChanged();
+    void about();
+    
+signals:
+    void aboutToShowSettingsView();
+    void aboutToShowEditorView(const QString &, bool);
+    void aboutToSimulateLeave(int);
+
+private slots:
+    void itemHighlighted(const QModelIndex &index);
+    //void itemSelected(const QModelIndex &index);
+    void updateMenu();
+    void selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/);
+    void activated(const QModelIndex& index);
+    void activateSelectionMode();
+    void deActivateSelectionMode();
+
+    void fileOpen(HbAction *);
+    void fileOverwrite(HbAction *);
+    void fileOverwritePostfix(HbAction *);
+
+private:
+    FileBrowserMainWindow &mMainWindow;
+    EngineWrapper *mEngineWrapper;
+
+    HbListView *mListView;
+    HbToolBar *mToolBar;
+    HbLabel *mNaviPane;
+    QGraphicsLinearLayout *mMainLayout;
+
+    QString mDirectory;
+    // selected path
+    QString mSelectedFilePath;
+    // initial path
+    //QDir mInitDirPath;
+    // file info contains all needed information of selected file from file model
+    QModelIndexList mClipboardIndices;
+    FileBrowserModel *mFileBrowserModel;
+    MenuAction mFileViewMenuActions;
+    HbAction *mToolbarBackAction;
+
+    // search
+    SearchView *mSearch;
+    // settings
+    SettingsView *mSettingsView;
+    // flags
+    bool mItemHighlighted;
+    bool mLocationChanged;
+    // flag for removing source file after copied to target file
+    bool mRemoveFileAfterCopied;
+    bool mClipBoardInUse;
+    bool mFolderContentChanged;
+
+    // temporarily storage
+    QString mOldPassword;
+    QString mPanicCategory;
+    QString mAbsoluteFilePath;
+    OverwriteOptions mOverwriteOptions;
+    QModelIndex mModelIndex;
+    bool mIsRenameAllowed;
+    bool mProceed;
+    bool mEraseMBR;
+};
+
+
+
+#endif /* FILEBROWSERVIEWH_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/fileentry.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef FILEEENTRY_H
+#define FILEEENTRY_H
+
+#include "FBFileUtils.h"
+#include <QString>
+#include <QDate>
+#include <QStringList>
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class FileEntry {
+
+public:
+    
+    /**
+     * Constructor
+     */
+    FileEntry(TFileEntry aFileEntry);
+    
+    /**
+     * Destructor
+     */
+    ~FileEntry();
+    
+    /* Functions that are called from UI */
+public: 
+    QString fullName();
+    QString path();
+
+    int attributes();
+    QString attributesString();
+
+    int size();
+    QString sizeString();
+
+//    QDateTime modified();
+    QString modifiedString();
+//    int Uid(int id);
+    bool isDir();
+    QString name();
+
+    int dirEntries();
+    QString dirEntriesString();
+
+    int iconId();
+
+private:
+    TFileEntry mFileEntry;
+    };
+
+#endif //FILEEENTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/menuaction.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MENUACTION_H
+#define MENUACTION_H
+
+//#include <QtGui>
+
+class HbMenu;
+class HbAction;
+
+class MenuAction
+{
+public:
+    MenuAction() :
+            //NoAction = 0,
+            mFileMenu(0),
+            mFileBackMoveUp(0),
+            mFileOpenDrive(0),
+            mFileOpenDirectory(0),
+            mFileSearch(0),
+            mFileNewMenu(0),
+            mFileNewFile(0),
+            mFileNewDirectory(0),
+            mFileDelete(0),
+            mFileRename(0),
+            mFileTouch(0),
+            mFileProperties(0),
+            mFileChecksumsMenu(0),
+            mFileChecksumsMD5(0),
+            mFileChecksumsMD2(0),
+            mFileChecksumsSHA1(0),
+            mFileSetAttributes(0),
+            //Edit -
+            mEditMenu(0),
+            mEditSnapShotToE(0),
+            mEditCut(0),
+            mEditCopy(0),
+            mEditPaste(0),
+            mEditCopyToFolder(0),
+            mEditMoveToFolder(0),
+            mEditSelect(0),
+            mEditUnselect(0),
+            mEditSelectAll(0),
+            mEditUnselectAll(0),
+            // View -
+            mViewMenu(0),
+            mViewFilterEntries(0),
+            mViewRefresh(0),
+            // Disk admin -
+            mDiskAdminMenu(0),
+            mDiskAdminSetDrivePassword(0),
+            mDiskAdminUnlockDrive(0),
+            mDiskAdminClearDrivePassword(0),
+            mDiskAdminEraseDrivePassword(0),
+            mDiskAdminFormatDrive(0),
+            mDiskAdminQuickFormatDrive(0),
+            mDiskAdminCheckDisk(0),
+            mDiskAdminScanDrive(0),
+            mDiskAdminSetDriveName(0),
+            mDiskAdminSetDriveVolumeLabel(0),
+            mDiskAdminEjectDrive(0),
+            mDiskAdminDismountDrive(0),
+            mDiskAdminEraseMBR(0),
+            mDiskAdminPartitionDrive(0),
+            // Tools -
+            mToolsMenu(0),
+            mToolsAllAppsToTextFile(0),
+            mToolsAllFilesToTextFile(0),
+            mToolsAvkonIconCacheMenu(0),
+            mToolsAvkonIconCacheEnable(0),
+            mToolsAvkonIconCacheDisable(0),
+            mToolsDisableExtendedErrors(0),
+            mToolsDumpMsgStoreWalk(0),
+            mToolsEditDataTypes(0),
+            mToolsEnableExtendedErrors(0),
+            mToolsErrorSimulateMenu(0),
+            mToolsErrorSimulateLeave(0),
+            mToolsErrorSimulatePanic(0),
+            mToolsErrorSimulateException(0),
+            mToolsMessageAttachmentsMenu(0),
+            mToolsMessageInbox(0),
+            mToolsMessageDrafts(0),
+            mToolsMessageSentItems(0),
+            mToolsMessageOutbox(0),
+            //    mLocalConnectivityMenu(0),
+            //    mToolsLocalConnectivityActivateInfrared(0),
+            //    mToolsLocalConnectivityLaunchBTUI(0),
+            //    mToolsLocalConnectivityLaunchUSBUI(0),
+            mToolsMemoryInfo(0),
+            mToolsSecureBackupMenu(0),
+            mToolsSecureBackStart(0),
+            mToolsSecureBackRestore(0),
+            mToolsSecureBackStop(0),
+            mToolsSetDebugMask(0),
+            mToolsShowOpenFilesHere(0),
+            mSelection(0),
+            mSetting(0),
+            mAbout(0),
+            mExit(0)
+    {
+
+    }
+
+    ~MenuAction() { }
+public:
+    //File menu operations
+    //NoAction = 0,
+    HbMenu *mFileMenu;
+    HbAction *mFileBackMoveUp;
+    HbAction *mFileOpenDrive;
+    HbAction *mFileOpenDirectory;
+    HbAction *mFileSearch;
+    HbMenu *mFileNewMenu;
+    HbAction *mFileNewFile;
+    HbAction *mFileNewDirectory;
+    HbAction *mFileDelete;
+    HbAction *mFileRename;
+    HbAction *mFileTouch;
+    HbAction *mFileProperties;
+    HbMenu *mFileChecksumsMenu;
+    HbAction *mFileChecksumsMD5;
+    HbAction *mFileChecksumsMD2;
+    HbAction *mFileChecksumsSHA1;
+    HbAction *mFileSetAttributes;
+
+    //Edit -
+    HbMenu *mEditMenu;
+    HbAction *mEditSnapShotToE;
+    HbAction *mEditCut;
+    HbAction *mEditCopy;
+    HbAction *mEditPaste;
+    HbAction *mEditCopyToFolder;
+    HbAction *mEditMoveToFolder;
+    HbAction *mEditSelect;
+    HbAction *mEditUnselect;
+    HbAction *mEditSelectAll;
+    HbAction *mEditUnselectAll;
+
+    // View -
+    HbMenu *mViewMenu;
+    HbAction *mViewFilterEntries;
+    HbAction *mViewRefresh;
+
+    // Disk admin -
+    HbMenu *mDiskAdminMenu;
+    HbAction *mDiskAdminSetDrivePassword;
+    HbAction *mDiskAdminUnlockDrive;
+    HbAction *mDiskAdminClearDrivePassword;
+    HbAction *mDiskAdminEraseDrivePassword;
+    HbAction *mDiskAdminFormatDrive;
+    HbAction *mDiskAdminQuickFormatDrive;
+    HbAction *mDiskAdminCheckDisk;
+    HbAction *mDiskAdminScanDrive;
+    HbAction *mDiskAdminSetDriveName;
+    HbAction *mDiskAdminSetDriveVolumeLabel;
+    HbAction *mDiskAdminEjectDrive;
+    HbAction *mDiskAdminDismountDrive;
+    HbAction *mDiskAdminEraseMBR;
+    HbAction *mDiskAdminPartitionDrive;
+
+    // Tools -
+    HbMenu *mToolsMenu;
+    HbAction *mToolsAllAppsToTextFile;
+    HbAction *mToolsAllFilesToTextFile;
+
+    HbMenu *mToolsAvkonIconCacheMenu;
+    HbAction *mToolsAvkonIconCacheEnable;
+    HbAction *mToolsAvkonIconCacheDisable;
+
+    HbAction *mToolsDisableExtendedErrors;
+    HbAction *mToolsDumpMsgStoreWalk;
+    HbAction *mToolsEditDataTypes;
+
+    HbAction *mToolsEnableExtendedErrors;
+
+    HbMenu *mToolsErrorSimulateMenu;    
+    HbAction *mToolsErrorSimulateLeave;
+    HbAction *mToolsErrorSimulatePanic;
+    HbAction *mToolsErrorSimulateException;
+
+    HbMenu *mToolsMessageAttachmentsMenu;
+    HbAction *mToolsMessageInbox;
+    HbAction *mToolsMessageDrafts;
+    HbAction *mToolsMessageSentItems;
+    HbAction *mToolsMessageOutbox;
+
+    HbMenu *mToolsLocalConnectivityMenu;
+    HbAction *mToolsLocalConnectivityActivateInfrared;
+    HbAction *mToolsLocalConnectivityLaunchBTUI;
+    HbAction *mToolsLocalConnectivityLaunchUSBUI;
+
+    HbAction *mToolsMemoryInfo;
+
+    HbMenu *mToolsSecureBackupMenu;
+    HbAction *mToolsSecureBackStart;
+    HbAction *mToolsSecureBackRestore;
+    HbAction *mToolsSecureBackStop;
+
+    HbAction *mToolsSetDebugMask;
+    HbAction *mToolsShowOpenFilesHere;
+
+    HbAction *mSelection;
+    HbAction *mSetting;
+    HbAction *mAbout;
+    HbAction *mExit;
+};
+
+
+#endif // MENUACTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/notifications.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef NOTIFICATIONS_H_
+#define NOTIFICATIONS_H_
+
+//#include <hbdeviceprogressdialog.h>
+#include <hbmessagebox.h>
+
+class Notifications
+{
+public:
+    
+    static void showAboutNote();
+    static void showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout = HbPopup::NoTimeout);
+    static void showInformationNote(const QString &text, const QString &title = QString());
+    static void showErrorNote(const QString &text, bool noTimeout = false);
+    static void showConfirmationNote(const QString &text, bool noTimeout = false);
+    static bool showConfirmationQuery(const QString &aText);
+    
+
+//    static HbDeviceProgressDialog* showWaitDialog(const QString &text);
+
+private:    
+};
+
+#endif // NOTIFICATIONS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/searchview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef SEARCHVIEW_H
+#define SEARCHVIEW_H
+
+#include <hbview.h>
+#include <hbmainwindow.h>
+
+#include <qdatetime.h>
+
+class QDir;
+class EngineWrapper;
+class QStringList;
+class HbDataForm;
+class HbDataFormModelItem;
+
+/**
+  * Settings class that is used for 
+  */
+class SearchAttributes
+{
+public:
+    QString   mSearchDir;
+    QString   mWildCards;
+    QString   mTextInFile;
+    int       mMinSize;
+    int       mMaxSize;
+    QDate     mMinDate;
+    QDate     mMaxDate;
+    bool      mRecurse;
+};
+
+/**
+ * search results class.
+ */
+class SearchResults
+{
+public:
+    int         mNumberOfFoundFiles;
+    QStringList* mFoundFilesList;
+};
+
+class SearchView : public HbView
+{
+    Q_OBJECT
+
+public:
+    SearchView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper);
+    ~SearchView();
+    void open(const QString &path);
+
+
+private slots:
+    void backButtonClicked();
+    void startFileSearch();
+    void loadAttributes();
+    void readFormItems();
+    
+private:
+    void fileSearchResults();
+
+    /* Main Window of folderbrowser */
+    HbMainWindow &mMainWindow;
+    /* Main View of folderbrowser*/
+    HbView &mMainView;
+    /* EngineWrapper */
+    EngineWrapper &mEngineWrapper;  
+
+    /* Search attributes */
+    SearchAttributes mAttributes;    
+    /* Search results */
+    SearchResults mResults;
+
+    HbDataForm *mForm;
+    HbDataFormModelItem *mSearchFileNameItem;
+    HbDataFormModelItem *mWildCardItem;
+    HbDataFormModelItem *mHasString;
+    HbDataFormModelItem *mRecurse;
+    HbDataFormModelItem *mMinSize;
+    HbDataFormModelItem *mMaxSize;
+    HbDataFormModelItem *mMinDate;
+    HbDataFormModelItem *mMaxDate;
+
+    QString mPath;
+};
+
+#endif // SEARCHVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/inc/settingsview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef SETTINGSVIEW_H
+#define SETTINGSVIEW_H
+
+#include <hbview.h>
+
+class HbDataForm;
+class HbDataFormModelItem;
+class FileBrowserMainWindow;
+class EngineWrapper;
+class FileBrowserSettings;
+
+class SettingsView : public HbView
+{
+    Q_OBJECT
+
+public:
+    SettingsView(FileBrowserMainWindow &mainWindow, EngineWrapper &engineWrapper);
+    virtual ~SettingsView();
+
+signals:
+    void finished(bool ok);
+
+public slots:
+//    void displayModeChanged();
+//    void fileViewChanged();
+//    void subDirectoryInfoChanged();
+//    void associatedIconsChanged();
+//    void rememberFolderOnExitChanged();
+//    void rememberLastFolderChanged();
+//    void showToolbarChanged();
+
+//    void toggleChange(QModelIndex, QModelIndex);
+    void accept();
+    void reject();
+
+private:
+    void initDataForm();
+    void createToolbar();
+    void constructMenu();
+    void loadSettings(const FileBrowserSettings &settings);
+    void saveSettings(FileBrowserSettings &settings);
+
+private:
+    FileBrowserMainWindow &mMainWindow;
+    EngineWrapper &mEngineWrapper;
+
+    HbDataForm *mForm;
+    HbDataFormModelItem *mDisplayModeItem;
+    HbDataFormModelItem *mFileViewItem;
+    HbDataFormModelItem *mShowDirectoryInfoItem;
+    HbDataFormModelItem *mShowAssociatedIconsItem;
+    HbDataFormModelItem *mRememberFolderOnExitItem;
+    HbDataFormModelItem *mRememberLastFolderItem;
+    HbDataFormModelItem *mShowToolbarItem;
+
+    HbDataFormModelItem *mSupportNetDrivesItem; //"Support net drives"
+    HbDataFormModelItem *mBypassPlatformSecurityItem; //"Bypass plat.security"
+    HbDataFormModelItem *mUnlockFilesViaSBItem; //"Unlock files via SB"
+    HbDataFormModelItem *mIgnoreProtectionAttributesItem; //"Ign. protection atts"
+    HbDataFormModelItem *mNoROAttributeCopyFromZItem; //"No RO-att copy from Z:"
+
+};
+
+#endif // SETTINGSVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/driveentry.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "driveentry.h"
+
+// ---------------------------------------------------------------------------
+
+DriveEntry::DriveEntry(TDriveEntry aDriveEntry)
+: mDriveEntry(aDriveEntry)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+DriveEntry::~DriveEntry()
+{
+}
+
+// ---------------------------------------------------------------------------
+
+QChar DriveEntry::driveLetter()
+{
+    return QChar(TUint(mDriveEntry.iLetter));
+}
+
+// ---------------------------------------------------------------------------
+
+int DriveEntry::number()
+{
+    return mDriveEntry.iNumber;
+}
+
+// ---------------------------------------------------------------------------
+
+QString DriveEntry::mediaTypeString()
+{
+    return QString::fromUtf16(mDriveEntry.iMediaTypeDesc.Ptr(), mDriveEntry.iMediaTypeDesc.Length());
+}
+
+// ---------------------------------------------------------------------------
+
+QString DriveEntry::attributesString()
+{
+    return QString::fromUtf16(mDriveEntry.iAttributesDesc.Ptr(), mDriveEntry.iAttributesDesc.Length());
+}
+
+// ---------------------------------------------------------------------------
+
+int DriveEntry::iconId()
+{
+    return mDriveEntry.iIconId;
+}
+
+// ---------------------------------------------------------------------------
+
+qint64 DriveEntry::volumeInfoFree()
+{
+    return mDriveEntry.iVolumeInfo.iFree;
+}
+
+// ---------------------------------------------------------------------------
+
+qint64 DriveEntry::volumeInfoSize()
+{
+    return mDriveEntry.iVolumeInfo.iSize;
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/editorview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <HbView>
+#include <HbMainWindow>
+#include <HbApplication>
+#include <HbAction>
+#include <HbMenu>
+#include <HbTextEdit>
+#include <hbpushbutton.h>
+
+#include <QGraphicsLinearLayout>
+#include <QFile>
+#include <QFileInfo>
+#include <QTextStream>
+#include <QByteArray>
+#include <QByteRef>
+
+#include "editorview.h"
+
+EditorView::EditorView(HbMainWindow &mainWindow)
+    : mMainWindow(mainWindow),
+    mTextEdit(0),
+    mFileHex(false),
+    mFlagReadOnly(),
+    mFileName(),
+    mFileContent(),
+    mToTextAction(0),
+    mToHexAction(0),
+    mExitAction(0)
+{
+    // Override back navigation action
+    HbAction *backNaviAction = new HbAction(Hb::BackNaviAction, this);
+    connect(backNaviAction, SIGNAL(triggered()), this, SLOT(backButtonClicked()));
+    setNavigationAction(backNaviAction);
+
+    createMenu();
+
+    // text editor
+//    mTextEdit = new QTextEdit();
+//    QGraphicsLinearLayout *editorLayout = new QGraphicsLinearLayout(Qt::Vertical);
+//    QGraphicsProxyWidget *editorWidget = new QGraphicsProxyWidget();
+//    editorWidget->setWidget(mTextEdit);
+//    editorLayout->addItem(editorWidget);
+//    setLayout(editorLayout);
+
+    mTextEdit = new HbTextEdit();
+    mTextEdit->setAlignment(Qt::AlignTop);
+    QGraphicsLinearLayout *editorLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
+    editorLayout->addItem(mTextEdit);
+    setLayout(editorLayout);
+}
+
+EditorView::~EditorView() 
+{
+//    delete mTextEdit;
+//    delete mToTextAction;
+//    delete mToHexAction;
+//    delete mExitAction;
+}
+
+void EditorView::open(const QString& fileName, bool flagReadOnly)
+{
+    mFlagReadOnly = flagReadOnly;
+
+    if (!fileName.isEmpty()) {
+        mTextEdit->setReadOnly(mFlagReadOnly);
+        loadFile(fileName);
+    }
+    else {
+        // not valid file name
+    }
+}
+
+void EditorView::loadFile(const QString &fileName)
+{
+    mFileName = fileName;
+    QFile file(fileName);
+    QFileInfo baseName(fileName);
+    setTitle(baseName.fileName());
+
+    if (!file.open(QFile::ReadOnly | QFile::Text)) {
+        // note: cannot be opened. readonly or not text
+        return;
+    }
+    QTextStream in(&file);
+    in.setAutoDetectUnicode(false);
+
+    mFileContent = in.readAll();
+    file.close();
+    displayInText();
+}
+
+void EditorView::displayInText()
+{
+    mFileHex = false;
+    QByteArray asciiContent = mFileContent.toAscii();
+    mTextEdit->setPlainText(QString(asciiContent));
+}
+
+void EditorView::displayInHex()
+{
+    QByteArray asciiContent = mFileContent.toAscii().toHex();
+    QString textInHex = QString(asciiContent);
+    mTextEdit->setPlainText(textInHex);
+    mFileHex = true;
+}
+
+void EditorView::createMenu()
+{
+    mToTextAction = menu()->addAction("View as text");
+    connect(mToTextAction, SIGNAL(triggered()), this, SLOT(displayInText()));
+    mToHexAction = menu()->addAction("View as hex");
+    connect(mToHexAction, SIGNAL(triggered()), this, SLOT(displayInHex()));
+//    mExitAction = menu()->addAction("Exit");
+//    connect(mExitAction, SIGNAL(triggered()), this, SLOT(backButtonClicked()));
+
+    // update the menus before showing it:
+    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
+}
+
+void EditorView::updateMenu()
+{
+    mToTextAction->setVisible(mFileHex);
+    mToHexAction->setVisible(!mFileHex);
+}	
+
+void EditorView::backButtonClicked()
+{
+    emit finished(false);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,729 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "enginewrapper.h"
+#include "engine.h"
+#include "FBFileUtils.h"
+#include "notifications.h"
+#include "filebrowserview.h"
+#include "searchview.h"
+#include "filebrowsersettings.h"
+#include "settingsview.h"
+
+#include <QString>
+#include <QFileInfo>
+#include <QModelIndex>
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::EngineWrapper()
+    : mEngine(0),
+    mFilesFound(),
+    mSettings(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::~EngineWrapper()
+{
+    if(mEngine != NULL) {
+        TRAP_IGNORE(mEngine->DeActivateEngineL());
+        delete mEngine;
+    } 
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::init()
+{
+    TRAPD(err, mEngine = CEngine::NewL(this));
+    if (err != KErrNone) {
+        return false;
+    } else {
+        TRAP_IGNORE(mEngine->ActivateEngineL());
+        mSettings = FileBrowserSettings(&mEngine->Settings());
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+// Functions that are called from UI
+// ---------------------------------------------------------------------------
+bool EngineWrapper::searchFiles()
+{
+    TRAPD(err, mEngine->SearchL() );
+    if(err != KErrNone) {
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+SearchAttributes EngineWrapper::getFileSearchAttributes()
+{
+    TSearchAttributes tAttributes = mEngine->GetSearchAttributes();
+    SearchAttributes attributes;
+
+    // Convert TSearchAttributes to SearchAttributes 
+    attributes.mSearchDir  = QString((QChar*)tAttributes.iSearchDir.Ptr(),tAttributes.iSearchDir.Length());
+    attributes.mWildCards  = QString((QChar*)tAttributes.iWildCards.Ptr(),tAttributes.iWildCards.Length()); 
+    attributes.mTextInFile = QString((QChar*)tAttributes.iTextInFile.Ptr(),tAttributes.iTextInFile.Length()); 
+    attributes.mMinSize    = tAttributes.iMinSize;
+    attributes.mMaxSize    = tAttributes.iMaxSize;
+    attributes.mRecurse    = tAttributes.iRecurse;
+    
+    // TTime to QDate
+    TBuf<20> timeString;
+    _LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3");
+    TRAP_IGNORE( tAttributes.iMinDate.FormatL(timeString, KDateString) );
+    QString temp = QString::fromUtf16(timeString.Ptr(), timeString.Length());
+    temp.replace(QChar('/'), QChar('-'));
+    attributes.mMinDate = QDate::fromString(temp, "dd-MM-yyyy");
+    
+    
+    TRAP_IGNORE( tAttributes.iMaxDate.FormatL(timeString, KDateString) );
+    temp = QString::fromUtf16(timeString.Ptr(), timeString.Length());
+    temp.replace(QChar('/'), QChar('-'));
+    attributes.mMaxDate = QDate::fromString(temp, "dd-MM-yyyy");
+    
+    return attributes;
+
+}
+
+// ---------------------------------------------------------------------------
+int EngineWrapper::setFileSearchAttributes(SearchAttributes attributes)
+{
+    TSearchAttributes tAttributes;
+    // Convert SearchAttributes to TSearchAttributes 
+    
+    //convert QString to TFilename:
+    tAttributes.iSearchDir = TFileName(attributes.mSearchDir.utf16());
+    tAttributes.iWildCards = TFileName(attributes.mWildCards.utf16());
+    tAttributes.iTextInFile = TFileName(attributes.mTextInFile.utf16());
+    
+    tAttributes.iMinSize    = attributes.mMinSize;
+    tAttributes.iMaxSize    = attributes.mMaxSize;    
+    tAttributes.iRecurse    = attributes.mRecurse;
+    
+    // QDate to TTime for both min- and max Date
+    QString temp = attributes.mMinDate.toString("yyyy-MM-dd");
+    QStringList dateList = temp.split("-");
+    int month = dateList[1].toInt() - 1;
+    int day = dateList[2].toInt() - 1;
+    temp = dateList[0];
+    if (month == 0) {
+        temp.append("00");
+    }
+    else {
+        temp.append(QString::number(month));
+    }
+    if (day == 0) {
+        temp.append("00");
+    }
+    else { 
+        temp.append(QString::number(day));
+    }
+    temp.append(":");
+        
+    TBuf<24> dateString(temp.utf16());
+    tAttributes.iMinDate.Set(dateString);
+    
+    temp = attributes.mMaxDate.toString("yyyy-MM-dd");
+    dateList = temp.split("-");
+    month = dateList[1].toInt() - 1;
+    day = dateList[2].toInt() - 1;
+    temp = dateList[0];
+    if (month == 0) {
+        temp.append("00");
+    }
+    else {
+        temp.append(QString::number(month));
+    }
+    if (day == 0) {
+        temp.append("00");
+    }
+    else { 
+        temp.append(QString::number(day));
+    }
+    temp.append(":");
+    dateString.Copy(temp.utf16());
+    tAttributes.iMaxDate.Set(dateString);
+    
+    mEngine->ChangeAttributes(tAttributes);
+    return KErrNone;
+}
+
+
+// ---------------------------------------------------------------------------
+SearchResults EngineWrapper::getSearchResults()
+{
+    TSearchResults tResults = mEngine->SearchResults();
+    SearchResults results;
+    results.mNumberOfFoundFiles = tResults.iNumberOfFoundFiles;
+    CFileEntryList* foundFilesResult = mEngine->FoundFiles();
+    if (!mFilesFound.isEmpty()) {
+        mFilesFound.clear();
+        }
+    // copy file names and convert them from TFileName format to QStringList items type
+    for (int i = 0; i < foundFilesResult->Count(); i++) {
+            mFilesFound.append(
+                    QString((QChar*)foundFilesResult->At(i).iFullName.Ptr(), 
+                    foundFilesResult->At(i).iFullName.Length()) 
+                    );
+        }
+    results.mFoundFilesList = &mFilesFound;
+    return results;
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::saveSettings(bool aNotifyModules)
+{
+    return mEngine->SaveSettingsL(aNotifyModules);;
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::isDriveListViewActive()
+{
+    // TODO check return value
+    if (mEngine->FileUtils() && mEngine->FileUtils()->IsDriveListViewActive()) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+bool EngineWrapper::isCurrentDriveReadOnly()
+{
+    // TODO check return value
+    if (mEngine->FileUtils() && mEngine->FileUtils()->IsCurrentDriveReadOnly()) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+bool EngineWrapper::isClipBoardListInUse()
+{
+    if (mEngine->FileUtils() && mEngine->FileUtils()->ClipBoardList() && mEngine->FileUtils()->ClipBoardList()->Count() != 0)
+        return true;
+    else
+        return false;
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::startExecutingCommands(const QString &aCommandsExecutionMessage)
+{
+    TPtrC commandsExecutionMessage(reinterpret_cast<const TText*>(aCommandsExecutionMessage.constData()));
+    TRAPD(err, mEngine->FileUtils()->StartExecutingCommandsL(commandsExecutionMessage) );
+    Q_UNUSED(err); //TODO
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::refreshView()
+{
+    if (mEngine->FileUtils()) {
+        TRAPD(err, mEngine->FileUtils()->RefreshViewL() );
+        Q_UNUSED(err); //TODO
+    }
+}
+
+void EngineWrapper::moveUpOneLevel()
+{
+    if (mEngine->FileUtils()) {
+        TRAPD(err, mEngine->FileUtils()->MoveUpOneLevelL() );
+        Q_UNUSED(err); //TODO
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::moveDownToDirectory(const QModelIndex& aIndex)
+{
+    if (mEngine->FileUtils()) {
+        TRAPD(err, mEngine->FileUtils()->MoveDownToDirectoryL(aIndex.row()) );
+        Q_UNUSED(err); //TODO
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+int EngineWrapper::clipboardCut(const QModelIndexList& aSelectionIndices)
+{
+    TInt operations = 0;
+    const CArrayFix<TInt> *selectionIndexes = convertSelectionList(aSelectionIndices);
+    if (mEngine->FileUtils()) {
+        TRAPD(err, operations = mEngine->FileUtils()->ClipboardCutL(selectionIndexes) );
+        Q_UNUSED(err); //TODO
+    }
+    delete selectionIndexes;
+    return operations;
+}
+
+// ---------------------------------------------------------------------------
+int EngineWrapper::clipboardCopy(const QModelIndexList& aSelectionIndices)
+{
+    TInt operations = 0;
+    const CArrayFix<TInt> *selectionIndexes = convertSelectionList(aSelectionIndices);
+
+    if (mEngine->FileUtils()) {
+        TRAPD(err, operations = mEngine->FileUtils()->ClipboardCopyL(selectionIndexes));
+        Q_UNUSED(err); //TODO
+    }
+    delete selectionIndexes;
+    return operations;
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::clipboardPaste(const OverwriteOptions &aOverwriteOptions)
+{
+    TOverwriteOptions tOverwriteOptions = convertOverwriteOptions(aOverwriteOptions);
+    if (mEngine->FileUtils()) {
+        TRAPD(err, mEngine->FileUtils()->ClipboardPasteL(tOverwriteOptions));
+        Q_UNUSED(err); //TODO
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::copyToFolder(const QString &aTargetDir, const OverwriteOptions &aOverwriteOptions, bool aMove)
+{
+    TFileName targetDir = TFileName(aTargetDir.utf16());
+    TOverwriteOptions tOverwriteOptions = convertOverwriteOptions(aOverwriteOptions);
+
+
+    TRAPD(err, mEngine->FileUtils()->CopyToFolderL(targetDir, tOverwriteOptions, aMove ? ETrue : EFalse) );
+    Q_UNUSED(err); //TODO
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::createNewFile(const QString &aNewFileName)
+{
+    TFileName fileName = TFileName(aNewFileName.utf16());
+    TRAPD(err, mEngine->FileUtils()->NewFileL(fileName) );
+    Q_UNUSED(err); //TODO
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::createNewDirectory(const QString &aNewDirectoryName)
+{
+    TFileName newDirectoryName = TFileName(aNewDirectoryName.utf16());
+    TRAPD(err, mEngine->FileUtils()->NewDirectoryL(newDirectoryName) );
+    Q_UNUSED(err); //TODO
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::deleteItems(const QModelIndexList& aSelectionIndices)
+{
+    setCurrentSelection(aSelectionIndices);
+    TRAPD(err, mEngine->FileUtils()->DeleteL() );
+    Q_UNUSED(err); //TODO
+}
+
+// ---------------------------------------------------------------------------
+bool EngineWrapper::selectionHasDirs()
+{
+    return mEngine->FileUtils()->SelectionHasDirs();
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::rename(const QModelIndex& aIndex, const QString aNewName)
+{
+    if (mEngine->FileUtils()) {
+        const TFileName newName = TFileName(aNewName.utf16());
+        TRAPD(err, mEngine->FileUtils()->RenameL(aIndex.row(), newName) );
+        Q_UNUSED(err); //TODO
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::touch(bool aRecurse)
+{
+    if (mEngine->FileUtils()) {
+        TRAPD(err, mEngine->FileUtils()->TouchL(aRecurse) );
+        Q_UNUSED(err); //TODO
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::properties(const QModelIndex &aCurrentItemIndex, QStringList &aPropertyList, QString &aTitleText)
+{
+    if (mEngine->FileUtils()) {
+
+        // create an array for the items
+        CDesCArray* entryLines = new(ELeave) CDesCArrayFlat(16);
+//        CleanupStack::PushL(entryLines);
+        TFileName titleText;
+
+        TRAPD(err, mEngine->FileUtils()->PropertiesL(aCurrentItemIndex.row(), entryLines, titleText));
+        Q_UNUSED(err); //TODO
+
+        aTitleText = QString::fromUtf16(titleText.Ptr(), titleText.Length());
+        QString textItem;
+        for (TInt i = 0; i < entryLines->Count(); ++i) {
+            textItem = QString::fromUtf16((*entryLines)[i].Ptr(), (*entryLines)[i].Length());
+            aPropertyList.append(textItem);
+        }
+//        CleanupStack::PopAndDestroy(); //entryLines
+        delete entryLines;
+    }
+}
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::openAppArc(QString fileName)
+{
+
+    //convert QString to TFilename:
+    fileName.replace("/", "\\");
+    TFileName fileToOpen = TFileName(fileName.utf16());
+
+    TRAPD(err, mEngine->OpenWithApparcL(fileToOpen) );
+    if(err != KErrNone) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::openDocHandler(QString fileName, bool embeddedVal)
+{
+    //convert QString to TFilename:
+    fileName.replace("/", "\\");
+    TFileName fileToOpen = TFileName(fileName.utf16());
+
+    TRAPD(err, mEngine->OpenWithDocHandlerL(fileToOpen, embeddedVal) );
+    if(err != KErrNone) {
+        return false;
+    } else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+int EngineWrapper::itemCount() const
+{
+    if (mEngine->FileUtils()->IsDriveListViewActive()) {
+        return mEngine->FileUtils()->DriveEntries()->Count();
+    } else {
+        return mEngine->FileUtils()->FileEntries()->Count();
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+DriveEntry EngineWrapper::getDriveEntry(const QModelIndex& aIndex) const
+{
+    TDriveEntry driveEntry;
+    if (mEngine->FileUtils()->DriveEntries()->Count() > aIndex.row() && aIndex.row() >= 0) {
+        driveEntry = mEngine->FileUtils()->DriveEntries()->At(aIndex.row());
+    }
+    return DriveEntry(driveEntry);
+}
+
+// ---------------------------------------------------------------------------
+
+FileEntry EngineWrapper::getFileEntry(const QModelIndex& aIndex) const
+{
+    TFileEntry fileEntry;
+    if (mEngine->FileUtils()->FileEntries()->Count() > aIndex.row() && aIndex.row() >= 0) {
+        fileEntry = mEngine->FileUtils()->FileEntries()->At(aIndex.row());
+    }
+    return FileEntry(fileEntry);
+}
+
+// ---------------------------------------------------------------------------
+
+const CArrayFix<TInt> *EngineWrapper::convertSelectionList(const QModelIndexList &aSelectionIndices)
+{
+    CArrayFixFlat<TInt>* selectionIndexes = 0;
+    TRAPD(err, selectionIndexes = new(ELeave)CArrayFixFlat<TInt>(4));
+    if (err != KErrNone) {
+        return 0;
+    }
+
+    for (int i=0; i< aSelectionIndices.count(); ++i) {
+        TRAPD(err, selectionIndexes->AppendL(aSelectionIndices.at(i).row()) );
+        Q_UNUSED(err); //TODO
+    }
+    return selectionIndexes;
+}
+
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::setCurrentSelection(const QModelIndexList &aSelectionIndices)
+{
+    const CArrayFix<TInt> *selectionIndexes = convertSelectionList(aSelectionIndices);
+    mEngine->FileUtils()->SetCurrentSelection(selectionIndexes);
+    delete selectionIndexes;
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::isDestinationEntriesExists(const QModelIndexList &aSelectionIndices, QString aTargetDir)
+{
+    TFileName targetDir = TFileName(aTargetDir.utf16());
+    setCurrentSelection(aSelectionIndices);
+
+    TBool someEntryExists = mEngine->FileUtils()->IsDestinationEntriesExists(targetDir);
+    return someEntryExists;
+}
+
+// ---------------------------------------------------------------------------
+bool EngineWrapper::targetExists(const QModelIndex& aIndex, const QString aNewName)
+{
+    const TFileName newName = TFileName(aNewName.utf16());
+    return mEngine->FileUtils()->TargetExists(aIndex.row(), newName);
+}
+
+// ---------------------------------------------------------------------------
+
+QString EngineWrapper::currentPath() const
+{
+    return QString::fromUtf16(mEngine->FileUtils()->CurrentPath().Ptr(),
+                              mEngine->FileUtils()->CurrentPath().Length());
+}
+
+TOverwriteOptions EngineWrapper::convertOverwriteOptions(const OverwriteOptions &aOverwriteOptions)
+{
+    TOverwriteOptions tOverwriteOptions;
+    tOverwriteOptions.iDoFileOperations = aOverwriteOptions.doFileOperations;
+    tOverwriteOptions.iQueryIndex = aOverwriteOptions.queryIndex;
+    tOverwriteOptions.iPostFix = TFileName(aOverwriteOptions.postFix.utf16());
+    tOverwriteOptions.iOverWriteFlags = aOverwriteOptions.overWriteFlags;
+    return tOverwriteOptions;
+}
+
+bool EngineWrapper::hasDrivePassword(const QModelIndex &aIndex)
+{
+    bool hasPassword = false;
+    if (mEngine->FileUtils()->DriveEntries()->Count() > aIndex.row() && aIndex.row() >= 0)
+    {
+        TDriveEntry driveEntry = mEngine->FileUtils()->DriveEntries()->At(aIndex.row());
+        hasPassword = driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttHasPassword;
+    }
+    return hasPassword;
+}
+
+bool EngineWrapper::isDriveRemovable(const QModelIndex &aIndex)
+{
+    bool isRemovable = false;
+    if (mEngine->FileUtils()->DriveEntries()->Count() > aIndex.row() && aIndex.row() >= 0)
+    {
+        TDriveEntry driveEntry = mEngine->FileUtils()->DriveEntries()->At(aIndex.row());
+        isRemovable = driveEntry.iVolumeInfo.iDrive.iDriveAtt & KDriveAttRemovable;
+    }
+    return isRemovable;
+}
+
+bool EngineWrapper::isDriveLocked(const QModelIndex &aIndex)
+{
+    bool isRemovable = false;
+    if (mEngine->FileUtils()->DriveEntries()->Count() > aIndex.row() && aIndex.row() >= 0)
+    {
+        TDriveEntry driveEntry = mEngine->FileUtils()->DriveEntries()->At(aIndex.row());
+        isRemovable = driveEntry.iVolumeInfo.iDrive.iMediaAtt & KMediaAttLocked;
+    }
+    return isRemovable;
+}
+
+void EngineWrapper::GetDriveName(const QModelIndex &aIndex, QString &aDriveName)
+{
+    TFileName driveName;
+    mEngine->FileUtils()->GetDriveName(aIndex.row(), driveName);
+    aDriveName = QString::fromUtf16(driveName.Ptr(), driveName.Length());
+}
+
+
+void EngineWrapper::GetDriveVolumeLabel(const QModelIndex &aIndex, QString &aVolumeLabel)
+{
+    TFileName volumeLabel;
+    mEngine->FileUtils()->GetDriveName(aIndex.row(), volumeLabel);
+    aVolumeLabel = QString::fromUtf16(volumeLabel.Ptr(), volumeLabel.Length());
+}
+
+void EngineWrapper::DiskAdminSetDrivePassword(const QModelIndex &aIndex,
+                                              const QString &aOldPassword,
+                                              const QString &aNewPassword)
+{
+    TFileName oldPassword = TFileName(aOldPassword.utf16());
+    TFileName newPassword = TFileName(aNewPassword.utf16());
+    TRAP_IGNORE(mEngine->FileUtils()->SetDrivePasswordL(aIndex.row(), oldPassword, newPassword));
+}
+
+void EngineWrapper::DiskAdminUnlockDrive(const QModelIndex &aIndex, const QString &aOldPassword)
+{
+    TFileName oldPassword = TFileName(aOldPassword.utf16());
+    TRAP_IGNORE(mEngine->FileUtils()->UnlockDriveL(aIndex.row(), oldPassword));
+}
+
+void EngineWrapper::DiskAdminClearDrivePassword(const QModelIndex &aIndex, const QString &aOldPassword)
+{
+    TFileName oldPassword = TFileName(aOldPassword.utf16());
+    TRAP_IGNORE(mEngine->FileUtils()->ClearDrivePasswordL(aIndex.row(), oldPassword));
+}
+
+void EngineWrapper::DiskAdminEraseDrivePassword(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->EraseDrivePasswordL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminFormatDrive(const QModelIndex &aIndex, bool aQuickFormat)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->FormatDriveL(aIndex.row(), aQuickFormat));
+}
+
+void EngineWrapper::DiskAdminQuickFormatDrive(const QModelIndex &aIndex, bool aQuickFormat)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->FormatDriveL(aIndex.row(), aQuickFormat));
+}
+
+void EngineWrapper::DiskAdminCheckDisk(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->CheckDiskL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminScanDrive(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->ScanDriveL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminSetDriveName(const QModelIndex &aIndex, const QString &aDriveName)
+{
+    TFileName driveName = TFileName(aDriveName.utf16());
+    TRAP_IGNORE(mEngine->FileUtils()->SetDriveNameL(aIndex.row(), driveName));
+}
+
+void EngineWrapper::DiskAdminSetDriveVolumeLabel(const QModelIndex &aIndex, const QString &aVolumeLabel)
+{
+    TFileName volumeLabel = TFileName(aVolumeLabel.utf16());
+    TRAP_IGNORE(mEngine->FileUtils()->SetDriveNameL(aIndex.row(), volumeLabel));
+}
+
+void EngineWrapper::DiskAdminEjectDrive(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->EjectDriveL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminDismountDrive(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->DismountFileSystemL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminEraseMBR(const QModelIndex &aIndex)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->EraseMBRL(aIndex.row()));
+}
+
+void EngineWrapper::DiskAdminPartitionDrive(const QModelIndex &aIndex, bool aEraseMBR, int aAmountOfPartitions)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->PartitionDriveL(aIndex.row(), aEraseMBR, aAmountOfPartitions));
+}
+
+void EngineWrapper::ToolsSetErrRd(bool aEnable)
+{
+    TRAP_IGNORE(mEngine->FileUtils()->SetErrRdL(aEnable));
+}
+
+bool EngineWrapper::ErrRdFileExists()
+{
+    return mEngine->FileUtils()->FileExists(KErrRdPath);
+}
+
+void EngineWrapper::ToolsErrorSimulateLeave(int aLeaveCode)
+{
+    mEngine->FileUtils()->SimulateLeaveL(aLeaveCode);
+}
+
+void EngineWrapper::ToolsErrorSimulatePanic(QString aPanicCategory, int aPanicCode)
+{
+    TBuf<128> panicCategory;
+    panicCategory.Copy(aPanicCategory.utf16());
+    mEngine->FileUtils()->SimulatePanicL(panicCategory, aPanicCode);
+}
+
+void EngineWrapper::ToolsErrorSimulateException(int aExceptionCode)
+{
+    mEngine->FileUtils()->SimulateExceptionL(aExceptionCode);
+}
+
+quint32 EngineWrapper::getDebugMask()
+{
+    return mEngine->FileUtils()->GetDebugMask();
+}
+
+void EngineWrapper::toolsSetDebugMask(quint32 aDbgMask)
+{
+    mEngine->FileUtils()->SetDebugMaskL(aDbgMask);
+}
+
+void EngineWrapper::showFileCheckSums(const QModelIndex &aIndex, TFileBrowserCmdFileChecksums checksumType)
+{
+    mEngine->FileUtils()->ShowFileCheckSumsL(aIndex.row(), checksumType);
+}
+
+// ---------------------------------------------------------------------------
+// Functions that are called from engine
+// ---------------------------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowErrorNote(const TDesC& aDescText, TBool aNoTimeout /*= EFalse*/)
+{
+    QString qStringText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    Notifications::showErrorNote(qStringText, aNoTimeout);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowInformationNote(const TDesC &aDescText, const TDesC &aDescTitle)
+{
+    QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    QString qTitle = QString::fromUtf16(aDescTitle.Ptr(), aDescTitle.Length());
+    Notifications::showInformationNote(qText, qTitle);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowConfirmationNote(const TDesC& aDescText, TBool aNoTimeout /*= EFalse*/)
+{
+    QString qStringText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    Notifications::showConfirmationNote(qStringText, aNoTimeout);
+}
+
+TBool EngineWrapper::ShowConfirmationQuery(const TDesC& aDescText)
+{
+    QString qStringText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    return Notifications::showConfirmationQuery(qStringText);
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/filebrowsermainwindow.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <HbApplication>
+#include <HbMainWindow>
+
+#include "filebrowsermainwindow.h"
+#include "enginewrapper.h"
+#include "filebrowserview.h"
+#include "settingsview.h"
+#include "editorview.h"
+
+FileBrowserMainWindow::FileBrowserMainWindow(QWidget *parent) :
+        HbMainWindow( parent )
+        ,mEngineWrapper(0)
+        ,mFileBrowserView(0)
+        ,mSettingsView(0)
+        ,mEditorView(0)
+{
+}
+
+FileBrowserMainWindow::~FileBrowserMainWindow ()
+{
+    if (mEngineWrapper) {
+        delete mEngineWrapper;
+    }
+}
+
+void FileBrowserMainWindow::init()
+{
+    // Create Engine Wrapper and initialize it
+    mEngineWrapper = new EngineWrapper();
+    int error = mEngineWrapper->init();
+    Q_ASSERT_X(error == 1, "FileBrowser", "Engine initialization failed");
+
+    // Create file browser view
+    mFileBrowserView = new FileBrowserView(*this);
+    connect(mFileBrowserView, SIGNAL(aboutToShowSettingsView()), this, SLOT(openSettingsView()));
+    mFileBrowserView->init(mEngineWrapper);
+    addView(mFileBrowserView);
+
+    // Create settings view
+    mSettingsView = new SettingsView(*this, *mEngineWrapper);
+    connect(mSettingsView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView()));
+    addView(mSettingsView);
+
+    // Create settings view
+    mEditorView = new EditorView(*this);
+    connect(mFileBrowserView, SIGNAL(aboutToShowEditorView(const QString &, bool)), this, SLOT(openEditorView(const QString &, bool)));
+    connect(mEditorView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView()));
+    addView(mEditorView);
+
+    // Show ApplicationView at startup
+    setCurrentView(mFileBrowserView);
+    // Show HbMainWindow
+    show();
+}
+
+void FileBrowserMainWindow::openFileBrowserView()
+{
+    setCurrentView(mFileBrowserView);
+}
+
+void FileBrowserMainWindow::openSettingsView()
+{
+    setCurrentView(mSettingsView);
+}
+
+void FileBrowserMainWindow::openEditorView(const QString &fileName, bool flagReadOnly)
+{
+    mEditorView->open(fileName, flagReadOnly);
+    setCurrentView(mEditorView);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/filebrowsermodel.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "filebrowsermodel.h"
+#include "enginewrapper.h"
+#include "fileentry.h"
+#include "driveentry.h"
+#include "settingsview.h"
+#include "filebrowsersettings.h"
+#include "FB.hrh"
+
+#include <QModelIndex>
+#include <QFileIconProvider>
+
+/**
+  Constructs a file browser custom system model with the given \a engineWrapper and \a parent.
+  */
+FileBrowserModel::FileBrowserModel(EngineWrapper *engineWrapper, QObject *parent) :
+    QAbstractListModel(parent),
+    mEngineWrapper(engineWrapper),
+    mFileIconProvider(0)
+{
+    mFileIconProvider = new QFileIconProvider();
+}
+
+/**
+  Destroys this file browser custom system model.
+  */
+FileBrowserModel::~FileBrowserModel()
+{  
+    if (mFileIconProvider) {
+        delete mFileIconProvider;
+    }
+}
+
+/**
+  \reimp
+  */
+int FileBrowserModel::rowCount(const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    return mEngineWrapper->itemCount();
+}
+
+/**
+  \reimp
+  */
+QVariant FileBrowserModel::data(const QModelIndex &index, int role) const
+{
+    if (!index.isValid() || index.model() != this)
+        return QVariant();
+
+    switch (role) {
+    case Qt::EditRole:
+    case Qt::DisplayRole: {
+            QStringList listItem;
+            if (mEngineWrapper->isDriveListViewActive()) {
+                DriveEntry driveEntry(mEngineWrapper->getDriveEntry(index));
+                if (mEngineWrapper->settings().fileViewMode() == EFileViewModeSimple)
+                {
+                    const QString SimpleDriveEntry("%1: <%2>");
+                    listItem /*<< driveEntry.IconId() */
+                            << SimpleDriveEntry.arg(driveEntry.driveLetter())
+                                               .arg(driveEntry.mediaTypeString());
+                } else if (mEngineWrapper->settings().fileViewMode() == EFileViewModeExtended) {
+                    const QString SimpleDriveEntry("%1: <%2>");
+                    const QString ExtendedDriveEntry("%1/%2 kB");
+                    listItem /*<< driveEntry.IconId()*/
+                            << SimpleDriveEntry.arg(driveEntry.driveLetter())
+                                               .arg(driveEntry.mediaTypeString())
+                            << ExtendedDriveEntry.arg(QString::number(driveEntry.volumeInfoFree()/1024))
+                                                 .arg(QString::number(driveEntry.volumeInfoSize()/1024));
+
+                }
+            } else {
+                FileEntry fileEntry(mEngineWrapper->getFileEntry(index));
+                if (mEngineWrapper->settings().fileViewMode() == EFileViewModeSimple)
+                {
+                    listItem /*<< fileEntry.IconId()*/
+                            << fileEntry.name();
+                } else if (mEngineWrapper->settings().fileViewMode() == EFileViewModeExtended) {
+                    QString extraData;
+                    extraData.append(fileEntry.modifiedString());
+                    if (fileEntry.isDir() && fileEntry.dirEntries() >= 0) {
+                        extraData.append(" - ");
+                        extraData.append(fileEntry.dirEntriesString());
+                    } else if (!fileEntry.isDir()) {
+                        extraData.append(" - ");
+                        extraData.append(fileEntry.sizeString());
+                    }
+                    listItem /*<< fileEntry.IconId()*/
+                            << fileEntry.name() << extraData << fileEntry.attributesString();
+                }
+            }
+            return listItem;
+        }
+    case Qt::DecorationRole: {
+            if (mEngineWrapper) {
+                QIcon icon;
+                if (mEngineWrapper->isDriveListViewActive()) {
+                    icon = mFileIconProvider->icon(QFileIconProvider::Drive);
+                } else {
+                    FileEntry fileEntry(mEngineWrapper->getFileEntry(index));
+                    if (fileEntry.isDir()) {
+                        icon = mFileIconProvider->icon(QFileIconProvider::Folder);
+                    } else {
+                        icon = mFileIconProvider->icon(QFileIconProvider::File);
+                    }
+                }
+                return QVariant(icon);
+            }
+        }
+    }
+
+    return QVariant();
+}
+
+/**
+  \reimp
+  */
+QVariant FileBrowserModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    Q_UNUSED(section)
+    Q_UNUSED(orientation)
+    Q_UNUSED(role)
+
+    // TODO, implement or remove
+    return QVariant();
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/filebrowserview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1976 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "filebrowserview.h"
+#include "filebrowsermainwindow.h"
+#include "settingsview.h"
+#include "editorview.h"
+#include "searchview.h"
+#include "enginewrapper.h"
+#include "notifications.h"
+
+#include "filebrowsermodel.h"
+
+#include <HbMainWindow>
+#include <HbMenu>
+#include <HbPopup>
+#include <HbView>
+#include <HbMessageBox>
+#include <HbAction>
+#include <HbLabel>
+#include <HbListView>
+#include <HbListViewItem>
+#include <HbListWidget>
+#include <HbLineEdit>
+#include <HbAbstractViewItem>
+#include <HbSelectionDialog>
+#include <HbValidator>
+#include <HbInputDialog>
+#include <HbToolBar>
+
+#include <QString>
+#include <QGraphicsLinearLayout>
+#include <QItemSelection>
+#include <QDebug>
+//TODO check if needed to do this way
+#include <FB.hrh>
+
+//const int DRIVEPATHLENGTH = 4;
+const QString okActionText("OK");
+const QString cancelActionText("Cancel");
+
+// ---------------------------------------------------------------------------
+
+FileBrowserView::FileBrowserView(FileBrowserMainWindow &mainWindow)
+    : mMainWindow(mainWindow),
+    mEngineWrapper(0),
+    mListView(0),
+    mToolBar(0),
+    mNaviPane(0),
+    mMainLayout(0),
+    mDirectory(),
+    mSelectedFilePath(),
+    mFileBrowserModel(0),
+    mFileViewMenuActions(),
+    mToolbarBackAction(0),
+    mSearch(0),
+    mSettingsView(0),
+    mItemHighlighted(false),
+    mLocationChanged(false),
+    mRemoveFileAfterCopied(false),
+    mClipBoardInUse(false),
+    mFolderContentChanged(false),
+    mOldPassword(),
+    mPanicCategory(),
+    mAbsoluteFilePath(),
+    mOverwriteOptions(),
+    mIsRenameAllowed(true),
+    mProceed(false),
+    mEraseMBR(false)
+{
+    setTitle("File Browser");
+
+    createMenu();
+    createToolBar();
+}
+
+// ---------------------------------------------------------------------------	
+
+void FileBrowserView::init(EngineWrapper *engineWrapper)
+{
+    mEngineWrapper = engineWrapper;
+
+    mListView = new HbListView(this);
+    mFileBrowserModel = new FileBrowserModel(mEngineWrapper);
+    if (!mListView->model()) {
+        mListView->setModel(mFileBrowserModel);
+        mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
+        mEngineWrapper->refreshView();
+        mToolbarBackAction->setEnabled(!mEngineWrapper->isDriveListViewActive());
+    }
+
+    //mListView->setRootIndex(mFileSystemModel->index(startPath));
+    //mListView->setRootIndex(model->index());
+
+    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
+    //mListView->setHighlightMode(HbItemHighlight::HighlightAlwaysVisible);
+
+    connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
+
+    mNaviPane = new HbLabel(this);
+    mNaviPane->setPlainText(QString(" ")); // TODO get from settings or default
+    //mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
+    HbFontSpec fontSpec(HbFontSpec::PrimarySmall);
+    mNaviPane->setFontSpec(fontSpec);
+
+    // Create layout and add list view and toolbar into layout:
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    mMainLayout->addItem(mNaviPane);
+    mMainLayout->addItem(mListView);
+    //mMainLayout->addItem(mToolBar);
+    setLayout(mMainLayout);
+}
+
+// ---------------------------------------------------------------------------
+
+FileBrowserView::~FileBrowserView()
+{  
+//    if (mSearch !=0) {
+//        delete mSearch;
+//    }
+//    if (mSettingsView != 0) {
+//        delete mSettingsView;
+//    }
+//    if (mEngineWrapper) {
+//        delete mEngineWrapper;
+//    }
+    delete mFileBrowserModel;
+    delete mListView;
+    delete mToolBar;
+}
+
+/**
+  Create a file browser tool bar
+  */
+void FileBrowserView::createToolBar()
+{
+    mToolBar = new HbToolBar(this);
+
+    mToolbarBackAction = new HbAction(/*"Back"*/);
+    mToolbarBackAction->setToolTip("Back");
+    mToolbarBackAction->setIcon(HbIcon(QString(":/qgn_indi_tb_filebrowser_folder_parent.svg")));
+    connect(mToolbarBackAction, SIGNAL(triggered()), this, SLOT(fileBackMoveUp()));
+    mToolBar->addAction(mToolbarBackAction);
+
+    if (mFileViewMenuActions.mSelection) {
+        mToolBar->addAction(mFileViewMenuActions.mSelection);
+    }
+
+    setToolBar(mToolBar);
+}
+
+/**
+  Initial setup for options menu.
+  Dynamic menu update during the runtime is performed by updateMenu() which
+  to menu's aboutToShow() signal.
+  */
+void FileBrowserView::createMenu()
+{
+    createFileMenu();
+    createEditMenu();
+    createViewMenu();
+    createDiskAdminMenu();
+    createToolsMenu();
+
+    createSelectionMenuItem();
+    createSettingsMenuItem();
+    createAboutMenuItem();
+    createExitMenuItem();
+
+    // menu dynamic update
+    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
+}
+
+/**
+  Initial setup for File submenu
+  */
+void FileBrowserView::createFileMenu()
+{
+    mFileViewMenuActions.mFileMenu = menu()->addMenu("File");
+
+    mFileViewMenuActions.mFileBackMoveUp = mFileViewMenuActions.mFileMenu->addAction("Back/Move up (<-)", this, SLOT(fileBackMoveUp()));
+    mFileViewMenuActions.mFileOpenDrive = mFileViewMenuActions.mFileMenu->addAction("Open drive (->)", this, SLOT(fileOpenDrive()));
+    mFileViewMenuActions.mFileOpenDirectory = mFileViewMenuActions.mFileMenu->addAction("Open directory (->)", this, SLOT(fileOpenDirectory()));
+    mFileViewMenuActions.mFileSearch = mFileViewMenuActions.mFileMenu->addAction("Search", this, SLOT(fileSearch()));
+    mFileViewMenuActions.mFileSearch->setVisible(false);
+
+    mFileViewMenuActions.mFileNewMenu = mFileViewMenuActions.mFileMenu->addMenu("New");
+    mFileViewMenuActions.mFileNewFile = mFileViewMenuActions.mFileNewMenu->addAction("File", this, SLOT(fileNewFile()));
+    mFileViewMenuActions.mFileNewDirectory = mFileViewMenuActions.mFileNewMenu->addAction("Directory", this, SLOT(fileNewDirectory()));
+
+    mFileViewMenuActions.mFileDelete = mFileViewMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
+    mFileViewMenuActions.mFileRename = mFileViewMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
+    mFileViewMenuActions.mFileTouch = mFileViewMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
+    mFileViewMenuActions.mFileProperties = mFileViewMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
+
+    mFileViewMenuActions.mFileChecksumsMenu = mFileViewMenuActions.mFileMenu->addMenu("Checksums");
+    mFileViewMenuActions.mFileChecksumsMD5 = mFileViewMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
+    mFileViewMenuActions.mFileChecksumsMD2 = mFileViewMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
+    mFileViewMenuActions.mFileChecksumsSHA1 = mFileViewMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
+
+    mFileViewMenuActions.mFileSetAttributes = mFileViewMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
+    mFileViewMenuActions.mFileSetAttributes->setVisible(false);
+}
+
+/**
+  Initial setup for Edit submenu
+  */
+void FileBrowserView::createEditMenu()
+{
+    mFileViewMenuActions.mEditMenu = menu()->addMenu("Edit");
+
+    mFileViewMenuActions.mEditSnapShotToE = mFileViewMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
+    mFileViewMenuActions.mEditSnapShotToE->setVisible(false);
+    mFileViewMenuActions.mEditCut = mFileViewMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
+    mFileViewMenuActions.mEditCopy = mFileViewMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
+    mFileViewMenuActions.mEditPaste = mFileViewMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
+
+    mFileViewMenuActions.mEditCopyToFolder = mFileViewMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
+    mFileViewMenuActions.mEditMoveToFolder = mFileViewMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
+
+    mFileViewMenuActions.mEditSelect = mFileViewMenuActions.mEditMenu->addAction("Select", this, SLOT(editSelect()));
+    mFileViewMenuActions.mEditUnselect = mFileViewMenuActions.mEditMenu->addAction("Unselect", this, SLOT(editUnselect()));
+    mFileViewMenuActions.mEditSelectAll = mFileViewMenuActions.mEditMenu->addAction("Select all", this, SLOT(editSelectAll()));
+    mFileViewMenuActions.mEditUnselectAll = mFileViewMenuActions.mEditMenu->addAction("Unselect all", this, SLOT(editUnselectAll()));
+}
+
+/**
+  Initial setup for View submenu
+  */
+void FileBrowserView::createViewMenu()
+{
+    mFileViewMenuActions.mViewMenu = menu()->addMenu("View");
+    mFileViewMenuActions.mViewMenu->menuAction()->setVisible(false);
+
+    mFileViewMenuActions.mViewFilterEntries = mFileViewMenuActions.mViewMenu->addAction("Filter entries", this, SLOT(viewFilterEntries()));
+    mFileViewMenuActions.mViewRefresh = mFileViewMenuActions.mViewMenu->addAction("Refresh", this, SLOT(viewRefresh()));
+}
+
+/**
+  Initial setup for Disk Admin submenu
+  */
+void FileBrowserView::createDiskAdminMenu()
+{
+    mFileViewMenuActions.mDiskAdminMenu = menu()->addMenu("Disk admin");
+    mFileViewMenuActions.mDiskAdminMenu->menuAction()->setVisible(false);
+
+    mFileViewMenuActions.mDiskAdminSetDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive password", this, SLOT(diskAdminSetDrivePassword()));
+    mFileViewMenuActions.mDiskAdminUnlockDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Unlock drive", this, SLOT(diskAdminUnlockDrive()));
+    mFileViewMenuActions.mDiskAdminClearDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Clear drive password", this, SLOT(diskAdminClearDrivePassword()));
+    mFileViewMenuActions.mDiskAdminEraseDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Erase drive password", this, SLOT(diskAdminEraseDrivePassword()));
+    mFileViewMenuActions.mDiskAdminFormatDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Format drive", this, SLOT(diskAdminFormatDrive()));
+    mFileViewMenuActions.mDiskAdminQuickFormatDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Quick format drive", this, SLOT(diskAdminQuickFormatDrive()));
+    mFileViewMenuActions.mDiskAdminCheckDisk = mFileViewMenuActions.mDiskAdminMenu->addAction("Check disk", this, SLOT(diskAdminCheckDisk()));
+    mFileViewMenuActions.mDiskAdminScanDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Scan drive", this, SLOT(diskAdminScanDrive()));
+    mFileViewMenuActions.mDiskAdminSetDriveName = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive name", this, SLOT(diskAdminSetDriveName()));
+    mFileViewMenuActions.mDiskAdminSetDriveVolumeLabel = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive volume label", this, SLOT(diskAdminSetDriveVolumeLabel()));
+    mFileViewMenuActions.mDiskAdminEjectDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Eject drive", this, SLOT(diskAdminEjectDrive()));
+    mFileViewMenuActions.mDiskAdminDismountDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Dismount drive", this, SLOT(diskAdminDismountDrive()));
+    mFileViewMenuActions.mDiskAdminEraseMBR = mFileViewMenuActions.mDiskAdminMenu->addAction("Erase MBR", this, SLOT(diskAdminEraseMBR()));
+    mFileViewMenuActions.mDiskAdminPartitionDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Partition drive", this, SLOT(diskAdminPartitionDrive()));
+}
+
+/**
+  Initial setup for Tools submenu
+  */
+void FileBrowserView::createToolsMenu()
+{
+    mFileViewMenuActions.mToolsMenu = menu()->addMenu("Tools");
+
+    mFileViewMenuActions.mToolsAllAppsToTextFile = mFileViewMenuActions.mToolsMenu->addAction("All apps to a text file", this, SLOT(toolsAllAppsToTextFile()));
+    mFileViewMenuActions.mToolsAllAppsToTextFile->setVisible(false);
+    mFileViewMenuActions.mToolsAllFilesToTextFile = mFileViewMenuActions.mToolsMenu->addAction("All files to a text file", this, SLOT(toolsAllFilesToTextFile()));
+    mFileViewMenuActions.mToolsAllFilesToTextFile->setVisible(false);
+
+    mFileViewMenuActions.mToolsAvkonIconCacheMenu = mFileViewMenuActions.mToolsMenu->addMenu("Avkon icon cache");
+    mFileViewMenuActions.mToolsAvkonIconCacheMenu->menuAction()->setVisible(false);
+    mFileViewMenuActions.mToolsAvkonIconCacheEnable = mFileViewMenuActions.mToolsAvkonIconCacheMenu->addAction("Enable", this, SLOT(toolsAvkonIconCacheEnable()));
+    mFileViewMenuActions.mToolsAvkonIconCacheDisable = mFileViewMenuActions.mToolsAvkonIconCacheMenu->addAction("Clear and disable", this, SLOT(toolsAvkonIconCacheDisable()));
+
+    mFileViewMenuActions.mToolsDisableExtendedErrors = mFileViewMenuActions.mToolsMenu->addAction("Disable extended errors", this, SLOT(toolsDisableExtendedErrors()));
+    mFileViewMenuActions.mToolsDumpMsgStoreWalk = mFileViewMenuActions.mToolsMenu->addAction("Dump msg. store walk", this, SLOT(toolsDumpMsgStoreWalk()));
+    mFileViewMenuActions.mToolsDumpMsgStoreWalk->setVisible(false);
+    mFileViewMenuActions.mToolsEditDataTypes = mFileViewMenuActions.mToolsMenu->addAction("Edit data types", this, SLOT(toolsEditDataTypes()));
+    mFileViewMenuActions.mToolsEditDataTypes->setVisible(false);
+    mFileViewMenuActions.mToolsEnableExtendedErrors = mFileViewMenuActions.mToolsMenu->addAction("Enable extended errors", this, SLOT(toolsEnableExtendedErrors()));
+
+    mFileViewMenuActions.mToolsErrorSimulateMenu = mFileViewMenuActions.mToolsMenu->addMenu("Error simulate");
+    mFileViewMenuActions.mToolsErrorSimulateLeave = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Leave", this, SLOT(toolsErrorSimulateLeave()));
+    mFileViewMenuActions.mToolsErrorSimulatePanic = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Panic", this, SLOT(toolsErrorSimulatePanic()));
+    mFileViewMenuActions.mToolsErrorSimulatePanic->setVisible(false);
+    mFileViewMenuActions.mToolsErrorSimulateException = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Exception", this, SLOT(toolsErrorSimulateException()));
+
+//    mFileViewMenuActions.mLocalConnectivityMenu = mFileViewMenuActions.mToolsMenu->addMenu("Local connectivity");
+//    mFileViewMenuActions.mToolsLocalConnectivityActivateInfrared = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Activate infrared", this, SLOT(toolsLocalConnectivityActivateInfrared()));
+//    mFileViewMenuActions.mToolsLocalConnectivityLaunchBTUI = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Launch BT UI", this, SLOT(toolsLocalConnectivityLaunchBTUI()));
+//    mFileViewMenuActions.mToolsLocalConnectivityLaunchUSBUI = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Launch USB UI", this, SLOT(toolsLocalConnectivityLaunchUSBUI()));
+
+    mFileViewMenuActions.mToolsMessageAttachmentsMenu = mFileViewMenuActions.mToolsMenu->addMenu("Message attachments");
+    mFileViewMenuActions.mToolsMessageAttachmentsMenu->menuAction()->setVisible(false);
+    mFileViewMenuActions.mToolsMessageInbox = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Inbox", this, SLOT(toolsMessageInbox()));
+    mFileViewMenuActions.mToolsMessageDrafts = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Drafts", this, SLOT(toolsMessageDrafts()));
+    mFileViewMenuActions.mToolsMessageSentItems = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Sent items", this, SLOT(toolsMessageSentItems()));
+    mFileViewMenuActions.mToolsMessageOutbox = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Outbox", this, SLOT(toolsMessageOutbox()));
+
+    mFileViewMenuActions.mToolsMemoryInfo = mFileViewMenuActions.mToolsMenu->addAction("Memory info", this, SLOT(toolsMemoryInfo()));
+    mFileViewMenuActions.mToolsMemoryInfo->setVisible(false);
+
+    mFileViewMenuActions.mToolsSecureBackupMenu = mFileViewMenuActions.mToolsMenu->addMenu("Secure backup");
+    mFileViewMenuActions.mToolsSecureBackupMenu->menuAction()->setVisible(false);
+    mFileViewMenuActions.mToolsSecureBackStart = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Start backup", this, SLOT(toolsSecureBackStart()));
+    mFileViewMenuActions.mToolsSecureBackRestore = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Start restore", this, SLOT(toolsSecureBackRestore()));
+    mFileViewMenuActions.mToolsSecureBackStop = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Stop", this, SLOT(toolsSecureBackStop()));
+
+    mFileViewMenuActions.mToolsSetDebugMask = mFileViewMenuActions.mToolsMenu->addAction("Set debug mask", this, SLOT(toolsSetDebugMaskQuestion()));
+    mFileViewMenuActions.mToolsShowOpenFilesHere = mFileViewMenuActions.mToolsMenu->addAction("Show open files here", this, SLOT(toolsShowOpenFilesHere()));
+    mFileViewMenuActions.mToolsShowOpenFilesHere->setVisible(false);
+}
+
+/**
+  Creates Selection mode menu item in option menu
+  */
+void FileBrowserView::createSelectionMenuItem()
+{
+    if (!mFileViewMenuActions.mSelection) {
+        mFileViewMenuActions.mSelection = menu()->addAction("Selection mode");
+        mFileViewMenuActions.mSelection->setToolTip("Selection mode");
+        mFileViewMenuActions.mSelection->setCheckable(true);
+        connect(mFileViewMenuActions.mSelection, SIGNAL(triggered()), this, SLOT(selectionModeChanged()));
+    }
+}
+
+/**
+  Creates Setting menu item in option menu
+  */
+void FileBrowserView::createSettingsMenuItem()
+{
+    mFileViewMenuActions.mSetting = menu()->addAction("Settings");
+    connect(mFileViewMenuActions.mSetting, SIGNAL(triggered()), this, SIGNAL(aboutToShowSettingsView()));
+}
+
+
+/**
+  Creates About menu item in option menu
+  */
+void FileBrowserView::createAboutMenuItem()
+{
+    // about note
+    mFileViewMenuActions.mAbout = menu()->addAction("About");
+    connect(mFileViewMenuActions.mAbout, SIGNAL(triggered()), this, SLOT(about()));
+}
+
+/**
+  Creates Exit menu item in option menu
+  */
+void FileBrowserView::createExitMenuItem()
+{
+    // application exit
+    mFileViewMenuActions.mExit = menu()->addAction("Exit");
+    connect(mFileViewMenuActions.mExit, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+/**
+  update menu: disk admin available only in device root view. edit available only in folder view
+  when file or folder content exist in current folder, or clipboard has copied item.
+  file and view menus updated every time regarding the folder content.
+  tools, settings, about, exit always available.
+  If there's remove and add operations at same time, always remove first
+  to keep to the correct menu items order.
+  */
+void FileBrowserView::updateMenu()
+{
+    bool emptyListBox = mFileBrowserModel->rowCount() == 0;           //iContainer->ListBoxNumberOfVisibleItems() == 0;
+    bool driveListActive = mEngineWrapper->isDriveListViewActive(); //iModel->FileUtils()->IsDriveListViewActive();
+    bool normalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
+    bool currentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();   //iModel->FileUtils()->IsCurrentDriveReadOnly();
+    bool currentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();   //iModel->FileUtils()->IsCurrentItemDirectory();
+    bool listBoxSelections = mListView->selectionModel()->selection().count() == 0;      //iContainer->ListBoxSelectionIndexesCount() == 0;
+    bool emptyClipBoard = !mEngineWrapper->isClipBoardListInUse();
+    bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
+
+    bool showEditMenu(true);
+    if (driveListActive) {
+        if (!showSnapShot || emptyListBox && emptyClipBoard)
+            showEditMenu = false;
+        else
+            showEditMenu = true;
+    } else {
+        if (emptyListBox && emptyClipBoard)
+            showEditMenu = false;
+        else
+            showEditMenu = true;
+    }
+
+    mFileViewMenuActions.mEditMenu->menuAction()->setVisible(showEditMenu);
+    // TODO mFileViewMenuActions.mDiskAdminMenu->menuAction()->setVisible(driveListActive);
+
+    mFileViewMenuActions.mFileBackMoveUp->setVisible( !driveListActive);
+
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpen, emptyListBox || driveListActive || currentItemDirectory);
+    mFileViewMenuActions.mFileOpenDrive->setVisible( !(emptyListBox || !driveListActive));
+    mFileViewMenuActions.mFileOpenDirectory->setVisible( !(emptyListBox || driveListActive || !currentItemDirectory));
+
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, emptyListBox || listBoxSelections || currentItemDirectory || driveListActive);
+    //aMenuPane->SetItemDimmed(EFileBrowserCmd FileEdit, emptyListBox || listBoxSelections || currentItemDirectory || driveListActive);
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, emptyListBox || driveListActive || currentItemDirectory);
+
+    mFileViewMenuActions.mFileNewMenu->menuAction()->setVisible(!(driveListActive || currentDriveReadOnly));
+    mFileViewMenuActions.mFileDelete->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
+    mFileViewMenuActions.mFileRename->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly || listBoxSelections));
+    mFileViewMenuActions.mFileTouch->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
+    mFileViewMenuActions.mFileProperties->setVisible(!(emptyListBox || listBoxSelections));
+    // TODO mFileViewMenuActions.mFileChecksums->setVisible(!(emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
+    // TODO mFileViewMenuActions.mFileSetAttributes->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
+    // TODO mFileViewMenuActions.mFileCompress->setVisible(!(currentDriveReadOnly || emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
+    // TODO mFileViewMenuActions.mFileDecompress->setVisible(!(currentDriveReadOnly || emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
+
+    bool currentSelected = true;    //iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
+    bool allSelected = mListView->selectionModel()->selection().count() == mFileBrowserModel->rowCount();        //iContainer->ListBox()->SelectionIndexes()->Count() == iContainer->ListBox()->Model()->NumberOfItems();
+    bool noneSelected = mListView->selectionModel()->selection().count() != 0;       //iContainer->ListBox()->SelectionIndexes()->Count() == 0;
+
+    //mFileViewMenuActions.mEditSnapShotToE->setVisible(driveListActive); // TODO
+    mFileViewMenuActions.mEditCut->setVisible(!(driveListActive || currentDriveReadOnly || emptyListBox));
+    mFileViewMenuActions.mEditCopy->setVisible(!(driveListActive || emptyListBox));
+    mFileViewMenuActions.mEditPaste->setVisible(!(driveListActive || emptyClipBoard || currentDriveReadOnly));
+    mFileViewMenuActions.mEditCopyToFolder->setVisible(!(driveListActive || emptyListBox));
+    mFileViewMenuActions.mEditMoveToFolder->setVisible(!(driveListActive || currentDriveReadOnly || emptyListBox));
+    mFileViewMenuActions.mEditSelect->setVisible(!(driveListActive || currentSelected || emptyListBox));
+    mFileViewMenuActions.mEditUnselect->setVisible(!(driveListActive || !currentSelected || emptyListBox));
+    mFileViewMenuActions.mEditSelectAll->setVisible(!(driveListActive || allSelected || emptyListBox));
+    mFileViewMenuActions.mEditUnselectAll->setVisible(!(driveListActive || noneSelected || emptyListBox));
+
+    // TODO mFileViewMenuActions.mViewSort->setVisible(!(!normalModeActive || driveListActive || emptyListBox));
+    // TODO mFileViewMenuActions.mViewOrder->setVisible(!(!normalModeActive || driveListActive || emptyListBox));
+    mFileViewMenuActions.mViewRefresh->setVisible(normalModeActive);
+    mFileViewMenuActions.mViewFilterEntries->setVisible(!emptyListBox);
+
+    // TODO R_FILEBROWSER_VIEW_SORT_SUBMENU
+    // aMenuPane->SetItemButtonState(iModel->FileUtils()->SortMode(), EEikMenuItemSymbolOn);
+
+    // TODO R_FILEBROWSER_VIEW_ORDER_SUBMENU
+    // aMenuPane->SetItemButtonState(iModel->FileUtils()->OrderMode(), EEikMenuItemSymbolOn);
+
+    // aResourceId == R_FILEBROWSER_TOOLS_SUBMENU
+    bool noExtendedErrorsAllowed = mEngineWrapper->ErrRdFileExists();
+    mFileViewMenuActions.mToolsDisableExtendedErrors->setVisible(noExtendedErrorsAllowed);
+    mFileViewMenuActions.mToolsEnableExtendedErrors->setVisible(!noExtendedErrorsAllowed);
+
+//    bool infraRedAllowed = mEngineWrapper->FileExists(KIRAppPath);
+//    bool bluetoothAllowed = mEngineWrapper->FileExists(KBTAppPath);
+//    bool usbAllowed = mEngineWrapper->FileExists(KUSBAppPath);
+//
+//    bool noLocalCon = !infraRedAllowed && !bluetoothAllowed && !usbAllowed;
+//    mFileViewMenuActions.mToolsLocalConnectivityMenu->menuAction()->setVisible(!noLocalCon);
+//
+//    mFileViewMenuActions.mToolsLocalConnectivityActivateInfrared->setVisible(infraRedAllowed);
+//    mFileViewMenuActions.mToolsLocalConnectivityLaunchBTUI->setVisible(bluetoothAllowed);
+//    mFileViewMenuActions.mToolsLocalConnectivityLaunchUSBUI->setVisible(usbAllowed);
+}
+
+/**
+  Refresh FileBrowser view
+  */
+void FileBrowserView::refreshList()
+{
+    mEngineWrapper->refreshView();
+    mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
+    mListView->reset();
+    mListView->setModel(mFileBrowserModel);
+    mToolbarBackAction->setEnabled(!mEngineWrapper->isDriveListViewActive());
+}
+
+/**
+  Populate changed folder content, i.e. in practice navigation list items
+  */
+void FileBrowserView::populateFolderContent()
+{
+    // update the file browser by setting up the model with current directory as root path
+    if(mListView->model() == 0)  {
+        mFileBrowserModel = new FileBrowserModel(mEngineWrapper);
+        mListView->setModel(mFileBrowserModel);
+    }
+
+    refreshList();
+    //mFileSystemModel->setFilter(mFileSystemModel->filter() | QDir::System | QDir::Hidden);
+    //mFileSystemModel->setRootPath(directory);
+    //mListView->setRootIndex(mFileSystemModel->index(directory));
+}
+
+// ---------------------------------------------------------------------------	
+
+void FileBrowserView::fileOpen(HbAction *action)
+{  
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(!action && dlg && dlg->selectedModelIndexes().count()){
+        int selectionIndex = dlg->selectedModelIndexes().at(0).row();
+
+        if (selectionIndex == 0) {
+            // open editor view
+            emit aboutToShowEditorView(mAbsoluteFilePath, true);
+        } else if (selectionIndex == 1) {
+            // AppArc
+            mEngineWrapper->openAppArc(mAbsoluteFilePath);
+        } else {
+            // DocHandler
+            mEngineWrapper->openDocHandler(mAbsoluteFilePath, true);
+        }
+    }
+}
+
+/**
+  Open overwrite dialog
+  */
+void FileBrowserView::fileOverwriteDialog()
+{
+    mOverwriteOptions = OverwriteOptions();
+    // open user-dialog to select: view as text/hex,  open w/AppArc or open w/DocH. embed
+    QStringList list;
+    list << QString("Overwrite all")
+            << QString("Skip all existing")
+            << QString("Gen. unique filenames")
+            << QString("Query postfix");
+    openListDialog(list, QString("Overwrite?"), this, SLOT(fileOverwrite(HbAction *)));
+}
+
+/**
+  File overwrite
+  */
+void FileBrowserView::fileOverwrite(HbAction *action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(!action && dlg && dlg->selectedModelIndexes().count()) {
+        mOverwriteOptions.queryIndex = dlg->selectedModelIndexes().at(0).row();
+        if (mOverwriteOptions.queryIndex == EFileActionQueryPostFix) {
+            QString heading = QString("Postfix");
+            HbInputDialog::getText(heading, this, SLOT(fileOverwritePostfix(HbAction *)), QString(), scene());
+        } else if (mOverwriteOptions.queryIndex == EFileActionSkipAllExisting) {
+            mOverwriteOptions.overWriteFlags = 0;
+        }
+    } else {
+        mOverwriteOptions.doFileOperations = false;
+    }
+}
+
+/**
+  File overwrite postfix query dialog
+  */
+void FileBrowserView::fileOverwritePostfix(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        mOverwriteOptions.postFix = dlg->value().toString();
+    } else {
+        mOverwriteOptions.doFileOperations = false;
+    }
+}
+
+// ---------------------------------------------------------------------------
+/**
+  Show a list dialog
+  \param List aList of item to select item from.
+  \param Title text aTitleText of a dialog heading widget
+  \return None
+  */
+void FileBrowserView::openListDialog(const QStringList& items, const QString &aTitleText, QObject* receiver, const char* member)
+{
+    // Create a list and some simple content for it
+    HbSelectionDialog *dlg = new HbSelectionDialog();
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    // Set items to be popup's content
+    dlg->setStringItems(items);
+    dlg->setSelectionMode(HbAbstractItemView::SingleSelection);
+    //dlg->setDismissPolicy(HbPopup::TapOutside);
+    
+    HbLabel *title = new HbLabel(dlg);
+    title->setPlainText(aTitleText);
+    dlg->setHeadingWidget(title);
+
+    // Launch popup and handle the user response:
+    dlg->open(receiver, member);
+}
+
+// ---------------------------------------------------------------------------
+
+HbDialog *FileBrowserView::filePathQuery(const QString &headingText,
+                                         const QString &text,
+                                         const QString &primaryActionText,
+                                         const QString &secondaryActionText)
+{
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbPopup::TapOutside);
+    dialog->setTimeout(HbPopup::NoTimeout);
+    HbLineEdit *edit = new HbLineEdit();
+    HbAction *primaryAction = new HbAction(primaryActionText);
+    HbAction *secondaryAction = new HbAction(secondaryActionText);
+    // connect signal to close pop-up if cancel selected:
+    connect(secondaryAction, SIGNAL(triggered()), dialog, SLOT(close()));
+    edit->setText(text);
+    dialog->setHeadingWidget(new HbLabel(headingText));
+    //popup->setHeadingWidget(dlgTitle);
+    dialog->setContentWidget(edit);
+    dialog->setPrimaryAction(primaryAction);
+    dialog->setSecondaryAction(secondaryAction);
+
+    return dialog;
+}
+
+// ---------------------------------------------------------------------------
+
+//HbDialog *FileBrowserView::openTextQuery(const QString &headingText,
+//                                         const QString &text,
+//                                         const QString &primaryActionText,
+//                                         const QString &secondaryActionText)
+//{
+//    HbDialog *dialog = new HbDialog();
+//    dialog->setDismissPolicy(HbPopup::TapOutside);
+//    dialog->setTimeout(HbPopup::NoTimeout);
+//    HbLineEdit *edit = new HbLineEdit();
+//    HbAction *primaryAction = new HbAction(primaryActionText);
+//    HbAction *secondaryAction = new HbAction(secondaryActionText);
+//    // connect signal to close pop-up if cancel selected:
+//    connect(secondaryAction, SIGNAL(triggered()), dialog, SLOT(close()));
+//    edit->setText(text);
+//    dialog->setHeadingWidget(new HbLabel(headingText));
+//    //popup->setHeadingWidget(dlgTitle);
+//    dialog->setContentWidget(edit);
+//    dialog->setPrimaryAction(primaryAction);
+//    dialog->setSecondaryAction(secondaryAction);
+//
+//    return dialog;
+//}
+
+// ---------------------------------------------------------------------------
+
+HbDialog *FileBrowserView::openNumberQuery(const QString &headingText,
+                                           const QString &text,
+                                           const QString &primaryActionText,
+                                           const QString &secondaryActionText,
+                                           int aMin/* = -99999*/,
+                                           int aMax/* = 99999*/)
+{
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbPopup::TapOutside);
+    dialog->setTimeout(HbPopup::NoTimeout);
+    HbAction *primaryAction = new HbAction(primaryActionText);
+    HbAction *secondaryAction = new HbAction(secondaryActionText);
+    // connect signal to close pop-up if cancel selected:
+    connect(secondaryAction, SIGNAL(triggered()), dialog, SLOT(close()));
+
+    HbLineEdit *edit = new HbLineEdit();
+    HbValidator *validator = new HbValidator();
+    validator->addField(new QIntValidator(aMin, aMax, 0), text);
+    edit->setValidator(validator);
+    edit->setInputMethodHints(Qt::ImhDigitsOnly);
+
+    //edit->setText(text);
+    dialog->setHeadingWidget(new HbLabel(headingText));
+    //popup->setHeadingWidget(dlgTitle);
+    dialog->setContentWidget(edit);
+    dialog->setPrimaryAction(primaryAction);
+    dialog->setSecondaryAction(secondaryAction);
+
+    return dialog;
+}
+
+// ---------------------------------------------------------------------------
+
+void FileBrowserView::openPropertyDialog(const QStringList& propertyList, const QString& title)
+{
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbPopup::TapOutside);
+    dialog->setTimeout(HbPopup::NoTimeout);
+
+    HbLabel *titleWidget = new HbLabel();
+    titleWidget->setPlainText(title);
+    dialog->setHeadingWidget(titleWidget);
+
+    // Create a list and some simple content for it
+    HbListWidget *list = new HbListWidget();
+    QString str;
+    foreach (str, propertyList) {
+        list->addItem(str);
+    }
+
+    // Connect list item activation signal to close the popup
+    connect(list, SIGNAL(activated(HbListWidgetItem*)), dialog, SLOT(close()));
+
+    HbAction *cancelAction = new HbAction("Close");
+    dialog->setPrimaryAction(cancelAction);
+
+    // Set listwidget to be popup's content
+    dialog->setContentWidget(list);
+    // Launch popup and handle the user response:
+    dialog->open();
+}
+
+QModelIndexList FileBrowserView::getSelectedItemsOrCurrentItem()
+{
+    QModelIndexList modelIndexList;
+    QItemSelectionModel *selectionIndexes = mListView->selectionModel();
+
+    // by default use selected items
+    if (selectionIndexes) {
+        if (selectionIndexes->hasSelection()) {
+            modelIndexList = mListView->selectionModel()->selectedIndexes();
+        } else { // or if none selected, use the current item index
+            QModelIndex currentIndex = currentItemIndex();
+//            if (mFileBrowserModel->rowCount(currentItemIndex) > currentItemIndex && currentItemIndex >= 0)
+//            {
+                modelIndexList.append(currentIndex);
+//            }
+        }
+    }
+    mClipBoardInUse = true;
+    return modelIndexList;
+}
+
+// ---------------------------------------------------------------------------
+
+QModelIndex FileBrowserView::currentItemIndex()
+{
+    return mListView->selectionModel()->currentIndex();
+}
+
+// ---------------------------------------------------------------------------
+// operations in File Menu
+// ---------------------------------------------------------------------------
+
+/**
+  Move back/up in folder browsing history
+  */
+void FileBrowserView::fileBackMoveUp()
+{
+    mLocationChanged = true;
+//    if(mDirectory.length() < DRIVEPATHLENGTH) {
+//        // location in the root of any drive -> move back/up to root of device
+//        QModelIndex index = currentItemIndex();
+//        const QString filePath = mFileSystemModel->filePath(index);
+//        qDebug() << "handleBackButton filePath" << filePath;
+//        mDirectory = mInitDirPath.path();
+//        populateFolderContent(mDirectory);
+//    }
+//    else if(mDirectory != mInitDirPath.path()) {
+//        // location in any folder in any drive -> move back/up
+//        QDir dir(mDirectory);
+//        dir.cdUp();
+//        const QString currentPath = dir.absolutePath();
+//        mDirectory = currentPath;
+//        populateFolderContent(currentPath);
+//        mSelectedFilePath = "";
+//    } else {
+//        // location already in the device root, no way up.
+//        // do nothing.
+//    }
+    mEngineWrapper->moveUpOneLevel();
+    populateFolderContent();
+}
+
+void FileBrowserView::fileOpenDrive()
+{
+    // TODO make a separate function to be called from here and fileOpenDirectory()
+    mLocationChanged = true;
+    // get selected drive or directory from list view model and open it:
+    //if (mListView->selectionModel()->hasSelection()) {
+    if (mListView->selectionModel()->selection().count() != 0) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->moveDownToDirectory(currentIndex);
+        populateFolderContent();
+    } else {
+        Notifications::showErrorNote("not selected item!");
+    }
+}
+
+void FileBrowserView::fileOpenDirectory()
+{
+    mLocationChanged = true;
+    // get selected drive or directory from list view model and open it:
+    //if (mListView->selectionModel()->hasSelection()) {
+    if (mListView->selectionModel()->selection().count() != 0) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->moveDownToDirectory(currentIndex);
+        populateFolderContent();
+    } else {
+        Notifications::showErrorNote("not selected item!");
+    }
+}
+
+void FileBrowserView::fileSearch()
+{
+    // create and launch search:
+//    if(mSearch != 0){
+//        delete mSearch;
+//        mSearch = 0;
+//    }
+//    mSearch = new SearchView(*this, mMainWindow, *mEngineWrapper);
+//    QString searchPath;
+//    if (mDirectory != mInitDirPath.path()) {
+//        searchPath = mDirectory;
+//        searchPath.replace("/", "\\");
+//        searchPath+="\\";
+//    }
+//    mSearch->open(searchPath);
+}
+
+/**
+  Open new file dialog
+  */
+void FileBrowserView::fileNewFile()
+{
+    QString heading = QString("Enter filename");
+    HbInputDialog::getText(heading, this, SLOT(doFileNewFile(HbAction*)), QString(), scene());
+}
+
+/**
+  Create a new file in current directory with a name queried from user
+  */
+void FileBrowserView::doFileNewFile(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString newFileName = dlg->value().toString();
+        mEngineWrapper->createNewFile(newFileName);
+        refreshList();
+    }
+}
+
+/**
+  Open new directory dialog
+  */
+void FileBrowserView::fileNewDirectory()
+{
+    QString heading = QString("Enter directory name");
+    HbInputDialog::getText(heading, this, SLOT(doFileNewDirectory(HbAction*)), QString(), scene());
+}
+
+/**
+  Create a new directory in current directory with a name queried from user
+  */
+void FileBrowserView::doFileNewDirectory(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString newDirectoryName = dlg->value().toString();
+        mEngineWrapper->createNewDirectory(newDirectoryName);
+        refreshList();
+    }
+}
+
+/**
+  Question for Delete actually selected files
+  */
+void FileBrowserView::fileDelete()
+{
+    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+    const QString messageFormat = "Delete %1 entries?";
+    QString message = messageFormat.arg(currentSelection.count());
+    HbMessageBox::question(message, this, SLOT(doFileDelete(HbAction*)));
+}
+
+/**
+  Delete actually selected files
+  */
+void FileBrowserView::doFileDelete(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+        mEngineWrapper->deleteItems(currentSelection);
+        refreshList();
+    }
+}
+
+/**
+  Open rename dialog for actually selected files
+  */
+void FileBrowserView::fileRename()
+{
+    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+    mEngineWrapper->setCurrentSelection(currentSelection);
+
+    for (int i(0), ie(currentSelection.count()); i < ie; ++i ) {
+        mModelIndex = currentSelection.at(i);
+        FileEntry entry = mEngineWrapper->getFileEntry(mModelIndex);
+
+        QString heading = QString("Enter new name");
+        HbInputDialog::getText(heading, this, SLOT(doFileRename(HbAction*)), entry.name(), scene());
+
+    }
+    mEngineWrapper->startExecutingCommands(QString("Renaming"));
+    refreshList();
+}
+
+/**
+  Rename actually selected files
+  */
+void FileBrowserView::doFileRename(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString newName = dlg->value().toString();
+
+        if (mEngineWrapper->targetExists(mModelIndex, newName)) {
+
+            const QString messageTemplate = QString("%1 already exists, overwrite?");
+            QString message = messageTemplate.arg(newName);
+            HbMessageBox::question(message, this, SLOT(doFileRenameFileExist(HbAction *)));
+        }
+        if (mIsRenameAllowed) {
+            mEngineWrapper->rename(mModelIndex, newName);
+        }
+    }
+}
+
+/**
+  Rename actually selected files
+  */
+void FileBrowserView::doFileRenameFileExist(HbAction *action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->secondaryAction()) {
+        mIsRenameAllowed = false;
+    }
+}
+
+/**
+  Touch actually selected files
+  */
+void FileBrowserView::fileTouch()
+{
+    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+    mEngineWrapper->setCurrentSelection(currentSelection);
+
+    if (mEngineWrapper->selectionHasDirs()) {
+        const QString message = "Recurse touch for all selected dirs?";
+        HbMessageBox::question(message, this, SLOT(doFileTouch(HbAction*)));
+    }
+    else{
+        mEngineWrapper->touch(false);
+        refreshList();
+    }
+}
+
+/**
+  Touch actually selected files
+  */
+void FileBrowserView::doFileTouch(HbAction* action)
+{
+    bool recurse = false;
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        recurse = true;
+        }
+    mEngineWrapper->touch(recurse);
+    refreshList();
+}
+
+void FileBrowserView::fileChecksumsMD5()
+{
+    fileChecksums(EFileChecksumsMD5);
+}
+
+void FileBrowserView::fileChecksumsMD2()
+{
+    fileChecksums(EFileChecksumsMD2);
+}
+
+void FileBrowserView::fileChecksumsSHA1()
+{
+    fileChecksums(EFileChecksumsSHA1);
+}
+
+void FileBrowserView::fileChecksums(TFileBrowserCmdFileChecksums checksumType)
+{
+    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->showFileCheckSums(currentIndex, checksumType);
+}
+
+/**
+  Show file properties
+  */
+void FileBrowserView::fileProperties()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    QStringList propertyList;
+    QString titleText;
+    mEngineWrapper->properties(currentIndex, propertyList, titleText);
+    openPropertyDialog(propertyList, titleText);
+}
+
+void FileBrowserView::fileSetAttributes()
+{
+
+}
+
+// edit menu
+void FileBrowserView::editSnapShotToE()
+{
+
+}
+
+/**
+  Set selected files into clipboard.
+  Selected item will be removed after paste operation.
+  */
+void FileBrowserView::editCut()
+{
+    mClipboardIndices = getSelectedItemsOrCurrentItem();
+
+    mEngineWrapper->clipboardCut(mClipboardIndices);
+
+    int operations = mClipboardIndices.count();
+    const QString message = QString ("%1 entries cut to clipboard");
+    QString noteMsg = message.arg(operations);
+
+    Notifications::showInformationNote(noteMsg);
+}
+
+/**
+  Set selected files into clipboard.
+  Selected item will not be removed after paste operation.
+  */
+void FileBrowserView::editCopy()
+{
+    mClipboardIndices = getSelectedItemsOrCurrentItem();
+
+    mEngineWrapper->clipboardCopy(mClipboardIndices);
+
+    int operations = mClipboardIndices.count();
+
+    const QString message = QString ("%1 entries copied to clipboard");
+    QString noteMsg = message.arg(operations);
+
+    Notifications::showInformationNote(noteMsg);
+}
+
+/**
+  Moves or copies file selection stored in clipboard to a actual directory.
+  Removing files depend on previous operation, i.e. Cut or Copy
+  */
+void FileBrowserView::editPaste()
+{
+    bool someEntryExists(false);
+
+    // TODO Set entry items here
+
+    someEntryExists = mEngineWrapper->isDestinationEntriesExists(mClipboardIndices, mEngineWrapper->currentPath());
+    if (someEntryExists) {
+        fileOverwriteDialog();
+    }
+    mEngineWrapper->clipboardPaste(mOverwriteOptions);
+}
+
+/**
+  Open copy to folder new filename dialog
+  */
+void FileBrowserView::editCopyToFolder()
+{
+    QString heading = QString("Enter new name");
+    HbInputDialog::getText(heading, this, SLOT(doEditCopyToFolder(HbAction*)), mEngineWrapper->currentPath(), scene());
+}
+
+/**
+  Copies current file selection to a queried directory.
+  */
+void FileBrowserView::doEditCopyToFolder(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString targetDir = dlg->value().toString();
+        bool someEntryExists(false);
+
+        // TODO Set entry items here
+        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+        mEngineWrapper->setCurrentSelection(currentSelection);
+
+        someEntryExists = mEngineWrapper->isDestinationEntriesExists(currentSelection, targetDir);
+        if (someEntryExists) {
+            fileOverwriteDialog();
+        }
+        mEngineWrapper->copyToFolder(targetDir, mOverwriteOptions, false);
+        refreshList();
+    }
+}
+
+/**
+  Open move to folder new filename dialog.
+  */
+void FileBrowserView::editMoveToFolder()
+{
+    QString heading = QString("Enter new name");
+    HbInputDialog::getText(heading, this, SLOT(doEditCopyToFolder(HbAction*)), mEngineWrapper->currentPath(), scene());
+}
+
+/**
+  Moves current file selection to a queried directory.
+  */
+void FileBrowserView::doEditMoveToFolder(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString targetDir = dlg->value().toString();
+        bool someEntryExists(false);
+
+        // TODO Set entry items here
+        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+        mEngineWrapper->setCurrentSelection(currentSelection);
+
+        someEntryExists = mEngineWrapper->isDestinationEntriesExists(currentSelection, targetDir);
+        if (someEntryExists) {
+            fileOverwriteDialog();
+        }
+        mEngineWrapper->copyToFolder(targetDir, mOverwriteOptions, true);
+        refreshList();
+    }
+}
+
+/**
+  Select current file
+  */
+void FileBrowserView::editSelect()
+{
+    QItemSelectionModel *selectionModel = mListView->selectionModel();
+    if (selectionModel) {
+        selectionModel->select(selectionModel->currentIndex(), QItemSelectionModel::SelectCurrent);
+        selectionModel->select(selectionModel->currentIndex(), QItemSelectionModel::Select);
+        itemHighlighted(selectionModel->currentIndex());
+        refreshList();
+    }
+}
+
+/**
+  Unselect current file
+  */
+void FileBrowserView::editUnselect()
+{
+    QItemSelectionModel *selectionModel = mListView->selectionModel();
+    if (selectionModel) {
+        selectionModel->select(selectionModel->currentIndex(), QItemSelectionModel::Deselect);
+        itemHighlighted(selectionModel->currentIndex());
+    }
+}
+
+/**
+  Select all files
+  */
+void FileBrowserView::editSelectAll()
+{
+    QItemSelectionModel *selectionModel = mListView->selectionModel();
+    if (selectionModel) {
+
+        if (mFileBrowserModel->rowCount() > 0) {
+            QModelIndex firstIndex = mFileBrowserModel->index(0, 0);
+            QModelIndex lastIndex = mFileBrowserModel->index( (mFileBrowserModel->rowCount() - 1), 0);
+
+            QItemSelection itemSelection(firstIndex, lastIndex);
+            //selectionModel->select(itemSelection, QItemSelectionModel::SelectCurrent);
+            selectionModel->select(itemSelection, QItemSelectionModel::Select);
+        }
+    }
+}
+
+/**
+  Unselect all files
+  */
+void FileBrowserView::editUnselectAll()
+{
+    QItemSelectionModel *selectionModel = mListView->selectionModel();
+    if (selectionModel) {
+        selectionModel->clearSelection();
+    }
+}
+
+// ---------------------------------------------------------------------------
+// view menu
+// ---------------------------------------------------------------------------
+void FileBrowserView::viewFilterEntries()
+{
+
+}
+void FileBrowserView::viewRefresh()
+{
+    refreshList();
+}
+
+// ---------------------------------------------------------------------------
+// disk admin menu
+// ---------------------------------------------------------------------------
+
+/**
+  Open old password for the selected drive dialog.
+  */
+void FileBrowserView::diskAdminSetDrivePassword()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    // check if the drive has a password
+    if (mEngineWrapper->hasDrivePassword(currentIndex)) {
+        QString heading = QString("Existing password");
+        HbInputDialog::getText(heading, this, SLOT(diskAdminSetDrivePasswordNew(HbAction*)), QString(), scene());
+    }
+}
+
+/**
+   Open new password for the selected drive dialog.
+  */
+void FileBrowserView::diskAdminSetDrivePasswordNew(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        mOldPassword = dlg->value().toString();
+    }
+
+    QString heading = QString("New password");
+    HbInputDialog::getText(heading, this, SLOT(doDiskAdminSetDrivePassword(HbAction*)), mOldPassword, scene());
+}
+
+/**
+   Set password for the selected drive.
+  */
+void FileBrowserView::doDiskAdminSetDrivePassword(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        QString newPassword = dlg->value().toString();
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminSetDrivePassword(currentIndex, mOldPassword, newPassword);
+        refreshList();
+    }
+}
+
+/**
+  Open Unlock the selected drive dialog.
+  */
+void FileBrowserView::diskAdminUnlockDrive()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    // check if the drive is locked
+    if (mEngineWrapper->isDriveLocked(currentIndex)) {
+        QString heading = QString("Existing password");
+        HbInputDialog::getText(heading, this, SLOT(doDiskAdminUnlockDrive(HbAction*)), QString(), scene());
+    } else {
+        Notifications::showInformationNote(QString("This drive is not locked"));
+    }
+}
+
+/**
+  Unlock the selected drive.
+  */
+void FileBrowserView::doDiskAdminUnlockDrive(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString oldPassword = dlg->value().toString();
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminUnlockDrive(currentIndex, oldPassword);
+        refreshList();
+    }
+}
+
+/**
+  Open clear password of the selected drive dialog.
+  */
+void FileBrowserView::diskAdminClearDrivePassword()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    // check if the drive has a password
+    if (mEngineWrapper->hasDrivePassword(currentIndex)) {
+        QString heading = QString("Existing password");
+        HbInputDialog::getText(heading, this, SLOT(doDiskAdminClearDrivePassword(HbAction*)), QString(), scene());
+    } else {
+        Notifications::showInformationNote(QString("This drive has no password"));
+    }
+}
+
+/**
+  Clear password of the selected drive.
+  */
+void FileBrowserView::doDiskAdminClearDrivePassword(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction())
+    {
+        QString oldPassword = dlg->value().toString();
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminClearDrivePassword(currentIndex, oldPassword);
+        refreshList();
+    }
+}
+
+
+/**
+  Question for erase password of the selected drive
+  */
+void FileBrowserView::diskAdminEraseDrivePassword()
+{
+    // check if the drive has a password
+    QModelIndex currentIndex = currentItemIndex();
+    if (mEngineWrapper->hasDrivePassword(currentIndex)) {
+        HbMessageBox::question(QString("Are you sure? All data can be lost!"), this, SLOT(doDiskAdminEraseDrivePassword(HbAction*)));
+    } else {
+        Notifications::showInformationNote(QString("This drive has no password"));
+    }
+}
+
+/**
+  Erase password of the selected drive
+  */
+void FileBrowserView::doDiskAdminEraseDrivePassword(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminEraseDrivePassword(currentIndex);
+        refreshList();
+    }
+}
+
+/**
+  Performs format on the selected drive
+  */
+void FileBrowserView::diskAdminFormatDrive()
+{
+    HbMessageBox::question(QString("Are you sure? All data will be lost!"), this, SLOT(doDiskAdminFormatDrive(HbAction*)));
+}
+
+/**
+  Performs format on the selected drive
+  */
+void FileBrowserView::doDiskAdminFormatDrive(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminFormatDrive(currentIndex, false);
+    }
+}
+
+/**
+  Performs quick format on the selected drive
+  */
+void FileBrowserView::diskAdminQuickFormatDrive()
+{
+    HbMessageBox::question(QString("Are you sure? All data will be lost!"), this, SLOT(doDiskAdminQuickFormatDrive(HbAction*)));
+}
+
+/**
+  Performs quick format on the selected drive
+  */
+void FileBrowserView::doDiskAdminQuickFormatDrive(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminFormatDrive(currentIndex, true);
+    }
+}
+
+/**
+    Checks the disk integrity on the selected drive
+  */
+void FileBrowserView::diskAdminCheckDisk()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->DiskAdminCheckDisk(currentIndex);
+}
+
+/**
+  Checks the selected drive for errors and corrects them
+  */
+void FileBrowserView::diskAdminScanDrive()
+{
+    HbMessageBox::question(QString("This finds errors on disk and corrects them. Proceed?"), this, SLOT(doDiskAdminScanDrive(HbAction*)));
+}
+
+/**
+  Checks the selected drive for errors and corrects them
+  */
+void FileBrowserView::doDiskAdminScanDrive(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminScanDrive(currentIndex);
+        refreshList();
+    }
+}
+
+/**
+  Open drive name dialog
+  */
+void FileBrowserView::diskAdminSetDriveName()
+{
+    QString driveName;
+
+    // get existing drive name
+    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->GetDriveName(currentIndex, driveName);
+
+    QString heading = QString("New name");
+    HbInputDialog::getText(heading, this, SLOT(doDiskAdminSetDriveName(HbAction*)), driveName, scene());
+}
+
+/**
+  Set drive name.
+  */
+void FileBrowserView::doDiskAdminSetDriveName(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        QString driveName = dlg->value().toString();
+
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminSetDriveName(currentIndex, driveName);
+
+        refreshList();
+    }
+}
+
+/**
+  Open drive volume label dialog
+  */
+void FileBrowserView::diskAdminSetDriveVolumeLabel()
+{
+    QString volumeLabel;
+
+    // get existing drive name
+    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->GetDriveVolumeLabel(currentIndex, volumeLabel);
+
+    QString heading = QString("New volume label");
+    HbInputDialog::getText(heading, this, SLOT(doDiskAdminSetDriveVolumeLabel(HbAction*)), volumeLabel, scene());
+}
+
+/**
+  Set drive volume label.
+  */
+void FileBrowserView::doDiskAdminSetDriveVolumeLabel(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        QString volumeLabel = dlg->value().toString();
+
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminSetDriveVolumeLabel(currentIndex, volumeLabel);
+
+        refreshList();
+    }
+}
+
+/**
+  Eject the selected drive
+  */
+void FileBrowserView::diskAdminEjectDrive()
+{
+    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->DiskAdminEjectDrive(currentIndex);
+    refreshList();
+}
+
+/**
+  Dismount the selected drive
+  */
+void FileBrowserView::diskAdminDismountDrive()
+{
+    HbMessageBox::question(QString("Are you sure you know what are you doing?"), this, SLOT(doDiskAdminDismountDrive(HbAction*)));
+}
+
+void FileBrowserView::doDiskAdminDismountDrive(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminDismountDrive(currentIndex);
+        refreshList();
+    }
+}
+
+/**
+  Erase Master Boot Record of the selected drive
+  */
+void FileBrowserView::diskAdminEraseMBR()
+{
+    // TODO What to do with FB LITE macros?
+    HbMessageBox::question(QString("Are you sure? Your media driver must support this!"), this, SLOT(doDiskAdminEraseMBR(HbAction*)));
+}
+
+void FileBrowserView::doDiskAdminEraseMBR(HbAction* action)
+{
+    // TODO What to do with FB LITE macros?
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()){
+        HbMessageBox::question(QString("Are you really sure you know what are you doing ?!?"), this, SLOT(doDiskAdminReallyEraseMBR(HbAction*)));
+    }
+}
+
+void FileBrowserView::doDiskAdminReallyEraseMBR(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        // warn if the selected drive is not detected as removable
+        if (mEngineWrapper->isDriveRemovable(currentIndex)) {
+            mEngineWrapper->DiskAdminEraseMBR(currentIndex);
+            refreshList();
+        } else {
+            HbMessageBox::question(QString("Selected drive is not removable, really continue?"), this, SLOT(doDiskAdminNotRemovableReallyEraseMBR(HbAction*)));
+        }
+    }
+}
+
+void FileBrowserView::doDiskAdminNotRemovableReallyEraseMBR(HbAction* action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->DiskAdminEraseMBR(currentIndex);
+        refreshList();
+    }
+
+}
+
+/**
+  Partition the selected drive
+  */
+void FileBrowserView::diskAdminPartitionDrive()
+{
+    const QString message("Are you sure? Your media driver must support this!");
+    HbMessageBox::question(message, this, SLOT(diskAdminPartitionDriveProceed(HbAction *)));
+}
+
+/**
+  Partition the selected drive if user is sure
+  */
+void FileBrowserView::diskAdminPartitionDriveProceed(HbAction *action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        const QString message("Are you really sure you know what are you doing ?!?");
+        HbMessageBox::question(message, this, SLOT(diskAdminPartitionDriveReallyProceed(HbAction *)));
+    }
+}
+
+/**
+  Partition the selected drive if user is really sure
+  */
+void FileBrowserView::diskAdminPartitionDriveReallyProceed(HbAction *action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        QModelIndex currentIndex = currentItemIndex();
+        mEraseMBR = false;
+        // warn if the selected drive is not detected as removable
+        if (mEngineWrapper->isDriveRemovable(currentIndex)) {
+            mProceed = true;
+        } else {
+            const QString message("Selected drive is not removable, really continue?");
+            HbMessageBox::question(message, this, SLOT(diskAdminPartitionDriveIsNotRemovable(HbAction *)));
+        }
+
+        if (mProceed) {
+            // query if erase mbr
+            mEraseMBR = false;
+
+            QString message("Erase MBR first (normally needed)?");
+            HbMessageBox::question(message, this, SLOT(diskAdminPartitionDriveEraseMbr(HbAction *)));
+
+            // TODO use HbListDialog
+            QStringList list;
+            list << "1" << "2" << "3" << "4";
+            openListDialog(list, QString("Partitions?"), this, SLOT(diskAdminPartitionDriveGetCount(HbAction*)));
+        }
+    }
+}
+
+/**
+  Store result of user query about proceeding when drive is not removable.
+  */
+void FileBrowserView::diskAdminPartitionDriveIsNotRemovable(HbAction *action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        mProceed = true;
+    } else {
+        mProceed = false;
+    }
+}
+
+/**
+  Store result of user query about erase MBR
+  */
+void FileBrowserView::diskAdminPartitionDriveEraseMbr(HbAction *action)
+{
+    HbMessageBox *dlg = qobject_cast<HbMessageBox*>(sender());
+    if (action == dlg->primaryAction()) {
+        mEraseMBR = true;
+    }
+}
+
+/**
+  Partition the selected drive
+  */
+void FileBrowserView::diskAdminPartitionDriveGetCount(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(!action && dlg && dlg->selectedItems().count()){
+        int selectionIndex = dlg->selectedItems().at(0).toInt();
+        QModelIndex currentIndex = currentItemIndex();
+        int amountOfPartitions = selectionIndex + 1;
+        mEngineWrapper->DiskAdminPartitionDrive(currentIndex, mEraseMBR, amountOfPartitions);
+        refreshList();
+    }
+}
+
+// ---------------------------------------------------------------------------
+// tools menu
+// ---------------------------------------------------------------------------
+void FileBrowserView::toolsAllAppsToTextFile()
+{
+
+}
+void FileBrowserView::toolsAllFilesToTextFile()
+{
+
+}
+void FileBrowserView::toolsAvkonIconCacheEnable()
+{
+
+}
+void FileBrowserView::toolsAvkonIconCacheDisable()
+{
+
+}
+
+/**
+  Disable extended errors
+  */
+void FileBrowserView::toolsDisableExtendedErrors()
+{
+    mEngineWrapper->ToolsSetErrRd(false);
+}
+
+void FileBrowserView::toolsDumpMsgStoreWalk()
+{
+
+}
+void FileBrowserView::toolsEditDataTypes()
+{
+
+}
+
+/**
+  Enable extended errors
+  */
+void FileBrowserView::toolsEnableExtendedErrors()
+{
+    mEngineWrapper->ToolsSetErrRd(true);
+}
+
+/**
+  Open simulate leave dialog
+  */
+void FileBrowserView::toolsErrorSimulateLeave()
+{
+    int leaveCode = -6;
+    QString heading = QString("Leave code");
+    //HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulateLeave(HbAction*)), leaveCode, scene());
+    HbInputDialog::getText(heading, this, SLOT(doToolsErrorSimulateLeave(HbAction*)), QString::number(leaveCode), scene());
+}
+
+
+/**
+  Simulate leave.
+  */
+void FileBrowserView::doToolsErrorSimulateLeave(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        bool ok;
+        int leaveCode = dlg->value().toString().toInt(&ok);
+        if (leaveCode != 0 || ok) {
+            mEngineWrapper->ToolsErrorSimulateLeave(leaveCode);
+        }
+    }
+}
+
+/**
+  Open simulate panic dialog.
+  */
+void FileBrowserView::toolsErrorSimulatePanic()
+{
+    mPanicCategory = QString ("Test Category");
+    QString heading = QString("Panic category");
+    HbInputDialog::getText(heading, this, SLOT(doToolsErrorSimulatePanicCode(HbAction*)), mPanicCategory, scene());
+}
+
+/**
+  Simulate panic.
+  */
+void FileBrowserView::doToolsErrorSimulatePanicCode(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        mPanicCategory = dlg->value().toString();
+        int panicCode(555);
+        QString heading = QString("Panic code");
+        HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulatePanic(HbAction*)), panicCode, scene());
+    }
+}
+
+/**
+  Simulate panic.
+  */
+void FileBrowserView::doToolsErrorSimulatePanic(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        bool ok;
+        int panicCode = dlg->value().toInt(&ok);
+        if (panicCode != 0 || ok) {
+            mEngineWrapper->ToolsErrorSimulatePanic(mPanicCategory, panicCode);
+        }
+    }
+}
+
+/**
+  Open simulate exception dialog.
+  */
+void FileBrowserView::toolsErrorSimulateException()
+{
+    int exceptionCode = 0;
+    QString heading = QString("Exception code");
+    HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulateException(HbAction*)), exceptionCode, scene());
+}
+
+/**
+  Simulate exception.
+  */
+void FileBrowserView::doToolsErrorSimulateException(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if (action == dlg->primaryAction()) {
+        bool ok;
+        int exceptionCode = dlg->value().toInt(&ok);
+        if (exceptionCode != 0 || ok) {
+            mEngineWrapper->ToolsErrorSimulateException(exceptionCode);
+        }
+    }
+}
+
+//    void FileBrowserView::toolsLocalConnectivityActivateInfrared()
+//{
+//
+//}
+//    void FileBrowserView::toolsLocalConnectivityLaunchBTUI()
+//{
+//
+//}
+//    void FileBrowserView::toolsLocalConnectivityLaunchUSBUI()
+//{
+//
+//}
+void FileBrowserView::toolsMessageInbox()
+{
+
+}
+void FileBrowserView::toolsMessageDrafts()
+{
+
+}
+void FileBrowserView::toolsMessageSentItems()
+{
+
+}
+void FileBrowserView::toolsMessageOutbox()
+{
+
+}
+void FileBrowserView::toolsMemoryInfo()
+{
+
+}
+void FileBrowserView::toolsSecureBackStart()
+{
+
+}
+void FileBrowserView::toolsSecureBackRestore()
+{
+
+}
+void FileBrowserView::toolsSecureBackStop()
+{
+
+}
+
+/**
+  Open debug mask dialog
+  */
+void FileBrowserView::toolsSetDebugMaskQuestion()
+{
+    quint32 dbgMask = mEngineWrapper->getDebugMask();
+    QString dbgMaskText = QString("0x").append(QString::number(dbgMask, 16));
+    QString heading = QString("Kernel debug mask in hex format");
+    HbInputDialog::getText(heading, this, SLOT(toolsSetDebugMask(HbAction*)), dbgMaskText, scene());
+}
+
+/**
+  Set debug mask
+  */
+void FileBrowserView::toolsSetDebugMask(HbAction *action)
+{
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if(action == dlg->primaryAction())
+    {
+        QString dbgMaskText = dlg->value().toString();
+        if (dbgMaskText.length() > 2 && dbgMaskText[0]=='0' && dbgMaskText[1]=='x') {
+            bool ok;
+            quint32 dbgMask = dbgMaskText.toUInt(&ok, 16);
+            if (dbgMask != 0 || ok) {
+                mEngineWrapper->toolsSetDebugMask(dbgMask);
+                Notifications::showConfirmationNote(QString("Changed"));
+            } else {
+                Notifications::showErrorNote(QString("Cannot convert value"));
+            }
+        } else {
+            Notifications::showErrorNote(QString("Not in hex format"));
+        }
+    }
+}
+
+void FileBrowserView::toolsShowOpenFilesHere()
+{
+
+}
+
+// ---------------------------------------------------------------------------
+// main menu items
+// ---------------------------------------------------------------------------
+void FileBrowserView::selectionModeChanged()
+{
+    if (mFileViewMenuActions.mSelection->isChecked()) {
+         activateSelectionMode();
+     } else {
+         deActivateSelectionMode();
+     }
+}
+
+/**
+  Show about note
+  */
+void FileBrowserView::about()
+{
+    Notifications::showAboutNote();
+}
+
+// ---------------------------------------------------------------------------
+// End of operations
+// ---------------------------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+
+/**
+  Item is selected from list when selection mode is activated from menu
+  */
+void FileBrowserView::selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
+{
+    QItemSelectionModel *selectionModel = mListView->selectionModel();
+    itemHighlighted(selectionModel->currentIndex());
+}
+
+/**
+  An item is highlighted = single-clicked from file/folder list.
+  */
+void FileBrowserView::itemHighlighted(const QModelIndex& index)
+{
+    Q_UNUSED(index)
+//    mItemHighlighted = true;
+//    mFileInfo = mFileSystemModel->fileInfo(index);
+}
+
+
+/**
+  An item is clicked from navigation item list. Navigation item list contains
+  drive-, folder- or file items. Opens selected drive, folder or file popup menu
+  */
+void FileBrowserView::activated(const QModelIndex& index)
+{
+    if (mFileBrowserModel) {
+        if (mEngineWrapper->isDriveListViewActive()) {
+            mEngineWrapper->moveDownToDirectory(index);
+            populateFolderContent();
+        } else if (mEngineWrapper->getFileEntry(index).isDir()) {
+            // populate new content of changed navigation view.
+            // mLocationChanged = true;
+            // mDirectory = filePath;
+            mEngineWrapper->moveDownToDirectory(index);
+            populateFolderContent();
+        } else {  // file item
+            // mSelectedFilePath = filePath;
+            FileEntry fileEntry = mEngineWrapper->getFileEntry(index);
+            mAbsoluteFilePath = fileEntry.path() + fileEntry.name();
+
+            // open user-dialog to select: view as text/hex,  open w/AppArc or open w/DocH. embed
+            QStringList list;
+            list << QString("View as text/hex") << QString("Open w/ AppArc") << QString("Open w/ DocH. embed");
+            openListDialog(list, QString("Open file"), this, SLOT(fileOpen(HbAction *)));
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void FileBrowserView::activateSelectionMode()
+{
+    QString path;
+    disconnect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
+    mListView->setSelectionMode(HbListView::MultiSelection);
+
+//    if (mDirectory != mInitDirPath.path()) {
+//        QDir dir(mDirectory);
+//        path = mDirectory;
+//        QStringList dirs = dir.entryList(QDir::AllDirs | QDir::System | QDir::Hidden);
+//        if (dirs.count() > 0) {
+//            path.append("\\" + dirs.at(0) + "\\");
+//        }
+//    } else {
+//        path = ("C:\\");
+//    }
+//    QModelIndex index = mFileSystemModel->index(path,0);
+//    mListView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent);
+//    mListView->selectionModel()->select(index, QItemSelectionModel::Select);
+//    //mListView->setHighlightMode(HbItemHighlight::HighlightAlwaysVisible);
+//    mListView->setFocus();    // TODO use focus in
+    if (mListView->selectionModel()) {
+        connect(mListView->selectionModel(),
+                SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+                this,
+                SLOT(selectionChanged(QItemSelection, QItemSelection)));
+//        // flag to indicate that selection mode changed, "edit" sub-menu update needed
+//        mFolderContentChanged = true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void FileBrowserView::deActivateSelectionMode()
+{
+    disconnect(mListView->selectionModel(),
+               SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+               this,
+               SLOT(selectionChanged(QItemSelection, QItemSelection)));
+    mListView->setSelectionMode(HbListView::NoSelection);
+    connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
+    editUnselectAll();
+    // flag to indicate that selection mode changed, "edit" sub-menu update needed
+    mFolderContentChanged = true;
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/fileentry.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "fileentry.h"
+
+#include <hbextendedlocale.h>
+
+// ---------------------------------------------------------------------------
+
+FileEntry::FileEntry(TFileEntry aFileEntry)
+: mFileEntry(aFileEntry)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+FileEntry::~FileEntry()
+{
+}
+
+// ---------------------------------------------------------------------------
+
+QString FileEntry::fullName()
+{
+    return QString::fromUtf16(mFileEntry.iFullName.Ptr(), mFileEntry.iFullName.Length());
+}
+
+// ---------------------------------------------------------------------------
+
+QString FileEntry::path()
+{
+    return QString::fromUtf16(mFileEntry.iPath.Ptr(), mFileEntry.iPath.Length());
+}
+
+// ---------------------------------------------------------------------------
+
+int FileEntry::attributes()
+{
+    return mFileEntry.iEntry.iAtt;
+}
+
+QString FileEntry::attributesString()
+{
+    QString attributesString;
+    if (mFileEntry.iEntry.IsArchive()) {
+        attributesString.append("A");
+    } else {
+        attributesString.append("-");
+    }
+    if (mFileEntry.iEntry.IsHidden()) {
+        attributesString.append("H");
+    } else {
+        attributesString.append("-");
+    }
+    if (mFileEntry.iEntry.IsReadOnly()) {
+        attributesString.append("R");
+    } else {
+        attributesString.append("-");
+    }
+    if (mFileEntry.iEntry.IsSystem()) {
+        attributesString.append("S");
+    } else {
+        attributesString.append("-");
+    }
+
+    return attributesString;
+}
+
+// ---------------------------------------------------------------------------
+
+int FileEntry::size()
+{
+    return mFileEntry.iEntry.iSize;
+}
+
+// ---------------------------------------------------------------------------
+
+QString FileEntry::sizeString()
+{
+    QString sizeString;
+    if (size() < 1024) {
+        sizeString.append(QString::number(size()));
+        sizeString.append(" B");
+    } else if (size() < 1024*1024) {
+        qreal sizeKB = static_cast<qreal>(size() / 1024);
+        sizeString.append( QString::number(sizeKB, 'f',1));
+        sizeString.append(" kB");
+    } else {
+        qreal sizeMB = static_cast<qreal>(size() / (1024*1024));
+        sizeString.append( QString::number(sizeMB, 'f',1));
+        sizeString.append(" MB");
+    }
+    return sizeString;
+}
+
+// ---------------------------------------------------------------------------
+
+//QDateTime FileEntry::modified()
+//{
+//    QDateTime modified;
+//    TTime time1Jan1970UTC = TTime(_L("19700101:000000.000000"));
+//    TTimeIntervalSeconds intervalSeconds;
+//
+//    TTime entryModified = mFileEntry.iEntry.iModified;
+//
+//    TInt err = /*mFileEntry.iEntry.iModified*/ entryModified.SecondsFrom(time1Jan1970UTC, intervalSeconds);
+//    if (err == KErrNone) {
+//        quint32 secsSince1Jan1970UTC = intervalSeconds.Int();
+//        modified = QDateTime::fromTime_t(secsSince1Jan1970UTC);
+//        qDebug() << "QDateTime:: " << modified.toString();
+//        modified.setTimeSpec(Qt::LocalTime);
+//        qDebug() << "QDateTime:: " << modified.toString() << modified.toLocalTime().toString();
+//    }
+//    return modified;
+//}
+
+// ---------------------------------------------------------------------------
+
+QString FileEntry::modifiedString()
+{
+    // TODO use HbExtendedLocale to convert date and time
+//    QDateTime modifiedInLocalTime = modified();//.toLocalTime();
+//    HbExtendedLocale locale = HbExtendedLocale::system();
+//    QString date = locale.format(modifiedInLocalTime.date(), r_qtn_date_usual);
+//    QString time = locale.format(modifiedInLocalTime.time(), r_qtn_time_usual);
+//
+//    return date + " " + time;
+    QString modifiedString;
+    TTime entryModified = mFileEntry.iEntry.iModified;
+    RTz Tz;
+    TInt err = Tz.Connect();
+    if ( err == KErrNone && Tz.ConvertToLocalTime( entryModified ) == KErrNone )
+    {
+        entryModified = mFileEntry.iEntry.iModified;
+        TBuf<128> extraData;
+        _LIT(KCurrentDate,"%D%M%*Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+        entryModified.FormatL(extraData, KCurrentDate);
+        modifiedString = QString::fromUtf16(extraData.Ptr(), extraData.Length());
+    }
+    Tz.Close();
+
+    return modifiedString;
+}
+
+// ---------------------------------------------------------------------------
+
+//int FileEntry::Uid(int id)
+//{
+//    return id;//mFileEntry.iEntry.iType[id];
+//}
+
+// ---------------------------------------------------------------------------
+
+bool FileEntry::isDir()
+{
+    return mFileEntry.iEntry.IsDir();
+}
+
+// ---------------------------------------------------------------------------
+
+
+QString FileEntry::name()
+{
+    return QString::fromUtf16(mFileEntry.iEntry.iName.Ptr(), mFileEntry.iEntry.iName.Length());
+}
+
+// ---------------------------------------------------------------------------
+
+int FileEntry::dirEntries()
+{
+    return mFileEntry.iDirEntries;
+}
+
+// ---------------------------------------------------------------------------
+
+QString FileEntry::dirEntriesString()
+{
+    QString dirEntriesString;
+    dirEntriesString.append(QString::number(dirEntries()));
+    if (dirEntries() == 1) {
+        dirEntriesString.append(" entry");
+    } else {
+        dirEntriesString.append(" entries");
+    }
+    return dirEntriesString;
+}
+
+// ---------------------------------------------------------------------------
+
+int FileEntry::iconId()
+{
+    return mFileEntry.iIconId;
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <HbApplication>
+#include <HbMainWindow>
+
+#include "filebrowsermainwindow.h"
+
+
+int main(int argc, char *argv[])
+{
+    HbApplication app(argc, argv);
+    FileBrowserMainWindow window;
+    window.init();
+    int result = app.exec();
+
+    return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/notifications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <hblabel.h>
+//#include <hbdeviceprogressdialog.h>
+#include <hbmessagebox.h>
+
+#include "notifications.h"
+
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout)
+{
+    HbMessageBox *messageBox = new HbMessageBox(type);
+    messageBox->setText(text);
+    if (label.length()) {
+        HbLabel *header = new HbLabel(label, messageBox);
+        messageBox->setHeadingWidget(header);
+    }
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(timeout);
+    messageBox->open();
+}
+
+void Notifications::showAboutNote()
+{
+    showMessageBox(HbMessageBox::MessageTypeInformation,
+                   "Version 5.0.0 - 23h April 2010. Copyright © 2010 Nokia Corporation"
+                        "and/or its subsidiary(-ies). All rights reserved."
+                        "Licensed under Eclipse Public License v1.0.",
+                   "About File Browser"
+        );
+}
+
+// ---------------------------------------------------------------------------
+
+//HbDeviceProgressDialog* Notifications::showWaitDialog(const QString &text)
+//{
+//    HbDeviceProgressDialog *note = new HbDeviceProgressDialog( HbProgressDialog::WaitDialog );
+//    note->setText( text );
+//    note->show();
+//    return note;
+//}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showInformationNote(const QString &text, const QString &title)
+{
+    showMessageBox(HbMessageBox::MessageTypeInformation, text, title, false);
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showErrorNote(const QString &text, bool noTimeout)
+{
+    showMessageBox(HbMessageBox::MessageTypeWarning, text, "", noTimeout ? HbPopup::NoTimeout : HbPopup::StandardTimeout);
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showConfirmationNote(const QString &text, bool noTimeout)
+{
+    showMessageBox(HbMessageBox::MessageTypeWarning, text, "", noTimeout ? HbPopup::NoTimeout : HbPopup::ConfirmationNoteTimeout);
+}
+
+// ---------------------------------------------------------------------------
+
+bool Notifications::showConfirmationQuery(const QString &aText)
+{
+    return false; //HbMessageBox::question(aText);
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/searchview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "searchview.h"
+#include "enginewrapper.h"
+
+#include <HbView>
+#include <HbMainWindow>
+
+#include <HbDataForm>
+#include <HbDataFormModel>
+#include <HbDataFormModelItem>
+#include <HbAction>
+#include <HbPushButton>
+#include <HbListWidget>
+#include <HbListWidgetItem>
+#include <HbDialog>
+#include <HbMenu>
+
+#include <QtGui>
+#include <QDir>
+#include <QFileInfo>
+#include <QProgressBar>
+
+
+const QStringList RECURSEMODES = (QStringList() << "Non-recursive" << "Recursive");
+
+SearchView::SearchView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper)
+: mMainWindow(mainWindow),
+  mMainView(mainView),
+  mEngineWrapper(engineWrapper),
+  mAttributes(),
+  mResults(),
+  mForm(0),
+  mSearchFileNameItem(0),
+  mWildCardItem(0),
+  mHasString(0),
+  mRecurse(0),
+  mMinSize(0),
+  mMaxSize(0),
+  mMinDate(0),
+  mMaxDate(0),
+  mPath()
+{
+}
+
+SearchView::~SearchView() 
+{
+}
+
+void SearchView::open(const QString &path)
+{   
+    // Remove main view from main window
+    mMainWindow.removeView(&mMainView);
+    mMainWindow.addView(this);
+    // Set title and add this view to main window
+    setTitle("Search");
+	
+    mForm = new HbDataForm(/*HbFormView::ModeEdit,*/ this);
+    HbDataFormModel *model = new HbDataFormModel();
+    mPath = path;
+    mSearchFileNameItem = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mSearchFileNameItem->setLabel("Search dir: ");
+
+    mWildCardItem = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mWildCardItem->setLabel("Wildcards: ");
+
+    mHasString = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mHasString->setLabel("Has string: ");
+    
+    mRecurse = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem);
+    mRecurse->setLabel("Recurse: ");
+    mRecurse->setContentWidgetData("items", RECURSEMODES);
+    
+    mMinSize = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mMinSize->setLabel("Min size: ");
+    
+    mMaxSize = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mMaxSize->setLabel("Max size: ");
+    
+    mMinDate = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mMinDate->setLabel("Min date: ");
+    mMinDate->setContentWidgetData("text", "01/01/1980");
+    
+    mMaxDate = new HbDataFormModelItem(HbDataFormModelItem::TextItem);
+    mMaxDate->setLabel("Max date: ");
+    mMaxDate->setContentWidgetData("text", "31/12/2060");
+    
+    // load file search attribute values from FB engine:
+    loadAttributes();
+    
+    model->appendDataFormItem(mSearchFileNameItem);
+    model->appendDataFormItem(mWildCardItem);
+    model->appendDataFormItem(mHasString);
+    model->appendDataFormItem(mRecurse);
+    model->appendDataFormItem(mMinSize);
+    model->appendDataFormItem(mMaxSize);
+    model->appendDataFormItem(mMinDate);
+    model->appendDataFormItem(mMaxDate);
+    mForm->setModel(model);
+
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical,this);
+
+    HbPushButton* buttonSearch = new HbPushButton("Search");
+    buttonSearch->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
+    connect(buttonSearch, SIGNAL(clicked()), this, SLOT(startFileSearch()));
+
+	HbPushButton* buttonCancel = new HbPushButton("Cancel");
+    buttonCancel->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
+    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(backButtonClicked()));
+
+    // Create widget and layout for buttons
+    QGraphicsWidget *buttonsWidget = new QGraphicsWidget(this);
+    QGraphicsGridLayout *gridLayout = new QGraphicsGridLayout(buttonsWidget);
+    
+    // add buttons to layout
+    gridLayout->addItem(buttonSearch, 0, 0);
+	gridLayout->addItem(buttonCancel, 0, 1);
+    buttonsWidget->setLayout(gridLayout);
+	// add form and buttons widget to list layout
+	layout->addItem(mForm);
+	layout->addItem(buttonsWidget);
+    setLayout(layout);
+    // about to close connect to go back to file browser view
+    connect(this, SIGNAL(aboutToClose()), this, SLOT(backButtonClicked())); 
+}
+
+void SearchView::backButtonClicked()
+{
+    mMainWindow.removeView(this);
+	mForm->deleteLater();
+	mForm = 0;
+    mMainWindow.addView(&mMainView);
+}
+
+void SearchView::startFileSearch()
+{
+    // save form data values and set them as search attributes into FB engine. 
+    readFormItems();
+    mEngineWrapper.setFileSearchAttributes(mAttributes);
+    
+    // Create busy indicator widget with  label **Searching**. Launch it to screen when
+    // FB Utils engine started for file search.  Hide busy indicator when search completed.
+    QProgressBar *progressBar = new QProgressBar();
+	progressBar->setMaximumHeight(16);
+	progressBar->setMaximumWidth(200);    
+    progressBar->setTextVisible(false);
+    progressBar->setMaximum(0);
+    progressBar->setMinimum(0);
+    progressBar->setValue(1);
+
+    QWidget *busyIndWidget = new QWidget();
+    busyIndWidget->setGeometry(12, 50, 120, 60);
+    QVBoxLayout *vbl = new QVBoxLayout(busyIndWidget);
+    QLabel *label = new QLabel("**Searching**");
+    vbl->addWidget(label);
+    vbl->addWidget(progressBar);
+    QHBoxLayout *hbl1 = new QHBoxLayout();
+    vbl->addLayout(hbl1);   
+    busyIndWidget->show();        
+    qApp->processEvents();
+    bool err = mEngineWrapper.searchFiles();
+    busyIndWidget->hide();
+
+    // show results of file search:
+    mResults = mEngineWrapper.getSearchResults();
+    fileSearchResults();
+}
+
+
+void SearchView::loadAttributes()
+{
+    // get settings from engine;
+    mAttributes = mEngineWrapper.getFileSearchAttributes();
+    
+    // set data:
+    mSearchFileNameItem->setContentWidgetData("text", mPath);
+    mSearchFileNameItem->setContentWidgetData("text", mAttributes.mSearchDir);
+    mWildCardItem->setContentWidgetData("text",mAttributes.mWildCards);
+    mHasString->setContentWidgetData("text", mAttributes.mTextInFile);
+
+    mRecurse->setContentWidgetData("selected",mAttributes.mRecurse);
+
+    mMinSize->setContentWidgetData("text",mAttributes.mMinSize);
+    mMaxSize->setContentWidgetData("text", mAttributes.mMaxSize);
+
+    mMinDate->setContentWidgetData("text", mAttributes.mMinDate);
+    mMaxDate->setContentWidgetData("text", mAttributes.mMaxDate);
+}
+
+
+void SearchView::fileSearchResults()
+{
+    HbDialog *dialog = new HbDialog();
+    dialog->setDismissPolicy(HbPopup::TapOutside);
+    dialog->setTimeout(HbPopup::NoTimeout);
+
+    // Create a list and some simple content for it
+    HbListWidget *resultsList = new HbListWidget();
+    resultsList->addItem(QString("%1 entries found").arg(mResults.mNumberOfFoundFiles));
+    for (int i = 0; i < mResults.mFoundFilesList->size(); i++) {
+        resultsList->addItem(QString("%1").arg(mResults.mFoundFilesList->at(i)));
+        }
+    dialog->setContentWidget(resultsList);    
+    dialog->open();
+}
+
+/**
+ * Reads form items and saves values of them into member variable mAttributes
+ */
+void SearchView::readFormItems()
+{
+    mAttributes.mSearchDir  = mSearchFileNameItem->contentWidgetData("text").toString();
+    mAttributes.mWildCards  = mWildCardItem->contentWidgetData("text").toString();
+    mAttributes.mTextInFile = mHasString->contentWidgetData("text").toString();
+    mAttributes.mMinSize    = mMinSize->contentWidgetData("text").toInt();
+    mAttributes.mMaxSize    = mMaxSize->contentWidgetData("text").toInt();
+    mAttributes.mMinDate    = mMinDate->contentWidgetData("text").toDate();
+    mAttributes.mMaxDate    = mMaxDate->contentWidgetData("text").toDate();
+    mAttributes.mRecurse    = mRecurse->contentWidgetData("selected").toBool();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/src/settingsview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "settingsview.h"
+#include "filebrowsermainwindow.h"
+#include "enginewrapper.h"
+#include "filebrowsersettings.h"
+
+#include <HbView>
+#include <HbDataForm>
+#include <HbDataFormModel>
+#include <HbDataFormModelItem>
+#include <HbAction>
+#include <HbToolBar>
+
+#include <QGraphicsLinearLayout>
+
+const QStringList DisplayModeModes = (QStringList() << "Full screen" << "Normal");
+const QStringList FileViewModes = (QStringList() << "Simple" << "Extended");
+const QStringList Modes = (QStringList() << "Yes" << "No");
+const QString YesText = QString("Yes");
+const QString NoText = QString("No");
+const QString acceptActionText = "OK";
+const QString rejectActionText = "Cancel";
+
+SettingsView::SettingsView(FileBrowserMainWindow &mainWindow, EngineWrapper &engineWrapper) :
+    mMainWindow(mainWindow),
+    mEngineWrapper(engineWrapper),
+    mForm(0),
+    mDisplayModeItem(0),
+    mFileViewItem(0),
+    mShowDirectoryInfoItem(0),
+    mShowAssociatedIconsItem(0),
+    mRememberFolderOnExitItem(0),
+    mRememberLastFolderItem(0),
+    mShowToolbarItem(0),
+    mSupportNetDrivesItem(0),
+    mBypassPlatformSecurityItem(0),
+    mUnlockFilesViaSBItem(0),
+    mIgnoreProtectionAttributesItem(0),
+    mNoROAttributeCopyFromZItem(0)
+{
+    setTitle("Settings");
+
+    // Override back navigation action
+    HbAction *leaveViewAction = new HbAction(Hb::BackNaviAction, this);
+    connect(leaveViewAction, SIGNAL(triggered()), this, SLOT(reject()));
+    setNavigationAction(leaveViewAction);
+
+    initDataForm();
+    createToolbar();
+}
+
+SettingsView::~SettingsView()
+{
+}
+
+void SettingsView::initDataForm()
+{
+    mForm = new HbDataForm(this);
+    HbDataFormModel *model = new HbDataFormModel();
+
+//    connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
+//            this, SLOT(toggleChange(QModelIndex, QModelIndex)));
+
+
+    // TODO to be done
+//    mDisplayModeItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem);
+//    mDisplayModeItem->setLabel("Display mode: ");
+//    mDisplayModeItem->setContentWidgetData("items", DisplayModeModes);
+//
+//    mFileViewItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem);
+//    mFileViewItem->setLabel("File view: ");
+//    mFileViewItem->setContentWidgetData("items", FileViewModes);
+//
+//    mShowDirectoryInfoItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+//    mShowDirectoryInfoItem->setLabel("Show directory info: ");
+//    mShowDirectoryInfoItem->setContentWidgetData(QString("text"), YesText);
+//    mShowDirectoryInfoItem->setContentWidgetData(QString("additionalText"), NoText);
+//
+//    mShowAssociatedIconsItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+//    mShowAssociatedIconsItem->setLabel("Show associated icons: ");
+//    mShowAssociatedIconsItem->setContentWidgetData(QString("text"), YesText);
+//    mShowAssociatedIconsItem->setContentWidgetData(QString("additionalText"), NoText);
+//
+//    mRememberFolderOnExitItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+//    mRememberFolderOnExitItem->setLabel("Remember folder on exit: ");
+//    mRememberFolderOnExitItem->setContentWidgetData(QString("text"), YesText);
+//    mRememberFolderOnExitItem->setContentWidgetData(QString("additionalText"), NoText);
+//
+//    mRememberLastFolderItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+//    mRememberLastFolderItem->setLabel("Remember last folder: ");
+//    mRememberLastFolderItem->setContentWidgetData(QString("text"), YesText);
+//    mRememberLastFolderItem->setContentWidgetData(QString("additionalText"), NoText);
+//
+//    mShowToolbarItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+//    mShowToolbarItem->setLabel("Show toolbar: ");
+//    mShowToolbarItem->setContentWidgetData(QString("text"), YesText);
+//    mShowToolbarItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    mSupportNetDrivesItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mSupportNetDrivesItem->setLabel("Support net drives: ");
+    mSupportNetDrivesItem->setContentWidgetData(QString("text"), YesText);
+    mSupportNetDrivesItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    mBypassPlatformSecurityItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mBypassPlatformSecurityItem->setLabel("Bypass plat.security: ");
+    mBypassPlatformSecurityItem->setContentWidgetData(QString("text"), YesText);
+    mBypassPlatformSecurityItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    mUnlockFilesViaSBItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mUnlockFilesViaSBItem->setLabel("Unlock files via SB: ");
+    mUnlockFilesViaSBItem->setContentWidgetData(QString("text"), YesText);
+    mUnlockFilesViaSBItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    mIgnoreProtectionAttributesItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mIgnoreProtectionAttributesItem->setLabel("Ign. protection atts: ");
+    mIgnoreProtectionAttributesItem->setContentWidgetData(QString("text"), YesText);
+    mIgnoreProtectionAttributesItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    mNoROAttributeCopyFromZItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mNoROAttributeCopyFromZItem->setLabel("No RO-att copy from Z: ");
+    mNoROAttributeCopyFromZItem->setContentWidgetData(QString("text"), YesText);
+    mNoROAttributeCopyFromZItem->setContentWidgetData(QString("additionalText"), NoText);
+
+    // load file search attribute values from FB engine:
+    loadSettings(mEngineWrapper.settings());
+
+//    model->appendDataFormItem(mDisplayModeItem);
+//    model->appendDataFormItem(mFileViewItem);
+//    model->appendDataFormItem(mShowDirectoryInfoItem);
+//    model->appendDataFormItem(mShowAssociatedIconsItem);
+//    model->appendDataFormItem(mRememberFolderOnExitItem);
+//    model->appendDataFormItem(mRememberLastFolderItem);
+//    model->appendDataFormItem(mShowToolbarItem);
+
+    model->appendDataFormItem(mSupportNetDrivesItem);
+    model->appendDataFormItem(mBypassPlatformSecurityItem);
+    model->appendDataFormItem(mUnlockFilesViaSBItem);
+    model->appendDataFormItem(mIgnoreProtectionAttributesItem);
+    model->appendDataFormItem(mNoROAttributeCopyFromZItem);
+
+    mForm->setModel(model);
+
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical,this);
+    layout->addItem(mForm);
+    setLayout(layout);
+}
+
+void SettingsView::createToolbar()
+{
+    HbToolBar *toolBar = new HbToolBar(this);
+    HbAction *acceptAction = new HbAction(acceptActionText);
+    connect(acceptAction, SIGNAL(triggered()), this, SLOT(accept()));
+    toolBar->addAction(acceptAction);
+
+    HbAction *rejectAction = new HbAction(rejectActionText);
+    connect(rejectAction, SIGNAL(triggered()), this, SLOT(reject()));
+    toolBar->addAction(rejectAction);
+
+    setToolBar(toolBar);
+}
+
+/**
+  Set form item values from settings \a settings.
+ */
+void SettingsView::loadSettings(const FileBrowserSettings &settings)
+{
+//    mDisplayModeItem->setContentWidgetData("text", settings.displayMode());
+//    mFileViewItem->setContentWidgetData("text", settings.fileViewMode());
+//    mShowDirectoryInfoItem->setContentWidgetData("text", settings.showSubDirectoryInfo());
+//    mShowAssociatedIconsItem->setContentWidgetData("text", settings.showAssociatedIcons());
+//    mRememberFolderOnExitItem->setContentWidgetData("text", settings.rememberFolderSelection());
+//    mRememberLastFolderItem->setContentWidgetData("text", settings.rememberLastPath());
+//    mShowToolbarItem->setContentWidgetData("text", settings.enableToolbar());
+
+    mSupportNetDrivesItem->setContentWidgetData("text", settings.supportNetworkDrives() ? YesText : NoText);
+    mSupportNetDrivesItem->setContentWidgetData("additionalText", !settings.supportNetworkDrives() ? YesText : NoText);
+
+    mBypassPlatformSecurityItem->setContentWidgetData("text", settings.bypassPlatformSecurity() ? YesText : NoText);
+    mBypassPlatformSecurityItem->setContentWidgetData("additionalText", !settings.bypassPlatformSecurity() ? YesText : NoText);
+
+    mUnlockFilesViaSBItem->setContentWidgetData("text", settings.removeFileLocks() ? YesText : NoText);
+    mUnlockFilesViaSBItem->setContentWidgetData("additionalText", !settings.removeFileLocks() ? YesText : NoText);
+
+    mIgnoreProtectionAttributesItem->setContentWidgetData("text", settings.ignoreProtectionsAttributes() ? YesText : NoText);
+    mIgnoreProtectionAttributesItem->setContentWidgetData("additionalText", !settings.ignoreProtectionsAttributes() ? YesText : NoText);
+
+    mNoROAttributeCopyFromZItem->setContentWidgetData("text", settings.removeROMWriteProrection() ? YesText : NoText);
+    mNoROAttributeCopyFromZItem->setContentWidgetData("additionalText", !settings.removeROMWriteProrection() ? YesText : NoText);
+}
+
+/**
+  Store form item data into \a settings
+ */
+void SettingsView::saveSettings(FileBrowserSettings &settings)
+{
+//    settings.setDisplayMode(mDisplayModeItem->contentWidgetData("text").toInt());
+//    settings.setFileViewMode(mFileViewItem->contentWidgetData("text").toInt());
+//    settings.setShowSubDirectoryInfo(mShowDirectoryInfoItem->contentWidgetData("text").toBool());
+//    settings.setShowAssociatedIcons(mShowAssociatedIconsItem->contentWidgetData("text").toBool());
+//    settings.setRememberLastPath(mRememberFolderOnExitItem->contentWidgetData("text").toBool());
+//    //settings.setLastPath(mRememberLastFolderItem->contentWidgetData("text").toString());
+//    settings.setRememberFolderSelection(mRememberLastFolderItem->contentWidgetData("text").toBool());
+//    settings.setEnableToolbar(mShowToolbarItem->contentWidgetData("text").toBool());
+
+    settings.setSupportNetworkDrives(mSupportNetDrivesItem->contentWidgetData("text").toString() == YesText);
+    settings.setBypassPlatformSecurity(mBypassPlatformSecurityItem->contentWidgetData("text").toString() == YesText);
+    settings.setRemoveFileLocks(mUnlockFilesViaSBItem->contentWidgetData("text").toString() == YesText);
+    settings.setIgnoreProtectionsAttributes(mIgnoreProtectionAttributesItem->contentWidgetData("text").toString() == YesText);
+    settings.setRemoveROMWriteProrection(mNoROAttributeCopyFromZItem->contentWidgetData("text").toString() == YesText);
+}
+
+void SettingsView::constructMenu()
+{
+    
+}
+//
+//void SettingsView::displayModeChanged()
+//{
+//}
+//
+//void SettingsView::fileViewChanged()
+//{
+//
+//}
+//
+//void SettingsView::subDirectoryInfoChanged()
+//{
+//}
+//
+//void SettingsView::associatedIconsChanged()
+//{
+//}
+//
+//void SettingsView::rememberFolderOnExitChanged()
+//{
+//}
+//
+//void SettingsView::rememberLastFolderChanged()
+//{
+//}
+//
+//void SettingsView::showToolbarChanged()
+//{
+//}
+
+void SettingsView::accept()
+{
+    saveSettings(mEngineWrapper.settings());
+    mEngineWrapper.saveSettings();
+    emit finished(true);
+}
+
+void SettingsView::reject()
+{
+    emit finished(false);
+}
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/ui.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,113 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+TEMPLATE = app
+TARGET = FileBrowser
+DEPENDPATH += .
+INCLUDEPATH += ./inc
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
+
+HEADERS += ./inc/filebrowsermainwindow.h \
+           ./inc/filebrowserview.h \
+           ./inc/filebrowsermodel.h \
+           ./inc/menuaction.h \
+           ./inc/filebrowsersettings.h \
+           ./inc/settingsview.h \
+           ./inc/editorview.h \
+           ./inc/searchview.h \
+           ./inc/enginewrapper.h \
+           ./inc/notifications.h \
+           ./inc/fileentry.h \
+           ./inc/driveentry.h
+SOURCES += ./src/main.cpp \
+           ./src/filebrowsermainwindow.cpp \
+           ./src/filebrowserview.cpp \
+           ./src/filebrowsermodel.cpp \
+           ./src/settingsview.cpp \
+           ./src/editorview.cpp \
+           ./src/searchview.cpp \
+           ./src/enginewrapper.cpp \
+           ./src/notifications.cpp \
+           ./src/fileentry.cpp \
+           ./src/driveentry.cpp
+RESOURCES += ./ui.qrc
+
+symbian {
+    INCLUDEPATH += ../
+    LIBS += -leikcore \
+            -lcommonengine \
+            -ltzclient \
+            -lapmime \
+            -lcommonui \
+            -leuser \
+            -lapparc \
+            -lcone \
+            -lws32 \
+            -lfbscli \
+            -lImageConversion \
+            -lPlatformEnv \
+            -lCommonDialogs \
+            -leikcoctl \
+            -lapgrfx \
+            -lefsrv \
+            -lbafl \
+            -lCentralRepository \
+            -lmediaclientaudio \
+            -lestor \
+            -lgdi \
+            -leikctl \
+            -leikcdlg \
+            -leikdlg \
+            -legul \
+            -lsendui \
+            -lmsgs \
+            -lezlib \
+            -lcdlengine \
+            -lremconcoreapi \
+            -lremconinterfacebase \
+            -lsbeclient \
+            -lhash \
+            -letext \
+            -lcharconv \
+        #ifndef FILEBROWSER_LITE
+            -lfilebrowserfileopclient
+        #endif"
+
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+    HEADERS += ../engine/engine.h \
+               ../engine/FBFileUtils.h \
+               ../engine/FBFileOps.h \
+               ../engine/FB.hrh \
+               ../engine/FBStd.h \
+               ../engine/FBTraces.h \
+            #ifndef FILEBROWSER_LITE
+               ../fileopclient\inc\FBFileOpClient.h
+            #endif
+    SOURCES += ../engine/engine.cpp \
+               ../engine/FBFileUtils.cpp \
+               ../engine/FBFileOps.cpp
+    RSS_RULES += "group_name = \"RnD Tools\";"
+    TARGET.CAPABILITY = NetworkServices LocalServices CAP_APPLICATION AllFiles DiskAdmin
+    TARGET.UID3 = 0xE85157B0
+    TARGET.VID = 0x101FB657 // Nokia
+    TARGET.EPOCHEAPSIZE  = 0x20000 0x4000000  // Min 128Kb, Max 64Mb
+    ICON = ../icons/qgn_menu_filebrowser.svg
+} else {
+    error("Only Symbian supported!")
+}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/ui/ui.qrc	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file alias="qgn_indi_tb_filebrowser_folder_parent.svg" >../icons/qgn_indi_tb_filebrowser_folder_parent.svg</file>
+        <file alias="qgn_indi_tb_filebrowser_find.svg" >../icons/qgn_indi_tb_filebrowser_find.svg</file>
+    </qresource>
+</RCC>
--- a/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ b/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -19,12 +19,12 @@
 */
 
 
-#include "../creator/group/bld.inf"
-#include "../filebrowser/group/bld.inf"
-#include "../launcher/group/bld.inf"
-#include "../loadgen/group/bld.inf"
+//Orbit version added #include "../creator/group/bld.inf"
+//Orbit version added #include "../filebrowser/group/bld.inf"
+//Orbit version added #include "../launcher/group/bld.inf"
+//Orbit version added #include "../loadgen/group/bld.inf"
 //Orbit version added #include "../perfmon/group/bld.inf"
 //Orbit version added #include "../screengrabber/group/bld.inf"
-#include "../stifui/group/bld.inf"
-#include "../memspyui/group/bld.inf"
-#include "../htiui/group/bld.inf"
+#include "../stifui/avkon/group/bld.inf"
+//Orbit version added #include "../memspyui/group/bld.inf"
+//Orbit version added #include "../htiui/group/bld.inf"
--- a/htiui/HtiAdminQt/HtiAdmin.pro	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiAdminQt/HtiAdmin.pro	Fri May 14 15:53:02 2010 +0300
@@ -19,7 +19,7 @@
 DEPENDPATH += .
 INCLUDEPATH += .
 INCLUDEPATH += . /epoc32/include/mw/hb/hbcore /epoc32/include/mw/hb/hbwidgets /epoc32/include/mw/hb/hbtools
-LIBS += -lhbcore -lhbwidgets -lhbtools
+LIBS += -lhbcore -lhbwidgets
 
 HEADERS += mainview.h 
 SOURCES += main.cpp mainview.cpp 
--- a/htiui/HtiAdminQt/mainview.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiAdminQt/mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -21,9 +21,9 @@
 #include <hbmenu.h>
 #include <hbaction.h>
 #include <hblabel.h>
-#include <HbInputDialog.h>
+#include <hbinputdialog.h>
 #include <qgraphicslinearlayout.h>
-#include <HbListDialog.h>
+//#include <HbListDialog.h>
 #include <hbmessagebox.h>
 
 
@@ -264,43 +264,43 @@
 void MainView::enableComm()
 {
     //Get current selection
-	QString currentComm;
-	mEngineWrapper.getSelectedComm(currentComm);
-	int curSelection = mPluginList.indexOf(currentComm, 0);
-	
-	QStringList selection;
-	bool ok = false;
-	selection = HbListDialog::getStringItems("Select Comm", mPluginList, curSelection, &ok, HbAbstractItemView::SingleSelection);
-		
-	if(ok){
-			if(selection[0] == QString("Bt serial comm")){
-				enableBTComm();
-			}
-			else if(selection[0] == QString("IP comm")){
-				enableIPComm();
-			}
-			else if(selection[0] == QString("SERIAL comm")){
-				enableSerialComm();
-			}
-			else{
-				//All other comm plugins
-				mEngineWrapper.enableOtherComm(selection[0]);
-			}	
-		}
+//	QString currentComm;
+//	mEngineWrapper.getSelectedComm(currentComm);
+//	int curSelection = mPluginList.indexOf(currentComm, 0);
+//	
+//	QStringList selection;
+//	bool ok = false;
+//	selection = HbListDialog::getStringItems("Select Comm", mPluginList, curSelection, &ok, HbAbstractItemView::SingleSelection);
+//		
+//	if(ok){
+//			if(selection[0] == QString("Bt serial comm")){
+//				enableBTComm();
+//			}
+//			else if(selection[0] == QString("IP comm")){
+//				enableIPComm();
+//			}
+//			else if(selection[0] == QString("SERIAL comm")){
+//				enableSerialComm();
+//			}
+//			else{
+//				//All other comm plugins
+//				mEngineWrapper.enableOtherComm(selection[0]);
+//			}	
+//		}
 }
 
 // ---------------------------------------------------------------------------
 void MainView::enableSerialComm()
 {
-	bool ok = false;
-    QString str = HbInputDialog::getText(
-					"Set Comm Port number ",
-					"",
-					&ok);
-    
-    if(ok){
-    	mEngineWrapper.enableSerial(str);
-    }
+//	bool ok = false;
+//    QString str = HbInputDialog::getText(
+//					"Set Comm Port number ",
+//					"",
+//					&ok);
+//    
+//    if(ok){
+//    	mEngineWrapper.enableSerial(str);
+//    }
 }
 
 
@@ -308,109 +308,109 @@
 void MainView::enableIPComm()
 {
     // Get IAPs list
-    QStringList iapsList;
-    mEngineWrapper.listIAPs(iapsList); 
-    if(iapsList.count() == 0)
-    {
-        HbMessageBox msg("No IAPs for selection!", HbMessageBox::MessageTypeWarning);
-        msg.exec();
-        return;
-    }
-    
-    // Get current selection
-    QString curIapName;
-    QString param = "IAPName";
-    mEngineWrapper.getIPCfgParam(param, curIapName);
-    int curSelction = iapsList.indexOf(curIapName, 0);
-    
-    QString iap;
-	QStringList selection;
-	bool ok = false;
-	selection = HbListDialog::getStringItems("Select IAP:", iapsList, curSelction, &ok, HbAbstractItemView::SingleSelection);
-	
-	if(ok)
-	{
-        iap = selection[0];
-	}
-	else
-	{
-        return;
-	}
-	
-	QStringList srcList;
-	srcList <<"Listen" <<"Connect";
-	
-	selection = HbListDialog::getStringItems("Select IP Comm", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-	
-	if(ok){
-		if(selection[0] == srcList[0]){
-			QString port = HbInputDialog::getText(
-								"Local port",
-								"",
-								&ok);	
-		
-			if(ok){
-				mEngineWrapper.ipListen(port, iap);
-			}
-			
-		}
-		else{
-			QString host = HbInputDialog::getText(
-								"Remote Host",
-								"",
-								&ok);	
-					
-			if(ok){
-				QString port = HbInputDialog::getText(
-												"Remote port",
-												"",
-												&ok);	
-			
-				if(ok){
-					mEngineWrapper.ipConnect(host, port, iap);
-				}
-			}
-		}
-			
-	}
+//    QStringList iapsList;
+//    mEngineWrapper.listIAPs(iapsList); 
+//    if(iapsList.count() == 0)
+//    {
+//        HbMessageBox msg("No IAPs for selection!", HbMessageBox::MessageTypeWarning);
+//        msg.exec();
+//        return;
+//    }
+//    
+//    // Get current selection
+//    QString curIapName;
+//    QString param = "IAPName";
+//    mEngineWrapper.getIPCfgParam(param, curIapName);
+//    int curSelction = iapsList.indexOf(curIapName, 0);
+//    
+//    QString iap;
+//	QStringList selection;
+//	bool ok = false;
+//	selection = HbListDialog::getStringItems("Select IAP:", iapsList, curSelction, &ok, HbAbstractItemView::SingleSelection);
+//	
+//	if(ok)
+//	{
+//        iap = selection[0];
+//	}
+//	else
+//	{
+//        return;
+//	}
+//	
+//	QStringList srcList;
+//	srcList <<"Listen" <<"Connect";
+//	
+//	selection = HbListDialog::getStringItems("Select IP Comm", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+//	
+//	if(ok){
+//		if(selection[0] == srcList[0]){
+//			QString port = HbInputDialog::getText(
+//								"Local port",
+//								"",
+//								&ok);	
+//		
+//			if(ok){
+//				mEngineWrapper.ipListen(port, iap);
+//			}
+//			
+//		}
+//		else{
+//			QString host = HbInputDialog::getText(
+//								"Remote Host",
+//								"",
+//								&ok);	
+//					
+//			if(ok){
+//				QString port = HbInputDialog::getText(
+//												"Remote port",
+//												"",
+//												&ok);	
+//			
+//				if(ok){
+//					mEngineWrapper.ipConnect(host, port, iap);
+//				}
+//			}
+//		}
+//			
+//	}
 }
 
 // ---------------------------------------------------------------------------
 void MainView::enableBTComm()
 {
-	QStringList srcList;
-	QStringList selection;
-	 
-	srcList <<"BT address" <<"BT name" <<"Search when starting" ;
-	
-	bool ok = false;
-	selection = HbListDialog::getStringItems("", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-	
-	if(ok){
-		if(selection[0] == srcList[0]){
-			QString address = HbInputDialog::getText(
-						"BT address",
-						"",
-						&ok);
-		
-			if(ok){
-				mEngineWrapper.enableBtByAddress(address);	
-			}
-		}
-		else if(selection[0] == srcList[1]){
-			QString name = HbInputDialog::getText(
-								"BT name",
-								"",
-								&ok);
-				
-					if(ok){
-						mEngineWrapper.enableBtByName(name);	
-					}
-		}
-		else if(selection[0] == srcList[2]){
-			mEngineWrapper.btSearch();
-		}
-	}
+//	QStringList srcList;
+//	QStringList selection;
+//	 
+//	srcList <<"BT address" <<"BT name" <<"Search when starting" ;
+//	
+//	bool ok = false;
+//	selection = HbListDialog::getStringItems("", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+//	
+//	if(ok){
+//		if(selection[0] == srcList[0]){
+//			QString address = HbInputDialog::getText(
+//						"BT address",
+//						"",
+//						&ok);
+//		
+//			if(ok){
+//				mEngineWrapper.enableBtByAddress(address);	
+//			}
+//		}
+//		else if(selection[0] == srcList[1]){
+//			QString name = HbInputDialog::getText(
+//								"BT name",
+//								"",
+//								&ok);
+//				
+//					if(ok){
+//						mEngineWrapper.enableBtByName(name);	
+//					}
+//		}
+//		else if(selection[0] == srcList[2]){
+//			mEngineWrapper.btSearch();
+//		}
+//	}
 }
 
 
@@ -418,40 +418,40 @@
 void MainView::setPriority()
 {
     // Get current priority
-    bool ok = false;
-    QString curPriority;
-    QString param = "Priority";
-    mEngineWrapper.getHtiCfgParam(param, curPriority);
-    int curSelection = curPriority.toInt(&ok);
-    if(ok){
-        curSelection--;
-    }
-    else{
-    curSelection = 2;
-    }
-    
-	QStringList srcList;
-	QStringList selection;
-	 
-	srcList <<"Backgroung" <<"Foregound" <<"High" << "Absolute High";
-	
-	
-	selection = HbListDialog::getStringItems("Select Hti Priority", srcList, curSelection, &ok, HbAbstractItemView::SingleSelection);
-	
-	if(ok){
-		if(selection[0] == srcList[0]){
-			mEngineWrapper.setPriorityBackground();
-		}
-		else if(selection[0] == srcList[1]){
-					mEngineWrapper.setPriorityForeground();
-		}
-		else if(selection[0] == srcList[2]){
-			mEngineWrapper.setPriorityHigh();
-		}
-		else{
-			mEngineWrapper.setPriorityAbsoluteHigh();
-		}	
-	}
+//    bool ok = false;
+//    QString curPriority;
+//    QString param = "Priority";
+//    mEngineWrapper.getHtiCfgParam(param, curPriority);
+//    int curSelection = curPriority.toInt(&ok);
+//    if(ok){
+//        curSelection--;
+//    }
+//    else{
+//    curSelection = 2;
+//    }
+//    
+//	QStringList srcList;
+//	QStringList selection;
+//	 
+//	srcList <<"Backgroung" <<"Foregound" <<"High" << "Absolute High";
+//	
+//	
+//	selection = HbListDialog::getStringItems("Select Hti Priority", srcList, curSelection, &ok, HbAbstractItemView::SingleSelection);
+//	
+//	if(ok){
+//		if(selection[0] == srcList[0]){
+//			mEngineWrapper.setPriorityBackground();
+//		}
+//		else if(selection[0] == srcList[1]){
+//					mEngineWrapper.setPriorityForeground();
+//		}
+//		else if(selection[0] == srcList[2]){
+//			mEngineWrapper.setPriorityHigh();
+//		}
+//		else{
+//			mEngineWrapper.setPriorityAbsoluteHigh();
+//		}	
+//	}
 }
 
 // ---------------------------------------------------------------------------
@@ -493,62 +493,62 @@
 // ---------------------------------------------------------------------------
 void MainView::showParamList()
 {
-	QStringList srcList;
-	QStringList selection;
-	QString value;
-	QString name;
-	QString cfgSelection;
-	QString paramSelection;
-	QString cfgHti = "Hti.cfg";
-	QString cfgBtComm ="HtiBtComm.cfg";
-	QString cfgSerialComm = "HtiSerialComm.cfg";
-	QString cfgIPComm = "HtiIPComm.cfg";
-	 
-	srcList <<cfgHti <<cfgBtComm <<cfgSerialComm << cfgIPComm;
-	
-	bool ok = false;
-	selection = HbListDialog::getStringItems("Select cfg file to modify", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-	
-	if(ok){
-        cfgSelection = selection[0];
-        srcList.clear();
-	    if(cfgSelection == cfgHti){
-	    srcList <<"CommPlugin" <<"MaxMsgSize" <<"MaxQueueSize" <<"MaxHeapSize"<<"Priority"
-	            <<"ShowConsole"<<"MaxWaitTime"<<"StartUpDelay"<<"EnableHtiWatchDog"
-	            <<"EnableHtiAutoStart"<<"ShowErrorDialogs"<<"ReconnectDelay";
-	    }
-	    else if(cfgSelection == cfgBtComm){
-	        srcList <<"BtDeviceName" <<"BtDeviceName";
-	    }
-	    else if(cfgSelection == cfgSerialComm){
-            srcList <<"CommPort" <<"DataRate"<<"Parity"<<"DataBits"<<"StopBits"<<"SendDelay"<<"Handshake";
-	    }
-	    else{
-	    srcList <<"IAPName"<<"LocalPort"<<"RemoteHost"<<"RemotePort"<<"ConnectTimeout";
-	    }
-	    
-	    selection = HbListDialog::getStringItems("Select a parameter name in" + cfgSelection, srcList, 0, &ok, HbAbstractItemView::SingleSelection);
-	}
-    
-    if(ok){
-        name = selection[0];
-        value = HbInputDialog::getText("Value for paramater " + name, "", &ok);
-    }
-    
-    if(ok){
-       if(cfgSelection == cfgHti){
-            mEngineWrapper.setHtiCfgParam(name, value);
-        }
-        else if(cfgSelection == cfgBtComm){
-            mEngineWrapper.setBtCfgParam(name, value);
-        }
-        else if(cfgSelection == cfgSerialComm){
-            mEngineWrapper.setSerialCfgParam(name, value);
-        }
-        else{
-            mEngineWrapper.setIPCfgParam(name, value);
-        }   
-    }
+//	QStringList srcList;
+//	QStringList selection;
+//	QString value;
+//	QString name;
+//	QString cfgSelection;
+//	QString paramSelection;
+//	QString cfgHti = "Hti.cfg";
+//	QString cfgBtComm ="HtiBtComm.cfg";
+//	QString cfgSerialComm = "HtiSerialComm.cfg";
+//	QString cfgIPComm = "HtiIPComm.cfg";
+//	 
+//	srcList <<cfgHti <<cfgBtComm <<cfgSerialComm << cfgIPComm;
+//	
+//	bool ok = false;
+//	selection = HbListDialog::getStringItems("Select cfg file to modify", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+//	
+//	if(ok){
+//        cfgSelection = selection[0];
+//        srcList.clear();
+//	    if(cfgSelection == cfgHti){
+//	    srcList <<"CommPlugin" <<"MaxMsgSize" <<"MaxQueueSize" <<"MaxHeapSize"<<"Priority"
+//	            <<"ShowConsole"<<"MaxWaitTime"<<"StartUpDelay"<<"EnableHtiWatchDog"
+//	            <<"EnableHtiAutoStart"<<"ShowErrorDialogs"<<"ReconnectDelay";
+//	    }
+//	    else if(cfgSelection == cfgBtComm){
+//	        srcList <<"BtDeviceName" <<"BtDeviceName";
+//	    }
+//	    else if(cfgSelection == cfgSerialComm){
+//            srcList <<"CommPort" <<"DataRate"<<"Parity"<<"DataBits"<<"StopBits"<<"SendDelay"<<"Handshake";
+//	    }
+//	    else{
+//	    srcList <<"IAPName"<<"LocalPort"<<"RemoteHost"<<"RemotePort"<<"ConnectTimeout";
+//	    }
+//	    
+//	    selection = HbListDialog::getStringItems("Select a parameter name in" + cfgSelection, srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+//	}
+//    
+//    if(ok){
+//        name = selection[0];
+//        value = HbInputDialog::getText("Value for paramater " + name, "", &ok);
+//    }
+//    
+//    if(ok){
+//       if(cfgSelection == cfgHti){
+//            mEngineWrapper.setHtiCfgParam(name, value);
+//        }
+//        else if(cfgSelection == cfgBtComm){
+//            mEngineWrapper.setBtCfgParam(name, value);
+//        }
+//        else if(cfgSelection == cfgSerialComm){
+//            mEngineWrapper.setSerialCfgParam(name, value);
+//        }
+//        else{
+//            mEngineWrapper.setIPCfgParam(name, value);
+//        }   
+//    }
 }
 
 
--- a/htiui/HtiDeviceReboot/group/HtiDeviceReboot.mmp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiDeviceReboot/group/HtiDeviceReboot.mmp	Fri May 14 15:53:02 2010 +0300
@@ -20,7 +20,7 @@
 TARGET          HtiDeviceRebootUI.exe
 TARGETTYPE      EXE
 
-UID             0x200212D6
+UID             0x1000008d 0x200212D6
 
 VENDORID        0x101FB657
 
--- a/htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp	Fri May 14 15:53:02 2010 +0300
@@ -35,7 +35,7 @@
 
 // LOCAL FUNCTION PROTOTYPES
 LOCAL_C TInt StartL();
-LOCAL_C TInt Reboot();
+LOCAL_C TInt Reboot(RStarterSession::TResetReason aReason);
 LOCAL_C TInt RestoreFactorySettings( TBool aIsDeepRfs );
 
 
@@ -54,12 +54,15 @@
 
     if ( cmdLen == 0 )
         {
-        error = Reboot();
+        error = Reboot(RStarterSession::EUnknownReset);
         }
 
     else
         {
         TLex parser( *cmdLine );
+        TInt input;
+        TInt ret = parser.Val(input);
+        
         parser.SkipCharacters();
         if ( parser.MarkedToken().CompareF( KParamNormalRfs ) == 0 )
             {
@@ -71,7 +74,14 @@
             }
         else
             {
-            error = KErrArgument;  // Unknown argument
+            if(ret != KErrNone )
+                {
+                error = KErrArgument;  // Unknown argument
+                }
+            else
+                {
+                error = Reboot((RStarterSession::TResetReason)input);
+                }
             }
         }
 
@@ -79,13 +89,13 @@
     return error;
     }
 
-LOCAL_C TInt Reboot()
+LOCAL_C TInt Reboot(RStarterSession::TResetReason aReason)
     {
     RStarterSession session;
     TInt error = session.Connect();
     if ( error == KErrNone )
         {
-        session.Reset( RStarterSession::EUnknownReset );
+        session.Reset( aReason );
         session.Close();
         }
     return error;
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Fri May 14 15:53:02 2010 +0300
@@ -35,7 +35,7 @@
 #include <swi/sisregistrysession.h>
 #include <swi/sisregistrypackage.h>
 #include <javaregistryincludes.h>
-#include <WidgetRegistryClient.h>
+#include <widgetregistryclient.h>
 
 using namespace Java;
 
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/group/HtiMessagesServicePlugin.mmp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/group/HtiMessagesServicePlugin.mmp	Fri May 14 15:53:02 2010 +0300
@@ -54,7 +54,6 @@
 LIBRARY         euser.lib
 LIBRARY         gsmu.lib
 LIBRARY         imcm.lib
-LIBRARY         mmscli.lib
 LIBRARY         msgs.lib
 LIBRARY         smcm.lib
 LIBRARY         etel.lib
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMailboxHandler.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMailboxHandler.cpp	Fri May 14 15:53:02 2010 +0300
@@ -584,9 +584,48 @@
 void CHtiMailboxHandler::HandleDeleteMailboxL( const TDesC8& aData )
     {
     HTI_LOG_FUNC_IN( "CHtiMailboxHandler::HandleDeleteMailboxL" );
-    // Deprecated
-    aData.Size();
-    User::Leave( KErrNotSupported );
+
+    // Delete by name - name should be unique
+    TInt nameLength = aData[0];
+    if ( nameLength > KEmailAccountNameSize || nameLength == 0 ||
+         aData.Length() != ( nameLength + 1 ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    TBuf<KEmailAccountNameSize> accountName;
+    accountName.Copy( aData.Mid( 1, nameLength ) );
+    HTI_LOG_FORMAT( "Searching account with name: %S", &accountName );
+
+    TSmtpAccount smtpAcc;
+    User::LeaveIfError( FindSmtpAccount( accountName, smtpAcc ) );
+    HTI_LOG_FORMAT( "Found SMTP: %d", smtpAcc.iSmtpAccountId );
+    TMsvId relatedAcc = smtpAcc.iRelatedService;
+
+    CEmailAccounts* accounts = CEmailAccounts::NewLC();
+
+    // Delete the SMTP account
+    accounts->DeleteSmtpAccountL( smtpAcc );
+
+    // Search for related POP & IMAP acconts and delete if found
+    TInt result = KErrNone;
+    TPopAccount popAcc;
+    TRAP( result, accounts->GetPopAccountL( relatedAcc, popAcc ) );
+    if ( result == KErrNone )
+        {
+        HTI_LOG_FORMAT( "Found related POP: %d", popAcc.iPopAccountId );
+        accounts->DeletePopAccountL( popAcc );
+        }
+
+    TImapAccount imapAcc;
+    TRAP( result, accounts->GetImapAccountL( relatedAcc, imapAcc ) );
+    if ( result == KErrNone )
+        {
+        HTI_LOG_FORMAT( "Found related IMAP: %d", imapAcc.iImapAccountId );
+        accounts->DeleteImapAccountL( imapAcc );
+        }
+
+    CleanupStack::PopAndDestroy( 1 ); // accounts
     HTI_LOG_FUNC_OUT( "CHtiMailboxHandler::HandleDeleteMailboxL" );
     }
 
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/group/HtiPIMServicePlugin.mmp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/group/HtiPIMServicePlugin.mmp	Fri May 14 15:53:02 2010 +0300
@@ -32,8 +32,8 @@
 SOURCE          proxy.cpp
 SOURCE          HtiPIMServicePlugin.cpp
 SOURCE          PIMHandler.cpp
-SOURCE          HtiBookmarkHandler.cpp
-SOURCE          HtiSimDirHandlerVPbk.cpp
+SOURCE          HtiBookmarkHandler.cpp 
+SOURCE          HtiSimDirHandler.cpp
 
 USERINCLUDE     ../inc
 APP_LAYER_SYSTEMINCLUDE
@@ -44,7 +44,6 @@
 
 LIBRARY         cmmanager.lib
 LIBRARY         apgrfx.lib
-LIBRARY         calenimp.lib
 LIBRARY         calinterimapi.lib
 LIBRARY         charconv.lib
 LIBRARY         ecom.lib
@@ -52,10 +51,10 @@
 LIBRARY         euser.lib
 LIBRARY         favouritesengine.lib
 LIBRARY         ws32.lib
-LIBRARY         vpbkeng.lib
-LIBRARY         vpbkvcardeng.lib
 LIBRARY         flogger.lib
-
+LIBRARY         cntmodel.lib
+LIBRARY			etelmm.lib
+LIBRARY			etel.lib 
 SMPSAFE
 
 // End of file
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -14,7 +14,7 @@
 * Description:  Build information file for HtiPIMServicePlugin
 *
 */
-
+#include "../../../symbian_version.hrh"
 
 PRJ_PLATFORMS
 
@@ -22,6 +22,7 @@
 
 PRJ_MMPFILES
 HtiPIMServicePlugin.mmp
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 HtiNpdHlp.mmp
-
+#endif
 // End of file
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiBookmarkHandler.h	Fri May 14 15:53:02 2010 +0300
@@ -21,9 +21,9 @@
 
 // INCLUDES
 #include <e32std.h>
-#include <FavouritesLimits.h>
-#include <FavouritesSession.h>
-#include <HTIServicePluginInterface.h>
+#include <favouriteslimits.h>
+#include <favouritessession.h>
+#include <HtiServicePluginInterface.h>
 
 // CONSTANTS
 const TInt KApMaxConnNameLength = 30;
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiPIMServicePlugin.h	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiPIMServicePlugin.h	Fri May 14 15:53:02 2010 +0300
@@ -21,7 +21,7 @@
 #define CHTIPIMSERVICEPLUGIN_H
 
 // INCLUDES
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
 #include <w32std.h>
 
 // CONSTANTS
@@ -31,8 +31,7 @@
 // FORWARD DECLARATIONS
 class CPIMHandler;
 class CHtiBookmarkHandler;
-class CHtiSimDirHandlerVPbk;
-
+class CHtiSimDirHandler;
 // CLASS DECLARATION
 
 /**
@@ -54,6 +53,9 @@
             ENotepadAddMemoFromFile = 0x06,
             ENotepadDeleteAll       = 0x07,
 
+            EOpenCalendarFile       = 0x08,
+            EListCalendarFiles      = 0x09,
+            
             ESimCardInfo            = 0x10,
             EImportSimContact       = 0x11,
             EDeleteSimContact       = 0x12,
@@ -99,7 +101,7 @@
 
         CPIMHandler* iPimHandler;
         CHtiBookmarkHandler* iBookmarkHandler;
-        CHtiSimDirHandlerVPbk* iSimDirHandler;
+        CHtiSimDirHandler* iSimDirHandler;
         };
 
 #endif // CHTIPIMSERVICEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiSimDirHandler.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class that handles SIM card contacts creation and deletion
+*                using the new Virtual Phonebook API
+*
+*/
+
+
+#ifndef HTISIMDIRHANDLER_H
+#define HTISIMDIRHANDLER_H
+
+
+// INCLUDES
+
+#include <HtiServicePluginInterface.h>
+#include <etelmm.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  Class that handles SIM card contacts creation and deletion using the
+*  new Virtual Phonebook API.
+*/
+class CHtiSimDirHandler : public CBase
+    {
+    public:
+
+    enum TContactFieldType
+        {
+        ENameField        = 0x01,
+        ESecondNameField  = 0x02,
+        EPhoneNumberField = 0x03,
+        EEMailField       = 0x04,
+        EAdditNumberField = 0x05
+        };
+
+    public:
+
+        /**
+        * Two-phased constructor.
+        */
+        static CHtiSimDirHandler* NewL();
+
+        /**
+        * Called when there is a message to be processed by this service.
+        * @param aMessage message body destinated to the servive
+        * @param aPriority message priority
+        */
+        void ProcessMessageL( const TDesC8& aMessage,
+            THtiMessagePriority aPriority );
+
+        /**
+        * Indicates whether this handler is ready to receive
+        * a new message or if it's busy processing previous message.
+        * @return ETrue if processing, EFalse if ready for new request
+        */
+        TBool IsBusy();
+
+        /**
+        * Destructor.
+        */
+        virtual ~CHtiSimDirHandler();
+
+        /**
+        * Sets the dispatcher to send outgoing messages to.
+        * @param aDispatcher pointer to dispatcher instance
+        */
+        void SetDispatcher( MHtiDispatcher* aDispatcher );
+
+    private: // constructors
+
+        /**
+        * C++ default constructor.
+        */
+        CHtiSimDirHandler();
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: // helpers
+
+        void HandleSimCardInfoL(const TDesC8& aData);
+        void HandleSimContactImportL(const TDesC8& aData);
+        void HandleSimContactDeleteL(const TDesC8& aData);
+
+        TBool CheckImportMsg(const TDesC8& aData);
+
+        void SendOkMsgL( const TDesC8& aData );
+        void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
+
+    private: // data
+
+        // Pointer to the dispatcher (referenced)
+        MHtiDispatcher* iDispatcher;
+
+        // Flag indicating if service is busy processing a request
+        TBool iIsBusy;
+        
+        RTelServer iEtelServer;
+        RMobilePhone iEtelPhone;
+        RMobilePhoneBookStore iEtelStore;
+
+        TBool iStoreIsOpen;
+    };
+
+#endif // HTISIMDIRHANDLER_H
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/HtiSimDirHandlerVPbk.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Class that handles SIM card contacts creation and deletion
-*                using the new Virtual Phonebook API
-*
-*/
-
-
-#ifndef HTISIMDIRHANDLERVPBK_H
-#define HTISIMDIRHANDLERVPBK_H
-
-
-// INCLUDES
-#include <MVPbkContactObserver.h>
-#include <MVPbkContactStoreObserver.h>
-#include <MVPbkContactViewObserver.h>
-#include <MVPbkBatchOperationObserver.h>
-//#include <MVPbkContactStoreListObserver.h>
-#include <HTIServicePluginInterface.h>
-
-// CONSTANTS
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-class CVPbkContactManager;
-class MVPbkContactStore;
-class MVPbkContactView;
-
-// CLASS DECLARATION
-
-/**
-*  Class that handles SIM card contacts creation and deletion using the
-*  new Virtual Phonebook API.
-*/
-class CHtiSimDirHandlerVPbk : public CBase,
-//                              public MVPbkContactStoreListObserver,
-                              public MVPbkContactStoreObserver,
-                              public MVPbkContactObserver,
-                              public MVPbkContactViewObserver,
-                              public MVPbkBatchOperationObserver
-    {
-    public:
-
-    enum TContactFieldType
-        {
-        ENameField        = 0x01,
-        ESecondNameField  = 0x02,
-        EPhoneNumberField = 0x03,
-        EEMailField       = 0x04,
-        EAdditNumberField = 0x05
-        };
-
-    public:
-
-        /**
-        * Two-phased constructor.
-        */
-        static CHtiSimDirHandlerVPbk* NewL();
-
-        /**
-        * Called when there is a message to be processed by this service.
-        * @param aMessage message body destinated to the servive
-        * @param aPriority message priority
-        */
-        void ProcessMessageL( const TDesC8& aMessage,
-            THtiMessagePriority aPriority );
-
-        /**
-        * Indicates whether this handler is ready to receive
-        * a new message or if it's busy processing previous message.
-        * @return ETrue if processing, EFalse if ready for new request
-        */
-        TBool IsBusy();
-
-        /**
-        * Destructor.
-        */
-        virtual ~CHtiSimDirHandlerVPbk();
-
-        /**
-        * Sets the dispatcher to send outgoing messages to.
-        * @param aDispatcher pointer to dispatcher instance
-        */
-        void SetDispatcher( MHtiDispatcher* aDispatcher );
-
-    public: // Functions from base classes
-
-        // From MVPbkContactStoreListObserver
-
-        /**
-         * Called when the opening process is complete, ie. all stores
-         * have been reported either failed or successful open.
-         */
-        //void OpenComplete();
-
-        // From MVPbkContactStoreObserver
-
-        /**
-         * Called when a contact store is ready to use.
-         */
-        void StoreReady( MVPbkContactStore& aContactStore );
-
-        /**
-         * Called when a contact store becomes unavailable.
-         * @param aContactStore The store that became unavailable.
-         * @param aReason The reason why the store is unavailable.
-         *                This is one of the system wide error codes.
-         */
-        void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
-
-        /**
-         * Called when changes occur in the contact store.
-         * @param aContactStore The store the event occurred in.
-         * @param aStoreEvent   Event that has occured.
-         */
-        void HandleStoreEventL( MVPbkContactStore& aContactStore,
-                                TVPbkContactStoreEvent aStoreEvent);
-
-        // From MVPbkContactObserver
-
-        /**
-         * Called when a contact operation has succesfully completed.
-         */
-        void ContactOperationCompleted( TContactOpResult aResult );
-
-        /**
-         * Called when a contact operation has failed.
-         */
-        void ContactOperationFailed( TContactOp aOpCode, TInt aErrorCode,
-                TBool aErrorNotified );
-
-        // From MVPbkContactViewObserver
-
-        /**
-         * Called when a view is ready for use.
-         */
-        void ContactViewReady( MVPbkContactViewBase& aView );
-
-        /**
-         * Called when a view is unavailable for a while.
-         */
-        void ContactViewUnavailable( MVPbkContactViewBase& aView );
-
-        /**
-         * Called when a contact has been added to the view.
-         */
-        void ContactAddedToView( MVPbkContactViewBase& aView,
-                                 TInt aIndex,
-                                 const MVPbkContactLink& aContactLink );
-
-        /**
-         * Called when a contact has been removed from a view.
-         */
-        void ContactRemovedFromView( MVPbkContactViewBase& aView,
-                                     TInt aIndex,
-                                     const MVPbkContactLink& aContactLink );
-
-        /**
-         * Called when an error occurs in the view.
-         */
-        void ContactViewError( MVPbkContactViewBase& aView,
-                               TInt aError,
-                               TBool aErrorNotified );
-
-        // From MVPbkBatchOperationObserver
-
-        /**
-         * Called when one step of the operation is complete
-         */
-        void StepComplete( MVPbkContactOperationBase& aOperation,
-                           TInt aStepSize );
-
-        /**
-         * Called when one step of the operation fails
-         */
-        TBool StepFailed( MVPbkContactOperationBase& aOperation,
-                          TInt aStepSize, TInt aError );
-
-        /**
-         * Called when operation is completed
-         */
-        void OperationComplete( MVPbkContactOperationBase& aOperation );
-
-
-    private: // constructors
-
-        /**
-        * C++ default constructor.
-        */
-        CHtiSimDirHandlerVPbk();
-
-        /**
-        * 2nd phase constructor.
-        */
-        void ConstructL();
-
-    private: // helpers
-
-        void HandleSimCardInfoL();
-        void HandleSimContactImportL();
-        void HandleSimContactDeleteL();
-
-        void DeleteContactsInViewL();
-        TBool CheckImportMsg();
-
-        void SendOkMsgL( const TDesC8& aData );
-        void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
-
-    private: // data
-
-        // Pointer to the dispatcher (referenced)
-        MHtiDispatcher* iDispatcher;
-
-        // The contact manager
-        CVPbkContactManager* iContactManager;
-
-        // The SIM contact store (referenced)
-        MVPbkContactStore* iSimStore;
-
-        // The contact view
-        MVPbkContactViewBase* iContactView;
-
-        // The current/latest contact operation
-        MVPbkContactOperationBase* iCurrentOperation;
-
-        // The latest received command message without the command code
-        HBufC8* iMessage;
-
-        // The command code of the latest/current command
-        TUint8 iCommand;
-
-        // Flag indicating if service is busy processing a request
-        TBool iIsBusy;
-
-        TBool iIsStoreOpen;
-
-    };
-
-#endif // HTISIMDIRHANDLERVPBK_H
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/PIMHandler.h	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/inc/PIMHandler.h	Fri May 14 15:53:02 2010 +0300
@@ -22,20 +22,13 @@
 // INCLUDES
 #include <e32base.h>
 #include <s32mem.h>
-#include <HTIServicePluginInterface.h>
-#include <MVPbkBatchOperationObserver.h>
-#include <MVPbkContactCopyObserver.h>
-#include <MVPbkContactStoreObserver.h>
-#include <MVPbkContactViewObserver.h>
+#include <HtiServicePluginInterface.h>
 #include <calprogresscallback.h>
 
 // CONSTANTS
 
 // FORWARD DECLARATIONS
-class CVPbkContactManager;
-class CVPbkVCardEng;
 class CCalSession;
-class CCalEntryView;
 
 // CLASS DECLARATION
 
@@ -43,10 +36,6 @@
 *  Functional implentation of PIM service.
 */
 class CPIMHandler : public CBase,
-                    public MVPbkContactStoreObserver,
-                    public MVPbkContactCopyObserver,
-                    public MVPbkContactViewObserver,
-                    public MVPbkBatchOperationObserver,
                     public MCalProgressCallBack
     {
     public:
@@ -62,104 +51,7 @@
         virtual ~CPIMHandler();
 
         void SetDispatcher( MHtiDispatcher* aDispatcher );
-
-
-        // From MVPbkContactStoreObserver
-
-        /**
-         * Called when a contact store is ready to use.
-         */
-        void StoreReady( MVPbkContactStore& aContactStore );
-
-        /**
-         * Called when a contact store becomes unavailable.
-         * @param aContactStore The store that became unavailable.
-         * @param aReason The reason why the store is unavailable.
-         *                This is one of the system wide error codes.
-         */
-        void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason );
-
-        /**
-         * Called when changes occur in the contact store.
-         * @param aContactStore The store the event occurred in.
-         * @param aStoreEvent   Event that has occured.
-         */
-        void HandleStoreEventL( MVPbkContactStore& aContactStore,
-                                TVPbkContactStoreEvent aStoreEvent);
-
-        // From MVPbkContactCopyObserver
-
-        /**
-         * Called when the contact has been successfully commited or
-         * copied. Caller takes the ownership of results.
-         * @param aOperation    The operation that this observer monitors.
-         * @param aResults  An array of links to copied contacts.
-         *                  Caller takes the ownership of the
-         *                  object immediately.
-         */
-        void ContactsSaved( MVPbkContactOperationBase& aOperation,
-            MVPbkContactLinkArray* aResults );
-
-        /**
-         * Called when there was en error while saving contact(s).
-         * @param aOperation    The operation that this observer monitors.
-         * @param aError an error that occured.
-         */
-        void ContactsSavingFailed(
-                MVPbkContactOperationBase& aOperation, TInt aError );
-
-        // From MVPbkContactViewObserver
-
-        /**
-         * Called when a view is ready for use.
-         */
-        void ContactViewReady( MVPbkContactViewBase& aView );
-
-        /**
-         * Called when a view is unavailable for a while.
-         */
-        void ContactViewUnavailable( MVPbkContactViewBase& aView );
-
-        /**
-         * Called when a contact has been added to the view.
-         */
-        void ContactAddedToView( MVPbkContactViewBase& aView,
-                                 TInt aIndex,
-                                 const MVPbkContactLink& aContactLink );
-
-        /**
-         * Called when a contact has been removed from a view.
-         */
-        void ContactRemovedFromView( MVPbkContactViewBase& aView,
-                                     TInt aIndex,
-                                     const MVPbkContactLink& aContactLink );
-
-        /**
-         * Called when an error occurs in the view.
-         */
-        void ContactViewError( MVPbkContactViewBase& aView,
-                               TInt aError,
-                               TBool aErrorNotified );
-
-        // From MVPbkBatchOperationObserver
-
-        /**
-         * Called when one step of the operation is complete
-         */
-        void StepComplete( MVPbkContactOperationBase& aOperation,
-                           TInt aStepSize );
-
-        /**
-         * Called when one step of the operation fails
-         */
-        TBool StepFailed( MVPbkContactOperationBase& aOperation,
-                          TInt aStepSize, TInt aError );
-
-        /**
-         * Called when operation is completed
-         */
-        void OperationComplete( MVPbkContactOperationBase& aOperation );
-
+      
 
         // From MCalProgressCallBack
 
@@ -178,31 +70,22 @@
         void HandleVCalendarImportFuncL( const TDesC8& aData );
         void HandleContactDeleteFuncL( const TDesC8& aData );
         void HandleCalendarDeleteFuncL( const TDesC8& aData );
+        void HandleOpenCalendarFileL( const TDesC8& aData );
+        void HandleListCalendarFilesL();
         void HandleNotepadAddMemoFuncL( const TDesC8& aData );
         void HandleNotepadAddMemoFromFileFuncL( const TDesC8& aData );
         void HandleNotepadDeleteAllFuncL();
-        void CreateContactDeleteViewL();
-        void DeleteContactsInViewL();
-
+        
         void SendOkMsgL( const TDesC8& aData );
         void SendNotepadOkMsgL( CHtiPIMServicePlugin::TCommand aCommand );
         void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
 
     private: // data
-        TUint8                iCommand;
         TBool                 iIsBusy;
-        CBufFlat*             iBuffer;
-        RBufReadStream        iReadStream;
-        CCalSession*          iCalSession;
-        CCalEntryView*        iEntryView;
-        CVPbkContactManager*  iContactManager;
-        CVPbkVCardEng*        iVCardEngine;
-        MVPbkContactStore*    iContactStore;
-        MVPbkContactOperationBase* iOp;
-        MVPbkContactViewBase* iContactView;
         MHtiDispatcher*       iDispatcher; // referenced
         CActiveSchedulerWait* iWaiter;
         TInt                  iEntryViewErr;
+        CCalSession*          iCalSession;
     };
 
 #endif // CPIMHANDLER_H
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiBookmarkHandler.cpp	Fri May 14 15:53:02 2010 +0300
@@ -25,8 +25,8 @@
 #include <cmdestination.h>
 #include <cmmanager.h>
 
-#include <FavouritesItem.h>
-#include <FavouritesItemList.h>
+#include <favouritesitem.h>
+#include <favouritesitemlist.h>
 #include <FavouritesDb.h>
 #include <FavouritesFile.h>
 #include <FavouritesWapAp.h>
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiPIMServicePlugin.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiPIMServicePlugin.cpp	Fri May 14 15:53:02 2010 +0300
@@ -20,13 +20,12 @@
 #include "HtiPIMServicePlugin.h"
 #include "PIMHandler.h"
 #include "HtiBookmarkHandler.h"
-#include "HtiSimDirHandlerVPbk.h"
-
+#include "HtiSimDirHandler.h"
 #include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
 
 // CONSTANTS
-_LIT8( KErrorMissingCommand, "Command was not given - message was empty" );
+_LIT8( KErrorMissingCommand, "Missing command" );
 
 // ----------------------------------------------------------------------------
 // Create instance of concrete ECOM interface implementation
@@ -87,7 +86,7 @@
         {
         if ( iSimDirHandler == NULL )
             {
-            iSimDirHandler = CHtiSimDirHandlerVPbk::NewL();
+            iSimDirHandler = CHtiSimDirHandler::NewL();
             iSimDirHandler->SetDispatcher( iDispatcher );
             }
         iSimDirHandler->ProcessMessageL( aMessage, aPriority );
@@ -111,18 +110,17 @@
     {
     if ( iPimHandler )
         {
-        if ( iPimHandler->IsBusy() )
-            return ETrue;
+        return iPimHandler->IsBusy();
         }
-    if ( iSimDirHandler )
-        {
-        if ( iSimDirHandler->IsBusy() )
-            return ETrue;
-        }
+
     if ( iBookmarkHandler )
         {
-        if ( iBookmarkHandler->IsBusy() )
-            return ETrue;
+        return iBookmarkHandler->IsBusy();
+        }
+    
+    if( iSimDirHandler)
+        {
+        return iSimDirHandler->IsBusy();
         }
     return EFalse;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandler.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,530 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Implementation of SIM card contacts handling using the new
+ *                Virtual Phonebook API
+ *
+ */
+
+// INCLUDE FILES
+#include "HtiSimDirHandler.h"
+#include "HtiPIMServicePlugin.h"
+
+#include <HtiDispatcherInterface.h>
+#include <HtiLogging.h>
+
+#include <mmtsy_names.h>
+#include <mpbutil.h> 
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+const TInt KSimInfoResponseLength = 12;
+const TInt KOneSimContactBufferSize = 512;
+// MACROS
+// LOCAL CONSTANTS AND MACROS
+_LIT8( KErrorUnrecognizedCommand, "Unrecognized command" );
+_LIT8( KErrorInvalidParameters, "Invalid command parameters" );
+_LIT8( KErrorImportFailed, "Contact import failed" );
+_LIT8( KErrorDeleteFailed, "Failed to delete contact" );
+_LIT8( KErrorSimCardInfoFailed, "Failed to get SIM card info" );
+_LIT8( KErrorFieldNotSupported, "Field is not supported");
+_LIT8( KErrorFieldTooBig, "Filed is too long");
+//_LIT8( KErrorSimStoreOpenFailed, "Failed to open SIM contact store" );
+//_LIT8( KErrorSimStoreUnavailable, "SIM contact store unavailable" );
+//_LIT8( KErrorContactOperationFailed, "SIM contact operation failed" );
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+CHtiSimDirHandler* CHtiSimDirHandler::NewL()
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::NewL" );
+    CHtiSimDirHandler* self = new (ELeave) CHtiSimDirHandler();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::NewL" );
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::CHtiSimDirHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// ----------------------------------------------------------------------------
+CHtiSimDirHandler::CHtiSimDirHandler() :
+    iIsBusy(EFalse), iStoreIsOpen(EFalse)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::CHtiSimDirHandler" );
+
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::CHtiSimDirHandler" );
+    }
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::~CHtiSimDirHandler
+// Destructor.
+// -----------------------------------------------------------------------------
+CHtiSimDirHandler::~CHtiSimDirHandler()
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::~CHtiSimDirHandler" );
+    iEtelStore.Close();
+    iEtelPhone.Close();
+    iEtelServer.Close();
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::~CHtiSimDirHandler" );
+    }
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+void CHtiSimDirHandler::ConstructL()
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::ConstructL" );
+
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::ConstructL" );
+    }
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::SetDispatcher
+// Sets the dispatcher pointer.
+// -----------------------------------------------------------------------------
+
+void CHtiSimDirHandler::SetDispatcher(MHtiDispatcher* aDispatcher)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::SetDispatcher" );
+    iDispatcher = aDispatcher;
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::SetDispatcher" );
+    }
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::ProcessMessageL
+// Parses the received message and calls handler functions.
+// -----------------------------------------------------------------------------
+void CHtiSimDirHandler::ProcessMessageL(const TDesC8& aMessage,
+        THtiMessagePriority /*aPriority*/)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::ProcessMessageL" );
+
+    if (iStoreIsOpen == EFalse)
+        {
+        User::LeaveIfError(iEtelServer.Connect());
+        User::LeaveIfError(iEtelServer.LoadPhoneModule(KMmTsyModuleName));
+        User::LeaveIfError(iEtelPhone.Open(iEtelServer, KMmTsyPhoneName));
+        User::LeaveIfError(iEtelStore.Open(iEtelPhone, KETelIccAdnPhoneBook));
+        HTI_LOG_TEXT( "SIM card open" );
+        iStoreIsOpen = ETrue;
+        }
+
+    if (iIsBusy)
+        {
+        HTI_LOG_TEXT( "HtiSimDirHandler is busy - leaving" );
+        User::Leave(KErrInUse);
+        }
+
+    // Will be set to EFalse in the SendOkMsgL or SendErrorMessageL methods.
+    iIsBusy = ETrue;
+
+    // Zero legth of aMessage tested already in CHtiPIMServicePlugin.
+    // Other sanity checks must be done here.
+    TInt err = KErrNone;
+    TUint8 command = aMessage.Ptr()[0];
+    switch (command)
+        {
+        case CHtiPIMServicePlugin::ESimCardInfo:
+            {
+            TRAP(err ,HandleSimCardInfoL(aMessage.Right(aMessage.Length() - 1)));
+            break;
+            }
+        case CHtiPIMServicePlugin::EImportSimContact:
+            {
+            TRAP(err ,HandleSimContactImportL(aMessage.Right(aMessage.Length() - 1)));
+            break;
+            }
+        case CHtiPIMServicePlugin::EDeleteSimContact:
+            {
+            TRAP(err ,HandleSimContactDeleteL(aMessage.Right(aMessage.Length() - 1)));
+            break;
+            }
+        default:
+            {
+            SendErrorMessageL(KErrArgument, KErrorUnrecognizedCommand);
+            return;
+            }
+        }
+
+    if (err != KErrNone)
+        {
+        iIsBusy = EFalse;
+        User::Leave(err);
+        } 
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::ProcessMessageL" );
+    }
+
+// -----------------------------------------------------------------------------
+// CHtiSimDirHandler::IsBusy
+// -----------------------------------------------------------------------------
+//
+TBool CHtiSimDirHandler::IsBusy()
+    {
+    return iIsBusy;
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::HandleSimCardInfoL
+// Gets information about the SIM card.
+// ----------------------------------------------------------------------------
+void CHtiSimDirHandler::HandleSimCardInfoL(const TDesC8& aData)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::HandleSimCardInfoL" );
+    if (aData.Length() != 0)
+        {
+        HTI_LOG_TEXT( "CHtiSimDirHandler: wrong length of data" );
+        SendErrorMessageL(KErrArgument, KErrorInvalidParameters);
+        return;
+        }
+
+    RMobilePhoneBookStore::TMobilePhoneBookInfoV5 etelStoreInfo;
+    RMobilePhoneBookStore::TMobilePhoneBookInfoV5Pckg etelStoreInfoPckg(etelStoreInfo);
+    
+    TRequestStatus requestStatus;
+    iEtelStore.GetInfo(requestStatus, (TDes8&) etelStoreInfoPckg);
+    User::WaitForRequest(requestStatus);
+    if (requestStatus.Int() != KErrNone)
+        {
+        HTI_LOG_TEXT( "CHtiSimDirHandler: Failed to get SIM card info" );
+        SendErrorMessageL(requestStatus.Int(), KErrorSimCardInfoFailed);
+        return;
+        }
+
+    // Create and send response message
+    TBuf8<KSimInfoResponseLength> reply;
+    reply.Append(etelStoreInfo.iMaxSecondNames > 0 ? etelStoreInfo.iMaxSecondNames : 0);
+    reply.Append(etelStoreInfo.iMaxAdditionalNumbers > 0 ? etelStoreInfo.iMaxAdditionalNumbers : 0);
+    reply.Append(etelStoreInfo.iMaxEmailAddr > 0 ? etelStoreInfo.iMaxEmailAddr : 0);
+    reply.Append(etelStoreInfo.iMaxTextLength > 0 ? etelStoreInfo.iMaxTextLength : 0);
+    reply.Append(etelStoreInfo.iMaxNumLength > 0 ? etelStoreInfo.iMaxNumLength : 0);
+    reply.Append(etelStoreInfo.iMaxTextLengthSecondName > 0 ? 
+        etelStoreInfo.iMaxTextLengthSecondName : 0);
+    reply.Append(etelStoreInfo.iMaxNumLengthAdditionalNumber > 0?
+        etelStoreInfo.iMaxNumLengthAdditionalNumber : 0);
+    reply.Append(etelStoreInfo.iMaxTextLengthEmailAddr > 0 ? etelStoreInfo.iMaxTextLengthEmailAddr : 0);
+    reply.Append( ( TUint8* ) ( &etelStoreInfo.iTotalEntries ), 2 );
+    reply.Append( ( TUint8* ) ( &etelStoreInfo.iUsedEntries ), 2 );
+    SendOkMsgL(reply);
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::HandleSimCardInfoL" );
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::HandleSimContactImportL
+// Imports the contact to SIM card.
+// ----------------------------------------------------------------------------
+void CHtiSimDirHandler::HandleSimContactImportL(const TDesC8& aData)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::HandleSimContactImportL" );
+    
+    if(CheckImportMsg(aData) == EFalse)
+        {
+        return;
+        }
+    
+    RBuf8 buffer;
+    buffer.CreateL(KOneSimContactBufferSize);
+    CleanupClosePushL(buffer);
+    CPhoneBookBuffer* pbBuffer = new (ELeave) CPhoneBookBuffer();
+    CleanupStack::PushL(pbBuffer);
+    pbBuffer->Set(&buffer);
+
+    //add new enty tag
+    User::LeaveIfError(pbBuffer->AddNewEntryTag());
+
+    TInt offset = 0;
+    TInt fieldCount = aData[offset];
+    offset++;
+
+    for (TInt i = 0; i < fieldCount; i++)
+        {
+        HTI_LOG_FORMAT( "Processing field %d", i + 1 );
+
+        TContactFieldType type = (TContactFieldType) aData[offset];
+        offset++;
+        TInt fieldLength = aData[offset];
+        offset++;
+        HBufC* fieldData = HBufC::NewLC(fieldLength);
+        fieldData->Des().Copy(aData.Mid(offset, fieldLength));
+        switch (type)
+            {
+            case ENameField:
+                User::LeaveIfError(pbBuffer->PutTagAndValue(
+                        RMobilePhoneBookStore::ETagPBText, fieldData->Des()));
+                break;
+            case ESecondNameField:
+                User::LeaveIfError(pbBuffer->PutTagAndValue(
+                        RMobilePhoneBookStore::ETagPBSecondName,
+                        fieldData->Des()));
+                break;
+            case EPhoneNumberField:
+                User::LeaveIfError(
+                        pbBuffer->PutTagAndValue(
+                                RMobilePhoneBookStore::ETagPBNumber,
+                                fieldData->Des()));
+                break;
+            case EEMailField:
+                User::LeaveIfError(pbBuffer->PutTagAndValue(
+                        RMobilePhoneBookStore::ETagPBEmailAddress,
+                        fieldData->Des()));
+                break;
+            case EAdditNumberField:
+                User::LeaveIfError(pbBuffer->AddNewNumberTag());
+                User::LeaveIfError(
+                        pbBuffer->PutTagAndValue(
+                                RMobilePhoneBookStore::ETagPBNumber,
+                                fieldData->Des()));
+                break;
+            default:
+                HTI_LOG_FORMAT( "Unknown field type %d", type );
+                User::Leave(KErrArgument);
+                break;
+            }
+        CleanupStack::PopAndDestroy(); // fieldData
+        offset += fieldLength;
+        }
+    
+    // save contact into sim card
+    TInt index = -1;
+    TRequestStatus status;
+    //store the entry in the first free location and then return 
+    //this location within index when it completes the request
+    iEtelStore.Write(status, buffer, index);
+    User::WaitForRequest(status);
+    if(status.Int() != KErrNone)
+        {
+        HTI_LOG_TEXT("Failed to add SIM contact");
+        SendErrorMessageL( status.Int(), KErrorImportFailed );
+        }
+    else
+        {
+        HTI_LOG_TEXT( "SIM contact added" );
+        TBuf8<4> idBuf;
+        idBuf.Append( ( TUint8* ) &index, 4 );
+        SendOkMsgL( idBuf );
+        }
+    CleanupStack::PopAndDestroy(2); // buffer, pbBuffer
+
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::HandleSimContactImportL" );
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::HandleSimContactDeleteL
+// Creates a contact view containing the contacts to be deleted.
+// ----------------------------------------------------------------------------
+void CHtiSimDirHandler::HandleSimContactDeleteL(const TDesC8& aData)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::HandleSimContactDeleteL" );
+    TInt dataLength = aData.Length();
+    if ( dataLength != 0 && dataLength != 4 )
+        {
+        HTI_LOG_TEXT( "CHtiSimDirHandler: Wrong length of data" )
+        SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+        return;
+        }
+    
+    TRequestStatus status;
+    if (dataLength == 0) //delete all
+        {
+        iEtelStore.DeleteAll(status);
+        HTI_LOG_TEXT("Delete all SIM contacts");
+        }
+    else //delete one contact with given id
+        {
+        TInt id = aData[0] + (aData[1] << 8) + (aData[2] << 16) + (aData[3]
+                << 24);
+        HTI_LOG_FORMAT( "Delete SIM contact with id %d", id );
+        iEtelStore.Delete(status, id);
+        }
+    
+    User::WaitForRequest(status);
+    if(status.Int() != KErrNone)
+        {
+        HTI_LOG_TEXT("Failed to delete contact(s)");
+        SendErrorMessageL( status.Int(), KErrorDeleteFailed );
+        }
+    else
+        {
+        HTI_LOG_TEXT("SIM contact(s) deleted");
+        SendOkMsgL( KNullDesC8 );
+        }
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::HandleSimContactDeleteL" );
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::CheckImportMsg
+// Validates the syntax of import contact message.
+// ----------------------------------------------------------------------------
+TBool CHtiSimDirHandler::CheckImportMsg(const TDesC8& aData)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::CheckImportMsg" );
+    // Import command syntax:
+    //   amount of fields     (1 byte)   __
+    //   type of field        (1 byte)     |
+    //   length of data field (1 byte)     | repeated <amount of fields> times
+    //   field data           (variable) __|
+
+    TInt length = aData.Length();
+    if (length < 4) // min length 4 bytes
+        {
+        HTI_LOG_FORMAT( "Message too short %d", length );
+        SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+        return EFalse;
+        }
+
+    RMobilePhoneBookStore::TMobilePhoneBookInfoV5 etelStoreInfo;
+    RMobilePhoneBookStore::TMobilePhoneBookInfoV5Pckg etelStoreInfoPckg(etelStoreInfo);
+    
+    TRequestStatus requestStatus;
+    iEtelStore.GetInfo(requestStatus, (TDes8&) etelStoreInfoPckg);
+    User::WaitForRequest(requestStatus);
+    if (requestStatus.Int() != KErrNone)
+        {
+        HTI_LOG_TEXT( "CHtiSimDirHandler: Failed to get SIM card info" );
+        SendErrorMessageL(requestStatus.Int(), KErrorSimCardInfoFailed);
+        return EFalse;
+        }
+    TInt offset = 0;
+    TInt fieldCount = aData[offset];
+    HTI_LOG_FORMAT( "Fields %d", fieldCount );
+    if (fieldCount < 1) // must be at least one field
+        {
+        SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+        return EFalse;
+        }
+
+    offset++;
+    TInt fieldsFound = 0;
+    while (offset < length)
+        {
+        fieldsFound++;
+        TContactFieldType fieldType = (TContactFieldType) aData[offset];
+        HTI_LOG_FORMAT( "Field type %d", fieldType );
+        TInt maxLength = 0;
+        if(fieldType == ENameField)
+            {
+            maxLength = etelStoreInfo.iMaxTextLength;
+            }
+        else if(fieldType == ESecondNameField)
+            {
+            maxLength = etelStoreInfo.iMaxTextLengthSecondName;
+            }
+        else if(fieldType == EPhoneNumberField)
+            {
+            maxLength = etelStoreInfo.iMaxNumLength;
+            }
+        else if(fieldType == EEMailField)
+            {
+            maxLength = etelStoreInfo.iMaxTextLengthEmailAddr;
+            }
+        else if(fieldType == EAdditNumberField)
+            {
+            maxLength = etelStoreInfo.iMaxNumLengthAdditionalNumber;
+            }
+        else
+            {
+            HTI_LOG_TEXT("Unknown field type");
+            SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+            return EFalse; // invalid field type
+            }
+        
+        if(maxLength <= 0)
+            {
+            HTI_LOG_TEXT("Field not supported");
+            SendErrorMessageL(KErrArgument, KErrorFieldNotSupported);
+            return EFalse;
+            }
+
+        offset++; // the type of field byte
+        if (offset >= length)
+            {
+            SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+            return EFalse;
+            }
+        TInt fieldLength = aData[offset];
+        HTI_LOG_FORMAT( "Field length %d", fieldLength );
+        if (fieldLength < 1)
+            {
+            SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+            return EFalse; // Field data can not be empty
+            }
+        else if(fieldLength > maxLength)
+            {
+            HTI_LOG_TEXT("The length of field is too long");
+            SendErrorMessageL( KErrArgument, KErrorFieldTooBig );
+            return EFalse;
+            }
+        offset++; // advance over the length of data byte
+        offset += fieldLength; // and the field data
+        }
+
+    if (offset == length && fieldsFound == fieldCount)
+        {
+        HTI_LOG_TEXT( "Message OK" );
+        return ETrue;
+        }
+    
+    SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
+    return EFalse;
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::SendOkMsgL
+// Helper function for sending response messages.
+// ----------------------------------------------------------------------------
+void CHtiSimDirHandler::SendOkMsgL(const TDesC8& aData)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::SendOkMsgL" );
+    iIsBusy = EFalse; // Done with the current request
+    User::LeaveIfNull(iDispatcher);
+    HBufC8* temp = HBufC8::NewL(aData.Length() + 1);
+    TPtr8 response = temp->Des();
+    response.Append((TChar) CHtiPIMServicePlugin::EResultOk);
+    response.Append(aData);
+    User::LeaveIfError(iDispatcher->DispatchOutgoingMessage(temp,
+            KPIMServiceUid));
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::SendOkMsgL" );
+    }
+
+// ----------------------------------------------------------------------------
+// CHtiSimDirHandler::SendErrorMessageL
+// Helper function for sending error response messages.
+// ----------------------------------------------------------------------------
+void CHtiSimDirHandler::SendErrorMessageL(TInt aError,
+        const TDesC8& aDescription)
+    {
+    HTI_LOG_FUNC_IN( "CHtiSimDirHandler::SendErrorMessageL" );
+    iIsBusy = EFalse; // Done with the current request
+    User::LeaveIfNull(iDispatcher);
+    User::LeaveIfError(iDispatcher->DispatchOutgoingErrorMessage(aError,
+            aDescription, KPIMServiceUid));
+    HTI_LOG_FUNC_OUT( "CHtiSimDirHandler::SendErrorMessageL" );
+    }
+
+// End of file
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandlerVPbk.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1008 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Implementation of SIM card contacts handling using the new
-*                Virtual Phonebook API
-*
-*/
-
-
-// INCLUDE FILES
-#include "HtiSimDirHandlerVPbk.h"
-#include "HtiPIMServicePlugin.h"
-
-#include <CVPbkContactManager.h>
-#include <CVPbkContactLinkArray.h>
-#include <CVPbkContactStoreUriArray.h>
-#include <CVPbkContactViewDefinition.h>
-#include <CVPbkSortOrder.h>
-#include <MVPbkContactFieldTextData.h>
-#include <MVPbkContactLink.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkContactStore.h>
-#include <MVPbkContactStoreInfo.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStoreProperties.h>
-#include <MVPbkContactView.h>
-#include <MVPbkContactViewBase.h>
-#include <MVPbkFieldType.h>
-#include <MVPbkStoreContact.h>
-#include <MVPbkStoreContactField.h>
-#include <MVPbkContactStoreObserver.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <TVPbkFieldVersitProperty.h>
-#include <VPbkContactStoreUris.h>
-#include <VPbkContactView.hrh>
-#include <VPbkFieldType.hrh>
-#include <VPbkEng.rsg>
-
-#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
-
-// EXTERNAL DATA STRUCTURES
-
-// EXTERNAL FUNCTION PROTOTYPES
-
-// CONSTANTS
-const TInt KSimInfoResponseLength = 12;
-
-// MACROS
-
-// LOCAL CONSTANTS AND MACROS
-_LIT8( KErrorUnrecognizedCommand, "Unrecognized command" );
-_LIT8( KErrorInvalidParameters, "Invalid command parameters" );
-_LIT8( KErrorImportFailed, "Contact import failed" );
-_LIT8( KErrorDeleteFailed, "Failed to delete contact" );
-_LIT8( KErrorSimCardInfoFailed, "Failed to get SIM card info" );
-_LIT8( KErrorSimStoreOpenFailed, "Failed to open SIM contact store" );
-_LIT8( KErrorSimStoreUnavailable, "SIM contact store unavailable" );
-
-_LIT8( KErrorContactOperationFailed, "SIM contact operation failed" );
-
-// MODULE DATA STRUCTURES
-
-// LOCAL FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-CHtiSimDirHandlerVPbk* CHtiSimDirHandlerVPbk::NewL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::NewL" );
-    CHtiSimDirHandlerVPbk* self = new (ELeave) CHtiSimDirHandlerVPbk();
-    CleanupStack::PushL ( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::NewL" );
-    return self;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::CHtiSimDirHandlerVPbk
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// ----------------------------------------------------------------------------
-CHtiSimDirHandlerVPbk::CHtiSimDirHandlerVPbk():iIsBusy( EFalse ),
-                                               iIsStoreOpen( EFalse )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::CHtiSimDirHandlerVPbk" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::CHtiSimDirHandlerVPbk" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::~CHtiSimDirHandlerVPbk
-// Destructor.
-// -----------------------------------------------------------------------------
-CHtiSimDirHandlerVPbk::~CHtiSimDirHandlerVPbk()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::~CHtiSimDirHandlerVPbk" );
-
-    if ( iContactView )
-        {
-        HTI_LOG_TEXT( "Deleting iContactView" );
-        iContactView->RemoveObserver( *this );
-        delete iContactView;
-        }
-    if ( iSimStore )
-        {
-        HTI_LOG_TEXT( "Closing iSimStore" );
-        iSimStore->Close( *this );
-        }
-    if ( iContactManager )
-        {
-        HTI_LOG_TEXT( "Deleting iContactManager" );
-        delete iContactManager;
-        }
-    if ( iMessage )
-        {
-        HTI_LOG_TEXT( "Deleting iMessage" );
-        delete iMessage;
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::~CHtiSimDirHandlerVPbk" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ConstructL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ConstructL" );
-
-    CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-    uriArray->AppendL( TVPbkContactStoreUriPtr(
-        VPbkContactStoreUris::SimGlobalAdnUri() ) );
-
-    iContactManager = CVPbkContactManager::NewL( *uriArray );
-    CleanupStack::PopAndDestroy( uriArray );
-
-    MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
-    iSimStore = storeList.Find( TVPbkContactStoreUriPtr(
-        VPbkContactStoreUris::SimGlobalAdnUri() ) );
-
-    if ( !iSimStore )
-        {
-        HTI_LOG_TEXT( "SIM ADN store not found - leaving" );
-        User::Leave( KErrNotFound );
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ConstructL" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::SetDispatcher
-// Sets the dispatcher pointer.
-// -----------------------------------------------------------------------------
-
-void CHtiSimDirHandlerVPbk::SetDispatcher( MHtiDispatcher* aDispatcher )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::SetDispatcher" );
-    iDispatcher = aDispatcher;
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::SetDispatcher" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ProcessMessageL
-// Parses the received message and calls handler functions.
-// -----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ProcessMessageL( const TDesC8& aMessage,
-    THtiMessagePriority /*aPriority*/ )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ProcessMessageL" );
-
-    if ( iIsBusy )
-        {
-        HTI_LOG_TEXT( "HtiSimDirHandlerVPbk is busy - leaving" );
-        User::Leave( KErrInUse );
-        }
-
-    // Will be set to EFalse in the SendOkMsgL or SendErrorMessageL methods.
-    iIsBusy = ETrue;
-
-    delete iMessage;
-    iMessage = NULL;
-
-    // Zero legth of aMessage tested already in CHtiPIMServicePlugin.
-    // Other sanity checks must be done here.
-
-    // Trap the AllocL to be able to set iIsBusy false before leaving.
-    TRAPD( err, iMessage = aMessage.Right( aMessage.Length() - 1 ).AllocL() );
-    if ( err != KErrNone )
-        {
-        iIsBusy = EFalse;
-        User::Leave( err );
-        }
-
-    iCommand = aMessage.Ptr()[0];
-
-    // Do basic validity checking for message
-    TBool isParamsOk = ETrue;
-    switch ( iCommand )
-        {
-        case CHtiPIMServicePlugin::ESimCardInfo:
-            {
-            if ( iMessage->Length() != 0 )
-                {
-                isParamsOk = EFalse;
-                }
-            break;
-            }
-        case CHtiPIMServicePlugin::EImportSimContact:
-            {
-            if ( !CheckImportMsg() )
-                {
-                isParamsOk = EFalse;
-                }
-            break;
-            }
-        case CHtiPIMServicePlugin::EDeleteSimContact:
-            {
-            if ( iMessage->Length() != 4 && iMessage->Length() != 0 )
-                {
-                isParamsOk = EFalse;
-                }
-            break;
-            }
-        default:
-            {
-            SendErrorMessageL( KErrArgument, KErrorUnrecognizedCommand );
-            return;
-            }
-        }
-
-    if ( !isParamsOk )
-        {
-        SendErrorMessageL( KErrArgument, KErrorInvalidParameters );
-        }
-
-    else
-        {
-        if ( iIsStoreOpen )
-            {
-            StoreReady( *iSimStore );
-            }
-        else
-            {
-            // Start async open operation.
-            // StoreReady callback will be called when opening is complete.
-            TRAPD( err, iSimStore->OpenL( *this ) );
-            if ( err != KErrNone )
-                {
-                HTI_LOG_FORMAT(
-                        "Leave from CHtiSimDirHandler::OpenL() %d", err );
-                SendErrorMessageL( err, KErrorSimStoreOpenFailed );
-                }
-            }
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ProcessMessageL" );
-    }
-
-
-// -----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::IsBusy
-// -----------------------------------------------------------------------------
-//
-TBool CHtiSimDirHandlerVPbk::IsBusy()
-    {
-    return iIsBusy;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::OpenComplete
-// Called when the opening process is complete.
-// From MVPbkContactStoreListObserver
-// ----------------------------------------------------------------------------
-/*
-void CHtiSimDirHandlerVPbk::OpenComplete()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::OpenComplete" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::OpenComplete" );
-    }
-*/
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::StoreReady
-// Called when a contact store is ready to use.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::StoreReady( MVPbkContactStore& aContactStore )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::StoreReady" );
-
-    if ( !iIsBusy || iSimStore != &aContactStore )
-        {
-        return;
-        }
-
-    iIsStoreOpen = ETrue;
-
-    if ( iCommand == CHtiPIMServicePlugin::ESimCardInfo )
-        {
-        TRAPD( err, HandleSimCardInfoL() );
-        if ( err != KErrNone )
-            {
-            TRAP_IGNORE( SendErrorMessageL( err, KErrorSimCardInfoFailed ) );
-            }
-        }
-
-    else if ( iCommand == CHtiPIMServicePlugin::EImportSimContact )
-        {
-        TRAPD( err, HandleSimContactImportL() );
-        if ( err != KErrNone )
-            {
-            TRAP_IGNORE( SendErrorMessageL( err, KErrorImportFailed ) );
-            }
-        }
-
-    else if ( iCommand == CHtiPIMServicePlugin::EDeleteSimContact )
-        {
-        TRAPD( err, HandleSimContactDeleteL() );
-        if ( err != KErrNone )
-            {
-            TRAP_IGNORE( SendErrorMessageL( err, KErrorDeleteFailed ) );
-            }
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::StoreReady" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::StoreUnavailable
-// Called when a contact store becomes unavailable.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::StoreUnavailable( MVPbkContactStore& aContactStore,
-                                              TInt aReason )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::StoreUnavailable" );
-
-    if ( iIsBusy && iSimStore == &aContactStore )
-        {
-        TRAP_IGNORE( SendErrorMessageL( aReason, KErrorSimStoreUnavailable ) );
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::StoreUnavailable" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::HandleStoreEventL
-// Called when changes occur in the contact store.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::HandleStoreEventL( MVPbkContactStore& aContactStore,
-                        TVPbkContactStoreEvent aStoreEvent )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::HandleStoreEventL" );
-
-    if ( iIsBusy && iSimStore == &aContactStore &&
-         aStoreEvent.iEventType == TVPbkContactStoreEvent::EContactAdded )
-        {
-        HTI_LOG_TEXT( "Contact added" );
-        TInt entryId = 0;
-        TBuf8<4> idBuf;
-        idBuf.Append( ( TUint8* ) &entryId, 4 );
-        TRAP_IGNORE( SendOkMsgL( idBuf ) );
-        }
-
-    else if ( iIsBusy && iSimStore == &aContactStore &&
-              aStoreEvent.iEventType == TVPbkContactStoreEvent::EContactDeleted )
-        {
-        HTI_LOG_TEXT( "Contact deleted" );
-        if ( iMessage->Length() > 0 )  // This is a single deletion
-            {
-            TRAP_IGNORE( SendOkMsgL( KNullDesC8 ) );
-            }
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::HandleStoreEventL" );
-    }
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactOperationCompleted
-// Called when a contact operation has succesfully completed.
-// From MVPbkContactObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactOperationCompleted( TContactOpResult /*aResult*/ )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactOperationCompleted" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactOperationCompleted" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactOperationFailed
-// Called when a contact operation has failed.
-// From MVPbkContactObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactOperationFailed( TContactOp aOpCode,
-                                                    TInt aErrorCode,
-                                                    TBool aErrorNotified )
-    {
-
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactOperationFailed" );
-    HTI_LOG_FORMAT( "aOpCode: %d", aOpCode );
-    HTI_LOG_FORMAT( "aErrorCode: %d", aErrorCode );
-    HTI_LOG_FORMAT( "aErrorNotified: %d", aErrorNotified );
-    TRAP_IGNORE( SendErrorMessageL( aErrorCode, KErrorContactOperationFailed ) );
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactOperationFailed" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactViewReady
-// Called when a view is ready for use.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactViewReady( MVPbkContactViewBase& aView )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactViewReady" );
-
-    if ( iContactView == &aView && iIsBusy &&
-            iCommand == CHtiPIMServicePlugin::EDeleteSimContact )
-        {
-        TRAPD( err, DeleteContactsInViewL() );
-        if ( err != KErrNone )
-            {
-            TRAP_IGNORE( SendErrorMessageL( err, KErrorDeleteFailed ) );
-            }
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactViewReady" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactViewUnavailable
-// Called when a view is unavailable for a while.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactViewUnavailable( MVPbkContactViewBase& /*aView*/ )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactViewUnavailable" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactViewUnavailable" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactAddedToView
-// Called when a contact has been added to the view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactAddedToView( MVPbkContactViewBase& /*aView*/,
-        TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactAddedToView" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactAddedToView" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactRemovedFromView
-// Called when a contact has been removed from a view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactRemovedFromView( MVPbkContactViewBase& /*aView*/,
-        TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactRemovedFromView" );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactRemovedFromView" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactViewError
-// Called when an error occurs in the view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactViewError( MVPbkContactViewBase& aView,
-                                              TInt aError,
-                                              TBool aErrorNotified )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactViewError" );
-    HTI_LOG_FORMAT( "CHtiSimDirHandlerVPbk::ContactViewError: %d", aError );
-    HTI_LOG_FORMAT( "ErrorNotified = %d", aErrorNotified );
-    if ( iContactView == &aView )
-        {
-        iContactView->RemoveObserver( *this );
-        if ( iIsBusy && iCommand == CHtiPIMServicePlugin::EDeleteSimContact )
-            {
-            SendErrorMessageL( aError, KErrorDeleteFailed );
-            }
-        }
-    aErrorNotified = aErrorNotified;  // avoid compiler warning
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactViewError" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::StepComplete
-// Called when one step of the batch operation is complete.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::StepComplete( MVPbkContactOperationBase& /*aOperation*/,
-                           TInt aStepSize )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::StepComplete" );
-    HTI_LOG_FORMAT( "Step size = %d", aStepSize );
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::StepComplete" );
-    aStepSize = aStepSize; // avoid compiler warning
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::StepFailed
-// Called when one step of the batch operation fails.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-TBool CHtiSimDirHandlerVPbk::StepFailed( MVPbkContactOperationBase& aOperation,
-                                         TInt aStepSize, TInt aError )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::StepFailed" );
-    HTI_LOG_FORMAT( "Error %d", aError );
-    if ( iCurrentOperation == &aOperation )
-        {
-        // We are returning EFalse (= do not continue) we can delete
-        // the operation. OperationComplete() won't be called.
-        delete iCurrentOperation;
-        iCurrentOperation = NULL;
-        TRAP_IGNORE( SendErrorMessageL( aError, KErrorDeleteFailed ) );
-        }
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::StepFailed" );
-    aStepSize = aStepSize; // avoid compiler warning
-    return EFalse; // do not continue
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::OperationComplete
-// Called when operation is completed.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::OperationComplete(
-            MVPbkContactOperationBase& aOperation )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::OperationComplete" );
-    // Operation is complete -> delete it
-    if ( iCurrentOperation == &aOperation )
-        {
-        delete iCurrentOperation;
-        iCurrentOperation = NULL;
-        if ( iIsBusy && iCommand == CHtiPIMServicePlugin::EDeleteSimContact )
-            {
-            // Delete operation has completed
-            TRAP_IGNORE( SendOkMsgL( KNullDesC8 ) );
-            }
-        }
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::OperationComplete" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::HandleSimCardInfoL
-// Gets information about the SIM card.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::HandleSimCardInfoL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::HandleSimCardInfoL" );
-
-    // Get entry counts
-    const MVPbkContactStoreInfo& info = iSimStore->StoreInfo();
-    TInt maxEntries = info.MaxNumberOfContactsL();
-    TInt currentEntries = info.NumberOfContactsL();
-    HTI_LOG_FORMAT( "Current entries = %d", currentEntries );
-    HTI_LOG_FORMAT( "Max entries = %d", maxEntries );
-
-    // Create new entry object to get field informations
-    MVPbkStoreContact* entry = iSimStore->CreateNewContactLC();
-    TVPbkFieldVersitProperty prop;
-    TVPbkFieldTypeParameters param;
-
-    // Resolve field types
-    prop.SetName( EVPbkVersitNameN );
-    const MVPbkFieldType* nameFieldType =
-        iContactManager->FieldTypes().FindMatch( prop, 0 );
-
-    const MVPbkFieldType* secNameFieldType =
-        iContactManager->FieldTypes().Find( R_VPBK_FIELD_TYPE_SECONDNAME );
-
-    param.Reset();
-    param.Add( EVPbkVersitParamCELL );
-    prop.SetName( EVPbkVersitNameTEL );
-    prop.SetParameters( param );
-    const MVPbkFieldType* numberFieldType =
-        iContactManager->FieldTypes().FindMatch( prop, 0 );
-
-    param.Reset();
-    param.Add( EVPbkVersitParamINTERNET );
-    prop.SetName( EVPbkVersitNameEMAIL );
-    prop.SetParameters( param );
-    const MVPbkFieldType* mailFieldType =
-        iContactManager->FieldTypes().FindMatch( prop, 0 );
-
-    // Get max field counts
-    TInt maxNumbers = entry->MaxNumberOfFieldL( *numberFieldType );
-    TInt maxSecondNames = entry->MaxNumberOfFieldL( *secNameFieldType );
-    TInt maxEmails = entry->MaxNumberOfFieldL( *mailFieldType );
-
-    HTI_LOG_FORMAT( "Max numbers = %d", maxNumbers );
-    HTI_LOG_FORMAT( "Max second names = %d", maxSecondNames );
-    HTI_LOG_FORMAT( "Max emails = %d", maxEmails );
-
-    // Create field objects to get field data max lengths and verify that
-    // fields can be created. It is assumed that all SIM cards support name
-    // and number fields but e-mail and second name fields are TRAP:ed as
-    // creating them would cause a leave if not supported by the SIM card.
-    // It was noticed that with a SIM card not supporting the second name
-    // field the MaxNumberOfFieldL method for that field returns 1 but then
-    // the CreateFieldLC leaves with KErrNotSupported.
-    MVPbkStoreContactField* nameField = entry->CreateFieldLC( *nameFieldType );
-    MVPbkContactFieldTextData& nameFieldData =
-        MVPbkContactFieldTextData::Cast( nameField->FieldData() );
-    TInt maxNameLength = nameFieldData.MaxLength();
-    CleanupStack::PopAndDestroy(); // nameField
-
-    MVPbkStoreContactField* numberField = entry->CreateFieldLC( *numberFieldType );
-    MVPbkContactFieldTextData& numberFieldData =
-        MVPbkContactFieldTextData::Cast( numberField->FieldData() );
-    TInt maxNumberLength = numberFieldData.MaxLength();
-    CleanupStack::PopAndDestroy(); // numberField
-
-    MVPbkStoreContactField* mailField = NULL;
-    TInt maxMailLength = 0;
-    if ( maxEmails > 0 )
-        {
-        TRAPD( err, mailField = entry->CreateFieldLC( *mailFieldType );
-            CleanupStack::Pop(); ); // Popping inside the TRAP
-        if ( err != KErrNone )
-            {
-            maxEmails = 0;
-            }
-        else
-            {
-            MVPbkContactFieldTextData& mailFieldData =
-                MVPbkContactFieldTextData::Cast( mailField->FieldData() );
-            maxMailLength = mailFieldData.MaxLength();
-            delete mailField;
-            mailField = NULL;
-            }
-        }
-
-    MVPbkStoreContactField* secNameField = NULL;
-    TInt maxSecNameLength = 0;
-    if ( maxSecondNames > 0 )
-        {
-        TRAPD( err, secNameField = entry->CreateFieldLC( *secNameFieldType );
-            CleanupStack::Pop(); ); // Popping inside the TRAP
-        if ( err != KErrNone )
-            {
-            maxSecondNames = 0;
-            }
-        else
-            {
-            MVPbkContactFieldTextData& secNameFieldData =
-                MVPbkContactFieldTextData::Cast( secNameField->FieldData() );
-            maxSecNameLength = secNameFieldData.MaxLength();
-            delete secNameField;
-            secNameField = NULL;
-            }
-        }
-
-    HTI_LOG_FORMAT( "Max name length = %d", maxNameLength );
-    HTI_LOG_FORMAT( "Max 2nd name length = %d", maxSecNameLength );
-    HTI_LOG_FORMAT( "Max number length = %d", maxNumberLength );
-    HTI_LOG_FORMAT( "Max mail length = %d", maxMailLength );
-
-    CleanupStack::PopAndDestroy(); // entry
-
-    // Create and send response message
-    TBuf8<KSimInfoResponseLength> reply;
-    reply.Append( maxSecondNames );
-    reply.Append( maxNumbers - 1 ); // max num of additional numbers, so -1
-    reply.Append( maxEmails );
-    reply.Append( maxNameLength );
-    reply.Append( maxNumberLength );
-    reply.Append( maxSecNameLength );
-    reply.Append( maxNumberLength ); // additional number uses same field type
-    reply.Append( maxMailLength );
-    reply.Append( ( TUint8* ) ( &maxEntries ), 2 );
-    reply.Append( ( TUint8* ) ( &currentEntries ), 2 );
-
-    SendOkMsgL( reply );
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::HandleSimCardInfoL" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::HandleSimContactImportL
-// Imports the contact to SIM card.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::HandleSimContactImportL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::HandleSimContactImportL" );
-
-    MVPbkStoreContact* newEntry = iSimStore->CreateNewContactLC();
-
-    TInt offset = 0;
-    TInt fieldCount = iMessage->Des()[offset];
-    offset++;
-
-    for ( TInt i = 0; i < fieldCount; i++ )
-        {
-        HTI_LOG_FORMAT( "Processing field %d", i + 1 );
-
-        MVPbkStoreContactField* field = NULL;
-        TVPbkFieldVersitProperty prop;
-        TVPbkFieldTypeParameters param;
-        const MVPbkFieldType* fieldType = NULL;
-        TContactFieldType type = ( TContactFieldType ) iMessage->Des()[offset];
-        offset++;
-        switch ( type )
-            {
-            case ENameField:
-                prop.SetName( EVPbkVersitNameN );
-                fieldType = iContactManager->FieldTypes().FindMatch( prop, 0 );
-                break;
-            case ESecondNameField:
-                fieldType = iContactManager->FieldTypes().Find(
-                    R_VPBK_FIELD_TYPE_SECONDNAME );
-                break;
-            case EPhoneNumberField:
-                param.Add( EVPbkVersitParamCELL );
-                prop.SetName( EVPbkVersitNameTEL );
-                prop.SetParameters( param );
-                fieldType = iContactManager->FieldTypes().FindMatch( prop, 0 );
-                break;
-            case EEMailField:
-                param.Add( EVPbkVersitParamINTERNET );
-                prop.SetName( EVPbkVersitNameEMAIL );
-                prop.SetParameters( param );
-                fieldType = iContactManager->FieldTypes().FindMatch( prop, 0 );
-                break;
-            case EAdditNumberField:
-                param.Add( EVPbkVersitParamCELL );
-                param.Add( EVPbkVersitParamHOME );
-                prop.SetName( EVPbkVersitNameTEL );
-                prop.SetParameters( param );
-                fieldType = iContactManager->FieldTypes().FindMatch( prop, 0 );
-                break;
-            default:
-                HTI_LOG_FORMAT( "Unknown field type %d", type );
-                User::Leave( KErrArgument );
-                break;
-            }
-
-        if ( fieldType == NULL )
-            {
-            User::Leave( KErrArgument );
-            }
-
-        HTI_LOG_FORMAT( "Field type res id %d", fieldType->FieldTypeResId() );
-
-        field = newEntry->CreateFieldLC( *fieldType );
-
-        TInt fieldLength = iMessage->Des()[offset];
-        offset++;
-        HBufC* fieldData = HBufC::NewLC( fieldLength );
-        fieldData->Des().Copy( iMessage->Mid( offset, fieldLength ) );
-        HTI_LOG_FORMAT( "Field created - adding data: %S", fieldData );
-
-        MVPbkContactFieldTextData& targetData =
-            MVPbkContactFieldTextData::Cast( field->FieldData() );
-        targetData.SetTextL( *fieldData );
-
-        CleanupStack::PopAndDestroy(); // fieldData
-
-        HTI_LOG_TEXT( "Data set - Adding the field" );
-        newEntry->AddFieldL( field );
-        CleanupStack::Pop(); // field
-
-        offset += fieldLength;
-        }
-
-    HTI_LOG_TEXT( "Entry created - Commiting" );
-    // Starts the async commit operation. Takes ownership of newEntry.
-    newEntry->CommitL( *this );
-    CleanupStack::Pop(); // newEntry
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::HandleSimContactImportL" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::HandleSimContactDeleteL
-// Creates a contact view containing the contacts to be deleted.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::HandleSimContactDeleteL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::HandleSimContactDeleteL" );
-
-    if ( iContactView )
-        {
-        iContactView->RemoveObserver( *this );
-        delete iContactView;
-        iContactView = NULL;
-        }
-
-    // Delete one entry based on ID
-    if ( iMessage->Length() == 4 )
-        {
-        TPtr8 msgPtr = iMessage->Des();
-        TInt id = msgPtr[0] + ( msgPtr[1] << 8 )
-                            + ( msgPtr[2] << 16 )
-                            + ( msgPtr[3] << 24 );
-        HTI_LOG_FORMAT( "Delete with id %d", id );
-
-        User::Leave( KErrNotSupported );
-        }
-
-    // Delete all
-    else
-        {
-        CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
-        CleanupStack::PushL( viewDef );
-        viewDef->SetType( EVPbkContactsView );
-        viewDef->SetSharing( EVPbkLocalView );
-        viewDef->SetSortPolicy( EVPbkUnsortedContactView ); // in SIM index order
-        CVPbkSortOrder* sortOrder = CVPbkSortOrder::NewL(
-                iSimStore->StoreProperties().SupportedFields() );
-        CleanupStack::PushL( sortOrder );
-        iContactView = iSimStore->CreateViewLC( *viewDef, *this, *sortOrder );
-        CleanupStack::Pop(); // view;
-        CleanupStack::PopAndDestroy( 2 ); // sortOrder, viewDef
-        }
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::HandleSimContactDeleteL" );
-    }
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::DeleteContactsInViewL
-// Deletes the contacts that are currently in iContactView.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::DeleteContactsInViewL()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::DeleteContactsInViewL" );
-
-    TInt cntCount( iContactView->ContactCountL() );
-    HTI_LOG_FORMAT( "Contact count in view = %d", cntCount );
-    if ( cntCount > 0 )
-        {
-        CVPbkContactLinkArray* contactLinks = CVPbkContactLinkArray::NewLC();
-        for ( TInt i = 0; i < cntCount; ++i )
-            {
-            MVPbkContactLink* link =
-                iContactView->ContactAtL( i ).CreateLinkLC();
-            contactLinks->AppendL( link );
-            CleanupStack::Pop(); // link
-            }
-        // Following DeleteContactsL will result in calls to StepComplete
-        // and finally OperationComplete (StepFailed if error occurs)
-        iCurrentOperation = iContactManager->DeleteContactsL(
-                *contactLinks, *this );
-        CleanupStack::PopAndDestroy(); // contactLinks
-        }
-    else
-        {
-        // Nothing to delete
-        SendOkMsgL( KNullDesC8 );
-        }
-
-    // We don't need the view anymore
-    HTI_LOG_TEXT( "Deleting the contact view" );
-    iContactView->RemoveObserver( *this );
-    delete iContactView;
-    iContactView = NULL;
-
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::DeleteContactsInViewL" );
-    }
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::CheckImportMsg
-// Validates the syntax of import contact message.
-// ----------------------------------------------------------------------------
-TBool CHtiSimDirHandlerVPbk::CheckImportMsg()
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::CheckImportMsg" );
-    // Import command syntax:
-    //   amount of fields     (1 byte)   __
-    //   type of field        (1 byte)     |
-    //   length of data field (1 byte)     | repeated <amount of fields> times
-    //   field data           (variable) __|
-
-    TInt length = iMessage->Length();
-    if ( length < 4 ) // min length 4 bytes
-        {
-        HTI_LOG_FORMAT( "Message too short %d", length );
-        return EFalse;
-        }
-
-    TInt offset = 0;
-    TInt fieldCount = iMessage->Des()[offset];
-    HTI_LOG_FORMAT( "Fields %d", fieldCount );
-    if ( fieldCount < 1 ) // must be at least one field
-        {
-        return EFalse;
-        }
-
-    offset++;
-    TInt fieldsFound = 0;
-    while ( offset < length )
-        {
-        fieldsFound++;
-        TInt fieldType = iMessage->Des()[offset];
-        HTI_LOG_FORMAT( "Field type %d", fieldType );
-        if ( fieldType < ENameField || fieldType > EAdditNumberField )
-            {
-            return EFalse; // invalid field type
-            }
-        offset++; // the type of field byte
-        if ( offset >= length )
-            {
-            return EFalse;
-            }
-        TInt fieldLength = iMessage->Des()[offset];
-        HTI_LOG_FORMAT( "Field length %d", fieldLength );
-        if ( fieldLength < 1 )
-            {
-            return EFalse; // Field data can not be empty
-            }
-        offset++; // advance over the length of data byte
-        offset += fieldLength; // and the field data
-        }
-
-    if ( offset == length && fieldsFound == fieldCount )
-        {
-        HTI_LOG_TEXT( "Message OK" );
-        return ETrue;
-        }
-
-    return EFalse;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::SendOkMsgL
-// Helper function for sending response messages.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::SendOkMsgL( const TDesC8& aData )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::SendOkMsgL" );
-    iIsBusy = EFalse; // Done with the current request
-    User::LeaveIfNull( iDispatcher );
-    HBufC8* temp = HBufC8::NewL( aData.Length() + 1 );
-    TPtr8 response = temp->Des();
-    response.Append( ( TChar ) CHtiPIMServicePlugin::EResultOk );
-    response.Append( aData );
-    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
-        temp, KPIMServiceUid ) );
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::SendOkMsgL" );
-    }
-
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::SendErrorMessageL
-// Helper function for sending error response messages.
-// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::SendErrorMessageL( TInt aError, const TDesC8& aDescription )
-    {
-    HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::SendErrorMessageL" );
-    iIsBusy = EFalse; // Done with the current request
-    User::LeaveIfNull( iDispatcher );
-    User::LeaveIfError( iDispatcher->DispatchOutgoingErrorMessage(
-        aError, aDescription, KPIMServiceUid ) );
-    HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::SendErrorMessageL" );
-    }
-
-
-// End of file
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/PIMHandler.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/PIMHandler.cpp	Fri May 14 15:53:02 2010 +0300
@@ -17,38 +17,30 @@
 
 
 // INCLUDE FILES
+#include "../../../symbian_version.hrh"
+
 #include "HtiPIMServicePlugin.h"
 #include "PIMHandler.h"
 
 #include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
 
 #include <utf.h>
 #include <calcommon.h>
 #include <calsession.h>
-#include <calenimporter.h>
 #include <calentryview.h>
 
-#include <CVPbkContactLinkArray.h>
-#include <CVPbkContactManager.h>
-#include <CVPbkContactViewDefinition.h>
-#include <CVPbkContactStoreUriArray.h>
-#include <CVPbkSortOrder.h>
-#include <CVPbkVCardEng.h>
-#include <MVPbkContactLinkArray.h>
-#include <MVPbkContactOperationBase.h>
-#include <MVPbkContactStore.h>
-#include <MVPbkContactStoreList.h>
-#include <MVPbkContactStoreObserver.h>
-#include <MVPbkContactStoreProperties.h>
-#include <MVPbkContactView.h>
-#include <MVPbkContactViewBase.h>
-#include <MVPbkViewContact.h>
-#include <TVPbkContactStoreUriPtr.h>
-#include <VPbkContactStoreUris.h>
+#include <cntdb.h> 
+#include <cntitem.h> 
+#include <cntfldst.h> 
+#include <cntvcard.h> 
+#include <cntfilt.h> 
+#include <caldataexchange.h> 
+#include <caldataformat.h> 
 
 // CONSTANTS
 _LIT8( KErrorUnrecognizedCommand, "Unrecognized command" );
+_LIT8( KErrorCalendarFileFormat, "Invalid format of calendar file name");
 _LIT8( KErrorVCardImportFailed, "vCard import failed" );
 _LIT8( KErrorVCalendarImportFailed, "vCalendar import failed" );
 _LIT8( KErrorMissingVCalendar, "Missing vCalendar object" );
@@ -57,8 +49,14 @@
 _LIT8( KErrorItemNotFound, "Item not found" );
 _LIT8( KErrorFailedDelete, "Failed to delete item" );
 _LIT8( KErrorFailedDeleteAll, "Failed to delete all items" );
-_LIT8( KErrorIdDeleteNotSupported, "Deleting with ID not supported anymore" );
+_LIT8( KErrorFailedOpenCalendar, "Failed to open calendar file");
+//_LIT8( KErrorFailedOpenContact, "Failed to open contact database");
+
 
+
+_LIT( KDefaultAgendaFile, "" ); // A default file is opened if fileName is KNullDesC
+
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )  
 _LIT8( KErrorMissingText, "Text parameter missing" );
 _LIT8( KErrorMissingFilepath, "Filepath parameter missing" );
 _LIT8( KErrorNotepadAddMemoFailed, "Notepad add memo failed" );
@@ -70,9 +68,9 @@
 _LIT( KCmdAddMemoFromFile, "AddMemoFromFile" );
 _LIT( KCmdDeleteAll,       "DeleteAll" );
 _LIT( KCmdDelim,           " " );
-
-_LIT( KDefaultAgendaFile, "" ); // A default file is opened if fileName is KNullDesC
-
+#else
+_LIT8( KErrorNotepadNotSupported, "Notepad not supported" );
+#endif
 
 // ----------------------------------------------------------------------------
 CPIMHandler* CPIMHandler::NewL()
@@ -87,7 +85,8 @@
     }
 
 // ----------------------------------------------------------------------------
-CPIMHandler::CPIMHandler():iIsBusy( EFalse ), iEntryViewErr( KErrNone )
+CPIMHandler::CPIMHandler():iIsBusy( EFalse ), iEntryViewErr( KErrNone ),
+        iCalSession(NULL)
     {
     }
 
@@ -95,22 +94,8 @@
 CPIMHandler::~CPIMHandler()
     {
     HTI_LOG_TEXT( "CPIMHandler destroy" );
-    HTI_LOG_TEXT( "Deleting iEntryView" );
-    delete iEntryView;
-    HTI_LOG_TEXT( "Deleting iCalSession" );
+    HTI_LOG_TEXT( "Deleting iCalSession");
     delete iCalSession;
-    if ( iContactView )
-        {
-        HTI_LOG_TEXT( "Deleting iContactView" );
-        iContactView->RemoveObserver( *this );
-        delete iContactView;
-        }
-    HTI_LOG_TEXT( "Deleting iVCardEngine" );
-    delete iVCardEngine;
-    HTI_LOG_TEXT( "Deleting iContactManager" );
-    delete iContactManager;
-    HTI_LOG_TEXT( "Deleting iBuffer" );
-    delete iBuffer;
     HTI_LOG_TEXT( "Deleting iWaiter" );
     delete iWaiter;
     }
@@ -120,7 +105,6 @@
     {
     HTI_LOG_TEXT( "CPIMHandler::ConstructL" );
     iWaiter = new ( ELeave ) CActiveSchedulerWait;
-
     }
 
 // ----------------------------------------------------------------------------
@@ -141,8 +125,8 @@
     // Zero legth of aMessage tested already in CHtiPIMServicePlugin.
     // Other sanity checks must be done here.
 
-    iCommand = aMessage.Ptr()[0];
-    switch ( iCommand )
+    TUint8 command = aMessage.Ptr()[0];
+    switch ( command )
         {
         case CHtiPIMServicePlugin::EImportVCard:
             {
@@ -168,6 +152,17 @@
                     aMessage.Right( aMessage.Length() - 1 ) ) );
             break;
             }
+        case CHtiPIMServicePlugin::EOpenCalendarFile:
+            {
+            TRAP( err, HandleOpenCalendarFileL(
+                    aMessage.Right( aMessage.Length() - 1 )));
+            break;
+            }
+        case CHtiPIMServicePlugin::EListCalendarFiles:
+            {
+            TRAP( err, HandleListCalendarFilesL());
+            break;
+            }
         case CHtiPIMServicePlugin::ENotepadAddMemo:
             {
             TRAP( err, HandleNotepadAddMemoFuncL( aMessage.Mid( 1 ) ) );
@@ -207,46 +202,144 @@
     }
 
 // ----------------------------------------------------------------------------
+void CPIMHandler::HandleOpenCalendarFileL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CPIMHandler::HandleOpenCalendarFileL" );
+    
+    // check the format, the correct format is DriveLetter:FileName
+    if (aData.Length() != 0)
+        {
+        if(aData.Length() < 3 || aData[1] != ':'||
+                !(aData[0] >= 'a' && aData[0] <= 'z' || aData[0] >= 'A' && aData[0] <= 'Z'))
+            {
+            SendErrorMessageL( KErrArgument, KErrorCalendarFileFormat );
+            return;
+            }
+        }
+    
+    delete iCalSession;
+    iCalSession = NULL;
+    
+    // Open iCalSession
+    HTI_LOG_TEXT("Open calendar session");
+    iCalSession = CCalSession::NewL();
+    TBuf<KMaxFileName + 2> calFile;
+    calFile.Copy(aData);
+    TRAPD(err, iCalSession->OpenL(calFile));
+    if(err == KErrNone)
+        {
+        HTI_LOG_TEXT("Calendar session open");
+        SendOkMsgL( KNullDesC8 );
+        }
+    else
+        {
+        HTI_LOG_TEXT("Failed to open calendar file");
+        SendErrorMessageL( err, KErrorFailedOpenCalendar );
+        delete iCalSession;
+        iCalSession = NULL;
+        }
+    HTI_LOG_FUNC_OUT( "CPIMHandler::HandleOpenCalendarFileL: Done" );
+    }
+
+// ----------------------------------------------------------------------------
+void CPIMHandler::HandleListCalendarFilesL()
+    {
+    HTI_LOG_FUNC_IN( "CPIMHandler::HandleListCalendarFiles" );
+    
+    CCalSession* calSession = CCalSession::NewL();
+    CleanupStack::PushL(calSession);
+    HTI_LOG_TEXT("List all calendar files");
+    CDesCArray* calFiles = calSession->ListCalFilesL();
+    
+    if(calFiles == NULL) //No calendar files
+        {
+        TBuf8<2> reply;
+        reply.AppendFill(0, 2);
+        SendOkMsgL(reply);
+        CleanupStack::PopAndDestroy(); // calSession
+        return;
+        }
+    
+    CleanupStack::PushL(calFiles);
+    TInt count = calFiles->Count();
+    
+    // files count + file count * (file name length + max file name + driver letter + ':')
+    TInt bufSize = 2 + count * (2 + KMaxFileName + 1 + 1);
+    CBufFlat* calListBuf = CBufFlat::NewL( bufSize );
+    CleanupStack::PushL(calListBuf);
+    
+    HBufC8* calArray = HBufC8::NewLC( bufSize );
+    TPtr8 calArrayPtr = calArray->Des();
+    
+    calArrayPtr.Append((TUint8*)(&count), 2);
+    TInt pos = 0;
+    calListBuf->ExpandL(pos, 2);
+    calListBuf->Write(pos, *calArray, 2);
+    calArrayPtr.Zero();
+    pos += 2;
+    
+    for(int i = 0; i < count; ++i)
+        {
+        TInt len = calFiles->MdcaPoint(i).Length();
+        calArrayPtr.Append((TUint8*)(&len), 2);
+        calArrayPtr.Append(calFiles->MdcaPoint(i));
+        calListBuf->ExpandL(pos, calArray->Length());
+        calListBuf->Write(pos,*calArray, calArray->Length());
+        pos += calArray->Length();
+        calArrayPtr.Zero();
+        }
+    SendOkMsgL( calListBuf->Ptr( 0 ) );
+    CleanupStack::PopAndDestroy(4); //calArray, calListBuf, calFiles, calSession;    
+    HTI_LOG_FUNC_OUT( "CPIMHandler::HandleListCalendarFiles: Done" );
+    }
+
+// ----------------------------------------------------------------------------
 void CPIMHandler::HandleVCardImportFuncL( const TDesC8& aData )
     {
     HTI_LOG_FUNC_IN( "CPIMHandler::HandleVCardImportFuncL" );
-
     if ( aData.Length() == 0 )
         {
         SendErrorMessageL( KErrArgument, KErrorMissingVCard );
         return;
         }
-
-    if ( iBuffer ) // delete if exists (just to be sure)
-        {
-        delete iBuffer;
-        iBuffer = NULL;
-        }
-    iBuffer = CBufFlat::NewL( aData.Length() );
-    iBuffer->ExpandL( 0, aData.Length() );
-
-    HTI_LOG_FORMAT( "Data length = %d", aData.Length() );
-    HTI_LOG_FORMAT( "Buffer length = %d", iBuffer->Ptr( 0 ).MaxLength() );
-    iBuffer->Ptr( 0 ).Copy( aData );
-
-    if ( iContactManager == NULL )
+    
+    CContactDatabase* contactDatabase = CContactDatabase::OpenL();
+    HTI_LOG_TEXT( "CPIMHandler: Contact database open" );
+    CleanupStack::PushL(contactDatabase);
+    
+    CBufFlat* buffer = CBufFlat::NewL(aData.Length());
+    CleanupStack::PushL(buffer);
+    buffer->ExpandL(0, aData.Length());
+    buffer->Ptr(0).Copy(aData.Right(aData.Length()));
+    RBufReadStream readStream;
+    readStream.Open(*buffer, 0);
+    CleanupClosePushL<RBufReadStream>( readStream );
+    
+    // Imports vCard
+    TBool success = EFalse;
+    TUid format = TUid::Uid(KUidVCardConvDefaultImpl);
+    CArrayPtr<CContactItem>* contacts = NULL;
+    TRAPD(err,contacts = contactDatabase->ImportContactsL(format, readStream, success, 
+            CContactDatabase::EImportSingleContact | CContactDatabase::ETTFormat));
+    CleanupStack::PushL(contacts);
+    if(err != KErrNone || success == EFalse || contacts == NULL || contacts->Count() == 0)
         {
-        CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-        uriArray->AppendL( TVPbkContactStoreUriPtr(
-            VPbkContactStoreUris::DefaultCntDbUri() ) );
-        iContactManager = CVPbkContactManager::NewL( *uriArray );
-        CleanupStack::PopAndDestroy( uriArray );
+        HTI_LOG_TEXT("Failed to import vCard");
+        SendErrorMessageL( err, KErrorVCardImportFailed );
         }
-
-    if ( iVCardEngine == NULL )
+    else
         {
-        iVCardEngine = CVPbkVCardEng::NewL( *iContactManager );
+        // Returns the imported contact id 
+        TInt32 entryId = contacts->At(0)->Id();
+        TBuf8<4> idBuf;
+        idBuf.Append( ( TUint8* ) &entryId, 4 );
+        HTI_LOG_TEXT("vCard imported");
+        SendOkMsgL( idBuf );
         }
-
-    MVPbkContactStoreList& stores = iContactManager->ContactStoresL();
-    iContactStore = &stores.At( 0 );
-    iContactStore->OpenL( *this );
-
+    
+    contacts->ResetAndDestroy();
+    
+    CleanupStack::PopAndDestroy(4); // contacts, readStream, buffer, contactDatabase
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleVCardImportFuncL: Done" );
     }
 
@@ -262,27 +355,23 @@
         return;
         }
 
-    if ( iBuffer ) // delete if exists (just to be sure)
-        {
-        delete iBuffer;
-        iBuffer = NULL;
-        }
-    iBuffer = CBufFlat::NewL( aData.Length() );
-    iBuffer->ExpandL( 0, aData.Length() );
-    iBuffer->Ptr( 0 ).Copy( aData );
+    CBufFlat* buffer = CBufFlat::NewL( aData.Length() );
+    CleanupStack::PushL(buffer);
+    buffer->ExpandL( 0, aData.Length() );
+    buffer->Ptr( 0 ).Copy( aData );
     RBufReadStream readStream;
-    readStream.Open( *iBuffer, 0 );
+    readStream.Open( *buffer, 0 );
     CleanupClosePushL( readStream );
 
-    if ( iCalSession == NULL )
+    if(iCalSession == NULL)
         {
-        HTI_LOG_TEXT( "CPIMHandler: Creating Calendar session" );
+        HTI_LOG_TEXT( "CPIMHandler: Open default calendar file" );
         iCalSession = CCalSession::NewL();
         iCalSession->OpenL( KDefaultAgendaFile );
         HTI_LOG_TEXT( "CPIMHandler: Calendar session open" );
         }
 
-    CCalenImporter* importer = CCalenImporter::NewL( *iCalSession );
+    CCalDataExchange* importer = CCalDataExchange::NewL(*iCalSession);
     CleanupStack::PushL( importer );
     HTI_LOG_TEXT( "CPIMHandler: Calendar importer created" );
 
@@ -291,59 +380,48 @@
 
     TInt err = KErrNone;
     TInt size = 0;
-    importer->SetImportMode( ECalenImportModeExtended );
-    // First try to import as iCalendar
-    TRAP( err, importer->ImportICalendarL( readStream, entryArray ) );
-    HTI_LOG_FORMAT( "ImportICalendarL return value %d", err );
+    // Import as VCalendar
+    TRAP( err, importer->ImportL( KUidVCalendar, readStream, entryArray ) );
+    HTI_LOG_FORMAT( "ImportL return value %d", err );
     size = entryArray.Count();
-    HTI_LOG_FORMAT( "Import ICalendarL imported %d entries", size );
-    // If import didn't succeed, try as vCalendar
-    if ( err != KErrNone || size == 0 )
-        {
-        readStream.Close();
-        readStream.Open( *iBuffer, 0 ); // reset read stream
-        entryArray.ResetAndDestroy(); // avoid double imports
-        TRAP( err, importer->ImportVCalendarL( readStream, entryArray ) );
-        HTI_LOG_FORMAT( "ImportVCalendarL return value %d", err );
-        size = entryArray.Count();
-        HTI_LOG_FORMAT( "Import VCalendarL imported %d entries", size );
-        }
+    HTI_LOG_FORMAT( "Import VCalendarL imported %d entries", size );
     TCalLocalUid uniqueId = 0;
     TInt success = 0;
     if ( size > 0 )
         {
-        iEntryView = CCalEntryView::NewL( *iCalSession, *this );
+        CCalEntryView* entryView = CCalEntryView::NewL( *iCalSession, *this );
         iWaiter->Start();
+        CleanupStack::PushL(entryView);
         if ( iEntryViewErr == KErrNone )
             {
-            TRAP( err, iEntryView->StoreL( entryArray, success ) );
+            TRAP( err, entryView->StoreL( entryArray, success ) );
             HTI_LOG_FORMAT( "StoreL return value %d", err );
             HTI_LOG_FORMAT( "Successfully stored %d entries", success );
             uniqueId = entryArray[0]->LocalUidL();
             }
-        delete iEntryView;
-        iEntryView = NULL;
+        CleanupStack::PopAndDestroy();
         }
     entryArray.ResetAndDestroy();
     CleanupStack::PopAndDestroy(); // entryArray
 
     if ( err == KErrNone && success > 0 )
         {
+        HTI_LOG_TEXT("vCalendar imported");
         TBuf8<8> uniqueIdStr;
         uniqueIdStr.Copy( ( TUint8* ) ( &uniqueId ), sizeof( uniqueId ) );
         SendOkMsgL( uniqueIdStr );
         }
     else
         {
-        if ( err == KErrNone ) err = KErrGeneral;
+        HTI_LOG_TEXT("Failed to import vCalendar");
+        if ( err == KErrNone ) 
+            {
+            err = KErrGeneral;
+            }
         SendErrorMessageL( err, KErrorVCalendarImportFailed );
         }
 
-    CleanupStack::PopAndDestroy( 2 ); // readStream, importer
-    delete iCalSession;
-    iCalSession = NULL;
-    delete iBuffer;
-    iBuffer = NULL;
+    CleanupStack::PopAndDestroy( 3 ); // buffer, readStream, importer
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleVCalendarImportFuncL: Done" );
     }
 
@@ -351,7 +429,6 @@
 void CPIMHandler::HandleContactDeleteFuncL( const TDesC8& aData )
     {
     HTI_LOG_FUNC_IN( "CPIMHandler::HandleContactDeleteFuncL" );
-
     TInt dataLength = aData.Length();
     if ( dataLength != 0 && dataLength != 4 )
         {
@@ -359,30 +436,50 @@
         SendErrorMessageL( KErrArgument, KErrorInvalidId );
         return;
         }
-
-    if ( dataLength == 4 )
-        {
-        SendErrorMessageL( KErrNotSupported, KErrorIdDeleteNotSupported );
-        return;
-        }
-
-    if ( iContactManager == NULL )
+    CContactDatabase* contactDatabase = CContactDatabase::OpenL();
+    HTI_LOG_TEXT( "CPIMHandler: Contact database open" );
+    CleanupStack::PushL(contactDatabase);
+    
+    if(dataLength == 0)   // delete all contacts
         {
-        CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
-        uriArray->AppendL( TVPbkContactStoreUriPtr(
-            VPbkContactStoreUris::DefaultCntDbUri() ) );
-        iContactManager = CVPbkContactManager::NewL( *uriArray );
-        CleanupStack::PopAndDestroy( uriArray );
+        //const CContactIdArray* array = iContactDatabase->SortedItemsL();
+        CCntFilter *filter = CCntFilter::NewLC();
+        filter->SetContactFilterTypeCard(ETrue);
+        filter->SetContactFilterTypeGroup(EFalse);
+        contactDatabase->FilterDatabaseL(*filter);
+        TRAPD(err, contactDatabase->DeleteContactsL(*filter->iIds));
+        CleanupStack::PopAndDestroy();
+        if(err == KErrNone)
+            {
+            HTI_LOG_TEXT("All contacts deleted");
+            SendOkMsgL( KNullDesC8 );
+            }
+        else
+            {
+            HTI_LOG_TEXT("Failed to delete all contacts");
+            SendErrorMessageL( err, KErrorFailedDeleteAll );
+            }
         }
-
-    if ( iContactStore == NULL )
+    else  // delete one contact by id
         {
-        MVPbkContactStoreList& stores = iContactManager->ContactStoresL();
-        iContactStore = &stores.At( 0 );
+        TUint id = aData[0] + ( aData[1] << 8 )
+                + ( aData[2] << 16 )
+                + ( aData[3] << 24 );
+        TRAPD(err, contactDatabase->DeleteContactL(id));
+        
+        if(err == KErrNone)
+            {
+            HTI_LOG_TEXT("Contact deleted");
+            SendOkMsgL( KNullDesC8 );
+            }
+        else
+            {
+            HTI_LOG_TEXT("Failed to delete contact");
+            SendErrorMessageL( err, KErrorFailedDelete );
+            }
         }
-
-    iContactStore->OpenL( *this );
-
+    
+    CleanupStack::PopAndDestroy();
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleContactDeleteFuncL" );
     }
 
@@ -399,42 +496,26 @@
         return;
         }
 
-    if ( iBuffer ) // delete if exists (just to be sure)
-        {
-        delete iBuffer;
-        iBuffer = NULL;
-        }
-    if ( aData.Length() > 0 )
+
+    if(iCalSession == NULL)
         {
-        iBuffer = CBufFlat::NewL( aData.Length() );
-        iBuffer->ExpandL( 0, aData.Length() );
-        iBuffer->Ptr( 0 ).Copy( aData );
-        }
-
-    if ( iCalSession == NULL )
-        {
-        HTI_LOG_TEXT( "CPIMHandler: Creating Calendar session" );
+        HTI_LOG_TEXT( "CPIMHandler: Open default calendar file" );
         iCalSession = CCalSession::NewL();
         iCalSession->OpenL( KDefaultAgendaFile );
         HTI_LOG_TEXT( "CPIMHandler: Calendar session open" );
         }
 
     HTI_LOG_TEXT( "CPIMHandler: Creating entry view" );
-    iEntryView = CCalEntryView::NewL( *iCalSession, *this );
+    CCalEntryView* entryView = CCalEntryView::NewL( *iCalSession, *this );
     iWaiter->Start();
+    CleanupStack::PushL(entryView);
     if ( iEntryViewErr != KErrNone )
         {
-        delete iEntryView;
-        iEntryView = NULL;
-        delete iCalSession;
-        iCalSession = NULL;
-        delete iBuffer;
-        iBuffer = NULL;
         User::Leave( iEntryViewErr );
         }
 
-    // If iBuffer is NULL, no ID given, delete all calendar entries
-    if ( iBuffer == NULL )
+    // If dataLength is 0, no ID given, delete all calendar entries
+    if ( dataLength == 0 )
         {
         HTI_LOG_TEXT( "CPIMHandler: Deleting all calendar entries" );
         TCalTime minTime;
@@ -442,15 +523,17 @@
         minTime.SetTimeUtcL( TCalTime::MinTime() );
         maxTime.SetTimeUtcL( TCalTime::MaxTime() );
         CalCommon::TCalTimeRange timeRange( minTime, maxTime );
-        TRAPD( err, iEntryView->DeleteL( timeRange,
+        TRAPD( err, entryView->DeleteL( timeRange,
                 CalCommon::EIncludeAll, *this ) );
         iWaiter->Start();
         if ( err == KErrNone && iEntryViewErr == KErrNone )
             {
+            HTI_LOG_TEXT("All calendar entries deleted");
             SendOkMsgL( KNullDesC8 );
             }
         else
             {
+            HTI_LOG_TEXT("Failed to delete all calendar entries");
             SendErrorMessageL( KErrGeneral, KErrorFailedDeleteAll );
             }
         }
@@ -458,13 +541,12 @@
     // If id given, delete only calendar entry having that id
     else
         {
-        TPtr8 data = iBuffer->Ptr( 0 );
-        TCalLocalUid id = data[0] + ( data[1] << 8 )
-                             + ( data[2] << 16 )
-                             + ( data[3] << 24 );
+        TCalLocalUid id = aData[0] + ( aData[1] << 8 )
+                             + ( aData[2] << 16 )
+                             + ( aData[3] << 24 );
         HTI_LOG_FORMAT( "CPIMHandler: Deleting one calendar entry %d", id );
         CCalEntry* entryToDelete = NULL;
-        TRAPD( err, entryToDelete = iEntryView->FetchL( id ) );
+        TRAPD( err, entryToDelete = entryView->FetchL( id ) );
 
         if ( err || entryToDelete == NULL )
             {
@@ -474,57 +556,25 @@
         else
             {
             CleanupStack::PushL( entryToDelete );
-            TRAP( err, iEntryView->DeleteL( *entryToDelete ) );
+            TRAP( err, entryView->DeleteL( *entryToDelete ) );
             if ( err == KErrNone )
                 {
+                HTI_LOG_TEXT("calendar entrie deleted");
                 SendOkMsgL( KNullDesC8 );
                 }
             else
                 {
-                HTI_LOG_TEXT( "CPIMHandler: Error deleting calendar entry" )
+                HTI_LOG_TEXT( "Failed to delete calendar entry" )
                 SendErrorMessageL( KErrGeneral, KErrorFailedDelete );
                 }
             CleanupStack::PopAndDestroy( entryToDelete );
             }
         }
-    delete iEntryView;
-    iEntryView = NULL;
-    delete iCalSession;
-    iCalSession = NULL;
-    delete iBuffer;
-    iBuffer = NULL;
+    CleanupStack::PopAndDestroy(); //entryView;
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleVCalendarDeleteFuncL" );
     }
 
-// ----------------------------------------------------------------------------
-void CPIMHandler::SendOkMsgL( const TDesC8& aData )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::SendOkMsgL: Starting" );
-
-    User::LeaveIfNull( iDispatcher );
-
-    HBufC8* temp = HBufC8::NewL( aData.Length() + 1 );
-    TPtr8 response = temp->Des();
-    response.Append( ( TChar ) CHtiPIMServicePlugin::EResultOk );
-    response.Append( aData );
-    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
-        temp, KPIMServiceUid ) );
-    iIsBusy = EFalse;
-    HTI_LOG_FUNC_OUT( "CPIMHandler::SendOkMsgL: Done" );
-    }
-
-// ----------------------------------------------------------------------------
-void CPIMHandler::SendErrorMessageL( TInt aError, const TDesC8& aDescription )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::SendErrorMessageL: Starting" );
-    User::LeaveIfNull( iDispatcher );
-    User::LeaveIfError( iDispatcher->DispatchOutgoingErrorMessage(
-        aError, aDescription, KPIMServiceUid ) );
-    iIsBusy = EFalse;
-    HTI_LOG_FUNC_OUT( "CPIMHandler::SendErrorMessageL: Done" );
-    }
-
-// ----------------------------------------------------------------------------
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )  
 TInt CallNpdHlp( const TDesC& aCmd )
     {
     HTI_LOG_FUNC_IN( "CallNpdHlp" );
@@ -555,24 +605,13 @@
     HTI_LOG_FUNC_OUT( "CallNpdHlp" );
     return KErrNone;
     }
-
-// ----------------------------------------------------------------------------
-void CPIMHandler::SendNotepadOkMsgL( CHtiPIMServicePlugin::TCommand aCommand )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::SendNotepadOkMsgL" );
-    TBuf8<1> msg;
-    msg.Append( aCommand );
-    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
-                        msg.AllocL(), KPIMServiceUid ) );
-    iIsBusy = EFalse;
-    HTI_LOG_FUNC_OUT( "CPIMHandler::SendNotepadOkMsgL" );
-    }
+#endif
 
 // ----------------------------------------------------------------------------
 void CPIMHandler::HandleNotepadAddMemoFuncL( const TDesC8& aData )
     {
     HTI_LOG_FUNC_IN( "CPIMHandler::HandleNotepadAddMemoFuncL" );
-
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 ) 
     if ( aData.Length() < 1 )
         {
         SendErrorMessageL( KErrArgument, KErrorMissingText );
@@ -601,7 +640,9 @@
         }
 
     CleanupStack::PopAndDestroy( 2 ); // text, cmd
-
+#else
+    SendErrorMessageL(KErrNotSupported, KErrorNotepadNotSupported);
+#endif   
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleNotepadAddMemoFuncL" );
     }
 
@@ -609,7 +650,7 @@
 void CPIMHandler::HandleNotepadAddMemoFromFileFuncL( const TDesC8& aData )
     {
     HTI_LOG_FUNC_IN( "CPIMHandler::HandleNotepadAddMemoFromFileFuncL" );
-
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 ) 
     if ( aData.Length() < 1 )
         {
         SendErrorMessageL( KErrArgument, KErrorMissingFilepath );
@@ -638,7 +679,9 @@
         }
 
     CleanupStack::PopAndDestroy( 2 ); // filename, cmd
-
+#else
+    SendErrorMessageL(KErrNotSupported, KErrorNotepadNotSupported);
+#endif 
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleNotepadAddMemoFromFileFuncL" );
     }
 
@@ -646,7 +689,7 @@
 void CPIMHandler::HandleNotepadDeleteAllFuncL()
     {
     HTI_LOG_FUNC_IN( "CPIMHandler::HandleNotepadDeleteAllFuncL" );
-
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 ) 
     TInt err = CallNpdHlp( KCmdDeleteAll() );
     if ( err )
         {
@@ -656,352 +699,53 @@
         {
         SendNotepadOkMsgL( CHtiPIMServicePlugin::ENotepadDeleteAll );
         }
-
+#else
+    SendErrorMessageL(KErrNotSupported, KErrorNotepadNotSupported);
+#endif 
     HTI_LOG_FUNC_OUT( "CPIMHandler::HandleNotepadDeleteAllFuncL" );
     }
 
 // ----------------------------------------------------------------------------
-// CPIMHandler::CreateContactDeleteViewL
-// Creates a contact view containing the contacts to be deleted.
-// ----------------------------------------------------------------------------
-void CPIMHandler::CreateContactDeleteViewL()
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::CreateContactDeleteViewL" );
-
-    if ( iContactView )
-        {
-        iContactView->RemoveObserver( *this );
-        delete iContactView;
-        iContactView = NULL;
-        }
-
-    CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
-    CleanupStack::PushL( viewDef );
-    viewDef->SetType( EVPbkContactsView );
-    viewDef->SetSharing( EVPbkLocalView );
-    viewDef->SetSortPolicy( EVPbkSortedContactView );
-    CVPbkSortOrder* sortOrder = CVPbkSortOrder::NewL(
-            iContactStore->StoreProperties().SupportedFields() );
-    CleanupStack::PushL( sortOrder );
-    iContactView = iContactStore->CreateViewLC( *viewDef, *this, *sortOrder );
-    CleanupStack::Pop(); // view;
-    CleanupStack::PopAndDestroy( 2 ); // sortOrder, viewDef
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::CreateContactDeleteViewL" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::DeleteContactsInViewL
-// Deletes the contacts that are currently in iContactView.
-// ----------------------------------------------------------------------------
-void CPIMHandler::DeleteContactsInViewL()
+void CPIMHandler::SendNotepadOkMsgL( CHtiPIMServicePlugin::TCommand aCommand )
     {
-    HTI_LOG_FUNC_IN( "CPIMHandler::DeleteContactsInViewL" );
-
-    TInt cntCount( iContactView->ContactCountL() );
-    HTI_LOG_FORMAT( "Contact count in view = %d", cntCount );
-    if ( cntCount > 0 )
-        {
-        CVPbkContactLinkArray* contactLinks = CVPbkContactLinkArray::NewLC();
-        for ( TInt i = 0; i < cntCount; ++i )
-            {
-            MVPbkContactLink* link =
-                iContactView->ContactAtL( i ).CreateLinkLC();
-            contactLinks->AppendL( link );
-            CleanupStack::Pop(); // link
-            }
-        // Following DeleteContactsL will result in calls to StepComplete
-        // and finally OperationComplete (StepFailed if error occurs)
-        iOp = iContactManager->DeleteContactsL( *contactLinks, *this );
-        CleanupStack::PopAndDestroy(); // contactLinks
-        }
-    else
-        {
-        // Nothing to delete
-        iContactStore->Close( *this );
-        SendOkMsgL( KNullDesC8 );
-        }
-
-    // We don't need the view anymore
-    HTI_LOG_TEXT( "Deleting the contact view" );
-    iContactView->RemoveObserver( *this );
-    delete iContactView;
-    iContactView = NULL;
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::DeleteContactsInViewL" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::StoreReady
-// Called when a contact store is ready to use.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::StoreReady( MVPbkContactStore& aContactStore )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::StoreReady" );
-    if ( iIsBusy && iContactStore == &aContactStore )
-        {
-        if ( iCommand == CHtiPIMServicePlugin::EImportVCard )
-            {
-            iReadStream.Open( *iBuffer, 0 );
-            HTI_LOG_TEXT( "Starting vCard import" );
-            TRAPD( err, iOp = iVCardEngine->ImportVCardL(
-                    *iContactStore, iReadStream, *this ) );
-            HTI_LOG_FORMAT( "ImpoortVCardL returned %d", err );
-            if ( err != KErrNone )
-                {
-                delete iOp;
-                iOp = NULL;
-                iReadStream.Close();
-                delete iBuffer;
-                iBuffer = NULL;
-                iContactStore->Close( *this );
-                TRAP_IGNORE( SendErrorMessageL( err, KErrorVCardImportFailed ) );
-                }
-            }
-        else if ( iCommand == CHtiPIMServicePlugin::EDeleteContact )
-            {
-            TRAPD( err, CreateContactDeleteViewL() );
-            if ( err != KErrNone )
-                {
-                iContactStore->Close( *this );
-                TRAP_IGNORE( SendErrorMessageL( err, KErrorFailedDelete ) );
-                }
-            }
-        }
-    HTI_LOG_FUNC_OUT( "CPIMHandler::StoreReady" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::StoreUnavailable
-// Called when a contact store becomes unavailable.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::StoreUnavailable( MVPbkContactStore& aContactStore,
-        TInt aReason )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::StoreUnavailable" );
-
-    if ( iIsBusy && iContactStore == &aContactStore )
-        {
-        delete iBuffer;
-        iBuffer = NULL;
-        TRAP_IGNORE( SendErrorMessageL( aReason, KErrorVCardImportFailed ) );
-        }
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::StoreUnavailable" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::HandleStoreEventL
-// Called when changes occur in the contact store.
-// From MVPbkContactStoreObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/,
-                        TVPbkContactStoreEvent /*aStoreEvent*/ )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::HandleStoreEventL" );
-    HTI_LOG_FUNC_OUT( "CPIMHandler::HandleStoreEventL" );
+    HTI_LOG_FUNC_IN( "CPIMHandler::SendNotepadOkMsgL" );
+    TBuf8<1> msg;
+    msg.Append( aCommand );
+    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
+                        msg.AllocL(), KPIMServiceUid ) );
+    iIsBusy = EFalse;
+    HTI_LOG_FUNC_OUT( "CPIMHandler::SendNotepadOkMsgL" );
     }
 
 // ----------------------------------------------------------------------------
-// CPIMHandler::ContactsSaved
-// Called when the contact has been successfully commited or copied.
-// From MVPbkContactCopyObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactsSaved( MVPbkContactOperationBase& aOperation,
-        MVPbkContactLinkArray* aResults )
-{
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactsSaved" );
+void CPIMHandler::SendOkMsgL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CPIMHandler::SendOkMsgL: Starting" );
 
-    if ( iIsBusy && iOp == &aOperation )
-        {
-        TInt count = aResults->Count();
-        HTI_LOG_FORMAT( "%d contact(s) added", count );
-        delete aResults;
-        delete iOp;
-        iOp = NULL;
-        iReadStream.Close();
-        delete iBuffer;
-        iBuffer = NULL;
-        iContactStore->Close( *this );
-        TInt entryId = 0; // We can't get the ID, just send zero
-        TBuf8<4> idBuf;
-        idBuf.Append( ( TUint8* ) &entryId, 4 );
-        TRAP_IGNORE( SendOkMsgL( idBuf ) );
-        }
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactsSaved" );
-}
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::ContactsSavingFailed
-// Called when there was en error while saving contact(s).
-// From MVPbkContactCopyObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactsSavingFailed(
-        MVPbkContactOperationBase& aOperation, TInt aError )
-{
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactsSavingFailed" );
+    User::LeaveIfNull( iDispatcher );
 
-    if ( iIsBusy && iOp == &aOperation )
-        {
-        delete iOp;
-        iOp = NULL;
-        iReadStream.Close();
-        delete iBuffer;
-        iBuffer = NULL;
-        iContactStore->Close( *this );
-        TRAP_IGNORE( SendErrorMessageL( aError, KErrorVCardImportFailed ) );
-        }
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactsSavingFailed" );
-}
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::ContactViewReady
-// Called when a view is ready for use.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactViewReady( MVPbkContactViewBase& aView )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactViewReady" );
-
-    if ( iContactView == &aView && iIsBusy &&
-            iCommand == CHtiPIMServicePlugin::EDeleteContact )
-        {
-        TRAPD( err, DeleteContactsInViewL() );
-        if ( err != KErrNone )
-            {
-            TRAP_IGNORE( SendErrorMessageL( err, KErrorFailedDelete ) );
-            }
-        }
-
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactViewReady" );
-    }
-
-// ----------------------------------------------------------------------------
-// CHtiSimDirHandlerVPbk::ContactViewUnavailable
-// Called when a view is unavailable for a while.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactViewUnavailable( MVPbkContactViewBase& /*aView*/ )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactViewUnavailable" );
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactViewUnavailable" );
+    HBufC8* temp = HBufC8::NewL( aData.Length() + 1 );
+    TPtr8 response = temp->Des();
+    response.Append( ( TChar ) CHtiPIMServicePlugin::EResultOk );
+    response.Append( aData );
+    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
+        temp, KPIMServiceUid ) );
+    iIsBusy = EFalse;
+    HTI_LOG_FUNC_OUT( "CPIMHandler::SendOkMsgL: Done" );
     }
 
 // ----------------------------------------------------------------------------
-// CPIMHandler::ContactAddedToView
-// Called when a contact has been added to the view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactAddedToView( MVPbkContactViewBase& /*aView*/,
-        TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactAddedToView" );
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactAddedToView" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::ContactRemovedFromView
-// Called when a contact has been removed from a view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactRemovedFromView( MVPbkContactViewBase& /*aView*/,
-        TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ )
+void CPIMHandler::SendErrorMessageL( TInt aError, const TDesC8& aDescription )
     {
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactRemovedFromView" );
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactRemovedFromView" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::ContactViewError
-// Called when an error occurs in the view.
-// From MVPbkContactViewObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::ContactViewError( MVPbkContactViewBase& aView,
-        TInt aError, TBool aErrorNotified )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::ContactViewError" );
-    HTI_LOG_FORMAT( "CPIMHandler::ContactViewError: %d", aError );
-    HTI_LOG_FORMAT( "ErrorNotified = %d", aErrorNotified );
-    if ( iContactView == &aView )
-        {
-        iContactView->RemoveObserver( *this );
-        delete iContactView;
-        iContactView = NULL;
-        if ( iIsBusy && iCommand == CHtiPIMServicePlugin::EDeleteContact )
-            {
-            SendErrorMessageL( aError, KErrorFailedDelete );
-            }
-        iContactStore->Close( *this );
-        }
-    aErrorNotified = aErrorNotified;  // avoid compiler warning
-    HTI_LOG_FUNC_OUT( "CPIMHandler::ContactViewError" );
+    HTI_LOG_FUNC_IN( "CPIMHandler::SendErrorMessageL: Starting" );
+    User::LeaveIfNull( iDispatcher );
+    User::LeaveIfError( iDispatcher->DispatchOutgoingErrorMessage(
+        aError, aDescription, KPIMServiceUid ) );
+    iIsBusy = EFalse;
+    HTI_LOG_FUNC_OUT( "CPIMHandler::SendErrorMessageL: Done" );
     }
 
 // ----------------------------------------------------------------------------
-// CPIMHandler::StepComplete
-// Called when one step of the batch operation is complete.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::StepComplete( MVPbkContactOperationBase& /*aOperation*/,
-                           TInt /*aStepSize*/ )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::StepComplete" );
-    HTI_LOG_FUNC_OUT( "CPIMHandler::StepComplete" );
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::StepFailed
-// Called when one step of the batch operation fails.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-TBool CPIMHandler::StepFailed( MVPbkContactOperationBase& aOperation,
-                                         TInt /*aStepSize*/, TInt aError )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::StepFailed" );
-    HTI_LOG_FORMAT( "Error %d", aError );
-    if ( iOp == &aOperation )
-        {
-        // We are returning EFalse (= do not continue) we can delete
-        // the operation. OperationComplete() won't be called.
-        delete iOp;
-        iOp = NULL;
-        iContactStore->Close( *this );
-        TRAP_IGNORE( SendErrorMessageL( aError, KErrorFailedDelete ) );
-        }
-    HTI_LOG_FUNC_OUT( "CPIMHandler::StepFailed" );
-    return EFalse; // do not continue
-    }
-
-// ----------------------------------------------------------------------------
-// CPIMHandler::OperationComplete
-// Called when operation is completed.
-// From MVPbkBatchOperationObserver
-// ----------------------------------------------------------------------------
-void CPIMHandler::OperationComplete(
-            MVPbkContactOperationBase& aOperation )
-    {
-    HTI_LOG_FUNC_IN( "CPIMHandler::OperationComplete" );
-    // Operation is complete -> delete it
-    if ( iOp == &aOperation )
-        {
-        delete iOp;
-        iOp = NULL;
-        iContactStore->Close( *this );
-        if ( iIsBusy && iCommand == CHtiPIMServicePlugin::EDeleteContact )
-            {
-            // Delete operation has completed
-            TRAP_IGNORE( SendOkMsgL( KNullDesC8 ) );
-            }
-        }
-    HTI_LOG_FUNC_OUT( "CPIMHandler::OperationComplete" );
-    }
-
-
-// ----------------------------------------------------------------------------
 // CPIMHandler::Progress
 // Called during calendar entry view creation and operations.
 // Called only if NotifyProgress returns ETrue.
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group/HtiScreenshotServicePlugin.mmp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group/HtiScreenshotServicePlugin.mmp	Fri May 14 15:53:02 2010 +0300
@@ -42,9 +42,9 @@
 END
 
 #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-LIBRARY         avkon.lib
+LIBRARY         alfclient.lib
 #endif
-
+LIBRARY         avkon.lib
 LIBRARY         bitgdi.lib
 LIBRARY         ecom.lib
 LIBRARY         efsrv.lib
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiScreenshotServicePlugin.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiScreenshotServicePlugin.cpp	Fri May 14 15:53:02 2010 +0300
@@ -28,12 +28,12 @@
 #include <ezcompressor.h>
 #include <hal.h>
 
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-
 #include <AknLayoutConfig.h>
 #include <apgtask.h> 
 #include <AknCapServerDefs.h>
 
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+#include <alf/alfdrawer.h>
 #endif
 
 // CONSTANTS
@@ -1717,7 +1717,7 @@
 void CHtiScreenshotServicePlugin::HandleRotateScreen(const TDesC8& aData)
     {
     HTI_LOG_FUNC_IN( "CHtiScreenshotServicePlugin::HandleRotateScreen" );
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )               
+             
     TInt orientation = aData[0];
     if (orientation > 1 || orientation < 0)
         {
@@ -1810,10 +1810,7 @@
     CleanupStack::PopAndDestroy(layoutConfigPtr);
     CleanupStack::PopAndDestroy(screenDevice);
     ws.Close();
-#else
-    iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
-            KErrDescrScreenNotSupported, KScreenshotServiceUid);
-#endif               
+             
     HTI_LOG_FUNC_OUT( "CHtiScreenshotServicePlugin::HandleRotateScreen" );
     }
 // ----------------------------------------------------------------------------
@@ -1833,15 +1830,25 @@
     iScreen = new( ELeave ) CFbsBitmap;
     User::LeaveIfError( iScreen->Create( imageSize, displayMode ) );
 
+	TInt err = KErrNone;
+	TRect region;
     if ( aRegion.IsEmpty() )
         {
-        iScreenDevice->CopyScreenToBitmap( iScreen );
+        err = iScreenDevice->CopyScreenToBitmap( iScreen );
+		region = imageSize;
         }
     else
         {
-        iScreenDevice->CopyScreenToBitmap( iScreen, aRegion );
+        err = iScreenDevice->CopyScreenToBitmap( iScreen, aRegion );
+		region = aRegion;
         }
-
+    if (err == KErrNoMemory)
+	    {
+		HTI_LOG_TEXT( "screenshot in camera mode" );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+		err = CAlfDrawer::FallbackCopyScreenToBitmap(*iScreenDevice, iScreen, region);
+#endif
+		}
 
     if ( iDeltaCapture )
         {
--- a/htiui/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -21,16 +21,18 @@
 #include "../symbian_version.hrh"
 
 PRJ_EXPORTS
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 ../rom/htiui.iby        CORE_IBY_EXPORT_PATH(tools,htiui.iby)
+#else
+../rom/htiui_10_1.iby   CORE_IBY_EXPORT_PATH(tools,htiui.iby)
+#endif
 
 // Service plugins
 #include "../HtiServicePlugins/HtiAppServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiAudioServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiKeyEventServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiMessagesServicePlugin/group/bld.inf"
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-    #include "../HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf"
-#endif
+#include "../HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiScreenshotServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiSysInfoServicePlugin/group/bld.inf"
 
@@ -44,7 +46,9 @@
 #include "../HtiStartupWait/group/bld.inf"
 
 // HTI Admin UI application
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
 #include "../HtiAdmin/group/bld.inf"
+#endif
 
 // Build stub SIS
 PRJ_EXTENSIONS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/htiui.pro	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = subdirs
+SUBDIRS += HtiAdminQt/HtiAdmin.pro 
+BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"group/bld.inf\""  
+BLD_INF_RULES.prj_extensions += "prj_extensions"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/rom/htiui_10_1.iby	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: Specifies HTI UI layer components for ROM image
+*
+*/
+
+#ifndef __HTIUI_IBY__
+#define __HTIUI_IBY__
+
+
+// HtiAdmin application
+S60_APP_EXE(HtiAdmin)
+data=DATAZ_\Resource\apps\HtiAdmin.rsc                      Resource\Apps\HtiAdmin.rsc
+data=ZPRIVATE\10003a3f\import\apps\HtiAdmin_reg.rsc         private\10003a3f\import\apps\HtiAdmin_reg.rsc
+
+
+// Test service plug-ins
+ECOM_PLUGIN(HtiAudioServicePlugin.dll,HtiAudioServicePlugin.rsc)
+ECOM_PLUGIN(HtiKeyEventServicePlugin.dll,HtiKeyEventServicePlugin.rsc)
+ECOM_PLUGIN(HtiMessagesServicePlugin.dll,HtiMessagesServicePlugin.rsc)
+ECOM_PLUGIN(HtiPIMServicePlugin.dll,HtiPIMServicePlugin.rsc)
+ECOM_PLUGIN(HtiScreenshotServicePlugin.dll,HtiScreenshotServicePlugin.rsc)
+ECOM_PLUGIN(HtiSysInfoServicePlugin.dll,HtiSysInfoServicePlugin.rsc)
+
+// Test service plug-in extension
+file=ABI_DIR\BUILD_DIR\HtiAppControl.dll            SHARED_LIB_DIR\HtiAppControl.dll
+
+// Backup fake DLL used by HtiFtpServicePlugin
+file=ABI_DIR\BUILD_DIR\HtiFtpBackupFake.dll         SHARED_LIB_DIR\HtiFtpBackupFake.dll
+
+// Device rebooter
+file=ABI_DIR\BUILD_DIR\HtiDeviceRebootUI.exe       SHARED_LIB_DIR\HtiDeviceRebootUI.exe
+
+// Startup wait DLL
+file=ABI_DIR\BUILD_DIR\HtiStartupWait.dll           SHARED_LIB_DIR\HtiStartupWait.dll
+
+// Stub SIS
+data=ZSYSTEM\Install\HTI_stub.sis                   system\install\HTI_stub.sis
+
+#endif // __HTIUI_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/sis/HTI_S60-10_1.pkg	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,111 @@
+;
+; 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 "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:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+; 
+; Description: Installation file for HTI
+
+
+; Languages
+&EN
+
+; Using UID of HtiFramework project
+#{"HTI"},(0x1020DEB6),2,21,0
+
+; Series60 product id for S60 5.2
+[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+
+; HtiCfg library
+"\epoc32\release\armv5\urel\HtiCfg.dll"                          - "!:\sys\bin\HtiCfg.dll"
+
+; HtiAdmin
+"\epoc32\release\armv5\urel\HtiAdmin.exe"                        - "!:\sys\bin\HtiAdmin.exe"
+"\epoc32\data\Z\Resource\apps\HtiAdmin.rsc"                      - "!:\Resource\Apps\HtiAdmin.rsc"
+"\epoc32\data\Z\private\10003a3f\import\apps\HtiAdmin_reg.rsc"          - "!:\private\10003a3f\import\apps\HtiAdmin_reg.rsc"
+
+; Serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiSerialCommEcomPlugin.rsc"    - "!:\Resource\Plugins\HtiSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSerialCommEcomPlugin.dll"         - "!:\sys\bin\HtiSerialCommEcomPlugin.dll"
+
+; BtSerial comm module
+"\epoc32\release\armv5\urel\HtiBtSerialComHelper.dll"            - "!:\sys\bin\HtiBtSerialComHelper.dll"
+"\epoc32\release\armv5\urel\HtiBtCommServer.dll"                 - "!:\sys\bin\HtiBtCommServer.dll"
+"\epoc32\release\armv5\urel\HtiBtCommInterface.dll"              - "!:\sys\bin\HtiBtCommInterface.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiBtCommEcomPlugin.rsc"        - "!:\Resource\Plugins\HtiBtCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiBtCommEcomPlugin.dll"             - "!:\sys\bin\HtiBtCommEcomPlugin.dll"
+
+; IPComm module
+"\epoc32\release\armv5\urel\HtiIPCommServer.exe"                 - "!:\sys\bin\HtiIPCommServer.exe"
+"\epoc32\release\armv5\urel\HtiIPCommServerClient.dll"           - "!:\sys\bin\HtiIPCommServerClient.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIPCommEcomPlugin.rsc"        - "!:\Resource\Plugins\HtiIPCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIPCommEcomPlugin.dll"             - "!:\sys\bin\HtiIPCommEcomPlugin.dll"
+
+; USB serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiUsbSerialCommEcomPlugin.dll"      - "!:\sys\bin\HtiUsbSerialCommEcomPlugin.dll"
+
+; Test service plug-ins
+"\epoc32\release\armv5\urel\HtiEchoServicePlugin.dll"            - "!:\sys\bin\HtiEchoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiEchoServicePlugin.rsc"       - "!:\Resource\Plugins\HtiEchoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiKeyEventServicePlugin.dll"        - "!:\sys\bin\HtiKeyEventServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiKeyEventServicePlugin.rsc"   - "!:\Resource\Plugins\HtiKeyEventServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiScreenshotServicePlugin.dll"      - "!:\sys\bin\HtiScreenshotServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiScreenshotServicePlugin.rsc" - "!:\Resource\Plugins\HtiScreenshotServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiFtpServicePlugin.dll"             - "!:\sys\bin\HtiFtpServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiFtpServicePlugin.rsc"        - "!:\Resource\Plugins\HtiFtpServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppServicePlugin.dll"             - "!:\sys\bin\HtiAppServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAppServicePlugin.rsc"        - "!:\Resource\Plugins\HtiAppServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppControl.dll"                   - "!:\sys\bin\HtiAppControl.dll"
+"\epoc32\release\armv5\urel\HtiStifTfServicePlugin.dll"          - "!:\sys\bin\HtiStifTfServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiStifTfServicePlugin.rsc"     - "!:\Resource\Plugins\HtiStifTfServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSysInfoServicePlugin.dll"         - "!:\sys\bin\HtiSysInfoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiSysInfoServicePlugin.rsc"    - "!:\Resource\Plugins\HtiSysInfoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAudioServicePlugin.dll"           - "!:\sys\bin\HtiAudioServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAudioServicePlugin.rsc"      - "!:\Resource\Plugins\HtiAudioServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiMessagesServicePlugin.dll"        - "!:\sys\bin\HtiMessagesServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiMessagesServicePlugin.rsc"   - "!:\Resource\Plugins\HtiMessagesServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiPIMServicePlugin.dll"             - "!:\sys\bin\HtiPIMServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+
+; File helper with capability ALL - for file operations to TCB folders
+"\epoc32\release\armv5\urel\HtiFileHlp.exe"                      - "!:\sys\bin\HtiFileHlp.exe"
+
+; Backup fake DLL used by HtiFtpServicePlugin
+"\epoc32\release\armv5\urel\HtiFtpBackupFake.dll"                - "!:\sys\bin\HtiFtpBackupFake.dll"
+
+; HTI watchdog
+"\epoc32\release\armv5\urel\HtiWatchDog.exe"                     - "!:\sys\bin\HtiWatchDog.exe"
+
+; HTI device reboot
+"\epoc32\release\armv5\urel\HtiDeviceRebootUI.exe"               - "!:\sys\bin\HtiDeviceRebootUI.exe"
+
+; HTI Framework
+"\epoc32\release\armv5\urel\HTIFramework.exe"                    - "!:\sys\bin\HTIFramework.exe"
+
+; AutoStart recogniser plug-in
+"\epoc32\release\armv5\urel\HtiAutoStart.dll"                    - "!:\sys\bin\HtiAutoStart.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAutoStart.rsc"               - "!:\Resource\Plugins\HtiAutoStart.rsc"
+
+; HTI startup wait
+"\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
+
+; Startup list resource file for starting HTIFramework.exe in device boot
+"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_S60-52.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/sis/HTI_S60-52.pkg	Fri May 14 15:53:02 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,18,0
+#{"HTI"},(0x1020DEB6),2,21,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,111 @@
+;
+; 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 "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:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+; 
+; Description: Installation file for HTI
+
+
+; Languages
+&EN
+
+; Using UID of HtiFramework project
+#{"HTI"},(0x1020DEB6),2,21,0,TYPE=SA,RU
+
+; Series60 product id for S60 5.2
+[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+
+; HtiCfg library
+"\epoc32\release\armv5\urel\HtiCfg.dll"                          - "!:\sys\bin\HtiCfg.dll"
+
+; HtiAdmin
+"\epoc32\release\armv5\urel\HtiAdmin.exe"                        - "!:\sys\bin\HtiAdmin.exe"
+"\epoc32\data\Z\Resource\apps\HtiAdmin.rsc"                      - "!:\Resource\Apps\HtiAdmin.rsc"
+"\epoc32\data\Z\private\10003a3f\import\apps\HtiAdmin_reg.rsc"          - "!:\private\10003a3f\import\apps\HtiAdmin_reg.rsc"
+
+; Serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiSerialCommEcomPlugin.rsc"    - "!:\Resource\Plugins\HtiSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSerialCommEcomPlugin.dll"         - "!:\sys\bin\HtiSerialCommEcomPlugin.dll"
+
+; BtSerial comm module
+"\epoc32\release\armv5\urel\HtiBtSerialComHelper.dll"            - "!:\sys\bin\HtiBtSerialComHelper.dll"
+"\epoc32\release\armv5\urel\HtiBtCommServer.dll"                 - "!:\sys\bin\HtiBtCommServer.dll"
+"\epoc32\release\armv5\urel\HtiBtCommInterface.dll"              - "!:\sys\bin\HtiBtCommInterface.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiBtCommEcomPlugin.rsc"        - "!:\Resource\Plugins\HtiBtCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiBtCommEcomPlugin.dll"             - "!:\sys\bin\HtiBtCommEcomPlugin.dll"
+
+; IPComm module
+"\epoc32\release\armv5\urel\HtiIPCommServer.exe"                 - "!:\sys\bin\HtiIPCommServer.exe"
+"\epoc32\release\armv5\urel\HtiIPCommServerClient.dll"           - "!:\sys\bin\HtiIPCommServerClient.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIPCommEcomPlugin.rsc"        - "!:\Resource\Plugins\HtiIPCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIPCommEcomPlugin.dll"             - "!:\sys\bin\HtiIPCommEcomPlugin.dll"
+
+; USB serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiUsbSerialCommEcomPlugin.dll"      - "!:\sys\bin\HtiUsbSerialCommEcomPlugin.dll"
+
+; Test service plug-ins
+"\epoc32\release\armv5\urel\HtiEchoServicePlugin.dll"            - "!:\sys\bin\HtiEchoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiEchoServicePlugin.rsc"       - "!:\Resource\Plugins\HtiEchoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiKeyEventServicePlugin.dll"        - "!:\sys\bin\HtiKeyEventServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiKeyEventServicePlugin.rsc"   - "!:\Resource\Plugins\HtiKeyEventServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiScreenshotServicePlugin.dll"      - "!:\sys\bin\HtiScreenshotServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiScreenshotServicePlugin.rsc" - "!:\Resource\Plugins\HtiScreenshotServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiFtpServicePlugin.dll"             - "!:\sys\bin\HtiFtpServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiFtpServicePlugin.rsc"        - "!:\Resource\Plugins\HtiFtpServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppServicePlugin.dll"             - "!:\sys\bin\HtiAppServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAppServicePlugin.rsc"        - "!:\Resource\Plugins\HtiAppServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppControl.dll"                   - "!:\sys\bin\HtiAppControl.dll"
+"\epoc32\release\armv5\urel\HtiStifTfServicePlugin.dll"          - "!:\sys\bin\HtiStifTfServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiStifTfServicePlugin.rsc"     - "!:\Resource\Plugins\HtiStifTfServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSysInfoServicePlugin.dll"         - "!:\sys\bin\HtiSysInfoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiSysInfoServicePlugin.rsc"    - "!:\Resource\Plugins\HtiSysInfoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAudioServicePlugin.dll"           - "!:\sys\bin\HtiAudioServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAudioServicePlugin.rsc"      - "!:\Resource\Plugins\HtiAudioServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiMessagesServicePlugin.dll"        - "!:\sys\bin\HtiMessagesServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiMessagesServicePlugin.rsc"   - "!:\Resource\Plugins\HtiMessagesServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiPIMServicePlugin.dll"             - "!:\sys\bin\HtiPIMServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+
+; File helper with capability ALL - for file operations to TCB folders
+"\epoc32\release\armv5\urel\HtiFileHlp.exe"                      - "!:\sys\bin\HtiFileHlp.exe"
+
+; Backup fake DLL used by HtiFtpServicePlugin
+"\epoc32\release\armv5\urel\HtiFtpBackupFake.dll"                - "!:\sys\bin\HtiFtpBackupFake.dll"
+
+; HTI watchdog
+"\epoc32\release\armv5\urel\HtiWatchDog.exe"                     - "!:\sys\bin\HtiWatchDog.exe"
+
+; HTI device reboot
+"\epoc32\release\armv5\urel\HtiDeviceRebootUI.exe"               - "!:\sys\bin\HtiDeviceRebootUI.exe"
+
+; HTI Framework
+"\epoc32\release\armv5\urel\HTIFramework.exe"                    - "!:\sys\bin\HTIFramework.exe"
+
+; AutoStart recogniser plug-in
+"\epoc32\release\armv5\urel\HtiAutoStart.dll"                    - "!:\sys\bin\HtiAutoStart.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAutoStart.rsc"               - "!:\Resource\Plugins\HtiAutoStart.rsc"
+
+; HTI startup wait
+"\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
+
+; Startup list resource file for starting HTIFramework.exe in device boot
+"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_S60_Upgrade-52.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-52.pkg	Fri May 14 15:53:02 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,18,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,21,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- a/htiui/sis/HTI_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/htiui/sis/HTI_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,18,0
+#{"HTI"},(0x1020DEB6),2,21,0
 
 ; Localised Vendor name
 %{"Nokia"}
--- a/launcher/data/launcher.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,445 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-NAME MATT
-
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <avkon.mbg>
-#include <AvkonIcons.hrh>
-
-#include "launcher.hrh"
-#include <data_caging_paths_strings.hrh>
-#include <appinfo.rh>
-#include <CommonDialogs.hrh> // Enumerations
-#include <CommonDialogs.rh> // Resource structures
-
-
-// ---------------------------------------------------------
-//   
-//    Define the resource file signature 
-//    This resource should be empty.
-//
-// ---------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//   
-//    Default Document Name
-//
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name { buf=""; }
-
-// ---------------------------------------------------------
-//   
-//    Define default menu and CBA key.
-//
-// ---------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-	status_pane = r_launcher_status_pane;
-    //menubar = r_launcher_menubar;
-    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_launcher_hotkeys
-//
-//----------------------------------------------------
-//
-RESOURCE HOTKEYS r_launcher_hotkeys
-    {
-    control=
-        {
-        HOTKEY { command=EAknCmdExit; key='e'; }
-        };
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_launcher_view1
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_launcher_view1
-    {
-    hotkeys=r_launcher_hotkeys;
-    menubar=r_launcher_menubar_view1;  
-    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_menubar_view1
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_launcher_menubar_view1
-    {
-    titles=
-        {
-        MENU_TITLE { menu_pane=r_launcher_app_menu; txt="App"; },
-        MENU_TITLE { menu_pane=r_launcher_view1_menu; txt="View"; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_view1_menu
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_launcher_view1_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=ECmdLaunchApps; cascade=r_launcher_launchapps_submenu; txt="Launch apps"; },
-        MENU_ITEM { command=ECmdLaunchOptions; cascade=r_launcher_launchoptions_submenu; txt = "Launch options"; },
-        MENU_ITEM { command=ECmdRefreshList; txt = "Refresh list"; },
-        MENU_ITEM { command=EAknMarkAll; txt="Select all"; },
-        MENU_ITEM { command=EAknUnmarkAll; txt="Unselect all"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_launcher_launchapps_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=ECmdLaunchAppsWithAutoClose; txt="Autoclose"; },
-        MENU_ITEM { command=ECmdLaunchAppsWithoutAutoClose; txt="No autoclose"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_launcher_launchoptions_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=ECmdSkipHiddenAndEmbedOnly; txt="Skip hidden & embed"; flags = EEikMenuItemRadioStart | EEikMenuItemSymbolOn; },
-        MENU_ITEM { command=ECmdDoNotSkipAnyFiles; txt="Do not skip any entries"; flags = EEikMenuItemRadioEnd; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_view2
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_launcher_view2
-    {
-    hotkeys=r_launcher_hotkeys;
-    menubar=r_launcher_menubar_view2;  
-    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT; 
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_menubar_view2
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_launcher_menubar_view2
-    {
-    titles=
-        {
-        MENU_TITLE { menu_pane=r_launcher_app_menu; txt="App"; },
-        MENU_TITLE { menu_pane=r_launcher_view2_menu; txt="View"; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_view2_menu
-//    ?description
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_launcher_view2_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=ECmdClearWindow; txt = "Clear window"; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_view3
-//
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_launcher_view3
-    {
-    hotkeys=r_launcher_hotkeys;     
-    cba=R_AVKON_SOFTKEYS_QUIT; 
-    }
-
-
-//----------------------------------------------------
-//   
-//    r_launcher_app_menu
-//
-//----------------------------------------------------
-//
-
-RESOURCE MENU_PANE r_launcher_app_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=ECmdDLLInfo; cascade=r_launcher_dllinfo_submenu; txt = "DLL info"; },
-        MENU_ITEM { command=ECmdStopLaunch; txt = "Stop launch"; },
-        MENU_ITEM { command=ECmdDeleteLog; txt = "Delete log(s)"; },
-        MENU_ITEM { command=ECmdAbout; txt = "About"; },
-        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_launcher_dllinfo_submenu
-    {
-    items = 
-        {        
-        MENU_ITEM { command=ECmdCompareDLLs; txt="DLL BC Analysis"; }
-        };
-    }
-        
-//----------------------------------------------------
-    
-RESOURCE STATUS_PANE_APP_MODEL r_launcher_status_pane
-    {
-	panes=
-		{
-		SPANE_PANE
-			{
-			id = EEikStatusPaneUidNavi;
-			type = EAknCtNaviPane;
-			resource = r_launcher_navi_decorator;
-			}
-		};
-    }
-
-//----------------------------------------------------
-//   
-//    r_launcher_navi_decorator
-//    ?description
-//
-//----------------------------------------------------
-//
-RESOURCE NAVI_DECORATOR r_launcher_navi_decorator
-    {
-    type = ENaviDecoratorControlTabGroup;
-    control = TAB_GROUP
-		{
-		tab_width = EAknTabWidthWithTwoTabs;
-		active = 0;
-		tabs = {
-			TAB
-				{
-                id = ELauncherView1Tab;
-                txt = "Apps";
-                },
-			TAB
-				{
-                id = ELauncherView2Tab;
-                txt = "Out";
-				}
-			};
-		};
-	}
-
-
-// ---------------------------------------------------------
-//   
-//   r_launcher_about_dialog
-//   About dialog - show version and copyright info etc.
-//
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_launcher_about_dialog
-{
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-    {
-        DLG_LINE
-        {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-            {
-                label = "About Launcher";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-            };
-        },
-        DLG_LINE
-        {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-            {
-                message = "Version 3.7.0 - 29th May 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
-            };
-        }
-    };
-}
-
-// ---------------------------------------------------------
-//   
-//   r_yes_no_dialog
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_yes_no_dialog
- {
- flags = EGeneralQueryFlags;
- buttons = R_AVKON_SOFTKEYS_YES_NO;
- items =
-   {
-   DLG_LINE
-     {
-     type = EAknCtQuery;
-     id = EYesNoQuery;
-     control = AVKON_CONFIRMATION_QUERY
-       {
-       layout = EConfirmationQueryLayout;
-       label = "";
-       };
-     }
-   };
- }
-
-// ---------------------------------------------------------
-//   
-//   r_general_progress_note
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_progress_note
-    {
-    flags = EAknProgressNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = EProgressNote;
-            control = AVKON_NOTE
-                {
-                layout = EProgressLayout;
-                singular_label = "Analysing DLLs";
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_general_wait_note
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_wait_note
-    {
-    flags = EAknWaitNoteFlags | EEikDialogFlagNotifyEsc;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtNote;
-            id = EWaitNote;
-            control= AVKON_NOTE 
-                { 
-                layout = EWaitLayout;
-                animation = R_QGN_GRAF_WAIT_BAR_ANIM;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_memory_selection_dialog
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog
-{
-title = "Choose memory:";
-}
-
-// ---------------------------------------------------------
-//   
-//   r_file_selection_dialog
-//   
-//
-// ---------------------------------------------------------
-//
-RESOURCE FILESELECTIONDIALOG r_file_selection_dialog
-{
-title = "Select input file:";
-//root_path = "C:\\Data\\";
-filters =
-{
-FILTER
-{
-filter_type = EAttributeFilter;
-filter_style = EExclusiveFilter;
-filter_data = { "SH", "R" }; // Excludes system, hidden and read-only attributes
-}
-};
-}
-
-// ---------------------------------------------------------
-//   
-//    New framework:
-//    Secure platform and scalable UI changes 
-//
-// ---------------------------------------------------------
-//
-RESOURCE LOCALISABLE_APP_INFO r_launcher_localisable_app_info
-    {
-    short_caption = "Launcher";
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = "Launcher";
-
-        number_of_icons = 1;
-
-        // Note for ROM-based apps it is recommended to add the drive letter
-        // icon_file = "z:"APP_BITMAP_DIR"\\myapp_aif.mif";
-        icon_file = APP_BITMAP_DIR"\\launcher_aif.mif";
-        };
-    }
-  
--- a/launcher/data/launcher_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <launcher.rsg>
-#include <appinfo.rh>
-#include <data_caging_paths_strings.hrh>
-
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x101FB74F
-
-
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "Launcher";
-    localisable_resource_file = APP_RESOURCE_DIR"\\Launcher";
-    localisable_resource_id = R_LAUNCHER_LOCALISABLE_APP_INFO;
-    group_name = "RnD Tools";
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/e32image.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __LAUNCHERE32IMAGE_H__
+#define __LAUNCHERE32IMAGE_H__
+
+#include <e32base.h>
+#include <badesca.h>
+#include <eikenv.h>
+
+class E32ImageHeader;
+class E32ImportSection;
+class E32RelocSection;
+class CEikonEnv;
+
+
+NONSHARABLE_CLASS(E32ImageReader) : public CBase, public TProcessCreateInfo
+	{
+public:
+	static E32ImageReader* NewLC();
+	~E32ImageReader();
+
+public:
+    CDesCArray* ListOfDLLsL(const TDesC& aFullPathToE32Image);
+
+private:
+	E32ImageReader();
+	void ConstructL();
+    TInt LoadData();
+    static TUint8* MemoryMove(TAny* aDestination, const TAny* aSource, TInt aNumberofBytes);
+    TInt LoadFile(TUint32 aCompression);
+    TInt LoadFileNoCompress();
+    void LoadFileInflateL();
+    TInt Read(TText8* aDest, TInt aSize);
+    TInt Read(TInt aPos, TText8* aDest, TInt aSize);
+    TInt ReadImportData();
+
+private:
+	CEikonEnv*      iEnv;
+
+public:
+	E32ImageHeader* iHeader;
+	E32ImportSection* iImportSection;
+	E32RelocSection* iCodeRelocSection;
+	E32RelocSection* iDataRelocSection;
+	TUint32* iImportData;
+	TUint8* iRestOfFileData;
+	TUint32 iRestOfFileSize;
+	TUint32 iConversionOffset;
+	RFile iFile;
+	TUint32 iCodeDelta;
+	TUint32 iDataDelta;
+	TUint32 iExportDirLoad;
+	TBool isDll;
+	TBool iAlreadyLoaded;
+	TAny* iCloseCodeSeg;
+	TInt iCurrentImportCount;
+	TInt iNextImportPos;
+	TUint32* iCurrentImportList;
+	TUint8 iCurrentImportListSorted;
+	TUint8 iExportDirLoadAllocated;
+	TUint8 iPadding1;
+	TUint8 iPadding2;
+	};
+
+#endif // __LAUNCHERE32IMAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/e32imageheaders.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,540 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef __LAUNCHERE32IMAGEHEADERS_H__
+#define __LAUNCHERE32IMAGEHEADERS_H__
+
+#include <e32uid.h>
+
+// from e32Huffman.h
+
+/** @file
+    @internalTechnology
+*/
+
+/** Bit output stream.
+    Good for writing bit streams for packed, compressed or huffman data algorithms.
+
+    This class must be derived from and OverflowL() reimplemented if the bitstream data
+    cannot be generated into a single memory buffer.
+*/
+class TBitOutput
+    {
+public:
+    IMPORT_C TBitOutput();
+    IMPORT_C TBitOutput(TUint8* aBuf,TInt aSize);
+    inline void Set(TUint8* aBuf,TInt aSize);
+    inline const TUint8* Ptr() const;
+    inline TInt BufferedBits() const;
+//
+    IMPORT_C void WriteL(TUint aValue, TInt aLength);
+    IMPORT_C void HuffmanL(TUint aHuffCode);
+    IMPORT_C void PadL(TUint aPadding);
+private:
+    void DoWriteL(TUint aBits, TInt aSize);
+    virtual void OverflowL();
+private:
+    TUint iCode;        // code in production
+    TInt iBits;
+    TUint8* iPtr;
+    TUint8* iEnd;
+    };
+
+/** Set the memory buffer to use for output
+
+    Data will be written to this buffer until it is full, at which point OverflowL() will
+    be called. This should handle the data and then can Set() again to reset the buffer
+    for further output.
+    
+    @param aBuf The buffer for output
+    @param aSize The size of the buffer in bytes
+*/
+inline void TBitOutput::Set(TUint8* aBuf,TInt aSize)
+    {iPtr=aBuf;iEnd=aBuf+aSize;}
+    
+/** Get the current write position in the output buffer
+
+    In conjunction with the address of the buffer, which should be known to the
+    caller, this describes the data in the bitstream.
+*/
+inline const TUint8* TBitOutput::Ptr() const
+    {return iPtr;}
+    
+/** Get the number of bits that are buffered
+
+    This reports the number of bits that have not yet been written into the
+    output buffer. It will always lie in the range 0..7. Use PadL() to
+    pad the data out to the next byte and write it to the buffer.
+*/
+inline TInt TBitOutput::BufferedBits() const
+    {return iBits+8;}
+
+/** Bit input stream. Good for reading bit streams for packed, compressed or huffman
+    data algorithms.
+*/
+class TBitInput
+    {
+public:
+    IMPORT_C TBitInput();
+    IMPORT_C TBitInput(const TUint8* aPtr, TInt aLength, TInt aOffset=0);
+    IMPORT_C void Set(const TUint8* aPtr, TInt aLength, TInt aOffset=0);
+//
+    IMPORT_C TUint ReadL();
+    IMPORT_C TUint ReadL(TInt aSize);
+    IMPORT_C TUint HuffmanL(const TUint32* aTree);
+private:
+    virtual void UnderflowL();
+private:
+    TInt iCount;
+    TUint iBits;
+    TInt iRemain;
+    const TUint32* iPtr;
+    };
+
+
+/** Huffman code toolkit.
+
+    This class builds a huffman encoding from a frequency table and builds
+    a decoding tree from a code-lengths table
+
+    The encoding generated is based on the rule that given two symbols s1 and s2, with 
+    code length l1 and l2, and huffman codes h1 and h2:
+
+        if l1<l2 then h1<h2 when compared lexicographically
+        if l1==l2 and s1<s2 then h1<h2 ditto
+
+    This allows the encoding to be stored compactly as a table of code lengths
+*/
+class Huffman
+    {
+public:
+    enum {KMaxCodeLength=27};
+    enum {KMetaCodes=KMaxCodeLength+1};
+    enum {KMaxCodes=0x8000};
+public:
+    IMPORT_C static void HuffmanL(const TUint32 aFrequency[],TInt aNumCodes,TUint32 aHuffman[]);
+    IMPORT_C static void Encoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aEncodeTable[]);
+    IMPORT_C static void Decoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aDecodeTree[],TInt aSymbolBase=0);
+    IMPORT_C static TBool IsValid(const TUint32 aHuffman[],TInt aNumCodes);
+//
+    IMPORT_C static void ExternalizeL(TBitOutput& aOutput,const TUint32 aHuffman[],TInt aNumCodes);
+    IMPORT_C static void InternalizeL(TBitInput& aInput,TUint32 aHuffman[],TInt aNumCodes);
+    };
+
+// end e32Huffman.h
+
+enum TCpu
+	{
+	ECpuUnknown=0, ECpuX86=0x1000, ECpuArmV4=0x2000, ECpuArmV5=0x2001, ECpuArmV6=0x2002, ECpuMCore=0x4000
+	};
+	
+const TInt KOrdinalBase=1;
+const TUint KImageDll				= 0x00000001u;
+const TUint KImageNoCallEntryPoint	= 0x00000002u;
+const TUint KImageFixedAddressExe	= 0x00000004u;
+const TUint KImageOldJFlag			= 0x00000008u;	// so we can run binaries built with pre 2.00 tools (hdrfmt=0)
+const TUint KImageOldElfFlag		= 0x00000010u;	// so we can run binaries built with pre 2.00 tools (hdrfmt=0)
+const TUint KImageABIMask			= 0x00000018u;	// only if hdr fmt not zero
+const TInt	KImageABIShift			= 3;
+const TUint	KImageABI_GCC98r2		= 0x00000000u;	// for ARM
+const TUint	KImageABI_EABI			= 0x00000008u;	// for ARM
+const TUint KImageEptMask			= 0x000000e0u;	// entry point type
+const TInt	KImageEptShift			= 5;
+const TUint KImageEpt_Eka1			= 0x00000000u;
+const TUint KImageEpt_Eka2			= 0x00000020u;
+const TUint KImageHdrFmtMask		= 0x0f000000u;
+const TInt	KImageHdrFmtShift		= 24;
+const TUint KImageHdrFmt_Original	= 0x00000000u;	// without compression support
+const TUint KImageHdrFmt_J			= 0x01000000u;	// with compression support
+const TUint KImageHdrFmt_V			= 0x02000000u;	// with versioning support
+const TUint KImageImpFmtMask		= 0xf0000000u;
+const TInt	KImageImpFmtShift		= 28;
+const TUint KImageImpFmt_PE			= 0x00000000u;	// PE-derived imports
+const TUint KImageImpFmt_ELF		= 0x10000000u;	// ELF-derived imports
+const TUint KImageImpFmt_PE2		= 0x20000000u;	// PE-derived imports without redundant copy of import ordinals
+const TUint KImageHWFloatMask		= 0x00f00000u;
+const TInt	KImageHWFloatShift		= 20;
+const TUint	KImageHWFloat_None		= EFpTypeNone << KImageHWFloatShift; // No hardware floating point used
+const TUint KImageHWFloat_VFPv2		= EFpTypeVFPv2 << KImageHWFloatShift; // ARM VFPv2 floating point used
+
+const TUint KMyFormatNotCompressed=0;
+const TUint KMyUidCompressionDeflate=0x101F7AFC;
+
+const TUint32 KImageCrcInitialiser	= 0xc90fdaa2u;
+/*
+const TUint16 KReservedRelocType        = (TUint16)0x0000;
+const TUint16 KTextRelocType            = (TUint16)0x1000;
+const TUint16 KDataRelocType            = (TUint16)0x2000;
+const TUint16 KInferredRelocType        = (TUint16)0x3000;
+*/
+class RFile;
+class E32ImageHeader
+	{
+public:
+	inline static TUint ABIFromFlags(TUint aFlags)
+		{
+		if (aFlags&KImageHdrFmtMask)
+			return aFlags & KImageABIMask;
+		if (aFlags&KImageOldElfFlag)
+			return KImageABI_EABI;
+		return KImageABI_GCC98r2;
+		}
+	inline static TUint EptFromFlags(TUint aFlags)
+		{
+		if (aFlags&KImageHdrFmtMask)
+			return aFlags & KImageEptMask;
+		if (aFlags&KImageOldJFlag)
+			return KImageEpt_Eka2;
+		return KImageEpt_Eka1;
+		}
+	inline static TUint HdrFmtFromFlags(TUint aFlags)
+		{
+		if (aFlags&KImageHdrFmtMask)
+			return aFlags & KImageHdrFmtMask;
+		if (aFlags&KImageOldJFlag)
+			return KImageHdrFmt_J;
+		return KImageHdrFmt_Original;
+		}
+	inline static TUint ImpFmtFromFlags(TUint aFlags)
+		{
+		if (aFlags&KImageHdrFmtMask)
+			return aFlags & KImageImpFmtMask;
+		if (aFlags&KImageOldElfFlag)
+			return KImageImpFmt_ELF;
+		return KImageImpFmt_PE;
+		}
+	inline TUint32 CompressionType() const
+		{
+		if (HdrFmtFromFlags(iFlags) >= KImageHdrFmt_J)
+			return iCompressionType;
+		return 0;
+		}
+	inline TUint32 ModuleVersion() const
+		{
+		if ((iFlags & KImageHdrFmtMask) >= KImageHdrFmt_V)
+			return iModuleVersion;
+		return 0x00000000u;
+		}
+	inline TInt TotalSize() const;
+	inline TInt UncompressedFileSize() const;
+	inline TUint HeaderFormat() const
+		{ return HdrFmtFromFlags(iFlags); }
+	inline TUint EntryPointFormat() const
+		{ return EptFromFlags(iFlags); }
+	inline TUint ImportFormat() const
+		{ return ImpFmtFromFlags(iFlags); }
+	inline TUint ABI() const
+		{ return ABIFromFlags(iFlags); }
+	inline void GetSecurityInfo(SSecurityInfo& aInfo) const;
+	inline TCpu CpuIdentifier() const;
+	inline TProcessPriority ProcessPriority() const;
+	inline TUint32 ExceptionDescriptor() const;
+	TInt IntegrityCheck(TInt aFileSize);
+	static TInt New(E32ImageHeader*& aHdr, RFile& aFile);
+public:
+	TUint32	iUid1;
+	TUint32	iUid2;
+	TUint32	iUid3;
+	TUint32 iUidChecksum;
+	TUint iSignature;			// 'EPOC'
+	TUint32	iHeaderCrc;			// CRC-32 of entire header
+	TUint32 iModuleVersion;		// Version number for this executable (used in link resolution)
+	TUint32 iCompressionType;	// Type of compression used (UID or 0 for none)
+	TVersion iToolsVersion;		// Version of PETRAN/ELFTRAN which generated this file
+	TUint32 iTimeLo;
+	TUint32 iTimeHi;
+	TUint iFlags;				// 0 = exe, 1 = dll, 2 = fixed address exe
+	TInt iCodeSize;				// size of code, import address table, constant data and export dir
+	TInt iDataSize;				// size of initialised data
+	TInt iHeapSizeMin;
+	TInt iHeapSizeMax;
+	TInt iStackSize;
+	TInt iBssSize;
+	TUint iEntryPoint;			// offset into code of entry point
+	TUint iCodeBase;			// where the code is linked for	
+	TUint iDataBase;			// where the data is linked for
+	TInt iDllRefTableCount;		// filling this in enables E32ROM to leave space for it
+	TUint iExportDirOffset;		// offset into the file of the export address table
+	TInt iExportDirCount;
+	TInt iTextSize;				// size of just the text section, also doubles as the offset for the iat w.r.t. the code section
+	TUint iCodeOffset;			// file offset to code section, also doubles as header size
+	TUint iDataOffset;			// file offset to data section
+	TUint iImportOffset;		// file offset to import section
+	TUint iCodeRelocOffset;		// relocations for code and const
+	TUint iDataRelocOffset;		// relocations for data
+	TUint16 iProcessPriority;	// executables priority
+	TUint16 iCpuIdentifier;		// 0x1000 = X86, 0x2000 = ARM
+	};
+
+class E32ImageHeaderComp : public E32ImageHeader
+	{
+public:
+	TUint32 iUncompressedSize;	// Uncompressed size of file
+								// For J format this is file size - sizeof(E32ImageHeader)
+								//  and this is included as part of the compressed data :-(
+								// For other formats this is file size - total header size
+	};
+
+class E32ImageHeaderV : public E32ImageHeaderComp
+	{
+public:
+	SSecurityInfo iS;
+
+	// Use iSpare1 as offset to Exception Descriptor
+	TUint32 iExceptionDescriptor;   // Offset in bytes from start of code section to Exception Descriptor, bit 0 set if valid
+	TUint32 iSpare2;
+	TUint16	iExportDescSize;	// size of bitmap section
+	TUint8	iExportDescType;	// type of description of holes in export table
+	TUint8	iExportDesc[1];		// description of holes in export table - extend
+	};
+
+// export description type
+const TUint	KImageHdr_ExpD_NoHoles			=0x00;	// no holes, all exports present
+const TUint	KImageHdr_ExpD_FullBitmap		=0x01;	// full bitmap present
+const TUint	KImageHdr_ExpD_SparseBitmap8	=0x02;	// sparse bitmap present, granularity 8
+const TUint	KImageHdr_ExpD_Xip				=0xff;	// XIP file
+
+
+inline TInt E32ImageHeader::TotalSize() const
+	{
+	if (HeaderFormat() == KImageHdrFmt_J && iCompressionType != 0)
+		return sizeof(E32ImageHeaderComp);
+	return iCodeOffset;
+	}
+
+inline TInt E32ImageHeader::UncompressedFileSize() const
+	{
+	TUint hdrfmt = HeaderFormat();
+	if (hdrfmt == KImageHdrFmt_Original || iCompressionType == 0)
+		return -1;			// not compressed
+	else if (hdrfmt == KImageHdrFmt_J)
+		return ((E32ImageHeaderComp*)this)->iUncompressedSize + sizeof(E32ImageHeader);
+	else
+		return ((E32ImageHeaderComp*)this)->iUncompressedSize + iCodeOffset;
+	}
+
+extern const SSecurityInfo KDefaultSecurityInfo;
+inline void E32ImageHeader::GetSecurityInfo(SSecurityInfo& aInfo) const
+	{
+	if (HeaderFormat() >= KImageHdrFmt_V)
+		aInfo = ((E32ImageHeaderV*)this)->iS;
+	else
+		aInfo = KDefaultSecurityInfo;
+	}
+
+inline TCpu E32ImageHeader::CpuIdentifier() const
+	{
+	if (HeaderFormat() >= KImageHdrFmt_V)
+		return (TCpu)iCpuIdentifier;
+	return (TCpu)iHeaderCrc;
+	}
+
+inline TProcessPriority E32ImageHeader::ProcessPriority() const
+	{
+	if (HeaderFormat() >= KImageHdrFmt_V)
+		return (TProcessPriority)iProcessPriority;
+	return *(const TProcessPriority*)&iProcessPriority;
+	}
+
+inline TUint32 E32ImageHeader::ExceptionDescriptor() const
+	{
+	if (HeaderFormat() >= KImageHdrFmt_V)
+		{
+		TUint32 xd = ((E32ImageHeaderV*)this)->iExceptionDescriptor;
+		if ((xd & 1) && (xd != 0xffffffffu))
+			return (xd & ~1);
+		}
+	return 0;
+	}
+
+class E32ImportBlock
+	{
+public:
+	inline const E32ImportBlock* NextBlock(TUint aImpFmt) const;
+	inline TInt Size(TUint aImpFmt) const;
+	inline const TUint* Imports() const;	// import list if present
+public:
+	TUint32	iOffsetOfDllName;	// offset of name of dll importing from
+	TInt	iNumberOfImports;	// no of imports from this dll
+//	TUint	iImport[iNumberOfImports];	// list of imported ordinals, omitted in PE2 import format
+	};
+
+inline TInt E32ImportBlock::Size(TUint aImpFmt) const
+	{
+	TInt r = sizeof(E32ImportBlock);
+	if (aImpFmt!=KImageImpFmt_PE2)
+		r += iNumberOfImports * sizeof(TUint);
+	return r;
+	}
+
+inline const E32ImportBlock* E32ImportBlock::NextBlock(TUint aImpFmt) const
+	{
+	const E32ImportBlock* next = this + 1;
+	if (aImpFmt!=KImageImpFmt_PE2)
+		next = (const E32ImportBlock*)( (TUint8*)next + iNumberOfImports * sizeof(TUint) );
+	return next;
+	}
+
+inline const TUint* E32ImportBlock::Imports() const
+	{
+	return (const TUint*)(this + 1);
+	}
+
+class E32ImportSection
+	{
+public:
+	TInt iSize;					// size of this section
+//	E32ImportBlock[iDllRefTableCount];
+	};
+
+class E32RelocSection
+	{
+public:
+	TInt iSize;					// size of this relocation section
+	TInt iNumberOfRelocs;		// number of relocations in this section
+	};
+
+
+typedef TUint8* (*TMemoryMoveFunction)(TAny* aTrg,const TAny* aSrc,TInt aLength);
+
+const TInt KDeflateLengthMag=8;
+const TInt KDeflateDistanceMag=12;
+const TInt KDeflateMinLength=3;
+const TInt KDeflateMaxLength=KDeflateMinLength-1 + (1<<KDeflateLengthMag);
+const TInt KDeflateMaxDistance=(1<<KDeflateDistanceMag);
+const TInt KDeflateDistCodeBase=0x200;
+const TUint KDeflateHashMultiplier=0xAC4B9B19u;
+const TInt KDeflateHashShift=24;
+const TInt KInflateWindowSize=0x8000;
+
+
+class TEncoding
+	{
+public:
+	enum {ELiterals=256,ELengths=(KDeflateLengthMag-1)*4,ESpecials=1,EDistances=(KDeflateDistanceMag-1)*4};
+	enum {ELitLens=ELiterals+ELengths+ESpecials};
+	enum {EEos=ELiterals+ELengths};
+public:
+	TUint32 iLitLen[ELitLens];
+	TUint32 iDistance[EDistances];
+	};
+
+const TInt KDeflationCodes=TEncoding::ELitLens+TEncoding::EDistances;
+
+NONSHARABLE_CLASS(CInflater) : public CBase
+	{
+public:
+	enum {EBufSize = 0x800, ESafetyZone=8};
+public:
+	static CInflater* NewLC(TBitInput& aInput);
+	~CInflater();
+	TInt ReadL(TUint8* aBuffer,TInt aLength, TMemoryMoveFunction aMemMovefn);
+	TInt SkipL(TInt aLength);
+private:
+	CInflater(TBitInput& aInput);
+	void ConstructL();
+	void InitL();
+	TInt InflateL();
+private:
+	TBitInput* iBits;
+	const TUint8* iRptr;			
+	TInt iLen;
+	const TUint8* iAvail;		
+	const TUint8* iLimit;
+	TEncoding* iEncoding;
+	TUint8* iOut;				
+	};
+
+void DeflateL(const TUint8* aBuf, TInt aLength, TBitOutput& aOutput);
+
+	
+NONSHARABLE_CLASS(TFileInput) : public TBitInput
+	{
+ 	enum {KBufSize=KInflateWindowSize};
+public:
+	TFileInput(RFile& aFile);
+	void Cancel();
+private:
+	void UnderflowL();
+private:
+	RFile& iFile;
+	TRequestStatus iStat;
+	TUint8* iReadBuf;
+	TPtr8 iPtr;
+	TUint8 iBuf1[KBufSize];
+	TUint8 iBuf2[KBufSize];
+	};
+
+class TFileNameInfo
+	{
+public:
+	enum
+    	{
+    	EIncludeDrive=1,
+    	EIncludePath=2,
+    	EIncludeBase=4,
+    	EIncludeVer=8,
+    	EForceVer=16,
+    	EIncludeUid=32,
+    	EForceUid=64,
+    	EIncludeExt=128,
+    	EIncludeDrivePath=EIncludeDrive|EIncludePath,
+    	EIncludeBaseExt=EIncludeBase|EIncludeExt,
+    	EIncludeDrivePathBaseExt=EIncludeDrive|EIncludePath|EIncludeBase|EIncludeExt,
+    	};
+	enum
+		{
+		EAllowUid=1,
+		EAllowPlaceholder=2,
+		EAllowDecimalVersion=4,
+		};
+public:
+	TFileNameInfo();
+	TInt Set(const TDesC8& aFileName, TUint aFlags);
+	void Dump() const;
+public:
+	inline TInt DriveLen() const {return iPathPos;}
+	inline TInt PathLen() const {return iBasePos-iPathPos;}
+	inline TInt BaseLen() const {return iVerPos-iBasePos;}
+	inline TInt VerLen() const {return iUidPos-iVerPos;}
+	inline TInt UidLen() const {return iExtPos-iUidPos;}
+	inline TInt ExtLen() const {return iLen-iExtPos;}
+	inline TPtrC8 Drive() const {return TPtrC8(iName, iPathPos);}
+	inline TPtrC8 Path() const {return TPtrC8(iName+iPathPos, iBasePos-iPathPos);}
+	inline TPtrC8 DriveAndPath() const {return TPtrC8(iName, iBasePos);}
+	inline TPtrC8 Base() const {return TPtrC8(iName+iBasePos, iVerPos-iBasePos);}
+	inline TPtrC8 VerStr() const {return TPtrC8(iName+iVerPos, iUidPos-iVerPos);}
+	inline TPtrC8 UidStr() const {return TPtrC8(iName+iUidPos, iExtPos-iUidPos);}
+	inline TPtrC8 Ext() const {return TPtrC8(iName+iExtPos, iLen-iExtPos);}
+	inline TUint32 Version() const {return iVersion;}
+	inline TUint32 Uid() const {return iUid;}
+	void GetName(TDes8& aName, TUint aFlags) const;
+public:
+	const TText8* iName;
+	TInt iPathPos;
+	TInt iBasePos;
+	TInt iVerPos;
+	TInt iUidPos;
+	TInt iExtPos;
+	TInt iLen;
+	TUint32 iVersion;
+	TUint32 iUid;
+	};
+
+
+#endif // __LAUNCHERE32IMAGEHEADERS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launcherdllelement.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef LAUNCHERDLLELEMENT_H_
+#define LAUNCHERDLLELEMENT_H_
+
+#include <e32base.h>
+
+typedef TBuf8<8> TDllIdValue;
+
+class CLauncherDLLElement : public CBase
+    {
+public:
+    
+    enum TDifference
+        {
+        EDifference_UID1,      // UID1 is different
+        EDifference_UID2,      // UID1 is different
+        EDifference_UID3,      // UID1 is different
+        EDifference_SID,       // SID is different
+        EDifference_Capability // Capabilities are different
+        };
+    
+    virtual ~CLauncherDLLElement();
+    static CLauncherDLLElement* NewL();
+    static CLauncherDLLElement* NewLC(); 
+    
+    /*
+     * Compares DLL elements.
+     * @return ETrue if differencies exist, EFalse otherwise.     
+     * @param aReferenceElement Reference DLL-element for comparison
+     * @param aDifferenceList Differencies are added to this list.
+     */
+    TBool CompareL(const CLauncherDLLElement& aReferenceElement, RArray<TDifference>& aDifferenceList) const;
+    
+    /*
+     * Returns DLL name
+     * @return DLL name
+     */
+    TFileName Name() const;    
+    /*
+     * Sets DLL name
+     * @param aName DLL name
+     */
+    void SetNameL(const TFileName& aName);
+    
+    /*
+     * Returns DLL UID1
+     * @return UID1 object
+     */
+    TUid UID1() const;
+    
+    /*
+     * Sets DLL UID1 
+     * @param aUID1 UID1 object
+     */
+    void SetUID1L(TUid aUID1);
+    
+    /*
+     * Returns DLL UID2
+     * @return UID2 object
+     */
+    TUid UID2() const;
+        
+    /*
+     * Sets DLL UID2 
+     * @param aUID2 UID2 object
+     */
+    void SetUID2L(TUid aUID2);
+        
+    /*
+     * Returns DLL UID3
+     * @return UID3 object
+     */
+    TUid UID3() const;
+    
+    /*
+     * Sets DLL UID3
+     * @param aUID3 UID3 object
+     */
+    void SetUID3L(TUid aUID3);
+    
+    /*
+     * Returns DLL SID
+     * @return SID object
+     */
+    TUid SID() const;
+    
+    /*
+     * Sets DLL SID
+     * @param aSID SID object
+     */
+    void SetSIDL(TUid aSID);
+    
+    /*
+     * Returns DLL capability
+     * @return capability value
+     */    
+    TUint32 Capability() const;
+    
+    /*
+     * Sets DLL capability
+     * @param aCapability capability value
+     */
+    void SetCapabilityL(TUint32 aCapability);
+    
+protected:
+    CLauncherDLLElement();
+    virtual void ConstructL();
+    
+private:
+    TFileName   iName;
+    TUid iUID1;
+    TUid iUID2;
+    TUid iUID3;
+    TUid iSID;
+    TUint32 iCapability;
+    };
+
+#endif /* LAUNCHERDLLELEMENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launcherdllparser.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef LAUNCHERDLLPARSER_H_
+#define LAUNCHERDLLPARSER_H_
+
+#include <e32base.h>
+#include <f32file.h>
+#include "launcherdllelement.h"
+
+#define UID1_OFFSET 0x00
+#define UID2_OFFSET 0x04
+#define UID3_OFFSET 0x08
+#define SID_OFFSET_ROM 0x44
+#define SID_OFFSET_ROFS 0x80
+#define CAPABILITY_OFFSET_ROM 0x4c
+#define CAPABILITY_OFFSET_ROFS 0x88
+
+class CLauncherDLLParser : public CBase
+    {
+public:
+
+    virtual ~CLauncherDLLParser();
+    static CLauncherDLLParser* NewL();
+    static CLauncherDLLParser* NewLC();
+    
+    /**
+     * Reads data from the given DLL-file and sets parsed data to given object.
+     * @param aFileSession Reference to an open file session     
+     * @param aFile Reference to the DLL file object
+     * @param aElement Reference to the element, which will contain the parsed data
+     */
+    void ParseL( RFs& aFileSession, RFile& aFile, CLauncherDLLElement& aElement );
+    
+private:
+
+    CLauncherDLLParser();
+    void ConstructL();
+    
+    /**
+     * Reads 32-bit unsigned integer from the given file.
+     * @return 32-bit unsigned integer value.
+     * @param aFile File handle.
+     */
+    TUint32 ReadUint32L( RFile& aFile );
+    };
+
+#endif /* LAUNCHERDLLPARSER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launcherengine.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef LAUNCHERENGINE_H
+#define LAUNCHERENGINE_H
+
+#include <e32base.h>
+#include <apgcli.h>
+#include <w32std.h>
+#include <e32std.h> 
+
+#include "launcherparserobserver.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CEikonEnv;
+class CAppThreadChecker;
+class CAppRunningChecker;
+class CLauncherXMLParser;
+class CLauncherDLLParser;
+
+
+// INFERFACE FOR COMMUNICATION WITH UI
+
+class MLauncherUI
+{
+public:
+    /**
+     * Method for writing text to output window.
+     * @param aText A text to be written.
+     * @return None.
+     */
+    virtual void PrintText(const TDesC& aText) = 0;
+
+    /**
+     * Shows info message with text
+     * @param aText An text to be shown in message.
+     * @return None.
+     */
+    virtual void ShowInfoMessage(const TDesC& aText) = 0;
+    
+    /**
+     * Shows error message with error text
+     * @param aText An error text to be shown in message.
+     * @return None.
+     */
+    virtual void ShowErrorMessage(const TDesC& aText) = 0;
+    
+    /**
+     * Shows progress bar with text
+     * @param aText A text to be shown at top of the progress bar.
+     * @param aMinimum A minimum progress bar value.
+     * @param aMaximum A maximum progress bar value.
+     * @return None.
+     */
+    virtual void ShowProgressBar(const TDesC& aText, TInt aMinimum, TInt aMaximum ) = 0;
+
+    /**
+     * Sets progress bar value
+     * @param aValue A value between min and max value of the progress bar range
+     * @return None.
+     */
+    virtual void SetProgressBarValue(TInt aValue) = 0;
+
+    /**
+     * Hides progress bar
+     * @return None.
+     */
+    virtual void HideProgressBar() = 0;
+
+    /**
+     * Shows wait dialog with text
+     * @param aText A text to be shown at top of the wait bar.
+     * @return None.
+     */
+    virtual void ShowWaitDialog(const TDesC& aText) = 0;
+
+    /**
+     * Hides wait dialog
+     * @return None.
+     */
+    virtual void HideWaitDialog() = 0;
+    
+    /**
+     * Changes focus to output view
+     * @return None.
+     */
+    virtual void ChangeFocusToOutputView() = 0;
+    
+};
+
+// CLASS DECLARATION
+
+class CLauncherEngine: public CActive, public MLauncherParserObserver
+{
+
+public:
+    static CLauncherEngine* NewL(MLauncherUI *aLauncherUI);
+    ~CLauncherEngine();
+    CDesCArray* ListOfAllAppsL();
+    void StartAppLaunchingL(const CArrayFix<TInt>* aSelectedApps, TBool aAutoClose);
+    void CheckIfAppIsRunningL();
+    void CheckWhyThreadDiedL();
+    void StopLaunchingL();
+    TBool LogFileExists();
+    TBool BCLogFileExists();
+    
+    TInt DeleteLogFile();
+    TInt DeleteBCLogFile();
+    
+    void AnalyseDLLsL( const TDesC& aFileName );
+    
+    void ElementParsedL(const CLauncherDLLElement& aDllElement);
+    void DocumentParsedL(TInt aErrorCode);
+    void ParsingProgressedL(TInt aBytes);
+    TInt ReadLineFromFileL(RFile& aFile, TDes& aReadBuf);
+    
+    const TDesC& RequiredDllsFilePath() const { return iRequiredDllsFilePath; };
+    
+    void CancelBCAnalysis();
+    
+private:
+    CLauncherEngine();
+    void ConstructL(MLauncherUI *aLauncherUI);
+    
+    void RunL();
+    void DoCancel();
+        
+    TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
+    void IssueLaunch();
+    void WriteInitialStuffToTheLogL(const TDesC& aOwnData, RFile& aFile);
+    void CheckForMoreAppsL();
+    void LaunchApplicationL();
+    void DoLaunchApplicationL();
+    CDesCArray* DependencyCheckForE32ImageL();
+
+    /**
+     * Performs binary compatibility analysis based on reference data given
+     * in XML-file.
+     */
+    void DoBCAnalysisL();
+    
+    /**
+     * Compares given DLL list to system DLLs
+     */
+    void DoCompareDLLListsL();
+    
+private:
+
+    MLauncherUI *iLauncherUI;
+    
+    RTimer          iTimer;
+    CEikonEnv*      iEnv;
+    RApaLsSession   iLs;
+    RWsSession      iWs;
+    HBufC8*         iLogWriteBuf;    
+    RFile           iLogFile;
+    RFile           iBCLogFile;  
+    TFileName       iLogFilePath;
+    TFileName       iBCLogFilePath;
+    TFileName       iSystemDllsFilePath;
+    TFileName       iRequiredDllsFilePath;        
+        
+    CDesCArray*     iAppsArray;
+    CDesCArray*     iAllAppsArray;
+    CDesCArray*     iSystemDllArray;
+//  CDesCArray*     iRequiredDllArray;
+
+    TBool           iLaunchingIsActive;
+    TBool           iDLLAnalysisIsActive;
+    TBool           iSkipHiddenAndEmbedOnly;
+    TBool           iAutoClose;
+    TInt            iAppLaunchCounter;
+    TInt            iFailedCases;
+    TInt            iOkCases;
+    TInt            iSkippedCases;
+    TInt            iTotalNumberOfCases;
+
+    TUid            iCurrentAppUid;
+    TThreadId       iCurrentAppThreadId;
+    TBuf<128>       iCurrentAppNameAndExt;
+    RThread         iCurrentAppThread;
+//
+    CAppThreadChecker*          iAppThreadChecker;
+    CAppRunningChecker*         iAppRunningChecker;
+
+    CLauncherXMLParser*     iXMLParser;
+    CLauncherDLLParser*     iDLLParser;
+    CLauncherDLLElement*    iDLLElement;
+    
+    TInt                iFoundBCIssues;
+    HBufC*              iBCIssuesBigBuffer;
+
+        
+public:
+    inline TBool SkipHiddenAndEmbedOnly()              { return iSkipHiddenAndEmbedOnly; };
+    inline void SetSkipHiddenAndEmbedOnly(TBool aSkip) { iSkipHiddenAndEmbedOnly = aSkip; };
+    inline const TDesC& LogFilePath() { return iLogFilePath; }
+    inline const TDesC& BCLogFilePath() { return iBCLogFilePath; }
+    inline const TDesC& SystemDllsFilePath() { return iSystemDllsFilePath; }
+};
+
+
+
+class CAppRunningChecker : public CActive
+    {
+public:
+    static CAppRunningChecker* NewL(CLauncherEngine* aLauncherEngine);
+    ~CAppRunningChecker();
+
+    void StartTesting();
+
+private:
+    CAppRunningChecker();
+    void ConstructL(CLauncherEngine* aLauncherEngine);
+
+    void RunL();
+    void DoCancel();
+
+private:
+    RTimer iTimer;
+    CEikonEnv* iEnv;
+    CLauncherEngine* iLauncherEngine;
+    };
+
+class CAppThreadChecker : public CActive
+    {
+public:
+    static CAppThreadChecker* NewL(CLauncherEngine* aLauncherEngine);
+    ~CAppThreadChecker();
+
+    void ActivateChecking();
+    void CheckIfAppIsRunningL();
+
+private:
+    CAppThreadChecker();
+    void ConstructL(CLauncherEngine* aLauncherEngine);
+
+    void RunL();
+    void DoCancel();
+
+private:
+    CEikonEnv* iEnv;
+    CLauncherEngine* iLauncherEngine;
+    };
+
+
+#endif //LAUNCHERENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launcherparserobserver.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef LAUNCHERPARSEROBSERVER_H_
+#define LAUNCHERPARSEROBSERVER_H_
+
+class CLauncherDLLElement;
+
+class MLauncherParserObserver
+{
+public:
+    
+    /**
+     * This method is called when parser has parsed next DLL element     
+     * @param aDllElement Parsed DLL element.     
+     */    
+    virtual void ElementParsedL(const CLauncherDLLElement& aDllElement) = 0;
+    
+    /**
+     * This method is called when the parsing is completed. If parsing was
+     * stopped due to an error, an error code is given in parameter.
+     * @param aErrorCode KErrNone if document was parsed successfully.
+     */
+    virtual void DocumentParsedL(TInt aErrorCode) = 0;
+    
+    /**
+     * Parser calls this function during parsing to indicate the amount of
+     * bytes parsed from the given file.
+     * @param aBytes Amount of data (in bytes) parsed. Amount is incremental.
+     */
+    virtual void ParsingProgressedL(TInt aBytes) = 0;
+    
+};
+
+#endif /* LAUNCHERPARSEROBSERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launchertraces.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __LAUNCHER_TRACES_H__
+#define __LAUNCHER_TRACES_H__
+
+#include <e32def.h>
+
+
+// ---------------------------------------------------------------------------
+// You change these logging method values below! Recompile the application to take changes effect.
+
+    // logging methods
+    // 0 = No logging
+    // 1 = Flogger
+    // 2 = RDebug
+    // 3 = Flogger and RDebug
+    
+    #ifndef _DEBUG
+        
+        // Logging method for UREL builds:
+        #define LAUNCHER_LOGGING_METHOD  2
+
+    #else
+
+        // Logging method for UDEB builds:
+        #define LAUNCHER_LOGGING_METHOD  0
+
+    #endif    
+    
+
+
+// ---------------------------------------------------------------------------
+// Do not make any changes to lines below...
+
+    #if LAUNCHER_LOGGING_METHOD == 1 || LAUNCHER_LOGGING_METHOD == 3
+
+        #include <flogger.h>
+        _LIT(KLogFolder,"Launcher");
+        _LIT(KLogFile,"Launcher_Trace.txt");
+
+    #endif
+
+    #if LAUNCHER_LOGGING_METHOD == 2 || LAUNCHER_LOGGING_METHOD == 3
+
+        #include <e32debug.h>
+
+    #endif
+
+
+    #if LAUNCHER_LOGGING_METHOD == 0
+    
+        #define LOGTEXT(AAA)
+        #define LOGSTRING(AAA)
+        #define LOGSTRING2(AAA,BBB)
+        #define LOGSTRING3(AAA,BBB,CCC)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD)
+    
+    
+    #elif LAUNCHER_LOGGING_METHOD == 1
+    
+        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+   
+    #elif LAUNCHER_LOGGING_METHOD == 2
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
+    
+    #elif LAUNCHER_LOGGING_METHOD == 3
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+
+    #endif
+
+// ---------------------------------------------------------------------------
+
+#endif // __LAUNCHER_TRACES_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/inc/launcherxmlparser.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef LAUNCHERXMLPARSER_H_
+#define LAUNCHERXMLPARSER_H_
+
+#include <e32base.h>
+#include <xml/contenthandler.h>
+#include <xml/parser.h>
+#include "launcherdllelement.h"
+#include "launcherparserobserver.h"
+
+using namespace Xml;
+
+const TUint KXMLBufferSize = 1024;
+
+class CLauncherDLLElement;
+
+/**
+ * Parses DLL data from the given XML-file
+ */
+class CLauncherXMLParser : public CActive, public MContentHandler
+{
+public:
+
+    virtual ~CLauncherXMLParser();
+    static CLauncherXMLParser* NewL(RFs& aFs);
+    static CLauncherXMLParser* NewLC(RFs& aFs);
+    
+    /**
+     * Parses the given XML-file and notifies the observer.
+     * @param aFilePath XML-file's path
+     * @param aObserver Pointer to the observer instance.
+     */
+    void ParseL(const TDesC& aFilePath, MLauncherParserObserver* aObserver);
+        
+protected:
+    
+    // from CActive    
+    void DoCancel();    
+    void RunL();
+    
+private:
+
+    CLauncherXMLParser(RFs& aFs);
+    void ConstructL();
+    
+    /**
+     * Tells whether the current XML element is a sub-element of the 'dll'-element.
+     * @return ETrue if the current XML-element is sub-element of the 'dll'-element.
+     */
+    TBool IsDataElement();
+
+    /**
+     * Deletes current data buffer and zeroes the pointer.
+     */
+    void ClearXMLDataBuffer();
+    
+    /**
+     * Converts 8-bit descriptor to 32-bit unsigned integer
+     * @return Converted 32-bit unsigned integer value.
+     * @param aStr 8-bit descriptor to be converted.
+     */
+    TUint32 ConvertDes8ToUint32L(const TDesC8& aStr);
+                
+public:
+    // From MContentHandler:    
+    void OnStartDocumentL(const RDocumentParameters &aDocParam, TInt aErrorCode);
+    void OnEndDocumentL(TInt aErrorCode);
+    void OnStartElementL(   const RTagInfo& aElement, 
+                            const RAttributeArray& aAttributes, 
+                            TInt aErrorCode);
+    void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnStartPrefixMappingL( const RString& aPrefix, 
+                                const RString& aUri, 
+                                TInt aErrorCode);
+    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+    void OnProcessingInstructionL(  const TDesC8& aTarget, 
+                                    const TDesC8& aData, 
+                                    TInt aErrorCode);
+    void OnError(TInt aErrorCode);
+    TAny* GetExtendedInterface(const TInt32 aUid);    
+    
+private:
+    CParser* iParser;  // XML parser
+    RFs& iFileSession;
+    RFile iFile; // XML file 
+    TBuf8<KXMLBufferSize> iXMLDataBuffer;
+    MLauncherParserObserver* iObserver;
+    CLauncherDLLElement* iCurrentDllElement;
+    TBuf8<KMaxFileName> iCurrentContent;
+    TBuf8<KMaxName> iCurrentElementName;
+    TBool iIgnoreError;
+    TInt  iParsedBytes;
+};
+
+#endif /* LAUNCHERXMLPARSER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/src/e32image.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,846 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#include "e32image.h"
+#include "e32imageheaders.h"
+#include "launchertraces.h"
+
+
+const TInt KMaxHeaderSize = sizeof(E32ImageHeaderV) + 65536/8;
+
+SCapabilitySet AllCapabilities;
+SCapabilitySet DisabledCapabilities;
+
+// ---------------------------------------------------------------------------
+
+E32ImageReader* E32ImageReader::NewLC()
+    {
+    E32ImageReader* self = new(ELeave) E32ImageReader;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+E32ImageReader::E32ImageReader()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+void E32ImageReader::ConstructL()
+    {
+    LOGSTRING("Launcher: E32ImageReader::ConstructL");
+
+    iEnv = CEikonEnv::Static();
+    }
+
+// ---------------------------------------------------------------------------
+
+CDesCArray* E32ImageReader::ListOfDLLsL(const TDesC& aFullPathToE32Image)
+    {
+    LOGSTRING("Launcher: E32ImageReader::ListOfDLLsL");
+
+    // open the file for reading
+    User::LeaveIfError( iFile.Open(iEnv->FsSession(), aFullPathToE32Image, EFileRead) );
+    CleanupClosePushL(iFile);
+    
+    // get local copies of capability sets
+    TCapabilitySet caps;
+    caps.SetAllSupported();
+    AllCapabilities=*(SCapabilitySet*)&caps;
+    caps.SetDisabled();
+    DisabledCapabilities=*(SCapabilitySet*)&caps;
+
+    // read the header of the image
+    User::LeaveIfError( E32ImageHeader::New(iHeader, iFile) );
+
+    // set stuff
+    iHeapSizeMin = iHeader->iHeapSizeMin;
+    iHeapSizeMax = iHeader->iHeapSizeMax;
+    iStackSize = iHeader->iStackSize;
+    iPriority = iHeader->ProcessPriority();
+    iDepCount = iHeader->iDllRefTableCount;
+    iExportDirCount = iHeader->iExportDirCount;
+    iExportDir = iHeader->iExportDirOffset-iHeader->iCodeOffset;
+    iTextSize = iHeader->iTextSize;
+    iCodeSize = iHeader->iCodeSize;
+    iDataSize = iHeader->iDataSize;
+    iBssSize = iHeader->iBssSize;
+    iTotalDataSize = iDataSize+iBssSize;
+    iFileEntryPoint = iHeader->iEntryPoint;
+    iEntryPtVeneer = 0;
+    iExceptionDescriptor = iHeader->ExceptionDescriptor();
+    if (iHeader->iExportDirOffset)
+        iExportDirLoad=iExportDir;
+    
+    // allocate data for the code area
+    iCodeLoadAddress = (TUint32)User::Alloc(iCodeSize);
+    
+    // load data from the binary
+    User::LeaveIfError( LoadData() );
+
+    // create an array for the dll names from the import list
+    CDesCArray* dllArray = new(ELeave) CDesCArrayFlat(100);
+    CleanupStack::PushL(dllArray);
+
+    // get the dll names from the import section
+    E32ImportSection* importSection = (E32ImportSection *)iImportData;
+    E32ImportBlock* block;
+    if(importSection)
+        block = (E32ImportBlock*)(importSection+1);
+    else
+        block = NULL;
+    iNextImportPos = 0;
+
+    // loop through all import data blocks
+    for (TInt i=0; i<iDepCount; i++)
+        {
+        // get a pointer to the dll name
+        TPtrC8 dllname = (const TText8*)((TUint32)iImportData + block->iOffsetOfDllName);
+        TBuf8<KMaxKernelName> rootname;
+        if (dllname.Length() > KMaxKernelName)
+            User::Leave( KErrNotSupported );
+        
+        // parse the filename
+        TFileNameInfo fni;
+        User::LeaveIfError( fni.Set(dllname, TFileNameInfo::EAllowUid) );
+        fni.GetName(rootname, TFileNameInfo::EIncludeBaseExt);
+
+        // append the name to the dll name array
+        TFileName dllName16;
+        dllName16.Copy(rootname);
+        dllArray->AppendL(dllName16);
+
+        // get the next block
+        TUint impfmt = iHeader->ImportFormat();
+        block = (E32ImportBlock*)block->NextBlock(impfmt);
+        }
+
+    CleanupStack::Pop();  //dllArray
+    CleanupStack::PopAndDestroy(); //iFile
+
+    // free memory
+    delete iHeader;
+    iHeader = NULL;
+    delete iImportSection;
+    iImportSection = NULL;
+    delete iCodeRelocSection;
+    iCodeRelocSection = NULL;
+    delete iDataRelocSection;
+    iDataRelocSection = NULL;
+    
+    User::Free((TAny*)iCodeLoadAddress);
+    User::Free(iRestOfFileData);
+    User::Free(iCurrentImportList);
+    if (iExportDirLoadAllocated)
+        User::Free((TAny*)iExportDirLoad);
+
+    return dllArray;
+    }
+
+// ---------------------------------------------------------------------------
+
+E32ImageReader::~E32ImageReader()
+    {
+    LOGSTRING("Launcher: E32ImageReader::~E32ImageReader");
+    }
+
+
+// ---------------------------------------------------------------------------
+
+TInt FileRead(RFile& aFile, TUint8* aDest, TInt aSize)
+    {
+    TPtr8 p(aDest,aSize,aSize);
+    return aFile.Read(p,aSize);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageHeader::New(E32ImageHeader*& aHdr, RFile& aFile)
+    {
+    LOGSTRING("Launcher: E32ImageHeader::New");
+
+    E32ImageHeader* h = NULL;
+    TInt hdrsz = 0;
+    TInt filesize;
+    TInt r = aFile.Size(filesize);
+    if (r!=KErrNone)
+        return r;
+    E32ImageHeader bh;
+    r = FileRead(aFile, (TUint8*)&bh, sizeof(E32ImageHeader));
+    if (r==KErrNone)
+        {
+        hdrsz = bh.TotalSize();
+        if ( (TUint(hdrsz) > TUint(KMaxHeaderSize)) || (TUint(hdrsz) < TUint(sizeof(bh))) )
+            return KErrCorrupt;
+        }
+    h = (E32ImageHeader*)User::Alloc(hdrsz);
+    if (!h)
+        return KErrNoMemory;
+    wordmove(h, &bh, sizeof(E32ImageHeader));
+    if (hdrsz > (TInt)sizeof(E32ImageHeader))
+        r = FileRead(aFile, (TUint8*)(h + 1), hdrsz - sizeof(E32ImageHeader));
+    if (r==KErrNone)
+        r = h->IntegrityCheck(filesize);
+    if (r==KErrNone)
+        {
+        if (h->HeaderFormat() >= KImageHdrFmt_V)
+            {
+            // Overide capabilities in image
+            for(TInt i=0; i<SCapabilitySet::ENCapW; i++)
+                {
+                ((E32ImageHeaderV*)h)->iS.iCaps[i] |= DisabledCapabilities[i];
+                ((E32ImageHeaderV*)h)->iS.iCaps[i] &= AllCapabilities[i];
+                }
+            }
+        aHdr = h;
+        }
+    else
+        {
+        delete h;
+        aHdr = NULL;
+        }
+    return r;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageHeader::IntegrityCheck(TInt aFileSize)
+    {
+    LOGSTRING("Launcher: E32ImageHeader::IntegrityCheck");
+    
+    TInt hdrsz = TotalSize();
+    TUint hdrfmt = HeaderFormat();
+    TUidType uids = *(const TUidType*)&iUid1;
+    E32ImageHeaderV* v = NULL;
+    TCheckedUid chkuid(uids);
+    const TUint32* pChkUid = (const TUint32*)&chkuid;
+
+    if (pChkUid[3] != iUidChecksum)
+        return KErrCorrupt;    
+
+    if (hdrfmt == KImageHdrFmt_V)
+        {
+        TUint32 supplied_crc = iHeaderCrc;
+        iHeaderCrc = KImageCrcInitialiser;
+        TUint32 crc = 0;
+        Mem::Crc32(crc, this, hdrsz);
+        iHeaderCrc = supplied_crc;
+        if (crc != supplied_crc)
+            return KErrCorrupt;    
+        v = (E32ImageHeaderV*)this;
+        TUint total_eds = v->iExportDescSize + sizeof(v->iExportDescSize) + sizeof(v->iExportDescType);
+        total_eds = (total_eds + 3) &~ 3;
+        if (total_eds + (TUint)_FOFF(E32ImageHeaderV, iExportDescSize) != (TUint)hdrsz)
+            return KErrCorrupt;
+        if (TUint(v->iExportDescType) > KImageHdr_ExpD_SparseBitmap8)
+            return KErrNotSupported;
+        }
+    else if (hdrfmt >= KImageHdrFmt_V)
+        return KErrNotSupported; 
+
+    TCpu cpu = CpuIdentifier();
+    TUint abi = ABI();
+    TUint impfmt = ImportFormat();
+    TUint compression = CompressionType();
+
+    TUint uncompressed_size = compression ? UncompressedFileSize() : (TUint)aFileSize;
+
+    if (iSignature != 0x434f5045) // 'EPOC'
+        return KErrCorrupt;
+    if (iCodeSize<0)
+        return KErrCorrupt;
+    if (iDataSize<0)
+        return KErrCorrupt;
+    if (iHeapSizeMin<0)
+        return KErrCorrupt;
+    if (iHeapSizeMax<iHeapSizeMin)
+        return KErrCorrupt;
+    if (iStackSize<0)
+        return KErrCorrupt;
+    if (iBssSize<0)
+        return KErrCorrupt;
+    if (iDllRefTableCount<0)
+        return KErrCorrupt;
+    if (iExportDirOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (TUint(iExportDirCount)>65535)
+        return KErrCorrupt;
+    if (iTextSize<0)
+        return KErrCorrupt;
+    if (iCodeSize<iTextSize)
+        return KErrCorrupt;
+    if (iCodeOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (iDataOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (iImportOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (iCodeRelocOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (iDataRelocOffset >= uncompressed_size)
+        return KErrCorrupt;
+    if (TUint(iCodeSize+iDataSize) > uncompressed_size)
+        return KErrCorrupt;
+
+    if (abi>KImageABI_EABI)
+        return KErrNotSupported;
+    if (impfmt>KImageImpFmt_PE2)
+        return KErrNotSupported;
+    if (iUid1 != (TUint32)KExecutableImageUidValue && iUid1 != (TUint32)KDynamicLibraryUidValue)
+        return KErrNotSupported;
+    TUint32 mv = ModuleVersion();
+    if (mv >= 0x80000000u || (mv & 0x0000ffffu) > 0x8000u)
+        return KErrNotSupported;
+
+    return KErrNone;
+    }
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::LoadData()
+    {
+    LOGSTRING("Launcher: E32ImageReader::LoadData");
+
+    TInt remainder;
+    iFile.Size(remainder);
+    
+    remainder -= iHeader->TotalSize();
+    TUint32 compression = iHeader->CompressionType();
+    if (compression != KMyFormatNotCompressed)
+        {
+        remainder = iHeader->UncompressedFileSize() - iHeader->iCodeOffset;
+        }
+
+    remainder -= iHeader->iCodeSize;
+    
+    if (remainder > 0)
+        {
+        iRestOfFileData = (TUint8*)User::Alloc(remainder);
+        if (iRestOfFileData)
+            iRestOfFileSize=remainder;
+        else
+            return KErrNoMemory;
+        }
+
+    iConversionOffset = iHeader->iCodeOffset + iHeader->iCodeSize;
+
+    TInt r = LoadFile(compression);
+    if (r !=KErrNone)
+        return r;
+
+
+    TUint8* source=NULL;
+    if (iHeader->iImportOffset)
+        {
+        TUint bufferOffset=iHeader->iImportOffset-iConversionOffset;
+        
+        if(bufferOffset>iRestOfFileSize || bufferOffset+sizeof(E32ImportSection)>iRestOfFileSize)
+            return KErrCorrupt;
+        
+        source=iRestOfFileData+bufferOffset;
+        
+        iImportSection = new E32ImportSection;
+        
+        if (iImportSection)
+            Mem::Move((TText8*)iImportSection, source, sizeof(E32ImportSection));
+        else
+            return KErrNoMemory;
+        }
+
+    iCodeDelta = iCodeRunAddress-iHeader->iCodeBase;
+    iDataDelta = iDataRunAddress-iHeader->iDataBase;
+
+    if (r==KErrNone)
+        r = ReadImportData();
+
+    return r;
+    }
+
+// ---------------------------------------------------------------------------
+
+TUint8* E32ImageReader::MemoryMove(TAny* aDestination, const TAny* aSource, TInt aNumberofBytes)
+    {
+    return Mem::Move(aDestination, aSource, aNumberofBytes);
+    }
+
+// ---------------------------------------------------------------------------
+
+GLDEF_C TInt svRelocateExports(TAny* aPtr)
+    {
+    E32ImageReader* pI=(E32ImageReader*)aPtr;
+    TUint32* destExport=(TUint32*)pI->iExportDirLoad;
+    TInt i=pI->iExportDirCount;
+    TUint32 codeBase=pI->iCodeRunAddress;
+    while (i-->0)
+        *destExport+++=codeBase;
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::LoadFile(TUint32 aCompression)
+    {
+    LOGSTRING("Launcher: E32ImageReader::LoadFile");
+
+    TInt r(KErrNone);
+
+    if (aCompression == KMyFormatNotCompressed)
+        r=LoadFileNoCompress();
+    
+    else if (aCompression == KMyUidCompressionDeflate)
+        {
+        TRAP(r, LoadFileInflateL());
+        }
+    
+    else
+        r = KErrNotSupported;
+    
+    return r;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::LoadFileNoCompress()
+    {
+    LOGSTRING("Launcher: E32ImageReader::LoadFileNoCompress");
+
+    TInt r(KErrNone);
+
+    if (iHeader->iCodeSize)
+        {
+        r = Read(iHeader->iCodeOffset, (TText8*)iCodeLoadAddress, iCodeSize);
+        }
+
+    if (r != KErrNone)
+        {
+        return r;
+        }
+
+    if (iRestOfFileSize)
+        {
+        r = Read(iConversionOffset, (TText8*)iRestOfFileData, iRestOfFileSize);
+        }
+    
+    return r;
+    }
+
+// ---------------------------------------------------------------------------
+
+void FileCleanup(TAny* aPtr)
+    {
+    TFileInput* f=(TFileInput*)aPtr;
+    f->Cancel();
+    delete f;
+    }
+
+// ---------------------------------------------------------------------------
+
+void E32ImageReader::LoadFileInflateL()
+    {
+    LOGSTRING("Launcher: E32ImageReader::LoadFileInflateL");
+
+    TInt pos = iHeader->TotalSize();
+    User::LeaveIfError(iFile.Seek(ESeekStart,pos));
+
+    TFileInput* file = new (ELeave) TFileInput(iFile);
+    CleanupStack::PushL(TCleanupItem(&FileCleanup,file));
+    CInflater* inflater = CInflater::NewLC(*file);
+    
+    if (iHeader->iCodeSize)
+        {
+        TInt count = inflater->ReadL((TUint8*)iCodeLoadAddress, iCodeSize, &MemoryMove);
+        
+        if(count!=iCodeSize)
+            User::Leave(KErrCorrupt);
+        }
+
+    if (iRestOfFileSize)
+        {
+        TUint32 count = inflater->ReadL(iRestOfFileData, iRestOfFileSize, &Mem::Move);
+        
+        if(count!=iRestOfFileSize)
+            User::Leave(KErrCorrupt);
+        }
+    
+    CleanupStack::PopAndDestroy(2,file);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::Read(TText8* aDest, TInt aSize)
+    {
+    TPtr8 p(aDest,aSize,aSize);
+    return iFile.Read(p,aSize);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::Read(TInt aPos, TText8* aDest, TInt aSize)
+    {
+    TPtr8 p(aDest,aSize,aSize);
+    if (aPos<0)
+        return KErrCorrupt;
+    return iFile.Read(aPos,p,aSize);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt E32ImageReader::ReadImportData()
+    {
+    LOGSTRING("Launcher: E32ImageReader::ReadImportData");
+
+    if (!iHeader->iImportOffset)
+        return KErrNone;
+    
+    TUint32 bufferOffset = iHeader->iImportOffset-iConversionOffset;
+    
+    if(bufferOffset>iRestOfFileSize || bufferOffset+iImportSection->iSize>iRestOfFileSize)
+        return KErrCorrupt;
+    
+    iImportData = (TUint32*)(iRestOfFileData+bufferOffset);
+    
+    E32ImportSection* s = (E32ImportSection*)iImportData;
+    E32ImportBlock* b = (E32ImportBlock*)(s + 1);
+    TUint impfmt = iHeader->ImportFormat();
+    TInt i;
+    TInt n = 0;
+    
+    for (i=0; i<iDepCount; ++i)
+        {
+        if (b->iNumberOfImports > n)
+            n = b->iNumberOfImports;
+        b = (E32ImportBlock*)b->NextBlock(impfmt);
+        }
+    
+    iCurrentImportList = (TUint32*)User::Alloc(n * sizeof(TUint32));
+    
+    if (!iCurrentImportList)
+        return KErrNoMemory;
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+
+inline CInflater::CInflater(TBitInput& aInput)
+    :iBits(&aInput),iEncoding(0),iOut(0)
+    {}
+
+// ---------------------------------------------------------------------------
+
+void CInflater::ConstructL()
+    {
+    iEncoding=new(ELeave) TEncoding;
+    InitL();
+    iLen=0;
+    iOut=new(ELeave) TUint8[KDeflateMaxDistance];
+    iAvail=iLimit=iOut;
+    }
+
+// ---------------------------------------------------------------------------
+
+CInflater* CInflater::NewLC(TBitInput& aInput)
+    {
+    CInflater* self=new(ELeave) CInflater(aInput);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CInflater::~CInflater()
+    {
+    delete iEncoding;
+    delete [] iOut;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CInflater::ReadL(TUint8* aBuffer,TInt aLength, TMemoryMoveFunction aMemMovefn)
+    {
+    TInt tfr=0;
+    for (;;)
+        {
+        TInt len=Min(aLength,iLimit-iAvail);
+        if (len && aBuffer)
+            {
+            aMemMovefn(aBuffer,iAvail,len);
+            aBuffer+=len;
+            }
+        aLength-=len;
+        iAvail+=len;
+        tfr+=len;
+        if (aLength==0)
+            return tfr;
+        len=InflateL();
+        if (len==0)
+            return tfr;
+        iAvail=iOut;
+        iLimit=iAvail+len;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CInflater::SkipL(TInt aLength)
+    {
+    return ReadL(0,aLength,Mem::Move);
+    }
+
+// ---------------------------------------------------------------------------
+
+void CInflater::InitL()
+    {
+    Huffman::InternalizeL(*iBits,iEncoding->iLitLen,KDeflationCodes);
+
+    if (!Huffman::IsValid(iEncoding->iLitLen,TEncoding::ELitLens) ||
+        !Huffman::IsValid(iEncoding->iDistance,TEncoding::EDistances))
+        User::Leave(KErrCorrupt);
+
+    Huffman::Decoding(iEncoding->iLitLen,TEncoding::ELitLens,iEncoding->iLitLen);
+    Huffman::Decoding(iEncoding->iDistance,TEncoding::EDistances,iEncoding->iDistance,KDeflateDistCodeBase);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CInflater::InflateL()
+    {
+    TUint8* out=iOut;
+    TUint8* const end=out+KDeflateMaxDistance;
+    const TUint32* tree=iEncoding->iLitLen;
+    if (iLen<0)    // EOF
+        return 0;
+    if (iLen>0)
+        goto useHistory;
+
+    while (out<end)
+        {
+        // get a huffman code
+        {
+        TInt val=iBits->HuffmanL(tree)-TEncoding::ELiterals;
+        if (val<0)
+            {
+            *out++=TUint8(val);
+            continue;        
+            }
+        if (val==TEncoding::EEos-TEncoding::ELiterals)
+            {    
+            iLen=-1;
+            break;
+            }
+        
+        TInt code=val&0xff;
+        if (code>=8)
+            {    
+            TInt xtra=(code>>2)-1;
+            code-=xtra<<2;
+            code<<=xtra;
+            code|=iBits->ReadL(xtra);
+            }
+        if (val<KDeflateDistCodeBase-TEncoding::ELiterals)
+            {
+            iLen=code+KDeflateMinLength;
+            tree=iEncoding->iDistance;
+            continue;        
+            }
+        
+        iRptr=out-(code+1);
+        if (iRptr+KDeflateMaxDistance<end)
+            iRptr+=KDeflateMaxDistance;
+        }
+useHistory:
+        TInt tfr=Min(end-out,iLen);
+        iLen-=tfr;
+        const TUint8* from=iRptr;
+        do
+            {
+            *out++=*from++;
+            if (from==end)
+                from-=KDeflateMaxDistance;
+            } while (--tfr!=0);
+        iRptr=from;
+        tree=iEncoding->iLitLen;
+        };
+    
+    return out-iOut;
+    }
+
+// ---------------------------------------------------------------------------
+
+TFileInput::TFileInput(RFile& aFile)
+    :iFile(aFile),iReadBuf(iBuf1),iPtr(iBuf1,KBufSize)
+    {
+    aFile.Read(iPtr,iStat);
+    }
+
+// ---------------------------------------------------------------------------
+
+void TFileInput::Cancel()
+    {
+    if (iReadBuf)
+        User::WaitForRequest(iStat);
+    }
+
+// ---------------------------------------------------------------------------
+
+void TFileInput::UnderflowL()
+    {
+    TUint8* b=iReadBuf;
+    ASSERT(b!=NULL);
+    User::WaitForRequest(iStat);
+    iReadBuf=0;
+    User::LeaveIfError(iStat.Int());
+    if(iPtr.Length()==0)
+        User::Leave(KErrCorrupt);
+    Set(b,iPtr.Length()*8);
+    
+    b = b==iBuf1 ? iBuf2 : iBuf1;
+    iPtr.Set(b,0,KBufSize);
+    iFile.Read(iPtr,iStat);
+    iReadBuf=b;
+    }
+
+// ---------------------------------------------------------------------------
+
+TFileNameInfo::TFileNameInfo()
+    {
+    memclr(this, sizeof(TFileNameInfo));
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt TFileNameInfo::Set(const TDesC8& aFileName, TUint aFlags)
+    {
+    iUid = 0;
+    iVersion = 0;
+    iPathPos = 0;
+    iName = aFileName.Ptr();
+    iLen = aFileName.Length();
+    iExtPos = aFileName.LocateReverse('.');
+    if (iExtPos<0)
+        iExtPos = iLen;
+    TInt osq = aFileName.LocateReverse('[');
+    TInt csq = aFileName.LocateReverse(']');
+    if (!(aFlags & EAllowUid) && (osq>=0 || csq>=0))
+        {
+        return KErrBadName;
+        }
+    if (osq>=iExtPos || csq>=iExtPos)
+        {
+        return KErrBadName;
+        }
+    TInt p = iExtPos;
+    if ((aFlags & EAllowUid) && p>=10 && iName[p-1]==']' && iName[p-10]=='[')
+        {
+        TPtrC8 uidstr(iName + p - 9, 8);
+        TLex8 uidlex(uidstr);
+        TUint32 uid = 0;
+        TInt r = uidlex.Val(uid, EHex);
+        if (r==KErrNone && uidlex.Eos())
+            iUid = uid, p -= 10;
+        }
+    iUidPos = p;
+    TInt ob = aFileName.LocateReverse('{');
+    TInt cb = aFileName.LocateReverse('}');
+    if (ob>=iUidPos || cb>=iUidPos)
+        {
+        return KErrBadName;
+        }
+    if (ob>=0 && cb>=0 && p-1==cb)
+        {
+        TPtrC8 p8(iName, p);
+        TInt d = p8.LocateReverse('.');
+        TPtrC8 verstr(iName+ob+1, p-ob-2);
+        TLex8 verlex(verstr);
+        if (ob==p-10 && d<ob)
+            {
+            TUint32 ver = 0;
+            TInt r = verlex.Val(ver, EHex);
+            if (r==KErrNone && verlex.Eos())
+                iVersion = ver, p = ob;
+            }
+        else if (d>ob && p-1>d && (aFlags & EAllowDecimalVersion))
+            {
+            TUint32 maj = 0;
+            TUint32 min = 0;
+            TInt r = verlex.Val(maj, EDecimal);
+            TUint c = (TUint)verlex.Get();
+            TInt r2 = verlex.Val(min, EDecimal);
+            if (r==KErrNone && c=='.' && r2==KErrNone && verlex.Eos() && maj<32768 && min<32768)
+                iVersion = (maj << 16) | min, p = ob;
+            }
+        }
+    iVerPos = p;
+    if (iLen>=2 && iName[1]==':')
+        {
+        TUint c = iName[0];
+        if (c!='?' || !(aFlags & EAllowPlaceholder))
+            {
+            c |= 0x20;
+            if (c<'a' || c>'z')
+                {
+                return KErrBadName;
+                }
+            }
+        iPathPos = 2;
+        }
+    TPtrC8 pathp(iName+iPathPos, iVerPos-iPathPos);
+    if (pathp.Locate('[')>=0 || pathp.Locate(']')>=0 || pathp.Locate('{')>=0 || pathp.Locate('}')>=0 || pathp.Locate(':')>=0)
+        {
+        return KErrBadName;
+        }
+    iBasePos = pathp.LocateReverse('\\') + 1 + iPathPos;
+
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+
+void TFileNameInfo::GetName(TDes8& aName, TUint aFlags) const
+    {
+    if (aFlags & EIncludeDrive)
+        aName.Append(Drive());
+    if (aFlags & EIncludePath)
+        {
+        if (PathLen() && iName[iPathPos]!='\\')
+            aName.Append('\\');
+        aName.Append(Path());
+        }
+    if (aFlags & EIncludeBase)
+        aName.Append(Base());
+    if ((aFlags & EForceVer) || ((aFlags & EIncludeVer) && VerLen()) )
+        {
+        aName.Append('{');
+        aName.AppendNumFixedWidth(iVersion, EHex, 8);
+        aName.Append('}');        
+        }
+    if ((aFlags & EForceUid) || ((aFlags & EIncludeUid) && UidLen()) )
+        {
+        aName.Append('[');
+        aName.AppendNumFixedWidth(iUid, EHex, 8);
+        aName.Append(']');
+        }
+    if (aFlags & EIncludeExt)
+        aName.Append(Ext());
+    }
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/src/launcherdllelement.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "launcherdllelement.h"
+#include "launchertraces.h"
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLElement::~CLauncherDLLElement()
+    {
+    LOGSTRING("Launcher: CLauncherDLLElement::~CLauncherDLLElement");    
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLElement::CLauncherDLLElement()
+    {    
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLElement* CLauncherDLLElement::NewL()
+    {
+    LOGSTRING("Launcher: CLauncherDLLElement::NewL");
+    CLauncherDLLElement* self = CLauncherDLLElement::NewLC();    
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLElement* CLauncherDLLElement::NewLC()
+    {
+    LOGSTRING("Launcher: CLauncherDLLElement::NewLC");
+    CLauncherDLLElement* self = new (ELeave) CLauncherDLLElement;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::ConstructL()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+   
+TBool CLauncherDLLElement::CompareL(const CLauncherDLLElement& aReferenceElement, RArray<TDifference>& aDifferenceList) const
+    {
+    LOGSTRING2("Launcher: CLauncherDLLElement::CompareL - DLLName: %S", &iName);
+    if( iName != aReferenceElement.Name())
+        {
+        LOGSTRING("Launcher: CLauncherDLLElement::CompareL: ERROR - DLL names don't match.");
+        User::Leave(KErrArgument);
+        }
+    
+    TBool diff = EFalse;
+            
+    if( iUID1 != aReferenceElement.UID1()) 
+        {
+        diff = ETrue;
+        aDifferenceList.Append(this->EDifference_UID1);      
+        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID1s differs: %x vs. %x", iUID1, aReferenceElement.UID1());  
+        }
+    if( iUID2!= aReferenceElement.UID2()) 
+        {
+        diff = ETrue;
+        aDifferenceList.Append(this->EDifference_UID2);        
+        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID2s differs: %x vs. %x", iUID2, aReferenceElement.UID2());  
+        }
+    if( iUID3 != aReferenceElement.UID3()) 
+        {
+        diff = ETrue;
+        aDifferenceList.Append(this->EDifference_UID3);        
+        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID3s differs: %x vs. %x", iUID3, aReferenceElement.UID3());  
+        }
+    if( iSID != aReferenceElement.SID()) 
+        {
+        diff = ETrue;
+        aDifferenceList.Append(this->EDifference_SID);        
+        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - SIDs differs: %x vs. %x", iSID, aReferenceElement.SID());  
+        }
+    if( iCapability != aReferenceElement.Capability()) 
+        {
+        diff = ETrue;
+        aDifferenceList.Append(this->EDifference_Capability);        
+        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - Capabilities differs: %x vs. %x", iCapability, aReferenceElement.Capability());  
+        }
+    
+    return diff;
+    }
+
+// ---------------------------------------------------------------------------
+
+TFileName CLauncherDLLElement::Name() const
+    {
+    return iName;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetNameL(const TFileName& aName)
+    {    
+    iName.Copy(aName); 
+    }
+
+// ---------------------------------------------------------------------------
+
+TUid CLauncherDLLElement::UID1() const
+    {
+    return iUID1;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetUID1L(TUid aUID1)
+    {
+    iUID1.iUid = aUID1.iUid;
+    }
+
+// ---------------------------------------------------------------------------
+
+TUid CLauncherDLLElement::UID2() const
+    {
+    return iUID2;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetUID2L(TUid aUID2)
+    {    
+    iUID2 = aUID2;
+    }
+
+// ---------------------------------------------------------------------------
+
+TUid CLauncherDLLElement::UID3() const
+    {    
+    return iUID3;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetUID3L(TUid aUID3)
+    {    
+    iUID3 = aUID3;
+    }
+
+// ---------------------------------------------------------------------------
+
+TUid CLauncherDLLElement::SID() const
+    {   
+    return iSID;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetSIDL(TUid aSID)
+    {    
+    iSID = aSID;
+    }
+
+// ---------------------------------------------------------------------------
+
+TUint32 CLauncherDLLElement::Capability() const
+    {
+    return iCapability;    
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLElement::SetCapabilityL(TUint32 aCapability)
+    {
+    iCapability = aCapability; 
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/src/launcherdllparser.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "launcherdllparser.h"
+#include "launchertraces.h"
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLParser::~CLauncherDLLParser()
+    {
+    LOGSTRING("Launcher: CLauncherDLLParser::~CLauncherDLLParser");
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLParser::CLauncherDLLParser()
+    {
+    LOGSTRING("Launcher: CLauncherDLLParser::CLauncherDLLParser");
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLParser* CLauncherDLLParser::NewL()
+    {
+    LOGSTRING("Launcher: CLauncherDLLParser::NewL");
+    CLauncherDLLParser* self = CLauncherDLLParser::NewLC();    
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherDLLParser* CLauncherDLLParser::NewLC()
+    {
+    LOGSTRING("Launcher: CLauncherDLLParser::NewLC");
+    CLauncherDLLParser* self = new (ELeave) CLauncherDLLParser;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLParser::ConstructL()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherDLLParser::ParseL( RFs& aFileSession, RFile& aFile, CLauncherDLLElement& aElement )
+    {
+    TFileName dllName;
+    TFileName fullName;
+    TUid tmpUID;
+    TInt offset = 0;
+        
+    aFile.Name(dllName);
+    aFile.FullName(fullName);
+    aElement.SetNameL(dllName);
+    
+    TBool isFileInRom = aFileSession.IsFileInRom(fullName) != 0;
+    
+    /**
+     * Read UID1
+     */
+    offset = UID1_OFFSET;
+    aFile.Seek(ESeekStart, offset); // Set file position   
+    tmpUID.iUid = ReadUint32L(aFile);    
+    aElement.SetUID1L(tmpUID);    
+    
+    /**
+     * Read UID2
+     */
+    offset = UID2_OFFSET;
+    aFile.Seek(ESeekStart, offset); // Set file position
+    tmpUID.iUid = ReadUint32L(aFile);    
+    aElement.SetUID2L(tmpUID);
+        
+    /**
+     * Read UID3
+     */
+    offset = UID3_OFFSET;
+    aFile.Seek(ESeekStart, offset); // Set file position
+    tmpUID.iUid = ReadUint32L(aFile);    
+    aElement.SetUID3L(tmpUID);
+        
+    /**
+     * Read SID
+     */
+    if( isFileInRom )
+        offset = SID_OFFSET_ROM;
+    else
+        offset = SID_OFFSET_ROFS;
+    aFile.Seek(ESeekStart, offset); // Set file position
+    tmpUID.iUid = ReadUint32L(aFile);    
+    aElement.SetSIDL(tmpUID);
+    
+    /**
+     * Read Capability
+     */
+    if( isFileInRom )
+        offset = CAPABILITY_OFFSET_ROM;
+    else
+        offset = CAPABILITY_OFFSET_ROFS;
+    aFile.Seek(ESeekStart, offset); // Set file position
+    TUint32 tmpVal = ReadUint32L(aFile);
+    aElement.SetCapabilityL(tmpVal);    
+    }
+
+// ---------------------------------------------------------------------------
+
+TUint32 CLauncherDLLParser::ReadUint32L( RFile& aFile )
+    {
+    TBuf8<4> tempBuf;    
+    User::LeaveIfError(aFile.Read(tempBuf, 4));
+    const TUint8* ptr = tempBuf.Ptr();    
+    return TUint32(ptr[0] | (ptr[1]<<8) | (ptr[2]<<16) | (ptr[3]<<24));    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/src/launcherengine.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1660 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <coemain.h>
+#include <eikenv.h>
+#include <pathinfo.h> 
+#include <apgtask.h>
+#include <bautils.h>
+ 
+#include "launchertraces.h"
+#include "e32image.h"
+#include "launcherxmlparser.h"
+#include "launcherdllparser.h"
+#include "launcherengine.h"
+
+_LIT(KLogFileName, "LauncherLog.txt");
+_LIT(KBCLogFileName, "LauncherBCLog.txt");
+_LIT(KSystemDllsFileName, "SystemDlls.txt");
+_LIT(KRequiredDllsFileName, "RequiredDlls.xml");
+_LIT(KDotXML,".xml");
+_LIT(KDotLauncherXML,".launcherxml");
+
+_LIT(KFileSeparator, "\t");
+_LIT(KFileNewLine, "\r\n");
+
+_LIT(KNewLine, "\n");
+
+const TInt KMaxAppsArraySize=250;
+const TInt KMaxDllArraySize=5000;
+const TInt KLauncherLogBufferSize = 4096;
+
+// After this many issues, issues are buffered and printed 
+// in the end of analysis
+const TInt KBigBufferUsageThreshold=10;
+
+// Buffer allocation unit
+const TInt KBigBufferAllocBytes=1024;
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine* CLauncherEngine::NewL(MLauncherUI *aLauncherUI)
+    {
+    CLauncherEngine* self = new(ELeave) CLauncherEngine;
+    CleanupStack::PushL(self);
+    self->ConstructL(aLauncherUI);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine::CLauncherEngine() : CActive(EActivePriorityIpcEventsHigh)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+template <typename T>
+void AppendLogBufferL(const TDesC& aText, T*& aBuf, TInt aIncreaseStep = KLauncherLogBufferSize)
+    {
+    if( aBuf == 0 )
+        {
+        aBuf = T::NewL(aIncreaseStep);
+        }
+    
+    TInt currentMaxLength = aBuf->Des().MaxLength();
+    if( aBuf->Des().Length() + aText.Length() > currentMaxLength )
+        {
+        TInt increaseSize = Max(aText.Length(), aIncreaseStep);                
+        aBuf = aBuf->ReAllocL(aBuf->Des().MaxLength() + increaseSize );
+        }
+    aBuf->Des().Append(aText);        
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::ConstructL(MLauncherUI *aLauncherUI)
+    {
+    LOGSTRING("Launcher: CLauncherEngine::ConstructL");
+    
+    User::LeaveIfNull( aLauncherUI );
+    
+    iLauncherUI = aLauncherUI;
+    
+
+    iEnv = CEikonEnv::Static();
+    iLaunchingIsActive = EFalse;
+    iDLLAnalysisIsActive = EFalse;
+    iSkipHiddenAndEmbedOnly = ETrue;
+
+    User::LeaveIfError(iTimer.CreateLocal());
+
+    User::LeaveIfError(iLs.Connect());
+    User::LeaveIfError(iWs.Connect());
+
+    iAppThreadChecker = CAppThreadChecker::NewL(this);
+    iAppRunningChecker = CAppRunningChecker::NewL(this);
+
+    iAllAppsArray = new(ELeave) CDesCArrayFlat(KMaxAppsArraySize);
+    iAppsArray = new(ELeave) CDesCArrayFlat(KMaxAppsArraySize);
+    iSystemDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
+
+    iLogWriteBuf = HBufC8::NewL(KLauncherLogBufferSize);
+
+    iLogFilePath = PathInfo::PhoneMemoryRootPath();
+    iLogFilePath.Append( KLogFileName );
+    
+    iBCLogFilePath = PathInfo::PhoneMemoryRootPath();
+    iBCLogFilePath.Append( KBCLogFileName );
+
+    iSystemDllsFilePath = PathInfo::PhoneMemoryRootPath();
+    iSystemDllsFilePath.Append( KSystemDllsFileName );
+
+    iRequiredDllsFilePath = PathInfo::PhoneMemoryRootPath();
+    iRequiredDllsFilePath.Append( KRequiredDllsFileName );
+            
+    iDLLParser = CLauncherDLLParser::NewL();
+
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine::~CLauncherEngine()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::~CLauncherEngine");
+
+    Cancel();
+
+    // close the log
+    iLogFile.Close();
+    iBCLogFile.Close();
+    if (iLogWriteBuf)
+        delete iLogWriteBuf;
+
+    if (iAppRunningChecker)
+        delete iAppRunningChecker;
+    
+    if (iAppThreadChecker)
+        delete iAppThreadChecker;
+
+    if (iSystemDllArray)
+        {
+        iSystemDllArray->Reset();
+        delete iSystemDllArray;
+        }
+
+    if (iAppsArray)
+        {
+        iAppsArray->Reset();
+        delete iAppsArray;
+        }
+
+    
+    if (iAllAppsArray)
+        {
+        iAllAppsArray->Reset();
+        delete iAllAppsArray;
+        }
+    
+    delete iXMLParser;
+   // delete iDLLParser;
+    //delete iDLLElement;
+    delete iBCIssuesBigBuffer;            
+    
+    iWs.Close();
+    iLs.Close();
+    iTimer.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::DoCancel()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DoCancel");
+    
+    if( iXMLParser )
+        {
+        iXMLParser->Cancel();
+        }
+    iTimer.Cancel();
+    
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::RunL()
+    {
+    
+    LOGSTRING("Launcher: CLauncherEngine::RunL");  
+    TInt err = iStatus.Int();
+    User::LeaveIfError(err);
+    
+    // write full app path to the log file
+    WriteInitialStuffToTheLogL(iAppsArray->MdcaPoint(iAppLaunchCounter), iLogFile);
+
+    // get the uid of the current app
+    iCurrentAppUid = KNullUid;
+    TApaAppInfo appInfo;
+    iLs.GetAllApps();
+    while (iLs.GetNextApp(appInfo) == KErrNone)
+        {
+        if (appInfo.iFullName.CompareF( iAppsArray->MdcaPoint(iAppLaunchCounter) ) == 0)
+            {
+            iCurrentAppUid = appInfo.iUid;
+            break;
+            }
+        }
+
+    if (iCurrentAppUid == KNullUid)
+        {        
+        iLogWriteBuf->Des().Append(_L("[WARN: App has no UID] "));
+        }
+
+    // parse the filename
+    TParse nameParser;
+    nameParser.SetNoWild(iAppsArray->MdcaPoint(iAppLaunchCounter), NULL, NULL);
+    iCurrentAppNameAndExt.Copy(nameParser.Drive());
+    iCurrentAppNameAndExt.Append(nameParser.NameAndExt());
+
+    // do not try to launch these apps
+    if (iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Launcher.")) != KErrNotFound
+        || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Phone.")) != KErrNotFound
+        || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Startup.")) != KErrNotFound  
+        || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\SplashScreen.")) != KErrNotFound  
+        || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\eshell.")) != KErrNotFound)  
+        {
+
+        iLauncherUI->PrintText(iCurrentAppNameAndExt);
+        iLauncherUI->PrintText(_L(": SKIPPED automatically\n"));
+        
+        iLogWriteBuf->Des().Append(_L("[SKIPPED automatically] "));
+        iLogWriteBuf->Des().Append(KFileNewLine);
+        iLogFile.Write(iLogWriteBuf->Des());
+
+        iSkippedCases++;
+        CheckForMoreAppsL();
+        }
+
+    else
+        {
+
+        // dependency check not needed if the app is in the ROM/ROFS, because they'll be checked automatically
+        // when the rom image is built
+        
+        if (iCurrentAppNameAndExt[0] != 'Z' && iCurrentAppNameAndExt[0] != 'z')
+            {
+
+            if (iCurrentAppNameAndExt[2] == '[')  // this is quite likely a Java application, no dependency test needed 
+                {
+                iLogWriteBuf->Des().Append(_L("[Dependency check not done] "));
+                }
+            else
+                {  // otherwise check depencies
+            
+                #ifdef __WINS__
+                
+                    // emulator not supported
+
+                #else
+
+                    // ELF binaries
+
+                    CDesCArray* missingDllArray = NULL;
+
+                    TRAPD(err, missingDllArray = DependencyCheckForE32ImageL());
+
+                    // some error happened while processing the E32 image
+                    if (err != KErrNone)
+                        {
+
+                        iLauncherUI->PrintText(iCurrentAppNameAndExt);
+                        iLauncherUI->PrintText(_L(": unable to read import table!\n"));
+                        
+                        iLogWriteBuf->Des().Append(_L("[Unable to read import table!] "));
+                        }
+
+                    // print missing dependencies
+                    else if (err==KErrNone && missingDllArray)
+                        {
+                        if (missingDllArray->MdcaCount() > 0)
+                            {
+                            iLauncherUI->PrintText(iCurrentAppNameAndExt);
+                            iLauncherUI->PrintText(_L(": missing dependencies: "));
+                            
+                            iLogWriteBuf->Des().Append(_L("[Missing dependencies: "));
+
+                            for (TInt k=0; k<missingDllArray->MdcaCount(); k++)
+                                {
+                                iLauncherUI->PrintText(missingDllArray->MdcaPoint(k));
+                                iLauncherUI->PrintText(_L(" "));
+                                
+                                iLogWriteBuf->Des().Append(missingDllArray->MdcaPoint(k));
+                                iLogWriteBuf->Des().Append(_L(" "));
+                                }
+
+                            iLauncherUI->PrintText(_L("\n"));
+
+                            iLogWriteBuf->Des().Append(_L("] "));
+                            }
+                        }
+
+                    if (missingDllArray)
+                        delete missingDllArray;
+
+                #endif
+
+                }  // if '['
+            }  // if 'Z'
+
+
+
+        // check if the app is already running
+        TApaTaskList taskList(iWs);
+        TApaTask thisTask = taskList.FindApp(iCurrentAppUid);
+        if (thisTask.Exists())
+            {
+            iLogWriteBuf->Des().Append(_L(" [OK: App already running]"));
+            iLogWriteBuf->Des().Append(KFileNewLine);
+            iLogFile.Write(iLogWriteBuf->Des());
+
+            iOkCases++;
+            CheckForMoreAppsL();
+            }
+        
+        else
+            {
+            // check the program's capabilities
+            TApaAppCapabilityBuf buf;
+            iLs.GetAppCapability(buf, iCurrentAppUid);
+            TApaAppCapability cap = buf();
+
+            // if it's embeddable only, don't launch if setting is enabled
+            if (cap.iEmbeddability == TApaAppCapability::EEmbeddableOnly && SkipHiddenAndEmbedOnly())  
+                {
+              
+                iLauncherUI->PrintText(iCurrentAppNameAndExt);
+                iLauncherUI->PrintText(_L(": SKIPPED: embeddable only\n"));
+
+                iLogWriteBuf->Des().Append(_L("[SKIPPED: embeddable only] "));
+                iLogWriteBuf->Des().Append(KFileNewLine);
+                iLogFile.Write(iLogWriteBuf->Des());
+
+                iSkippedCases++;
+                CheckForMoreAppsL();
+                }
+        
+            // if it's hidden, don't launch if setting is enabled
+            else if (cap.iAppIsHidden && SkipHiddenAndEmbedOnly())  
+                {
+                
+                iLauncherUI->PrintText(iCurrentAppNameAndExt);
+                iLauncherUI->PrintText(_L(": SKIPPED: hidden\n"));
+                
+                iLogWriteBuf->Des().Append(_L("[SKIPPED: hidden] "));
+                iLogWriteBuf->Des().Append(KFileNewLine);
+                iLogFile.Write(iLogWriteBuf->Des());
+
+                iSkippedCases++;
+                CheckForMoreAppsL();
+                }
+
+            // otherwise do the normal launch test
+            else
+                {
+                LaunchApplicationL();
+                }
+            
+            } //if (thisTask.Exists())
+        
+        } //if (iAppsArray->MdcaPoint(iAppLaunchCounter).FindF
+        
+    }
+
+// ---------------------------------------------------------------------------
+
+CDesCArray* CLauncherEngine::ListOfAllAppsL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::ListOfAllAppsL");
+
+    // find all DLLs from the system
+    iSystemDllArray->Reset();
+    TRAP_IGNORE( FindFiles(_L("*.dll"), _L("\\sys\\bin\\")) );
+
+    // write the list of DLLs to a file
+    RFile dllFile;
+    if (dllFile.Replace(iEnv->FsSession(), iSystemDllsFilePath, EFileWrite) == KErrNone)
+        {
+        TBuf8<KMaxFileName> dllName;
+
+        for (TInt i=0; i<iSystemDllArray->MdcaCount(); i++)
+            {
+            dllName.Copy( iSystemDllArray->MdcaPoint(i) );
+            dllName.Append( KFileNewLine );
+
+            dllFile.Write( dllName );
+            }
+
+        dllFile.Close();
+        }
+
+    // reset the apps list
+    iAllAppsArray->Reset();
+
+    // search all apps
+    TApaAppInfo appInfo;
+    iLs.GetAllApps();
+
+    while (iLs.GetNextApp(appInfo) == KErrNone)
+        {
+        iAllAppsArray->AppendL(appInfo.iFullName);
+        }
+
+
+    // remove launcher.app / launcher.exe from the list
+    for (TInt i=0; i<iAllAppsArray->MdcaCount(); i++)
+        {
+        if (iAllAppsArray->MdcaPoint(i).FindF(_L("\\Launcher.")) != KErrNotFound)
+            {
+            iAllAppsArray->Delete(i);
+            iAllAppsArray->Compress();
+            break;
+            }
+        }
+
+    // sort the elements
+    iAllAppsArray->Sort();
+
+    return iAllAppsArray;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CLauncherEngine::FindFiles(const TDesC& aFileName, const TDesC& aPath)
+    {
+    TFindFile fileFinder(iEnv->FsSession());
+    CDir* fileList; 
+    TInt err = fileFinder.FindWildByDir(aFileName, aPath, fileList);
+
+    while (err == KErrNone)
+        {
+        for (TInt i=0; i<fileList->Count(); i++)
+            {
+            TParse fullentry;
+            fullentry.Set((*fileList)[i].iName, &fileFinder.File(), NULL);
+
+            TRAP(err, iSystemDllArray->AppendL(fullentry.NameAndExt())); 
+            }
+
+        delete fileList;
+        err = fileFinder.FindWild(fileList);
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+
+
+void CLauncherEngine::StartAppLaunchingL(const CArrayFix<TInt>* aSelectedApps, TBool aAutoClose)
+    {
+    LOGSTRING("Launcher: CLauncherEngine::StartAppLaunchingL");
+
+    // check that we have something to launch
+    if (aSelectedApps->Count() <= 0)
+        {
+        _LIT(message, "Nothing selected");
+        iLauncherUI->ShowErrorMessage(message);
+        }
+    else
+        {
+        // update the list of applications to be tested
+        iAppsArray->Reset();
+
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+
+        for (TInt i=0; i<iAllAppsArray->MdcaCount(); i++)
+            {
+            ref = i;
+
+            // if the application is selected, append it to the apps array
+            if (aSelectedApps->Find(ref, key, index) == 0)  
+                {
+                iAppsArray->AppendL(iAllAppsArray->MdcaPoint(i));
+                }
+            }
+
+
+        // to make sure that our algorithm works correctly
+        if (iAppsArray->MdcaCount() != aSelectedApps->Count())
+            {
+            _LIT(message, "Something went wrong...");
+            iLauncherUI->ShowErrorMessage(message);
+            }
+
+        
+        // init
+        Cancel();
+        iLaunchingIsActive = ETrue;
+        iAutoClose = aAutoClose;
+        iAppLaunchCounter = 0;
+        iFailedCases = 0;
+        iOkCases = 0;
+        iSkippedCases = 0;
+        iTotalNumberOfCases = iAppsArray->MdcaCount();
+        iCurrentAppUid = KNullUid;
+
+        // open the log file for writing
+        if (iLogFile.Open(iEnv->FsSession(), iLogFilePath, EFileWrite) != KErrNone)
+            {
+            iEnv->FsSession().MkDirAll(iLogFilePath);
+            iLogFile.Replace(iEnv->FsSession(), iLogFilePath, EFileWrite);
+            }
+        else
+            {
+            // file opens correctly, seek to the end
+            TInt fileSize=0;
+            iLogFile.Size(fileSize);
+            iLogFile.Seek(ESeekCurrent, fileSize);
+            }
+
+        // change focus to output view!!
+        iLauncherUI->ChangeFocusToOutputView();
+
+        //text to log
+        iLauncherUI->PrintText(_L("New test started.\n"));
+
+        // start the first launch!
+        IssueLaunch();
+
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::IssueLaunch()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::IssueLaunch");
+
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Timing error?"), 100));
+
+    // this should keep the backlight on
+    User::ResetInactivityTime();
+
+    iDLLAnalysisIsActive = EFalse;
+    // some delay
+    iTimer.After(iStatus, 1000000);    
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::WriteInitialStuffToTheLogL(const TDesC& aOwnData, RFile& aFile)
+    {
+    LOGSTRING("Launcher: CLauncherEngine::WriteInitialStuffToTheLog");
+
+    TTime time;
+    time.HomeTime();
+    TBuf<32> currentTime;
+    TBuf<32> currentDate;
+
+    // current date            
+    _LIT(KCurrentDate,"%D%M%Y%/0%1%/1%2%/2%3%/3");
+    time.FormatL(currentDate, KCurrentDate);    
+    iLogWriteBuf->Des().Copy(currentDate);    
+    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
+
+    // current time
+    _LIT(KCurrentTime,"%-B%:0%J%:1%T%:2%S%:3%+B");
+    time.FormatL(currentTime, KCurrentTime);    
+    AppendLogBufferL(currentTime, iLogWriteBuf);
+    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
+
+    // available RAM memory
+    TMemoryInfoV1Buf memory;
+    UserHal::MemoryInfo(memory);
+    iLogWriteBuf->Des().AppendNum(memory().iFreeRamInBytes);  
+    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
+
+    // own data, eg. application name
+    AppendLogBufferL(aOwnData, iLogWriteBuf);
+    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
+    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);    
+
+    // write the buffer to the file
+    aFile.Write(iLogWriteBuf->Des()); 
+
+    // clear the buffer
+    iLogWriteBuf->Des().Copy(_L(""));
+    }
+
+// ---------------------------------------------------------------------------
+
+
+void CLauncherEngine::CheckForMoreAppsL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::CheckForMoreAppsL");
+
+    // make sure the launcher app is in the foreground
+    TApaTaskList taskList(iWs);
+    TUid launcherAppUid;
+    launcherAppUid.iUid = 0x101FB74F;
+    TApaTask launcherTask = taskList.FindApp(launcherAppUid);
+    launcherTask.BringToForeground();
+
+
+    // check if we have more test to be executed
+    if ( iAppLaunchCounter >= iTotalNumberOfCases-1 )
+        {
+        
+        // all done, show stats
+        TBuf<200> message;
+        message.Append( _L("Done: ") );
+        message.AppendNum( iOkCases );
+        message.Append( _L(" ok, ") );
+        message.AppendNum( iFailedCases );
+        message.Append( _L(" failed, ") );
+        message.AppendNum( iSkippedCases );
+        message.Append( _L(" skipped.") );
+
+        // print the message to the output screen
+        iLauncherUI->PrintText(message);
+        iLauncherUI->PrintText(_L("\n\n"));
+        
+        //write same stuff to the log
+        WriteInitialStuffToTheLogL(message, iLogFile);
+        iLogWriteBuf->Des().Copy(KFileNewLine);
+        iLogWriteBuf->Des().Append(KFileNewLine);        
+        iLogFile.Write(iLogWriteBuf->Des());
+
+        // close the log
+        iLogFile.Close();
+
+        iLaunchingIsActive = EFalse;
+
+        // all apps launched
+        _LIT(KAllDoneMessage, "All apps launched");
+        iLauncherUI->ShowInfoMessage(KAllDoneMessage);
+        }
+    else
+        {
+        // more apps to be launched, maintain requests
+        iAppLaunchCounter++;
+        IssueLaunch();
+        }
+  
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::LaunchApplicationL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::LaunchApplication");
+    LOGSTRING3("Launcher: Trying to launch %S, UID: %d", &iCurrentAppNameAndExt, iCurrentAppUid.iUid);
+
+    TRAPD(err, DoLaunchApplicationL());
+    
+    if (err!=KErrNone)
+        {
+        iLogWriteBuf->Des().Append(_L("[FAIL: Cannot launch the app] "));        
+       
+        iLauncherUI->PrintText(iCurrentAppNameAndExt);
+        iLauncherUI->PrintText(_L(": cannot launch\n"));
+        
+        // write the buffer to the log
+        iLogWriteBuf->Des().Append(KFileNewLine);        
+        iLogFile.Write(iLogWriteBuf->Des());
+
+        // this application isn't even launchable, go to next one
+        iFailedCases++;
+        CheckForMoreAppsL();        
+        }
+    
+    }
+// ---------------------------------------------------------------------------
+
+
+void CLauncherEngine::DoLaunchApplicationL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DoLaunchApplicationL");
+
+    // create a new handle
+    RThread newThreadHandle;
+    iCurrentAppThread = newThreadHandle;
+
+
+    // Find the task with uid3
+    TApaTaskList tasklist(iWs);
+    TApaTask task=tasklist.FindApp(iCurrentAppUid);
+
+    if (task.Exists())
+        // Task exists, bring it to foreground
+        {
+        task.BringToForeground();
+        }
+    else
+        // Task doesn't exist, launch a new instance of an application
+        {
+        TApaAppInfo appInfo;
+        User::LeaveIfError(iLs.GetAppInfo(appInfo, iCurrentAppUid));
+        TApaAppCapabilityBuf capBuf;
+        User::LeaveIfError(iLs.GetAppCapability(capBuf, iCurrentAppUid));
+        TApaAppCapability& caps = capBuf();
+
+        CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+        cmdLine->SetExecutableNameL(appInfo.iFullName);
+
+        if ( caps.iLaunchInBackground )
+            // Apps capability defines that the app is launched in background
+            {
+            cmdLine->SetCommandL(EApaCommandBackground);
+            }
+        else
+            {
+            cmdLine->SetCommandL(EApaCommandRun);
+            }
+
+        // start the app
+        User::LeaveIfError(iLs.StartApp(*cmdLine, iCurrentAppThreadId));
+
+        // activate thread checker active object
+        iAppThreadChecker->ActivateChecking();
+
+        // now open a handle to the thread and register death notifier
+        TInt err = iCurrentAppThread.Open(iCurrentAppThreadId);
+        if (err == KErrNone)
+            iCurrentAppThread.Logon(iAppThreadChecker->iStatus);
+        else
+            {
+            iCurrentAppThread.Close();
+            TRequestStatus* status = &iAppThreadChecker->iStatus;
+            User::RequestComplete(status, KErrNone);
+            iAppThreadChecker->Cancel();
+            User::Leave(err);                
+            }
+
+        CleanupStack::PopAndDestroy(); // cmdLine
+        }
+
+    // the application is now running, start a check to see if it's still alive
+    iAppRunningChecker->StartTesting(); 
+
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::CheckIfAppIsRunningL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::CheckIfAppIsRunningL");
+
+    // cancel the death notifier since it isn't needed anymore
+    if( iCurrentAppThread.Handle() != 0 )
+        {
+        iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
+        }
+
+    // cancel checkers
+    iAppThreadChecker->Cancel();
+    iAppRunningChecker->Cancel(); 
+
+
+
+    // check from the window server if the app is running
+    TApaTaskList taskList(iWs);
+    TApaTask thisTask = taskList.FindApp(iCurrentAppUid);
+
+    if( !thisTask.Exists() ) // application not running -> FAIL
+        {
+        // check from the thread why it quit
+        CheckWhyThreadDiedL();
+
+        // --> CheckForMoreApps() and all the other stuff called from CheckWhyThreadDied() !
+
+        }
+    else
+        {
+        // app is running!
+        iOkCases++;
+
+        // close handle to the thread        
+        iCurrentAppThread.Close();
+
+
+        iLogWriteBuf->Des().Append(_L(" [OK]"));
+        iLogWriteBuf->Des().Append(KFileNewLine);        
+        iLogFile.Write(iLogWriteBuf->Des());
+
+
+        // close the running application if needed
+        if (iAutoClose)
+            {
+            // since the application is still open, let's close it
+            thisTask.EndTask();
+            //User::After(1000);
+            //thisTask.SendSystemEvent(EApaSystemEventShutdown);
+            //thisTask.KillTask();
+            //User::After(1000);
+            }
+
+        // this app is done now, move to the next one!
+        CheckForMoreAppsL();
+                
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::CheckWhyThreadDiedL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::CheckWhyThreadDiedL");
+
+    // cancel the death notifier since it isn't needed anymore
+    if( iCurrentAppThread.Handle() != 0 )
+        {
+        iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
+        }
+
+    // make sure all checkers are cancelled
+    iAppRunningChecker->Cancel(); 
+    iAppThreadChecker->Cancel(); 
+
+    TBuf<256> outputText;
+    outputText.Append(_L("App.Closed. "));
+
+
+    if (iCurrentAppThread.ExitType() == EExitKill)
+        {
+        outputText.Append(_L("\"EExitKill\""));
+        }
+    else if (iCurrentAppThread.ExitType() == EExitTerminate)
+        {
+        outputText.Append(_L("\"EExitTerminate\""));
+        }
+    else if (iCurrentAppThread.ExitType() == EExitPanic)
+        {
+        outputText.Append(_L("\"EExitPanic\""));
+        }
+    else if (iCurrentAppThread.ExitType() == EExitPending)
+        {
+        outputText.Append(_L("\"EExitPending\""));
+        }
+    else // unknown reason
+        {
+        outputText.Append(_L("\"Exit_Unknown_Reason\""));
+        }        
+    
+    outputText.Append(_L(" code:"));
+    TInt exitReason = iCurrentAppThread.ExitReason();
+    outputText.AppendNum(exitReason);
+    outputText.Append(_L(" \""));
+
+    TPtrC exitCategory = iCurrentAppThread.ExitCategory();
+    outputText.Append(exitCategory);
+
+    outputText.Append(_L("\""));
+
+
+    // print to screen
+    iLauncherUI->PrintText(iCurrentAppNameAndExt);
+    iLauncherUI->PrintText(_L(": "));
+    iLauncherUI->PrintText(outputText);
+    iLauncherUI->PrintText(_L("\n"));
+    
+    // write to the log also
+    iLogWriteBuf->Des().Append(_L(" [FAIL: "));
+    iLogWriteBuf->Des().Append(outputText);
+    iLogWriteBuf->Des().Append(_L("]"));
+    iLogWriteBuf->Des().Append(KFileNewLine);
+    
+    iLogFile.Write(iLogWriteBuf->Des());
+
+    // close handle to the thread
+    //iCurrentAppThread.Close();    <-- not safe the close the handle because of the "App.Closed" dialog
+    //                                  somehow takes ownership of the thread or something
+
+    // nothing to do anymore, move to the next app
+    iFailedCases++;
+    CheckForMoreAppsL();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+
+CDesCArray* CLauncherEngine::DependencyCheckForE32ImageL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DependencyCheckForE32ImageL");
+
+    // create an empty array for the missing dll names
+    CDesCArray* missingDllArray = new(ELeave) CDesCArrayFlat(100);
+    CleanupStack::PushL(missingDllArray);
+
+    // get a list of DLLs from the E32 image file
+    E32ImageReader* reader = E32ImageReader::NewLC();
+    CDesCArray* dllArray = reader->ListOfDLLsL( iAppsArray->MdcaPoint(iAppLaunchCounter) );
+    CleanupStack::PopAndDestroy(); // reader
+    CleanupStack::PushL(dllArray);
+
+    // compare system DLL and image DLL arrays
+    TInt pos(0);
+    for (TInt j=0; j<dllArray->MdcaCount(); j++)
+        {
+        if (iSystemDllArray->Find(dllArray->MdcaPoint(j), pos, ECmpFolded) != 0)  
+            {
+            // DLL not found, append the name to the list of missing DLLs
+            missingDllArray->AppendL(dllArray->MdcaPoint(j));  
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // dllArray
+    CleanupStack::Pop();  // missingDllArray
+
+    LOGSTRING("Launcher: CLauncherEngine::DependencyCheckForE32ImageL returns");
+
+    return missingDllArray;
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CLauncherEngine::DeleteLogFile()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DeleteLogFile");
+    return BaflUtils::DeleteFile(iEnv->FsSession(), iLogFilePath);
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::StopLaunchingL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::StopLaunchingL");
+    if(iLaunchingIsActive)
+        {
+        //write to the log
+        WriteInitialStuffToTheLogL(_L("Cancelled by the user !!! "), iLogFile);
+        iLogWriteBuf->Des().Copy(KFileNewLine);
+        iLogWriteBuf->Des().Append(KFileNewLine);
+        iLogFile.Write(iLogWriteBuf->Des());
+    
+        // close the log
+        iLogFile.Close();
+    
+        // print to the screen
+        iLauncherUI->PrintText(_L("Launching cancelled.\n\n"));
+    
+        // cancel all active objects
+        if( iCurrentAppThread.Handle() != 0 )
+            {
+            iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
+            }
+        Cancel();
+        iAppRunningChecker->Cancel(); 
+        iAppThreadChecker->Cancel(); 
+        
+        iLaunchingIsActive = EFalse;
+    
+        _LIT(KMessage, "Launching cancelled");
+        iLauncherUI->ShowInfoMessage(KMessage);
+
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TBool CLauncherEngine::LogFileExists()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::LogFileExists");
+    return BaflUtils::FileExists(iEnv->FsSession(), iLogFilePath);
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CLauncherEngine::DeleteBCLogFile()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DeleteBCLogFile");
+    return BaflUtils::DeleteFile(iEnv->FsSession(), iBCLogFilePath);
+    }
+
+
+// ---------------------------------------------------------------------------
+
+TBool CLauncherEngine::BCLogFileExists()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::BCLogFileExists");
+    return BaflUtils::FileExists(iEnv->FsSession(), iBCLogFilePath);
+    }
+
+// ---------------------------------------------------------------------------
+void CLauncherEngine::AnalyseDLLsL( const TDesC& aFileName )
+    {
+    LOGSTRING("Launcher: CLauncherEngine::AnalyseDLLsL");
+    _LIT(KStartSeparator, "******************************");
+    _LIT(KStartingAnalysis, "Starting BC Analysis for DLLs.");    
+    _LIT(KInputFileSelected, "Input file selected: ");
+    
+    // Reset found issues counter and buffer
+    iFoundBCIssues = 0;    
+    delete iBCIssuesBigBuffer;
+    iBCIssuesBigBuffer = 0;
+    
+    // Reset log writing buffer:
+    iLogWriteBuf->Des().Zero();
+                
+    if( IsActive() )
+        {
+        Cancel();
+        }   
+    
+    iRequiredDllsFilePath = aFileName;
+    
+    if( BaflUtils::FileExists(iEnv->FsSession(), iRequiredDllsFilePath) == EFalse )
+        {
+        LOGSTRING2("Launcher: CLauncherEngine::AnalyseDLLsL - can't find input file: %S", &iRequiredDllsFilePath);
+        User::Leave( KErrNotFound );
+        }
+    
+    // open the log file for writing
+    if (iBCLogFile.Open(iEnv->FsSession(), iBCLogFilePath, EFileWrite) != KErrNone)
+        {
+        iEnv->FsSession().MkDirAll(iLogFilePath);
+        iBCLogFile.Replace(iEnv->FsSession(), iBCLogFilePath, EFileWrite);
+        }
+    else
+        {
+        // file opens correctly, seek to the end
+        TInt fileSize=0;
+        iBCLogFile.Size(fileSize);
+        iBCLogFile.Seek(ESeekCurrent, fileSize);
+        }
+    
+    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+    AppendLogBufferL(KStartSeparator(), iLogWriteBuf);
+    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+    iBCLogFile.Write(iLogWriteBuf->Des());
+    iLogWriteBuf->Des().Zero();
+    
+    // Resolve file type. Should we use XML parsing or just compare DLL list
+    TBool xmlParsing =
+        KDotXML().Compare(iRequiredDllsFilePath.Right(KDotXML().Length())) == 0 ||
+        KDotLauncherXML().Compare(iRequiredDllsFilePath.Right(KDotLauncherXML().Length())) == 0;
+    
+    // Log analysis starting time and selected input file:
+    WriteInitialStuffToTheLogL(KStartingAnalysis, iBCLogFile);    
+    AppendLogBufferL(KInputFileSelected(), iLogWriteBuf);
+    AppendLogBufferL(iRequiredDllsFilePath, iLogWriteBuf);
+    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+    iBCLogFile.Write(iLogWriteBuf->Des());
+    iLogWriteBuf->Des().Zero();
+    
+    if( xmlParsing )
+        {
+        iLauncherUI->ChangeFocusToOutputView();
+        DoBCAnalysisL();
+        }
+    else
+        {
+        DoCompareDLLListsL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::DoBCAnalysisL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DoBCAnalysisL");
+    if( iXMLParser == 0 )
+        {
+        iXMLParser = CLauncherXMLParser::NewL(iEnv->FsSession());
+        }
+    
+    TEntry entry;
+    User::LeaveIfError(iEnv->FsSession().Entry(iRequiredDllsFilePath, entry));
+    TInt fileSize = entry.iSize;
+    
+    _LIT(KAnalysing,"Analysing DLLs");
+    iLauncherUI->ShowProgressBar(KAnalysing, 0, fileSize);
+    iDLLAnalysisIsActive = ETrue;
+    
+    iXMLParser->ParseL(iRequiredDllsFilePath, this);
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::CancelBCAnalysis()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::CancelBCAnalysis");
+    iXMLParser->Cancel();
+    iLauncherUI->PrintText(_L("\nAnalysis cancelled.\n\n"));
+
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::DoCompareDLLListsL()
+    {
+    LOGSTRING("Launcher: CLauncherEngine::DoCompareDLLListsL");
+    
+    RFile file;
+    CleanupClosePushL(file);
+        
+    // Show progress bar 
+    _LIT(KAnalysing,"Analysing DLLs");
+    iLauncherUI->ShowWaitDialog(KAnalysing);
+
+    if(file.Open(iEnv->FsSession(), iRequiredDllsFilePath, EFileRead) != KErrNone)
+        {
+        // Hide wait dialog  
+        iLauncherUI->HideWaitDialog();
+        
+        iLauncherUI->ChangeFocusToOutputView();
+
+        TBuf<200> msg;
+
+        
+        msg.Format(_L("Unable to open %S for reading!\n\n"), &iRequiredDllsFilePath);
+        iLauncherUI->PrintText( msg );
+        }
+    else
+        {
+        
+        CDesCArray* requiredDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
+        CleanupStack::PushL(requiredDllArray);
+
+        // read all lines the text file
+        TFileName dllName;
+        TInt i(0);
+        while( ReadLineFromFileL(file, dllName) == KErrNone && i<KMaxDllArraySize )
+            {
+            dllName.TrimAll();
+
+            if (dllName.Length() > 1)
+                requiredDllArray->AppendL(dllName);
+            
+            i++;
+            }
+
+        if (requiredDllArray->MdcaCount() == 0)
+            {
+            // Hide wait dialog  
+            iLauncherUI->HideWaitDialog();
+            
+            iLauncherUI->ChangeFocusToOutputView();
+
+            TBuf<200> msg;
+            msg.Format(_L("File %S is empty!\n\n"), &iRequiredDllsFilePath);
+            iLauncherUI->PrintText( msg );
+            }
+        else
+            {
+            // compare the arrays and print any missing items
+            CDesCArray* missingDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
+            CleanupStack::PushL(missingDllArray);
+
+            TInt pos(0);
+            for (TInt j=0; j<requiredDllArray->MdcaCount(); j++)
+                {
+                if (iSystemDllArray->Find(requiredDllArray->MdcaPoint(j), pos, ECmpFolded) != 0)  
+                    {
+                    // DLL not found, append the name to the list of missing DLLs
+                    missingDllArray->AppendL(requiredDllArray->MdcaPoint(j));  
+                    }
+                }
+
+            
+            if (missingDllArray->MdcaCount() == 0)
+                {
+                _LIT(KMessage, "No missing files found");
+                AppendLogBufferL(KMessage(), iLogWriteBuf);
+                iLauncherUI->ShowInfoMessage(KMessage);
+                }
+            else
+                {
+                iLauncherUI->ChangeFocusToOutputView();
+                _LIT(KMissingFiles, "Missing files:\n");
+
+                //iLauncherUI->PrintText( KMissingFiles );
+                AppendLogBufferL(KMissingFiles(), iBCIssuesBigBuffer, KBigBufferAllocBytes);
+                
+                AppendLogBufferL(KMissingFiles(), iLogWriteBuf);
+                
+                for (TInt i=0; i<missingDllArray->MdcaCount(); i++)
+                    {
+                    //iLauncherUI->PrintText( missingDllArray->MdcaPoint(i) );
+                    AppendLogBufferL(missingDllArray->MdcaPoint(i), iBCIssuesBigBuffer, KBigBufferAllocBytes);
+                    //iLauncherUI->PrintText( _L("\n") );         
+                    AppendLogBufferL(KNewLine(), iBCIssuesBigBuffer, KBigBufferAllocBytes);
+                    
+                    AppendLogBufferL(missingDllArray->MdcaPoint(i), iLogWriteBuf);
+                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+                    }
+                AppendLogBufferL(KNewLine(), iBCIssuesBigBuffer, KBigBufferAllocBytes);
+                iLauncherUI->PrintText( iBCIssuesBigBuffer->Des() );
+                }
+            
+            // Hide wait dialog  
+            iLauncherUI->HideWaitDialog();
+            
+            CleanupStack::PopAndDestroy(); // missingDllArray            
+            }
+
+        CleanupStack::PopAndDestroy(); // requiredDllArray
+        }
+
+    CleanupStack::PopAndDestroy(); //file
+    iBCLogFile.Write(iLogWriteBuf->Des());
+    iLogWriteBuf->Des().Zero();
+    iBCLogFile.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::ParsingProgressedL(TInt aBytes)
+    {
+    LOGSTRING2("Launcher: CLauncherEngine::ParsingProgressedL - Bytes: %d", aBytes);
+    iLauncherUI->SetProgressBarValue(aBytes);
+    }
+
+// ---------------------------------------------------------------------------
+
+
+void CLauncherEngine::ElementParsedL(const CLauncherDLLElement& aDllElement)
+    {
+    LOGSTRING("Launcher: CLauncherEngine::ElementParsedL");
+    User::ResetInactivityTime();
+
+    _LIT(KIndent, "    ");
+    _LIT(KIssuesFound, "Binary compatibility issues found:"); 
+    _LIT(KDLLMissing,"DLL is missing");
+    _LIT(KUID1Changed,"UID1 changed");
+    _LIT(KUID2Changed,"UID2 changed");
+    _LIT(KUID3Changed,"UID3 changed");
+    _LIT(KSIDChanged,"SID changed");
+    _LIT(KCapabilityChanged,"Capability changed");
+    
+    if( iDLLElement == 0 )
+        {
+        iDLLElement = CLauncherDLLElement::NewL();
+        }
+    
+    TFindFile fileFinder(iEnv->FsSession());
+    _LIT(KDLLPath, "\\sys\\bin\\");
+    TInt err = fileFinder.FindByPath(aDllElement.Name(), &KDLLPath); 
+    
+    TBuf<256> issueStr;
+    
+    if( err == KErrNotFound )
+        {
+        if( iFoundBCIssues++ == 0 )
+            {                        
+            iLauncherUI->PrintText( KIssuesFound );
+            iLauncherUI->PrintText( KNewLine );            
+            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+            AppendLogBufferL(KIssuesFound(), iLogWriteBuf);
+            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+            }
+        issueStr.Copy(aDllElement.Name());
+        issueStr.Append(KNewLine);
+        issueStr.Append(KIndent);
+        issueStr.Append(KDLLMissing);
+        issueStr.Append(KNewLine);
+                
+        AppendLogBufferL(issueStr, iLogWriteBuf);
+        
+        TFileName dllName = aDllElement.Name();
+        LOGSTRING2("Launcher: DLL not found: %S", &dllName);
+        if( iFoundBCIssues > KBigBufferUsageThreshold )
+            {
+            if( iBCIssuesBigBuffer == 0)
+                {
+                iBCIssuesBigBuffer = HBufC::NewL(KBigBufferAllocBytes);
+                }
+            TInt maxSize = iBCIssuesBigBuffer->Des().Length() + issueStr.Length();
+            if( maxSize >= iBCIssuesBigBuffer->Des().MaxLength())
+                {
+                iBCIssuesBigBuffer = iBCIssuesBigBuffer->ReAllocL(maxSize + KBigBufferAllocBytes );                
+                }
+            TPtr ptr(iBCIssuesBigBuffer->Des());
+            ptr += issueStr;            
+            }
+        else
+            {
+            iLauncherUI->PrintText( issueStr);
+            }
+        }
+    else if( err == KErrNone)
+        {
+        // File is found, so let's try to open it:
+        RFile dllFile;
+        CleanupClosePushL(dllFile);        
+        if( dllFile.Open(iEnv->FsSession(), fileFinder.File(), EFileRead) == KErrNone )
+            {
+            // Parse DLL:
+            iDLLParser->ParseL(iEnv->FsSession(), dllFile, *iDLLElement);
+            CleanupStack::PopAndDestroy(); // dllFile            
+            RArray<CLauncherDLLElement::TDifference> diffs;
+            CleanupClosePushL(diffs);
+                        
+            // Compare DLLs:              
+            if( iDLLElement->CompareL(aDllElement, diffs))
+                {                
+                if( iFoundBCIssues++ == 0 )
+                    {
+                    iLauncherUI->PrintText( KIssuesFound );
+                    iLauncherUI->PrintText( KNewLine );                   
+                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+                    AppendLogBufferL(KIssuesFound(), iLogWriteBuf);
+                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+                    }
+                // Differencies found:
+                for( TInt i = 0; i < diffs.Count(); ++i )
+                    {                
+                    // Print DLL name:
+                    if( i == 0 )
+                        {
+                        issueStr.Copy(aDllElement.Name());
+                        issueStr.Append(KNewLine);
+                        }
+                    
+                    // Print differencies:
+                    issueStr.Append(KIndent);
+                    switch(diffs[i])
+                        {
+                        case CLauncherDLLElement::EDifference_UID1:
+                            issueStr.Append(KUID1Changed);
+                            break;
+                        case CLauncherDLLElement::EDifference_UID2:
+                            issueStr.Append( KUID2Changed );
+                            break;
+                        case CLauncherDLLElement::EDifference_UID3:
+                            issueStr.Append( KUID3Changed );
+                            break;
+                        case CLauncherDLLElement::EDifference_SID:
+                            issueStr.Append( KSIDChanged );
+                            break;
+                        case CLauncherDLLElement::EDifference_Capability:
+                            issueStr.Append( KCapabilityChanged );
+                            break;
+                        }
+                    issueStr.Append( KNewLine );                    
+                    }
+                AppendLogBufferL(issueStr, iLogWriteBuf);
+                if( iFoundBCIssues > KBigBufferUsageThreshold )
+                    {
+                    // To improve performance, don't print issues to output anymore.
+                    // Instead, store the issues in buffer and print them when analysis is done.
+                    if( iBCIssuesBigBuffer == 0)
+                        {
+                        iBCIssuesBigBuffer = HBufC::NewL(KBigBufferAllocBytes);
+                        }
+                    TInt maxSize = iBCIssuesBigBuffer->Des().Length() + issueStr.Length();
+                    if( maxSize >= iBCIssuesBigBuffer->Des().MaxLength())
+                        {
+                        TInt increaseSize = Max(issueStr.Length(), KBigBufferAllocBytes);
+                        iBCIssuesBigBuffer = iBCIssuesBigBuffer->ReAllocL(maxSize + increaseSize );                            
+                        }
+                    TPtr ptr(iBCIssuesBigBuffer->Des());
+                    ptr += issueStr;
+                    }
+                else
+                    {
+                    iLauncherUI->PrintText( issueStr);
+                    }
+                }
+            CleanupStack::Pop(); // diffs
+            diffs.Close();            
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(); // dllFile
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+void CLauncherEngine::DocumentParsedL(TInt aErrorCode)
+    {            
+    LOGSTRING2("Launcher: CLauncherEngine::DocumentParsedL (Error code: %d)", aErrorCode);
+        
+    iDLLAnalysisIsActive = EFalse;
+    _LIT(KParseError, "Parse error: ");
+    _LIT(KNoIssues, "No binary compatibility issues found");
+    
+    if( IsActive() )
+        {
+        Cancel();
+        }
+     
+    //hide progress bar 
+    iLauncherUI->HideProgressBar();
+
+    if( aErrorCode != KErrNone )
+        {
+        TBuf<16> errorCodeString;
+        errorCodeString.AppendNum(aErrorCode);
+        iLauncherUI->PrintText( KNewLine );
+        iLauncherUI->PrintText( KParseError );
+        iLauncherUI->PrintText( errorCodeString );
+        iLauncherUI->PrintText( KNewLine );        
+        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+        AppendLogBufferL(KParseError(), iLogWriteBuf);
+        AppendLogBufferL(errorCodeString, iLogWriteBuf);
+        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+        }
+    else if(iFoundBCIssues == 0)
+        {
+        iLauncherUI->PrintText( KNoIssues );
+        iLauncherUI->PrintText( KNewLine );        
+        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+        AppendLogBufferL(KNoIssues(), iLogWriteBuf);
+        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
+        }
+    else if( iBCIssuesBigBuffer && iBCIssuesBigBuffer->Des().Length() > 0 )
+        {
+        iLauncherUI->PrintText(iBCIssuesBigBuffer->Des());
+        delete iBCIssuesBigBuffer;
+        iBCIssuesBigBuffer = 0;
+        }
+    if( iLogWriteBuf->Length() > 0 && iBCLogFile.SubSessionHandle() != 0)
+        {
+        iBCLogFile.Write(iLogWriteBuf->Des());
+        }
+    WriteInitialStuffToTheLogL(_L("Analysis ready"), iBCLogFile);
+    iLogWriteBuf->Des().Zero();
+    iBCLogFile.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CLauncherEngine::ReadLineFromFileL(RFile& aFile, TDes& aReadBuf)
+    {
+    LOGSTRING("Launcher: CLauncherEngine::ReadLineFromFile");
+
+    _LIT8(KImcvCRLF, "\r\n");
+    TInt err(KErrNone);
+
+    HBufC8* tempLine = HBufC8::NewLC(1000);
+    TPtr8 buffer = tempLine->Des();
+
+    // clear the target buffer
+    aReadBuf.Zero();
+
+    // get the current file position
+    TInt filePos(0);
+    aFile.Seek(ESeekCurrent, filePos);
+
+    // read the buffer
+    err = aFile.Read(buffer);
+
+    // check if it's the end of file
+    TInt s = buffer.Length();
+    if (s == 0)
+        err = KErrEof;
+
+    if (err == KErrNone)
+        {
+        // copy to the lfcr and then set the file pointer to the point after that
+        TInt pos = buffer.Find(KImcvCRLF);
+        if (pos != -1)
+            {
+            TFileName tempBuf;
+            buffer.SetLength(pos);
+            tempBuf.Copy(buffer);
+            aReadBuf.Justify(tempBuf, pos, ELeft, ' ');
+            filePos += (pos+2);
+
+            // set the file pointer back to after the lfcr
+            aFile.Seek(ESeekStart, filePos);
+            }
+        
+        // else fill the whole buffer
+        else
+            {
+            aReadBuf.Copy(buffer);
+            }
+        }
+
+    CleanupStack::PopAndDestroy(); // tempLine
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+// ---------------------------------------------------------------------------
+
+CAppThreadChecker* CAppThreadChecker::NewL(CLauncherEngine* aLauncherEngine)
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::NewL");
+
+    CAppThreadChecker* self = new(ELeave) CAppThreadChecker;
+    CleanupStack::PushL(self);
+    self->ConstructL(aLauncherEngine);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CAppThreadChecker::CAppThreadChecker() : CActive(EActivePriorityIpcEventsHigh)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppThreadChecker::ConstructL(CLauncherEngine* aLauncherEngine)
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::ConstructL");
+
+    iEnv = CEikonEnv::Static();
+
+    iLauncherEngine = aLauncherEngine;
+
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+
+CAppThreadChecker::~CAppThreadChecker()
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::~CAppThreadChecker");
+
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppThreadChecker::ActivateChecking()
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::ActivateChecking");
+
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Thread Checker"), 300));
+
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppThreadChecker::RunL()
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::RunL");
+
+    // check the state of the thread
+    iLauncherEngine->CheckWhyThreadDiedL();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppThreadChecker::DoCancel()
+    {
+    LOGSTRING("Launcher: CAppThreadChecker::DoCancel");
+    }
+
+// ---------------------------------------------------------------------------
+
+
+
+// ---------------------------------------------------------------------------
+
+//////////////////////////////////////////////////////////////////////////////////////
+
+// ---------------------------------------------------------------------------
+
+CAppRunningChecker* CAppRunningChecker::NewL(CLauncherEngine* aLauncherEngine)
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::NewL");
+
+    CAppRunningChecker* self = new(ELeave) CAppRunningChecker;
+    CleanupStack::PushL(self);
+    self->ConstructL(aLauncherEngine);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CAppRunningChecker::CAppRunningChecker() : CActive(EActivePriorityIpcEventsHigh)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppRunningChecker::ConstructL(CLauncherEngine* aLauncherEngine)
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::ConstructL");
+
+    iEnv = CEikonEnv::Static();
+    User::LeaveIfError(iTimer.CreateLocal());
+
+    iLauncherEngine = aLauncherEngine;
+
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+
+CAppRunningChecker::~CAppRunningChecker()
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::~CAppRunningChecker");
+
+    Cancel();
+
+    iTimer.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppRunningChecker::StartTesting()
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::StartTesting");
+
+    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Running Checker"), 200));
+
+    // async delay of seven seconds
+    iTimer.After(iStatus, 7000000);    
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppRunningChecker::RunL()
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::RunL");
+
+    // check if the application is running
+    iLauncherEngine->CheckIfAppIsRunningL();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CAppRunningChecker::DoCancel()
+    {
+    LOGSTRING("Launcher: CAppRunningChecker::DoCancel");
+    iTimer.Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/engine/src/launcherxmlparser.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,430 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <f32file.h>
+#include <xml/documentparameters.h>
+#include "launcherxmlparser.h"
+#include "launchertraces.h"
+
+_LIT8(KXmlMimeType, "text/xml");
+
+/**
+ * XML element names
+ */
+_LIT8(KDll, "dll");
+_LIT8(KDllName, "dllname");
+_LIT8(KUID1, "uid1");
+_LIT8(KUID2, "uid2");
+_LIT8(KUID3, "uid3");
+_LIT8(KSID, "sid");
+_LIT8(KCapability, "capability");
+
+// ---------------------------------------------------------------------------
+
+CLauncherXMLParser::CLauncherXMLParser(RFs& aFs)
+:
+CActive( EPriorityIdle ),
+iParser(0),
+iFileSession(aFs),
+iParsedBytes(0)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::ConstructL()
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::ConstructL");
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherXMLParser* CLauncherXMLParser::NewL(RFs& aFs)
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::NewL");
+    CLauncherXMLParser* self = CLauncherXMLParser::NewLC(aFs);    
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherXMLParser* CLauncherXMLParser::NewLC(RFs& aFs)
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::NewLC");
+    CLauncherXMLParser* self = new (ELeave) CLauncherXMLParser(aFs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherXMLParser::~CLauncherXMLParser()
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::~CLauncherXMLParser");
+    Cancel();
+    delete iParser;
+    delete iCurrentDllElement;    
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::ClearXMLDataBuffer()
+    {
+    iXMLDataBuffer.Zero();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::DoCancel()
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::DoCancel");
+    iIgnoreError = ETrue;
+    if( iParser )
+        {
+        TRAP_IGNORE(iParser->ParseEndL());
+        }
+    iFile.Close();
+    ClearXMLDataBuffer();
+    }
+
+// ---------------------------------------------------------------------------
+// Gives current buffer content to parser for processing. Then reads
+// next part of the file in the buffer and waits for next scheduled run.
+
+void CLauncherXMLParser::RunL()
+    {
+    TInt err = iStatus.Int();
+    LOGSTRING2("Launcher: CLauncherXMLParser::RunL - iStatus: %d", err);
+    if( err != KErrNone )
+        {
+        iObserver->DocumentParsedL(err); // Observer should cancel parsing        
+        iFile.Close();
+        ClearXMLDataBuffer();
+        }
+    else
+        {        
+        iParsedBytes += iXMLDataBuffer.Length();
+        iObserver->ParsingProgressedL(iParsedBytes);
+        // Check if the end of the file is reached:
+        if( iXMLDataBuffer.Length() > 0)
+            {
+            // Parse the data in buffer 
+            LOGSTRING("Launcher: CLauncherXMLParser::RunL: Starting XML parsing");
+            if( iParser )
+                {
+                iParser->ParseL( iXMLDataBuffer );
+                }
+            else
+                {
+                LOGSTRING("CLauncherXMLParser::RunL - Error: NULL parser");
+                User::Leave(KErrGeneral);
+                }
+            // Read new data from XML file to buffer:
+            iFile.Read( iXMLDataBuffer, KXMLBufferSize, iStatus );
+            SetActive();
+            }
+        else
+            {
+            // End of the file reached. Stop parsing and close the file:
+            LOGSTRING("Launcher: CLauncherXMLParser::RunL: Data parsed. Stopping");
+            if( iParser )
+                {
+                iParser->ParseEndL();
+                }
+            iFile.Close();
+            ClearXMLDataBuffer();
+            }    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::ParseL(const TDesC& aFilePath, MLauncherParserObserver* aObserver)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::ParseL: %S", &aFilePath);
+    iIgnoreError = EFalse;
+    iParsedBytes = 0;
+    if ( IsActive() )
+        {
+        Cancel();
+        }
+    
+    if( aObserver == 0 )
+        {
+        LOGSTRING("Launcher: CLauncherXMLParser::ParseL: Error: Observer is a NULL pointer.");
+        User::Leave(KErrArgument);
+        }
+    
+    // Open the XML-file
+    TInt err = iFile.Open( iFileSession, aFilePath, EFileRead );
+    User::LeaveIfError( err );
+    
+    // Create and start XML-parser:
+    delete iParser;
+    iParser = 0;
+    iParser = CParser::NewL(KXmlMimeType, *this);        
+        
+    // Set observer:
+    iObserver = aObserver;
+    
+    // Initialize the buffer and read first part of the XML-file:
+    ClearXMLDataBuffer();
+    iFile.Read( iXMLDataBuffer, KXMLBufferSize, iStatus );
+    SetActive();   
+    iParser->ParseBeginL(); // Reset the parser to xml-filetype
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode)
+    {    
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartDocumentL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnEndDocumentL(TInt aErrorCode)
+    {    
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnEndDocumentL (Error code: %d)", aErrorCode);    
+    iObserver->DocumentParsedL(aErrorCode);
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnStartPrefixMappingL( const RString& /*aPrefix*/, 
+                                                const RString& /*aUri*/, 
+                                                TInt aErrorCode)
+    {    
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Launcer: CLauncherXMLParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnProcessingInstructionL(  const TDesC8& /*aTarget*/, 
+                                    const TDesC8& /*aData*/, 
+                                    TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnError(TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnError: %d", aErrorCode);    
+    if( iIgnoreError == EFalse )
+        {        
+        TRAP_IGNORE(iObserver->DocumentParsedL(aErrorCode));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TAny* CLauncherXMLParser::GetExtendedInterface(const TInt32 aUid)
+    {
+    (void)aUid;
+    LOGSTRING2("Launcher: CLauncherXMLParser::GetExtendedInterface (UID: %d)", aUid);
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnStartElementL(   const RTagInfo& aElement,
+                                            const RAttributeArray& /*aAttributes*/,
+                                            TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartElementL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    else
+        {
+        // Save XML-element name:
+        iCurrentElementName = aElement.LocalName().DesC();
+    
+        // If this is 'dll'-element, initialize new DLL element instance:
+        if( iCurrentDllElement == 0 && iCurrentElementName == KDll )
+            {
+            iCurrentDllElement = CLauncherDLLElement::NewL();
+            }
+        // Clear contents buffer:
+        iCurrentContent.Zero();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherXMLParser::OnEndElementL(const RTagInfo& aElement, TInt aErrorCode)
+    {   
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnEndElementL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    else
+        {
+        // Save XML-element's name:        
+        iCurrentElementName = aElement.LocalName().DesC();    
+        TUid tmpUID;
+
+        if( IsDataElement() )
+            {        
+            // Check that we have a pointer to parent DLL element
+            if( iCurrentDllElement == 0 )
+                {
+                LOGSTRING("Launcher: CLauncherXMLParser: Error in parsing xml (parent DLL element missing).");
+                User::Leave(KErrGeneral);
+                }
+            // DLL name
+            if( iCurrentElementName == KDllName )
+                {
+                TFileName dllName;
+                dllName.Copy(iCurrentContent);
+                iCurrentDllElement->SetNameL(dllName);
+                }
+            // UID1
+            else if( iCurrentElementName == KUID1 )
+                {
+                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
+                iCurrentDllElement->SetUID1L(tmpUID);
+                }
+            // UID2
+            else if( iCurrentElementName == KUID2 )
+                {
+                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
+                iCurrentDllElement->SetUID2L(tmpUID);
+                }
+            // UID3
+            else if( iCurrentElementName == KUID3 )
+                {
+                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
+                iCurrentDllElement->SetUID3L(tmpUID);
+                }
+            // SID
+            else if( iCurrentElementName == KSID )
+                {
+                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
+                iCurrentDllElement->SetSIDL(tmpUID);
+                }
+            // Capability
+            else if( iCurrentElementName == KCapability )
+                {            
+                iCurrentDllElement->SetCapabilityL(ConvertDes8ToUint32L(iCurrentContent));
+                }
+            }
+        else if( iCurrentElementName == KDll )
+            {
+            // DLL element parsed, give current DLL object to observer:
+            iObserver->ElementParsedL(*iCurrentDllElement);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TBool CLauncherXMLParser::IsDataElement()
+    {
+    if( iCurrentElementName == KDllName ||
+        iCurrentElementName == KUID1 ||
+        iCurrentElementName == KUID2 ||
+        iCurrentElementName == KUID3 ||
+        iCurrentElementName == KSID ||
+        iCurrentElementName == KCapability )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Reads content of an xml-element.
+
+void CLauncherXMLParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
+    {
+    LOGSTRING2("Launcher: CLauncherXMLParser::OnContentL (Error code: %d)", aErrorCode);
+    if( aErrorCode != KErrNone )
+        {
+        iObserver->DocumentParsedL(aErrorCode);
+        }
+    else if( iCurrentElementName.Length() == 0)
+        {
+        LOGSTRING("Launcher: CLauncherXMLParser: Error in parsing xml (element name missing).");
+        User::Leave(KErrGeneral);
+        }
+    iCurrentContent.Append(aBytes);
+    }
+
+// ---------------------------------------------------------------------------
+
+TUint32 CLauncherXMLParser::ConvertDes8ToUint32L(const TDesC8& aStr)
+    {
+    LOGSTRING("Launcher: CLauncherXMLParser::ConvertDes8ToUintL");
+    TUint32 uintVal = 0;
+    TLex8 lex(aStr);
+    TInt errorCode=lex.Val(uintVal, EHex);
+    User::LeaveIfError(errorCode);
+    return uintVal;
+    }
--- a/launcher/envpatcher/EnvPatcher.pl	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,544 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-# 
-# Description:
-# Environment Patcher - Patches older S60 SDKs for supporting
-# tricks in newer platforms
-#
-
-
-require v5.6.1;	
-
-use File::Copy;
-use strict;
-
-# check amount of commandline options is valid
-if (@ARGV != 1)
-{
-    print "Usage: EnvPatcher <EPOCROOT>\n";
-    exit 1;
-}
-
-
-# get epocroot and convert, convert \ -> /
-(my $epocroot = $ARGV[0]) =~ s{\\}{/}g;
-
-# remove any trailing forward slashes
-$epocroot =~ s/\/$//;
-
-
-# create variables for paths
-my $e32toolsdir = $epocroot."/epoc32/tools";
-my $e32includedir = $epocroot."/epoc32/include";
-my $e32includeoemdir = $e32includedir."/oem";
-my $platformpathspath = $e32includedir."/platform_paths.hrh";
-my $domainplatformpathspath = $e32includedir."/domain/osextensions/platform_paths.hrh";
-my $mmppmpath = $e32toolsdir."/mmp.pm";
-my $pathutlpmpath = $e32toolsdir."/pathutl.pm";
-my $prepfilepmpath = $e32toolsdir."/prepfile.pm";
-
-# variables for hacked content
-my $dependshack = "\t\t\tif (/^DEPENDS\$/o) {\r\n\t\t\t\tnext LINE;  # Ignore DEPENDS keyword, not needed by ABLD\r\n\t\t\t}\r\n";
-my $smpsafehack = "\t\tif (/^SMPSAFE\$/o) {\r\n\t\t\tnext LINE;  # Ignore SMPSAFE keyword, not needed by older environments\r\n\t\t}\r\n";
-my $forwardslashhack = "\t\t# EnvPatcher forwardslash hack begins\r\n\t\t\$_=~s{/}{\\\\}g;   # convert all forward slashes to backslashes\r\n\t\t# EnvPatcher forwardslash hack ends\r\n\r\n";
-my $coreibyexportsupport = "\r\n// Following definition is used for exporting tools and stubs IBY files to\r\n// Core image.\r\n#define CORE_IBY_EXPORT_PATH(path,exported)  /epoc32/rom/include/##exported\r\n";
-
-
-# check epoc32\tools exists
-unless (-d $e32toolsdir)
-{
-    print "$e32toolsdir not found, please check valid epocroot has been given!\n";
-    exit 1;
-}
-
-# check epoc32\include exists
-unless (-d $e32includedir)
-{
-    print "$e32includedir not found, please check valid epocroot has been given!\n";
-    exit 1;
-}
-
-
-# create epoc32\include\oem if it does not exist
-unless (-d $e32includeoemdir)
-{
-    mkdir $e32includeoemdir or die;
-    print "Missing directory $e32includeoemdir created succesfully.\n";
-}
-
-
-# check if epoc32\include\domain\osextensions\platform_paths.hrh exists
-if (-e $domainplatformpathspath)
-{
-    # show an error if the file does not have any platform macros
-    unless (string_exists_in_file($domainplatformpathspath, "OS_LAYER_SYSTEMINCLUDE"))
-    {
-        print "ERROR: $domainplatformpathspath does not have SF macros.\n";
-        print "Please check your environment, if you have S60 3.2 OEM or newer, please get the latest version!\n";
-        exit 2;
-    }
-}
-
-
-# check if epoc32\include\platform_paths.hrh exists
-if (-e $platformpathspath)
-{
-    print "$platformpathspath already exists, not checking it.\n";    
-}
-else
-{
-    # create the file missing file
-    create_default_platform_paths_hrh();
-    print "Missing file $platformpathspath created succesfully.\n";    
-}
-
-
-# check if CORE_IBY_EXPORT_PATH macro exist in the platform_paths.hrh
-unless (string_exists_in_file($platformpathspath, "CORE_IBY_EXPORT_PATH"))
-{
-    # read content of the platform_paths.hrh
-    my @filecontent = read_file_to_array($platformpathspath);  
-
-    my $match_found = 0;
-    my $i = 0;
-    my $match_found_pos = 0;
-    
-    # find the position where the include guards start (this should be a safe position)
-    foreach (@filecontent)
-    {
-        if ($_ =~ /#define PLATFORM_PATHS_HRH/)
-        {
-            $match_found = 1;
-            $match_found_pos = $i;
-            last;
-        } 
-
-        $i++;
-    }
-    
-    if ($match_found)
-    {
-        # insert the patched content to the file
-        splice(@filecontent, $match_found_pos+1, 0, $coreibyexportsupport);
-        
-        # write the modified array to the file
-        write_file_from_array($platformpathspath, @filecontent);
-    
-        print "Platform_paths.hrh updated to support CORE_IBY_EXPORT_PATH macro.\n";
-    }
-    else
-    {
-        print "WARNING: $platformpathspath is corrupted or not supported!\n";    
-    }
-}
- 
-    
-# check if epoc32\tools\mmp.pm exists
-if (-e $mmppmpath)
-{
-    # check if DEPENDS keyword already exists in the file
-    if (string_exists_in_file($mmppmpath, "DEPENDS"))
-    {
-        print "The SDK can already handle DEPENDS keyword in a MMP file.\n";        
-    }
-    else
-    {
-        # read content of the mmp.pm file
-        my @filecontent = read_file_to_array($mmppmpath);
-        
-        my $match_found = 0;
-        my $i = 0;
-        my $match_found_pos = 0;
-        
-        # loop through the array to find the correct place
-        foreach (@filecontent)
-        {
-            if ($_ =~ /Unrecognised Resource Keyword/)
-            {
-                $match_found = 1;
-                $match_found_pos = $i;
-                last;
-            } 
-
-            $i++;
-        }
-        
-        if ($match_found)
-        {
-            # insert the patched content to the file
-            splice(@filecontent, $match_found_pos-1, 0, $dependshack);
-            
-            # write the modified array to the file
-            write_file_from_array($mmppmpath, @filecontent);
-        
-            print "Mmp.pm patched with DEPENDS keyword hack.\n";
-        }
-        else
-        {
-            print "ERROR: Unable to find correct place from $mmppmpath for patching!\n";
-            print "Your SDK environment probably is not supported by this script!\n";
-            exit(2);    
-        }
-    }
-
-    # check if SMPSAFE keyword already exists in the file
-    if (string_exists_in_file($mmppmpath, "SMPSAFE"))
-    {
-        print "The SDK can already handle SMPSAFE keyword in a MMP file.\n";        
-    }
-    else
-    {
-        # read content of the mmp.pm file
-        my @filecontent = read_file_to_array($mmppmpath);
-        
-        my $match_found = 0;
-        my $i = 0;
-        my $match_found_pos = 0;
-        
-        # loop through the array to find the correct place
-        foreach (@filecontent)
-        {
-            if ($_ =~ /Unrecognised Keyword/)
-            {
-                $match_found = 1;
-                $match_found_pos = $i;
-                last;
-            } 
-
-            $i++;
-        }
-        
-        if ($match_found)
-        {
-            # insert the patched content to the file
-            splice(@filecontent, $match_found_pos, 0, $smpsafehack);
-            
-            # write the modified array to the file
-            write_file_from_array($mmppmpath, @filecontent);
-        
-            print "Mmp.pm patched with SMPSAFE keyword hack.\n";
-        }
-        else
-        {
-            print "ERROR: Unable to find correct place from $mmppmpath for patching!\n";
-            print "Your SDK environment probably is not supported by this script!\n";
-            exit(2);    
-        }
-    }
-}
-else
-{
-    print "WARNING: $mmppmpath not found, this environment is not supported!\n";
-}
-
-
-# check if epoc32\tools\pathutl.pm exists
-if (-e $pathutlpmpath)
-{
-    # check if "sub Path_Norm" already exists in the pathutil.pm file
-    # if it does not exists, then we need to patch prepfile.pm
-    if (string_exists_in_file($pathutlpmpath, "sub Path_Norm"))
-    {
-        print "The SDK is non Symbian OS 9.1, no need to add forward slash hack.\n";        
-    }
-    else
-    {
-        # check if prepfile.pm has already been patched
-        if (string_exists_in_file($prepfilepmpath, "EnvPatcher forwardslash hack"))
-        {        
-            print "The SDK has already been patched with forwardslash hack.\n";         
-        }
-        else
-        {    
-            # read content of the prepfile.pm file
-            my @filecontent = read_file_to_array($prepfilepmpath);  
-    
-            my $match_found = 0;
-            my $i = 0;
-            my $match_found_pos = 0;
-            
-            # loop through the array to find the correct place
-            foreach (@filecontent)
-            {
-                if ($_ =~ /# skip blank lines/)
-                {
-                    $match_found = 1;
-                    $match_found_pos = $i;
-                    last;
-                } 
-    
-                $i++;
-            }
-            
-            if ($match_found)
-            {
-                # insert the patched content to the file
-                splice(@filecontent, $match_found_pos+6, 0, $forwardslashhack);
-                
-                # write the modified array to the file
-                write_file_from_array($prepfilepmpath, @filecontent);
-            
-                print "Prepfile.pm patched with forward slash hack.\n";
-            }
-            else
-            {
-                print "ERROR: Unable to find correct place from $prepfilepmpath for patching!\n";
-                print "Your SDK environment probably is not supported by this script!\n";
-                exit(2);    
-            }
-        }
-    }    
-}
-else
-{
-    print "WARNING: $pathutlpmpath not found, this environment is not supported!\n";
-}
- 
- 
- 
-# checks if string exists in the file    
-sub string_exists_in_file
-{
-    my $filepath = $_[0];
-    my $findstring = $_[1];
-    my $match_found = 0;     
-
-    open(FILE, "<", $filepath) or die "Failed to open $filepath for reading!";
-
-    # loop through the file for occurances
-    while (<FILE>)
-    {
-        if ($_ =~ /$findstring/)
-        {
-            $match_found = 1;
-            last;
-        } 
-    }
-
-    close FILE;
-    
-    return $match_found;
-}
-
-
-# reads lines from a file to an array    
-sub read_file_to_array
-{
-    my $filepath = $_[0];
-
-    open(FILE, "<", $filepath) or die "Failed to open $filepath for reading!";
-    my @data = <FILE>;
-    close FILE;
-    
-    return(@data);
-}
-
-
-# writes lines from an array to a file
-sub write_file_from_array
-{
-    my ($filepath, @data) = @_;
-    
-    # take a backup of the file
-    copy ($filepath, $filepath."EnvPatcher") or die "Cannot take backup of $filepath to $filepath.EnvPatcher";
-        
-    open(FILE, ">", $filepath) or die "Failed to open $filepath for writing!";
-
-    # write the array to file
-    foreach my $line (@data)
-    {
-        print FILE "$line";
-    }
-
-    close FILE;
-}
-
-sub create_default_platform_paths_hrh
-{
-    # the file does not exist, so create the missing file
-    open(FILE, ">", $platformpathspath) or die "Failed to open $platformpathspath for writing!\n";
-    
-    print FILE <<ENDOFTHEFILE;
-#ifndef PLATFORM_PATHS_HRH
-#define PLATFORM_PATHS_HRH
-
-/**
-* ---------------------------------------
-* Location, where the applications layer specific public headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define APP_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define APP_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the applications layer specific platform headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define APP_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define APP_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the middleware layer specific public headers should be exported
-* See usage on top of this hrh-file.
-* ---------------------------------------
-*/
-#define MW_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define MW_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the middleware layer specific platform headers should be exported
-* ---------------------------------------
-*/
-#define MW_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define MW_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the os layer specific public headers should be exported
-* ---------------------------------------
-*/
-#define  OSEXT_LAYER_SDK_EXPORT_PATH(exported) /epoc32/include/##exported
-#define  OS_LAYER_PUBLIC_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the os specific platform headers should be exported
-* ---------------------------------------
-*/
-#define OSEXT_LAYER_DOMAIN_EXPORT_PATH(exported) /epoc32/include/##exported
-#define OS_LAYER_PLATFORM_EXPORT_PATH(exported) /epoc32/include/##exported
-
-/**
-* ---------------------------------------
-* Location, where the  cenrep excel sheets should be exported
-* Deprecated: should no longer be used. Kept for compability.
-* ---------------------------------------
-*/
-#define CENREP_XLS_EXPORT_PATH(exported) /epoc32/tools/cenrep/data/src/##exported
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be 
-* used in the mmp-files that are part of the applications-layer. It includes all 
-* the needed directories from the /epoc32/include, that are valid ones for the 
-* application-layer components. 
-*
-* Applications layer is the last one in the list, since most likely the most of 
-* the headers come from middleware or os-layer  => thus they are first.
-*/
-#define APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
- 
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the middleware-layer. It includes all 
-* the needed directories from the /epoc32/include, that are valid ones for the 
-* middleware-layer components. 
-*/
-#define MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the  osextensions-layer. It includes all
-* the needed directories from the /epoc32/include, that are valid ones for the
-* os-layer components. 
-*/
-#define OS_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include /epoc32/include/oem
-
-
-// Below statement is Deprecated and the OS_LAYER_SYSTEMINCLUDE-macro has to be
-// used.
-#define OSEXT_LAYER_SYSTEMINCLUDE OS_LAYER_SYSTEMINCLUDE
-
-/**
-* This define statements defines the SYSTEMINCLUDE-line, which is intended to be
-* used in the mmp-files that are part of the os-layer. This is intended 
-* to be only used by those components which need to use in their mmp-file either
-* kern_ext.mmh or nkern_ext.mmh. Reason is that those
-* 2 files already contain the /epoc32/include  as system include path.
-* 
-*/
-#define OS_LAYER_KERNEL_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/oem
-
-
-// Below statement is Deprecated and the OS_LAYER_KERNEL_SYSTEMINCLUDE-macro 
-// has to be used.
-#define OSEXT_LAYER_KERNEL_SYSTEMINCLUDE OS_LAYER_KERNEL_SYSTEMINCLUDE
-
-/**
-****************************************************************************
-* Definitions that also define the paths to the layer specific source directories.
-****************************************************************************
-*/
-/**
-* The below 3 macros define the paths to the layer-specific source dirs.
-* See usage on top of this hrh-file, these are used the same way as 
-* for instance the OS_LAYER_DOMAIN_EXPORT_PATH
-* Deprecated: is not allowed to be using in Symbian Foundation
-*/
-#define APP_LAYER_SOURCE_PATH(rest)    /s60/app/##rest
-#define MW_LAYER_SOURCE_PATH(rest)     /s60/mw/##rest
-#define OSEXT_LAYER_SOURCE_PATH(rest)  /s60/osext/##rest
-
-/**
-****************************************************************************
-* Definitions to export IBY files to different folders where they will be taken 
-* to ROM image
-****************************************************************************
-*/
-// Following definition is used for exporting tools and stubs IBY files to 
-// Core image.
-#define CORE_IBY_EXPORT_PATH(path,exported)  /epoc32/rom/include/##exported
-
-/**
-* ---------------------------------------
-* Macros for Configuration tool migration. 
-* The below macros define the location under epoc32, where the confml 
-* (Configuration Markup Language) and crml (Central Repository Markup Language) 
-* files should be exported.
-* ---------------------------------------
-*/
-#define CONFML_EXPORT_PATH(file,category)           /epoc32/rom/config/confml_data/##category##/##file
-#define CRML_EXPORT_PATH(file,category)             /epoc32/rom/config/confml_data/##category##/##file
-#define GCFML_EXPORT_PATH(file,category)            /epoc32/rom/config/confml_data/##category##/##file
-#define CONFML_CONFIG_EXPORT_PATH(file,category)    /epoc32/rom/config/confml_data/##category##/config/##file
-
-#define APP_LAYER_CONFML(exported) 	                CONFML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_CRML(exported)                    CRML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_GCFML(exported)                   GCFML_EXPORT_PATH(exported,s60)
-#define APP_LAYER_CONFML_CONFIG(exported)           CONFML_CONFIG_EXPORT_PATH(exported,s60)
-                                                    
-#define MW_LAYER_CONFML(exported)                   CONFML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_CRML(exported)                     CRML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_GCFML(exported)                    GCFML_EXPORT_PATH(exported,s60)
-#define MW_LAYER_CONFML_CONFIG(exported)            CONFML_CONFIG_EXPORT_PATH(exported,s60)
-       
-// Deprecate: Use the OS_LAYER_* macros instead of OSEXT_LAYER_*                                             
-#define OSEXT_LAYER_CONFML(exported)                CONFML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_CRML(exported)                  CRML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_GCFML(exported)                 GCFML_EXPORT_PATH(exported,s60)
-#define OSEXT_LAYER_CONFML_CONFIG(exported)         CONFML_CONFIG_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CONFML(exported)                   CONFML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CRML(exported)                     CRML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_GCFML(exported)                    GCFML_EXPORT_PATH(exported,s60)
-#define OS_LAYER_CONFML_CONFIG(exported)            CONFML_CONFIG_EXPORT_PATH(exported,s60)
-
-#endif  // end of PLATFORM_PATHS_HRH
-
-ENDOFTHEFILE
-
-    close FILE;    
-}
--- a/launcher/envpatcher/ReadMe.txt	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-Environment Patcher v1.0.1
-==========================
-
-Updated: 12th November 2009
-
-
-Introduction:
--------------
-This tool can be used to patch your S60 SDK environment so that the tricks and
-macros introduced in the latest SDKs can be used in a public SDK and older
-OEM releases.
-
-This tool can perform the following tasks:
-- Adds support for forward slashes in paths in bld.inf/.mmp files in S60 3.0 
-- Removes an unncessary warning about DEPENDS and SMPSAFE resource keywords in
-  an .mmp file
-- Creates a missing epoc32\include\platform_paths.hrh file for supporting
-  platform macros introduced since S60 3.2 OEM and Symbian Foundation releases
-- Modifies epoc32\include\platform_paths.hrh for missing macros   
-- Creates a missing epoc32\include\oem directory to suppress a possible warning
-
-
-Usage:
-------
-EnvPatcher.pl <EPOCROOT>
-
-Where EPOCROOT is the path to the root of the SDK, for example:
-  EnvPatcher.pl c:\Symbian\9.1\S60_3rd_MR
-  EnvPatcher.pl z:\
-
-
-Requirements:
--------------
-- S60 SDK (public or OEM), version 3.0 or newer
-- Perl 5.6.1 or newer
-
-
-
-
-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 "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
--- a/launcher/group/ReleaseNotes_Launcher.txt	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-===============================================================================
-
-RELEASE NOTES - LAUNCHER v3.7.0
-RELEASED 29th May 2009 
-
-SUPPORTS S60 3.0+
-
-===============================================================================
-
-Product Description:
-====================
-Launcher is a testing utility application aimed to help test the launching of
-applications installed in the system, both on user side disk drives and on
-ROM. Launcher tests if an application can be launched and then, if the launch
-has failed, reports the possible reason for the failure. It is a very useful
-application when checking the build as the user can instantly see if the
-applications work. Launcher can also be used when testing binary
-compatibility issues because it can reveal any DLL files missing from the
-device.
-
-Main Features:
-==============
-- Show a list of installed applications in all drives
-- Launch selected applications and read their statuses from threads
-- In case of a failure, report thread's exit type, reason and category
-- Show missing DLL files required by the binary to be launched
-- Show problems on the UI and print all cases to a log file
-- Generate a list of DLLs in the device to a file
-- Analyse binary compatibility of system DLLs comparing them to a user
-  given reference data. Report any binary compatibility issues or missing
-  DLL files.
-
-===============================================================================
-
-What's New in v3.7.0
-====================
-- Feature: Binary compatiblity check for DLLs, which checks UID1, UID2, UID3, SID
-and capability values of system DLLs against an XML-formatted input file.
-- Fix: Launcher panics when comparing a large DLL list against system DLLs.
-- Fix: Launcher panics when application launching is cancelled.
-
-===============================================================================
-
-Installation Notes:
-===================
-Launcher is typically preinstalled on ROM. If not, it can be added to the
-ROM with the .iby file. Alternatively, a .sis file can be found under the sis-
-directory, but the user needs to sign it with their own developer certificate.
-In Nokia R&D environment, you can use directly the R&D-signed .sis file under the
-internal\sis directory.
-
-When signing with own developer certificate, the following capabilities are
-needed:
-  PowerMgmt
-  ReadDeviceData
-  WriteDeviceData
-  AllFiles
-  ReadUserData
-  WriteUserData
-
-When building Launcher against S60 3.0 or 3.1, you may need to patch your SDK
-environment first with some fixes. For more information, please refer to the
-instructions under the "envpatcher" directory.
-  
-===============================================================================
-
-System Requirements:
-====================
-Basic Requirements:
-- Any S60 3.x device or emulator environment
-
-===============================================================================
-
-Compatibility Issues:
-=====================
-N/A
-
-===============================================================================
-
-Known Issues:
-=============
-
-Fails in a test despite the application is working correctly
-------------------------------------------------------------
-- Some application may exit immediately after a launch. This can be
-  normal behavior and should be checked manually. Such application is, for example, 
-  irapp.exe.
-  
-Binary compatibility check support
-----------------------------------
-- Currently, only uncompressed and deflate compressed ELF binaries are
-  supported. This means that for example WINSCW is not supported.
-
-===============================================================================
-
-Version History:
-================
-
-Version 3.6.3 - 14th March 2008
--------------------------------
-- Change: Removed unnecessary capabilities
-
-Version 3.6.2 - 6th November 2007
---------------------------------
-- Fix: Applications can be selected/unselected on a touch UI
-- Fix: Scroll bar in the output view can be scrolled on a touch UI
-
-Version 3.6.1 - 9th October 2007
---------------------------------
-- Fix: Layout in out tab in mirrored mode
-- Fix: Codescanner high warnings
-
-Version 3.6.0 - 25th January 2007
----------------------------------
-- Fix: Re-fix problems when reading import section from binaries
-- Fix: Output screen for larger resolutions
-- Fix: Stopping of launching
-
-Version 3.5.0 - 4th December 2006
----------------------------------
-- Fix: Problems when reading import section from binaries
-- Change: Marquee used for items in the application list view
-
-===============================================================================
-
-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 "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
--- a/launcher/group/backup_registration.xml	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<backup_registration>
-  <passive_backup>
-    <include_directory name="\"/>
-  </passive_backup>
-  <system_backup/>
-  <restore requires_reboot = "no"/>
-</backup_registration>
--- a/launcher/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_EXPORTS
-../group/backup_registration.xml    Z:/private/101fb74f/backup_registration.xml
-../rom/Launcher.iby CORE_IBY_EXPORT_PATH(tools,Launcher.iby)
-
-
-PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
-  gnumakefile launcher_icons_aif.mk
-
-  #ifdef MARM
-  gnumakefile launcher_stub_sis.mk
-  #endif
-#endif
-
-launcher.mmp
-
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE launcher_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_launcher
-  END
-
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME Launcher_stub
-  END
-  #endif  
-#endif
--- a/launcher/group/launcher.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-#include "../symbian_version.hrh"
-
-
-TARGET            Launcher.exe
-TARGETTYPE        exe
-EPOCSTACKSIZE     0x5000
-EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
-
-UID               0x100039CE 0x101FB74F
-
-VENDORID          VID_DEFAULT
-CAPABILITY        ReadUserData ReadDeviceData WriteUserData WriteDeviceData PowerMgmt AllFiles
-
-SMPSAFE
-
-LANG              SC
-
-
-START RESOURCE    ../data/launcher.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../data/launcher_reg.rss
-DEPENDS           launcher.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-APP_LAYER_SYSTEMINCLUDE
-USERINCLUDE       ../inc
-SOURCEPATH        ../src
-
-
-SOURCE            launcher.cpp
-SOURCE            launcherapplication.cpp 
-SOURCE            launcherdocument.cpp
-SOURCE            launcherappui.cpp
-SOURCE            launcherviewapps.cpp
-SOURCE            launcherviewoutput.cpp
-SOURCE            launchercontaineroutput.cpp
-SOURCE            launchercontainerapps.cpp
-SOURCE            launcherengine.cpp
-SOURCE            e32image.cpp 
-SOURCE			  launcherxmlparser.cpp 
-SOURCE            launcherdllelement.cpp
-SOURCE            launcherdllparser.cpp
-
-LIBRARY           euser.lib
-LIBRARY           apparc.lib
-LIBRARY           cone.lib 
-LIBRARY           eikcore.lib  
-LIBRARY           avkon.lib 
-LIBRARY           efsrv.lib
-LIBRARY           apgrfx.lib
-LIBRARY           ws32.lib
-LIBRARY           bafl.lib
-LIBRARY           eikcoctl.lib
-LIBRARY           eikctl.lib
-LIBRARY           aknnotify.lib 
-LIBRARY           egul.lib
-LIBRARY           aknicon.lib
-LIBRARY           flogger.lib
-LIBRARY           platformenv.lib
-LIBRARY           aknskins.lib
-LIBRARY           aknskinsrv.lib
-LIBRARY           aknswallpaperutils.lib
-LIBRARY           gdi.lib
-LIBRARY 	      xmlframework.lib
-LIBRARY           charconv.lib
-LIBRARY           commondialogs.lib
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-LIBRARY           sendui.lib 
-#endif
-
-// End of File
--- a/launcher/group/launcher_icons_aif.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\launcher_aif.mif
-
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN :
-	@if exist $(ICONTARGETFILENAME) erase $(ICONTARGETFILENAME)
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-RESOURCE : $(ICONTARGETFILENAME)
-
-$(ICONTARGETFILENAME) : ..\icons\qgn_menu_launcher.svg
-	mifconv $(ICONTARGETFILENAME) \
-		/c8,8 ..\icons\qgn_menu_launcher.svg
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/launcher/group/launcher_stub_sis.mk	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# 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 "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:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  
-#
-
-
-TARGETDIR=$(EPOCROOT)EPOC32\Data\Z\System\Install
-
-SISNAME=Launcher_stub
-PKGNAME=Launcher_stub
-
-$(TARGETDIR) :
-	@perl -S emkdir.pl "$(TARGETDIR)"
-
-do_nothing :
-	rem do_nothing
-
-SISFILE=$(TARGETDIR)\$(SISNAME).sis
-
-$(SISFILE) : ..\sis\$(PKGNAME).pkg
-	makesis -s $? $@ 
-
-
-
-MAKMAKE : do_nothing
-
-RESOURCE : do_nothing
-
-SAVESPACE : do_nothing
-
-BLD : do_nothing
-
-FREEZE : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-FINAL : $(TARGETDIR) $(SISFILE)
-
-CLEAN : 
-	@if exist $(SISFILE) erase $(SISFILE)
-
-RELEASABLES : 
-	@echo $(SISFILE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/icons/check.svg	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="64px"
+   height="64px"
+   id="svg2425"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="littlecheck.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs2427">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 32 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="64 : 32 : 1"
+       inkscape:persp3d-origin="32 : 21.333333 : 1"
+       id="perspective2433" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="5.5"
+     inkscape:cx="41.434135"
+     inkscape:cy="30.383938"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:document-units="px"
+     inkscape:grid-bbox="true"
+     inkscape:window-width="1680"
+     inkscape:window-height="960"
+     inkscape:window-x="-4"
+     inkscape:window-y="-4" />
+  <metadata
+     id="metadata2430">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <g
+       style="opacity:1"
+       id="g2392"
+       inkscape:label="Taso 1"
+       transform="translate(142.14286,-114.28572)">
+      <path
+         id="path2380"
+         d="M 88.571429,669.50504 C 157.14286,706.6479 165.71429,755.21933 165.71429,755.21933 L 260,755.21933 L 377.14286,498.07647 L 297.14286,520.93361 L 220,683.79075 L 137.14286,615.21933 L 88.571429,669.50504 z"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         id="path2382"
+         d="M 166.13825,753.72414 C 160.59283,734.93105 150.56818,718.85592 134.09168,702.33551 C 122.39811,690.61077 109.94955,681.0295 95.667678,672.7617 C 92.528095,670.9442 90.022074,669.29624 90.098744,669.09959 C 90.391504,668.34866 136.88523,616.64733 137.26775,616.64733 C 137.48928,616.64733 156.25397,632.01906 178.96703,650.80675 L 220.26352,684.96615 L 221.01814,683.36302 C 221.43318,682.48128 238.8474,645.7167 259.71641,601.66393 L 297.66005,521.56799 L 336.5681,510.41987 C 357.96753,504.2884 375.52719,499.31453 375.58957,499.3668 C 375.65196,499.41909 349.60366,556.8017 317.70448,626.88374 L 259.70597,754.3056 L 213.01297,754.32277 C 176.07199,754.33635 166.282,754.21133 166.13824,753.72414 L 166.13825,753.72414 z"
+         style="fill:#808080;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    </g>
+    <g
+       style="opacity:1"
+       id="g2438"
+       inkscape:label="Taso 1"
+       transform="matrix(0.2179694,0,0,0.244371,-19.028457,-120.49825)">
+      <path
+         id="path2440"
+         d="M 88.571429,669.50504 C 157.14286,706.6479 165.71429,755.21933 165.71429,755.21933 L 260,755.21933 L 377.14286,498.07647 L 297.14286,520.93361 L 220,683.79075 L 137.14286,615.21933 L 88.571429,669.50504 z"
+         style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         id="path2442"
+         d="M 166.13825,753.72414 C 160.59283,734.93105 150.56818,718.85592 134.09168,702.33551 C 122.39811,690.61077 109.94955,681.0295 95.667678,672.7617 C 92.528095,670.9442 90.022074,669.29624 90.098744,669.09959 C 90.391504,668.34866 136.88523,616.64733 137.26775,616.64733 C 137.48928,616.64733 156.25397,632.01906 178.96703,650.80675 L 220.26352,684.96615 L 221.01814,683.36302 C 221.43318,682.48128 238.8474,645.7167 259.71641,601.66393 L 297.66005,521.56799 L 336.5681,510.41987 C 357.96753,504.2884 375.52719,499.31453 375.58957,499.3668 C 375.65196,499.41909 349.60366,556.8017 317.70448,626.88374 L 259.70597,754.3056 L 213.01297,754.32277 C 176.07199,754.33635 166.282,754.21133 166.13824,753.72414 L 166.13825,753.72414 z"
+         style="fill:#808080;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    </g>
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/applicationview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef APPLICATIONVIEW_H
+#define APPLICATIONVIEW_H
+
+#include <hbview.h>
+
+class HbAction;
+class HbDocumentLoader;
+class HbListWidget;
+class CommonActions;
+class EngineWrapper;
+
+class ApplicationView : public HbView
+{
+    Q_OBJECT
+    
+public:
+    
+    /**
+     * Constructor
+     */
+    ApplicationView();
+    
+    /**
+     * Destructor
+     */
+    ~ApplicationView();
+
+    /**
+     * Created Application View
+     */
+    static ApplicationView* create(HbDocumentLoader &loader,
+                        CommonActions *commonActions, 
+                        EngineWrapper *engine);
+    
+    /**
+     * Setter for engine
+     */
+    void setEngine(EngineWrapper *engine);
+    
+private slots:
+
+    
+    /**
+     * Refreshed application list
+     */
+    void refreshAppList();
+    
+    /**
+     * Launches selected applications
+     */
+    void launchSelectedApplications();
+    
+    /**
+     * Launches and closes selected applications
+     */
+    void launchAndCloseSelectedApplications();
+    
+    /**
+     * Selects all list items
+     */
+    void selectAllItems();
+    
+    /**
+     * unselects all items
+     */
+    void unselectAllItems();
+    
+    /**
+     * Changes launch options so that hidden applications are skipped
+     */
+    void launchOptionsSkipHidden();
+    
+    /**
+     * Changes launch options so that hidden applications are not skipped
+     */
+    void launchOptionsDontSkipHidden();
+    
+    /**
+     * Opens output view
+     */
+    void openOutputView();
+
+
+private:
+    
+    /**
+     * Initializes view
+     */
+    void init(HbDocumentLoader &loader, CommonActions *commonActions);
+    
+    /**
+     * connects signals and slots
+     */
+    void connectSignalsAndSlots();
+    
+    /**
+     * Loads all UI items from xml file
+     */
+    void loadItemsFromXml(HbDocumentLoader &loader);
+  
+private slots:
+
+    
+private:
+    EngineWrapper *mEngine;
+    
+    //UI components:
+    HbListWidget *mApplicationList;
+    
+    //Actions:
+    HbAction *mActionRefresh;
+    HbAction *mActionLaunchApps;
+    HbAction *mActionLaunchAndCloseApps;
+    HbAction *mActionSkipHidden;
+    HbAction *mActionDontSkipHidden;
+    HbAction *mActionSelectAll;
+    HbAction *mActionUnselectAll;
+    HbAction *mActionOpenOutputView;
+
+
+};
+
+#endif // APPLICATIONVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/commonActions.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef COMMONACTIONS_H
+#define COMMONACTIONS_H
+
+#include <qobject.h>
+
+class EngineWrapper;
+class HbAction;
+class HbMenu;
+class HbApplication;
+
+class CommonActions : public QObject
+{
+    Q_OBJECT
+public:
+    
+    /**
+     * Constructor
+     */
+    CommonActions(EngineWrapper *engine, HbApplication *application);
+    
+    /**
+     * Destructor
+     */
+    ~CommonActions();
+    
+    /**
+     * Adds all actions to menu that is given as parameter
+     */
+    void addActionsToMenu(HbMenu *menu);
+    
+public slots:
+
+    /**
+     * Shows about box
+     */
+    void showAbout();
+    
+    /**
+     * Stops launching applications
+     */
+    void stopLaunch();
+    
+    /**
+     * Sends DLL info
+     */
+    void sendDllInfo();
+    
+    /**
+     * Compares DLL infos
+     */
+    void compareDllInfo();
+    
+    /**
+     * Sends log
+     */
+    void sendLog();
+    
+    /**
+     * Deletes log
+     */
+    void deleteLog();
+    
+    /**
+     * Exits launcher
+     */
+    void exit();
+
+private:
+    void connectSignalsAndSlots();
+    
+private:
+    EngineWrapper *mEngine;
+    
+    HbApplication *mApplication;
+    
+    //Actions:
+
+    HbAction *mActionStopLaunch;
+    HbAction *mActionSendDllInfo;
+    HbAction *mActionCompareDllInfo;
+    HbAction *mActionSendLog;
+    HbAction *mActionDeleteLog;
+    HbAction *mActionAbout;
+    HbAction *mActionExit;
+    
+};
+    
+#endif //COMMONACTIONS_H
--- a/launcher/inc/e32image.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHERE32IMAGE_H__
-#define __LAUNCHERE32IMAGE_H__
-
-#include <e32base.h>
-#include <badesca.h>
-#include <eikenv.h>
-
-class E32ImageHeader;
-class E32ImportSection;
-class E32RelocSection;
-class CEikonEnv;
-
-
-NONSHARABLE_CLASS(E32ImageReader) : public CBase, public TProcessCreateInfo
-	{
-public:
-	static E32ImageReader* NewLC();
-	~E32ImageReader();
-
-public:
-    CDesCArray* ListOfDLLsL(const TDesC& aFullPathToE32Image);
-
-private:
-	E32ImageReader();
-	void ConstructL();
-    TInt LoadData();
-    static TUint8* MemoryMove(TAny* aDestination, const TAny* aSource, TInt aNumberofBytes);
-    TInt LoadFile(TUint32 aCompression);
-    TInt LoadFileNoCompress();
-    void LoadFileInflateL();
-    TInt Read(TText8* aDest, TInt aSize);
-    TInt Read(TInt aPos, TText8* aDest, TInt aSize);
-    TInt ReadImportData();
-
-private:
-	CEikonEnv*      iEnv;
-
-public:
-	E32ImageHeader* iHeader;
-	E32ImportSection* iImportSection;
-	E32RelocSection* iCodeRelocSection;
-	E32RelocSection* iDataRelocSection;
-	TUint32* iImportData;
-	TUint8* iRestOfFileData;
-	TUint32 iRestOfFileSize;
-	TUint32 iConversionOffset;
-	RFile iFile;
-	TUint32 iCodeDelta;
-	TUint32 iDataDelta;
-	TUint32 iExportDirLoad;
-	TBool isDll;
-	TBool iAlreadyLoaded;
-	TAny* iCloseCodeSeg;
-	TInt iCurrentImportCount;
-	TInt iNextImportPos;
-	TUint32* iCurrentImportList;
-	TUint8 iCurrentImportListSorted;
-	TUint8 iExportDirLoadAllocated;
-	TUint8 iPadding1;
-	TUint8 iPadding2;
-	};
-
-#endif // __LAUNCHERE32IMAGE_H__
--- a/launcher/inc/e32imageheaders.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,534 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHERE32IMAGEHEADERS_H__
-#define __LAUNCHERE32IMAGEHEADERS_H__
-
-#include <e32uid.h>
-
-/** Bit output stream.
-	Good for writing bit streams for packed, compressed or huffman data algorithms.
-
-	This class must be derived from and OverflowL() reimplemented if the bitstream data
-	cannot be generated into a single memory buffer.
-*/
-class TBitOutput
-	{
-public:
-	IMPORT_C TBitOutput();
-	IMPORT_C TBitOutput(TUint8* aBuf,TInt aSize);
-	inline void Set(TUint8* aBuf,TInt aSize);
-	inline const TUint8* Ptr() const;
-	inline TInt BufferedBits() const;
-//
-	IMPORT_C void WriteL(TUint aValue, TInt aLength);
-	IMPORT_C void HuffmanL(TUint aHuffCode);
-	IMPORT_C void PadL(TUint aPadding);
-private:
-	void DoWriteL(TUint aBits, TInt aSize);
-	virtual void OverflowL();
-private:
-	TUint iCode;		// code in production
-	TInt iBits;
-	TUint8* iPtr;
-	TUint8* iEnd;
-	};
-
-/** Set the memory buffer to use for output
-
-	Data will be written to this buffer until it is full, at which point OverflowL() will
-	be called. This should handle the data and then can Set() again to reset the buffer
-	for further output.
-	
-	@param aBuf The buffer for output
-	@param aSize The size of the buffer in bytes
-*/
-inline void TBitOutput::Set(TUint8* aBuf,TInt aSize)
-	{iPtr=aBuf;iEnd=aBuf+aSize;}
-	
-/** Get the current write position in the output buffer
-
-	In conjunction with the address of the buffer, which should be known to the
-	caller, this describes the data in the bitstream.
-*/
-inline const TUint8* TBitOutput::Ptr() const
-	{return iPtr;}
-	
-/** Get the number of bits that are buffered
-
-	This reports the number of bits that have not yet been written into the
-	output buffer. It will always lie in the range 0..7. Use PadL() to
-	pad the data out to the next byte and write it to the buffer.
-*/
-inline TInt TBitOutput::BufferedBits() const
-	{return iBits+8;}
-
-
-/** Bit input stream. Good for reading bit streams for packed, compressed or huffman
-	data algorithms.
-*/
-class TBitInput
-	{
-public:
-	IMPORT_C TBitInput();
-	IMPORT_C TBitInput(const TUint8* aPtr, TInt aLength, TInt aOffset=0);
-	IMPORT_C void Set(const TUint8* aPtr, TInt aLength, TInt aOffset=0);
-//
-	IMPORT_C TUint ReadL();
-	IMPORT_C TUint ReadL(TInt aSize);
-	IMPORT_C TUint HuffmanL(const TUint32* aTree);
-private:
-	virtual void UnderflowL();
-private:
-	TInt iCount;
-	TUint iBits;
-	TInt iRemain;
-	const TUint32* iPtr;
-	};
-
-/** Huffman code toolkit.
-
-	This class builds a huffman encoding from a frequency table and builds
-	a decoding tree from a code-lengths table
-
-	The encoding generated is based on the rule that given two symbols s1 and s2, with 
-	code length l1 and l2, and huffman codes h1 and h2:
-
-		if l1<l2 then h1<h2 when compared lexicographically
-		if l1==l2 and s1<s2 then h1<h2 ditto
-
-	This allows the encoding to be stored compactly as a table of code lengths
-*/
-class Huffman
-	{
-public:
-	enum {KMaxCodeLength=27};
-	enum {KMetaCodes=KMaxCodeLength+1};
-	enum {KMaxCodes=0x8000};
-public:
-	IMPORT_C static void HuffmanL(const TUint32 aFrequency[],TInt aNumCodes,TUint32 aHuffman[]);
-	IMPORT_C static void Encoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aEncodeTable[]);
-	IMPORT_C static void Decoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aDecodeTree[],TInt aSymbolBase=0);
-	IMPORT_C static TBool IsValid(const TUint32 aHuffman[],TInt aNumCodes);
-//
-	IMPORT_C static void ExternalizeL(TBitOutput& aOutput,const TUint32 aHuffman[],TInt aNumCodes);
-	IMPORT_C static void InternalizeL(TBitInput& aInput,TUint32 aHuffman[],TInt aNumCodes);
-	};
-
-
-enum TCpu
-	{
-	ECpuUnknown=0, ECpuX86=0x1000, ECpuArmV4=0x2000, ECpuArmV5=0x2001, ECpuArmV6=0x2002, ECpuMCore=0x4000
-	};
-	
-const TInt KOrdinalBase=1;
-const TUint KImageDll				= 0x00000001u;
-const TUint KImageNoCallEntryPoint	= 0x00000002u;
-const TUint KImageFixedAddressExe	= 0x00000004u;
-const TUint KImageOldJFlag			= 0x00000008u;	// so we can run binaries built with pre 2.00 tools (hdrfmt=0)
-const TUint KImageOldElfFlag		= 0x00000010u;	// so we can run binaries built with pre 2.00 tools (hdrfmt=0)
-const TUint KImageABIMask			= 0x00000018u;	// only if hdr fmt not zero
-const TInt	KImageABIShift			= 3;
-const TUint	KImageABI_GCC98r2		= 0x00000000u;	// for ARM
-const TUint	KImageABI_EABI			= 0x00000008u;	// for ARM
-const TUint KImageEptMask			= 0x000000e0u;	// entry point type
-const TInt	KImageEptShift			= 5;
-const TUint KImageEpt_Eka1			= 0x00000000u;
-const TUint KImageEpt_Eka2			= 0x00000020u;
-const TUint KImageHdrFmtMask		= 0x0f000000u;
-const TInt	KImageHdrFmtShift		= 24;
-const TUint KImageHdrFmt_Original	= 0x00000000u;	// without compression support
-const TUint KImageHdrFmt_J			= 0x01000000u;	// with compression support
-const TUint KImageHdrFmt_V			= 0x02000000u;	// with versioning support
-const TUint KImageImpFmtMask		= 0xf0000000u;
-const TInt	KImageImpFmtShift		= 28;
-const TUint KImageImpFmt_PE			= 0x00000000u;	// PE-derived imports
-const TUint KImageImpFmt_ELF		= 0x10000000u;	// ELF-derived imports
-const TUint KImageImpFmt_PE2		= 0x20000000u;	// PE-derived imports without redundant copy of import ordinals
-const TUint KImageHWFloatMask		= 0x00f00000u;
-const TInt	KImageHWFloatShift		= 20;
-const TUint	KImageHWFloat_None		= EFpTypeNone << KImageHWFloatShift; // No hardware floating point used
-const TUint KImageHWFloat_VFPv2		= EFpTypeVFPv2 << KImageHWFloatShift; // ARM VFPv2 floating point used
-
-const TUint KMyFormatNotCompressed=0;
-const TUint KMyUidCompressionDeflate=0x101F7AFC;
-
-const TUint32 KImageCrcInitialiser	= 0xc90fdaa2u;
-/*
-const TUint16 KReservedRelocType        = (TUint16)0x0000;
-const TUint16 KTextRelocType            = (TUint16)0x1000;
-const TUint16 KDataRelocType            = (TUint16)0x2000;
-const TUint16 KInferredRelocType        = (TUint16)0x3000;
-*/
-class RFile;
-class E32ImageHeader
-	{
-public:
-	inline static TUint ABIFromFlags(TUint aFlags)
-		{
-		if (aFlags&KImageHdrFmtMask)
-			return aFlags & KImageABIMask;
-		if (aFlags&KImageOldElfFlag)
-			return KImageABI_EABI;
-		return KImageABI_GCC98r2;
-		}
-	inline static TUint EptFromFlags(TUint aFlags)
-		{
-		if (aFlags&KImageHdrFmtMask)
-			return aFlags & KImageEptMask;
-		if (aFlags&KImageOldJFlag)
-			return KImageEpt_Eka2;
-		return KImageEpt_Eka1;
-		}
-	inline static TUint HdrFmtFromFlags(TUint aFlags)
-		{
-		if (aFlags&KImageHdrFmtMask)
-			return aFlags & KImageHdrFmtMask;
-		if (aFlags&KImageOldJFlag)
-			return KImageHdrFmt_J;
-		return KImageHdrFmt_Original;
-		}
-	inline static TUint ImpFmtFromFlags(TUint aFlags)
-		{
-		if (aFlags&KImageHdrFmtMask)
-			return aFlags & KImageImpFmtMask;
-		if (aFlags&KImageOldElfFlag)
-			return KImageImpFmt_ELF;
-		return KImageImpFmt_PE;
-		}
-	inline TUint32 CompressionType() const
-		{
-		if (HdrFmtFromFlags(iFlags) >= KImageHdrFmt_J)
-			return iCompressionType;
-		return 0;
-		}
-	inline TUint32 ModuleVersion() const
-		{
-		if ((iFlags & KImageHdrFmtMask) >= KImageHdrFmt_V)
-			return iModuleVersion;
-		return 0x00000000u;
-		}
-	inline TInt TotalSize() const;
-	inline TInt UncompressedFileSize() const;
-	inline TUint HeaderFormat() const
-		{ return HdrFmtFromFlags(iFlags); }
-	inline TUint EntryPointFormat() const
-		{ return EptFromFlags(iFlags); }
-	inline TUint ImportFormat() const
-		{ return ImpFmtFromFlags(iFlags); }
-	inline TUint ABI() const
-		{ return ABIFromFlags(iFlags); }
-	inline void GetSecurityInfo(SSecurityInfo& aInfo) const;
-	inline TCpu CpuIdentifier() const;
-	inline TProcessPriority ProcessPriority() const;
-	inline TUint32 ExceptionDescriptor() const;
-	TInt IntegrityCheck(TInt aFileSize);
-	static TInt New(E32ImageHeader*& aHdr, RFile& aFile);
-public:
-	TUint32	iUid1;
-	TUint32	iUid2;
-	TUint32	iUid3;
-	TUint32 iUidChecksum;
-	TUint iSignature;			// 'EPOC'
-	TUint32	iHeaderCrc;			// CRC-32 of entire header
-	TUint32 iModuleVersion;		// Version number for this executable (used in link resolution)
-	TUint32 iCompressionType;	// Type of compression used (UID or 0 for none)
-	TVersion iToolsVersion;		// Version of PETRAN/ELFTRAN which generated this file
-	TUint32 iTimeLo;
-	TUint32 iTimeHi;
-	TUint iFlags;				// 0 = exe, 1 = dll, 2 = fixed address exe
-	TInt iCodeSize;				// size of code, import address table, constant data and export dir
-	TInt iDataSize;				// size of initialised data
-	TInt iHeapSizeMin;
-	TInt iHeapSizeMax;
-	TInt iStackSize;
-	TInt iBssSize;
-	TUint iEntryPoint;			// offset into code of entry point
-	TUint iCodeBase;			// where the code is linked for	
-	TUint iDataBase;			// where the data is linked for
-	TInt iDllRefTableCount;		// filling this in enables E32ROM to leave space for it
-	TUint iExportDirOffset;		// offset into the file of the export address table
-	TInt iExportDirCount;
-	TInt iTextSize;				// size of just the text section, also doubles as the offset for the iat w.r.t. the code section
-	TUint iCodeOffset;			// file offset to code section, also doubles as header size
-	TUint iDataOffset;			// file offset to data section
-	TUint iImportOffset;		// file offset to import section
-	TUint iCodeRelocOffset;		// relocations for code and const
-	TUint iDataRelocOffset;		// relocations for data
-	TUint16 iProcessPriority;	// executables priority
-	TUint16 iCpuIdentifier;		// 0x1000 = X86, 0x2000 = ARM
-	};
-
-class E32ImageHeaderComp : public E32ImageHeader
-	{
-public:
-	TUint32 iUncompressedSize;	// Uncompressed size of file
-								// For J format this is file size - sizeof(E32ImageHeader)
-								//  and this is included as part of the compressed data :-(
-								// For other formats this is file size - total header size
-	};
-
-class E32ImageHeaderV : public E32ImageHeaderComp
-	{
-public:
-	SSecurityInfo iS;
-
-	// Use iSpare1 as offset to Exception Descriptor
-	TUint32 iExceptionDescriptor;   // Offset in bytes from start of code section to Exception Descriptor, bit 0 set if valid
-	TUint32 iSpare2;
-	TUint16	iExportDescSize;	// size of bitmap section
-	TUint8	iExportDescType;	// type of description of holes in export table
-	TUint8	iExportDesc[1];		// description of holes in export table - extend
-	};
-
-// export description type
-const TUint	KImageHdr_ExpD_NoHoles			=0x00;	// no holes, all exports present
-const TUint	KImageHdr_ExpD_FullBitmap		=0x01;	// full bitmap present
-const TUint	KImageHdr_ExpD_SparseBitmap8	=0x02;	// sparse bitmap present, granularity 8
-const TUint	KImageHdr_ExpD_Xip				=0xff;	// XIP file
-
-
-inline TInt E32ImageHeader::TotalSize() const
-	{
-	if (HeaderFormat() == KImageHdrFmt_J && iCompressionType != 0)
-		return sizeof(E32ImageHeaderComp);
-	return iCodeOffset;
-	}
-
-inline TInt E32ImageHeader::UncompressedFileSize() const
-	{
-	TUint hdrfmt = HeaderFormat();
-	if (hdrfmt == KImageHdrFmt_Original || iCompressionType == 0)
-		return -1;			// not compressed
-	else if (hdrfmt == KImageHdrFmt_J)
-		return ((E32ImageHeaderComp*)this)->iUncompressedSize + sizeof(E32ImageHeader);
-	else
-		return ((E32ImageHeaderComp*)this)->iUncompressedSize + iCodeOffset;
-	}
-
-extern const SSecurityInfo KDefaultSecurityInfo;
-inline void E32ImageHeader::GetSecurityInfo(SSecurityInfo& aInfo) const
-	{
-	if (HeaderFormat() >= KImageHdrFmt_V)
-		aInfo = ((E32ImageHeaderV*)this)->iS;
-	else
-		aInfo = KDefaultSecurityInfo;
-	}
-
-inline TCpu E32ImageHeader::CpuIdentifier() const
-	{
-	if (HeaderFormat() >= KImageHdrFmt_V)
-		return (TCpu)iCpuIdentifier;
-	return (TCpu)iHeaderCrc;
-	}
-
-inline TProcessPriority E32ImageHeader::ProcessPriority() const
-	{
-	if (HeaderFormat() >= KImageHdrFmt_V)
-		return (TProcessPriority)iProcessPriority;
-	return *(const TProcessPriority*)&iProcessPriority;
-	}
-
-inline TUint32 E32ImageHeader::ExceptionDescriptor() const
-	{
-	if (HeaderFormat() >= KImageHdrFmt_V)
-		{
-		TUint32 xd = ((E32ImageHeaderV*)this)->iExceptionDescriptor;
-		if ((xd & 1) && (xd != 0xffffffffu))
-			return (xd & ~1);
-		}
-	return 0;
-	}
-
-class E32ImportBlock
-	{
-public:
-	inline const E32ImportBlock* NextBlock(TUint aImpFmt) const;
-	inline TInt Size(TUint aImpFmt) const;
-	inline const TUint* Imports() const;	// import list if present
-public:
-	TUint32	iOffsetOfDllName;	// offset of name of dll importing from
-	TInt	iNumberOfImports;	// no of imports from this dll
-//	TUint	iImport[iNumberOfImports];	// list of imported ordinals, omitted in PE2 import format
-	};
-
-inline TInt E32ImportBlock::Size(TUint aImpFmt) const
-	{
-	TInt r = sizeof(E32ImportBlock);
-	if (aImpFmt!=KImageImpFmt_PE2)
-		r += iNumberOfImports * sizeof(TUint);
-	return r;
-	}
-
-inline const E32ImportBlock* E32ImportBlock::NextBlock(TUint aImpFmt) const
-	{
-	const E32ImportBlock* next = this + 1;
-	if (aImpFmt!=KImageImpFmt_PE2)
-		next = (const E32ImportBlock*)( (TUint8*)next + iNumberOfImports * sizeof(TUint) );
-	return next;
-	}
-
-inline const TUint* E32ImportBlock::Imports() const
-	{
-	return (const TUint*)(this + 1);
-	}
-
-class E32ImportSection
-	{
-public:
-	TInt iSize;					// size of this section
-//	E32ImportBlock[iDllRefTableCount];
-	};
-
-class E32RelocSection
-	{
-public:
-	TInt iSize;					// size of this relocation section
-	TInt iNumberOfRelocs;		// number of relocations in this section
-	};
-
-
-typedef TUint8* (*TMemoryMoveFunction)(TAny* aTrg,const TAny* aSrc,TInt aLength);
-
-const TInt KDeflateLengthMag=8;
-const TInt KDeflateDistanceMag=12;
-const TInt KDeflateMinLength=3;
-const TInt KDeflateMaxLength=KDeflateMinLength-1 + (1<<KDeflateLengthMag);
-const TInt KDeflateMaxDistance=(1<<KDeflateDistanceMag);
-const TInt KDeflateDistCodeBase=0x200;
-const TUint KDeflateHashMultiplier=0xAC4B9B19u;
-const TInt KDeflateHashShift=24;
-const TInt KInflateWindowSize=0x8000;
-
-
-class TEncoding
-	{
-public:
-	enum {ELiterals=256,ELengths=(KDeflateLengthMag-1)*4,ESpecials=1,EDistances=(KDeflateDistanceMag-1)*4};
-	enum {ELitLens=ELiterals+ELengths+ESpecials};
-	enum {EEos=ELiterals+ELengths};
-public:
-	TUint32 iLitLen[ELitLens];
-	TUint32 iDistance[EDistances];
-	};
-
-const TInt KDeflationCodes=TEncoding::ELitLens+TEncoding::EDistances;
-
-NONSHARABLE_CLASS(CInflater) : public CBase
-	{
-public:
-	enum {EBufSize = 0x800, ESafetyZone=8};
-public:
-	static CInflater* NewLC(TBitInput& aInput);
-	~CInflater();
-	TInt ReadL(TUint8* aBuffer,TInt aLength, TMemoryMoveFunction aMemMovefn);
-	TInt SkipL(TInt aLength);
-private:
-	CInflater(TBitInput& aInput);
-	void ConstructL();
-	void InitL();
-	TInt InflateL();
-private:
-	TBitInput* iBits;
-	const TUint8* iRptr;			
-	TInt iLen;
-	const TUint8* iAvail;		
-	const TUint8* iLimit;
-	TEncoding* iEncoding;
-	TUint8* iOut;				
-	};
-
-void DeflateL(const TUint8* aBuf, TInt aLength, TBitOutput& aOutput);
-
-	
-NONSHARABLE_CLASS(TFileInput) : public TBitInput
-	{
- 	enum {KBufSize=KInflateWindowSize};
-public:
-	TFileInput(RFile& aFile);
-	void Cancel();
-private:
-	void UnderflowL();
-private:
-	RFile& iFile;
-	TRequestStatus iStat;
-	TUint8* iReadBuf;
-	TPtr8 iPtr;
-	TUint8 iBuf1[KBufSize];
-	TUint8 iBuf2[KBufSize];
-	};
-
-class TFileNameInfo
-	{
-public:
-	enum
-    	{
-    	EIncludeDrive=1,
-    	EIncludePath=2,
-    	EIncludeBase=4,
-    	EIncludeVer=8,
-    	EForceVer=16,
-    	EIncludeUid=32,
-    	EForceUid=64,
-    	EIncludeExt=128,
-    	EIncludeDrivePath=EIncludeDrive|EIncludePath,
-    	EIncludeBaseExt=EIncludeBase|EIncludeExt,
-    	EIncludeDrivePathBaseExt=EIncludeDrive|EIncludePath|EIncludeBase|EIncludeExt,
-    	};
-	enum
-		{
-		EAllowUid=1,
-		EAllowPlaceholder=2,
-		EAllowDecimalVersion=4,
-		};
-public:
-	TFileNameInfo();
-	TInt Set(const TDesC8& aFileName, TUint aFlags);
-	void Dump() const;
-public:
-	inline TInt DriveLen() const {return iPathPos;}
-	inline TInt PathLen() const {return iBasePos-iPathPos;}
-	inline TInt BaseLen() const {return iVerPos-iBasePos;}
-	inline TInt VerLen() const {return iUidPos-iVerPos;}
-	inline TInt UidLen() const {return iExtPos-iUidPos;}
-	inline TInt ExtLen() const {return iLen-iExtPos;}
-	inline TPtrC8 Drive() const {return TPtrC8(iName, iPathPos);}
-	inline TPtrC8 Path() const {return TPtrC8(iName+iPathPos, iBasePos-iPathPos);}
-	inline TPtrC8 DriveAndPath() const {return TPtrC8(iName, iBasePos);}
-	inline TPtrC8 Base() const {return TPtrC8(iName+iBasePos, iVerPos-iBasePos);}
-	inline TPtrC8 VerStr() const {return TPtrC8(iName+iVerPos, iUidPos-iVerPos);}
-	inline TPtrC8 UidStr() const {return TPtrC8(iName+iUidPos, iExtPos-iUidPos);}
-	inline TPtrC8 Ext() const {return TPtrC8(iName+iExtPos, iLen-iExtPos);}
-	inline TUint32 Version() const {return iVersion;}
-	inline TUint32 Uid() const {return iUid;}
-	void GetName(TDes8& aName, TUint aFlags) const;
-public:
-	const TText8* iName;
-	TInt iPathPos;
-	TInt iBasePos;
-	TInt iVerPos;
-	TInt iUidPos;
-	TInt iExtPos;
-	TInt iLen;
-	TUint32 iVersion;
-	TUint32 iUid;
-	};
-
-
-#endif // __LAUNCHERE32IMAGEHEADERS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/enginewrapper.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,170 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef ENGINEWRAPPER_H
+#define ENGINEWRAPPER_H
+
+#include <qstringlist.h>
+#include <qabstractitemmodel.h>
+#include <qlist.h>
+#include <coecntrl.h>
+
+#include "launcherengine.h"
+
+class HbProgressDialog;
+class HbDeviceProgressDialog;
+class HbAction;
+
+class LauncherMainWindow;
+
+
+class EngineWrapper : public QObject, public MLauncherUI
+{
+    Q_OBJECT
+    
+public:
+    
+    /**
+     * Constructor
+     */
+    EngineWrapper(LauncherMainWindow* mainWindow);
+    
+    /**
+     * Destructor
+     */
+    ~EngineWrapper();
+    
+    /**
+     * Initializes Engine Wrapper
+     * @return true if engine was started successfully
+     */
+    bool init();
+    
+public:
+    // functions that are called from UI
+    
+    /**
+     * Fetches list of applications from engine
+     */
+    bool listOfAllApps(QStringList &allAppsQStringList);
+    
+    /**
+     * Starts launching applications that are given as parameter
+     */
+    bool startAppLaunching(const QModelIndexList &list, bool autoClose);
+    
+    /**
+     * Sets engine to skip hidden applications when launching
+     */
+    void setSkipHiddenAndEmbedOnly(bool skip);
+    
+    /**
+     * Stops launching applications
+     */
+    bool stopLaunching();
+    
+    /**
+     * Sends log
+     */
+    bool sendLog();
+    
+    /**
+     * Deletes log
+     */
+    bool deleteLog();
+    
+    /**
+     * Compares dll
+     */
+    void compareDlls();
+    
+    /**
+     * Sends list of dlls
+     */
+    bool sendListOfDlls();
+    
+public:
+    // From MLauncherUIEngine
+    // functions that are called from Engine
+    
+    /**
+     * Shows error message with error text
+     */
+    virtual void ShowErrorMessage(const TDesC& aText);
+    
+    /**
+     * Shows information message with info text
+     */
+    virtual void ShowInfoMessage(const TDesC& aText);
+
+    /**
+     * Shows progress bar with text
+     */
+    virtual void ShowProgressBar(const TDesC& aText, TInt aMinimum = 0, TInt aMaximum = 0 );
+
+    /**
+     * Sets progress bar value
+     */
+    virtual void SetProgressBarValue(TInt aValue);
+
+    /**
+     * Hides progress bar
+     */
+    virtual void HideProgressBar();
+
+    /**
+     * Shows wait dialog with text
+     */
+    virtual void ShowWaitDialog(const TDesC& aText);
+
+    /**
+     * Hides wait dialog
+     */
+    virtual void HideWaitDialog();
+
+    /**
+     * Changes focus to output view
+     */
+    virtual void ChangeFocusToOutputView();
+    
+    /**
+     * Prints text to output views log
+     */
+    virtual void PrintText(const TDesC& aText);
+    
+public slots:
+    void doCompareDlls(HbAction*);
+    void CancelDllBCanalysis();
+    
+private:
+    
+    /**
+     * Allocate CArrayFix and copy QList to it
+     */
+    CArrayFix<TInt>* QModelIndexListToCArrayFixL(const QModelIndexList& qlist);
+    
+private:
+    CLauncherEngine *mEngine;
+    LauncherMainWindow *mMainWindow;
+    HbProgressDialog* mProgressDialog;
+    HbDeviceProgressDialog* mWaitDialog;
+};
+
+
+
+
+#endif //ENGINEWRAPPER_H
--- a/launcher/inc/launcher.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHER_HRH__
-#define __LAUNCHER_HRH__
-
-#include "../symbian_version.hrh"
-
-enum TLauncherCommandIds
-    {
-    ECmdLaunchApps = 1,
-	ECmdLaunchAppsWithAutoClose,
-	ECmdLaunchAppsWithoutAutoClose,
-	ECmdDLLInfo,
-	ECmdSetDLLFilename,
-	ECmdCompareDLLs,
-	ECmdRefreshList,
-	ECmdClearWindow,
-	ECmdStopLaunch,
-	ECmdLaunchOptions,
-	ECmdSkipHiddenAndEmbedOnly,
-	ECmdDoNotSkipAnyFiles,
-	ECmdDeleteLog,
-	ECmdAbout
-	#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-	,
-	ECmdSendUISystemDllFile,
-	ECmdSendUILogFile
-	#endif
-    };
-
-enum TLauncherTabViewId
-    {
-    ELauncherView1Tab = 1,
-    ELauncherView2Tab
-    };
-
-enum TLauncherId
-    {
-    EWaitNote = 1,
-    EProgressNote,
-    EYesNoQuery
-    };
-
-#endif // __LAUNCHER_HRH__
--- a/launcher/inc/launcher.pan	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHER_PAN__
-#define __LAUNCHER_PAN__
-
-
-/** Launcher application panic codes */
-enum TLauncherPanics 
-    {
-    ELauncherBasicUi = 1
-    // add further panics here
-    };
-
-#endif // __LAUNCHER_PAN__
--- a/launcher/inc/launcherapplication.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHER_APPLICATION_H__
-#define __LAUNCHER_APPLICATION_H__
-
-#include <aknapp.h>
-
-
-/*! 
-  @class CLauncherApplication
-  
-  @discussion An instance of CLauncherApplication is the application part of the AVKON
-  application framework for the Launcher example application
-  */
-class CLauncherApplication : public CAknApplication
-    {
-public:  // from CApaApplication
-
-/*! 
-  @function AppDllUid
-  
-  @discussion Returns the application DLL UID value
-  @result the UID of this Application/Dll
-  */
-    TUid AppDllUid() const;
-
-protected: // from CEikApplication
-/*! 
-  @function CreateDocumentL
-  
-  @discussion Create a CApaDocument object and return a pointer to it
-  @result a pointer to the created document
-  */
-    CApaDocument* CreateDocumentL();
-    };
-
-#endif // __LAUNCHER_APPLICATION_H__
--- a/launcher/inc/launcherappui.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LAUNCHERAPPUI_H
-#define LAUNCHERAPPUI_H
-
-// INCLUDES
-#include <eikapp.h>
-#include <eikdoc.h>
-#include <e32std.h>
-#include <coeccntx.h>
-#include <aknviewappui.h>
-#include <akntabgrp.h>
-#include <aknnavide.h>
-#include "../symbian_version.hrh"
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-#include <SendUi.h>
-#endif 
-#include "LauncherEngine.h"
-
-// FORWARD DECLARATIONS
-class CLauncherContainerApps;
-class CLauncherEngine;
-
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-
-// CLASS DECLARATION
-
-/**
-* Application UI class.
-* Provides support for the following features:
-* - EIKON control architecture
-* - view architecture
-* - status pane
-* 
-*/
-class CLauncherAppUi : public CAknViewAppUi
-    {
-    public: // // Constructors and destructor
-
-        /**
-        * EPOC default constructor.
-        */      
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */      
-        ~CLauncherAppUi();
-        
-    public: // New functions
-
-    public: // Functions from base classes
-
-    private:
-        // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-    private:
-        /**
-        * From CEikAppUi, takes care of command handling.
-        * @param aCommand command to be handled
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From CEikAppUi, handles key events.
-        * @param aKeyEvent Event to handled.
-        * @param aType Type of the key event. 
-        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
-        */
-        virtual TKeyResponse HandleKeyEventL(
-            const TKeyEvent& aKeyEvent,TEventCode aType);
-
-    private: //Data
-        CAknNavigationControlContainer* iNaviPane;
-        CAknTabGroup*                   iTabGroup;
-        CAknNavigationDecorator*        iDecoratedTabGroup;
-        CLauncherEngine*                iEngine;
-
-        #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-        #ifdef RD_SUPPORT_SENDUI_API_V2
-          CSendUi*                        iSendUi;
-        #else
-          CSendAppUi*                     iSendAppUi;
-        #endif
-        #endif
-
-    public:
-        CAknTabGroup* TabGroup() { return iTabGroup; }     
-    
-    };
-
-#endif
-
-// End of File
--- a/launcher/inc/launchercontainerapps.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LAUNCHERCONTAINERAPPS_H
-#define LAUNCHERCONTAINERAPPS_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <eiklbo.h> 
-   
-// FORWARD DECLARATIONS
-class CLauncherEngine;
-
-// CLASS DECLARATION
-
-/**
-*  CLauncherContainerApps  container control class.
-*  
-*/
-class CLauncherContainerApps : public CCoeControl, MCoeControlObserver, MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * EPOC default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, CLauncherEngine* aEngine);
-
-        /**
-        * Destructor.
-        */
-        ~CLauncherContainerApps();
-
-    public: // New functions
-
-    public: // Functions from base classes
-
-    public: // From MEikListBoxObserver
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-    
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl.
-        */
-        void SizeChanged();  
-    
-        /**
-        * From CoeControl.
-        */
-        TInt CountComponentControls() const;
-    
-        /**
-        * From CCoeControl.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-    
-        /**
-        * Event handling section, e.g Listbox events.
-        */
-        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
-
-        /**
-        * From CCoeControl,Draw.
-        */
-        void Draw(const TRect& aRect) const;
-    
-        /**
-        * Key event handler. Handles up and down arrow keys, so that
-        * output window can be scrolled.
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
-
-    public:
-        void HandleResourceChange(TInt aType);
-
-    public:    
-        const CArrayFix<TInt>* SelectedApps();
-        void UpdateFileListL();
-        void MarkCurrentItemL();
-        void UnmarkCurrentItem();
-        TInt NumberOfSelectedItems() const;
-        void MarkAllItemsL();
-        void UnmarkAllItems();
-        
-        CEikListBox* ListBox() { return iListBox; }
-        CLauncherEngine* Engine() { return iEngine; }
-
-
-            
-    private: //data
-        CDesCArray* iSelectedItems;
-        CAknSingleStyleListBox* iListBox;
-
-        CLauncherEngine* iEngine;
-    
-    };
-
-#endif
-
-// End of File
--- a/launcher/inc/launchercontaineroutput.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LAUNCHERCONTAINEROUTPUT_H
-#define LAUNCHERCONTAINEROUTPUT_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiksbobs.h>
-
-class CEikRichTextEditor;
-class CEikScrollBarFrame;
-class CLauncherEngine; 
-
-
-// FORWARD DECLARATIONS
-
-
-// CLASS DECLARATION
-
-/**
-*  CLauncherContainerOutput  container control class.
-*  
-*/
-class CLauncherContainerOutput : public CCoeControl, MCoeControlObserver, MEikScrollBarObserver
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * EPOC default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, CLauncherEngine* aEngine);
-
-        /**
-        * Destructor.
-        */
-        ~CLauncherContainerOutput();
-
-    public: // New functions
-
-        void PrintTextL(const TDesC& aDes);
-        void ClearOutputWindowL();
-
-
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        void Draw(const TRect& aRect) const;
-        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
-        void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); // From MEikScrollBarObserver
-
-    public:
-        void HandleResourceChange(TInt aType);
-
-	private:
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
-    
-    private:
-        /**
-         * Updates the containers content in screen.
-         * @param aScrollToBottom If true, screen is scrolled to bottom.
-         * @param aScrollToTop If true, screen is scrolled to top. Ignored if
-         * aScrollToBottom is set true.
-         */
-        void UpdateVisualContentL(TBool aScrollToBottom, TBool aScrollToTop = EFalse);
-
-    private: //data
-        CEikScrollBarFrame*     iScrollBarFrame;
-        HBufC*                  iText;
-        const CFont*            iFont;
-        HBufC*                  iWrapperString;
-        CArrayFix<TPtrC>*       iWrappedArray;
-        TInt                    iCurrentLine;
-        TInt                    iLineCount;
-        TInt                    iNumberOfLinesFitsScreen;
-        TInt                    iLeftDrawingPosition;
-        TReal                   iX_factor;
-        TReal                   iY_factor;
-
-        CLauncherEngine* iEngine;
-
-    };
-
-#endif
-
-// End of File
--- a/launcher/inc/launcherdllelement.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef LAUNCHERDLLELEMENT_H_
-#define LAUNCHERDLLELEMENT_H_
-
-#include <e32base.h>
-
-typedef TBuf8<8> TDllIdValue;
-
-class CLauncherDLLElement : public CBase
-    {
-public:
-    
-    enum TDifference
-        {
-        EDifference_UID1,      // UID1 is different
-        EDifference_UID2,      // UID1 is different
-        EDifference_UID3,      // UID1 is different
-        EDifference_SID,       // SID is different
-        EDifference_Capability // Capabilities are different
-        };
-    
-    virtual ~CLauncherDLLElement();
-    static CLauncherDLLElement* NewL();
-    static CLauncherDLLElement* NewLC(); 
-    
-    /*
-     * Compares DLL elements.
-     * @return ETrue if differencies exist, EFalse otherwise.     
-     * @param aReferenceElement Reference DLL-element for comparison
-     * @param aDifferenceList Differencies are added to this list.
-     */
-    TBool CompareL(const CLauncherDLLElement& aReferenceElement, RArray<TDifference>& aDifferenceList) const;
-    
-    /*
-     * Returns DLL name
-     * @return DLL name
-     */
-    TFileName Name() const;    
-    /*
-     * Sets DLL name
-     * @param aName DLL name
-     */
-    void SetNameL(const TFileName& aName);
-    
-    /*
-     * Returns DLL UID1
-     * @return UID1 object
-     */
-    TUid UID1() const;
-    
-    /*
-     * Sets DLL UID1 
-     * @param aUID1 UID1 object
-     */
-    void SetUID1L(TUid aUID1);
-    
-    /*
-     * Returns DLL UID2
-     * @return UID2 object
-     */
-    TUid UID2() const;
-        
-    /*
-     * Sets DLL UID2 
-     * @param aUID2 UID2 object
-     */
-    void SetUID2L(TUid aUID2);
-        
-    /*
-     * Returns DLL UID3
-     * @return UID3 object
-     */
-    TUid UID3() const;
-    
-    /*
-     * Sets DLL UID3
-     * @param aUID3 UID3 object
-     */
-    void SetUID3L(TUid aUID3);
-    
-    /*
-     * Returns DLL SID
-     * @return SID object
-     */
-    TUid SID() const;
-    
-    /*
-     * Sets DLL SID
-     * @param aSID SID object
-     */
-    void SetSIDL(TUid aSID);
-    
-    /*
-     * Returns DLL capability
-     * @return capability value
-     */    
-    TUint32 Capability() const;
-    
-    /*
-     * Sets DLL capability
-     * @param aCapability capability value
-     */
-    void SetCapabilityL(TUint32 aCapability);
-    
-protected:
-    CLauncherDLLElement();
-    virtual void ConstructL();
-    
-private:
-    TFileName   iName;
-    TUid iUID1;
-    TUid iUID2;
-    TUid iUID3;
-    TUid iSID;
-    TUint32 iCapability;
-    };
-
-#endif /* LAUNCHERDLLELEMENT_H_ */
--- a/launcher/inc/launcherdllparser.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef LAUNCHERDLLPARSER_H_
-#define LAUNCHERDLLPARSER_H_
-
-#include <e32base.h>
-#include <f32file.h>
-#include "launcherdllelement.h"
-
-#define UID1_OFFSET 0x00
-#define UID2_OFFSET 0x04
-#define UID3_OFFSET 0x08
-#define SID_OFFSET_ROM 0x44
-#define SID_OFFSET_ROFS 0x80
-#define CAPABILITY_OFFSET_ROM 0x4c
-#define CAPABILITY_OFFSET_ROFS 0x88
-
-class CLauncherDLLParser : public CBase
-    {
-public:
-
-    virtual ~CLauncherDLLParser();
-    static CLauncherDLLParser* NewL();
-    static CLauncherDLLParser* NewLC();
-    
-    /**
-     * Reads data from the given DLL-file and sets parsed data to given object.
-     * @param aFileSession Reference to an open file session     
-     * @param aFile Reference to the DLL file object
-     * @param aElement Reference to the element, which will contain the parsed data
-     */
-    void ParseL( RFs& aFileSession, RFile& aFile, CLauncherDLLElement& aElement );
-    
-private:
-
-    CLauncherDLLParser();
-    void ConstructL();
-    
-    /**
-     * Reads 32-bit unsigned integer from the given file.
-     * @return 32-bit unsigned integer value.
-     * @param aFile File handle.
-     */
-    TUint32 ReadUint32L( RFile& aFile );
-    };
-
-#endif /* LAUNCHERDLLPARSER_H_ */
--- a/launcher/inc/launcherdocument.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHER_DOCUMENT_H__
-#define __LAUNCHER_DOCUMENT_H__
-
-
-#include <akndoc.h>
-
-// Forward references
-class CLauncherAppUi;
-class CEikApplication;
-
-
-/*! 
-  @class CLauncherDocument
-  
-  @discussion An instance of class CLauncherDocument is the Document part of the AVKON
-  application framework for the Launcher example application
-  */
-class CLauncherDocument : public CAknDocument
-    {
-public:
-
-/*!
-  @function NewL
-  
-  @discussion Construct a CLauncherDocument for the AVKON application aApp 
-  using two phase construction, and return a pointer to the created object
-  @param aApp application creating this document
-  @result a pointer to the created instance of CLauncherDocument
-  */
-    static CLauncherDocument* NewL(CEikApplication& aApp);
-
-/*!
-  @function NewLC
-  
-  @discussion Construct a CLauncherDocument for the AVKON application aApp 
-  using two phase construction, and return a pointer to the created object
-  @param aApp application creating this document
-  @result a pointer to the created instance of CLauncherDocument
-  */
-    static CLauncherDocument* NewLC(CEikApplication& aApp);
-
-/*!
-  @function ~CLauncherDocument
-  
-  @discussion Destroy the object and release all memory objects
-  */
-    ~CLauncherDocument();
-
-/*!
-  @function CreateAppUiL 
-  
-  @discussion Create a CLauncherAppUi object and return a pointer to it
-  @result a pointer to the created instance of the AppUi created
-  */
-    CEikAppUi* CreateAppUiL();
-private:
-
-/*!
-  @function ConstructL
-  
-  @discussion Perform the second phase construction of a CLauncherDocument object
-  */
-    void ConstructL();
-
-/*!
-  @function CLauncherDocument
-  
-  @discussion Perform the first phase of two phase construction 
-  @param aApp application creating this document
-  */
-    CLauncherDocument(CEikApplication& aApp);
-
-    };
-
-
-#endif // __LAUNCHER_DOCUMENT_H__
--- a/launcher/inc/launcherengine.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef __LAUNCHER_ENGINE_H__
-#define __LAUNCHER_ENGINE_H__
-
-#include "Launcher.hrh"
-#include "launcherparserobserver.h"
-
-#include <aknappui.h>
-#include <e32base.h>
-#include <apgcli.h>
-#include "../symbian_version.hrh"
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-#include <SendUi.h>
-#endif 
-#include <aknprogressdialog.h>
-#include <maknfileselectionobserver.h>
-
-class CLauncherAppUi;
-class CLauncherContainerApps;
-class CLauncherContainerOutput;
-
-class CLauncherXMLParser;
-class CLauncherDLLParser;
-
-class CAppThreadChecker;
-class CAppRunningChecker;
-
-class CAknGlobalNote;
-
-
-class CLauncherEngine : public CActive, public MLauncherParserObserver, public MProgressDialogCallback
-	{
-public:
-	static CLauncherEngine* NewL(CLauncherAppUi* aAppUi);
-	~CLauncherEngine();
-
-public:
-    void SetContainerApps(CLauncherContainerApps* aContainerApps);
-    void SetContainerOutput(CLauncherContainerOutput* aContainerOutput);
-
-    CDesCArray* ListOfAllAppsL();
-    void StartAppLaunchingL(const CArrayFix<TInt>* aSelectedApps, TBool aAutoClose);
-    void CheckWhyThreadDiedL();
-    void CheckIfAppIsRunningL();
-    TInt DeleteLogFile();
-    TInt DeleteBCLogFile();
-    TBool LogFileExists();
-    TBool BCLogFileExists();
-    void AnalyseDLLsL();
-    void StopLaunchingL();
-	#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-    void SendLogViaSendUiL(CSendUi* aSendUi);
-    void SendListOfSystemDllsViaSendUiL(CSendUi* aSendUi);
-	#endif 
-    TBool SelectRequiredDLLsFileL();
-        
-    // From MLauncherParserObserver
-    void ElementParsedL(const CLauncherDLLElement& aDllElement);
-    void DocumentParsedL(TInt aErrorCode);
-    void ParsingProgressedL(TInt aBytes);
-    
-    // From MProgressDialogCallback
-    void DialogDismissedL( TInt aButtonId );    
-    
-private:
-	CLauncherEngine();
-	void ConstructL(CLauncherAppUi* aAppUi);
-
-	void RunL();
-	void DoCancel();
-
-	void IssueLaunch();
-	void LaunchApplicationL();
-	void DoLaunchApplicationL();
-		
-    void CheckForMoreAppsL();
-    void WriteInitialStuffToTheLogL(const TDesC& aOwnData, RFile& aFile);
-    TInt FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath);
-    TInt FindFiles(const TDesC& aFileName, const TDesC& aPath);
-    TInt ReadLineFromFileL(RFile& aFile, TDes& aReadBuf);
-    void ChangeFocusToOutputView();
-    
-    /**
-     * Performs binary compatibility analysis based on reference data given
-     * in XML-file.
-     */
-    void DoBCAnalysisL();
-    
-    /**
-     * Compares given DLL list to system DLLs
-     */
-    void DoCompareDLLListsL();
-    
-    /**
-     * IsCurrentThreadOpen
-     */
-    TBool IsCurrentThreadOpen() const;
-        
-    CDesCArray* DependencyCheckForE32ImageL();
-    
-private:
-	RTimer          iTimer;
-	CEikonEnv*      iEnv;
-	RApaLsSession   iLs;
-    RWsSession      iWs;
-    HBufC8*         iLogWriteBuf;    
-    RFile           iLogFile;
-    RFile           iBCLogFile;  
-    TFileName       iLogFilePath;
-    TFileName       iBCLogFilePath;
-    TFileName       iSystemDllsFilePath;
-    TFileName       iRequiredDllsFilePath;        
-    
-    CDesCArray*     iAppsArray;
-    CDesCArray*     iAllAppsArray;
-    CDesCArray*     iSystemDllArray;
-    CDesCArray*     iRequiredDllArray;
-
-    TBool           iLaunchingIsActive;
-    TBool           iDLLAnalysisIsActive;
-    TBool           iSkipHiddenAndEmbedOnly;
-    TBool           iAutoClose;
-    TInt            iAppLaunchCounter;
-    TInt            iFailedCases;
-    TInt            iOkCases;
-    TInt            iSkippedCases;
-    TInt            iTotalNumberOfCases;
-
-    TUid            iCurrentAppUid;
-    TThreadId       iCurrentAppThreadId;
-    TBuf<128>       iCurrentAppNameAndExt;
-    RThread         iCurrentAppThread;
-
-    CAppThreadChecker*          iAppThreadChecker;
-    CAppRunningChecker*         iAppRunningChecker;
-
-    CLauncherAppUi*             iAppUi;
-    CLauncherContainerApps*     iContainerApps;
-    CLauncherContainerOutput*   iContainerOutput;
-    
-    CLauncherXMLParser*     iXMLParser;
-    CLauncherDLLParser*     iDLLParser;
-    CLauncherDLLElement*    iDLLElement;
-    
-    CEikProgressInfo*       iProgressInfo;
-    CAknProgressDialog*     iWaitDialog;
-    TInt                    iWaitDialogId;    
-    TInt                iFoundBCIssues;
-    HBufC*              iBCIssuesBigBuffer;
-
-public:
-    inline TBool LaunchingIsActive()                   { return iLaunchingIsActive; };
-    inline TBool SkipHiddenAndEmbedOnly()              { return iSkipHiddenAndEmbedOnly; };
-    inline void SetSkipHiddenAndEmbedOnly(TBool aSkip) { iSkipHiddenAndEmbedOnly = aSkip; };
-    inline CAppThreadChecker*  AppThreadChecker()      { return iAppThreadChecker; };
-    inline CAppRunningChecker* AppRunningChecker()     { return iAppRunningChecker; };
-	};
-
-
-class CAppRunningChecker : public CActive
-	{
-public:
-	static CAppRunningChecker* NewL(CLauncherEngine* aLauncherEngine);
-	~CAppRunningChecker();
-
-	void StartTesting();
-
-private:
-	CAppRunningChecker();
-	void ConstructL(CLauncherEngine* aLauncherEngine);
-
-	void RunL();
-	void DoCancel();
-
-private:
-	RTimer iTimer;
-	CEikonEnv* iEnv;
-    CLauncherEngine* iLauncherEngine;
-	};
-
-
-class CAppThreadChecker : public CActive
-	{
-public:
-	static CAppThreadChecker* NewL(CLauncherEngine* aLauncherEngine);
-	~CAppThreadChecker();
-
-	void ActivateChecking();
-
-private:
-	CAppThreadChecker();
-	void ConstructL(CLauncherEngine* aLauncherEngine);
-
-	void RunL();
-	void DoCancel();
-
-private:
-	CEikonEnv* iEnv;
-    CLauncherEngine* iLauncherEngine;
-	};
-
-#endif // __LAUNCHER_ENGINE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launchermainwindow.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef LauncherMainWindow_H_
+#define LauncherMainWindow_H_
+
+#include <hbmainwindow.h>
+#include <hbview.h>
+
+class HbApplication;
+class ApplicationView;
+class OutputView;
+class EngineWrapper;
+class CommonActions;
+
+class LauncherMainWindow : public HbMainWindow
+    {
+public:
+    
+    LauncherMainWindow ( QWidget *parent = 0 );
+    virtual ~LauncherMainWindow ();
+    
+    int init( HbApplication &app );
+    
+    void openApplicationView();
+    void openOutputView();
+    /**
+     * Prints text into output
+     */
+    void printText(const QString &text);
+    
+private: //data
+    EngineWrapper* mEngineWrapper;
+    ApplicationView* mApplicationView;
+    OutputView* mOutputView;
+    CommonActions* mCommonActions;
+    };
+
+#endif /* LauncherMainWindow_H_ */
--- a/launcher/inc/launcherparserobserver.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef LAUNCHERPARSEROBSERVER_H_
-#define LAUNCHERPARSEROBSERVER_H_
-
-class CLauncherDLLElement;
-
-class MLauncherParserObserver
-{
-public:
-    
-    /**
-     * This method is called when parser has parsed next DLL element     
-     * @param aDllElement Parsed DLL element.     
-     */    
-    virtual void ElementParsedL(const CLauncherDLLElement& aDllElement) = 0;
-    
-    /**
-     * This method is called when the parsing is completed. If parsing was
-     * stopped due to an error, an error code is given in parameter.
-     * @param aErrorCode KErrNone if document was parsed successfully.
-     */
-    virtual void DocumentParsedL(TInt aErrorCode) = 0;
-    
-    /**
-     * Parser calls this function during parsing to indicate the amount of
-     * bytes parsed from the given file.
-     * @param aBytes Amount of data (in bytes) parsed. Amount is incremental.
-     */
-    virtual void ParsingProgressedL(TInt aBytes) = 0;
-    
-};
-
-#endif /* LAUNCHERPARSEROBSERVER_H_ */
--- a/launcher/inc/launchertraces.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#ifndef __LAUNCHER_TRACES_H__
-#define __LAUNCHER_TRACES_H__
-
-#include <e32def.h>
-
-
-// ---------------------------------------------------------------------------
-// You change these logging method values below! Recompile the application to take changes effect.
-
-    // logging methods
-    // 0 = No logging
-    // 1 = Flogger
-    // 2 = RDebug
-    // 3 = Flogger and RDebug
-    
-    #ifndef _DEBUG
-        
-        // Logging method for UREL builds:
-        #define LAUNCHER_LOGGING_METHOD  3
-
-    #else
-
-        // Logging method for UDEB builds:
-        #define LAUNCHER_LOGGING_METHOD  3
-
-    #endif    
-    
-
-
-// ---------------------------------------------------------------------------
-// Do not make any changes to lines below...
-
-    #if LAUNCHER_LOGGING_METHOD == 1 || LAUNCHER_LOGGING_METHOD == 3
-
-        #include <flogger.h>
-        _LIT(KLogFolder,"Launcher");
-        _LIT(KLogFile,"Launcher_Trace.txt");
-
-    #endif
-
-    #if LAUNCHER_LOGGING_METHOD == 2 || LAUNCHER_LOGGING_METHOD == 3
-
-        #include <e32debug.h>
-
-    #endif
-
-
-    #if LAUNCHER_LOGGING_METHOD == 0
-    
-        #define LOGTEXT(AAA)
-        #define LOGSTRING(AAA)
-        #define LOGSTRING2(AAA,BBB)
-        #define LOGSTRING3(AAA,BBB,CCC)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD)
-    
-    
-    #elif LAUNCHER_LOGGING_METHOD == 1
-    
-        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-   
-    #elif LAUNCHER_LOGGING_METHOD == 2
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
-    
-    #elif LAUNCHER_LOGGING_METHOD == 3
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-
-    #endif
-
-// ---------------------------------------------------------------------------
-
-#endif // __LAUNCHER_TRACES_H__
-
--- a/launcher/inc/launcherviewapps.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LAUNCHERVIEWAPPS_H
-#define LAUNCHERVIEWAPPS_H
-
-// INCLUDES
-#include <aknview.h>
-
-#include "LauncherEngine.h"
-
-// CONSTANTS
-// UID of view
-const TUid KViewId = {1};
-
-// FORWARD DECLARATIONS
-class CLauncherContainerApps;
-
-// CLASS DECLARATION
-
-/**
-*  CLauncherViewApps view class.
-* 
-*/
-class CLauncherViewApps : public CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * EPOC default constructor.
-        */
-        void ConstructL(CLauncherEngine* aEngine);
-
-        /**
-        * Destructor.
-        */
-        ~CLauncherViewApps();
-
-    public: // Functions from base classes
-        
-        /**
-        * From ?base_class ?member_description
-        */
-        TUid Id() const;
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleClientRectChange();
-
-    private:
-
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CLauncherContainerApps* iContainer;
-    };
-
-#endif
-
-// End of File
--- a/launcher/inc/launcherviewoutput.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LAUNCHERVIEWOUTPUT_H
-#define LAUNCHERVIEWOUTPUT_H
-
-// INCLUDES
-#include <aknview.h>
-
-#include "LauncherEngine.h"
-
-// CONSTANTS
-// UID of view
-const TUid KView2Id = {2};
-
-// FORWARD DECLARATIONS
-class CLauncherContainerOutput;
-
-// CLASS DECLARATION
-
-/**
-*  CLauncherViewOutput view class.
-* 
-*/
-class CLauncherViewOutput : public CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * EPOC default constructor.
-        */
-        void ConstructL(CLauncherEngine* aEngine);
-
-        /**
-        * Destructor.
-        */
-        ~CLauncherViewOutput();
-
-    public: // Functions from base classes
-        
-        /**
-        * From ?base_class ?member_description
-        */
-        TUid Id() const;
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From ?base_class ?member_description
-        */
-        void HandleClientRectChange();
-
-    private:
-
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * From AknView, ?member_description
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CLauncherContainerOutput* iContainer;
-    };
-
-#endif
-
-// End of File
--- a/launcher/inc/launcherxmlparser.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef LAUNCHERXMLPARSER_H_
-#define LAUNCHERXMLPARSER_H_
-
-#include <e32base.h>
-#include <xml/contenthandler.h>
-#include <xml/parser.h>
-#include "launcherdllelement.h"
-#include "launcherparserobserver.h"
-
-using namespace Xml;
-
-const TUint KXMLBufferSize = 1024;
-
-class CLauncherDLLElement;
-
-/**
- * Parses DLL data from the given XML-file
- */
-class CLauncherXMLParser : public CActive, public MContentHandler
-{
-public:
-
-    virtual ~CLauncherXMLParser();
-    static CLauncherXMLParser* NewL(RFs& aFs);
-    static CLauncherXMLParser* NewLC(RFs& aFs);
-    
-    /**
-     * Parses the given XML-file and notifies the observer.
-     * @param aFilePath XML-file's path
-     * @param aObserver Pointer to the observer instance.
-     */
-    void ParseL(const TDesC& aFilePath, MLauncherParserObserver* aObserver);
-        
-protected:
-    
-    // from CActive    
-    void DoCancel();    
-    void RunL();
-    
-private:
-
-    CLauncherXMLParser(RFs& aFs);
-    void ConstructL();
-    
-    /**
-     * Tells whether the current XML element is a sub-element of the 'dll'-element.
-     * @return ETrue if the current XML-element is sub-element of the 'dll'-element.
-     */
-    TBool IsDataElement();
-
-    /**
-     * Deletes current data buffer and zeroes the pointer.
-     */
-    void ClearXMLDataBuffer();
-    
-    /**
-     * Converts 8-bit descriptor to 32-bit unsigned integer
-     * @return Converted 32-bit unsigned integer value.
-     * @param aStr 8-bit descriptor to be converted.
-     */
-    TUint32 ConvertDes8ToUint32L(const TDesC8& aStr);
-                
-public:
-    // From MContentHandler:    
-    void OnStartDocumentL(const RDocumentParameters &aDocParam, TInt aErrorCode);
-    void OnEndDocumentL(TInt aErrorCode);
-    void OnStartElementL(   const RTagInfo& aElement, 
-                            const RAttributeArray& aAttributes, 
-                            TInt aErrorCode);
-    void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
-    void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnStartPrefixMappingL( const RString& aPrefix, 
-                                const RString& aUri, 
-                                TInt aErrorCode);
-    void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
-    void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
-    void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
-    void OnProcessingInstructionL(  const TDesC8& aTarget, 
-                                    const TDesC8& aData, 
-                                    TInt aErrorCode);
-    void OnError(TInt aErrorCode);
-    TAny* GetExtendedInterface(const TInt32 aUid);    
-    
-private:
-    CParser* iParser;  // XML parser
-    RFs& iFileSession;
-    RFile iFile; // XML file 
-    TBuf8<KXMLBufferSize> iXMLDataBuffer;
-    MLauncherParserObserver* iObserver;
-    CLauncherDLLElement* iCurrentDllElement;
-    TBuf8<KMaxFileName> iCurrentContent;
-    TBuf8<KMaxName> iCurrentElementName;
-    TBool iIgnoreError;
-    TInt  iParsedBytes;
-};
-
-#endif /* LAUNCHERXMLPARSER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/notifications.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef NOTIFICATIONS_H_
+#define NOTIFICATIONS_H_
+
+#include <hbmessagebox.h>
+#include <hbdeviceprogressdialog.h>
+
+
+class Notifications
+    {
+public:
+
+    /**
+     * shows message box of the specified type with text and label
+     */
+    static void showMessageBox(
+        HbMessageBox::MessageBoxType type, 
+        const QString &text, 
+        const QString &label, 
+        int timeout = HbPopup::NoTimeout
+        );
+    
+    /**
+     * shows about box
+     */
+    static void about();
+
+    /**
+     * shows information type message box
+     */
+    static void showInformationNote(const QString &text);
+
+    /**
+     * shows warning type message box
+     */
+    static void showErrorNote(const QString &text);
+    
+     /**
+     * shows progressbar
+     */
+    static HbDeviceProgressDialog* showWaitDialog(const QString &text);
+
+    
+    };
+
+
+
+#endif // NOTIFICATIONS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/outputview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef OUTPUTVIEW_H
+#define OUTPUTVIEW_H
+
+#include <hbview.h>
+
+class HbDocumentLoader;
+class HbAction;
+class HbTextEdit;
+class CommonActions;
+
+class OutputView : public HbView
+{
+    Q_OBJECT
+    
+public:
+    /**
+     * Constructor
+     */
+    OutputView();
+    
+    /**
+     * Destructor
+     */
+    ~OutputView();
+    
+    /**
+     * Creates output view and adds it into main window
+     */
+    static OutputView* create(HbDocumentLoader &loader, CommonActions *commonActions);
+    
+    /**
+     * Prints text into output
+     */
+    void printText(const QString &text);
+    
+private slots:
+
+    /**
+     * Clears output
+     */
+    void clearOutput();
+    
+    /**
+     * Opens application view
+     */
+    void openApplicationView();
+    
+private:
+    
+    /**
+     * Initializes view
+     */
+    void init(HbDocumentLoader &loader, CommonActions *commonActions);
+    
+    /**
+     * Loads all output view's ui components from xml-file
+     */
+    void loadItemsFromXml(HbDocumentLoader &loader);
+    
+    /**
+     * connects signals and slots to each other
+     */
+    void connectSignalsAndSlots();
+    
+
+private:
+    
+    // Actions
+    HbAction *mActionClear;
+    HbAction *mActionOpenApplicationView;  
+
+    HbTextEdit *mTextOutput;
+    
+};
+
+#endif // OUTPUTVIEW
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/launcher.pro	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE = app
+TARGET = Launcher
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
+DEPENDPATH += src
+DEPENDPATH += inc
+INCLUDEPATH += inc
+
+HEADERS += launchermainwindow.h applicationview.h enginewrapper.h notifications.h  outputview.h commonactions.h
+SOURCES += main.cpp launchermainwindow.cpp applicationview.cpp enginewrapper.cpp notifications.cpp  outputview.cpp commonactions.cpp
+RESOURCES += launcher.qrc
+
+symbian: {
+
+        BLD_INF_RULES.prj_exports += "./rom/Launcher.iby                CORE_IBY_EXPORT_PATH(tools,Launcher.iby)"
+        BLD_INF_RULES.prj_exports += "./rom/backup_registration.xml     Z:/private/101fb74f/backup_registration.xml"
+
+        launcher_stub_sis_mk = \
+        "$${LITERAL_HASH}if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)" \
+        "   $${LITERAL_HASH}ifdef MARM" \
+        "       gnumakefile .sis/launcher_stub_sis.mk" \
+        "   $${LITERAL_HASH}endif" \
+        "$${LITERAL_HASH}endif"
+        BLD_INF_RULES.prj_mmpfiles += launcher_stub_sis_mk
+        
+        launcher_buildstubsis_extension = \
+        "$${LITERAL_HASH}if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)" \
+        "   $${LITERAL_HASH}ifdef MARM" \
+        "       START EXTENSION app-services/buildstubsis" \
+        "       OPTION SRCDIR sis" \
+        "       OPTION SISNAME Launcher_stub" \
+        "       END" \
+        "   $${LITERAL_HASH}endif" \
+        "$${LITERAL_HASH}endif"
+        BLD_INF_RULES.prj_extensions += launcher_buildstubsis_extension
+        
+        INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+                     
+        DEPENDPATH += engine/inc
+        DEPENDPATH += engine/src
+        INCLUDEPATH += engine/inc
+        
+        HEADERS += launcherengine.h launchertraces.h e32image.h e32imageheaders.h launcherxmlparser.h launcherdllelement.h launcherparserobserver.h launcherdllparser.h
+		SOURCES += launcherengine.cpp e32image.cpp launcherxmlparser.cpp launcherdllelement.cpp launcherdllparser.cpp
+		
+		RSS_RULES += "group_name = \"RnD Tools\"";
+		
+		LIBS += -lapgrfx -lPlatformEnv -lxqutils -lxmlframework -lbafl -lshareui
+
+        TARGET.CAPABILITY = ReadUserData ReadDeviceData WriteUserData WriteDeviceData PowerMgmt AllFiles
+        
+        TARGET.UID2 = 0x100039CE
+        TARGET.UID3 = 0x101FB74F
+        TARGET.SID = 0x101FB74F
+        TARGET.VID = 0x101FB657 // Nokia
+	
+        TARGET.EPOCHEAPSIZE = 0x20000 0x2000000  // Min 128Kb, Max 32Mb
+
+        ICON = ./icons/qgn_menu_launcher.svg 
+
+} else {
+    error("Only Symbian supported!")
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/launcher.qrc	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,9 @@
+<RCC>
+    <qresource prefix="/xml" >
+        <file alias="applicationview.xml" >src/applicationview.xml</file>
+        <file alias="outputview.xml" >src/outputview.xml</file>
+    </qresource>
+    <qresource prefix="/gfx" >
+        <file alias="launcher.svg" >icons/qgn_menu_launcher.svg</file>
+    </qresource>
+</RCC>
--- a/launcher/rom/Launcher.iby	Mon May 03 12:32:02 2010 +0300
+++ b/launcher/rom/Launcher.iby	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+//*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  
+* Description: 
 *
 */
 
@@ -20,13 +20,15 @@
 #define __LAUNCHER_IBY__
 
 S60_APP_EXE(Launcher)
-S60_APP_AIF_ICONS(Launcher)
 S60_APP_RESOURCE(Launcher)
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(Launcher)
-#else
-  S60_APP_AIF_RSC(Launcher)
-#endif
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,Launcher)
+data=ZPRIVATE\10003a3f\import\APPS\Launcher_reg.RSC Private\10003a3f\import\Apps\Launcher_reg.rsc
+
+//#ifdef S60_UPGRADABLE_APP_REG_RSC
+//  S60_UPGRADABLE_APP_REG_RSC(Launcher)
+//#else
+//  S60_APP_AIF_RSC(Launcher)
+//#endif
 
 data=ZPRIVATE\101FB74F\backup_registration.xml        	private\101FB74F\backup_registration.xml
 data=ZSYSTEM\Install\Launcher_stub.sis                  \system\install\Launcher_stub.sis
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/rom/backup_registration.xml	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <passive_backup>
+    <include_directory name="\"/>
+  </passive_backup>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- a/launcher/sis/Launcher_S60-30.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"Launcher"},(0x101FB74F),3,7,0,TYPE=SA
-
-; Supports S60 v 3.0
-[0x101F7961], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\Launcher.exe"-"!:\sys\bin\Launcher.exe"
-"\epoc32\data\z\Resource\apps\Launcher_aif.mif"-"!:\Resource\Apps\Launcher_aif.mif"
-"\epoc32\data\z\Resource\apps\Launcher.rsc"-"!:\Resource\Apps\Launcher.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\Launcher_reg.rsc"-"!:\private\10003a3f\import\apps\Launcher_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\101FB74F\backup_registration.xml"
Binary file launcher/sis/Launcher_S60-30.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/sis/Launcher_S60-5x.pkg	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,43 @@
+;
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "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:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+; Language - standard language definitions
+&EN
+
+; Standard SIS file header
+#{"Launcher"},(0x101FB74F),4,0,0,TYPE=SA
+
+;Supports S60 v 5.0
+[0x1028315F], 0, 0, 0, {"S60ProductID"}
+
+;Supports S60 v 5.1
+[0x10283160], 0, 0, 0, {"S60ProductID"}
+
+;Supports S60 v 5.2
+[0x20022E6D], 0, 0, 0, {"S60ProductID"}
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+"\epoc32\release\armv5\urel\launcher.exe"-"!:\sys\bin\launcher.exe"
+"\epoc32\data\z\resource\apps\launcher.mif"-"!:\resource\apps\launcher.mif"
+"\epoc32\data\z\resource\apps\launcher.rsc"-"!:\resource\apps\launcher.rsc"
+"\epoc32\data\z\private\10003a3f\import\apps\launcher_reg.rsc"-"!:\private\10003a3f\import\apps\launcher_reg.rsc"
+"..\group\backup_registration.xml"-"!:\private\101fb74f\backup_registration.xml"
--- a/launcher/sis/Launcher_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/launcher/sis/Launcher_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ; All rights reserved.
 ; This component and the accompanying materials are made available
 ; under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 &EN
 
 ; Standard SIS file header
-#{"Launcher"},(0x101FB74F),1,0,0
+#{"Launcher"},(0x101FB74F),4,0,0
 
 ; Non-localised vendor name
 :"Nokia Corporation"
@@ -28,7 +28,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\Launcher.exe"
-""-"z:\Resource\Apps\Launcher_aif.mif"
+""-"z:\Resource\Apps\Launcher.mif"
 ""-"z:\Resource\Apps\Launcher.rsc"
 ""-"z:\private\10003a3f\import\apps\Launcher_reg.rsc"
 ""-"z:\private\101FB74F\backup_registration.xml"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/sis/launcher_stub_sis.mk	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,56 @@
+#
+# 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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+
+
+TARGETDIR=$(EPOCROOT)EPOC32\Data\Z\System\Install
+
+SISNAME=Launcher_stub
+PKGNAME=Launcher_stub
+
+$(TARGETDIR) :
+	@perl -S emkdir.pl "$(TARGETDIR)"
+
+do_nothing :
+	rem do_nothing
+
+SISFILE=$(TARGETDIR)\$(SISNAME).sis
+
+$(SISFILE) : .\$(PKGNAME).pkg
+	makesis -s $? $@ 
+
+
+
+MAKMAKE : do_nothing
+
+RESOURCE : do_nothing
+
+SAVESPACE : do_nothing
+
+BLD : do_nothing
+
+FREEZE : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+FINAL : $(TARGETDIR) $(SISFILE)
+
+CLEAN : 
+	@if exist $(SISFILE) erase $(SISFILE)
+
+RELEASABLES : 
+	@echo $(SISFILE)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/applicationview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,299 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbdocumentloader.h>
+#include <hblistwidget.h>
+#include <qstandarditemmodel.h>
+#include <hbaction.h>
+#include <hbmenu.h>
+#include <qlist.h>
+
+#include "applicationview.h"
+#include "launchermainwindow.h"
+#include "enginewrapper.h"
+#include "notifications.h"
+#include "commonactions.h"
+#include "outputview.h"
+
+
+
+
+// xml definition of view
+const char *APPLICATIONVIEW_XML = ":/xml/applicationview.xml";
+
+// name of the application view object in the xml file.
+const char *APPLICATIONVIEW = "applicationview";
+const char *LISTVIEW = "applicationList";
+const char *ACTIONREFRESH = "actionRefresh";
+const char *ACTIONLAUNCHAPPS = "actionLaunchApps";
+const char *ACTIONLAUNCHANDCLOSEAPPS = "actionLaunchAppsAndClose";
+const char *ACTIONSELECT = "actionSelectAll";
+const char *ACTIONUNSELECT = "actionUnselectAll";
+const char *ACTIONOPENOUTPUTVIEW = "actionOpenOutputView";
+const char *ACTIONSKIPHIDDEN = "actionSkipHidden";
+const char *ACTIONDONTSKIPHIDDEN = "actionDontSkipHidden";
+
+// ---------------------------------------------------------------------------
+
+ApplicationView* ApplicationView::create(HbDocumentLoader &loader, CommonActions *commonActions, EngineWrapper *engine)
+{
+    
+    // Load xml-file
+    bool ok = false;
+    qDebug("QTLauncher::load xml");
+    loader.load(APPLICATIONVIEW_XML, &ok);
+    
+    // Load Application View:
+    QGraphicsWidget *widget = loader.findWidget(APPLICATIONVIEW);
+    Q_ASSERT_X(ok && (widget != 0), "Launcher", "Invalid launcher.xml file");
+    ApplicationView *applicationView = qobject_cast<ApplicationView *>(widget);
+      
+    // Set enginewrappers pointer to applicationview and initialize it
+    applicationView->setEngine(engine);
+    applicationView->init(loader, commonActions);
+    
+    return applicationView;    
+}
+
+// ---------------------------------------------------------------------------
+
+ApplicationView::ApplicationView()  
+    :   mEngine(0),
+        mActionRefresh(0),
+        mActionLaunchApps(0),
+        mActionLaunchAndCloseApps(0),
+        mActionSkipHidden(0),
+        mActionDontSkipHidden(0),
+        mActionSelectAll(0),
+        mActionUnselectAll(0),
+        mActionOpenOutputView(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::setEngine(EngineWrapper *engine)
+{
+    mEngine = engine;
+}
+
+// ---------------------------------------------------------------------------
+
+ApplicationView::~ApplicationView()
+{
+    if(mActionRefresh)
+        mActionRefresh->deleteLater();
+    if(mActionLaunchApps)
+        mActionLaunchApps->deleteLater();
+    if(mActionLaunchAndCloseApps)
+        mActionLaunchAndCloseApps->deleteLater();
+    if(mActionSkipHidden)
+        mActionSkipHidden->deleteLater();
+    if(mActionDontSkipHidden)
+        mActionDontSkipHidden->deleteLater();
+    if(mActionSelectAll)
+        mActionSelectAll->deleteLater();
+    if(mActionUnselectAll)
+        mActionUnselectAll->deleteLater();
+    if(mActionOpenOutputView)
+        mActionOpenOutputView->deleteLater();
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::init(HbDocumentLoader &loader, CommonActions *commonActions)
+{
+    // Load items from xml file
+    loadItemsFromXml(loader);
+    
+    // Set actions checkable and select "Skip hidden & embed"
+    mActionSkipHidden->setCheckable(true);
+    mActionSkipHidden->setChecked(true);
+    mActionDontSkipHidden->setCheckable(true);
+    
+    commonActions->addActionsToMenu(menu());
+    
+    // Set list widget settings
+    mApplicationList->setClampingStyle(HbScrollArea::BounceBackClamping);
+    mApplicationList->setSelectionMode(HbAbstractItemView::MultiSelection);
+    
+    // Refresh application list
+    refreshAppList();
+    
+    // Connect signals and slots
+    connectSignalsAndSlots();
+   
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::refreshAppList()
+{
+    // Clear list
+
+    mApplicationList->clear();
+    QStringList apps;
+
+    // show wait dialog
+    QObject *dialog =  static_cast<QObject*>(Notifications::showWaitDialog("Initializing"));
+
+    // Get application list from engine
+    if(!mEngine->listOfAllApps(apps)) {
+        Notifications::showErrorNote("Unable to refresh list");
+    }
+    
+    // Format values to list widget
+    int i = 0;
+    while(i < apps.size()) {
+        mApplicationList->addItem(/*HbIcon(":/gfx/check.svg"),*/apps.at(i));
+        i++;
+    }
+    mApplicationList->selectAll();
+    
+    // remove the wait dialog
+    delete dialog;
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::connectSignalsAndSlots()
+{
+    // Actions
+    connect(mActionRefresh, SIGNAL(triggered()), this, SLOT(refreshAppList()));
+    connect(mActionLaunchApps, SIGNAL(triggered()), this, SLOT(launchSelectedApplications()));
+    connect(mActionLaunchAndCloseApps, SIGNAL(triggered()), this, SLOT(launchAndCloseSelectedApplications()));
+    connect(mActionSelectAll, SIGNAL(triggered()), this, SLOT(selectAllItems()));
+    connect(mActionUnselectAll, SIGNAL(triggered()), this, SLOT(unselectAllItems()));
+    connect(mActionSkipHidden, SIGNAL(triggered()), this, SLOT(launchOptionsSkipHidden()));
+    connect(mActionDontSkipHidden, SIGNAL(triggered()), this, SLOT(launchOptionsDontSkipHidden()));
+    connect(mActionOpenOutputView, SIGNAL(triggered()), this, SLOT(openOutputView()));
+}
+
+// ---------------------------------------------------------------------------
+
+
+void ApplicationView::loadItemsFromXml(HbDocumentLoader &loader)
+{
+    
+    // List widget:
+    QGraphicsWidget *widget = loader.findWidget(LISTVIEW);
+    Q_ASSERT_X((widget != 0), "Launcher", "Invalid launcher.xml file");
+    mApplicationList = qobject_cast<HbListWidget *>(widget);
+    
+    /* ACTIONS: */
+    //refresh
+    QObject *object= loader.findObject(ACTIONREFRESH);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionRefresh = qobject_cast<HbAction *>(object);
+    
+    // launch applications
+    object= loader.findObject(ACTIONLAUNCHAPPS);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionLaunchApps = qobject_cast<HbAction *>(object);
+
+    // launch and close
+    object= loader.findObject(ACTIONLAUNCHANDCLOSEAPPS);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionLaunchAndCloseApps = qobject_cast<HbAction *>(object);
+    
+    // select all applications
+    object= loader.findObject(ACTIONSELECT);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionSelectAll = qobject_cast<HbAction *>(object);
+    
+    // unselect all applications
+    object= loader.findObject(ACTIONUNSELECT);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionUnselectAll = qobject_cast<HbAction *>(object);
+    
+    // open output view
+    object= loader.findObject(ACTIONOPENOUTPUTVIEW);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionOpenOutputView = qobject_cast<HbAction *>(object);
+    
+    // skip hidden
+    object= loader.findObject(ACTIONSKIPHIDDEN);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionSkipHidden = qobject_cast<HbAction *>(object);
+    
+    // do not skip hidden
+    object= loader.findObject(ACTIONDONTSKIPHIDDEN);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionDontSkipHidden = qobject_cast<HbAction *>(object);
+    
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::launchSelectedApplications()
+{
+    QModelIndexList list = mApplicationList->selectionModel()->selectedIndexes();
+    mEngine->startAppLaunching(list, false);
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::launchAndCloseSelectedApplications()
+{
+    QModelIndexList list = mApplicationList->selectionModel()->selectedIndexes();
+    mEngine->startAppLaunching(list, true);
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::selectAllItems()
+{
+    mApplicationList->selectAll();
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::unselectAllItems()
+{
+    mApplicationList->clearSelection();
+}
+// ---------------------------------------------------------------------------
+
+void ApplicationView::launchOptionsSkipHidden()
+{
+    mActionSkipHidden->setChecked(true);
+    mActionDontSkipHidden->setChecked(false);
+    mEngine->setSkipHiddenAndEmbedOnly(true);
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::launchOptionsDontSkipHidden()
+{
+    mActionSkipHidden->setChecked(false);
+    mActionDontSkipHidden->setChecked(true);
+    mEngine->setSkipHiddenAndEmbedOnly(false);
+}
+
+// ---------------------------------------------------------------------------
+
+void ApplicationView::openOutputView()
+{
+    qDebug("OpenOutputView");
+    LauncherMainWindow *pMainWindow = static_cast< LauncherMainWindow * >( mainWindow() );
+    if( pMainWindow )
+        {
+        pMainWindow->openOutputView();
+        }
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/applicationview.xml	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.2">
+    <object name="actionLaunchApps" type="HbAction">
+        <string name="iconText" value="LaunchApps"/>
+        <string name="text" value="Launch selected"/>
+        <string name="toolTip" value="LaunchApps"/>
+    </object>
+    <object name="actionLaunchAppsAndClose" type="HbAction">
+        <string name="iconText" value="LaunchAppsAndClose"/>
+        <string name="text" value="Launch and close selected"/>
+        <string name="toolTip" value="LaunchAppsAndClose"/>
+    </object>
+    <object name="actionRefresh" type="HbAction">
+        <string name="iconText" value="RefreshList"/>
+        <string name="text" value="Refresh list"/>
+        <string name="toolTip" value="RefreshList"/>
+    </object>
+    <object name="actionSelectAll" type="HbAction">
+        <string name="iconText" value="Select/Unselect"/>
+        <string name="text" value="Select all"/>
+        <string name="toolTip" value="Select/Unselect"/>
+    </object>
+    <object name="actionUnselectAll" type="HbAction">
+        <string name="iconText" value="Unselect All"/>
+        <string name="text" value="Unselect all"/>
+        <string name="toolTip" value="Unselect All"/>
+    </object>
+    <object name="actionSkipHidden" type="HbAction">
+        <string name="iconText" value="Skip hidden &amp; embed"/>
+        <string name="text" value="Skip hidden &amp; embed"/>
+        <string name="toolTip" value="Skip hidden &amp; embed"/>
+    </object>
+    <object name="actionDontSkipHidden" type="HbAction">
+        <string name="iconText" value="Do not skip any entries"/>
+        <string name="text" value="Do not skip any entries"/>
+        <string name="toolTip" value="Do not skip any entries"/>
+    </object>
+    <object name="actionOpenOutputView" type="HbAction">
+        <string name="iconText" value="Open output view"/>
+        <string name="text" value="Open output view"/>
+        <string name="toolTip" value="Open output view"/>
+    </object>
+    <widget name="applicationview" type="ApplicationView">
+        <widget name="applicationContent" role="HbView:widget" type="HbWidget">
+            <widget name="applicationList" type="HbListWidget">
+                <sizehint height="320.0" type="PREFERRED" width="240.0"/>
+                <zvalue value="278529.0001"/>
+            </widget>
+            <layout type="anchor" widget="applicationContent">
+                <anchoritem dst="applicationList" dstEdge="LEFT" spacing="0.0" src="" srcEdge="LEFT"/>
+                <anchoritem dst="applicationList" dstEdge="TOP" spacing="0.0" src="" srcEdge="TOP"/>
+                <anchoritem dst="applicationList" dstEdge="RIGHT" spacing="0.0" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="applicationList" dstEdge="BOTTOM" spacing="0.0" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+            <ref object="actionLaunchAppsAndClose" role="HbMenu:addAction"/>
+            <ref object="actionLaunchApps" role="HbMenu:addAction"/>
+            <widget name="menuLaunchOptions" role="HbMenu:menu" type="HbMenu">
+                <ref object="actionSkipHidden" role="HbMenu:addAction"/>
+                <ref object="actionDontSkipHidden" role="HbMenu:addAction"/>
+                <string name="title" value="Launch options"/>
+            </widget>
+            <ref object="actionRefresh" role="HbMenu:addAction"/>
+            <ref object="actionSelectAll" role="HbMenu:addAction"/>
+            <ref object="actionUnselectAll" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="viewToobar" role="HbView:toolBar" type="HbToolBar">
+            <ref object="actionOpenOutputView" role="HbToolBar:addAction"/>
+        </widget>
+        <string name="title" value="Applications"/>
+    </widget>
+    <metadata display="QHD portrait" unit="px"/>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/commonActions.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbapplication.h>
+#include <hbinstance.h>
+
+#include "hbaction.h"
+#include "hbmenu.h"
+#include "commonactions.h"
+#include "notifications.h"
+#include "enginewrapper.h"
+
+// ---------------------------------------------------------------------------
+
+CommonActions::CommonActions(EngineWrapper *engine, HbApplication *application)
+    : mEngine(engine), mApplication(application)
+{
+
+    
+    mActionStopLaunch = new HbAction("Stop launch", this);
+    mActionSendLog = new HbAction("Send log", this);
+    mActionDeleteLog = new HbAction("Delete log", this);
+    mActionSendDllInfo = new HbAction("Send list of DLLs", this);
+    mActionCompareDllInfo = new HbAction("Dll BC analysis", this);
+    mActionAbout = new HbAction("About", this);
+    mActionExit = new HbAction("Exit", this);
+
+
+    connectSignalsAndSlots();
+}
+
+// ---------------------------------------------------------------------------
+
+CommonActions::~CommonActions()
+{
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::showAbout()
+{
+    Notifications::about();
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::exit()
+{
+    mApplication->exit();
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::sendDllInfo()
+{
+    if (!mEngine->sendListOfDlls()) {
+        Notifications::showErrorNote("Unable to send list");
+    }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::compareDllInfo()
+{
+    mEngine->compareDlls();
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::sendLog()
+{
+    if (!mEngine->sendLog()) {
+        Notifications::showErrorNote("Unable to send log");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::deleteLog()
+{
+    if (mEngine->deleteLog()) {
+        QString text = "Log file(s) deleted";
+        Notifications::showInformationNote(text);
+    }
+    else {
+        QString text = "Unable to delete";
+        Notifications::showErrorNote(text);
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::stopLaunch()
+{
+    if (!mEngine->stopLaunching()) {
+        Notifications::showErrorNote("Unable to stop launching");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::addActionsToMenu(HbMenu *menu)
+{
+    menu->addAction(mActionStopLaunch);
+    menu->addAction(mActionSendLog);
+    menu->addAction(mActionDeleteLog);
+    HbMenu *menuDllInfo = menu->addMenu("Dll Info");
+    menuDllInfo->addAction(mActionSendDllInfo);
+    menuDllInfo->addAction(mActionCompareDllInfo);
+    menu->addAction(mActionAbout);
+    menu->addAction(mActionExit);
+}
+
+// ---------------------------------------------------------------------------
+
+void CommonActions::connectSignalsAndSlots()
+{
+    connect(mActionStopLaunch, SIGNAL(triggered()), this, SLOT(stopLaunch()));
+    connect(mActionSendDllInfo, SIGNAL(triggered()), this, SLOT(sendDllInfo()));
+    connect(mActionCompareDllInfo, SIGNAL(triggered()), this, SLOT(compareDllInfo()));
+    connect(mActionSendLog, SIGNAL(triggered()), this, SLOT(sendLog()));
+    connect(mActionDeleteLog, SIGNAL(triggered()), this, SLOT(deleteLog()));
+    connect(mActionAbout, SIGNAL(triggered()), this, SLOT(showAbout()));
+    connect(mActionExit, SIGNAL(triggered()), this, SLOT( exit() ) );
+}
+
+
+// ---------------------------------------------------------------------------
--- a/launcher/src/e32image.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,846 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "e32image.h"
-#include "e32imageheaders.h"
-#include "launchertraces.h"
-
-
-const TInt KMaxHeaderSize = sizeof(E32ImageHeaderV) + 65536/8;
-
-SCapabilitySet AllCapabilities;
-SCapabilitySet DisabledCapabilities;
-
-// ---------------------------------------------------------------------------
-
-E32ImageReader* E32ImageReader::NewLC()
-    {
-    E32ImageReader* self = new(ELeave) E32ImageReader;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-E32ImageReader::E32ImageReader()
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-void E32ImageReader::ConstructL()
-    {
-    LOGSTRING("Launcher: E32ImageReader::ConstructL");
-
-    iEnv = CEikonEnv::Static();
-    }
-
-// ---------------------------------------------------------------------------
-
-CDesCArray* E32ImageReader::ListOfDLLsL(const TDesC& aFullPathToE32Image)
-    {
-    LOGSTRING("Launcher: E32ImageReader::ListOfDLLsL");
-
-    // open the file for reading
-    User::LeaveIfError( iFile.Open(iEnv->FsSession(), aFullPathToE32Image, EFileRead) );
-    CleanupClosePushL(iFile);
-    
-    // get local copies of capability sets
-    TCapabilitySet caps;
-    caps.SetAllSupported();
-    AllCapabilities=*(SCapabilitySet*)&caps;
-    caps.SetDisabled();
-    DisabledCapabilities=*(SCapabilitySet*)&caps;
-
-    // read the header of the image
-    User::LeaveIfError( E32ImageHeader::New(iHeader, iFile) );
-
-    // set stuff
-    iHeapSizeMin = iHeader->iHeapSizeMin;
-    iHeapSizeMax = iHeader->iHeapSizeMax;
-    iStackSize = iHeader->iStackSize;
-    iPriority = iHeader->ProcessPriority();
-    iDepCount = iHeader->iDllRefTableCount;
-    iExportDirCount = iHeader->iExportDirCount;
-    iExportDir = iHeader->iExportDirOffset-iHeader->iCodeOffset;
-    iTextSize = iHeader->iTextSize;
-    iCodeSize = iHeader->iCodeSize;
-    iDataSize = iHeader->iDataSize;
-    iBssSize = iHeader->iBssSize;
-    iTotalDataSize = iDataSize+iBssSize;
-    iFileEntryPoint = iHeader->iEntryPoint;
-    iEntryPtVeneer = 0;
-    iExceptionDescriptor = iHeader->ExceptionDescriptor();
-    if (iHeader->iExportDirOffset)
-        iExportDirLoad=iExportDir;
-    
-    // allocate data for the code area
-    iCodeLoadAddress = (TUint32)User::Alloc(iCodeSize);
-    
-    // load data from the binary
-    User::LeaveIfError( LoadData() );
-
-    // create an array for the dll names from the import list
-    CDesCArray* dllArray = new(ELeave) CDesCArrayFlat(100);
-    CleanupStack::PushL(dllArray);
-
-    // get the dll names from the import section
-    E32ImportSection* importSection = (E32ImportSection *)iImportData;
-    E32ImportBlock* block;
-    if(importSection)
-        block = (E32ImportBlock*)(importSection+1);
-    else
-        block = NULL;
-    iNextImportPos = 0;
-
-    // loop through all import data blocks
-    for (TInt i=0; i<iDepCount; i++)
-        {
-        // get a pointer to the dll name
-        TPtrC8 dllname = (const TText8*)((TUint32)iImportData + block->iOffsetOfDllName);
-        TBuf8<KMaxKernelName> rootname;
-        if (dllname.Length() > KMaxKernelName)
-            User::Leave( KErrNotSupported );
-        
-        // parse the filename
-        TFileNameInfo fni;
-        User::LeaveIfError( fni.Set(dllname, TFileNameInfo::EAllowUid) );
-        fni.GetName(rootname, TFileNameInfo::EIncludeBaseExt);
-
-        // append the name to the dll name array
-        TFileName dllName16;
-        dllName16.Copy(rootname);
-        dllArray->AppendL(dllName16);
-
-        // get the next block
-        TUint impfmt = iHeader->ImportFormat();
-        block = (E32ImportBlock*)block->NextBlock(impfmt);
-        }
-
-    CleanupStack::Pop();  //dllArray
-    CleanupStack::PopAndDestroy(); //iFile
-
-    // free memory
-    delete iHeader;
-    iHeader = NULL;
-    delete iImportSection;
-    iImportSection = NULL;
-    delete iCodeRelocSection;
-    iCodeRelocSection = NULL;
-    delete iDataRelocSection;
-    iDataRelocSection = NULL;
-    
-    User::Free((TAny*)iCodeLoadAddress);
-    User::Free(iRestOfFileData);
-    User::Free(iCurrentImportList);
-    if (iExportDirLoadAllocated)
-        User::Free((TAny*)iExportDirLoad);
-
-    return dllArray;
-    }
-
-// ---------------------------------------------------------------------------
-
-E32ImageReader::~E32ImageReader()
-    {
-    LOGSTRING("Launcher: E32ImageReader::~E32ImageReader");
-    }
-
-
-// ---------------------------------------------------------------------------
-
-TInt FileRead(RFile& aFile, TUint8* aDest, TInt aSize)
-    {
-    TPtr8 p(aDest,aSize,aSize);
-    return aFile.Read(p,aSize);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageHeader::New(E32ImageHeader*& aHdr, RFile& aFile)
-    {
-    LOGSTRING("Launcher: E32ImageHeader::New");
-
-    E32ImageHeader* h = NULL;
-    TInt hdrsz = 0;
-    TInt filesize;
-    TInt r = aFile.Size(filesize);
-    if (r!=KErrNone)
-        return r;
-    E32ImageHeader bh;
-    r = FileRead(aFile, (TUint8*)&bh, sizeof(E32ImageHeader));
-    if (r==KErrNone)
-        {
-        hdrsz = bh.TotalSize();
-        if ( (TUint(hdrsz) > TUint(KMaxHeaderSize)) || (TUint(hdrsz) < TUint(sizeof(bh))) )
-            return KErrCorrupt;
-        }
-    h = (E32ImageHeader*)User::Alloc(hdrsz);
-    if (!h)
-        return KErrNoMemory;
-    wordmove(h, &bh, sizeof(E32ImageHeader));
-    if (hdrsz > (TInt)sizeof(E32ImageHeader))
-        r = FileRead(aFile, (TUint8*)(h + 1), hdrsz - sizeof(E32ImageHeader));
-    if (r==KErrNone)
-        r = h->IntegrityCheck(filesize);
-    if (r==KErrNone)
-        {
-        if (h->HeaderFormat() >= KImageHdrFmt_V)
-            {
-            // Overide capabilities in image
-            for(TInt i=0; i<SCapabilitySet::ENCapW; i++)
-                {
-                ((E32ImageHeaderV*)h)->iS.iCaps[i] |= DisabledCapabilities[i];
-                ((E32ImageHeaderV*)h)->iS.iCaps[i] &= AllCapabilities[i];
-                }
-            }
-        aHdr = h;
-        }
-    else
-        {
-        delete h;
-        aHdr = NULL;
-        }
-    return r;
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageHeader::IntegrityCheck(TInt aFileSize)
-    {
-    LOGSTRING("Launcher: E32ImageHeader::IntegrityCheck");
-    
-    TInt hdrsz = TotalSize();
-    TUint hdrfmt = HeaderFormat();
-    TUidType uids = *(const TUidType*)&iUid1;
-    E32ImageHeaderV* v = NULL;
-    TCheckedUid chkuid(uids);
-    const TUint32* pChkUid = (const TUint32*)&chkuid;
-
-    if (pChkUid[3] != iUidChecksum)
-        return KErrCorrupt;    
-
-    if (hdrfmt == KImageHdrFmt_V)
-        {
-        TUint32 supplied_crc = iHeaderCrc;
-        iHeaderCrc = KImageCrcInitialiser;
-        TUint32 crc = 0;
-        Mem::Crc32(crc, this, hdrsz);
-        iHeaderCrc = supplied_crc;
-        if (crc != supplied_crc)
-            return KErrCorrupt;    
-        v = (E32ImageHeaderV*)this;
-        TUint total_eds = v->iExportDescSize + sizeof(v->iExportDescSize) + sizeof(v->iExportDescType);
-        total_eds = (total_eds + 3) &~ 3;
-        if (total_eds + (TUint)_FOFF(E32ImageHeaderV, iExportDescSize) != (TUint)hdrsz)
-            return KErrCorrupt;
-        if (TUint(v->iExportDescType) > KImageHdr_ExpD_SparseBitmap8)
-            return KErrNotSupported;
-        }
-    else if (hdrfmt >= KImageHdrFmt_V)
-        return KErrNotSupported; 
-
-    TCpu cpu = CpuIdentifier();
-    TUint abi = ABI();
-    TUint impfmt = ImportFormat();
-    TUint compression = CompressionType();
-
-    TUint uncompressed_size = compression ? UncompressedFileSize() : (TUint)aFileSize;
-
-    if (iSignature != 0x434f5045) // 'EPOC'
-        return KErrCorrupt;
-    if (iCodeSize<0)
-        return KErrCorrupt;
-    if (iDataSize<0)
-        return KErrCorrupt;
-    if (iHeapSizeMin<0)
-        return KErrCorrupt;
-    if (iHeapSizeMax<iHeapSizeMin)
-        return KErrCorrupt;
-    if (iStackSize<0)
-        return KErrCorrupt;
-    if (iBssSize<0)
-        return KErrCorrupt;
-    if (iDllRefTableCount<0)
-        return KErrCorrupt;
-    if (iExportDirOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (TUint(iExportDirCount)>65535)
-        return KErrCorrupt;
-    if (iTextSize<0)
-        return KErrCorrupt;
-    if (iCodeSize<iTextSize)
-        return KErrCorrupt;
-    if (iCodeOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (iDataOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (iImportOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (iCodeRelocOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (iDataRelocOffset >= uncompressed_size)
-        return KErrCorrupt;
-    if (TUint(iCodeSize+iDataSize) > uncompressed_size)
-        return KErrCorrupt;
-
-    if (abi>KImageABI_EABI)
-        return KErrNotSupported;
-    if (impfmt>KImageImpFmt_PE2)
-        return KErrNotSupported;
-    if (iUid1 != (TUint32)KExecutableImageUidValue && iUid1 != (TUint32)KDynamicLibraryUidValue)
-        return KErrNotSupported;
-    TUint32 mv = ModuleVersion();
-    if (mv >= 0x80000000u || (mv & 0x0000ffffu) > 0x8000u)
-        return KErrNotSupported;
-
-    return KErrNone;
-    }
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::LoadData()
-    {
-    LOGSTRING("Launcher: E32ImageReader::LoadData");
-
-    TInt remainder;
-    iFile.Size(remainder);
-    
-    remainder -= iHeader->TotalSize();
-    TUint32 compression = iHeader->CompressionType();
-    if (compression != KMyFormatNotCompressed)
-        {
-        remainder = iHeader->UncompressedFileSize() - iHeader->iCodeOffset;
-        }
-
-    remainder -= iHeader->iCodeSize;
-    
-    if (remainder > 0)
-        {
-        iRestOfFileData = (TUint8*)User::Alloc(remainder);
-        if (iRestOfFileData)
-            iRestOfFileSize=remainder;
-        else
-            return KErrNoMemory;
-        }
-
-    iConversionOffset = iHeader->iCodeOffset + iHeader->iCodeSize;
-
-    TInt r = LoadFile(compression);
-    if (r !=KErrNone)
-        return r;
-
-
-    TUint8* source=NULL;
-    if (iHeader->iImportOffset)
-        {
-        TUint bufferOffset=iHeader->iImportOffset-iConversionOffset;
-        
-        if(bufferOffset>iRestOfFileSize || bufferOffset+sizeof(E32ImportSection)>iRestOfFileSize)
-            return KErrCorrupt;
-        
-        source=iRestOfFileData+bufferOffset;
-        
-        iImportSection = new E32ImportSection;
-        
-        if (iImportSection)
-            Mem::Move((TText8*)iImportSection, source, sizeof(E32ImportSection));
-        else
-            return KErrNoMemory;
-        }
-
-    iCodeDelta = iCodeRunAddress-iHeader->iCodeBase;
-    iDataDelta = iDataRunAddress-iHeader->iDataBase;
-
-    if (r==KErrNone)
-        r = ReadImportData();
-
-    return r;
-    }
-
-// ---------------------------------------------------------------------------
-
-TUint8* E32ImageReader::MemoryMove(TAny* aDestination, const TAny* aSource, TInt aNumberofBytes)
-    {
-    return Mem::Move(aDestination, aSource, aNumberofBytes);
-    }
-
-// ---------------------------------------------------------------------------
-
-GLDEF_C TInt svRelocateExports(TAny* aPtr)
-    {
-    E32ImageReader* pI=(E32ImageReader*)aPtr;
-    TUint32* destExport=(TUint32*)pI->iExportDirLoad;
-    TInt i=pI->iExportDirCount;
-    TUint32 codeBase=pI->iCodeRunAddress;
-    while (i-->0)
-        *destExport+++=codeBase;
-    return 0;
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::LoadFile(TUint32 aCompression)
-    {
-    LOGSTRING("Launcher: E32ImageReader::LoadFile");
-
-    TInt r(KErrNone);
-
-    if (aCompression == KMyFormatNotCompressed)
-        r=LoadFileNoCompress();
-    
-    else if (aCompression == KMyUidCompressionDeflate)
-        {
-        TRAP(r, LoadFileInflateL());
-        }
-    
-    else
-        r = KErrNotSupported;
-    
-    return r;
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::LoadFileNoCompress()
-    {
-    LOGSTRING("Launcher: E32ImageReader::LoadFileNoCompress");
-
-    TInt r(KErrNone);
-
-    if (iHeader->iCodeSize)
-        {
-        r = Read(iHeader->iCodeOffset, (TText8*)iCodeLoadAddress, iCodeSize);
-        }
-
-    if (r != KErrNone)
-        {
-        return r;
-        }
-
-    if (iRestOfFileSize)
-        {
-        r = Read(iConversionOffset, (TText8*)iRestOfFileData, iRestOfFileSize);
-        }
-    
-    return r;
-    }
-
-// ---------------------------------------------------------------------------
-
-void FileCleanup(TAny* aPtr)
-    {
-    TFileInput* f=(TFileInput*)aPtr;
-    f->Cancel();
-    delete f;
-    }
-
-// ---------------------------------------------------------------------------
-
-void E32ImageReader::LoadFileInflateL()
-    {
-    LOGSTRING("Launcher: E32ImageReader::LoadFileInflateL");
-
-    TInt pos = iHeader->TotalSize();
-    User::LeaveIfError(iFile.Seek(ESeekStart,pos));
-
-    TFileInput* file = new (ELeave) TFileInput(iFile);
-    CleanupStack::PushL(TCleanupItem(&FileCleanup,file));
-    CInflater* inflater = CInflater::NewLC(*file);
-    
-    if (iHeader->iCodeSize)
-        {
-        TInt count = inflater->ReadL((TUint8*)iCodeLoadAddress, iCodeSize, &MemoryMove);
-        
-        if(count!=iCodeSize)
-            User::Leave(KErrCorrupt);
-        }
-
-    if (iRestOfFileSize)
-        {
-        TUint32 count = inflater->ReadL(iRestOfFileData, iRestOfFileSize, &Mem::Move);
-        
-        if(count!=iRestOfFileSize)
-            User::Leave(KErrCorrupt);
-        }
-    
-    CleanupStack::PopAndDestroy(2,file);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::Read(TText8* aDest, TInt aSize)
-    {
-    TPtr8 p(aDest,aSize,aSize);
-    return iFile.Read(p,aSize);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::Read(TInt aPos, TText8* aDest, TInt aSize)
-    {
-    TPtr8 p(aDest,aSize,aSize);
-    if (aPos<0)
-        return KErrCorrupt;
-    return iFile.Read(aPos,p,aSize);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt E32ImageReader::ReadImportData()
-    {
-    LOGSTRING("Launcher: E32ImageReader::ReadImportData");
-
-    if (!iHeader->iImportOffset)
-        return KErrNone;
-    
-    TUint32 bufferOffset = iHeader->iImportOffset-iConversionOffset;
-    
-    if(bufferOffset>iRestOfFileSize || bufferOffset+iImportSection->iSize>iRestOfFileSize)
-        return KErrCorrupt;
-    
-    iImportData = (TUint32*)(iRestOfFileData+bufferOffset);
-    
-    E32ImportSection* s = (E32ImportSection*)iImportData;
-    E32ImportBlock* b = (E32ImportBlock*)(s + 1);
-    TUint impfmt = iHeader->ImportFormat();
-    TInt i;
-    TInt n = 0;
-    
-    for (i=0; i<iDepCount; ++i)
-        {
-        if (b->iNumberOfImports > n)
-            n = b->iNumberOfImports;
-        b = (E32ImportBlock*)b->NextBlock(impfmt);
-        }
-    
-    iCurrentImportList = (TUint32*)User::Alloc(n * sizeof(TUint32));
-    
-    if (!iCurrentImportList)
-        return KErrNoMemory;
-    
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-
-inline CInflater::CInflater(TBitInput& aInput)
-    :iBits(&aInput),iEncoding(0),iOut(0)
-    {}
-
-// ---------------------------------------------------------------------------
-
-void CInflater::ConstructL()
-    {
-    iEncoding=new(ELeave) TEncoding;
-    InitL();
-    iLen=0;
-    iOut=new(ELeave) TUint8[KDeflateMaxDistance];
-    iAvail=iLimit=iOut;
-    }
-
-// ---------------------------------------------------------------------------
-
-CInflater* CInflater::NewLC(TBitInput& aInput)
-    {
-    CInflater* self=new(ELeave) CInflater(aInput);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CInflater::~CInflater()
-    {
-    delete iEncoding;
-    delete [] iOut;
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CInflater::ReadL(TUint8* aBuffer,TInt aLength, TMemoryMoveFunction aMemMovefn)
-    {
-    TInt tfr=0;
-    for (;;)
-        {
-        TInt len=Min(aLength,iLimit-iAvail);
-        if (len && aBuffer)
-            {
-            aMemMovefn(aBuffer,iAvail,len);
-            aBuffer+=len;
-            }
-        aLength-=len;
-        iAvail+=len;
-        tfr+=len;
-        if (aLength==0)
-            return tfr;
-        len=InflateL();
-        if (len==0)
-            return tfr;
-        iAvail=iOut;
-        iLimit=iAvail+len;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CInflater::SkipL(TInt aLength)
-    {
-    return ReadL(0,aLength,Mem::Move);
-    }
-
-// ---------------------------------------------------------------------------
-
-void CInflater::InitL()
-    {
-    Huffman::InternalizeL(*iBits,iEncoding->iLitLen,KDeflationCodes);
-
-    if (!Huffman::IsValid(iEncoding->iLitLen,TEncoding::ELitLens) ||
-        !Huffman::IsValid(iEncoding->iDistance,TEncoding::EDistances))
-        User::Leave(KErrCorrupt);
-
-    Huffman::Decoding(iEncoding->iLitLen,TEncoding::ELitLens,iEncoding->iLitLen);
-    Huffman::Decoding(iEncoding->iDistance,TEncoding::EDistances,iEncoding->iDistance,KDeflateDistCodeBase);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CInflater::InflateL()
-    {
-    TUint8* out=iOut;
-    TUint8* const end=out+KDeflateMaxDistance;
-    const TUint32* tree=iEncoding->iLitLen;
-    if (iLen<0)    // EOF
-        return 0;
-    if (iLen>0)
-        goto useHistory;
-
-    while (out<end)
-        {
-        // get a huffman code
-        {
-        TInt val=iBits->HuffmanL(tree)-TEncoding::ELiterals;
-        if (val<0)
-            {
-            *out++=TUint8(val);
-            continue;        
-            }
-        if (val==TEncoding::EEos-TEncoding::ELiterals)
-            {    
-            iLen=-1;
-            break;
-            }
-        
-        TInt code=val&0xff;
-        if (code>=8)
-            {    
-            TInt xtra=(code>>2)-1;
-            code-=xtra<<2;
-            code<<=xtra;
-            code|=iBits->ReadL(xtra);
-            }
-        if (val<KDeflateDistCodeBase-TEncoding::ELiterals)
-            {
-            iLen=code+KDeflateMinLength;
-            tree=iEncoding->iDistance;
-            continue;        
-            }
-        
-        iRptr=out-(code+1);
-        if (iRptr+KDeflateMaxDistance<end)
-            iRptr+=KDeflateMaxDistance;
-        }
-useHistory:
-        TInt tfr=Min(end-out,iLen);
-        iLen-=tfr;
-        const TUint8* from=iRptr;
-        do
-            {
-            *out++=*from++;
-            if (from==end)
-                from-=KDeflateMaxDistance;
-            } while (--tfr!=0);
-        iRptr=from;
-        tree=iEncoding->iLitLen;
-        };
-    
-    return out-iOut;
-    }
-
-// ---------------------------------------------------------------------------
-
-TFileInput::TFileInput(RFile& aFile)
-    :iFile(aFile),iReadBuf(iBuf1),iPtr(iBuf1,KBufSize)
-    {
-    aFile.Read(iPtr,iStat);
-    }
-
-// ---------------------------------------------------------------------------
-
-void TFileInput::Cancel()
-    {
-    if (iReadBuf)
-        User::WaitForRequest(iStat);
-    }
-
-// ---------------------------------------------------------------------------
-
-void TFileInput::UnderflowL()
-    {
-    TUint8* b=iReadBuf;
-    ASSERT(b!=NULL);
-    User::WaitForRequest(iStat);
-    iReadBuf=0;
-    User::LeaveIfError(iStat.Int());
-    if(iPtr.Length()==0)
-        User::Leave(KErrCorrupt);
-    Set(b,iPtr.Length()*8);
-    
-    b = b==iBuf1 ? iBuf2 : iBuf1;
-    iPtr.Set(b,0,KBufSize);
-    iFile.Read(iPtr,iStat);
-    iReadBuf=b;
-    }
-
-// ---------------------------------------------------------------------------
-
-TFileNameInfo::TFileNameInfo()
-    {
-    memclr(this, sizeof(TFileNameInfo));
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt TFileNameInfo::Set(const TDesC8& aFileName, TUint aFlags)
-    {
-    iUid = 0;
-    iVersion = 0;
-    iPathPos = 0;
-    iName = aFileName.Ptr();
-    iLen = aFileName.Length();
-    iExtPos = aFileName.LocateReverse('.');
-    if (iExtPos<0)
-        iExtPos = iLen;
-    TInt osq = aFileName.LocateReverse('[');
-    TInt csq = aFileName.LocateReverse(']');
-    if (!(aFlags & EAllowUid) && (osq>=0 || csq>=0))
-        {
-        return KErrBadName;
-        }
-    if (osq>=iExtPos || csq>=iExtPos)
-        {
-        return KErrBadName;
-        }
-    TInt p = iExtPos;
-    if ((aFlags & EAllowUid) && p>=10 && iName[p-1]==']' && iName[p-10]=='[')
-        {
-        TPtrC8 uidstr(iName + p - 9, 8);
-        TLex8 uidlex(uidstr);
-        TUint32 uid = 0;
-        TInt r = uidlex.Val(uid, EHex);
-        if (r==KErrNone && uidlex.Eos())
-            iUid = uid, p -= 10;
-        }
-    iUidPos = p;
-    TInt ob = aFileName.LocateReverse('{');
-    TInt cb = aFileName.LocateReverse('}');
-    if (ob>=iUidPos || cb>=iUidPos)
-        {
-        return KErrBadName;
-        }
-    if (ob>=0 && cb>=0 && p-1==cb)
-        {
-        TPtrC8 p8(iName, p);
-        TInt d = p8.LocateReverse('.');
-        TPtrC8 verstr(iName+ob+1, p-ob-2);
-        TLex8 verlex(verstr);
-        if (ob==p-10 && d<ob)
-            {
-            TUint32 ver = 0;
-            TInt r = verlex.Val(ver, EHex);
-            if (r==KErrNone && verlex.Eos())
-                iVersion = ver, p = ob;
-            }
-        else if (d>ob && p-1>d && (aFlags & EAllowDecimalVersion))
-            {
-            TUint32 maj = 0;
-            TUint32 min = 0;
-            TInt r = verlex.Val(maj, EDecimal);
-            TUint c = (TUint)verlex.Get();
-            TInt r2 = verlex.Val(min, EDecimal);
-            if (r==KErrNone && c=='.' && r2==KErrNone && verlex.Eos() && maj<32768 && min<32768)
-                iVersion = (maj << 16) | min, p = ob;
-            }
-        }
-    iVerPos = p;
-    if (iLen>=2 && iName[1]==':')
-        {
-        TUint c = iName[0];
-        if (c!='?' || !(aFlags & EAllowPlaceholder))
-            {
-            c |= 0x20;
-            if (c<'a' || c>'z')
-                {
-                return KErrBadName;
-                }
-            }
-        iPathPos = 2;
-        }
-    TPtrC8 pathp(iName+iPathPos, iVerPos-iPathPos);
-    if (pathp.Locate('[')>=0 || pathp.Locate(']')>=0 || pathp.Locate('{')>=0 || pathp.Locate('}')>=0 || pathp.Locate(':')>=0)
-        {
-        return KErrBadName;
-        }
-    iBasePos = pathp.LocateReverse('\\') + 1 + iPathPos;
-
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------------------------
-
-void TFileNameInfo::GetName(TDes8& aName, TUint aFlags) const
-    {
-    if (aFlags & EIncludeDrive)
-        aName.Append(Drive());
-    if (aFlags & EIncludePath)
-        {
-        if (PathLen() && iName[iPathPos]!='\\')
-            aName.Append('\\');
-        aName.Append(Path());
-        }
-    if (aFlags & EIncludeBase)
-        aName.Append(Base());
-    if ((aFlags & EForceVer) || ((aFlags & EIncludeVer) && VerLen()) )
-        {
-        aName.Append('{');
-        aName.AppendNumFixedWidth(iVersion, EHex, 8);
-        aName.Append('}');        
-        }
-    if ((aFlags & EForceUid) || ((aFlags & EIncludeUid) && UidLen()) )
-        {
-        aName.Append('[');
-        aName.AppendNumFixedWidth(iUid, EHex, 8);
-        aName.Append(']');
-        }
-    if (aFlags & EIncludeExt)
-        aName.Append(Ext());
-    }
-
-// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,354 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <xqconversions.h>
+#include <hbinputdialog.h>
+#include <bautils.h>
+#include <shareuidialog.h>
+#include <eikenv.h>
+#include <hbprogressdialog.h>
+#include <QDebug>
+
+#include "launchermainwindow.h"
+#include "notifications.h"
+#include "enginewrapper.h"
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::EngineWrapper(LauncherMainWindow* mainWindow)
+: mEngine(0), 
+  mMainWindow(mainWindow),
+  mProgressDialog(0),
+  mWaitDialog(0)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::~EngineWrapper()
+{
+    if (mEngine != NULL) {
+        delete mEngine;
+        mEngine = NULL;
+    }
+    if (mProgressDialog != NULL) {
+        delete mProgressDialog;
+        mProgressDialog = NULL;
+    }
+    if (mWaitDialog != NULL) {
+        delete mWaitDialog;
+        mWaitDialog = NULL;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::init()
+{
+    
+    // construct engine
+    TRAPD(error, mEngine = CLauncherEngine::NewL(this));
+    if (error != KErrNone) {
+        return false;
+    }
+    
+    return true;
+   
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::listOfAllApps(QStringList &allAppsQStringList){
+    
+    // Get application CDesCArray list from engine
+    CDesCArray* allAppsCDescArray = 0;
+    TRAPD(error, allAppsCDescArray = mEngine->ListOfAllAppsL());
+    if(error != KErrNone) {
+        return false;
+    }
+        
+    //convert CDesCArray to QStringList
+    for (int i = 0; i < allAppsCDescArray->Count(); i++) {
+        allAppsQStringList.append(QString::fromUtf16(
+                allAppsCDescArray->MdcaPoint(i).Ptr(),
+                allAppsCDescArray->MdcaPoint(i).Length()));
+    }
+    return true;
+}
+
+// ---------------------------------------------------------------------------
+bool EngineWrapper::startAppLaunching(const QModelIndexList &qList, bool autoClose) 
+{
+    
+    // check if used has not selected any files
+    if (qList.size() == 0) {
+        Notifications::showErrorNote("Nothing selected");
+        return false;
+    }
+
+    bool retval(true);
+    CArrayFix<TInt>* pArrayFix = NULL;
+    try{
+        // Create CArrayFix for application numbers that are launched and Qlist into CArrayFix
+        QT_TRAP_THROWING( pArrayFix = QModelIndexListToCArrayFixL(qList) );
+        
+        // Start launching applications
+        QT_TRAP_THROWING(mEngine->StartAppLaunchingL(pArrayFix, autoClose ? ETrue : EFalse));
+    }
+    catch (const std::exception &e){
+        qDebug() << "EngineWrapper::startAppLaunching - exception: " << e.what();
+        retval = false;
+    }
+    
+    if(pArrayFix)
+        delete pArrayFix;
+    
+    return retval;
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::stopLaunching()
+{
+    TRAPD(error, mEngine->StopLaunchingL());
+    if (error != KErrNone) {
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::sendLog()
+{
+    ShareUi dialog;
+    QList<QVariant> fileList;
+
+    if( mEngine->LogFileExists() )
+        {
+        const TDesC& logFilePath = mEngine->LogFilePath();
+        fileList.append( QString::fromUtf16( logFilePath.Ptr(), logFilePath.Length() ) );
+        }
+    if( mEngine->BCLogFileExists() )
+        {
+        const TDesC& BCLogFilePath = mEngine->BCLogFilePath();
+        fileList.append( QString::fromUtf16( BCLogFilePath.Ptr(), BCLogFilePath.Length() ) );
+        }
+    
+    if( !fileList.empty()){
+        dialog.init(fileList,true);   
+        return true;
+    }
+    else{
+        return false;
+    }
+    
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::deleteLog()
+{
+    // if log file exists delete it.
+    if (mEngine->LogFileExists()) {
+        if (mEngine->DeleteLogFile() != KErrNone) {
+            return false;
+        }
+    }
+    
+    //if BC log file exists, delete it.
+    if (mEngine->BCLogFileExists()) {
+        if (mEngine->DeleteBCLogFile() != KErrNone) {
+            return false;
+        }
+    }
+    
+    return true;
+
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::sendListOfDlls()
+{
+    const TDesC& systemDllsFilePath = mEngine->SystemDllsFilePath();
+    
+    if ( BaflUtils::FileExists( CEikonEnv::Static()->FsSession(), systemDllsFilePath) ){
+        ShareUi dialog;
+        QList<QVariant> fileList;
+        fileList.append( QString::fromUtf16( systemDllsFilePath.Ptr(), systemDllsFilePath.Length() ) );
+        dialog.init(fileList,true); 
+        return true;
+    }
+    else{
+        Notifications::showErrorNote("DLL list does not exist");
+        return false;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::doCompareDlls(HbAction* action)
+    {
+    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
+    if(action == dlg->primaryAction())
+        {
+        TFileName fileName( dlg->value().toString().utf16() );
+        TRAPD(error,  mEngine->AnalyseDLLsL( fileName ) );
+        if( error != KErrNone )
+            { 
+            HideWaitDialog();
+            HideProgressBar();
+            Notifications::showErrorNote( QString("Error in analyse: %1").arg( error ) );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::compareDlls()
+{
+    const TDesC& requiredDllsFileName = mEngine->RequiredDllsFilePath();
+    QString fileName = QString::fromUtf16( requiredDllsFileName.Ptr(), requiredDllsFileName.Length() );
+    HbInputDialog::getText( "Select input file for BC analysis:", this, SLOT(doCompareDlls(HbAction*)), fileName );
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::ShowProgressBar(const TDesC& descText, TInt minimum, TInt maximum)
+{
+    QString qStringText = XQConversions::s60DescToQString(descText);
+   
+    if(mProgressDialog){
+        delete mProgressDialog;
+        mProgressDialog = NULL;
+    }
+    mProgressDialog = new HbProgressDialog( HbProgressDialog::ProgressDialog );
+    
+    if( maximum > 0 )
+        mProgressDialog->setRange(minimum, maximum);
+    //iProgressDialog->setAutoClose(true);
+    mProgressDialog->setText(qStringText);
+    connect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(CancelDllBCanalysis()));
+    mProgressDialog->show();
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::SetProgressBarValue(TInt value)
+{
+    if (mProgressDialog && value > 0 ){
+        mProgressDialog->setProgressValue(value);
+    }
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::HideProgressBar()
+{
+    if (mProgressDialog != NULL) {
+        disconnect(mProgressDialog, SIGNAL(cancelled), this, SLOT(CancelDllBCanalysis()));
+        delete mProgressDialog;
+        mProgressDialog = NULL;
+    }
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::CancelDllBCanalysis()
+{
+    mEngine->CancelBCAnalysis();
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::ShowWaitDialog(const TDesC& descText)
+{
+    QString qStringText = XQConversions::s60DescToQString(descText);
+   
+    if(mWaitDialog){
+        delete mWaitDialog;
+        mWaitDialog = NULL;
+    }
+    mWaitDialog = Notifications::showWaitDialog(qStringText);
+}
+
+// ---------------------------------------------------------------------------
+void EngineWrapper::HideWaitDialog()
+{
+    if (mWaitDialog != NULL) {
+        delete mWaitDialog;
+        mWaitDialog = NULL;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::setSkipHiddenAndEmbedOnly(bool skip)
+{
+    if(skip) {
+        mEngine->SetSkipHiddenAndEmbedOnly(ETrue);
+    }
+    else {
+        mEngine->SetSkipHiddenAndEmbedOnly(EFalse);
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ChangeFocusToOutputView()
+{
+    mMainWindow->openOutputView();
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::PrintText(const TDesC& descText)
+{
+    
+    // Convert the descriptor to QString
+    QString qStringText = XQConversions::s60DescToQString(descText);
+    mMainWindow->printText(qStringText);
+}
+
+// ---------------------------------------------------------------------------
+
+CArrayFix<TInt>* EngineWrapper::QModelIndexListToCArrayFixL(const QModelIndexList& qlist)
+{
+    CArrayFix<TInt>* pArrayFix = new (ELeave) CArrayFixFlat<TInt>( qlist.size() );
+    CleanupStack::PushL(pArrayFix);
+    for (int j = 0; j < qlist.size(); j++) {
+        pArrayFix->AppendL(qlist.at(j).row());
+    }
+    CleanupStack::Pop(pArrayFix);
+    return pArrayFix;
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowErrorMessage(const TDesC& descText)
+{
+    QString qStringText = XQConversions::s60DescToQString(descText);
+    Notifications::showErrorNote(qStringText);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowInfoMessage(const TDesC& descText)
+{
+    QString qStringText = XQConversions::s60DescToQString(descText);
+    Notifications::showInformationNote(qStringText);
+}
+
+// End of File
--- a/launcher/src/launcher.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "LauncherApplication.h"
-#include <eikstart.h>
-    
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CLauncherApplication;
-    }
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-
-
-
-
-
-
-
--- a/launcher/src/launcherapplication.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include "LauncherDocument.h"
-#include "LauncherApplication.h"
-
-// local constants
-static const TUid KUidLauncherApp = {0x101FB74F}; 
-
-CApaDocument* CLauncherApplication::CreateDocumentL()
-    {  
-    // Create an Launcher document, and return a pointer to it
-    CApaDocument* document = CLauncherDocument::NewL(*this);
-    return document;
-    }
-
-TUid CLauncherApplication::AppDllUid() const
-    {
-    // Return the UID for the Launcher application
-    return KUidLauncherApp;
-    }
-
--- a/launcher/src/launcherappui.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "LauncherAppUi.h"
-#include "LauncherViewApps.h"
-#include "LauncherViewOutput.h"
-#include <Launcher.rsg>
-#include "launcher.hrh"
-
-#include <avkon.hrh>
-#include <aknnotewrappers.h>
-#include <eikmenup.h>
-#include <aknmessagequerydialog.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CLauncherAppUi::ConstructL()
-// ?implementation_description
-// ----------------------------------------------------------
-//
-void CLauncherAppUi::ConstructL()
-    {
-    BaseConstructL(EAknEnableSkin);
-    #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-    iSendUi = CSendUi::NewL();
-    #endif
-    // Show tabs for main views from resources
-    CEikStatusPane* sp = StatusPane();
-
-    // Fetch pointer to the default navi pane control
-    iNaviPane = (CAknNavigationControlContainer*)sp->ControlL( 
-        TUid::Uid(EEikStatusPaneUidNavi));
-
-    // Tabgroup has been read from resource and it were pushed to the navi pane. 
-    // Get pointer to the navigation decorator with the ResourceDecorator() function. 
-    // Application owns the decorator and it has responsibility to delete the object.
-    iDecoratedTabGroup = iNaviPane->ResourceDecorator();
-    if (iDecoratedTabGroup)
-        {
-        iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
-        }
-
-    // init the engine class
-    iEngine = CLauncherEngine::NewL(this);
-
-    // init the apps view
-    CLauncherViewApps* view1 = new (ELeave) CLauncherViewApps;
-    CleanupStack::PushL( view1 );
-    view1->ConstructL(iEngine);
-    AddViewL( view1 );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // view1
-
-    // init the output view
-    CLauncherViewOutput* view2 = new (ELeave) CLauncherViewOutput;
-    CleanupStack::PushL( view2 );
-    view2->ConstructL(iEngine);
-    AddViewL( view2 );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // view2
-
-    // set apps view as default
-    SetDefaultViewL(*view1);
-
-    }
-
-// ----------------------------------------------------
-// CLauncherAppUi::~CLauncherAppUi()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CLauncherAppUi::~CLauncherAppUi()
-    {
-    delete iEngine;
-
-    delete iDecoratedTabGroup;
-    #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-    delete iSendUi;
-    #endif
-    }
-
-// ------------------------------------------------------------------------------
-// CLauncherAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ------------------------------------------------------------------------------
-//
-void CLauncherAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_LAUNCHER_APP_MENU)
-        {
-        // launch stop check
-        aMenuPane->SetItemDimmed(ECmdStopLaunch, !iEngine->LaunchingIsActive());
-
-        // deleting log is possible only when the log exists
-        aMenuPane->SetItemDimmed(ECmdDeleteLog, !(iEngine->LogFileExists() || iEngine->BCLogFileExists()));
-
-        // SendUI for the log file
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-        if (iEngine->LogFileExists() || iEngine->BCLogFileExists())
-            {
-            TInt index(0);
-            aMenuPane->ItemAndPos( ECmdDeleteLog, index );
-            iSendUi->AddSendMenuItemL(*aMenuPane, index-1, ECmdSendUILogFile, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments));
-            aMenuPane->SetItemTextL(ECmdSendUILogFile, _L("Send log(s)"));
-            }
-#endif
-        }
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-    else if (aResourceId == R_LAUNCHER_DLLINFO_SUBMENU)
-        {
-        //SendUI for the system dll file
-        TInt index(0);
-        aMenuPane->ItemAndPos( ECmdCompareDLLs, index );
-
-        iSendUi->AddSendMenuItemL(*aMenuPane, index, ECmdSendUISystemDllFile, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments));
-        aMenuPane->SetItemTextL(ECmdSendUISystemDllFile, _L("Send list of DLLs"));
-        aMenuPane->SetItemButtonState(ECmdSendUISystemDllFile, EEikMenuItemSymbolIndeterminate); 
-        }
-#endif
-    }
-
-// ----------------------------------------------------
-// CLauncherAppUi::HandleKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-// ----------------------------------------------------
-//
-TKeyResponse CLauncherAppUi::HandleKeyEventL(
-    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-    {
-    if ( iTabGroup == NULL )
-        {
-        return EKeyWasNotConsumed;
-        }
-
-    TInt active = iTabGroup->ActiveTabIndex();
-    TInt count = iTabGroup->TabCount();
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-            if ( active > 0 )
-                {
-                active--;
-                iTabGroup->SetActiveTabByIndex( active );
-                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
-                }
-            break;
-        case EKeyRightArrow:
-            if( (active + 1) < count )
-                {
-                active++;
-                iTabGroup->SetActiveTabByIndex( active );
-                ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
-                }
-            break;
-        default:
-            return EKeyWasNotConsumed;
-        }
-
-    return EKeyWasConsumed;
-    }
-
-// ----------------------------------------------------
-// CLauncherAppUi::HandleCommandL(TInt aCommand)
-// ----------------------------------------------------
-//
-void CLauncherAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch ( aCommand )
-        {
-        case EEikCmdExit:
-        case EAknSoftkeyExit:
-            {
-            Exit();
-            break;
-            }
-        case ECmdDeleteLog:
-            {
-            TInt ret = KErrNone;
-            
-            if( iEngine->LogFileExists())
-                {
-                ret = iEngine->DeleteLogFile();
-                }
-            if (ret == KErrNone)                
-                {
-                if( iEngine->BCLogFileExists())
-                    {
-                    ret = iEngine->DeleteBCLogFile();
-                    }
-                }            
-            if( ret == KErrNone )
-                {
-                _LIT(KMessage, "Log file(s) deleted");
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote;
-                note->ExecuteLD(KMessage);
-                }
-            else
-                {
-                _LIT(KMessage, "Unable to delete");
-                CAknErrorNote* note = new(ELeave) CAknErrorNote;
-                note->ExecuteLD(KMessage);
-                }
-            break;
-            }        
-        case ECmdCompareDLLs:
-            {
-            iEngine->AnalyseDLLsL();
-            break;
-            }
-
-        case ECmdAbout:
-            {
-	        CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-            dialog->ExecuteLD(R_LAUNCHER_ABOUT_DIALOG);
-
-            break;
-            }
-
-        case ECmdStopLaunch:
-            {
-            iEngine->StopLaunchingL();
-            break;
-            }
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-        case ECmdSendUILogFile:
-            {
-            iEngine->SendLogViaSendUiL(iSendUi);
-            break;
-            }
-
-        case ECmdSendUISystemDllFile:
-            {
-            iEngine->SendListOfSystemDllsViaSendUiL(iSendUi);
-            break;
-            }
-#endif
-        case EAknSoftkeyCancel:
-            {
-            iEngine->Cancel();
-            break;
-            }
-        default:
-            {
-            }
-            break;      
-        }
-    }
-
-// End of File  
--- a/launcher/src/launchercontainerapps.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "LauncherContainerApps.h"
-#include "LauncherEngine.h"
-
-
-#include <eikclb.h>
-#include <eikclbd.h>
-#include <aknconsts.h>
-#include <aknutils.h>
-#include <aknnotewrappers.h>
-#include <akniconarray.h> 
-#include <f32file.h>
-#include <avkon.mbg>
-#include <AknIconUtils.h>
-#include <akndef.h>
-
-
-_LIT(KTab,"\t");
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::ConstructL(const TRect& aRect)
-// EPOC two phased constructor
-// ---------------------------------------------------------
-//
-void CLauncherContainerApps::ConstructL(const TRect& aRect, CLauncherEngine* aEngine)
-    {
-    iEngine = aEngine;
-
-    CreateWindowL();
-    Window().SetShadowDisabled(EFalse);
-    SetRect(aRect);
-
-    iListBox = new(ELeave) CAknSingleStyleListBox;
-    iListBox->SetContainerWindowL(*this);
-    iListBox->ConstructL(this, EAknListBoxMarkableList);
-    iListBox->View()->SetListEmptyTextL(_L("No apps found"));
-
-    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-
-    CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
-    CleanupStack::PushL(iconArray);
-    CFbsBitmap* markBitmap = NULL;
-    CFbsBitmap* markBitmapMask = NULL;
-    
-    TRgb defaultColor;
-    defaultColor = CEikonEnv::Static()->Color(EColorControlText);
-
-    AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
-            KAknsIIDQgnIndiMarkedAdd,
-            KAknsIIDQsnIconColors,
-            EAknsCIQsnIconColorsCG13,
-            markBitmap,
-            markBitmapMask,
-            AknIconUtils::AvkonIconFileName(),
-            EMbmAvkonQgn_indi_marked_add,
-            EMbmAvkonQgn_indi_marked_add_mask,
-            defaultColor
-            );
-     
-    CGulIcon* markIcon = CGulIcon::NewL(markBitmap,markBitmapMask);
-    iconArray->AppendL(markIcon);                       
-    CleanupStack::Pop(); // iconArray
-
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
-
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-    
-    // set size of the listbox
-    TSize outputRectSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-    TRect outputRect(outputRectSize);
-    iListBox->SetRect(outputRect);
-
-
-    iListBox->ActivateL();
-   
-    //ActivateL();  
-    }
-
-// Destructor
-CLauncherContainerApps::~CLauncherContainerApps()
-    {
-    delete iListBox;
-    iListBox = NULL;
-    }
-
-// ---------------------------------------------------------
-
-const CArrayFix<TInt>* CLauncherContainerApps::SelectedApps()
-    {
-    const CListBoxView::CSelectionIndexArray* indices = iListBox->SelectionIndexes();
-    
-    return static_cast<const CArrayFix<TInt>*>(indices);
-    }
-
-// ---------------------------------------------------------
-
-void CLauncherContainerApps::UpdateFileListL()
-    {
-    // get list of all apps from the engine
-	CDesCArray* appFullPathsArray = iEngine->ListOfAllAppsL();
-		
-    // get an instance of the listbox's item array
-	MDesCArray* tempArray = iListBox->Model()->ItemTextArray();
-	CDesCArray* listBoxArray = (CDesCArray*)tempArray;
-	listBoxArray->Reset();
-
-	for ( TInt i=0; i<appFullPathsArray->Count(); i++)
-	    {
-        // parse the filename
-        TParse nameParser;
-        TInt err = nameParser.SetNoWild((*appFullPathsArray)[i], NULL, NULL);
-        
-        if (!err)
-		    {
-            TFileName name;
-            name.Copy(KTab);
-            name.Append(nameParser.Drive());
-            name.Append(nameParser.NameAndExt());
-            name.Append(KTab);
-            name.Append(KTab);
-
-		    listBoxArray->AppendL( name );
-            }
-        else
-            {
-		    listBoxArray->AppendL( _L("\t*invalid file*\t\t") );
-            }
-        }
-
-    // updates the listbox
-    iListBox->HandleItemAdditionL();
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::SizeChanged()
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-//
-void CLauncherContainerApps::SizeChanged()
-{
-    TSize outputRectSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-    TRect outputRect(outputRectSize);
-    
-    if (iListBox)
-        iListBox->SetRect(outputRect);
-}
-
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::CountComponentControls() const
-// ---------------------------------------------------------
-//
-TInt CLauncherContainerApps::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::ComponentControl(TInt aIndex) const
-// ---------------------------------------------------------
-//
-CCoeControl* CLauncherContainerApps::ComponentControl(TInt /*aIndex*/) const
-    {
-    return iListBox;
-    }
-
-// ---------------------------------------------------------
-// CBCAppMainContainer::Draw(const TRect& aRect) const
-// ---------------------------------------------------------
-//
-void CLauncherContainerApps::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.Clear(aRect);
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::HandleControlEventL(
-//     CCoeControl* aControl,TCoeEvent aEventType)
-// ---------------------------------------------------------
-//
-void CLauncherContainerApps::HandleControlEventL(
-    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    }
-
-
-// ---------------------------------------------------------
-// CLauncherContainerApps::OfferKeyEventL(const TKeyEvent& aKeyEvent,
-//                                    TEventCode aType)
-// Handle key event. Only up and down key arrow events are
-// consumed in order to enable scrolling in output window.
-// ---------------------------------------------------------
-//
-TKeyResponse CLauncherContainerApps::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-
-    // handle OK key
-    if (aKeyEvent.iCode == EKeyOK)
-        {
-        if (iListBox->View()->ItemIsSelected(iListBox->CurrentItemIndex()))
-            {
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iListBox );
-            }
-        else
-            {
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iListBox );
-            }
-
-        return EKeyWasNotConsumed;
-        }
-    
-    // left and right keys are needed by other class
-    else if (aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow)
-        return EKeyWasNotConsumed;
-
-    else
-        return iListBox->OfferKeyEventL(aKeyEvent, aType);
-    }
-
-// ---------------------------------------------------------
-
-void CLauncherContainerApps::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            {
-            if (iListBox->View()->ItemIsSelected(iListBox->CurrentItemIndex()))
-                {
-                AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdUnmark, iListBox );
-                }
-            else
-                {
-                AknSelectionService::HandleMarkableListProcessCommandL( EAknCmdMark, iListBox );
-                }            
-            }
-            break;
-        default:
-            break;
-        }
-    }
-    
-// ---------------------------------------------------------
-//
-
-void CLauncherContainerApps::HandleResourceChange(TInt aType)
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-
-        TSize outputRectSize;
-        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-        TRect outputRect(outputRectSize);
-        iListBox->SetRect(outputRect);
-        }
-    else
-        {
-        CCoeControl::HandleResourceChange(aType);
-        }
-    }
-
-
-// End of File  
--- a/launcher/src/launchercontaineroutput.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "LauncherContainerOutput.h"
-#include "LauncherEngine.h"
-
-
-#include <AknBidiTextUtils.h>
-#include <aknutils.h>
-#include <aknnotewrappers.h>
-#include <eiksbfrm.h>
-#include <akndef.h>
-
-const TUint KLeftMargin = 2;
-const TUint KRightMargin = 2;
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-
-void CLauncherContainerOutput::ConstructL(const TRect& aRect, CLauncherEngine* aEngine)
-    {
-    iEngine = aEngine;
-
-    CreateWindowL();
-    Window().SetShadowDisabled(EFalse);
-    
-    SetBlank();
-
-    iText = HBufC::NewL(200000);
-    iCurrentLine = 0;
-    iLineCount = 0;
-    iNumberOfLinesFitsScreen = 0;
-    iX_factor = 1;
-    iY_factor = 1;
-    iLeftDrawingPosition = KLeftMargin;
-
-    iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
-
-    iWrappedArray = new(ELeave) CArrayFixFlat<TPtrC>(500);
-
-    
-    SetRect(aRect);
-    //ActivateL(); 
-
-
-    PrintTextL(_L("Ready.\n\n"));
-
-    }
-
-CLauncherContainerOutput::~CLauncherContainerOutput()
-    {
-    if (iWrappedArray)
-        {
-        iWrappedArray->Reset();
-        delete iWrappedArray;
-        }
-
-    if (iText)
-        delete iText;
-
-    if (iScrollBarFrame)
-        delete iScrollBarFrame;
-
-    if (iWrapperString)
-        delete iWrapperString;
-    }
-
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::UpdateVisualContentL()
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::UpdateVisualContentL(TBool aScrollToBottom, TBool aScrollToTop)
-    {
-    TSize rectSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, rectSize);
-    TRect rect(rectSize);
-
-    // init scroll bar if not yet done
-    if (!iScrollBarFrame)
-        {
-        iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, this, ETrue);
-
-        CAknAppUi* appUi = iAvkonAppUi;
-        
-	    if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
-	        {
-		    iScrollBarFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse);            
-		    iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
-	        }
-	    else
-	        {
-		    iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
-	        }  
-	    iScrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-        }
-
-    // drawing positions, needed for scalable ui
-    iX_factor = TReal(rect.Width()) / 176;
-    iY_factor = TReal(rect.Height()) / 144;
-
-    iWrappedArray->Reset();
-
-    if (iWrapperString)
-        {
-        delete iWrapperString;
-        iWrapperString = NULL;
-        }
-
-    // define drawing width, some extra space needed if using double span scrolling bar
-    TUint drawingWidth(0);
-    if (iScrollBarFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
-        {
-        if (AknLayoutUtils::LayoutMirrored())  // scroll bar on 'left'
-            {
-            iLeftDrawingPosition = KLeftMargin + 12;
-            drawingWidth = TInt( rect.Width() - iLeftDrawingPosition*iX_factor - (KRightMargin*iX_factor)); 
-            }
-        else // scroll bar on 'right'
-            {
-            iLeftDrawingPosition = KLeftMargin;  
-            drawingWidth = TInt( rect.Width() - iLeftDrawingPosition*iX_factor - (KRightMargin*iX_factor + 7*iX_factor)); 
-            }        
-        }
-    else
-        drawingWidth = TInt( rect.Width() - KLeftMargin*iX_factor - KRightMargin*iX_factor);
-
-    // wrap the text
-    iWrapperString = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
-        iText->Des(),
-        drawingWidth,
-        *iFont,
-        *iWrappedArray
-        );
-    
-    iLineCount = iWrappedArray->Count();
-
-    // count amount of lines fits to screen
-    iNumberOfLinesFitsScreen = TInt(rect.Height() / (iFont->HeightInPixels()));
-
-    // check if needed to scroll to the bottom
-    if (aScrollToBottom )
-        {
-        if( iCurrentLine < iLineCount - iNumberOfLinesFitsScreen)
-            {
-            iCurrentLine = iLineCount-iNumberOfLinesFitsScreen;
-            }
-        }
-    else if( aScrollToTop )
-        {
-        iCurrentLine = 0;
-        }
-
-    // update the scroll bars
-	TEikScrollBarModel horizontalBar;
-    TEikScrollBarModel verticalBar;
-    verticalBar.iThumbPosition = iCurrentLine;
-    verticalBar.iScrollSpan = iLineCount - iNumberOfLinesFitsScreen + 1;
-    verticalBar.iThumbSpan = 1;
-
-    TEikScrollBarFrameLayout layout;
-	layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
-
-    if (iScrollBarFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
-        {    
-        // do not let scrollbar values overflow
-        if (verticalBar.iThumbPosition + verticalBar.iThumbSpan > verticalBar.iScrollSpan)
-            verticalBar.iThumbPosition = verticalBar.iScrollSpan - verticalBar.iThumbSpan;
-		
-        TAknDoubleSpanScrollBarModel horizontalDSBar(horizontalBar);
-        TAknDoubleSpanScrollBarModel verticalDSBar(verticalBar);
-       
-        iScrollBarFrame->TileL(&horizontalDSBar, &verticalDSBar, rect, rect, layout);        
-        iScrollBarFrame->SetVFocusPosToThumbPos(verticalDSBar.FocusPosition());
-	    }  
-	else
-	    {
-		iScrollBarFrame->TileL( &horizontalBar, &verticalBar, rect, rect, layout );
-		iScrollBarFrame->SetVFocusPosToThumbPos( verticalBar.iThumbPosition );
-	    }
-
-
-    // update the screen
-    DrawNow();
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::Draw(const TRect& aRect) const
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.Clear(aRect);
-    gc.SetPenColor(KRgbBlack);
-    gc.UseFont(iFont);
-
-    // draw the text
-    for (TInt i=0; i<iNumberOfLinesFitsScreen; i++)
-        {
-        // index out of bounds check and then draw text
-        if (i+iCurrentLine < iWrappedArray->Count())
-            gc.DrawText(iWrappedArray->At(i+iCurrentLine), TPoint(TInt(iLeftDrawingPosition*iX_factor), TInt(iFont->HeightInPixels()*(i+1))));
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::HandleControlEventL(
-//     CCoeControl* aControl,TCoeEvent aEventType)
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::HandleControlEventL(
-    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::PrintTextL(const TDesC& aDes)
-// Print text into output window.
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::PrintTextL(const TDesC& aDes)
-    {
-    iText->Des().Append( aDes );
-    UpdateVisualContentL(ETrue);
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::OfferKeyEventL(const TKeyEvent& aKeyEvent,
-//                                    TEventCode aType)
-// Handle key event. Only up and down key arrow events are
-// consumed in order to enable scrolling in output window.
-// ---------------------------------------------------------
-//
-TKeyResponse CLauncherContainerOutput::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-    
-    if(aKeyEvent.iCode == EKeyUpArrow)
-        {
-        if (iCurrentLine > 0)
-            {
-            iCurrentLine--;
-            UpdateVisualContentL(EFalse);
-            }
-
-        return EKeyWasConsumed;
-        }
-    
-    else if(aKeyEvent.iCode == EKeyDownArrow)
-        {
-        if (iCurrentLine < iLineCount - iNumberOfLinesFitsScreen)
-            {
-            iCurrentLine++;
-            UpdateVisualContentL(EFalse);
-            }
-
-        return EKeyWasConsumed;
-        }
-    
-    return EKeyWasNotConsumed;
-    }
-
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::ClearOutputWindowL()
-// Clear the output window.
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::ClearOutputWindowL()
-    {
-    iText->Des() = _L("");
-    UpdateVisualContentL(EFalse, ETrue);
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::HandleResourceChange(TInt aType)
-// Handle layout change of the screen
-// ---------------------------------------------------------
-//
-
-void CLauncherContainerOutput::HandleResourceChange(TInt aType)
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-
-        iCurrentLine = 0; // scroll to top
-
-        // update font
-        iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
-
-        // delete the scroll and update screen
-        if (iScrollBarFrame)
-            {
-            delete iScrollBarFrame;
-            iScrollBarFrame = NULL;
-            }
-        TRAP_IGNORE(UpdateVisualContentL(EFalse));
-        }
-    else
-        {
-        CCoeControl::HandleResourceChange(aType);
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherContainerOutput::HandleScrollEventL()
-// Capture touch events on the scroll bar
-// ---------------------------------------------------------
-//
-void CLauncherContainerOutput::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
-    {
-    // only on page up/down,scroll up/down and drag events
-    if ((aEventType == EEikScrollPageDown) || (aEventType == EEikScrollPageUp) || 
-       (aEventType == EEikScrollThumbDragVert) || (aEventType == EEikScrollUp) ||
-       (aEventType == EEikScrollDown))
-        {
-        // get the current position from the scroll bar
-        iCurrentLine = aScrollBar->ThumbPosition();
-        
-        // refresh now
-        UpdateVisualContentL(EFalse);
-        }
-    }
-
-
-// End of File  
--- a/launcher/src/launcherdllelement.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include "launcherdllelement.h"
-#include "launchertraces.h"
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLElement::~CLauncherDLLElement()
-    {
-    LOGSTRING("Launcher: CLauncherDLLElement::~CLauncherDLLElement");    
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLElement::CLauncherDLLElement()
-    {    
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLElement* CLauncherDLLElement::NewL()
-    {
-    LOGSTRING("Launcher: CLauncherDLLElement::NewL");
-    CLauncherDLLElement* self = CLauncherDLLElement::NewLC();    
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLElement* CLauncherDLLElement::NewLC()
-    {
-    LOGSTRING("Launcher: CLauncherDLLElement::NewLC");
-    CLauncherDLLElement* self = new (ELeave) CLauncherDLLElement;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::ConstructL()
-    {
-    
-    }
-
-// ---------------------------------------------------------------------------
-   
-TBool CLauncherDLLElement::CompareL(const CLauncherDLLElement& aReferenceElement, RArray<TDifference>& aDifferenceList) const
-    {
-    LOGSTRING2("Launcher: CLauncherDLLElement::CompareL - DLLName: %S", &iName);
-    if( iName != aReferenceElement.Name())
-        {
-        LOGSTRING("Launcher: CLauncherDLLElement::CompareL: ERROR - DLL names don't match.");
-        User::Leave(KErrArgument);
-        }
-    
-    TBool diff = EFalse;
-            
-    if( iUID1 != aReferenceElement.UID1()) 
-        {
-        diff = ETrue;
-        aDifferenceList.Append(this->EDifference_UID1);      
-        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID1s differs: %x vs. %x", iUID1, aReferenceElement.UID1());  
-        }
-    if( iUID2!= aReferenceElement.UID2()) 
-        {
-        diff = ETrue;
-        aDifferenceList.Append(this->EDifference_UID2);        
-        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID2s differs: %x vs. %x", iUID2, aReferenceElement.UID2());  
-        }
-    if( iUID3 != aReferenceElement.UID3()) 
-        {
-        diff = ETrue;
-        aDifferenceList.Append(this->EDifference_UID3);        
-        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - UID3s differs: %x vs. %x", iUID3, aReferenceElement.UID3());  
-        }
-    if( iSID != aReferenceElement.SID()) 
-        {
-        diff = ETrue;
-        aDifferenceList.Append(this->EDifference_SID);        
-        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - SIDs differs: %x vs. %x", iSID, aReferenceElement.SID());  
-        }
-    if( iCapability != aReferenceElement.Capability()) 
-        {
-        diff = ETrue;
-        aDifferenceList.Append(this->EDifference_Capability);        
-        LOGSTRING3("Launcher: CLauncherDLLElement::CompareL - Capabilities differs: %x vs. %x", iCapability, aReferenceElement.Capability());  
-        }
-    
-    return diff;
-    }
-
-// ---------------------------------------------------------------------------
-
-TFileName CLauncherDLLElement::Name() const
-    {
-    return iName;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetNameL(const TFileName& aName)
-    {    
-    iName.Copy(aName); 
-    }
-
-// ---------------------------------------------------------------------------
-
-TUid CLauncherDLLElement::UID1() const
-    {
-    return iUID1;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetUID1L(TUid aUID1)
-    {
-    iUID1.iUid = aUID1.iUid;
-    }
-
-// ---------------------------------------------------------------------------
-
-TUid CLauncherDLLElement::UID2() const
-    {
-    return iUID2;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetUID2L(TUid aUID2)
-    {    
-    iUID2 = aUID2;
-    }
-
-// ---------------------------------------------------------------------------
-
-TUid CLauncherDLLElement::UID3() const
-    {    
-    return iUID3;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetUID3L(TUid aUID3)
-    {    
-    iUID3 = aUID3;
-    }
-
-// ---------------------------------------------------------------------------
-
-TUid CLauncherDLLElement::SID() const
-    {   
-    return iSID;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetSIDL(TUid aSID)
-    {    
-    iSID = aSID;
-    }
-
-// ---------------------------------------------------------------------------
-
-TUint32 CLauncherDLLElement::Capability() const
-    {
-    return iCapability;    
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLElement::SetCapabilityL(TUint32 aCapability)
-    {
-    iCapability = aCapability; 
-    }
--- a/launcher/src/launcherdllparser.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include "launcherdllparser.h"
-#include "launchertraces.h"
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLParser::~CLauncherDLLParser()
-    {
-    LOGSTRING("Launcher: CLauncherDLLParser::~CLauncherDLLParser");
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLParser::CLauncherDLLParser()
-    {
-    LOGSTRING("Launcher: CLauncherDLLParser::CLauncherDLLParser");
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLParser* CLauncherDLLParser::NewL()
-    {
-    LOGSTRING("Launcher: CLauncherDLLParser::NewL");
-    CLauncherDLLParser* self = CLauncherDLLParser::NewLC();    
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherDLLParser* CLauncherDLLParser::NewLC()
-    {
-    LOGSTRING("Launcher: CLauncherDLLParser::NewLC");
-    CLauncherDLLParser* self = new (ELeave) CLauncherDLLParser;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLParser::ConstructL()
-    {
-    
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherDLLParser::ParseL( RFs& aFileSession, RFile& aFile, CLauncherDLLElement& aElement )
-    {
-    TFileName dllName;
-    TFileName fullName;
-    TUid tmpUID;
-    TInt offset = 0;
-        
-    aFile.Name(dllName);
-    aFile.FullName(fullName);
-    aElement.SetNameL(dllName);
-    
-    TBool isFileInRom = aFileSession.IsFileInRom(fullName) != 0;
-    
-    /**
-     * Read UID1
-     */
-    offset = UID1_OFFSET;
-    aFile.Seek(ESeekStart, offset); // Set file position   
-    tmpUID.iUid = ReadUint32L(aFile);    
-    aElement.SetUID1L(tmpUID);    
-    
-    /**
-     * Read UID2
-     */
-    offset = UID2_OFFSET;
-    aFile.Seek(ESeekStart, offset); // Set file position
-    tmpUID.iUid = ReadUint32L(aFile);    
-    aElement.SetUID2L(tmpUID);
-        
-    /**
-     * Read UID3
-     */
-    offset = UID3_OFFSET;
-    aFile.Seek(ESeekStart, offset); // Set file position
-    tmpUID.iUid = ReadUint32L(aFile);    
-    aElement.SetUID3L(tmpUID);
-        
-    /**
-     * Read SID
-     */
-    if( isFileInRom )
-        offset = SID_OFFSET_ROM;
-    else
-        offset = SID_OFFSET_ROFS;
-    aFile.Seek(ESeekStart, offset); // Set file position
-    tmpUID.iUid = ReadUint32L(aFile);    
-    aElement.SetSIDL(tmpUID);
-    
-    /**
-     * Read Capability
-     */
-    if( isFileInRom )
-        offset = CAPABILITY_OFFSET_ROM;
-    else
-        offset = CAPABILITY_OFFSET_ROFS;
-    aFile.Seek(ESeekStart, offset); // Set file position
-    TUint32 tmpVal = ReadUint32L(aFile);
-    aElement.SetCapabilityL(tmpVal);    
-    }
-
-// ---------------------------------------------------------------------------
-
-TUint32 CLauncherDLLParser::ReadUint32L( RFile& aFile )
-    {
-    TBuf8<4> tempBuf;    
-    User::LeaveIfError(aFile.Read(tempBuf, 4));
-    const TUint8* ptr = tempBuf.Ptr();    
-    return TUint32(ptr[0] | (ptr[1]<<8) | (ptr[2]<<16) | (ptr[3]<<24));    
-    }
--- a/launcher/src/launcherdocument.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include "LauncherAppUi.h"
-#include "LauncherDocument.h"
-
-
-// Standard Symbian OS construction sequence
-CLauncherDocument* CLauncherDocument::NewL(CEikApplication& aApp)
-    {
-    CLauncherDocument* self = NewLC(aApp);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CLauncherDocument* CLauncherDocument::NewLC(CEikApplication& aApp)
-    {
-    CLauncherDocument* self = new (ELeave) CLauncherDocument(aApp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-void CLauncherDocument::ConstructL()
-    {
-    // Add any construction that can leave here
-    }    
-
-CLauncherDocument::CLauncherDocument(CEikApplication& aApp) : CAknDocument(aApp) 
-    {
-    // Add any construction that can not leave here
-    }   
-
-CLauncherDocument::~CLauncherDocument()
-    {
-    // Any destruction code here
-    }
-
-CEikAppUi* CLauncherDocument::CreateAppUiL()
-    {
-    // Create the application user interface, and return a pointer to it
-    CEikAppUi* appUi = new (ELeave) CLauncherAppUi;
-    return appUi;
-    }
-
--- a/launcher/src/launcherengine.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1800 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include <aknnotewrappers.h>
-#include <avkon.hrh>
-#include <aknwaitdialog.h>
-#include <aknglobalnote.h>
-#include <coeutils.h> 
-#include <akncommondialogs.h>
-#include <eikprogi.h>
-
-#include <LAUNCHER.rsg>
-
-#include "LauncherAppUi.h"
-#include "LauncherEngine.h"
-#include "Launcher.hrh"
-#include "LauncherViewApps.h"
-#include "LauncherViewOutput.h"
-#include "LauncherContainerApps.h"
-#include "LauncherContainerOutput.h"
-#include "launcherdllparser.h"
-#include "launcherxmlparser.h"
-
-#include <CMessageData.h>
-#include <e32std.h>
-#include <w32std.h>
-#include <apgtask.h>
-#include <bautils.h>
-#include <s32file.h>
-#include <pathinfo.h> 
-#include <e32cmn.h>
-
-#include "LauncherTraces.h"
-#include "E32Image.h"
-
-_LIT(KLogFileName, "LauncherLog.txt");
-_LIT(KBCLogFileName, "LauncherBCLog.txt");
-_LIT(KSystemDllsFileName, "SystemDlls.txt");
-_LIT(KRequiredDllsFileName, "RequiredDlls.xml");
-_LIT(KDotXML,".xml");
-_LIT(KDotLauncherXML,".launcherxml");
-
-_LIT(KFileSeparator, "\t");
-_LIT(KFileNewLine, "\r\n");
-
-const TInt KMaxAppsArraySize=250;
-const TInt KMaxDllArraySize=5000;
-const TInt KLauncherLogBufferSize = 4096;
-
-// After this many issues, issues are buffered and printed 
-// in the end of analysis
-const TInt KBigBufferUsageThreshold=10;
-
-// Buffer allocation unit
-const TInt KBigBufferAllocBytes=1024;
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine* CLauncherEngine::NewL(CLauncherAppUi* aAppUi)
-    {
-    CLauncherEngine* self = new(ELeave) CLauncherEngine;
-    CleanupStack::PushL(self);
-    self->ConstructL(aAppUi);
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine::CLauncherEngine() : CActive(EActivePriorityIpcEventsHigh)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-template <typename T>
-void AppendLogBufferL(const T& aText, HBufC8*& aBuf)
-    {
-    if( aBuf == 0 )
-        {
-        aBuf = HBufC8::NewL(KLauncherLogBufferSize);
-        }
-    
-    TInt currentMaxLength = aBuf->Des().MaxLength();
-    if( aBuf->Des().Length() + aText.Length() > currentMaxLength )
-        {
-        TInt increaseSize = Max(aText.Length(), KLauncherLogBufferSize);                
-        aBuf = aBuf->ReAllocL(aBuf->Des().MaxLength() + increaseSize );
-        }
-    aBuf->Des().Append(aText);        
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::ConstructL(CLauncherAppUi* aAppUi)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::ConstructL");
-
-    iAppUi = aAppUi;
-    iEnv = CEikonEnv::Static();
-    iLaunchingIsActive = EFalse;
-    iDLLAnalysisIsActive = EFalse;
-    iSkipHiddenAndEmbedOnly = ETrue;
-
-    User::LeaveIfError(iTimer.CreateLocal());
-
-    User::LeaveIfError(iLs.Connect());
-    User::LeaveIfError(iWs.Connect());
-
-    iAppThreadChecker = CAppThreadChecker::NewL(this);
-    iAppRunningChecker = CAppRunningChecker::NewL(this);
-
-    iAllAppsArray = new(ELeave) CDesCArrayFlat(KMaxAppsArraySize);
-    iAppsArray = new(ELeave) CDesCArrayFlat(KMaxAppsArraySize);
-    iSystemDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
-
-    iLogWriteBuf = HBufC8::NewL(KLauncherLogBufferSize);
-
-    iLogFilePath = PathInfo::PhoneMemoryRootPath();
-    iLogFilePath.Append( KLogFileName );
-    
-    iBCLogFilePath = PathInfo::PhoneMemoryRootPath();
-    iBCLogFilePath.Append( KBCLogFileName );
-
-    iSystemDllsFilePath = PathInfo::PhoneMemoryRootPath();
-    iSystemDllsFilePath.Append( KSystemDllsFileName );
-
-    iRequiredDllsFilePath = PathInfo::PhoneMemoryRootPath();
-    iRequiredDllsFilePath.Append( KRequiredDllsFileName );
-            
-    iDLLParser = CLauncherDLLParser::NewL();
-
-    CActiveScheduler::Add(this);
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine::~CLauncherEngine()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::~CLauncherEngine");
-
-    Cancel();
-
-    // close the log
-    iLogFile.Close();
-    iBCLogFile.Close();
-    if (iLogWriteBuf)
-        delete iLogWriteBuf;
-
-    if (iAppRunningChecker)
-        delete iAppRunningChecker;
-    
-    if (iAppThreadChecker)
-        delete iAppThreadChecker;
-
-    if (iSystemDllArray)
-        {
-        iSystemDllArray->Reset();
-        delete iSystemDllArray;
-        }
-
-    if (iAppsArray)
-        {
-        iAppsArray->Reset();
-        delete iAppsArray;
-        }
-
-    if (iAllAppsArray)
-        {
-        iAllAppsArray->Reset();
-        delete iAllAppsArray;
-        }
-    
-    delete iXMLParser;
-    delete iDLLParser;
-    delete iDLLElement;
-    delete iBCIssuesBigBuffer;            
-    
-    iWs.Close();
-    iLs.Close();
-    iTimer.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::SetContainerApps(CLauncherContainerApps* aContainerApps)
-    {
-    iContainerApps = aContainerApps;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::SetContainerOutput(CLauncherContainerOutput* aContainerOutput)
-    {
-    iContainerOutput = aContainerOutput;
-    }
-
-// ---------------------------------------------------------------------------
-
-
-TInt CLauncherEngine::FindFilesRecursiveL(const TDesC& aFileName, const TDesC& aPath)
-    {
-    TInt err = KErrNone;
-    CDirScan* scan = CDirScan::NewLC(iEnv->FsSession());
-    scan->SetScanDataL(aPath, KEntryAttDir, ESortNone);
-    CDir* dirEntries = NULL;
-
-    for(;;)
-        {
-        TRAP(err, scan->NextL(dirEntries));
-        if (!dirEntries  || (err!=KErrNone))
-            break;
-
-        for (TInt i=0; i<dirEntries->Count(); i++) 
-            {
-            TFileName path(scan->FullPath());
-            path.Append((*dirEntries)[i].iName);
-            path.Append(_L("\\"));
-            FindFiles(aFileName, path);
-            }
-        delete(dirEntries);
-        }
-
-    CleanupStack::PopAndDestroy(scan);
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CLauncherEngine::FindFiles(const TDesC& aFileName, const TDesC& aPath)
-    {
-    TFindFile fileFinder(iEnv->FsSession());
-    CDir* fileList; 
-    TInt err = fileFinder.FindWildByDir(aFileName, aPath, fileList);
-
-    while (err == KErrNone)
-        {
-        for (TInt i=0; i<fileList->Count(); i++)
-            {
-            TParse fullentry;
-            fullentry.Set((*fileList)[i].iName, &fileFinder.File(), NULL);
-
-            TRAP(err, iSystemDllArray->AppendL(fullentry.NameAndExt())); 
-            }
-
-        delete fileList;
-        err = fileFinder.FindWild(fileList);
-        }
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-
-CDesCArray* CLauncherEngine::ListOfAllAppsL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::ListOfAllAppsL");
-
-    // show wait dialog
-    CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-    waitDialog->SetSoftkeys(R_AVKON_SOFTKEYS_EMPTY);
-    TInt dialogId = waitDialog->ShowNoteL(EAknGlobalWaitNote, _L("Initializing"));
-
-
-    // find all DLLs from the system
-    iSystemDllArray->Reset();
-    TRAP_IGNORE( FindFiles(_L("*.dll"), _L("\\sys\\bin\\")) );
-
-    // write the list of DLLs to a file
-    RFile dllFile;
-    if (dllFile.Replace(iEnv->FsSession(), iSystemDllsFilePath, EFileWrite) == KErrNone)
-        {
-        TBuf8<KMaxFileName> dllName;
-
-        for (TInt i=0; i<iSystemDllArray->MdcaCount(); i++)
-            {
-            dllName.Copy( iSystemDllArray->MdcaPoint(i) );
-            dllName.Append( KFileNewLine );
-
-            dllFile.Write( dllName );
-            }
-
-        dllFile.Close();
-        }
-
-    // reset the apps list
-    iAllAppsArray->Reset();
-
-    // search all apps
-    TApaAppInfo appInfo;
-    iLs.GetAllApps();
-
-    while (iLs.GetNextApp(appInfo) == KErrNone)
-        {
-        iAllAppsArray->AppendL(appInfo.iFullName);
-        }
-
-
-    // remove launcher.app / launcher.exe from the list
-    for (TInt i=0; i<iAllAppsArray->MdcaCount(); i++)
-        {
-        if (iAllAppsArray->MdcaPoint(i).FindF(_L("\\Launcher.")) != KErrNotFound)
-            {
-            iAllAppsArray->Delete(i);
-            iAllAppsArray->Compress();
-            break;
-            }
-        }
-
-    // sort the elements
-    iAllAppsArray->Sort();
-
-    // remove the wait dialog
-    waitDialog->CancelNoteL(dialogId);
-    CleanupStack::PopAndDestroy(); //waitDialog;
-       
-    return iAllAppsArray;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::StartAppLaunchingL(const CArrayFix<TInt>* aSelectedApps, TBool aAutoClose)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::StartAppLaunchingL");
-
-    // check that we have something to launch
-    if (aSelectedApps->Count() <= 0)
-        {
-        _LIT(message, "Nothing selected");
-        CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-        errorNote->ExecuteLD(message);
-        }
-    else
-        {
-        // update the list of applications to be tested
-        iAppsArray->Reset();
-
-        TInt ref(0);
-        TKeyArrayFix key(0, ECmpTUint16);
-        TInt index(0);
-
-        for (TInt i=0; i<iAllAppsArray->MdcaCount(); i++)
-            {
-            ref = i;
-
-            // if the application is selected, append it to the apps array
-            if (aSelectedApps->Find(ref, key, index) == 0)  
-                {
-                iAppsArray->AppendL(iAllAppsArray->MdcaPoint(i));
-                }
-            }
-
-
-        // to make sure that our algorithm works correctly
-        if (iAppsArray->MdcaCount() != aSelectedApps->Count())
-            {
-            _LIT(message, "Something went wrong...");
-            CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-            errorNote->ExecuteLD(message);
-            return;
-            }
-
-        
-        // init
-        Cancel();
-        iLaunchingIsActive = ETrue;
-        iAutoClose = aAutoClose;
-        iAppLaunchCounter = 0;
-        iFailedCases = 0;
-        iOkCases = 0;
-        iSkippedCases = 0;
-        iTotalNumberOfCases = iAppsArray->MdcaCount();
-        iCurrentAppUid = KNullUid;
-
-        // open the log file for writing
-        if (iLogFile.Open(iEnv->FsSession(), iLogFilePath, EFileWrite) != KErrNone)
-            {
-            iEnv->FsSession().MkDirAll(iLogFilePath);
-            iLogFile.Replace(iEnv->FsSession(), iLogFilePath, EFileWrite);
-            }
-        else
-            {
-            // file opens correctly, seek to the end
-            TInt fileSize=0;
-            iLogFile.Size(fileSize);
-            iLogFile.Seek(ESeekCurrent, fileSize);
-            }
-
-        ChangeFocusToOutputView();
-
-        iContainerOutput->PrintTextL(_L("New test started.\n"));
-
-        // start the first launch!
-        IssueLaunch();
-
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::IssueLaunch()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::IssueLaunch");
-
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Timing error?"), 100));
-
-    // this should keep the backlight on
-    User::ResetInactivityTime();
-
-    // some delay
-    iTimer.After(iStatus, 1000000);    
-    SetActive();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::RunL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::RunL");  
-    TInt err = iStatus.Int();
-    User::LeaveIfError(err);
-    
-    if( iDLLAnalysisIsActive )
-        {
-        if( iWaitDialog == 0)
-            {
-            TEntry entry;
-            User::LeaveIfError(iEnv->FsSession().Entry(iRequiredDllsFilePath, entry));
-            TInt fileSize = entry.iSize;
-
-            // init progress bar
-            iWaitDialog = new(ELeave) CAknProgressDialog((reinterpret_cast<CEikDialog**>(&iWaitDialog)), ETrue);
-            iWaitDialog->SetCallback(this);
-            iWaitDialog->PrepareLC(R_GENERAL_PROGRESS_NOTE);
-            iWaitDialog->SetCurrentLabelL( EAknCtNote, _L("Analysing DLLs"));
-            iProgressInfo = iWaitDialog->GetProgressInfoL();
-            iProgressInfo->SetFinalValue( fileSize );
-            iWaitDialog->RunLD();
-            iWaitDialog->MakeVisible( ETrue );
-            }
-        
-        iBCLogFile.Write(iLogWriteBuf->Des());
-        iLogWriteBuf->Des().Zero();
-        return;
-        }
-    else
-        {
-        // write full app path to the log file
-        WriteInitialStuffToTheLogL(iAppsArray->MdcaPoint(iAppLaunchCounter), iLogFile);
-
-        // get the uid of the current app
-        iCurrentAppUid = KNullUid;
-        TApaAppInfo appInfo;
-        iLs.GetAllApps();
-        while (iLs.GetNextApp(appInfo) == KErrNone)
-            {
-            if (appInfo.iFullName.CompareF( iAppsArray->MdcaPoint(iAppLaunchCounter) ) == 0)
-                {
-                iCurrentAppUid = appInfo.iUid;
-                break;
-                }
-            }
-
-        if (iCurrentAppUid == KNullUid)
-            {        
-            iLogWriteBuf->Des().Append(_L("[WARN: App has no UID] "));
-            }
-
-        // parse the filename
-        TParse nameParser;
-        nameParser.SetNoWild(iAppsArray->MdcaPoint(iAppLaunchCounter), NULL, NULL);
-        iCurrentAppNameAndExt.Copy(nameParser.Drive());
-        iCurrentAppNameAndExt.Append(nameParser.NameAndExt());
-
-        // do not try to launch these apps
-        if (iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Launcher.")) != KErrNotFound
-            || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Phone.")) != KErrNotFound
-            || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\Startup.")) != KErrNotFound  
-            || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\SplashScreen.")) != KErrNotFound  
-            || iAppsArray->MdcaPoint(iAppLaunchCounter).FindF(_L("\\eshell.")) != KErrNotFound)  
-            {
-            iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-            iContainerOutput->PrintTextL(_L(": SKIPPED automatically\n"));
-
-            iLogWriteBuf->Des().Append(_L("[SKIPPED automatically] "));
-            iLogWriteBuf->Des().Append(KFileNewLine);
-            iLogFile.Write(iLogWriteBuf->Des());
-
-            iSkippedCases++;
-            CheckForMoreAppsL();
-            }
-
-        else
-            {
-
-            // dependency check not needed if the app is in the ROM/ROFS, because they'll be checked automatically
-            // when the rom image is built
-            
-            if (iCurrentAppNameAndExt[0] != 'Z' && iCurrentAppNameAndExt[0] != 'z')
-                {
-
-                if (iCurrentAppNameAndExt[2] == '[')  // this is quite likely a Java application, no dependency test needed 
-                    {
-                    iLogWriteBuf->Des().Append(_L("[Dependency check not done] "));
-                    }
-                else
-                    {  // otherwise check depencies
-                
-                    #ifdef __WINS__
-                    
-                        // emulator not supported
-
-                    #else
-
-                        // ELF binaries
-
-                        CDesCArray* missingDllArray = NULL;
-
-                        TRAPD(err, missingDllArray = DependencyCheckForE32ImageL());
-
-                        // some error happened while processing the E32 image
-                        if (err != KErrNone)
-                            {
-                            iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-                            iContainerOutput->PrintTextL(_L(": unable to read import table!\n"));
-
-                            iLogWriteBuf->Des().Append(_L("[Unable to read import table!] "));
-                            }
-
-                        // print missing dependencies
-                        else if (err==KErrNone && missingDllArray)
-                            {
-                            if (missingDllArray->MdcaCount() > 0)
-                                {
-                                iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-                                iContainerOutput->PrintTextL(_L(": missing dependencies: "));
-                                iLogWriteBuf->Des().Append(_L("[Missing dependencies: "));
-
-                                for (TInt k=0; k<missingDllArray->MdcaCount(); k++)
-                                    {
-                                    iContainerOutput->PrintTextL(missingDllArray->MdcaPoint(k));
-                                    iContainerOutput->PrintTextL(_L(" "));
-
-                                    iLogWriteBuf->Des().Append(missingDllArray->MdcaPoint(k));
-                                    iLogWriteBuf->Des().Append(_L(" "));
-                                    }
-
-                                iContainerOutput->PrintTextL(_L("\n"));
-                                iLogWriteBuf->Des().Append(_L("] "));
-                                }
-                            }
-
-                        if (missingDllArray)
-                            delete missingDllArray;
-
-                    #endif
-
-                    }  // if '['
-                }  // if 'Z'
-
-
-
-            // check if the app is already running
-            TApaTaskList taskList(iWs);
-            TApaTask thisTask = taskList.FindApp(iCurrentAppUid);
-            if (thisTask.Exists())
-                {
-                iLogWriteBuf->Des().Append(_L(" [OK: App already running]"));
-                iLogWriteBuf->Des().Append(KFileNewLine);
-                iLogFile.Write(iLogWriteBuf->Des());
-
-                iOkCases++;
-                CheckForMoreAppsL();
-                }
-            
-            else
-                {
-                // check the program's capabilities
-                TApaAppCapabilityBuf buf;
-                iLs.GetAppCapability(buf, iCurrentAppUid);
-                TApaAppCapability cap = buf();
-
-                // if it's embeddable only, don't launch if setting is enabled
-                if (cap.iEmbeddability == TApaAppCapability::EEmbeddableOnly && SkipHiddenAndEmbedOnly())  
-                    {
-                    iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-                    iContainerOutput->PrintTextL(_L(": SKIPPED: embeddable only\n"));
-
-                    iLogWriteBuf->Des().Append(_L("[SKIPPED: embeddable only] "));
-                    iLogWriteBuf->Des().Append(KFileNewLine);
-                    iLogFile.Write(iLogWriteBuf->Des());
-
-                    iSkippedCases++;
-                    CheckForMoreAppsL();
-                    }
-            
-                // if it's hidden, don't launch if setting is enabled
-                else if (cap.iAppIsHidden && SkipHiddenAndEmbedOnly())  
-                    {
-                    iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-                    iContainerOutput->PrintTextL(_L(": SKIPPED: hidden\n"));
-
-                    iLogWriteBuf->Des().Append(_L("[SKIPPED: hidden] "));
-                    iLogWriteBuf->Des().Append(KFileNewLine);
-                    iLogFile.Write(iLogWriteBuf->Des());
-
-                    iSkippedCases++;
-                    CheckForMoreAppsL();
-                    }
-
-                // otherwise do the normal launch test
-                else
-                    {
-                    LaunchApplicationL();
-                    }
-                
-                } //if (thisTask.Exists())
-            
-            } //if (iAppsArray->MdcaPoint(iAppLaunchCounter).FindF
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::CheckIfAppIsRunningL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::CheckIfAppIsRunningL");
-
-    // cancel the death notifier since it isn't needed anymore
-    if( iCurrentAppThread.Handle() != 0 )
-        {
-        iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
-        }
-
-    // cancel checkers
-    iAppThreadChecker->Cancel();
-    iAppRunningChecker->Cancel(); 
-
-
-
-    // check from the window server if the app is running
-    TApaTaskList taskList(iWs);
-    TApaTask thisTask = taskList.FindApp(iCurrentAppUid);
-
-    if( !thisTask.Exists() ) // application not running -> FAIL
-        {
-        // check from the thread why it quit
-        CheckWhyThreadDiedL();
-
-        // --> CheckForMoreApps() and all the other stuff called from CheckWhyThreadDied() !
-
-        }
-    else
-        {
-        // app is running!
-        iOkCases++;
-
-        // close handle to the thread        
-        iCurrentAppThread.Close();
-
-
-        iLogWriteBuf->Des().Append(_L(" [OK]"));
-        iLogWriteBuf->Des().Append(KFileNewLine);        
-        iLogFile.Write(iLogWriteBuf->Des());
-
-
-        // close the running application if needed
-        if (iAutoClose)
-            {
-            // since the application is still open, let's close it
-            thisTask.EndTask();
-            //User::After(1000);
-            //thisTask.SendSystemEvent(EApaSystemEventShutdown);
-            //thisTask.KillTask();
-            //User::After(1000);
-            }
-
-        // this app is done now, move to the next one!
-        CheckForMoreAppsL();
-                
-        }    
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::CheckWhyThreadDiedL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::CheckWhyThreadDiedL");
-
-    // cancel the death notifier since it isn't needed anymore
-    if( iCurrentAppThread.Handle() != 0 )
-        {
-        iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
-        }
-
-    // make sure all checkers are cancelled
-    iAppRunningChecker->Cancel(); 
-    iAppThreadChecker->Cancel(); 
-
-    TBuf<256> outputText;
-    outputText.Append(_L("App.Closed. "));
-
-
-    if (iCurrentAppThread.ExitType() == EExitKill)
-        {
-        outputText.Append(_L("\"EExitKill\""));
-        }
-    else if (iCurrentAppThread.ExitType() == EExitTerminate)
-        {
-        outputText.Append(_L("\"EExitTerminate\""));
-        }
-    else if (iCurrentAppThread.ExitType() == EExitPanic)
-        {
-        outputText.Append(_L("\"EExitPanic\""));
-        }
-    else if (iCurrentAppThread.ExitType() == EExitPending)
-        {
-        outputText.Append(_L("\"EExitPending\""));
-        }
-    else // unknown reason
-        {
-        outputText.Append(_L("\"Exit_Unknown_Reason\""));
-        }        
-    
-    outputText.Append(_L(" code:"));
-    TInt exitReason = iCurrentAppThread.ExitReason();
-    outputText.AppendNum(exitReason);
-    outputText.Append(_L(" \""));
-
-    TPtrC exitCategory = iCurrentAppThread.ExitCategory();
-    outputText.Append(exitCategory);
-
-    outputText.Append(_L("\""));
-
-
-    // print to screen
-    iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-    iContainerOutput->PrintTextL(_L(": "));
-    iContainerOutput->PrintTextL(outputText);
-    iContainerOutput->PrintTextL(_L("\n"));
-
-    // write to the log also
-    iLogWriteBuf->Des().Append(_L(" [FAIL: "));
-    iLogWriteBuf->Des().Append(outputText);
-    iLogWriteBuf->Des().Append(_L("]"));
-    iLogWriteBuf->Des().Append(KFileNewLine);
-    
-    iLogFile.Write(iLogWriteBuf->Des());
-
-    // close handle to the thread
-    //iCurrentAppThread.Close();    <-- not safe the close the handle because of the "App.Closed" dialog
-    //                                  somehow takes ownership of the thread or something
-
-    // nothing to do anymore, move to the next app
-    iFailedCases++;
-    CheckForMoreAppsL();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::CheckForMoreAppsL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::CheckForMoreAppsL");
-
-    // make sure the launcher app is in the foreground
-    TApaTaskList taskList(iWs);
-    TUid launcherAppUid;
-    launcherAppUid.iUid = 0x101FB74F;
-    TApaTask launcherTask = taskList.FindApp(launcherAppUid);
-    launcherTask.BringToForeground();
-
-
-    // check if we have more test to be executed
-    if ( iAppLaunchCounter >= iTotalNumberOfCases-1 )
-        {
-        
-        // all done, show stats
-        TBuf<200> message;
-        message.Append( _L("Done: ") );
-        message.AppendNum( iOkCases );
-        message.Append( _L(" ok, ") );
-        message.AppendNum( iFailedCases );
-        message.Append( _L(" failed, ") );
-        message.AppendNum( iSkippedCases );
-        message.Append( _L(" skipped.") );
-
-        // print the message to the output screen
-        iContainerOutput->PrintTextL(message);
-        iContainerOutput->PrintTextL(_L("\n\n"));
-
-        //write same stuff to the log
-        WriteInitialStuffToTheLogL(message, iLogFile);
-        iLogWriteBuf->Des().Copy(KFileNewLine);
-        iLogWriteBuf->Des().Append(KFileNewLine);        
-        iLogFile.Write(iLogWriteBuf->Des());
-
-        // close the log
-        iLogFile.Close();
-
-        iLaunchingIsActive = EFalse;
-
-        _LIT(KAllDoneMessage, "All apps launched");
-        CAknConfirmationNote* confirmationNote = new(ELeave) CAknConfirmationNote;
-        confirmationNote->ExecuteLD(KAllDoneMessage);
-
-        }
-    else
-        {
-        // more apps to be launched, maintain requests
-        iAppLaunchCounter++;
-        IssueLaunch();
-        }
-  
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DoCancel()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DoCancel");
-    
-    if( iXMLParser )
-        {
-        iXMLParser->Cancel();
-        }
-    iTimer.Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::LaunchApplicationL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::LaunchApplication");
-    LOGSTRING3("Launcher: Trying to launch %S, UID: %d", &iCurrentAppNameAndExt, iCurrentAppUid.iUid);
-
-    TRAPD(err, DoLaunchApplicationL());
-    
-    if (err!=KErrNone)
-        {
-        iLogWriteBuf->Des().Append(_L("[FAIL: Cannot launch the app] "));        
-        
-        iContainerOutput->PrintTextL(iCurrentAppNameAndExt);
-        iContainerOutput->PrintTextL(_L(": cannot launch\n"));
-
-        // write the buffer to the log
-        iLogWriteBuf->Des().Append(KFileNewLine);        
-        iLogFile.Write(iLogWriteBuf->Des());
-
-        // this application isn't even launchable, go to next one
-        iFailedCases++;
-        CheckForMoreAppsL();        
-        }
-    
-    }
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DoLaunchApplicationL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DoLaunchApplicationL");
-
-    // create a new handle
-    RThread newThreadHandle;
-    iCurrentAppThread = newThreadHandle;
-
-
-    // Find the task with uid3
-    TApaTaskList tasklist(iWs);
-    TApaTask task=tasklist.FindApp(iCurrentAppUid);
-
-    if (task.Exists())
-        // Task exists, bring it to foreground
-        {
-        task.BringToForeground();
-        }
-    else
-        // Task doesn't exist, launch a new instance of an application
-        {
-        TApaAppInfo appInfo;
-        User::LeaveIfError(iLs.GetAppInfo(appInfo, iCurrentAppUid));
-        TApaAppCapabilityBuf capBuf;
-        User::LeaveIfError(iLs.GetAppCapability(capBuf, iCurrentAppUid));
-        TApaAppCapability& caps = capBuf();
-
-        CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
-        cmdLine->SetExecutableNameL(appInfo.iFullName);
-
-        if ( caps.iLaunchInBackground )
-            // Apps capability defines that the app is launched in background
-            {
-            cmdLine->SetCommandL(EApaCommandBackground);
-            }
-        else
-            {
-            cmdLine->SetCommandL(EApaCommandRun);
-            }
-
-        // start the app
-        User::LeaveIfError(iLs.StartApp(*cmdLine, iCurrentAppThreadId));
-
-        // activate thread checker active object
-        iAppThreadChecker->ActivateChecking();
-
-        // now open a handle to the thread and register death notifier
-        TInt err = iCurrentAppThread.Open(iCurrentAppThreadId);
-        if (err == KErrNone)
-            iCurrentAppThread.Logon(iAppThreadChecker->iStatus);
-        else
-            {
-            iCurrentAppThread.Close();
-            TRequestStatus* status = &iAppThreadChecker->iStatus;
-            User::RequestComplete(status, KErrNone);
-            iAppThreadChecker->Cancel();
-            User::Leave(err);                
-            }
-
-        CleanupStack::PopAndDestroy(); // cmdLine
-        }
-
-    // the application is now running, start a check to see if it's still alive
-    iAppRunningChecker->StartTesting(); 
-
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::StopLaunchingL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::StopLaunchingL");
-
-    //write to the log
-    WriteInitialStuffToTheLogL(_L("Cancelled by the user !!! "), iLogFile);
-    iLogWriteBuf->Des().Copy(KFileNewLine);
-    iLogWriteBuf->Des().Append(KFileNewLine);
-    iLogFile.Write(iLogWriteBuf->Des());
-
-    // close the log
-    iLogFile.Close();
-
-    // print to the screen
-    iContainerOutput->PrintTextL(_L("Launching cancelled.\n\n"));
-
-    // cancel all active objects
-    if( iCurrentAppThread.Handle() != 0 )
-        {
-        iCurrentAppThread.LogonCancel(iAppThreadChecker->iStatus);
-        }
-    Cancel();
-    iAppRunningChecker->Cancel(); 
-    iAppThreadChecker->Cancel(); 
-    
-    iLaunchingIsActive = EFalse;
-
-    _LIT(KMessage, "Launching cancelled");
-    CAknInformationNote* confirmationNote = new(ELeave) CAknInformationNote;
-    confirmationNote->ExecuteLD(KMessage);
-    }
-
-// ---------------------------------------------------------------------------
-
-CDesCArray* CLauncherEngine::DependencyCheckForE32ImageL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DependencyCheckForE32ImageL");
-
-    // create an empty array for the missing dll names
-    CDesCArray* missingDllArray = new(ELeave) CDesCArrayFlat(100);
-    CleanupStack::PushL(missingDllArray);
-
-    // get a list of DLLs from the E32 image file
-    E32ImageReader* reader = E32ImageReader::NewLC();
-    CDesCArray* dllArray = reader->ListOfDLLsL( iAppsArray->MdcaPoint(iAppLaunchCounter) );
-    CleanupStack::PopAndDestroy(); // reader
-    CleanupStack::PushL(dllArray);
-
-    // compare system DLL and image DLL arrays
-    TInt pos(0);
-    for (TInt j=0; j<dllArray->MdcaCount(); j++)
-        {
-        if (iSystemDllArray->Find(dllArray->MdcaPoint(j), pos, ECmpFolded) != 0)  
-            {
-            // DLL not found, append the name to the list of missing DLLs
-            missingDllArray->AppendL(dllArray->MdcaPoint(j));  
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); // dllArray
-    CleanupStack::Pop();  // missingDllArray
-
-    LOGSTRING("Launcher: CLauncherEngine::DependencyCheckForE32ImageL returns");
-
-    return missingDllArray;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::WriteInitialStuffToTheLogL(const TDesC& aOwnData, RFile& aFile)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::WriteInitialStuffToTheLog");
-
-    TTime time;
-    time.HomeTime();
-    TBuf<32> currentTime;
-    TBuf<32> currentDate;
-
-    // current date            
-    _LIT(KCurrentDate,"%D%M%Y%/0%1%/1%2%/2%3%/3");
-    time.FormatL(currentDate, KCurrentDate);    
-    iLogWriteBuf->Des().Copy(currentDate);    
-    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
-
-    // current time
-    _LIT(KCurrentTime,"%-B%:0%J%:1%T%:2%S%:3%+B");
-    time.FormatL(currentTime, KCurrentTime);    
-    AppendLogBufferL(currentTime, iLogWriteBuf);
-    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
-
-    // available RAM memory
-    TMemoryInfoV1Buf memory;
-    UserHal::MemoryInfo(memory);
-    iLogWriteBuf->Des().AppendNum(memory().iFreeRamInBytes);  
-    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
-
-    // own data, eg. application name
-    AppendLogBufferL(aOwnData, iLogWriteBuf);
-    AppendLogBufferL(KFileSeparator(), iLogWriteBuf);
-    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);    
-
-    // write the buffer to the file
-    aFile.Write(iLogWriteBuf->Des()); 
-
-    // clear the buffer
-    iLogWriteBuf->Des().Copy(_L(""));
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CLauncherEngine::DeleteLogFile()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DeleteLogFile");
-    return BaflUtils::DeleteFile(iEnv->FsSession(), iLogFilePath);
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CLauncherEngine::DeleteBCLogFile()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DeleteBCLogFile");
-    return BaflUtils::DeleteFile(iEnv->FsSession(), iBCLogFilePath);
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CLauncherEngine::LogFileExists()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::LogFileExists");
-    return BaflUtils::FileExists(iEnv->FsSession(), iLogFilePath);
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CLauncherEngine::BCLogFileExists()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::BCLogFileExists");
-    return BaflUtils::FileExists(iEnv->FsSession(), iBCLogFilePath);
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DialogDismissedL( TInt aButtonId )
-    {
-    LOGSTRING2("Launcher: CLauncherEngine::DialogDismissedL - Button id: %d", aButtonId);    
-    iWaitDialog = 0;
-    iDLLAnalysisIsActive = EFalse;
-    _LIT(KAnalysisCancelled, "DLL Analysis cancelled");
-    if( IsActive() )
-        {
-        Cancel();
-        }
-    if( iXMLParser )
-        {
-        iXMLParser->Cancel();
-        }
-    if( aButtonId == EAknSoftkeyCancel )
-        {
-        iContainerOutput->PrintTextL( KNewLine );
-        iContainerOutput->PrintTextL( KAnalysisCancelled );
-        iContainerOutput->PrintTextL( KNewLine );
-        if( iLogWriteBuf )
-            {
-            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-            AppendLogBufferL(KAnalysisCancelled(), iLogWriteBuf);
-            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-            if( iBCLogFile.SubSessionHandle() != 0)
-                {
-                iBCLogFile.Write(iLogWriteBuf->Des());
-                }
-            iLogWriteBuf->Des().Zero();
-            }
-        iBCLogFile.Close();
-        }        
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CLauncherEngine::SelectRequiredDLLsFileL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::SelectRequiredDLLsFile");
-    _LIT(KMessage, "Please, select input file for BC analysis");
-    CAknInformationNote* infoNote = new(ELeave) CAknInformationNote(ETrue);
-    infoNote->ExecuteLD(KMessage);    
-    return AknCommonDialogs::RunSelectDlgLD( iRequiredDllsFilePath, R_MEMORY_SELECTION_DIALOG, R_FILE_SELECTION_DIALOG);
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DoBCAnalysisL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DoBCAnalysisL");
-    if( iXMLParser == 0 )
-        {
-        iXMLParser = CLauncherXMLParser::NewL(iEnv->FsSession());
-        }
-    
-    delete iWaitDialog;
-    iWaitDialog = 0;    
-    iXMLParser->ParseL(iRequiredDllsFilePath,this);
-    iDLLAnalysisIsActive = ETrue;
-    
-    // some delay
-    iTimer.After(iStatus, 500000);
-    SetActive();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::AnalyseDLLsL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::AnalyseDLLsL");
-    _LIT(KStartSeparator, "******************************");
-    _LIT(KStartingAnalysis, "Starting BC Analysis for DLLs.");    
-    _LIT(KInputFileSelected, "Input file selected: ");
-    
-    // Reset found issues counter and buffer
-    iFoundBCIssues = 0;    
-    delete iBCIssuesBigBuffer;
-    iBCIssuesBigBuffer = 0;
-    
-    // Reset log writing buffer:
-    iLogWriteBuf->Des().Zero();
-                
-    if( IsActive() )
-        {
-        Cancel();
-        }           
-   
-    if( !SelectRequiredDLLsFileL() )
-        {        
-        return; // Input file selection cancelled
-        }
-    
-    // open the log file for writing
-    if (iBCLogFile.Open(iEnv->FsSession(), iBCLogFilePath, EFileWrite) != KErrNone)
-        {
-        iEnv->FsSession().MkDirAll(iLogFilePath);
-        iBCLogFile.Replace(iEnv->FsSession(), iBCLogFilePath, EFileWrite);
-        }
-    else
-        {
-        // file opens correctly, seek to the end
-        TInt fileSize=0;
-        iBCLogFile.Size(fileSize);
-        iBCLogFile.Seek(ESeekCurrent, fileSize);
-        }
-    
-    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-    AppendLogBufferL(KStartSeparator(), iLogWriteBuf);
-    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-    iBCLogFile.Write(iLogWriteBuf->Des());
-    iLogWriteBuf->Des().Zero();
-    
-    // Resolve file type. Should we use XML parsing or just compare DLL list
-    TBool xmlParsing =
-        KDotXML().Compare(iRequiredDllsFilePath.Right(KDotXML().Length())) == 0 ||
-        KDotLauncherXML().Compare(iRequiredDllsFilePath.Right(KDotLauncherXML().Length())) == 0;
-    
-    // Log analysis starting time and selected input file:
-    WriteInitialStuffToTheLogL(KStartingAnalysis, iBCLogFile);    
-    AppendLogBufferL(KInputFileSelected(), iLogWriteBuf);
-    AppendLogBufferL(iRequiredDllsFilePath, iLogWriteBuf);
-    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-    iBCLogFile.Write(iLogWriteBuf->Des());
-    iLogWriteBuf->Des().Zero();
-    
-    if( xmlParsing )
-        {
-        ChangeFocusToOutputView();
-        DoBCAnalysisL();
-        }
-    else
-        {
-        DoCompareDLLListsL();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DoCompareDLLListsL()
-    {
-    LOGSTRING("Launcher: CLauncherEngine::DoCompareDLLListsL");
-    RFile file;
-    CleanupClosePushL(file);
-    
-    if(file.Open(iEnv->FsSession(), iRequiredDllsFilePath, EFileRead) != KErrNone)
-        {
-        ChangeFocusToOutputView();
-
-        TBuf<200> msg;
-        msg.Format(_L("Unable to open %S for reading!\n\n"), &iRequiredDllsFilePath);
-        iContainerOutput->PrintTextL( msg );
-        }
-    else
-        {
-        CDesCArray* requiredDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
-        CleanupStack::PushL(requiredDllArray);
-
-        // read all lines the text file
-        TFileName dllName;
-        TInt i(0);
-        while( ReadLineFromFileL(file, dllName) == KErrNone && i<KMaxDllArraySize )
-            {
-            dllName.TrimAll();
-
-            if (dllName.Length() > 1)
-                requiredDllArray->AppendL(dllName);
-            
-            i++;
-            }
-
-        if (requiredDllArray->MdcaCount() == 0)
-            {
-            ChangeFocusToOutputView();
-
-            TBuf<200> msg;
-            msg.Format(_L("File %S is empty!\n\n"), &iRequiredDllsFilePath);
-            iContainerOutput->PrintTextL( msg );
-            }
-        else
-            {
-            // compare the arrays and print any missing items
-            CDesCArray* missingDllArray = new(ELeave) CDesCArrayFlat(KMaxDllArraySize);
-            CleanupStack::PushL(missingDllArray);
-
-            TInt pos(0);
-            for (TInt j=0; j<requiredDllArray->MdcaCount(); j++)
-                {
-                if (iSystemDllArray->Find(requiredDllArray->MdcaPoint(j), pos, ECmpFolded) != 0)  
-                    {
-                    // DLL not found, append the name to the list of missing DLLs
-                    missingDllArray->AppendL(requiredDllArray->MdcaPoint(j));  
-                    }
-                }
-
-            if (missingDllArray->MdcaCount() == 0)
-                {
-                _LIT(KMessage, "No missing files found");
-                AppendLogBufferL(KMessage(), iLogWriteBuf);
-                CAknInformationNote* note = new(ELeave) CAknInformationNote;
-                note->ExecuteLD(KMessage);
-                }
-            else
-                {
-                ChangeFocusToOutputView();
-                _LIT(KMissingFiles, "Missing files:\n");
-
-                iContainerOutput->PrintTextL( KMissingFiles );
-                AppendLogBufferL(KMissingFiles(), iLogWriteBuf);
-                
-                for (TInt i=0; i<missingDllArray->MdcaCount(); i++)
-                    {
-                    iContainerOutput->PrintTextL( missingDllArray->MdcaPoint(i) );                    
-                    iContainerOutput->PrintTextL( _L("\n") );           
-                    AppendLogBufferL(missingDllArray->MdcaPoint(i), iLogWriteBuf);
-                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-                    }
-
-                iContainerOutput->PrintTextL( _L("\n") );
-                }
-
-            CleanupStack::PopAndDestroy(); // missingDllArray            
-            }
-
-        CleanupStack::PopAndDestroy(); // requiredDllArray
-        }
-
-    CleanupStack::PopAndDestroy(); //file
-    iBCLogFile.Write(iLogWriteBuf->Des());
-    iLogWriteBuf->Des().Zero();
-    iBCLogFile.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::ParsingProgressedL(TInt aBytes)
-    {
-    LOGSTRING2("Launcher: CLauncherEngine::ParsingProgressedL - Bytes: %d", aBytes);
-    if (iProgressInfo && aBytes > 0 )
-        {
-        iProgressInfo->SetAndDraw(aBytes);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DocumentParsedL(TInt aErrorCode)
-    {            
-    LOGSTRING2("Launcher: CLauncherEngine::DocumentParsedL (Error code: %d)", aErrorCode);
-        
-    iDLLAnalysisIsActive = EFalse;
-    _LIT(KParseError, "Parse error: ");
-    _LIT(KNoIssues, "No binary compatibility issues found");
-    
-    if( IsActive() )
-        {
-        Cancel();
-        }
-            
-    if( iWaitDialog )
-        {
-        iWaitDialog->ProcessFinishedL();
-        iWaitDialog = 0;
-        }
-        
-    if( aErrorCode != KErrNone )
-        {
-        TBuf<16> errorCodeString;
-        errorCodeString.AppendNum(aErrorCode);
-        iContainerOutput->PrintTextL( KNewLine );
-        iContainerOutput->PrintTextL( KParseError );
-        iContainerOutput->PrintTextL( errorCodeString );
-        iContainerOutput->PrintTextL( KNewLine );        
-        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-        AppendLogBufferL(KParseError(), iLogWriteBuf);
-        AppendLogBufferL(errorCodeString, iLogWriteBuf);
-        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-        }
-    else if(iFoundBCIssues == 0)
-        {
-        iContainerOutput->PrintTextL( KNoIssues );
-        iContainerOutput->PrintTextL( KNewLine );        
-        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-        AppendLogBufferL(KNoIssues(), iLogWriteBuf);
-        AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-        }
-    else if( iBCIssuesBigBuffer && iBCIssuesBigBuffer->Des().Length() > 0 )
-        {
-        iContainerOutput->PrintTextL(iBCIssuesBigBuffer->Des());
-        delete iBCIssuesBigBuffer;
-        iBCIssuesBigBuffer = 0;
-        }
-    if( iLogWriteBuf->Length() > 0 && iBCLogFile.SubSessionHandle() != 0)
-        {
-        iBCLogFile.Write(iLogWriteBuf->Des());
-        }
-    WriteInitialStuffToTheLogL(_L("Analysis ready"), iBCLogFile);
-    iLogWriteBuf->Des().Zero();
-    iBCLogFile.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::ElementParsedL(const CLauncherDLLElement& aDllElement)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::ElementParsedL");
-    User::ResetInactivityTime();
-    _LIT(KNewLine, "\n");
-    _LIT(KIndent, "    ");
-    _LIT(KIssuesFound, "Binary compatibility issues found:"); 
-    _LIT(KDLLMissing,"DLL is missing");
-    _LIT(KUID1Changed,"UID1 changed");
-    _LIT(KUID2Changed,"UID2 changed");
-    _LIT(KUID3Changed,"UID3 changed");
-    _LIT(KSIDChanged,"SID changed");
-    _LIT(KCapabilityChanged,"Capability changed");
-    
-    if( iDLLElement == 0 )
-        {
-        iDLLElement = CLauncherDLLElement::NewL();
-        }
-    
-    TFindFile fileFinder(iEnv->FsSession());
-    _LIT(KDLLPath, "\\sys\\bin\\");
-    TInt err = fileFinder.FindByPath(aDllElement.Name(), &KDLLPath); 
-    
-    TBuf<256> issueStr;
-    
-    if( err == KErrNotFound )
-        {
-        if( iFoundBCIssues++ == 0 )
-            {                        
-            iContainerOutput->PrintTextL( KIssuesFound );
-            iContainerOutput->PrintTextL( KNewLine );            
-            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-            AppendLogBufferL(KIssuesFound(), iLogWriteBuf);
-            AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-            }
-        issueStr.Copy(aDllElement.Name());
-        issueStr.Append(KNewLine);
-        issueStr.Append(KIndent);
-        issueStr.Append(KDLLMissing);
-        issueStr.Append(KNewLine);
-                
-        AppendLogBufferL(issueStr, iLogWriteBuf);
-        
-        TFileName dllName = aDllElement.Name();
-        LOGSTRING2("Launcher: DLL not found: %S", &dllName);
-        if( iFoundBCIssues > KBigBufferUsageThreshold )
-            {
-            if( iBCIssuesBigBuffer == 0)
-                {
-                iBCIssuesBigBuffer = HBufC::NewL(KBigBufferAllocBytes);
-                }
-            TInt maxSize = iBCIssuesBigBuffer->Des().Length() + issueStr.Length();
-            if( maxSize >= iBCIssuesBigBuffer->Des().MaxLength())
-                {
-                iBCIssuesBigBuffer = iBCIssuesBigBuffer->ReAllocL(maxSize + KBigBufferAllocBytes );                
-                }
-            TPtr ptr(iBCIssuesBigBuffer->Des());
-            ptr += issueStr;            
-            }
-        else
-            {
-            iContainerOutput->PrintTextL( issueStr);
-            }
-        }
-    else if( err == KErrNone)
-        {
-        // File is found, so let's try to open it:
-        RFile dllFile;
-        CleanupClosePushL(dllFile);        
-        if( dllFile.Open(iEnv->FsSession(), fileFinder.File(), EFileRead) == KErrNone )
-            {
-            // Parse DLL:
-            iDLLParser->ParseL(iEnv->FsSession(), dllFile, *iDLLElement);
-            CleanupStack::PopAndDestroy(); // dllFile            
-            RArray<CLauncherDLLElement::TDifference> diffs;
-            CleanupClosePushL(diffs);
-                        
-            // Compare DLLs:              
-            if( iDLLElement->CompareL(aDllElement, diffs))
-                {                
-                if( iFoundBCIssues++ == 0 )
-                    {
-                    iContainerOutput->PrintTextL( KIssuesFound );
-                    iContainerOutput->PrintTextL( KNewLine );                   
-                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-                    AppendLogBufferL(KIssuesFound(), iLogWriteBuf);
-                    AppendLogBufferL(KFileNewLine(), iLogWriteBuf);
-                    }
-                // Differencies found:
-                for( TInt i = 0; i < diffs.Count(); ++i )
-                    {                
-                    // Print DLL name:
-                    if( i == 0 )
-                        {
-                        issueStr.Copy(aDllElement.Name());
-                        issueStr.Append(KNewLine);
-                        }
-                    
-                    // Print differencies:
-                    issueStr.Append(KIndent);
-                    switch(diffs[i])
-                        {
-                        case CLauncherDLLElement::EDifference_UID1:
-                            issueStr.Append(KUID1Changed);
-                            break;
-                        case CLauncherDLLElement::EDifference_UID2:
-                            issueStr.Append( KUID2Changed );
-                            break;
-                        case CLauncherDLLElement::EDifference_UID3:
-                            issueStr.Append( KUID3Changed );
-                            break;
-                        case CLauncherDLLElement::EDifference_SID:
-                            issueStr.Append( KSIDChanged );
-                            break;
-                        case CLauncherDLLElement::EDifference_Capability:
-                            issueStr.Append( KCapabilityChanged );
-                            break;
-                        }
-                    issueStr.Append( KNewLine );                    
-                    }
-                AppendLogBufferL(issueStr, iLogWriteBuf);
-                if( iFoundBCIssues > KBigBufferUsageThreshold )
-                    {
-                    // To improve performance, don't print issues to output anymore.
-                    // Instead, store the issues in buffer and print them when analysis is done.
-                    if( iBCIssuesBigBuffer == 0)
-                        {
-                        iBCIssuesBigBuffer = HBufC::NewL(KBigBufferAllocBytes);
-                        }
-                    TInt maxSize = iBCIssuesBigBuffer->Des().Length() + issueStr.Length();
-                    if( maxSize >= iBCIssuesBigBuffer->Des().MaxLength())
-                        {
-                        TInt increaseSize = Max(issueStr.Length(), KBigBufferAllocBytes);
-                        iBCIssuesBigBuffer = iBCIssuesBigBuffer->ReAllocL(maxSize + increaseSize );                            
-                        }
-                    TPtr ptr(iBCIssuesBigBuffer->Des());
-                    ptr += issueStr;
-                    }
-                else
-                    {
-                    iContainerOutput->PrintTextL( issueStr);
-                    }
-                }
-            CleanupStack::Pop(); // diffs
-            diffs.Close();            
-            }
-        else
-            {
-            CleanupStack::PopAndDestroy(); // dllFile
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TInt CLauncherEngine::ReadLineFromFileL(RFile& aFile, TDes& aReadBuf)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::ReadLineFromFile");
-
-    _LIT8(KImcvCRLF, "\r\n");
-    TInt err(KErrNone);
-
-    HBufC8* tempLine = HBufC8::NewLC(1000);
-    TPtr8 buffer = tempLine->Des();
-
-    // clear the target buffer
-    aReadBuf.Zero();
-
-    // get the current file position
-    TInt filePos(0);
-    aFile.Seek(ESeekCurrent, filePos);
-
-    // read the buffer
-    err = aFile.Read(buffer);
-
-    // check if it's the end of file
-    TInt s = buffer.Length();
-    if (s == 0)
-        err = KErrEof;
-
-    if (err == KErrNone)
-        {
-        // copy to the lfcr and then set the file pointer to the point after that
-        TInt pos = buffer.Find(KImcvCRLF);
-        if (pos != -1)
-            {
-            TFileName tempBuf;
-            buffer.SetLength(pos);
-            tempBuf.Copy(buffer);
-            aReadBuf.Justify(tempBuf, pos, ELeft, ' ');
-            filePos += (pos+2);
-
-            // set the file pointer back to after the lfcr
-            aFile.Seek(ESeekStart, filePos);
-            }
-        
-        // else fill the whole buffer
-        else
-            {
-            aReadBuf.Copy(buffer);
-            }
-        }
-
-    CleanupStack::PopAndDestroy(); // tempLine
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-void CLauncherEngine::SendLogViaSendUiL(CSendUi* aSendUi)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::SendLogViaSendUiL");
-
-    CMessageData* messageData = CMessageData::NewL();
-    CleanupStack::PushL( messageData );
-    if( LogFileExists() )
-        {
-        messageData->AppendAttachmentL( iLogFilePath );
-        }
-    if( BCLogFileExists() )
-        {
-        messageData->AppendAttachmentL( iBCLogFilePath );
-        }
-    aSendUi->ShowQueryAndSendL( messageData, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments ));
-    CleanupStack::PopAndDestroy(); //messageData
-    }
-#endif
-
-// ---------------------------------------------------------------------------
-
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
-void CLauncherEngine::SendListOfSystemDllsViaSendUiL(CSendUi* aSendUi)
-    {
-    LOGSTRING("Launcher: CLauncherEngine::SendListOfDllsViaSendUiL");
-
-    if (BaflUtils::FileExists(iEnv->FsSession(), iSystemDllsFilePath))
-        {
-        CMessageData* messageData = CMessageData::NewL();
-        CleanupStack::PushL( messageData );
-        messageData->AppendAttachmentL( iSystemDllsFilePath );
-        aSendUi->ShowQueryAndSendL( messageData, TSendingCapabilities(0, 0, TSendingCapabilities::ESupportsAttachments ));
-        CleanupStack::PopAndDestroy(); //messageData
-        }
-    else
-        {
-        _LIT(message, "DLL list does not exist");
-        CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-        errorNote->ExecuteLD(message);        
-        }
-    }
-#endif
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::ChangeFocusToOutputView()
-    {
-    iAppUi->TabGroup()->SetActiveTabByIndex( 1 );
-    TRAP_IGNORE(iAppUi->ActivateLocalViewL( KView2Id ));
-    }
-
-
-// ---------------------------------------------------------------------------
-
-//////////////////////////////////////////////////////////////////////////////////////
-
-// ---------------------------------------------------------------------------
-
-CAppRunningChecker* CAppRunningChecker::NewL(CLauncherEngine* aLauncherEngine)
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::NewL");
-
-    CAppRunningChecker* self = new(ELeave) CAppRunningChecker;
-    CleanupStack::PushL(self);
-    self->ConstructL(aLauncherEngine);
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CAppRunningChecker::CAppRunningChecker() : CActive(EActivePriorityIpcEventsHigh)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppRunningChecker::ConstructL(CLauncherEngine* aLauncherEngine)
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::ConstructL");
-
-    iEnv = CEikonEnv::Static();
-    User::LeaveIfError(iTimer.CreateLocal());
-
-    iLauncherEngine = aLauncherEngine;
-
-    CActiveScheduler::Add(this);
-    }
-
-// ---------------------------------------------------------------------------
-
-CAppRunningChecker::~CAppRunningChecker()
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::~CAppRunningChecker");
-
-    Cancel();
-
-    iTimer.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppRunningChecker::StartTesting()
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::StartTesting");
-
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Running Checker"), 200));
-
-    // async delay of seven seconds
-    iTimer.After(iStatus, 7000000);    
-    SetActive();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppRunningChecker::RunL()
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::RunL");
-
-    // check if the application is running
-    iLauncherEngine->CheckIfAppIsRunningL();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppRunningChecker::DoCancel()
-    {
-    LOGSTRING("Launcher: CAppRunningChecker::DoCancel");
-    iTimer.Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-
-//////////////////////////////////////////////////////////////////////////////////////
-
-// ---------------------------------------------------------------------------
-
-CAppThreadChecker* CAppThreadChecker::NewL(CLauncherEngine* aLauncherEngine)
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::NewL");
-
-    CAppThreadChecker* self = new(ELeave) CAppThreadChecker;
-    CleanupStack::PushL(self);
-    self->ConstructL(aLauncherEngine);
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CAppThreadChecker::CAppThreadChecker() : CActive(EActivePriorityIpcEventsHigh)
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppThreadChecker::ConstructL(CLauncherEngine* aLauncherEngine)
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::ConstructL");
-
-    iEnv = CEikonEnv::Static();
-
-    iLauncherEngine = aLauncherEngine;
-
-    CActiveScheduler::Add(this);
-    }
-
-// ---------------------------------------------------------------------------
-
-CAppThreadChecker::~CAppThreadChecker()
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::~CAppThreadChecker");
-
-    Cancel();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppThreadChecker::ActivateChecking()
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::ActivateChecking");
-
-    __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("Thread Checker"), 300));
-
-    SetActive();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppThreadChecker::RunL()
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::RunL");
-
-    // check the state of the thread
-    iLauncherEngine->CheckWhyThreadDiedL();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CAppThreadChecker::DoCancel()
-    {
-    LOGSTRING("Launcher: CAppThreadChecker::DoCancel");
-    }
-
-// ---------------------------------------------------------------------------
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launchermainwindow.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbdocumentloader.h>
+
+#include "enginewrapper.h"
+#include "commonactions.h"
+#include "applicationview.h"
+#include "outputview.h"
+#include "launchermainwindow.h"
+
+// Here we create custom document loader to be able to use custom views in XML.
+class LauncherDocumentLoader : public HbDocumentLoader
+{
+public:
+    virtual QObject *createObject(const QString& type, const QString &name);
+};
+
+QObject *LauncherDocumentLoader::createObject(const QString& type, const QString &name)
+{
+    // Application view
+    if (type == ApplicationView::staticMetaObject.className()) {
+        QObject *object = new ApplicationView;
+        object->setObjectName(name);
+        return object;
+    }
+    
+    // Output view
+    else if (type == OutputView::staticMetaObject.className()) {
+        QObject *object = new OutputView;
+        object->setObjectName(name);
+        return object;
+    }
+    
+    return HbDocumentLoader::createObject(type, name);
+}
+
+
+LauncherMainWindow::LauncherMainWindow( QWidget *parent ) : HbMainWindow( parent )
+    ,mEngineWrapper(0)
+    ,mApplicationView(0)
+    ,mOutputView(0)
+    ,mCommonActions(0)
+    {
+    }
+
+LauncherMainWindow::~LauncherMainWindow ()
+    {
+    if(mCommonActions)
+        delete mCommonActions;
+    if(mEngineWrapper)
+        delete mEngineWrapper;
+    }
+
+int LauncherMainWindow::init( HbApplication &app )
+    {
+    
+    // Create Engine Wrapper and initialize it
+    mEngineWrapper = new EngineWrapper(this);
+    if (!mEngineWrapper->init()) {
+        return EXIT_FAILURE;
+    }
+    
+    // Create common actions class for actions that are used in all views of Launcher        
+    mCommonActions = new CommonActions(mEngineWrapper, &app);
+
+    // Create document loader
+    LauncherDocumentLoader loader;
+    
+    // Create application view
+    mApplicationView = ApplicationView::create(loader, mCommonActions, mEngineWrapper);
+    // Add view to main window
+    addView(mApplicationView);
+
+    loader.reset();
+    
+    // Create output view
+    mOutputView = OutputView::create(loader, mCommonActions);
+    // Add view to main window
+    addView(mOutputView);
+    
+    // Show ApplicationView at startup
+    setCurrentView(mApplicationView);
+    
+    // Show HbMainWindow
+    show();
+
+    return 0;// no errors
+    }
+
+void LauncherMainWindow::openApplicationView()
+    {
+    setCurrentView(mApplicationView);
+    }
+
+void LauncherMainWindow::openOutputView()
+    {
+    setCurrentView(mOutputView);
+    }
+
+void LauncherMainWindow::printText(const QString &text)
+    {
+    mOutputView->printText(text);
+    }
--- a/launcher/src/launcherviewapps.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include <aknviewappui.h>
-#include <avkon.hrh>
-#include <Launcher.rsg>
-#include <AknUtils.h>
-#include <eikmenup.h>
-
-#include "LauncherViewApps.h"
-#include "LauncherContainerApps.h" 
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CLauncherViewApps::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CLauncherViewApps::ConstructL(CLauncherEngine* aEngine)
-    {
-    BaseConstructL( R_LAUNCHER_VIEW1 );
-
-    iContainer = new (ELeave) CLauncherContainerApps;
-    iContainer->SetMopParent(this);
-    iContainer->ConstructL( ClientRect(), aEngine );
-
-    AppUi()->AddToStackL( *this, iContainer );
-
-    // add data to the listbox and as default mark all as selected
-    iContainer->UpdateFileListL();
-    AknSelectionService::HandleMarkableListProcessCommandL( EAknMarkAll, iContainer->ListBox() );
-
-    aEngine->SetContainerApps(iContainer);
-
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewApps::~CLauncherViewApps()
-// ---------------------------------------------------------
-//
-CLauncherViewApps::~CLauncherViewApps()
-    {
-    AppUi()->RemoveFromViewStack( *this, iContainer );
-    delete iContainer;
-    }
-
-// ---------------------------------------------------------
-// TUid CLauncherViewApps::Id()
-// ?implementation_description
-// ---------------------------------------------------------
-//
-TUid CLauncherViewApps::Id() const
-    {
-    return KViewId;
-    }
-
-// ------------------------------------------------------------------------------
-// CLauncherViewApps::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ------------------------------------------------------------------------------
-//
-
-void CLauncherViewApps::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_LAUNCHER_VIEW1_MENU)
-        {
-        // launch start check
-        aMenuPane->SetItemDimmed(ECmdLaunchApps, iContainer->Engine()->LaunchingIsActive());
-
-        // hide launch options when launching is active
-        aMenuPane->SetItemDimmed(ECmdLaunchOptions, iContainer->Engine()->LaunchingIsActive());
-
-        // EAknMarkAll
-        TBool allSelected = iContainer->ListBox()->SelectionIndexes()->Count() == iContainer->ListBox()->Model()->NumberOfItems();
-        aMenuPane->SetItemDimmed(EAknMarkAll, allSelected);
-
-        // EAknUnmarkAll
-        TBool noneSelected = iContainer->ListBox()->SelectionIndexes()->Count() == 0;
-        aMenuPane->SetItemDimmed(EAknUnmarkAll, noneSelected); 
-        }
-
-	else if (aResourceId == R_LAUNCHER_LAUNCHOPTIONS_SUBMENU)
-	    {
-	    if (iContainer->Engine()->SkipHiddenAndEmbedOnly())
-            aMenuPane->SetItemButtonState(ECmdSkipHiddenAndEmbedOnly, EEikMenuItemSymbolOn);
-	    else
-            aMenuPane->SetItemButtonState(ECmdDoNotSkipAnyFiles, EEikMenuItemSymbolOn);
-	    } 
-
-    else
-        {
-        AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewApps::HandleCommandL(TInt aCommand)
-// ---------------------------------------------------------
-//
-void CLauncherViewApps::HandleCommandL(TInt aCommand)
-    {  
-    switch ( aCommand )
-        {
-        case ECmdLaunchAppsWithAutoClose:
-            {
-            iContainer->Engine()->StartAppLaunchingL(iContainer->SelectedApps(), ETrue);
-            break;
-            }
-         
-        case ECmdLaunchAppsWithoutAutoClose:
-            {
-            iContainer->Engine()->StartAppLaunchingL(iContainer->SelectedApps(), EFalse);
-            break;
-            }
-
-        case ECmdSkipHiddenAndEmbedOnly:
-            {
-            iContainer->Engine()->SetSkipHiddenAndEmbedOnly(ETrue);
-            break;
-            }
-
-        case ECmdDoNotSkipAnyFiles:
-            {
-            iContainer->Engine()->SetSkipHiddenAndEmbedOnly(EFalse);
-            break;
-            }
-                        
-        case ECmdRefreshList:
-            {
-            iContainer->UpdateFileListL();
-            AknSelectionService::HandleMarkableListProcessCommandL( EAknMarkAll, iContainer->ListBox() );
-            break;
-            }
-
-        case EAknCmdMark:
-        case EAknCmdUnmark:
-        case EAknUnmarkAll:
-        case EAknMarkAll:
-            {
-            AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iContainer->ListBox() );
-            break;
-            }
-        
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewApps::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CLauncherViewApps::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewApps::DoActivateL(...)
-// ---------------------------------------------------------
-//
-void CLauncherViewApps::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    //AppUi()->AddToStackL( *this, iContainer );
-    iContainer->ActivateL();
-    iContainer->MakeVisible(ETrue);
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewApps::DoDeactivate()
-// ---------------------------------------------------------
-//
-void CLauncherViewApps::DoDeactivate()
-    {
-    iContainer->MakeVisible(EFalse);
-    //AppUi()->RemoveFromViewStack( *this, iContainer );
-    }
-
-// End of File
-
--- a/launcher/src/launcherviewoutput.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include  <aknviewappui.h>
-#include  <avkon.hrh>
-#include  <Launcher.rsg>
-#include  "LauncherViewOutput.h"
-#include  "LauncherContainerOutput.h" 
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CLauncherViewOutput::ConstructL(CLauncherEngine* aEngine)
-    {
-    BaseConstructL( R_LAUNCHER_VIEW2 );
-
-    iContainer = new (ELeave) CLauncherContainerOutput;
-    iContainer->SetMopParent(this);
-    iContainer->ConstructL( ClientRect(), aEngine );
-
-    AppUi()->AddToStackL( *this, iContainer );
-
-    aEngine->SetContainerOutput(iContainer);
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::~CLauncherViewOutput()
-// ---------------------------------------------------------
-//
-CLauncherViewOutput::~CLauncherViewOutput()
-    {
-    AppUi()->RemoveFromViewStack( *this, iContainer );
-    delete iContainer;
-    }
-
-// ---------------------------------------------------------
-// TUid CLauncherViewOutput::Id()
-// ---------------------------------------------------------
-//
-TUid CLauncherViewOutput::Id() const
-    {
-    return KView2Id;
-    }
-
-// ------------------------------------------------------------------------------
-// CLauncherViewApps::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ------------------------------------------------------------------------------
-//
-
-void CLauncherViewOutput::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_LAUNCHER_VIEW2_MENU)
-        {
-        // ...
-        }
-    else
-        {
-        AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::HandleCommandL(TInt aCommand)
-// ---------------------------------------------------------
-//
-void CLauncherViewOutput::HandleCommandL(TInt aCommand)
-    {   
-
-    switch ( aCommand )
-        {
-        case ECmdClearWindow:
-            {
-            iContainer->ClearOutputWindowL();
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CLauncherViewOutput::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::DoActivateL(...)
-// ---------------------------------------------------------
-//
-void CLauncherViewOutput::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    //AppUi()->AddToStackL( *this, iContainer );
-    iContainer->ActivateL();
-    iContainer->MakeVisible(ETrue);
-    }
-
-// ---------------------------------------------------------
-// CLauncherViewOutput::DoDeactivate()
-// ---------------------------------------------------------
-//
-void CLauncherViewOutput::DoDeactivate()
-    {
-    iContainer->MakeVisible(EFalse);
-    //AppUi()->RemoveFromViewStack( *this, iContainer );
-    }
-
-// End of File
-
--- a/launcher/src/launcherxmlparser.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,428 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-#include <f32file.h>
-#include <xml/documentparameters.h>
-#include "launcherxmlparser.h"
-#include "launchertraces.h"
-
-_LIT8(KXmlMimeType, "text/xml");
-
-/**
- * XML element names
- */
-_LIT8(KDll, "dll");
-_LIT8(KDllName, "dllname");
-_LIT8(KUID1, "uid1");
-_LIT8(KUID2, "uid2");
-_LIT8(KUID3, "uid3");
-_LIT8(KSID, "sid");
-_LIT8(KCapability, "capability");
-
-// ---------------------------------------------------------------------------
-
-CLauncherXMLParser::CLauncherXMLParser(RFs& aFs)
-:
-CActive( EPriorityLow ),
-iParser(0),
-iFileSession(aFs),
-iParsedBytes(0)
-    {
-    CActiveScheduler::Add( this );
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::ConstructL()
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::ConstructL");
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherXMLParser* CLauncherXMLParser::NewL(RFs& aFs)
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::NewL");
-    CLauncherXMLParser* self = CLauncherXMLParser::NewLC(aFs);    
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherXMLParser* CLauncherXMLParser::NewLC(RFs& aFs)
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::NewLC");
-    CLauncherXMLParser* self = new (ELeave) CLauncherXMLParser(aFs);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherXMLParser::~CLauncherXMLParser()
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::~CLauncherXMLParser");
-    Cancel();
-    delete iParser;
-    delete iCurrentDllElement;    
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::ClearXMLDataBuffer()
-    {
-    iXMLDataBuffer.Zero();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::DoCancel()
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::DoCancel");
-    iIgnoreError = ETrue;
-    if( iParser )
-        {
-        TRAP_IGNORE(iParser->ParseEndL());
-        }
-    iFile.Close();
-    ClearXMLDataBuffer();
-    }
-
-// ---------------------------------------------------------------------------
-// Gives current buffer content to parser for processing. Then reads
-// next part of the file in the buffer and waits for next scheduled run.
-
-void CLauncherXMLParser::RunL()
-    {
-    TInt err = iStatus.Int();
-    LOGSTRING2("Launcher: CLauncherXMLParser::RunL - iStatus: %d", err);
-    if( err != KErrNone )
-        {
-        iObserver->DocumentParsedL(err); // Observer should cancel parsing        
-        iFile.Close();
-        ClearXMLDataBuffer();
-        }
-    else
-        {        
-        iParsedBytes += iXMLDataBuffer.Length();
-        iObserver->ParsingProgressedL(iParsedBytes);
-        // Check if the end of the file is reached:
-        if( iXMLDataBuffer.Length() > 0)
-            {
-            // Parse the data in buffer 
-            LOGSTRING("Launcher: CLauncherXMLParser::RunL: Starting XML parsing");
-            if( iParser )
-                {
-                iParser->ParseL( iXMLDataBuffer );
-                }
-            else
-                {
-                LOGSTRING("CLauncherXMLParser::RunL - Error: NULL parser");
-                User::Leave(KErrGeneral);
-                }
-            // Read new data from XML file to buffer:
-            iFile.Read( iXMLDataBuffer, KXMLBufferSize, iStatus );
-            SetActive();
-            }
-        else
-            {
-            // End of the file reached. Stop parsing and close the file:
-            LOGSTRING("Launcher: CLauncherXMLParser::RunL: Data parsed. Stopping");
-            if( iParser )
-                {
-                iParser->ParseEndL();
-                }
-            iFile.Close();
-            ClearXMLDataBuffer();
-            }    
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::ParseL(const TDesC& aFilePath, MLauncherParserObserver* aObserver)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::ParseL: %S", &aFilePath);
-    iIgnoreError = EFalse;
-    iParsedBytes = 0;
-    if ( IsActive() )
-        {
-        Cancel();
-        }
-    
-    if( aObserver == 0 )
-        {
-        LOGSTRING("Launcher: CLauncherXMLParser::ParseL: Error: Observer is a NULL pointer.");
-        User::Leave(KErrArgument);
-        }
-    
-    // Open the XML-file
-    TInt err = iFile.Open( iFileSession, aFilePath, EFileRead );
-    User::LeaveIfError( err );
-    
-    // Create and start XML-parser:
-    delete iParser;
-    iParser = 0;
-    iParser = CParser::NewL(KXmlMimeType, *this);        
-        
-    // Set observer:
-    iObserver = aObserver;
-    
-    // Initialize the buffer and read first part of the XML-file:
-    ClearXMLDataBuffer();
-    iFile.Read( iXMLDataBuffer, KXMLBufferSize, iStatus );
-    SetActive();   
-    iParser->ParseBeginL(); // Reset the parser to xml-filetype
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnStartDocumentL(const Xml::RDocumentParameters& /*aDocParam*/, TInt aErrorCode)
-    {    
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartDocumentL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnEndDocumentL(TInt aErrorCode)
-    {    
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnEndDocumentL (Error code: %d)", aErrorCode);    
-    iObserver->DocumentParsedL(aErrorCode);
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnStartPrefixMappingL( const RString& /*aPrefix*/, 
-                                                const RString& /*aUri*/, 
-                                                TInt aErrorCode)
-    {    
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartPrefixMappingL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Launcer: CLauncherXMLParser::OnEndPrefixMappingL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnIgnorableWhiteSpaceL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnSkippedEntityL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnProcessingInstructionL(  const TDesC8& /*aTarget*/, 
-                                    const TDesC8& /*aData*/, 
-                                    TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnProcessingInstructionL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnError(TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnError: %d", aErrorCode);    
-    if( iIgnoreError == EFalse )
-        {        
-        TRAP_IGNORE(iObserver->DocumentParsedL(aErrorCode));
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TAny* CLauncherXMLParser::GetExtendedInterface(const TInt32 aUid)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::GetExtendedInterface (UID: %d)", aUid);
-    return 0;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnStartElementL(   const RTagInfo& aElement,
-                                            const RAttributeArray& /*aAttributes*/,
-                                            TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnStartElementL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    else
-        {
-        // Save XML-element name:
-        iCurrentElementName = aElement.LocalName().DesC();
-    
-        // If this is 'dll'-element, initialize new DLL element instance:
-        if( iCurrentDllElement == 0 && iCurrentElementName == KDll )
-            {
-            iCurrentDllElement = CLauncherDLLElement::NewL();
-            }
-        // Clear contents buffer:
-        iCurrentContent.Zero();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherXMLParser::OnEndElementL(const RTagInfo& aElement, TInt aErrorCode)
-    {   
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnEndElementL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    else
-        {
-        // Save XML-element's name:        
-        iCurrentElementName = aElement.LocalName().DesC();    
-        TUid tmpUID;
-
-        if( IsDataElement() )
-            {        
-            // Check that we have a pointer to parent DLL element
-            if( iCurrentDllElement == 0 )
-                {
-                LOGSTRING("Launcher: CLauncherXMLParser: Error in parsing xml (parent DLL element missing).");
-                User::Leave(KErrGeneral);
-                }
-            // DLL name
-            if( iCurrentElementName == KDllName )
-                {
-                TFileName dllName;
-                dllName.Copy(iCurrentContent);
-                iCurrentDllElement->SetNameL(dllName);
-                }
-            // UID1
-            else if( iCurrentElementName == KUID1 )
-                {
-                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
-                iCurrentDllElement->SetUID1L(tmpUID);
-                }
-            // UID2
-            else if( iCurrentElementName == KUID2 )
-                {
-                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
-                iCurrentDllElement->SetUID2L(tmpUID);
-                }
-            // UID3
-            else if( iCurrentElementName == KUID3 )
-                {
-                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
-                iCurrentDllElement->SetUID3L(tmpUID);
-                }
-            // SID
-            else if( iCurrentElementName == KSID )
-                {
-                tmpUID.iUid = ConvertDes8ToUint32L(iCurrentContent);
-                iCurrentDllElement->SetSIDL(tmpUID);
-                }
-            // Capability
-            else if( iCurrentElementName == KCapability )
-                {            
-                iCurrentDllElement->SetCapabilityL(ConvertDes8ToUint32L(iCurrentContent));
-                }
-            }
-        else if( iCurrentElementName == KDll )
-            {
-            // DLL element parsed, give current DLL object to observer:
-            iObserver->ElementParsedL(*iCurrentDllElement);
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CLauncherXMLParser::IsDataElement()
-    {
-    if( iCurrentElementName == KDllName ||
-        iCurrentElementName == KUID1 ||
-        iCurrentElementName == KUID2 ||
-        iCurrentElementName == KUID3 ||
-        iCurrentElementName == KSID ||
-        iCurrentElementName == KCapability )
-        {
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// ---------------------------------------------------------------------------
-// Reads content of an xml-element.
-
-void CLauncherXMLParser::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
-    {
-    LOGSTRING2("Launcher: CLauncherXMLParser::OnContentL (Error code: %d)", aErrorCode);
-    if( aErrorCode != KErrNone )
-        {
-        iObserver->DocumentParsedL(aErrorCode);
-        }
-    else if( iCurrentElementName.Length() == 0)
-        {
-        LOGSTRING("Launcher: CLauncherXMLParser: Error in parsing xml (element name missing).");
-        User::Leave(KErrGeneral);
-        }
-    iCurrentContent.Append(aBytes);
-    }
-
-// ---------------------------------------------------------------------------
-
-TUint32 CLauncherXMLParser::ConvertDes8ToUint32L(const TDesC8& aStr)
-    {
-    LOGSTRING("Launcher: CLauncherXMLParser::ConvertDes8ToUintL");
-    TUint32 uintVal = 0;
-    TLex8 lex(aStr);
-    TInt errorCode=lex.Val(uintVal, EHex);
-    User::LeaveIfError(errorCode);
-    return uintVal;
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbapplication.h>
+#include <launchermainwindow.h>
+
+
+int main(int argc, char *argv[])
+{
+
+    // Create application, main window.
+    HbApplication app(argc, argv);
+    // Create main window
+    LauncherMainWindow mainWindow;
+    // init main window
+    int error = mainWindow.init(app);
+    if(error)
+        return error;
+    // enter event loop
+    return app.exec();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/notifications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <hblabel.h>
+#include <hbdeviceprogressdialog.h>
+#include <hbmessagebox.h>
+
+
+#include "notifications.h"
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showMessageBox(HbMessageBox::MessageBoxType type, const QString &text, const QString &label, int timeout )
+{
+    HbMessageBox *messageBox = new HbMessageBox(type);
+    messageBox->setText(text);
+    if(label.length())
+        {
+        HbLabel *header = new HbLabel(label, messageBox);
+        messageBox->setHeadingWidget(header);
+        }
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(timeout);
+    messageBox->open();
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::about()
+{
+    Notifications::showMessageBox( 
+        HbMessageBox::MessageTypeInformation, 
+        "Version 4.0.0 - 3rd March 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.", 
+        "About Launcher"
+        );
+}
+
+// ---------------------------------------------------------------------------
+
+HbDeviceProgressDialog* Notifications::showWaitDialog(const QString &text)
+{
+    HbDeviceProgressDialog *note = new HbDeviceProgressDialog( HbProgressDialog::WaitDialog );
+    note->setText( text );
+    note->setAction(0);
+    note->show();
+    return note;
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showInformationNote(const QString &text)
+{
+    Notifications::showMessageBox( 
+        HbMessageBox::MessageTypeInformation,
+        text, 
+        "", // no label
+        3000
+        );
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showErrorNote(const QString &text)
+{
+    Notifications::showMessageBox( 
+        HbMessageBox::MessageTypeWarning,
+        text, 
+        "", // no label
+        3000
+        );
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/outputview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <hbdocumentloader.h>
+#include <launchermainwindow.h>
+#include <hbaction.h>
+#include <hbmenu.h>
+#include <hbtextedit.h>
+
+#include "enginewrapper.h"
+#include "commonactions.h"
+#include "outputview.h"
+
+// xml definition of view
+const char *OUTPUTVIEW_XML = ":/xml/outputview.xml";
+
+// name of the output view object in the xml file.
+const char *OUTPUTVIEW = "outputview";
+const char *ACTIONCLEAR = "actionClearWindow";
+const char *TEXTOUTPUT = "textEdit";
+const char *ACTIONOPENAPPLICATIONVIEW = "actionOpenApplicationView";
+
+// ---------------------------------------------------------------------------
+
+
+OutputView::OutputView():
+    mActionClear(0),
+    mActionOpenApplicationView(0),
+    mTextOutput(0)
+{
+
+}
+
+// ---------------------------------------------------------------------------
+
+OutputView::~OutputView()
+{
+    if(mActionClear)
+        mActionClear->deleteLater();
+    if(mActionOpenApplicationView)
+        mActionOpenApplicationView->deleteLater();
+}
+
+
+// ---------------------------------------------------------------------------
+
+OutputView* OutputView::create(HbDocumentLoader &loader, 
+                        CommonActions *commonActions)
+{
+    // Load application view from xml-file
+    bool ok = false;
+    loader.load(OUTPUTVIEW_XML, &ok);
+    
+    // Output View:
+    QGraphicsWidget *widget = loader.findWidget(OUTPUTVIEW);
+    Q_ASSERT_X(ok && (widget != 0), "Launcher", "Invalid launcher.xml file");
+    OutputView *outputView = qobject_cast<OutputView *>(widget);
+    
+    // initialize view
+    outputView->init(loader, commonActions);
+    
+    return outputView;
+}
+
+// ---------------------------------------------------------------------------
+
+
+void OutputView::loadItemsFromXml(HbDocumentLoader &loader)
+{
+
+    // List widget:
+    QGraphicsWidget *widget = loader.findWidget(TEXTOUTPUT);
+    Q_ASSERT_X((widget != 0), "Launcher", "Invalid launcher.xml file");
+    mTextOutput = qobject_cast<HbTextEdit *>(widget);
+
+    // clear action:
+    QObject *object= loader.findObject(ACTIONCLEAR);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionClear = qobject_cast<HbAction *>(object);
+    
+    // open output view
+    object= loader.findObject(ACTIONOPENAPPLICATIONVIEW);
+    Q_ASSERT_X((object != 0), "Launcher", "Invalid launcher.xml file");
+    mActionOpenApplicationView = qobject_cast<HbAction *>(object);
+
+}
+
+// ---------------------------------------------------------------------------
+
+
+void OutputView::init(HbDocumentLoader &loader, CommonActions *commonActions)
+{
+    loadItemsFromXml(loader);
+    connectSignalsAndSlots();
+
+    // set text edit components settings
+    mTextOutput->setPlainText("Ready.\n\n");
+    mTextOutput->setReadOnly(true);
+    mTextOutput->setCursorVisibility( Hb::TextCursorHidden );
+    mTextOutput->setAttribute(Qt::WA_InputMethodEnabled, false);
+    
+    // add actions to menu
+    commonActions->addActionsToMenu(menu());
+
+}
+
+// ---------------------------------------------------------------------------
+
+void OutputView::connectSignalsAndSlots()
+{
+    // Clear action
+    connect(mActionClear, SIGNAL(triggered()), this, SLOT(clearOutput()));
+    connect(mActionOpenApplicationView, SIGNAL(triggered()), this, SLOT(openApplicationView()));
+}
+
+// ---------------------------------------------------------------------------
+
+void OutputView::clearOutput()
+{
+    mTextOutput->setPlainText("");
+}
+
+// ---------------------------------------------------------------------------
+
+void OutputView::printText(const QString &text)
+{
+    QString newText = mTextOutput->toPlainText() + text;
+    mTextOutput->setPlainText(newText);
+    mTextOutput->setCursorPosition(newText.length()-1);
+}
+
+// ---------------------------------------------------------------------------
+
+void OutputView::openApplicationView()
+{
+    qDebug("openApplicationView");
+    LauncherMainWindow *pMainWindow = static_cast< LauncherMainWindow * >( mainWindow() );
+    if( pMainWindow )
+        {
+        pMainWindow->openApplicationView();
+        }
+}
+
+// ---------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/outputview.xml	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.2">
+    <object name="actionClearWindow" type="HbAction">
+        <string name="iconText" value="Clear window"/>
+    </object>
+    <object name="actionOpenApplicationView" type="HbAction">
+        <string name="iconText" value="Open application view"/>
+        <string name="text" value="Open application view"/>
+        <string name="toolTip" value="Open application view"/>
+    </object>
+    <widget name="outputview" type="OutputView">
+        <widget name="OutputContent" role="HbView:widget" type="HbWidget">
+            <widget name="textEdit" type="HbTextEdit">
+                <string name="plainText" value="Text"/>
+                <sizehint height="5.970149423688901un" type="PREFERRED" width="22.388060338833377un"/>
+            </widget>
+            <layout type="anchor" widget="OutputContent">
+                <anchoritem dst="textEdit" dstEdge="LEFT" spacing="0.0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="textEdit" dstEdge="TOP" spacing="0.0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="textEdit" dstEdge="RIGHT" spacing="0.0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="textEdit" dstEdge="BOTTOM" spacing="0.0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <widget name="viewMenu" role="HbView:menu" type="HbMenu">
+            <ref object="actionClearWindow" role="HbMenu:addAction"/>
+        </widget>
+        <widget name="viewToobar" role="HbView:toolBar" type="HbToolBar">
+            <ref object="actionOpenApplicationView" role="HbToolBar:addAction"/>
+        </widget>
+        <string name="title" value="Output"/>
+    </widget>
+    <metadata display="QHD portrait" unit="un"/>
+</hbdocument>
--- a/launcher/symbian_version.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Symbian version configuration file 
-*
-*/
-
-#ifndef __SYMBIAN_VERSION_HRH
-#define __SYMBIAN_VERSION_HRH
-
-// S60 and Symbian version number enumeration definitions
-
-#define S60_30                                              30
-#define S60_31                                              31
-#define S60_32                                              32
-#define S60_50                                              50
-#define S60_51                                              91
-#define S60_52                                              92
-#define SYMBIAN_1                                           50
-#define SYMBIAN_2                                           91
-#define SYMBIAN_3                                           92
-#define SYMBIAN_4                                           101
-
-
-/**
- * Defines the S60 or Symbian version used by this component. This flag can be
- * used to variate the source code based on the SDK in use. The value of the
- * flag should be always changed to reflect the current build environment.
- */
-#define SYMBIAN_VERSION_SUPPORT                              SYMBIAN_4
-
-
-#endif  // __SYMBIAN_VERSION_HRH
--- a/layers.sysdef.xml	Mon May 03 12:32:02 2010 +0300
+++ b/layers.sysdef.xml	Fri May 14 15:53:02 2010 +0300
@@ -15,6 +15,24 @@
 			<module name="perfmon">
 				<unit unitID="tools.perfmonqt" mrp="" bldFile="&layer_real_source_path;/perfmon" name="perfmon" proFile="perfmon.pro" />
 			</module>
+			<module name="htiui">
+				<unit unitID="tools.htiuiqt" mrp="" bldFile="&layer_real_source_path;/htiui" name="htiui" proFile="htiui.pro" />
+			</module>
+			<module name="creator">
+				<unit unitID="tools.creatorqt" mrp="" bldFile="&layer_real_source_path;/creator" name="creator" proFile="creator.pro" />
+			</module>
+			<module name="filebrowser">
+				<unit unitID="tools.filebrowserqt" mrp="" bldFile="&layer_real_source_path;/filebrowser" name="filebrowser" proFile="filebrowser.pro" />
+			</module>
+			<module name="launcher">
+				<unit unitID="tools.launcherqt" mrp="" bldFile="&layer_real_source_path;/launcher" name="launcher" proFile="launcher.pro" />
+			</module>
+			<module name="loadgen">
+				<unit unitID="tools.loadgenqt" mrp="" bldFile="&layer_real_source_path;/loadgen" name="loadgen" proFile="loadgen.pro" />
+			</module>
+			<module name="memspyui">
+				<unit unitID="tools.memspyuiqt" mrp="" bldFile="&layer_real_source_path;/memspyui" name="memspyui" proFile="memspyui.pro" />
+			</module>			
     </layer>
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- a/loadgen/data/loadgen.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1418 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-NAME MATT
-
-#include <eikon.rh>
-#include <eikon.rsg>
-#include <eikon.hrh>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <avkon.mbg>
-#include <CommonDialogs.hrh>
-#include <CommonDialogs.rh>
-#include <pathconfiguration.hrh>
-#include <data_caging_paths_strings.hrh>
-#include <appinfo.rh>
-
-#include "loadgen.hrh"
-#include "loadgen_std.h"
-
-
-// ---------------------------------------------------------
-//   
-//    Define the resource file signature 
-//    This resource should be empty.
-//
-// ---------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//   
-//    Default Document Name
-//
-// ---------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name { buf=""; }
-
-// ---------------------------------------------------------
-//   
-//    Define default menu and CBA key.
-//
-// ---------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-    {
-    //status_pane = r_loadgen_status_pane;
-    //menubar = r_loadgen_menubar;
-    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
-    }
-
-    
-//----------------------------------------------------
-//   
-//    r_loadgen_hotkeys
-//
-//----------------------------------------------------
-//
-RESOURCE HOTKEYS r_loadgen_hotkeys
-    {
-    control=
-        {
-        HOTKEY { command=EAknCmdExit; key='e'; }
-        };
-    }
-
-
-//----------------------------------------------------
-//    r_loadgen_view_main
-//----------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_loadgen_view_main
-    {
-    hotkeys=r_loadgen_hotkeys;
-    menubar=r_loadgen_menubar_view_main;  
-    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
-    }
-
-//----------------------------------------------------
-//    r_loadgen_menubar_view_main
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_loadgen_menubar_view_main
-    {
-    titles=
-        {
-        MENU_TITLE { menu_pane=r_loadgen_app_menu; txt="App"; },
-        MENU_TITLE { menu_pane=r_loadgen_view_main_menu; txt="Main"; }
-        };
-    }
-
-//----------------------------------------------------
-//    r_loadgen_view_main_menu
-//----------------------------------------------------
-//
-
-RESOURCE MENU_PANE r_loadgen_view_main_menu
-    {
-    items=
-        {
-        };
-    }
-
-           
-        
-//----------------------------------------------------
-//    r_loadgen_app_menu
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_loadgen_app_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=ELoadGenCmdNewLoad; txt="New load"; cascade=r_loadgen_newload_submenu; },
-        MENU_ITEM { command=ELoadGenStopAll; txt="Stop all"; },
-        MENU_ITEM { command=ELoadGenSuspendAll; txt="Suspend all"; },
-        MENU_ITEM { command=ELoadGenResumeAll; txt="Resume all"; },
-        MENU_ITEM { command=ELoadGenCmdLaunchPerfMon; txt="Launch PerfMon"; },
-        MENU_ITEM { command=ELoadGenCmdAbout; txt="About"; },
-        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
-        };
-    }
-
-RESOURCE MENU_PANE r_loadgen_newload_submenu
-    {
-    items = 
-        {
-        MENU_ITEM { command=ELoadGenCmdNewLoadCPULoad; txt="CPU load"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadEatMemory; txt="Eat memory"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadPhoneCall; txt="Phone calls"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadMessages; txt="Messages"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadNetConn; txt="Network conn."; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadKeyPress; txt="Key presses"; },        
-        MENU_ITEM { command=ELoadGenCmdNewLoadApplications; txt="Applications"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadPhotoCaptures; txt="Photo captures"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadBluetooth; txt="Bluetooth actions"; },
-        MENU_ITEM { command=ELoadGenCmdNewLoadPointerEvent; txt="Pointer events"; }
-        };
-    }
-    
-//----------------------------------------------------
-//    r_loadgen_settings_dialog
-//    Dialog for setting list
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_loadgen_settings_dialog
-    {
-    flags =
-        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
-        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
-        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
-    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtSettingListBox;
-            id = ELoadGenSettingItemList;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = LISTBOX
-                {
-                flags = EAknListBoxSelectionList;
-                };
-            }
-        };
-    }
-
-//----------------------------------------------------
-//    r_loadgen_settings_menubar
-//----------------------------------------------------
-//
-
-RESOURCE MENU_BAR r_loadgen_settings_menubar
-    {
-    titles =
-        {
-        MENU_TITLE
-            {
-            menu_pane = r_loadgen_settings_menupane;
-            txt = " ";   // dummy
-            }
-        };
-    }
-
-RESOURCE MENU_PANE r_loadgen_settings_menupane
-    {
-    items =
-        {
-        MENU_ITEM
-            {
-            command = ELoadGenCmdSettingsChange;
-            txt = "Change";
-            },
-        MENU_ITEM
-            {
-            command = ELoadGenCmdSettingsExit;
-            txt = "Exit";
-            }
-        };
-    }
-
-
-
-  
-// ---------------------------------------------------------
-//   
-//   r_loadgen_about_dialog
-//   About dialog - show version and copyright info etc.
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_loadgen_about_dialog
-    {
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-                {
-                label = "About LoadGen";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-                {
-                message = "Version 1.4.0 - 30th September 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_general_confirmation_query
-// ---------------------------------------------------------
-//
-
-RESOURCE DIALOG r_general_confirmation_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY
-                {
-                layout = EConfirmationQueryLayout;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_general_text_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_text_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items=
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout = EDataLayout;
-                control = EDWIN
-                    {
-                    width = 256;
-                    lines = 3;
-                    maxlength = 256;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_general_text_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_general_numeric_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control= AVKON_DATA_QUERY
-                {
-                layout = ENumberLayout;
-                control = AVKON_INTEGER_EDWIN
-                    {
-                    min = -999999;
-                    max = 999999;
-                    };
-                };
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   r_item_action_query
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_item_action_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        AVKON_LIST_QUERY_DLG_LINE
-            {
-            control= AVKON_LIST_QUERY_CONTROL
-                {
-                listtype = EAknCtSinglePopupMenuListBox;
-                listbox = AVKON_LIST_QUERY_LIST
-                    {
-                    array_id = r_item_action_query_array;
-                    };
-                heading = "";
-                };
-            }
-        };
-    }
-
-RESOURCE ARRAY r_item_action_query_array
-    {
-    items =
-        {
-        LBUF {txt = "Stop"; },
-        LBUF {txt = "Resume/suspend"; },
-        LBUF {txt = "Edit"; }
-        };
-    }     
-
-
-// ---------------------------------------------------------
-//   r_cpuload_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_cpuload_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_cpuload_form;
-    }
-
-RESOURCE FORM r_cpuload_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenCPULoadQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Load mode";
-            id = ELoadGenCPULoadQueryMode;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_cpuloadmode_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Type";
-            id = ELoadGenCPULoadQueryType;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_cpuloadtype_textarray;
-                active = 0;    
-                };
-            }
-        };
-    }
-
-RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_length
-    {
-    type = EEikCtNumberEditor;
-    prompt = "Length (ms)";
-    id = ELoadGenCPULoadQueryLength;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = NUMBER_EDITOR
-        {
-        min = 0;    
-        max = 999999999;    
-        };
-    }
-
-RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_idle
-    {
-    type = EEikCtNumberEditor;
-    prompt = "Idle (ms)";
-    id = ELoadGenCPULoadQueryIdle;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = NUMBER_EDITOR
-        {
-        min = 0;    
-        max = 999999999;    
-        };
-    }
-
-RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_variance
-    {
-    type = EEikCtNumberEditor;
-    prompt = "Random variance (%)";
-    id = ELoadGenCPULoadQueryVariance;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = NUMBER_EDITOR
-        {
-        min = 0;    
-        max = 100;    
-        };
-    }
-
-RESOURCE DLG_LINE r_cpuload_dlg_line_cpu
-    {
-    type = EAknCtPopupFieldText;
-    prompt = "CPU";
-    id = ELoadGenCPULoadQueryCpu;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = POPUP_FIELD_TEXT
-        {
-        popupfield = POPUP_FIELD
-            {
-            width = 100;
-            };
-        textarray = r_cpuloadcpu_textarray;
-        active = 0;    
-        };
-    }
-
-                
-// ---------------------------------------------------------
-//   r_memoryeat_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_memoryeat_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_memoryeat_form;
-    }
-
-RESOURCE FORM r_memoryeat_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenMemoryEatQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Source";
-            id = ELoadGenMemoryEatQuerySource;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_memoryeatsource_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Type";
-            id = ELoadGenMemoryEatQueryType;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_memoryeattype_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Buffer (B)";
-            id = ELoadGenMemoryEatQueryBuffer;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Idle after buffer (ms)";
-            id = ELoadGenMemoryEatQueryIdle;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenMemoryEatQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }
-
-RESOURCE DLG_LINE r_memoryeat_dlg_line_amount
-    {
-    type = EEikCtEdwin;
-    prompt = "Amount (B)";
-    id = ELoadGenMemoryEatQueryAmount;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = EDWIN
-        {
-        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
-        maxlength = 14;    
-        width = 6;
-        default_input_mode = EAknEditorNumericInputMode;
-        allowed_input_modes = EAknEditorNumericInputMode;    
-        };
-    }
-    
-RESOURCE DLG_LINE r_memoryeat_dlg_line_random_min
-    {
-    type = EEikCtEdwin;
-    prompt = "Min to be left (B)";
-    id = ELoadGenMemoryEatQueryRandomMin;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = EDWIN
-        {
-        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
-        maxlength = 14;    
-        width = 6;
-        default_input_mode = EAknEditorNumericInputMode;
-        allowed_input_modes = EAknEditorNumericInputMode;    
-        };
-    }
-
-RESOURCE DLG_LINE r_memoryeat_dlg_line_random_max
-    {
-    type = EEikCtEdwin;
-    prompt = "Max to be left (B)";
-    id = ELoadGenMemoryEatQueryRandomMax;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = EDWIN
-        {
-        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
-        maxlength = 14;    
-        width = 6;
-        default_input_mode = EAknEditorNumericInputMode;
-        allowed_input_modes = EAknEditorNumericInputMode;    
-        };
-    }
-
-
-
-// ---------------------------------------------------------
-//   r_phonecall_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_phonecall_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_phonecall_form;
-    }
-
-RESOURCE FORM r_phonecall_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenPhoneCallQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Phone number";
-            id = ELoadGenPhoneCallQueryDestination;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Length (ms)";
-            id = ELoadGenPhoneCallQueryLength;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Idle (ms)";
-            id = ELoadGenPhoneCallQueryIdle;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenPhoneCallQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   r_netconn_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_netconn_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_netconn_form;
-    }
-
-RESOURCE FORM r_netconn_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenNetConnQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Destination URL";
-            id = ELoadGenNetConnQueryDestination;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Idle (ms)";
-            id = ELoadGenNetConnQueryIdle;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenNetConnQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }
-
-
-// ---------------------------------------------------------
-//   r_keypress_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_keypress_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_keypress_form;
-    }
-
-RESOURCE FORM r_keypress_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenKeyPressQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Heartbeat (ms)";
-            id = ELoadGenKeyPressQueryHeartBeat;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenKeyPressQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }    
-
-// ---------------------------------------------------------
-//   r_pointerevent_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_pointerevent_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_pointerevent_form;
-    }
-
-RESOURCE FORM r_pointerevent_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenPointerEventQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Heartbeat (ms)";
-            id = ELoadGenPointerEventQueryHeartBeat;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenPointerEventQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_messages_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_messages_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_messages_form;
-    }
-
-RESOURCE FORM r_messages_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenMessagesQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },
-            DLG_LINE
-                {
-                type = EAknCtPopupFieldText;
-                prompt = "Type";
-                id = ELoadGenMessagesQueryType;
-                itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                control = POPUP_FIELD_TEXT
-                    {
-                    popupfield = POPUP_FIELD
-                        {
-                        width = 100;
-                        };
-                    textarray = r_message_type_textarray;
-                    active = 0;    
-                    };
-                },            
-        DLG_LINE
-            {
-            type = EEikCtEdwin;
-            prompt = "Phone number";
-            id = ELoadGenMessagesQueryDestination;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = EDWIN
-                {
-                width = 255;    
-                maxlength = 255;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Maximum amount of messages";
-            id = ELoadGenMessagesQueryAmount;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 1000;    
-                };
-            },            
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Message length";
-            id = ELoadGenMessagesQueryLength;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 512;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Idle (ms)";
-            id = ELoadGenMessagesQueryIdle;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenMessagesQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_applicatios_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_applications_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_applications_form;
-    }
-
-RESOURCE FORM r_applications_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Priority";
-            id = ELoadGenApplicationsQueryPriority;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_thread_priority_textarray;
-                active = 0;    
-                };
-            },            
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Max parallel applications";
-            id = ELoadGenApplicationsMaxOpen;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Launching interval (ms)";
-            id = ELoadGenApplicationsLaunchingInterval;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-            
-        DLG_LINE
-            {
-            type = EAknCtPopupFieldText;
-            prompt = "Key press type";
-            id = ELoadGenApplicationsKeyPressType;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = POPUP_FIELD_TEXT
-                {
-                popupfield = POPUP_FIELD
-                    {
-                    width = 100;
-                    };
-                textarray = r_applications_keypress_type_textarray;
-                active = 0;    
-                };
-            },            
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Key press interval (ms)";
-            id = ELoadGenApplicationsKeyPressQueryHeartBeat;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 999999999;    
-                };
-            },
-        DLG_LINE
-            {
-            type = EEikCtNumberEditor;
-            prompt = "Random variance (%)";
-            id = ELoadGenApplicationsQueryVariance;
-            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-            control = NUMBER_EDITOR
-                {
-                min = 0;    
-                max = 100;    
-                };
-            }
-        };
-    }    
-
-// ---------------------------------------------------------
-//   r_photocapture_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_photocapture_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_photocapture_form;
-    }
-
-RESOURCE FORM r_photocapture_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-                DLG_LINE
-                    {
-                    type = EAknCtPopupFieldText;
-                    prompt = "Priority";
-                    id = ELoadGenPhotoCaptureQueryPriority;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = POPUP_FIELD_TEXT
-                        {
-                        popupfield = POPUP_FIELD
-                            {
-                            width = 100;
-                            };
-                        textarray = r_thread_priority_textarray;
-                        active = 0;    
-                        };
-                    },
-                DLG_LINE
-                    {
-                    type = EEikCtNumberEditor;
-                    prompt = "Idle (ms)";
-                    id = ELoadGenPhotoCaptureQueryIdle;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = NUMBER_EDITOR
-                        {
-                        min = 0;    
-                        max = 999999999;    
-                        };
-                    },
-                DLG_LINE
-                    {
-                    type = EEikCtNumberEditor;
-                    prompt = "Random variance (%)";
-                    id = ELoadGenPhotoCaptureQueryVariance;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = NUMBER_EDITOR
-                        {
-                        min = 0;    
-                        max = 100;    
-                        };
-                    }
-        };
-    }
-
-/*RESOURCE DLG_LINE r_photocapture_dlg_line_periodic_idle
-    {
-    type = EEikCtNumberEditor;
-    prompt = "Idle (ms)";
-    id = ELoadGenPhotoCaptureQueryIdle;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = NUMBER_EDITOR
-        {
-        min = 0;    
-        max = 999999999;    
-        };
-    }
-
-RESOURCE DLG_LINE r_photocapture_dlg_line_periodic_variance
-    {
-    type = EEikCtNumberEditor;
-    prompt = "Random variance (%)";
-    id = ELoadGenPhotoCaptureQueryVariance;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = NUMBER_EDITOR
-        {
-        min = 0;    
-        max = 100;    
-        };
-    }*/
-
-RESOURCE DLG_LINE r_photocapture_dlg_line_device
-    {
-    type = EAknCtPopupFieldText;
-    prompt = "Device";
-    id = ELoadGenPhotoCaptureQueryDevice;
-    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-    control = POPUP_FIELD_TEXT
-        {
-        popupfield = POPUP_FIELD
-            {
-            width = 100;
-            };
-        textarray = r_photocapturedevice_textarray;
-        active = 0;    
-        };
-    }
-
-// ---------------------------------------------------------
-//   r_photocapture_form_dialog
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_bluetooth_form_dialog
-    {
-    flags = EAknDialogGenericFullScreen;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    form = r_bluetooth_form;
-    }
-
-RESOURCE FORM r_bluetooth_form
-    {
-    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
-    items = 
-        {
-                DLG_LINE
-                    {
-                    type = EAknCtPopupFieldText;
-                    prompt = "Priority";
-                    id = ELoadGenBluetoothQueryPriority;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = POPUP_FIELD_TEXT
-                        {
-                        popupfield = POPUP_FIELD
-                            {
-                            width = 100;
-                            };
-                        textarray = r_thread_priority_textarray;
-                        active = 0;    
-                        };
-                    },
-                DLG_LINE
-                    {
-                    type = EEikCtNumberEditor;
-                    prompt = "Idle (ms)";
-                    id = ELoadGenBluetoothQueryIdle;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = NUMBER_EDITOR
-                        {
-                        min = 0;    
-                        max = 999999999;    
-                        };
-                    },
-                DLG_LINE
-                    {
-                    type = EEikCtNumberEditor;
-                    prompt = "Random variance (%)";
-                    id = ELoadGenBluetoothQueryVariance;
-                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
-                    control = NUMBER_EDITOR
-                        {
-                        min = 0;    
-                        max = 100;    
-                        };
-                    }
-        };
-    }
-
-// ---------------------------------------------------------
-// Arrays for forms:    
-    
-RESOURCE ARRAY r_thread_priority_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Much less (-20)"; },
-        LBUF { txt = "Less (-10)"; },
-        LBUF { txt = "Normal (0)"; },
-        LBUF { txt = "More (10)"; },
-        LBUF { txt = "Much more (20)"; },
-        LBUF { txt = "Real time (30)"; },
-        LBUF { txt = "Abs. very low (100)"; },
-        LBUF { txt = "Abs. low (200)"; },
-        LBUF { txt = "Abs. backgr. (300)"; },
-        LBUF { txt = "Abs. foregr. (400)"; },
-        LBUF { txt = "Abs. high (500)"; }
-        };
-    } 
-
-RESOURCE ARRAY r_cpuloadmode_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Yielding"; },
-        LBUF { txt = "Blocking"; }
-        };
-    } 
-    
-RESOURCE ARRAY r_cpuloadtype_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Continuous"; },
-        LBUF { txt = "Periodic"; }
-        };
-    }       
-
-RESOURCE ARRAY r_cpuloadcpu_textarray
-    {
-    items =
-        {
-        LBUF { txt = "CPU0"; }
-        };
-    }       
-
-RESOURCE ARRAY r_memoryeatsource_textarray
-    {
-    items =
-        {
-        LBUF { txt = "RAM"; },
-        LBUF { txt = "C:"; },
-        LBUF { txt = "D:"; },
-        LBUF { txt = "E:"; },
-        LBUF { txt = "F:"; },
-        LBUF { txt = "G:"; },
-        LBUF { txt = "H:"; },
-        LBUF { txt = "I:"; },
-        LBUF { txt = "J:"; },
-        LBUF { txt = "K:"; },
-        LBUF { txt = "L:"; },
-        LBUF { txt = "M:"; },
-        LBUF { txt = "N:"; }
-        };
-    }
-    
-RESOURCE ARRAY r_memoryeattype_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Memory to eat"; },
-        LBUF { txt = "Memory to be left"; },
-        LBUF { txt = "Alternate min/max"; }
-        };
-    }
-    
-RESOURCE ARRAY r_message_type_textarray
-    {
-    items =
-        {
-        LBUF { txt = "SMS"; },
-        LBUF { txt = "MMS"; }
-        };
-    } 
-
-RESOURCE ARRAY r_applications_keypress_type_textarray
-    {
-    items =
-        {
-        LBUF { txt = "None"; },
-        LBUF { txt = "Arrow keys"; }
-        };
-    } 
-
-RESOURCE ARRAY r_photocapturedevice_textarray
-    {
-    items =
-        {
-        LBUF { txt = "Camera 1"; }
-        };
-    } 
-
-
-// ---------------------------------------------------------
-//   
-//    RESOURCE LOCALISABLE_APP_INFO
-//
-// ---------------------------------------------------------
-//
-RESOURCE LOCALISABLE_APP_INFO r_loadgen_localisable_app_info
-    {
-    short_caption = "LoadGen";
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = "Load Gener.";
-
-        number_of_icons = 1;
-
-        // Note for ROM-based apps it is recommended to add the drive letter
-        // icon_file = "z:"APP_BITMAP_DIR"\\myapp_aif.mif";
-        icon_file = APP_BITMAP_DIR"\\loadgen_aif.mif";
-        };
-    }
--- a/loadgen/data/loadgen_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-#include <loadgen.rsg>
-#include <appinfo.rh>
-#include <data_caging_paths_strings.hrh>
-
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x20011384
-
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "LoadGen";
-    localisable_resource_file = APP_RESOURCE_DIR"\\LoadGen";
-    localisable_resource_id = R_LOADGEN_LOCALISABLE_APP_INFO;
-    group_name = "RnD Tools";    
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_HRH
+#define LOADGEN_HRH
+
+enum TLoadGenCommandIds
+    {
+    ELoadGenCmdNewLoad,    
+    ELoadGenCmdNewLoadCPULoad,    
+    ELoadGenCmdNewLoadEatMemory,    
+    ELoadGenCmdNewLoadPhoneCall,    
+    ELoadGenCmdNewLoadNetConn,    
+    ELoadGenCmdNewLoadKeyPress,    
+    ELoadGenCmdNewLoadMessages,
+    ELoadGenCmdNewLoadApplications,
+    ELoadGenCmdNewLoadPhotoCaptures,
+    ELoadGenCmdNewLoadBluetooth,
+    ELoadGenCmdNewLoadPointerEvent,
+    ELoadGenStopAll,
+    ELoadGenSuspendAll,
+    ELoadGenResumeAll,
+
+    ELoadGenCmdLaunchPerfMon,
+    ELoadGenCmdAbout,
+
+    ELoadGenCmdSettingsChange,
+    ELoadGenCmdSettingsExit,
+    ELoadGenCmdSettingsBack,
+
+    ELoadGenSettingItemList
+    };
+
+enum TEditorFormItemIds
+    {
+    ELoadGenCPULoadQueryPriority = 1000,
+    ELoadGenCPULoadQueryMode,
+    ELoadGenCPULoadQueryType,
+    ELoadGenCPULoadQueryLength,
+    ELoadGenCPULoadQueryIdle,
+    ELoadGenCPULoadQueryVariance,
+    ELoadGenCPULoadQueryCpu,
+
+    ELoadGenMemoryEatQueryPriority,
+    ELoadGenMemoryEatQuerySource,
+    ELoadGenMemoryEatQueryType,
+    ELoadGenMemoryEatQueryBuffer,
+    ELoadGenMemoryEatQueryIdle,
+    ELoadGenMemoryEatQueryAmount,
+    ELoadGenMemoryEatQueryRandomMin,
+    ELoadGenMemoryEatQueryRandomMax,
+    ELoadGenMemoryEatQueryVariance,
+    
+    ELoadGenPhoneCallQueryPriority,
+    ELoadGenPhoneCallQueryDestination,
+    ELoadGenPhoneCallQueryLength,
+    ELoadGenPhoneCallQueryIdle,
+    ELoadGenPhoneCallQueryVariance,
+    
+    ELoadGenNetConnQueryPriority,
+    ELoadGenNetConnQueryDestination,
+    ELoadGenNetConnQueryIdle,
+    ELoadGenNetConnQueryVariance,
+   
+    ELoadGenKeyPressQueryPriority,
+    ELoadGenKeyPressQueryHeartBeat,
+    ELoadGenKeyPressQueryVariance,
+        
+    ELoadGenMessagesQueryPriority,        
+    ELoadGenMessagesQueryType,            // Message type
+    ELoadGenMessagesQueryDestination,     // Phone number
+    ELoadGenMessagesQueryAmount,          // Messages
+    ELoadGenMessagesQueryLength,          // Message length
+    ELoadGenMessagesQueryMessage,         // Message
+    ELoadGenMessagesQueryIdle,            // idle period 
+    ELoadGenMessagesQueryVariance,
+
+    ELoadGenApplicationsQueryPriority,
+    ELoadGenApplicationsLaunchingInterval,
+    ELoadGenApplicationsKeyPressQueryHeartBeat,
+    ELoadGenApplicationsMaxOpen,
+    ELoadGenApplicationsKeyPressType,
+    ELoadGenApplicationsQueryVariance,
+    
+    ELoadGenPhotoCaptureQueryPriority,
+    ELoadGenPhotoCaptureQueryDevice,    
+    ELoadGenPhotoCaptureQueryIdle,
+    ELoadGenPhotoCaptureQueryVariance,
+           
+    ELoadGenBluetoothQueryPriority,
+    ELoadGenBluetoothQueryIdle,
+    ELoadGenBluetoothQueryVariance,
+    
+    ELoadGenPointerEventQueryPriority,
+    ELoadGenPointerEventQueryHeartBeat,
+    ELoadGenPointerEventQueryVariance
+    };
+
+enum TItemActionMenuTypes
+    {
+    EItemActionMenuTypeStop = 0,
+    EItemActionMenuTypeSuspendResume,    
+    EItemActionMenuTypeEdit    
+    };
+
+enum TThreadPriorityTypes
+    {
+    EThreadPriorityTypeMuchLess = 0,    
+    EThreadPriorityTypeLess,    
+    EThreadPriorityTypeNormal,    
+    EThreadPriorityTypeMore,    
+    EThreadPriorityTypeMuchMore,    
+    EThreadPriorityTypeRealTime,    
+    EThreadPriorityTypeAbsoluteVeryLow,    
+    EThreadPriorityTypeAbsoluteLow,    
+    EThreadPriorityTypeAbsoluteBackground,    
+    EThreadPriorityTypeAbsoluteForeground,    
+    EThreadPriorityTypeAbsoluteHigh
+    };
+
+enum TCpuLoadMode
+    {
+    ECpuLoadModeYielding = 0,
+    ECpuLoadModeBlocking    
+    };
+                    
+enum TCpuLoadTypes
+    {
+    ECpuLoadTypeContinuous = 0,
+    ECpuLoadTypePeriodic    
+    };
+
+enum TMemoryEatTypes
+    {
+    EMemoryEatTypeMemoryToEat = 0,
+    EMemoryEatTypeMemoryToBeLeft,
+    EMemoryEatTypeWavy
+    };        
+
+enum TMemoryEatSourceTypes
+    {
+    EMemoryEatSourceTypeRAM = 0,
+    EMemoryEatSourceTypeDriveC,
+    EMemoryEatSourceTypeDriveD,
+    EMemoryEatSourceTypeDriveE,
+    EMemoryEatSourceTypeDriveF,
+    EMemoryEatSourceTypeDriveG,
+    EMemoryEatSourceTypeDriveH,
+    EMemoryEatSourceTypeDriveI,
+    EMemoryEatSourceTypeDriveJ,
+    EMemoryEatSourceTypeDriveK,
+    EMemoryEatSourceTypeDriveL,
+    EMemoryEatSourceTypeDriveM,
+    EMemoryEatSourceTypeDriveN
+    };
+
+enum TMessageTypes
+    {
+    EMessageTypeSMS = 0,
+    EMessageTypeMMS
+    };      
+
+enum TApplicationsKeyPressTypes
+    {
+    EApplicationsKeyPressTypeNone = 0,
+    EApplicationsKeyPressTypeArrows
+    };      
+
+enum TApplicationsEventTypes
+    {
+    EApplicationsCloseApplication = 0,
+    EApplicationsLaunchApplication
+    };      
+
+#endif      // LOADGEN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_applications.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef LOADGEN_APPLICATIONS_H
+#define LOADGEN_APPLICATIONS_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <w32std.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CLauncherEngine;
+
+// CLASS DECLARATIONS
+
+class CAppLauncher : public CLoadBase
+    {
+public:
+    static CAppLauncher* NewL( TApplicationsAttributes& aAttributes,
+                                TInt aReferenceNumber );
+    virtual ~CAppLauncher();
+        
+private: // Constructors
+    CAppLauncher( TApplicationsAttributes& aAttributes, 
+                    TInt aReferenceNumber );
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TApplicationsAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TApplicationsAttributes aAttributes) { iAttributes = aAttributes; }
+	
+
+public:  // New static methods
+    static TInt ThreadFunction( TAny* aThreadArg );
+
+private:  // New static methods
+    static void GenerateLoad( TApplicationsAttributes& aAttributes );
+
+private: // Data
+    TApplicationsAttributes         iAttributes;    
+    RThread                         iThread;
+    };
+
+// Class to start launching applications in given period 
+
+// CLASS DECLARATIONS
+class CAppLauncherManager : public CActive
+    {
+public:
+    static CAppLauncherManager* NewL( TApplicationsAttributes& aAttributes );
+    ~CAppLauncherManager();
+
+private:
+    CAppLauncherManager( TApplicationsAttributes& aAttributes );
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack( TAny* aAny );
+    void SimulateEventL();
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TApplicationsAttributes&    iAttributes;    
+    CPeriodic*                  iPeriodicTimer;
+    RWsSession                  iWsSession;
+    CLauncherEngine*            iLauncherEngine;
+    TInt                        iAppEventType;
+    }; 
+
+// A class where applicationg launching and ending is implemented 
+#include <aknappui.h>
+#include <apgcli.h>
+
+// FORWARD DECLARATIONS
+class CAppKeyPressManager;
+
+// CLASS DECLARATIONS
+class CLauncherEngine : public CBase
+    {
+public:
+    static CLauncherEngine* NewL( TApplicationsAttributes& aAttributes );
+    ~CLauncherEngine();
+
+public:
+    void StartAppLaunchingL();
+    void StopApplication( TBool aRandomApplication );
+    
+    
+private:
+    CLauncherEngine( TApplicationsAttributes& aAttributes );
+    void ConstructL();
+    TBool LaunchApplicationL();
+    void DoLaunchApplicationL();
+
+public:    
+    inline TInt AppLaunchCounter() { return iAppLaunchCounter; }
+    
+private:
+    RTimer          iTimer;
+    RApaLsSession   iLs;
+    RWsSession      iWs;
+    TInt            iAppLaunchCounter;
+    TUid            iCurrentAppUid;
+    TThreadId       iCurrentAppThreadId;
+    TBuf<128>       iCurrentAppNameAndExt;
+    RThread         iCurrentAppThread;
+    TInt            iParallelApplicationsCounter;
+    TApplicationsAttributes&    iAttributes;
+
+    CAppKeyPressManager* iAppKeyPressManager;
+    };
+
+
+// A class where key presses can be added to application
+#include <e32cmn.h>
+// FORWARD DECLARATIONS
+class CApplicationKeyPresses;
+// CLASS DECLARATIONS
+class CAppKeyPressManager : public CBase
+    {
+public:
+    static CAppKeyPressManager* NewL( TApplicationsAttributes& aAttributes );
+    ~CAppKeyPressManager();
+    void AddNewApplicationUidToKeyEventsL( TUid aUid );
+    TUid KillApplication( TBool aRandomApplication );
+    
+private:
+    CAppKeyPressManager( TApplicationsAttributes& aAttributes );
+    void ConstructL();
+
+private:
+    RPointerArray<CApplicationKeyPresses> iKeyPresses;
+    TApplicationsAttributes& iAttributes;    
+    }; 
+
+// A class which sends key press events to application
+// CLASS DECLARATIONS
+class CApplicationKeyPresses : public CBase
+    {
+public:
+    static CApplicationKeyPresses* NewL( TUid aUid, 
+                                            TApplicationsAttributes& aAttributes );
+    ~CApplicationKeyPresses();
+    
+private:
+    CApplicationKeyPresses( TUid aUid, TApplicationsAttributes& aAttributes );
+    void ConstructL();
+
+private:
+    static TInt PeriodicTimerCallBack( TAny* aAny );
+    void SimulateKeyEvent();
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TUid                        iUid;
+    TApplicationsAttributes&    iAttributes;
+    CPeriodic*                  iPeriodicTimer;
+    RWsSession                  iWsSession;
+public:
+    inline TUid ApplicationUid() { return iUid; };    
+    }; 
+
+#endif // LOADGEN_APPLICATIONS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_bluetooth.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef LOADGEN_BLUETOOTH_H
+#define LOADGEN_BLUETOOTH_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <centralrepository.h>
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+#include <es_sock.h>
+#include <bt_sock.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATIONS
+
+class CBluetooth : public CLoadBase
+    {
+public:
+    static CBluetooth* NewL(TBluetoothAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CBluetooth();
+        
+private: // Constructors
+    CBluetooth(TBluetoothAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TBluetoothAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TBluetoothAttributes aAttributes) { iAttributes = aAttributes; }
+    
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+    
+private:  // New static methods
+    static void GenerateLoad(TBluetoothAttributes& aAttributes);    
+    void InitializeBluetoothL();
+    TBool SetBTPowerState(TBool aState);
+    
+private: // Data
+           
+    TBluetoothAttributes    iAttributes;    
+    RThread                 iThread; 
+    };
+ 
+
+
+ 
+class CBTManager : public CActive//, public MBTPowerManagerObserver
+    {
+    public:
+        
+        static CBTManager* NewL(TBluetoothAttributes& aAttrs);
+        virtual ~CBTManager();
+ 
+    private:
+        
+        CBTManager( TBluetoothAttributes& aAttrs);
+        void ConstructL();
+        TInt StartBTDeviceDiscovery();
+ 
+    private:
+            
+        static TInt PeriodicTimerCallBack(TAny* aAny);        
+    public:
+                                                        
+        /**
+         * From CActive:
+         */
+        void RunL();
+        void DoCancel();       
+
+    private:
+        
+        CPeriodic*              iPeriodicTimer;
+        TBluetoothAttributes&   iAttributes;  
+        CRepository*            iBTPowerStateCRepo;
+        RSocketServ             iSocketServerHnd;
+        RHostResolver           iHostResolver;        
+        TNameEntry              iBTNameEntry;        
+    };
+
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_cpuload.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#ifndef LOADGEN_CPULOAD_H
+#define LOADGEN_CPULOAD_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATIONS
+
+class CCPULoad : public CLoadBase
+    {
+public:
+    static CCPULoad* NewL(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CCPULoad();
+        
+private: // Constructors
+    CCPULoad(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TCPULoadAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TCPULoadAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+
+private:  // New static methods
+    static void GenerateLoad(TCPULoadAttributes& aAttributes);
+    static void DoHeaveStuff(TInt aMode);
+
+private: // Data
+    TCPULoadAttributes      iAttributes;    
+    RThread                 iThread;
+    };
+ 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_keypress.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_KEYPRESS_H
+#define LOADGEN_KEYPRESS_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <w32std.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATIONS
+
+class CKeyPress : public CLoadBase
+    {
+public:
+    static CKeyPress* NewL(TKeyPressAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CKeyPress();
+        
+private: // Constructors
+    CKeyPress(TKeyPressAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TKeyPressAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TKeyPressAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+
+private:  // New static methods
+    static void GenerateLoad(TKeyPressAttributes& aAttributes);
+
+private: // Data
+    TKeyPressAttributes         iAttributes;    
+    RThread                     iThread;
+    };
+
+
+class CKeyPressManager : public CActive
+    {
+public:
+    static CKeyPressManager* NewL(TKeyPressAttributes& aAttributes);
+    ~CKeyPressManager();
+
+private:
+    CKeyPressManager(TKeyPressAttributes& aAttributes);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack(TAny* aAny);
+    void SimulateKeyEvent();
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TKeyPressAttributes&    iAttributes;    
+    CPeriodic*              iPeriodicTimer;
+    RWsSession              iWsSession;
+    }; 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_loadattributes.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_LOADATTRIBUTES_H
+#define LOADGEN_LOADATTRIBUTES_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <badesca.h> // CDesCArray
+
+const TInt KCPUSelection_FreeScheduling = -1;
+const TInt KCPUSelection_AllCPUs        = 999;
+
+// FORWARD DECLARATIONS
+
+
+// CLASS DECLARATIONS
+class TCPULoadAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TUint iMode;        
+    TUint iType;        
+    TUint iLength;        
+    TUint iIdle;        
+    TUint iRandomVariance;
+    // iCpu defines in which CPU the load thread should be executed in 
+    // (in SMP environments). 0 = CPU0, 1 = CPU1 etc. Negative value means 
+    // that CPU is undefined. When CPU is undefined, Scheduler can schedule
+    // the load thread freely to any CPU as it pleases.
+    TInt  iCpu;
+    // Defines how many CPUs the running system has.
+    TUint iCpuCount;
+    };
+
+class TMemoryEatAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TUint iSource;        
+    TUint iType;
+    TUint iBuffer;
+    TUint iIdle;
+    TInt64 iAmount;
+    TInt64 iRandomMin;
+    TInt64 iRandomMax;
+    TBuf<64> iAmountDes;
+    TBuf<64> iRandomMinDes;
+    TBuf<64> iRandomMaxDes;
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    }; 
+
+class TPhoneCallAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TBuf<128> iDestination;
+    TUint iLength;        
+    TUint iIdle;        
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TNetConnAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TBuf<128> iDestination;
+    TUint iIdle;        
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TKeyPressAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TUint iHeartBeat;        
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TPointerEventAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;        
+    TUint iHeartBeat;        
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TMessageAttributes
+    {
+public:
+    TUint iId;
+    TInt iMessageType;
+    TBuf<128> iDestination;
+    TUint iPriority; 
+    TUint iAmount;
+    TInt iLength;    
+    TUint iIdle;    
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TApplicationsAttributes
+    {
+public:
+    TUint iId;        
+    TUint iPriority;
+    TUint iLaunchingInterval;
+    TUint iKeyPressType;
+    TUint iMaxOpen;
+    TUint iHeartBeat;
+    TUint iRandomVariance;
+    CDesCArray* iAppsArray;
+    TRequestStatus* iDeathStatus;
+    };
+
+
+class TPhotoCaptureAttributes
+    {
+public:
+    TUint iId;    
+    TInt iPriority;
+    TInt iCameraCount;
+    TInt iCamera;
+    TUint iIdle;    
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    };
+
+class TBluetoothAttributes
+    {
+public:
+    TUint iId;    
+    TInt iPriority;    
+    TUint iIdle;    
+    TUint iRandomVariance;        
+    TRequestStatus* iDeathStatus;
+    TBool iBluetoothSupported;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_loadbase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_LOADBASE_H
+#define LOADGEN_LOADBASE_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include "loadgen_loadbase.h"
+
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATIONS
+
+class CLoadBase : public CBase
+    {
+public:
+    enum TLoadState
+        {
+        ELoadStateInvalid = -1,
+        ELoadStateConstructed,
+        ELoadStateRunning,
+        ELoadStateSuspended,
+        ELoadStateClosed
+        };
+        
+protected: // Constructors
+    CLoadBase();
+    void ConstructL();
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TInt State() { return iState; }
+    inline TInt Type() { return iType; }
+
+protected: // Data
+    TInt iState;
+    TInt iType;
+    };
+ 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_memoryeat.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_MEMORYEAT_H
+#define LOADGEN_MEMORYEAT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATIONS
+
+class CMemoryEat : public CLoadBase
+    {
+public:
+    static CMemoryEat* NewL(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CMemoryEat();
+        
+private: // Constructors
+    CMemoryEat(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TMemoryEatAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TMemoryEatAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+private:
+    static void GenerateLoad(TMemoryEatAttributes& aAttributes);
+
+private: // Data
+    TMemoryEatAttributes    iAttributes;    
+    RThread                 iThread;
+    };
+
+
+class CMemoryEatManager : public CActive
+    {
+public:
+    static CMemoryEatManager* NewL(TMemoryEatAttributes& aAttributes);
+    ~CMemoryEatManager();
+
+private:
+    CMemoryEatManager(TMemoryEatAttributes& aAttributes);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack(TAny* aAny);
+    void InitMemoryEatL();
+    void DestroyMemoryEat();
+    void EatMemoryL();
+    void DoEatMemoryL( TInt64 aNewSize );
+    void HandleEatMemoryL( TInt64 aNewSize );
+    void AllocMemoryL( TInt64 aNewSize );
+    void FreeMemoryL( TInt64 aNewSize );
+    TInt64 ReadFreeMemory();
+    
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TMemoryEatAttributes&   iAttributes;    
+    CPeriodic*              iPeriodicTimer;
+    RChunk                  iEatChunk;
+    RFile                   iEatFile;
+    RFs                     iFs;
+    TBool                   iWavyEatMoreMemory;
+    TInt     iFilesCounter;
+    };
+     
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_messages.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,422 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_MESSAGES_H
+#define LOADGEN_MESSAGES_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CSmsHandler;
+class CMmsHandler;
+
+const TInt EMaxMessageLength = 512;
+
+// CLASS DECLARATIONS
+
+class CMessages : public CLoadBase
+    {
+public:
+    static CMessages* NewL( TMessageAttributes& aAttributes, TInt aReferenceNumber );
+    virtual ~CMessages();
+        
+private: // Constructors
+    CMessages( TMessageAttributes& aAttributes, TInt aReferenceNumber );
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TMessageAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TMessageAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction( TAny* aThreadArg );
+
+private:  // New static methods
+    static void GenerateLoad( TMessageAttributes& aAttributes );
+
+private: // Data
+    TMessageAttributes            iAttributes;    
+    RThread                     iThread;
+
+    };
+
+
+class CMessageManager : public CActive
+    { 
+private:
+    enum TState
+        {
+        EStateIdle = 0,
+        EStateSend,
+        EStateSending        
+        };
+public:
+    static CMessageManager* NewL( TMessageAttributes& aAttributes );
+    virtual ~CMessageManager();
+
+
+private:
+    CMessageManager( TMessageAttributes& aAttributes );
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack( TAny* aAny );
+    void HandleMessageSending();
+    void DoDial();
+    void DoHangup();
+    void CreateMessage();    
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+    void HandleStatus( TInt aErr );
+
+private:
+    TMessageAttributes&                   iAttributes;
+    CPeriodic*                          iPeriodicTimer;
+    TInt                                iState;
+    CSmsHandler*                        iSmsHandler;
+    CMmsHandler*                        iMmsHandler;
+    TInt                                iMessageCounter;
+    HBufC*                                iMessage;
+    }; 
+
+//  INCLUDES
+#include <e32base.h>
+#include <msvapi.h>
+#include <mtuireg.h>
+#include <txtrich.h>
+// CONSTANTS
+const TInt KBfrLength = 20;
+const TInt KTelephoneNumberMaxLength = 100;
+ 
+// FORWARD DECLARATIONS
+class CSmsAppUi;
+class CClientMtmRegistry;
+class CSmsClientMtm;
+ 
+// CLASS DECLARATION
+/**
+* CSmsHandler application engine class.
+* Takes care of sending and receiveing SMS messages using the SMS client MTM.
+* Interacts with the application UI class.
+*/
+class CSmsHandler : public CActive, public MMsvSessionObserver
+    {
+    public: // Constructors and destructor
+ 
+        /**
+        * NewL.
+        * Two-phased constructor.
+        * @param aSmsAppUi Pointer to AppUi instance.
+        * @return Pointer to the created instance of CSmsHandler.
+        */
+        static CSmsHandler* NewL( CMessageManager& aManager );
+ 
+        /**
+        * NewLC.
+        * Two-phased constructor.
+        * @param aSmsAppUi Pointer to AppUi instance.
+        * @return Pointer to the created instance of CSmsHandler.
+        */
+        static CSmsHandler* NewLC( CMessageManager& aManager );
+ 
+        /**
+        * ~CSmsHandler
+        * Destructor.
+        */
+        virtual ~CSmsHandler();
+ 
+    public: // New functions
+        /**
+        * SendL.
+        * Starts the process of creating and sending an SMS message.
+        * @param aRecipientNumber The number of the recipent.
+        * @param aMessageText The message text.
+        * @return ETrue if successful, EFalse if not.
+        */
+       TBool SendL( const TDesC& aRecipientNumber,
+                    const TDesC& aMessageText );
+ 
+    public: // Functions from base classes
+ 
+        /**
+        * From MMsvSessionObserver, HandleSessionEventL.
+        * Handles notifications of events from the Message Server.
+        * @param aEvent The event that has taken place
+        * @param aArg1 Event type-specific argument value
+        * @param aArg2 Event type-specific argument value
+        * @param aArg3 Event type-specific argument value
+        */
+        void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1,
+                                  TAny* aArg2, TAny* aArg3 );
+ 
+    protected: // Functions from base classes
+ 
+        /**
+        * From CActive, DoCancel.
+        * Cancels any outstanding requests.
+        */
+        void DoCancel();
+ 
+        /**
+        * From CActive, RunL.
+        * Handles an active object’s request completion event.
+        */
+        void RunL();
+ 
+    private: // Constructors
+ 
+        /**
+        * CSmsHandler.
+        * C++ default constructor.
+        * @param aSmsAppUi Pointer to AppUi instance.
+        */
+        CSmsHandler( CMessageManager& aManager );
+ 
+        /**
+        * ConstructL.
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+ 
+    private: // New functions
+ 
+        /**
+        * AccessMtmL.
+        * Access the MTM Registry and create an SMS specific Client MTM instance.
+        */
+        void AccessMtmL();
+ 
+        /**
+        * CreateMsgL.
+        * Create an SMS message.
+        * @return ETrue if successful, EFalse is unsuccessful.
+        */
+        TBool CreateMsgL();
+ 
+        /**
+        * ScheduleL.
+        * Schedule an SMS message for sending.
+        */
+        void ScheduleL();
+ 
+        /**
+        * ValidateL.
+        * Validate an SMS message.
+        * @return ETrue if successful, EFalse is unsuccessful.
+        */
+        TBool ValidateL();
+ 
+    private: // Enumeration
+ 
+        /**
+        * TState, enumeration for the state of the handler, used by RunL().
+        */
+        enum TState
+            {
+            EWaitingForMoving = 1,
+            EWaitingForScheduling
+            };
+ 
+    private: // Data
+ 
+        /**
+        * iState, the state of the handler.
+        */
+        TState iState;
+ 
+        /**
+        * iSession, the contact database.
+        * Owned by CSmsHandler object.
+        */
+        CMsvSession* iSession;
+ 
+        /**
+        * iMtmRegistry, client MTM registry.
+        * Owned by CSmsHandler object.
+        */
+        CClientMtmRegistry* iMtmRegistry;
+ 
+        /**
+        * iSmsMtm, SMS specific Client MTM.
+        * Owned by CSmsHandler object.
+        */
+        CSmsClientMtm* iSmsMtm;
+ 
+        /**
+        * iOperation, the current message server operation.
+        * Owned by CSmsHandler object.
+        */
+        CMsvOperation* iOperation;
+ 
+        /**
+        * iRecipientNumber, telephone number of the recipient.
+        */
+        TBuf<KTelephoneNumberMaxLength> iRecipientNumber;
+ 
+        /**
+        * iMessageText, SMS message text.
+        */
+        TBuf<EMaxMessageLength> iMessageText;
+
+ 
+        /**
+        * iSmsAppUi, application UI
+        * Not owned by CSmsHandler object.
+        */
+        CSmsAppUi* iSmsAppUi;
+ 
+        /**
+        * iMtmUiRegistry, User Interface MTM Registry.
+        * Owned by CSmsHandler object.
+        */
+        CMtmUiRegistry* iMtmUiRegistry;
+        
+        CMessageManager& iManager;
+ 
+    };
+
+
+// INCLUDES
+#include <msvapi.h>                         // for MMsvSessionObserver 
+#include <mmsclient.h>                      // for CMmsClientMtm
+#include <coecntrl.h>
+
+// Forward declarations
+class CClientMtmRegistry;
+class CMsvSession;
+
+//
+// Container class to draw text on screen
+//
+class CMmsHandler : public CBase, public MMsvSessionObserver
+    {
+public: // Constructors and destructor
+
+    /**
+    * NewL.
+    * Two-phased constructor.
+    * @param aSmsAppUi Pointer to AppUi instance.
+    * @return Pointer to the created instance of CSmsHandler.
+    */
+    static CMmsHandler* NewL( CMessageManager& aManager );
+
+    /**
+    * NewLC.
+    * Two-phased constructor.
+    * @param aSmsAppUi Pointer to AppUi instance.
+    * @return Pointer to the created instance of CSmsHandler.
+    */
+    static CMmsHandler* NewLC( CMessageManager& aManager );
+
+    /**
+    * ~CSmsHandler
+    * Destructor.
+    */
+    virtual ~CMmsHandler();
+
+private: // Constructors
+
+    /**
+    * CSmsHandler.
+    * C++ default constructor.
+    * @param aSmsAppUi Pointer to AppUi instance.
+    */
+    CMmsHandler( CMessageManager& aManager );
+
+    /**
+    * ConstructL.
+    * 2nd phase constructor.
+    */
+    void ConstructL();
+
+public: // New functions
+    
+    /*
+     * Creates client MTM registry when session is ready for use. 
+     * This completes model construction and is called after 'server
+     * ready' event is received after async opening of CMsvSession.
+     */ 
+    void CompleteConstructL();
+       
+    /*
+     * CMmsHandler::CreateNewMessageL()
+     * Creates a new message server entry and set up default values.
+     * In case the attachment file does not found method return EFalse
+     * otherwise ETrue.
+     * There are differenses how to add attachment file between 2nd and 3rd edition.
+     */  
+     TBool CreateMsgL();
+
+    /**
+     * Send the message.
+     * Return values: ETrue or EFalse
+     */
+    TBool SendMessageL();
+        
+     /**
+      * SendL.
+      * Starts the process of creating and sending an SMS message.
+      * @param aRecipientNumber The number of the recipent.
+      * @param aMessageText The message text.
+      * @return ETrue if successful, EFalse if not.
+      */
+     TBool SendL( const TDesC& aRecipientNumber,
+                 const TDesC& aMessageText );     
+           
+private:    
+    // from MMsvSessionObserver
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+  
+    void SetMessageBodyL();
+
+private:
+
+    CMsvSession* iSession;          // Client session on the message server
+    CMmsClientMtm* iMmsMtm;         // Message Type Module (MMS)
+    CClientMtmRegistry* iMtmReg;    // Mtm client registry for creating new mtms
+
+    /**
+    * iRecipientNumber, telephone number of the recipient.
+    */
+    TBuf<KTelephoneNumberMaxLength> iRecipientNumber;
+
+    /**
+    * iMessageText, SMS message text.
+    */
+    TBuf<EMaxMessageLength> iMessageText;
+    
+    CMessageManager& iManager;
+    
+    };
+#endif // LOADGEN_MESSAGES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_netconn.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_NETCONN_H
+#define LOADGEN_NETCONN_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <DownloadMgrClient.h> 
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CNetConnManager;
+
+
+// CLASS DECLARATIONS
+
+class CNetConn : public CLoadBase
+    {
+public:
+    static CNetConn* NewL(TNetConnAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CNetConn();
+        
+private: // Constructors
+    CNetConn(TNetConnAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TNetConnAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TNetConnAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+
+private:  // New static methods
+    static void GenerateLoad(TNetConnAttributes& aAttributes);
+
+private: // Data
+    TNetConnAttributes          iAttributes;    
+    RThread                     iThread;
+    };
+
+
+class CNetConnManager : public CActive, public MHttpDownloadMgrObserver
+    {
+public:
+    static CNetConnManager* NewL(TNetConnAttributes& aAttributes);
+    ~CNetConnManager();
+
+private:
+    CNetConnManager(TNetConnAttributes& aAttributes);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack(TAny* aAny);
+    void StartDownloadL();
+
+private: // MHttpDownloadMgrObserver
+    void HandleDMgrEventL(RHttpDownload& aDownload, THttpDownloadEvent aEvent); 
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TNetConnAttributes&     iAttributes;    
+    CPeriodic*              iPeriodicTimer;
+    RHttpDownloadMgr        iDownloadMgr;
+    }; 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_phonecall.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_PHONECALL_H
+#define LOADGEN_PHONECALL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <etel3rdparty.h>
+
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CPhoneCallManager;
+class CDialer;
+
+
+// CLASS DECLARATIONS
+
+class CPhoneCall : public CLoadBase
+    {
+public:
+    static CPhoneCall* NewL(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CPhoneCall();
+        
+private: // Constructors
+    CPhoneCall(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TPhoneCallAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TPhoneCallAttributes aAttributes) { iAttributes = aAttributes; }
+	
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+
+private:  // New static methods
+    static void GenerateLoad(TPhoneCallAttributes& aAttributes);
+
+private: // Data
+    TPhoneCallAttributes        iAttributes;    
+    RThread                     iThread;
+    };
+
+    
+
+class CPhoneCallManager : public CActive
+    { 
+private:
+    enum TState
+        {
+        EStateIdle = 0,
+        EStateCall
+        };
+public:
+    static CPhoneCallManager* NewL(TPhoneCallAttributes& aAttributes);
+    ~CPhoneCallManager();
+
+private:
+    CPhoneCallManager(TPhoneCallAttributes& aAttributes);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack(TAny* aAny);
+    void HandleCalls();
+    void DoDial();
+    void DoHangup();
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+    void HandleStatus(TInt aErr);
+
+private:
+    TPhoneCallAttributes&               iAttributes;
+    CDialer*                            iDialer;   
+    CPeriodic*                          iPeriodicTimer;
+    TInt                                iState;
+    }; 
+
+
+class CDialer : public CActive
+    { 
+public:
+    static CDialer* NewL(CPhoneCallManager& aManager);
+    ~CDialer();
+
+private:
+    CDialer(CPhoneCallManager& aManager);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+public:
+    void Dial(const TDesC& aDestination);
+    void Hangup();
+
+private:
+    CPhoneCallManager&                  iManager;
+    CTelephony*                         iTelephony;
+    CTelephony::TCallId                 iCallId;
+    CTelephony::TCallParamsV1           iCallParams;
+    CTelephony::TCallParamsV1Pckg       iCallParamsPckg;
+    };
+        
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_photocapture.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_PHOTOCAPTURE_H
+#define LOADGEN_PHOTOCAPTURE_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <ecam.h>  // CCamera, MCameraObserver
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CCameraManager;
+
+
+// CLASS DECLARATIONS
+
+class CPhotoCapture : public CLoadBase
+    {
+public:
+    static CPhotoCapture* NewL(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CPhotoCapture();
+        
+private: // Constructors
+    CPhotoCapture(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TPhotoCaptureAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TPhotoCaptureAttributes aAttributes) { iAttributes = aAttributes; }
+
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+    //static void SetImagesReady(TInt aImages);
+    //static TInt ImagesReady();
+
+private:  // New static methods
+    static void GenerateLoad(TPhotoCaptureAttributes& aAttributes);
+    static void DoHeaveStuff(TInt aMode);
+
+private: // Data
+    TPhotoCaptureAttributes iAttributes;    
+    RThread                 iThread;
+    //static TInt             iImagesReady;
+    };
+ 
+
+
+ 
+class CCameraManager : public CActive, public MCameraObserver
+    {
+    public:
+        
+        static CCameraManager* NewL(TPhotoCaptureAttributes& aAttrs);        
+        virtual ~CCameraManager();
+ 
+    private:
+        
+        CCameraManager(TPhotoCaptureAttributes& aAttrs);
+        void ConstructL();
+ 
+    private:
+        /**
+         * From MCameraObserver:
+         */         
+        virtual void ReserveComplete(TInt aError);
+        virtual void PowerOnComplete(TInt aError);
+        virtual void ViewFinderFrameReady(CFbsBitmap& aFrame);
+        virtual void ImageReady(CFbsBitmap* aBitmap,
+                HBufC8* aData, TInt aError);
+        virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,
+                TInt aError);
+    
+        static TInt PeriodicTimerCallBack(TAny* aAny);
+    public:
+        
+        /**
+         * Reserves the camera.
+         */
+        void ReserveCameraL();
+        
+        /**
+         * Takes a picture.
+         */
+        void CapturePhotoL();
+        
+        TInt NumberOfPictures();
+                                        
+        /**
+         * From CActive:
+         */
+        void RunL();
+        void DoCancel();
+ 
+    private:
+        
+        enum TState
+            {
+            ENotReady,
+            ECameraReserved,
+            EIdle,
+            ECapture
+            };
+
+        CPeriodic*                  iPeriodicTimer;
+        TPhotoCaptureAttributes&    iAttributes;
+        CCamera*                    iCamera;
+        TState                      iState;
+        TInt                        iNumOfPics;
+        TCameraInfo                 iCameraInfo;
+        TInt                        iCurrentCamera;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_pointerevent.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_POINTEREVENT_H
+#define LOADGEN_POINTEREVENT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <w32std.h>
+
+#include "loadgen_loadbase.h"
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+
+
+
+// CLASS DECLARATIONS
+
+class CPointerEvent : public CLoadBase
+    {
+public:
+    static CPointerEvent* NewL(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
+    virtual ~CPointerEvent();
+        
+private: // Constructors
+    CPointerEvent(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
+    void ConstructL();  
+
+public:  // New methods
+    virtual void Resume();
+    virtual void Suspend();
+    virtual void SetPriority();
+    virtual void Close();
+    virtual TPtrC Description();
+    inline TPointerEventAttributes& Attributes() { return iAttributes; }
+	inline void SetAttributes(TPointerEventAttributes aAttributes) { iAttributes = aAttributes; }
+
+public:  // New static methods
+    static TInt ThreadFunction(TAny* aThreadArg);
+
+private:  // New static methods
+    static void GenerateLoad(TPointerEventAttributes& aAttributes);
+
+private: // Data
+    TPointerEventAttributes         iAttributes;    
+    RThread                     iThread;
+    };
+
+
+class CPointerEventManager : public CActive
+    {
+public:
+    static CPointerEventManager* NewL(TPointerEventAttributes& aAttributes);
+    ~CPointerEventManager();
+
+private:
+    CPointerEventManager(TPointerEventAttributes& aAttributes);
+    void ConstructL();
+
+private:
+    void RunL();
+    void DoCancel();
+
+private:
+    static TInt PeriodicTimerCallBack(TAny* aAny);
+    void SimulatePointerEvent();
+
+public:
+    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
+
+private:
+    TPointerEventAttributes&    iAttributes;    
+    CPeriodic*                  iPeriodicTimer;
+    //RWsSession                  iWsSession;
+    }; 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_std.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_STD_H
+#define LOADGEN_STD_H
+
+
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_traces.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+
+#ifndef __LOADGEN_TRACES_H__
+#define __LOADGEN_TRACES_H__
+
+#include <e32def.h>
+
+
+// ---------------------------------------------------------------------------
+// You change these logging method values below! Recompile the application to take changes effect.
+
+    // logging methods
+    // 0 = No logging
+    // 1 = Flogger
+    // 2 = RDebug
+    // 3 = Flogger and RDebug
+    
+    #ifndef _DEBUG
+        
+        // Logging method for UREL builds:
+        #define LOADGEN_LOGGING_METHOD  3
+
+    #else
+
+        // Logging method for UDEB builds:
+        #define LOADGEN_LOGGING_METHOD  3
+
+    #endif    
+    
+
+
+// ---------------------------------------------------------------------------
+// Do not make any changes to lines below...
+
+    #if LOADGEN_LOGGING_METHOD == 1 || LOADGEN_LOGGING_METHOD == 3
+
+        #include <flogger.h>
+        _LIT(KLogFolder,"loadgen");
+        _LIT(KLogFile,"loadgen_trace.txt");
+
+    #endif
+
+    #if LOADGEN_LOGGING_METHOD == 2 || LOADGEN_LOGGING_METHOD == 3
+
+        #include <e32debug.h>
+
+    #endif
+
+
+    #if LOADGEN_LOGGING_METHOD == 0
+    
+        #define LOGTEXT(AAA)
+        #define LOGSTRING(AAA)
+        #define LOGSTRING2(AAA,BBB)
+        #define LOGSTRING3(AAA,BBB,CCC)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD)
+    
+    
+    #elif LOADGEN_LOGGING_METHOD == 1
+    
+        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+   
+    #elif LOADGEN_LOGGING_METHOD == 2
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
+    
+    #elif LOADGEN_LOGGING_METHOD == 3
+    
+        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
+        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
+        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
+        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
+        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
+
+    #endif
+
+// ---------------------------------------------------------------------------
+
+#endif // __LOADGEN_TRACES_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/inc/loadgen_utils.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_UTILS_H
+#define LOADGEN_UTILS_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+const TUint KHalFunction_EKernelHalNumLogicalCpus = 16; //EKernelHalNumLogicalCpus
+const TUint KHalFunction_EKernelHalLockThreadToCpu = 19; //EKernelHalLockThreadToCpu
+
+class CLoadGenUtils {
+
+public:
+		static TThreadPriority SettingItemToThreadPriority(TInt aIndex);
+		static void SettingItemToThreadDescription(TInt aIndex, TDes& aBuf);
+		static void SettingItemToSourceDescription(TInt aIndex, TDes& aBuf);
+		static TInt MilliSecondsToMicroSeconds(TInt aMilliSeconds, TInt aRandomVariance=0);
+		static TInt RandomNumber(TInt aMin, TInt aMax);
+		static TSize ScreenSize();
+
+private:
+          /* Desctructor pure Virtual -> static class cannot be instantiated or inherited */
+		virtual ~CLoadGenUtils()=0;	
+	    static TInt64 iRandomNumberSeed;
+
+};
+
+#endif		  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_applications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,686 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_applications.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+#include "loadgen_traces.h"
+
+_LIT(KThreadName, "Applications %d");
+
+const TInt KDefaultStartDelay = 500;
+const TInt KThreadNameLength = 64;
+const TInt KDescriptorBufSize = 256;
+const TInt KPriorityBufSize = 16;
+const TInt KScanCodeStart = 32;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CAppLauncher* CAppLauncher::NewL( TApplicationsAttributes& aAttributes, TInt aReferenceNumber )
+    {
+    CAppLauncher* self = new(ELeave) CAppLauncher( aAttributes, aReferenceNumber );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CAppLauncher::~CAppLauncher()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CAppLauncher::CAppLauncher(  
+           TApplicationsAttributes& aAttributes, TInt aReferenceNumber ) : 
+           iAttributes( aAttributes )
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadApplications;
+    
+    TBuf<KThreadNameLength> threadName;
+    threadName.Format( KThreadName, iAttributes.iId );
+    
+    // create a thread
+    User::LeaveIfError( iThread.Create( threadName, ThreadFunction, 
+                                        KDefaultStackSize*2, KMinHeapSize, 
+                                        KKilo * KMinHeapSize, (TAny*) &iAttributes ) );
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CAppLauncher::ThreadFunction( TAny* aThreadArg )
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install( pS );
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad( *( ( TApplicationsAttributes* ) aThreadArg ) );
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::GenerateLoad( TApplicationsAttributes& aAttributes )
+    {
+    CAppLauncherManager* appLauncherManager = NULL;
+    TRAPD( err, appLauncherManager = CAppLauncherManager::NewL( aAttributes ) );
+    if ( err == KErrNone ) 
+        {
+        CActiveScheduler::Start();
+        }
+    delete appLauncherManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority( CLoadGenUtils::SettingItemToThreadPriority( iAttributes.iPriority ) );
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CAppLauncher::Close()
+    {
+    CLoadBase::Close();
+    
+    if ( iThread.ExitReason() == 0 ) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete( iAttributes.iDeathStatus, KErrCancel );
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon( waiter );
+        User::WaitForRequest( waiter );
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CAppLauncher::Description()
+    {
+    TBuf<KDescriptorBufSize> buf;
+    TBuf<KPriorityBufSize> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription( iAttributes.iPriority, prioBuf );
+    
+    _LIT(KAppLauncherEntry, "[%d] Appls prio=%S max apps=%d heartbeat=%dms random=%d%%");
+    buf.Format( KAppLauncherEntry, iAttributes.iId, &prioBuf, iAttributes.iMaxOpen, 
+                iAttributes.iHeartBeat, iAttributes.iRandomVariance );
+   
+    return TPtrC( buf );
+    }               
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CAppLauncherManager* CAppLauncherManager::NewL( TApplicationsAttributes& aAttributes )
+    {
+    CAppLauncherManager* self = new(ELeave) CAppLauncherManager(aAttributes);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CAppLauncherManager::CAppLauncherManager( TApplicationsAttributes& aAttributes ) :
+            CActive( EPriorityStandard ), iAttributes( aAttributes )
+    {
+    iAppEventType = EApplicationsLaunchApplication;
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CAppLauncherManager::~CAppLauncherManager()
+    {
+    if ( iPeriodicTimer )
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }
+    delete iLauncherEngine;
+    Cancel();
+    
+    iWsSession.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CAppLauncherManager::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    
+    // create instance to application launcher
+    iLauncherEngine = CLauncherEngine::NewL( iAttributes );
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // init
+    User::LeaveIfError( iWsSession.Connect() );
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iPeriodicTimer->Start( KDefaultStartDelay, 
+                           CLoadGenUtils::MilliSecondsToMicroSeconds( 
+                               iAttributes.iLaunchingInterval, iAttributes.iRandomVariance ),
+                           TCallBack( PeriodicTimerCallBack, this ) );
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CAppLauncherManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CAppLauncherManager::DoCancel()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CAppLauncherManager::PeriodicTimerCallBack( TAny* aAny )
+    {
+    CAppLauncherManager* self = static_cast<CAppLauncherManager*>( aAny );
+
+    TRAPD( err, self->SimulateEventL() );
+    if ( KErrNone != err )
+        {
+        return err;
+        }
+    return KErrNone;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CAppLauncherManager::SimulateEventL()
+    {    
+    // Randomly start new applications.
+    // After maximum applications launched stop one application.
+    // And after that start launching again.
+    if ( iAppEventType == EApplicationsLaunchApplication && 
+         iAttributes.iMaxOpen == iLauncherEngine->AppLaunchCounter() )
+        {
+        iAppEventType = EApplicationsCloseApplication;
+        }
+    if ( iAppEventType == EApplicationsCloseApplication && 
+         iAttributes.iMaxOpen -1 == iLauncherEngine->AppLaunchCounter() )
+        {
+        iAppEventType = EApplicationsLaunchApplication;
+        }
+    
+    // Launch or stop
+    if ( iAppEventType == EApplicationsLaunchApplication )
+        {
+        iLauncherEngine->StartAppLaunchingL();
+        }  
+    else
+        {
+        iLauncherEngine->StopApplication( ETrue );
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+#include <avkon.hrh>
+#include <e32std.h>
+#include <w32std.h>
+#include <apgtask.h>
+#include <bautils.h>
+#include <s32file.h>
+#include <apgwgnam.h> 
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine* CLauncherEngine::NewL( TApplicationsAttributes& aAttributes )
+    {
+    CLauncherEngine* self = new(ELeave) CLauncherEngine( aAttributes );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine::CLauncherEngine( TApplicationsAttributes& aAttributes ) : 
+                        iAttributes( aAttributes )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::ConstructL()
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::ConstructL");
+    iAppKeyPressManager = CAppKeyPressManager::NewL( iAttributes );
+    iAppLaunchCounter = 0;
+    User::LeaveIfError( iTimer.CreateLocal() );
+
+    User::LeaveIfError( iLs.Connect() );
+    User::LeaveIfError( iWs.Connect() );
+
+    }
+
+// ---------------------------------------------------------------------------
+
+CLauncherEngine::~CLauncherEngine()
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::~CLauncherEngine");
+    StopApplication( EFalse );
+    iWs.Close();
+    iLs.Close();
+    iTimer.Close();
+    delete iAppKeyPressManager;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::StartAppLaunchingL()
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::StartAppLaunchingL");
+    if ( iAppLaunchCounter == iAttributes.iMaxOpen )
+        {
+        return;
+        }
+
+    // start launching
+    TBool launched( EFalse );
+    while ( !launched )
+        {
+        launched = LaunchApplicationL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TBool CLauncherEngine::LaunchApplicationL()
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::LaunchApplicationL");
+    TBool result( EFalse );
+    // get the uid of the current app
+    iCurrentAppUid = KNullUid;
+    TApaAppInfo appInfo;
+    
+    // get application list size
+    TInt appsListSize = iAttributes.iAppsArray->MdcaCount();
+    // get random application number in the list
+    TInt appTolaunch = CLoadGenUtils::RandomNumber( 0,  appsListSize - 1 );
+    // get file name of the application to be launched
+    TFileName launchFileName = iAttributes.iAppsArray->MdcaPoint( appTolaunch );
+    iLs.GetAllApps();
+    while ( iLs.GetNextApp( appInfo ) == KErrNone )
+        {
+        // get file name in  current appInfo
+        TFileName appFileName = appInfo.iFullName;
+        // get AppUid
+        if ( appFileName.CompareF( launchFileName ) == 0 )
+            {
+            iCurrentAppUid = appInfo.iUid;
+            break;
+            }
+        }
+
+    if ( iCurrentAppUid != KNullUid )
+        {        
+        // parse the filename
+        TParse nameParser;
+        nameParser.SetNoWild( iAttributes.iAppsArray->MdcaPoint( appTolaunch ), NULL, NULL );
+        iCurrentAppNameAndExt.Copy( nameParser.Drive() );
+        iCurrentAppNameAndExt.Append( nameParser.NameAndExt() );
+           
+        // do not try to launch these apps
+        if ( iCurrentAppUid != KNullUid &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch).FindF(_L("\\loadgen.")) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\Phone." ) ) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch).FindF( _L("\\Startup.") ) == KErrNotFound &&  
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\SplashScreen.") ) == KErrNotFound &&  
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\cameraapp.") ) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\eshell.") ) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\ConnTest.") ) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\Launcher.") ) == KErrNotFound &&
+              
+#ifdef __WINS__
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\DebugAgent.") ) == KErrNotFound &&
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\redirect.") ) == KErrNotFound &&              
+#endif              
+              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\VoiceRecorder.") ) == KErrNotFound )            
+            {
+        
+            // check if the app is already running
+            TApaTaskList taskList( iWs );
+            TApaTask thisTask = taskList.FindApp( iCurrentAppUid );
+            if ( !thisTask.Exists( ))
+                {
+                // check the program's capabilities
+                TApaAppCapabilityBuf buf;
+                iLs.GetAppCapability( buf, iCurrentAppUid );
+                TApaAppCapability cap = buf();
+        
+                // if it's embeddable only, don't launch if setting is enabled
+                // if it's hidden, don't launch if setting is enabled
+                if ( cap.iEmbeddability != TApaAppCapability::EEmbeddableOnly &&
+                     !cap.iAppIsHidden )
+                    {
+                    LOGSTRING2("launchFileName = %S", &launchFileName);
+                    
+                    DoLaunchApplicationL();
+                    result = ETrue;
+                    }            
+                } 
+            }
+        }
+    return result;
+    }
+
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::DoLaunchApplicationL()
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::DoLaunchApplicationL");
+
+    // Find the task with uid3
+    TApaTaskList tasklist( iWs );
+    TApaTask task=tasklist.FindApp( iCurrentAppUid );
+
+    if ( !task.Exists() )
+        // Task doesn't exist, launch a new instance of an application
+        {
+        TApaAppInfo appInfo;
+        User::LeaveIfError( iLs.GetAppInfo( appInfo, iCurrentAppUid ) );
+        TApaAppCapabilityBuf capBuf;
+        User::LeaveIfError( iLs.GetAppCapability( capBuf, iCurrentAppUid ) );
+        TApaAppCapability& caps = capBuf();
+
+        CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
+        cmdLine->SetExecutableNameL( appInfo.iFullName );
+
+        // app is launched in background
+        cmdLine->SetCommandL( EApaCommandBackground );       
+
+        // start the app
+        User::LeaveIfError( iLs.StartApp( *cmdLine ) );
+        iAppKeyPressManager->AddNewApplicationUidToKeyEventsL( iCurrentAppUid );
+        iAppLaunchCounter++;
+
+        CleanupStack::PopAndDestroy( cmdLine );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CLauncherEngine::StopApplication( TBool aRandomApplication )
+    {
+    LOGSTRING("LoadGen: CLauncherEngine::StopApplication");
+
+    // remove key pressing instance
+    TUid appToDelete = iAppKeyPressManager->KillApplication( aRandomApplication );
+    if ( appToDelete != KNullUid )
+        {
+        TApaTaskList taskList( iWs );
+        TApaTask thisTask = taskList.FindApp( appToDelete );
+    
+        if ( thisTask.Exists() )
+            {
+            // since the application is still open, let's close it
+            thisTask.EndTask();
+            }
+        iAppLaunchCounter--;
+        }
+    
+    // return if only one application requested
+    if ( aRandomApplication )
+        {
+        return;
+        }
+    
+    // remove all launched applications because load is requested to be closed
+    while ( appToDelete != KNullUid )
+        {
+        appToDelete = iAppKeyPressManager->KillApplication( aRandomApplication );
+            
+        if ( appToDelete != KNullUid )
+            {
+            TApaTaskList taskList( iWs );
+            TApaTask thisTask = taskList.FindApp( appToDelete );
+        
+            if ( thisTask.Exists() )
+                {
+                // since the application is still open, let's close it
+                thisTask.EndTask();
+                }
+            iAppLaunchCounter--;
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CAppKeyPressManager* CAppKeyPressManager::NewL( TApplicationsAttributes& aAttributes )
+    {
+    LOGSTRING("LoadGen: CAppKeyPressManager::NewL");
+    CAppKeyPressManager* self = new(ELeave) CAppKeyPressManager( aAttributes );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CAppKeyPressManager::CAppKeyPressManager( TApplicationsAttributes& aAttributes ) :
+                                            iAttributes( aAttributes )
+    {
+    LOGSTRING("LoadGen: CAppKeyPressManager::CAppKeyPressManager");
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CAppKeyPressManager::~CAppKeyPressManager()
+    {
+    LOGSTRING("LoadGen: CAppKeyPressManager::~CAppKeyPressManager");
+    if ( iKeyPresses.Count() != 0 )
+        {
+        iKeyPresses.ResetAndDestroy();
+        }
+
+    iKeyPresses.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CAppKeyPressManager::ConstructL()
+    {
+    LOGSTRING("LoadGen: CAppKeyPressManager::ConstructL");
+    }
+    
+   
+// --------------------------------------------------------------------------------------------
+void CAppKeyPressManager::AddNewApplicationUidToKeyEventsL( TUid aUid )
+    {
+    LOGSTRING("LoadGen: CAppKeyPressManager::AddNewApplicationUidToKeyEventsL");
+    CApplicationKeyPresses* applicationKP = CApplicationKeyPresses::NewL( aUid,
+                                                                    iAttributes );
+    CleanupStack::PushL( applicationKP );
+    User::LeaveIfError( iKeyPresses.Append( applicationKP ) );
+    CleanupStack::Pop( applicationKP );
+    }
+
+// --------------------------------------------------------------------------------------------
+TUid CAppKeyPressManager::KillApplication( TBool aRandomApplication )
+    {
+    TUid applicationUid = KNullUid;
+    TInt appToDelete = iKeyPresses.Count() - 1 ;
+    // remove the newest application if not random 
+    if ( aRandomApplication )
+        {
+         appToDelete = CLoadGenUtils::RandomNumber( 0, iKeyPresses.Count() - 1 );
+        }
+    if ( iKeyPresses.Count() )
+        {
+        // get random application and delete it
+        
+        applicationUid = iKeyPresses[appToDelete]->ApplicationUid();
+        delete iKeyPresses[appToDelete];
+        iKeyPresses.Remove( appToDelete );
+        }
+    return applicationUid;
+    }
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CApplicationKeyPresses* CApplicationKeyPresses::NewL( TUid aUid, TApplicationsAttributes&  
+        aAttributes )
+    {
+    LOGSTRING("LoadGen: CApplicationKeyPresses::NewL");
+    CApplicationKeyPresses* self = new(ELeave) CApplicationKeyPresses( aUid, aAttributes );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CApplicationKeyPresses::CApplicationKeyPresses( TUid aUid, 
+                                                        TApplicationsAttributes& aAttributes ) :
+                                                iUid( aUid ), iAttributes( aAttributes ) 
+    {
+    LOGSTRING("LoadGen: CApplicationKeyPresses::CApplicationKeyPresses");
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CApplicationKeyPresses::~CApplicationKeyPresses()
+    {
+    LOGSTRING("LoadGen: CApplicationKeyPresses::~CApplicationKeyPresses");
+    if ( iPeriodicTimer )
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }
+    
+    iWsSession.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CApplicationKeyPresses::ConstructL()
+    {
+    LOGSTRING("LoadGen: CApplicationKeyPresses::ConstructL");
+    // init
+    User::LeaveIfError( iWsSession.Connect() );
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    if ( iAttributes.iKeyPressType )
+        {
+        iPeriodicTimer->Start( KDefaultStartDelay,
+                               CLoadGenUtils::MilliSecondsToMicroSeconds( 
+                                       iAttributes.iHeartBeat,
+                                       iAttributes.iRandomVariance ),
+                                TCallBack( PeriodicTimerCallBack, this ) );
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TInt CApplicationKeyPresses::PeriodicTimerCallBack( TAny* aAny )
+    {
+    CApplicationKeyPresses* self = static_cast<CApplicationKeyPresses*>( aAny );
+    self->SimulateKeyEvent();
+    return KErrNone;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CApplicationKeyPresses::SimulateKeyEvent()
+    {
+    LOGSTRING("LoadGen: CApplicationKeyPresses::SimulateKeyEvent");
+    // for arrow key events
+    
+    TInt wgId(0);
+    CApaWindowGroupName::FindByAppUid( iUid, iWsSession, wgId );
+    // generate a random arrow key event
+    TWsEvent event;
+    event.SetType( EEventKey );
+    event.Key()->iCode = CLoadGenUtils::RandomNumber( EKeyLeftArrow, EKeyDownArrow );
+    event.Key()->iScanCode = event.Key()->iCode - KScanCodeStart;
+    event.Key()->iModifiers = 0;
+    event.Key()->iRepeats = 0;
+    iWsSession.SendEventToWindowGroup( wgId, event );
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_bluetooth.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,339 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_bluetooth.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include "loadgen_traces.h"
+#include <loadgen.rsg>
+#include <e32hal.h>
+#include <u32hal.h>
+#include <e32math.h>
+#include <eikenv.h>
+#include <btserversdkcrkeys.h>
+#include <btnotifierapi.h>
+#include <btpm.h>
+
+_LIT(KThreadName, "Bluetooth %d");
+_LIT(KBTLinkManagerStr, "BTLinkManager");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+   
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CBluetooth* CBluetooth::NewL(TBluetoothAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CBluetooth* self = new(ELeave) CBluetooth(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    TRAPD(err, self->ConstructL());
+    if( err != KErrNone )
+        {
+        User::Leave(err);
+        }
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CBluetooth::~CBluetooth()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CBluetooth::CBluetooth(TBluetoothAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::ConstructL()
+    {    
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadBluetooth;
+    
+    InitializeBluetoothL();
+                        
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+            
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    iState = ELoadStateConstructed;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CBluetooth::ThreadFunction(TAny* aThreadArg)
+    {
+    TInt err = KErrNone;
+    
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TBluetoothAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::GenerateLoad(TBluetoothAttributes& aAttributes)
+    {    
+    CBTManager* btManager = 0;
+    TRAPD(err, btManager = CBTManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete btManager;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::Resume()
+    {    
+    CLoadBase::Resume();    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::Suspend()
+    {
+    CLoadBase::Suspend();    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::SetPriority()
+    {
+    CLoadBase::SetPriority();    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CBluetooth::Close()
+    {
+    LOGSTRING2("LoadGen: CBluetooth::~CBluetooth() - State: %d", iState);
+    if( iState != ELoadStateInvalid )
+        {
+        CLoadBase::Close();        
+        // kill the thread immediately
+        iThread.Kill(0);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+TPtrC CBluetooth::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+        
+    _LIT(KBluetoothEntry, "[%d] Bluetooth prio=%S idle=%dms random=%d%%");
+    buf.Format(KBluetoothEntry, iAttributes.iId, &prioBuf, iAttributes.iIdle, iAttributes.iRandomVariance);
+       
+    return TPtrC(buf);
+    }
+
+// --------------------------------------------------------------------------------------------
+void CBluetooth::InitializeBluetoothL()
+    {
+    // Create central repository for checking and setting bluetooth power state    
+    CRepository* btPowerStateCRepo = CRepository::NewL(KCRUidBluetoothPowerState);
+    
+    // Check if the BT is already turned on:    
+    TInt btPowerState = 0;
+    btPowerStateCRepo->Get(KBTPowerState, btPowerState);
+    delete btPowerStateCRepo;
+    btPowerStateCRepo = 0;
+        
+    if(btPowerState == EBTPowerOff)
+        {
+        // Switch bt power on:
+        if (SetBTPowerState(ETrue) == EFalse)
+            {
+            LOGSTRING("LoadGen: Bluetooth could not be switched on");
+            User::Leave(KErrNotReady);
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+TBool CBluetooth::SetBTPowerState(TBool aState)
+    {    
+    // Ask user to turn on the bluetooth device:
+    RNotifier btPowerNotifier;
+    TInt errCode = btPowerNotifier.Connect();
+    
+    TBool retVal = errCode == KErrNone;
+    
+    if( errCode == KErrNone )
+        {
+        TPckgBuf<TBool> powerRequest(aState);
+        TPckgBuf<TBool> powerReply(EFalse);
+        TRequestStatus powerRequestStatus;
+        btPowerNotifier.StartNotifierAndGetResponse(powerRequestStatus, 
+                                                KPowerModeSettingNotifierUid, 
+                                                powerRequest, 
+                                                powerReply);
+        User::WaitForRequest(powerRequestStatus);
+        btPowerNotifier.CancelNotifier(KPowerModeSettingNotifierUid);
+        btPowerNotifier.Close();  
+        if( powerReply() == EFalse )
+            {
+            LOGSTRING("LoadGen: Bluetooth activating cancelled.");
+            }
+        retVal = powerReply();
+        }
+    
+    return retVal; 
+    }
+
+// --------------------------------------------------------------------------------------------
+CBTManager* CBTManager::NewL(   TBluetoothAttributes& aAttrs)
+    {
+    CBTManager* self = new (ELeave) CBTManager( aAttrs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+ 
+// --------------------------------------------------------------------------------------------
+CBTManager::~CBTManager()
+    {    
+    if (iPeriodicTimer)
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }    
+    iHostResolver.Close();        
+    Cancel();
+    }
+ 
+// --------------------------------------------------------------------------------------------
+CBTManager::CBTManager( TBluetoothAttributes& aAttrs) 
+: 
+CActive(EPriorityStandard),
+iAttributes(aAttrs)
+    {    
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CBTManager::ConstructL()
+    {
+    // Socket server session initiation:
+    User::LeaveIfError(iSocketServerHnd.Connect());    
+
+    CActiveScheduler::Add(this);
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+        
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+
+// --------------------------------------------------------------------------------------------
+void CBTManager::DoCancel()
+    {
+    LOGSTRING("LoadGen: CBTManager::DoCancel()");    
+    }
+
+// --------------------------------------------------------------------------------------------
+void CBTManager::RunL()
+    {    
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();    
+    }
+
+// --------------------------------------------------------------------------------------------
+TInt CBTManager::StartBTDeviceDiscovery()
+    {
+    TInt retVal = KErrNone; 
+    RThread myThread;
+           
+    // Initialize host resolver      
+    iHostResolver.Close();        
+    TProtocolDesc protocolInfo;
+    retVal = iSocketServerHnd.FindProtocol(KBTLinkManagerStr(), protocolInfo);
+    if( retVal == KErrNone )
+        {
+        retVal = iHostResolver.Open(iSocketServerHnd, protocolInfo.iAddrFamily, protocolInfo.iProtocol);        
+        }
+    
+    if( retVal == KErrNone )
+        {
+        TInquirySockAddr socketAddress;
+        socketAddress.SetIAC( KGIAC );
+        socketAddress.SetAction(KHostResInquiry|KHostResName|KHostResIgnoreCache);
+        retVal = iHostResolver.GetByAddress(socketAddress, iBTNameEntry);        
+        // Loop all discovered devices:
+        while( retVal == KErrNone )        
+            {
+            LOGSTRING3("LoadGen: Thread %S found device: %S", &(myThread.Name()), &(iBTNameEntry().iName) );
+            // Get next device
+            retVal = iHostResolver.Next(iBTNameEntry);            
+            }
+        }
+    
+    // KErrEof is returned when no more devices to loop
+    if( retVal == KErrEof )
+        {
+        retVal = KErrNone;
+        }
+            
+    iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                        iAttributes.iRandomVariance ), KDefaultPeriod, 
+                        TCallBack( PeriodicTimerCallBack, this ) );
+
+    return retVal;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CBTManager::PeriodicTimerCallBack(TAny* aAny)
+    {        
+    CBTManager* self = static_cast<CBTManager*>( aAny );
+    self->iPeriodicTimer->Cancel();
+    // Perform device discovery:
+    self->StartBTDeviceDiscovery();
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_cpuload.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,270 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_cpuload.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+#include <e32hal.h>
+#include <u32hal.h>
+#include <e32math.h>
+#include <e32svr.h>
+
+_LIT(KThreadName, "CPULoad %d");
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CCPULoad* CCPULoad::NewL(TCPULoadAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CCPULoad* self = new(ELeave) CCPULoad(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CCPULoad::~CCPULoad()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CCPULoad::CCPULoad(TCPULoadAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadCPULoad;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CCPULoad::ThreadFunction(TAny* aThreadArg)
+    {
+    TCPULoadAttributes* threadArg = (TCPULoadAttributes*)aThreadArg;
+    TInt err = KErrNone;
+
+    // if a cpu is defined, tie this thread to the given cpu (SMP environment)
+    if (threadArg->iCpu >= 0 && threadArg->iCpu != KCPUSelection_AllCPUs )
+        {
+        UserSvr::HalFunction(EHalGroupKernel, KHalFunction_EKernelHalLockThreadToCpu, (TAny*) threadArg->iCpu, 0);
+        }
+    
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TCPULoadAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::GenerateLoad(TCPULoadAttributes& aAttributes)
+    {
+    for (;;)
+        {   
+        if (aAttributes.iType == ECpuLoadTypeContinuous)
+            {
+            // do constantly heave stuff
+            DoHeaveStuff(aAttributes.iMode);
+            }
+
+        else if (aAttributes.iType == ECpuLoadTypePeriodic)
+            {
+            // do periodically heave stuff
+            TTime startTime;
+            startTime.HomeTime(); // get start time
+
+            TTime currentTime;
+            TTimeIntervalMicroSeconds interval;
+            TInt processPeriod; 
+			#ifdef QT_SUPPORT
+				
+			#else
+				processPeriod = CLoadGenUtils::MilliSecondsToMicroSeconds(aAttributes.iLength, aAttributes.iRandomVariance);
+			#endif
+            do
+                {
+                // do heave stuff
+                DoHeaveStuff(aAttributes.iMode);
+
+                currentTime.HomeTime();
+                interval = currentTime.MicroSecondsFrom(startTime);                
+                }
+            while (interval.Int64() < processPeriod);       
+
+
+            // now wait
+            User::After( CLoadGenUtils::MilliSecondsToMicroSeconds(aAttributes.iIdle, aAttributes.iRandomVariance) );
+            }   
+
+        else
+            {
+            User::Panic(_L("Unk.type"), 888);
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::DoHeaveStuff(TInt aMode)
+    {
+    TTime now;
+    now.HomeTime();
+    TInt64 seed = now.Int64();
+    
+    TReal random = Math::FRand(seed);
+    
+    TReal target(10);
+    TReal source(10);
+    
+    target += random;
+    
+    Math::Cos(target, source);
+    
+    source = source / 1.0382873;
+    source -= 32.24343;
+    source += 132.24343;
+    source *= random;
+    
+    // yield trick
+    if (aMode == ECpuLoadModeYielding)
+        {
+        // sleep randomly
+        if (User::TickCount() % 50 == 0)
+            User::AfterHighRes(1);            
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CCPULoad::Close()
+    {
+    CLoadBase::Close();
+
+    // kill the thread immediately
+    iThread.Kill(0);   
+
+    iThread.Close();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CCPULoad::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    
+    if (iAttributes.iType == ECpuLoadTypeContinuous)
+        {
+        if (iAttributes.iMode == ECpuLoadModeYielding)
+            {
+            _LIT(KCPULoadEntryContinuous, "[%d] CPULoad prio=%S mode=yielding type=cont");
+            buf.Format(KCPULoadEntryContinuous, iAttributes.iId, &prioBuf);
+            }
+        else if (iAttributes.iMode == ECpuLoadModeBlocking)
+            {
+            _LIT(KCPULoadEntryContinuous, "[%d] CPULoad prio=%S mode=blocking type=cont");
+            buf.Format(KCPULoadEntryContinuous, iAttributes.iId, &prioBuf);
+            }
+        }
+    
+    else if (iAttributes.iType == ECpuLoadTypePeriodic)
+        {
+        if (iAttributes.iMode == ECpuLoadModeYielding)
+            {
+            _LIT(KCPULoadEntryPeriodic, "[%d] CPULoad prio=%S mode=yielding type=period peak=%dms idle=%dms random=%d%%");
+            buf.Format(KCPULoadEntryPeriodic, iAttributes.iId, &prioBuf, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
+            }        
+        else if (iAttributes.iMode == ECpuLoadModeBlocking)
+            {
+            _LIT(KCPULoadEntryPeriodic, "[%d] CPULoad prio=%S mode=blocking type=period peak=%dms idle=%dms random=%d%%");
+            buf.Format(KCPULoadEntryPeriodic, iAttributes.iId, &prioBuf, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
+            }        
+        }
+    
+    // if we are running a load in a specific cpu, add the "name" of the
+    // cpu to the description. (SMP environment)
+    if (iAttributes.iCpu >= 0 && iAttributes.iCpu != KCPUSelection_AllCPUs)
+        {
+        TBuf<15> cpu;
+        _LIT(KCPU, " CPU%d");
+        cpu.Format(KCPU, iAttributes.iCpu);
+        buf.Append(cpu);
+        }
+    
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_keypress.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_keypress.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+
+_LIT(KThreadName, "KeyPress %d");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CKeyPress* CKeyPress::NewL(TKeyPressAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CKeyPress* self = new(ELeave) CKeyPress(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CKeyPress::~CKeyPress()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CKeyPress::CKeyPress(TKeyPressAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadKeyPress;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CKeyPress::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TKeyPressAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::GenerateLoad(TKeyPressAttributes& aAttributes)
+    {
+    CKeyPressManager* keyPressManager = NULL;
+    TRAPD(err, keyPressManager = CKeyPressManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete keyPressManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CKeyPress::Close()
+    {
+    CLoadBase::Close();
+    
+    if (iThread.ExitReason() == 0) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon(waiter);
+        User::WaitForRequest(waiter);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CKeyPress::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    
+    _LIT(KKeyPressEntry, "[%d] KeyPress prio=%S heartbeat=%dms random=%d%%");
+    buf.Format(KKeyPressEntry, iAttributes.iId, &prioBuf, iAttributes.iHeartBeat, iAttributes.iRandomVariance);
+   
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CKeyPressManager* CKeyPressManager::NewL(TKeyPressAttributes& aAttributes)
+    {
+    CKeyPressManager* self = new(ELeave) CKeyPressManager(aAttributes);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CKeyPressManager::CKeyPressManager(TKeyPressAttributes& aAttributes) :
+    CActive(EPriorityStandard), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CKeyPressManager::~CKeyPressManager()
+    {
+    Cancel();
+    
+    iWsSession.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CKeyPressManager::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // init
+    User::LeaveIfError( iWsSession.Connect() );
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CKeyPressManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CKeyPressManager::DoCancel()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CKeyPressManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CKeyPressManager* self = static_cast<CKeyPressManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    self->SimulateKeyEvent();
+
+    return KErrNone;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CKeyPressManager::SimulateKeyEvent()
+    {
+    // generate a random key event from a to z
+    TKeyEvent keyEvent;
+    keyEvent.iCode = CLoadGenUtils::RandomNumber('a','z');
+    keyEvent.iScanCode = keyEvent.iCode - 32;
+    keyEvent.iModifiers = 0;
+    keyEvent.iRepeats = 0;
+    
+    iWsSession.SimulateKeyEvent(keyEvent);
+    iWsSession.Flush();
+    
+    // call timer
+    iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iHeartBeat, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_loadbase.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_loadbase.h"
+#include "loadgen.hrh"
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CLoadBase::CLoadBase()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadBase::ConstructL()
+    {
+    iState = ELoadStateInvalid;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadBase::Resume()
+    {
+    iState = ELoadStateRunning;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadBase::Suspend()
+    {
+    iState = ELoadStateSuspended;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadBase::SetPriority()
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadBase::Close()
+    {
+    iState = ELoadStateClosed;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CLoadBase::Description()
+    {
+    return TPtrC(KNullDesC);
+    }               
+               
+// --------------------------------------------------------------------------------------------
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_memoryeat.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,603 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_memoryeat.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include "loadgen_traces.h"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+
+_LIT(KThreadName, "MemEat %d");
+_LIT(KChunkName, "LoadGen %d");
+_LIT(KFilePath, "%c:\\system\\temp\\LoadGen-%d_%d.$$$");
+
+// currently can only handle 2GB
+const TInt64 KMaxEatSize = 2147483647;
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CMemoryEat* CMemoryEat::NewL(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CMemoryEat* self = new(ELeave) CMemoryEat(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CMemoryEat::~CMemoryEat()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CMemoryEat::CMemoryEat(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadEatMemory;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 32*1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CMemoryEat::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start memory eat, pass pointer to arguments
+    GenerateLoad(*((TMemoryEatAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::GenerateLoad(TMemoryEatAttributes& aAttributes)
+    {
+    CMemoryEatManager* memoryEatManager = NULL;
+    TRAPD(err, memoryEatManager = CMemoryEatManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete memoryEatManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEat::Close()
+    {
+    CLoadBase::Close();
+    
+    if (iThread.ExitReason() == 0) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon(waiter);
+        User::WaitForRequest(waiter);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CMemoryEat::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    TBuf<16> srcBuf;
+    CLoadGenUtils::SettingItemToSourceDescription(iAttributes.iSource, srcBuf);
+    
+    if (iAttributes.iType == EMemoryEatTypeMemoryToEat)
+        {
+        _LIT(KMemoryEatEntryMemoryToEat, "[%d] MemEat src=%S prio=%S type=MemToEat amount=%LDB buf=%dB idle=%dms");
+        
+        buf.Format(KMemoryEatEntryMemoryToEat, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iAmount, iAttributes.iBuffer, iAttributes.iIdle);
+        }
+    else if (iAttributes.iType == EMemoryEatTypeMemoryToBeLeft)
+        {
+        _LIT(KMemoryEatEntryMemoryToBeLeft, "[%d] MemEat src=%S prio=%S type=MemToBeLeft amount=%LDB buf=%dB idle=%dms");
+        
+        buf.Format(KMemoryEatEntryMemoryToBeLeft, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iAmount, iAttributes.iBuffer, iAttributes.iIdle);
+        }        
+
+    else if (iAttributes.iType == EMemoryEatTypeWavy)
+        {
+        _LIT(KMemoryEatEntryRandom, "[%d] MemEat src=%S prio=%S type=Random min=%LDB max=%LDB buf=%dB idle=%dms");
+        
+        buf.Format(KMemoryEatEntryRandom, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iRandomMin, iAttributes.iRandomMax, iAttributes.iBuffer, iAttributes.iIdle);
+        } 
+            
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CMemoryEatManager* CMemoryEatManager::NewL(TMemoryEatAttributes& aAttributes)
+    {
+    CMemoryEatManager* self = new(ELeave) CMemoryEatManager(aAttributes);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CMemoryEatManager::CMemoryEatManager(TMemoryEatAttributes& aAttributes) :
+    CActive(EPriorityStandard), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CMemoryEatManager::~CMemoryEatManager()
+    {
+    Cancel();
+    DestroyMemoryEat();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // init
+    InitMemoryEatL();
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::DoCancel()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CMemoryEatManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    TInt result = KErrNone;
+    CMemoryEatManager* self = static_cast<CMemoryEatManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    TRAP( result, self->EatMemoryL() );
+
+    return result;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::InitMemoryEatL()
+    {
+    // create a chunk for RAM
+    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
+        {
+        TBuf<64> chunkName;
+        chunkName.Format(KChunkName, iAttributes.iId);
+        
+        // set max size of the chunk to be size of the RAM memory
+        TMemoryInfoV1Buf ramMemory;
+        UserHal::MemoryInfo(ramMemory);
+    
+        User::LeaveIfError( iEatChunk.CreateGlobal(chunkName, 0, ramMemory().iMaxFreeRamInBytes-1, EOwnerThread) );
+        }
+    
+    // create a temporary file to disk
+    else
+        {
+        // connect to RFs
+        User::LeaveIfError( iFs.Connect() );
+        
+        iFilesCounter = 0;
+        
+        TFileName eatFileName;
+        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, 1 );
+
+        iFs.MkDirAll( eatFileName );
+        User::LeaveIfError( iEatFile.Replace( iFs, eatFileName, EFileWrite ) );
+        iFilesCounter++;        
+        } 
+    
+    iWavyEatMoreMemory = ETrue;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEatManager::DestroyMemoryEat()
+    {
+    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
+        {
+        iEatChunk.Adjust(0);
+        iEatChunk.Close();
+        }
+    else
+        {
+        // close current file
+        
+        iEatFile.Flush();
+        iEatFile.Close();
+
+        // delete created files
+        for ( TInt k = 1; k <= iFilesCounter; k++ )
+            {            
+            TFileName eatFileName;
+            eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, k );
+            iFs.Delete( eatFileName );
+            }
+        iFs.Close();
+        } 
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::EatMemoryL()
+    {
+    // get current sizes
+    TInt64 eatSizeNow(0);
+    TInt sizeNow(0);
+    TInt64 freeSystemMemory(0);
+
+    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
+        {
+        eatSizeNow = iEatChunk.Size(); // get current chunk size
+        }
+    else
+        {
+        User::LeaveIfError( iEatFile.Size( sizeNow ) );
+        if ( iFilesCounter > 1)
+            {
+            eatSizeNow += sizeNow + ( ( iFilesCounter - 1 ) * KMaxEatSize );
+        	}
+        else
+            { 
+            eatSizeNow = sizeNow ; 
+            }
+        }
+    LOGSTRING2("Loadgen:EatMemoryL eatSizeNow = %d", eatSizeNow );
+    
+    freeSystemMemory = ReadFreeMemory();
+    
+    // eat until specific amount of memory at most amount of buffer at a time  
+    if (iAttributes.iType == EMemoryEatTypeMemoryToEat)
+        {
+        // grow partial buffer to match exact amount 
+        if ( ( iAttributes.iAmount - eatSizeNow >= 0 && 
+               iAttributes.iAmount - eatSizeNow < iAttributes.iBuffer ) )
+            {
+               DoEatMemoryL( eatSizeNow + ( iAttributes.iAmount - eatSizeNow ) );
+            }
+        
+        // grow full buffer
+        else if ( eatSizeNow < iAttributes.iAmount )
+            {
+            DoEatMemoryL( eatSizeNow + iAttributes.iBuffer );
+            }
+        // shrink partial buffer to match exact amount
+        else if (eatSizeNow - iAttributes.iAmount >= 0 && eatSizeNow - iAttributes.iAmount < iAttributes.iBuffer)
+            {
+            DoEatMemoryL(eatSizeNow - (eatSizeNow - iAttributes.iAmount));
+            }                
+        
+        // shrink full buffer
+        else if (eatSizeNow > iAttributes.iAmount)
+            {
+            DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
+            }                
+        }
+
+    
+    // eat until specific amount of free memory has been reached at most amount of buffer at a time
+    else if (iAttributes.iType == EMemoryEatTypeMemoryToBeLeft)
+        {
+        // grow partial buffer to match exact amount
+        if (freeSystemMemory - iAttributes.iAmount >= 0 && freeSystemMemory - iAttributes.iAmount < iAttributes.iBuffer)
+            {
+            DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iAmount));
+            }
+
+        // grow full buffer
+        else if (freeSystemMemory > iAttributes.iAmount)
+            {
+            DoEatMemoryL(eatSizeNow + iAttributes.iBuffer);
+            }
+
+        // shrink partial buffer to match exact amount
+        if (iAttributes.iAmount - freeSystemMemory >= 0 && iAttributes.iAmount - freeSystemMemory < iAttributes.iBuffer)
+            {
+            DoEatMemoryL(eatSizeNow - (iAttributes.iAmount - freeSystemMemory));
+            }
+
+        // shrink full buffer
+        else if (freeSystemMemory < iAttributes.iAmount)
+            {
+            DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
+            }
+        }        
+        
+    // wavy memory eat
+    else if (iAttributes.iType == EMemoryEatTypeWavy)
+        {
+        // grow to max value if not under it
+        if (freeSystemMemory > iAttributes.iRandomMax)
+            {
+            DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iRandomMax) + iAttributes.iBuffer);
+            iWavyEatMoreMemory = ETrue; // change direction
+            }
+        
+        // shrink to min value if not below it
+        else if (freeSystemMemory < iAttributes.iRandomMin)
+            {
+            DoEatMemoryL(eatSizeNow - (iAttributes.iRandomMin - freeSystemMemory) - iAttributes.iBuffer);
+            iWavyEatMoreMemory = EFalse; // change direction
+            }                
+        
+        // grow or shrink
+        else
+            {
+            if (iWavyEatMoreMemory)
+                {
+                // grow partial buffer to match exact amount
+                if (freeSystemMemory - iAttributes.iRandomMin >= 0 && freeSystemMemory - iAttributes.iRandomMin < iAttributes.iBuffer)
+                    {
+                    DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iRandomMin));
+                    iWavyEatMoreMemory = EFalse; // change direction since limit reached
+                    }
+                
+                // grow full buffer
+                else
+                    {
+                    DoEatMemoryL(eatSizeNow + iAttributes.iBuffer);
+                    }
+                }
+
+            else // shrink
+                {
+                // shrink partial buffer to match exact amount
+                if (iAttributes.iRandomMax - freeSystemMemory >= 0 && iAttributes.iRandomMax - freeSystemMemory < iAttributes.iBuffer)
+                    {
+                    DoEatMemoryL(eatSizeNow - (iAttributes.iRandomMax - freeSystemMemory));
+                    iWavyEatMoreMemory = ETrue; // change direction since limit reached
+                    }                
+                
+                // shrink full buffer
+                else
+                    {
+                    DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
+                    }                 
+                }
+            }
+        }
+        
+
+    // call timer
+    iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CMemoryEatManager::DoEatMemoryL( TInt64 aNewSize )
+    {
+    // check that new size is in valid range
+    if (aNewSize < 0)
+        {
+        aNewSize = 0;
+        }
+    LOGSTRING2("Loadgen::DoEatMemoryL aNewSize = %d", aNewSize );
+    // set new size
+    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
+        {
+        TInt err = iEatChunk.Adjust( aNewSize );
+        }
+    else
+        {
+        HandleEatMemoryL( aNewSize );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMemoryEatManager::HandleEatMemoryL( TInt64 aNewSize )
+    {
+    // current size = open file size + full files sizes
+    TInt currentFileSize = 0;        
+    User::LeaveIfError( iEatFile.Size( currentFileSize ) );    
+    TInt64 currentSize = currentFileSize + ( ( iFilesCounter - 1 ) * KMaxEatSize );
+    
+    if ( aNewSize > currentSize ) // increasing
+        {
+        AllocMemoryL( aNewSize );
+        }
+    else if ( aNewSize < currentSize )//decreasing
+        {
+        FreeMemoryL( aNewSize );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+void CMemoryEatManager::AllocMemoryL( TInt64 aNewSize )
+    {
+    LOGSTRING("Loadgen: CMemoryEatManager::AllocMemoryL =>");
+    // size of the file that remains open
+    TInt64 sizeLeft = aNewSize % KMaxEatSize;
+    // amount of the files that is needed
+    TInt64 filesNeeded = aNewSize / KMaxEatSize; 
+    if ( sizeLeft > 0 )
+        {
+        filesNeeded++;
+        }
+
+    if ( filesNeeded > iFilesCounter )
+        {
+        // update current file size to 2 GB
+        User::LeaveIfError( iEatFile.SetSize( KMaxEatSize ) );
+        // close current file
+        iEatFile.Flush();
+        iEatFile.Close();
+        
+        // open new file
+        TFileName eatFileName;
+        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, ++iFilesCounter );
+        
+        iFs.MkDirAll( eatFileName );
+        User::LeaveIfError( iEatFile.Replace( iFs, eatFileName, EFileWrite ) );
+        
+        }
+    User::LeaveIfError( iEatFile.SetSize( sizeLeft ) );
+    LOGSTRING("Loadgen: CMemoryEatManager::AllocMemoryL <=");
+    }
+
+// --------------------------------------------------------------------------------------------
+void CMemoryEatManager::FreeMemoryL( TInt64 aNewSize )    
+    {
+    LOGSTRING("Loadgen: CMemoryEatManager::FreeMemoryL =>");
+    // size of the file that remains open
+    TInt sizeLeft = aNewSize % KMaxEatSize;
+        
+    LOGSTRING2("Loadgen: sizeLeft = %d ",  sizeLeft );
+    // amount of the files that is needed
+    TInt filesNeeded = aNewSize / KMaxEatSize; 
+  
+    if ( filesNeeded == 0 )
+            {
+            filesNeeded = 1;
+            }
+
+    if ( iFilesCounter > 1 && filesNeeded < iFilesCounter )
+        {
+        TFileName eatFileName;
+
+        // close current open file 
+        iEatFile.Flush();
+        iEatFile.Close();
+        // remove file
+        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter-- );
+        iFs.Delete( eatFileName );
+        
+        // remove files not needed
+        while ( iFilesCounter > filesNeeded )
+            {
+            eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter-- );
+            iFs.Delete( eatFileName );
+            }
+
+        // open new file
+        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter );
+        User::LeaveIfError( iEatFile.Open( iFs, eatFileName, EFileWrite ) );
+        }
+    User::LeaveIfError( iEatFile.SetSize( sizeLeft ) );
+    LOGSTRING("Loadgen: CMemoryEatManager::FreeMemoryL <=");
+    }
+
+// --------------------------------------------------------------------------------------------
+TInt64 CMemoryEatManager::ReadFreeMemory()    
+    {
+    if ( iAttributes.iSource == EMemoryEatSourceTypeRAM )
+        {   
+        TMemoryInfoV1Buf ramMemory;
+        UserHal::MemoryInfo( ramMemory ); // get available RAM
+        return (TInt64)ramMemory().iFreeRamInBytes;
+        }
+    else
+        {   
+        TVolumeInfo volumeInfo;
+        iFs.Volume( volumeInfo, iAttributes.iSource + 1 ); // get available disk      
+        return volumeInfo.iFree;
+        }
+    }
+// --------------------------------------------------------------------------------------------
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_messages.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,990 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_messages.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+#include <e32math.h>
+
+_LIT(KThreadName, "Messages %d");
+_LIT(KMessageSMS, "A test message from LoadGen S60 RnD tool. ");
+_LIT( KMessageSMSType, "SMS" );
+_LIT( KMessageMMSType, "MMS" );
+
+const TInt KTestMessageLength = 42;
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CMessages* CMessages::NewL( TMessageAttributes& aAttributes, TInt aReferenceNumber )
+    {
+    CMessages* self = new(ELeave) CMessages( aAttributes, aReferenceNumber );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CMessages::~CMessages()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CMessages::CMessages( TMessageAttributes& aAttributes, 
+                       TInt aReferenceNumber ) 
+                            : iAttributes( aAttributes )
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessages::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadMessages;
+    
+    TBuf<64> threadName;
+    threadName.Format( KThreadName, iAttributes.iId );
+    
+    // create a thread
+    User::LeaveIfError( iThread.Create( threadName, 
+                                        ThreadFunction, 
+                                        KDefaultStackSize * 2, 
+                                        KMinHeapSize, 
+                                        1024 * KMinHeapSize, 
+                                        (TAny*) &iAttributes ) );
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CMessages::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install( pS );
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad( *( ( TMessageAttributes* ) aThreadArg ) );
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessages::GenerateLoad( TMessageAttributes& aAttributes )
+    {
+    CMessageManager* messagesManager = NULL;
+    TRAPD( err, messagesManager = CMessageManager::NewL( aAttributes ) );
+
+    if ( err == KErrNone )
+        {
+        CActiveScheduler::Start();
+        }
+    delete messagesManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessages::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessages::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessages::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority( CLoadGenUtils::SettingItemToThreadPriority( iAttributes.iPriority ) );
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CMessages::Close()
+    {
+    CLoadBase::Close();
+
+    if ( iThread.ExitReason() == 0 ) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete( iAttributes.iDeathStatus, KErrCancel );
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon( waiter );
+        User::WaitForRequest( waiter );
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CMessages::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    TBuf<3> typeBuf;
+    CLoadGenUtils::SettingItemToThreadDescription( iAttributes.iPriority, prioBuf );
+    if ( iAttributes.iMessageType == EMessageTypeSMS )
+        {
+        typeBuf.Copy( KMessageSMSType );
+        }
+    else
+        {
+        typeBuf.Copy( KMessageMMSType );
+        }
+    _LIT(KMessagesEntry, "[%d] Type=%S prio=%S dest=%S idle=%dms random=%d%%");
+    buf.Format( KMessagesEntry,  iAttributes.iId, &typeBuf, &prioBuf, &iAttributes.iDestination, 
+                iAttributes.iIdle, iAttributes.iRandomVariance );
+    
+    return TPtrC( buf );
+    }               
+// --------------------------------------------------------------------------------------------
+
+CMessageManager* CMessageManager::NewL( TMessageAttributes& aAttributes )
+    {
+    CMessageManager* self = new(ELeave) CMessageManager( aAttributes );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+CMessageManager::CMessageManager( TMessageAttributes& aAttributes ) :
+    CActive( EPriorityStandard ), iAttributes( aAttributes ), iState( EStateIdle )
+    {
+    iMessageCounter = 0;
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CMessageManager::~CMessageManager()
+    {
+    Cancel();
+    delete iMessage;
+    if ( iPeriodicTimer )
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }
+    if ( iAttributes.iMessageType == EMessageTypeSMS && iSmsHandler )
+        {
+        delete iSmsHandler;
+        }
+    else if ( iMmsHandler )
+        {
+        delete iMmsHandler;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CMessageManager::ConstructL()
+    {
+    CActiveScheduler::Add( this );
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    if ( iAttributes.iAmount > 0 )
+        {
+        iState = EStateSend;
+        }
+    iMessage = HBufC::NewL( iAttributes.iLength );
+    CreateMessage();
+
+    // init SMS sender ao
+    if ( iAttributes.iMessageType == EMessageTypeSMS )
+        {
+        iSmsHandler = CSmsHandler::NewL( *this );
+        }
+    else
+        {
+        iMmsHandler = CMmsHandler::NewL( *this );
+        }
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iPeriodicTimer->Start( KDefaultStart, KDefaultPeriod, 
+                        TCallBack( PeriodicTimerCallBack, this ) );
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CMessageManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CMessageManager::DoCancel()
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TInt CMessageManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CMessageManager* self = static_cast<CMessageManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    self->HandleMessageSending();
+
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessageManager::CreateMessage()
+    {
+    // Message body
+    TBuf<KTestMessageLength> mToYou( KMessageSMS );
+    TPtr ptr = iMessage->Des();
+
+    // Take as many characters as user requested to create the message
+    for ( TInt j = 0; j < iAttributes.iLength; j++ )
+          {
+           for ( TInt k = 0; k < KTestMessageLength;  k++ )
+               {
+               ptr.Append( mToYou[k] );
+               j++;
+               if ( j == iAttributes.iLength )
+                   {
+                   break;
+                   }
+               }        
+           }
+    }
+
+
+// --------------------------------------------------------------------------------------------
+
+void CMessageManager::HandleMessageSending()
+    {
+    if ( iState == EStateSend && iAttributes.iDestination.Length() <= KTelephoneNumberMaxLength )
+        {
+        TBool err( KErrNone );        
+
+        // make a new call
+        iState = EStateSending;
+ 
+        iMessageCounter++;
+        if ( iAttributes.iMessageType == EMessageTypeSMS )
+            {
+            TRAP( err, iSmsHandler->SendL( iAttributes.iDestination, *iMessage ) );
+            if ( !err )
+                {
+                iState = EStateIdle;
+                iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                            iAttributes.iRandomVariance ), KDefaultPeriod, 
+                            TCallBack( PeriodicTimerCallBack, this ) );
+
+                }
+            }
+        else
+            {
+            TRAP( err, iMmsHandler->SendL( iAttributes.iDestination, *iMessage ) );            
+            if ( err )
+                {
+                HandleStatus( EStateIdle );
+                }
+            }
+        }
+    else
+        {
+        iState = EStateIdle;
+        iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                    iAttributes.iRandomVariance ), KDefaultPeriod, 
+                    TCallBack( PeriodicTimerCallBack, this ) );
+
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CMessageManager::HandleStatus( TInt /*aErr*/ )
+    {
+    // timer after wait
+    if ( iMessageCounter < iAttributes.iAmount )
+        {
+        iState = EStateSend;
+        iPeriodicTimer->Cancel();
+        iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                    iAttributes.iRandomVariance ), KDefaultPeriod, 
+                    TCallBack( PeriodicTimerCallBack, this ) );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+// INCLUDE FILES
+#include <eikenv.h>
+#include <coemain.h>
+#include <e32std.h>
+#include <msvids.h>
+#include <msvstd.h>
+#include <smsclnt.h>
+#include <smut.h>
+#include <mtclreg.h>
+#include <txtrich.h>
+#include <smscmds.h>
+#include <mtmuibas.h>
+#include <mtmdef.h>
+#include <StringLoader.h>
+#include "smutset.h"
+#include "smuthdr.h"
+ 
+ 
+ 
+// ============================ MEMBER FUNCTIONS ===============================
+// -----------------------------------------------------------------------------
+// CSmsHandler::CSmsHandler()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CSmsHandler::CSmsHandler( CMessageManager& aManager )
+    : CActive( CActive::EPriorityStandard ), iManager( aManager )
+    {
+    CActiveScheduler::Add( this );
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::ConstructL()
+    {
+    // Session to message server is opened asynchronously.
+    iSession = CMsvSession::OpenAsyncL( *this );
+ 
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSmsHandler* CSmsHandler::NewL( CMessageManager& aManager  )
+    {
+    CSmsHandler* self = NewLC( aManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CSmsHandler* CSmsHandler::NewLC(  CMessageManager& aManager )
+    {
+    CSmsHandler* self = new ( ELeave ) CSmsHandler( aManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+ 
+// ----------------------------------------------------------
+// CSmsHandler::~CSmsHandler()
+// Destructor.
+// ----------------------------------------------------------
+//
+CSmsHandler::~CSmsHandler()
+    {
+    Cancel();           // cancel any outstanding request
+ 
+    delete iOperation;
+    delete iMtmUiRegistry;
+    delete iSmsMtm;
+    delete iMtmRegistry;
+    delete iSession;    // session must be deleted last
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::DoCancel()
+// Cancels a request.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::DoCancel()
+    {
+    if ( iOperation )
+        {
+        iOperation->Cancel();
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::RunL()
+// Handles request completion events.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::RunL()
+    {
+    User::LeaveIfError( iStatus != KErrNone );
+ 
+    // Determine the current operations progress.
+    // ProgressL returns an 8 bit descriptor.
+    TBufC8<KMsvProgressBufferLength> progress( iOperation->ProgressL() );
+    _LIT8( KCompare, "KErrNone" );
+    User::LeaveIfError( !progress.Compare( KCompare ) );
+ 
+    // The pointer to the current CMsvOperation object is no longer needed.
+    delete iOperation;
+    iOperation = NULL;
+ 
+    // Determine which request has finished.
+    switch ( iState )
+        {
+        case EWaitingForMoving:
+            // Once a message is moved to Outbox it is scheduled for sending.
+            ScheduleL();
+            break;
+ 
+        case EWaitingForScheduling:
+            {
+            TMsvEntry entry( iSmsMtm->Entry().Entry() );
+            TInt state( entry.SendingState() );
+ 
+            if ( state == KMsvSendStateWaiting || state == KMsvSendStateScheduled)
+                {
+                // notify the observer that status has changed
+                iManager.HandleStatus( iStatus.Int() );
+                }
+            break;
+            }
+ 
+        default:
+            break;
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::HandleSessionEventL()
+// Handles notifications of events from the Message Server.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::HandleSessionEventL( TMsvSessionEvent aEvent,
+                                      TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+    {
+    switch ( aEvent )
+        {
+        // Session to server established
+        case EMsvServerReady:
+            {
+            TMsvId serviceId( KUidMsgTypeSMS.iUid ); // SMS service id
+ 
+            // Determine if the event was succesful.
+            // ServiceProgress inserts TBuf8 value in progress.
+            TBuf8<KBfrLength> progress;
+            iSession->ServiceProgress( serviceId, progress );
+            _LIT8( KCompare, "KErrNone" );
+ 
+            if ( progress.Compare( KCompare ) )
+                {
+                // Check that MtmRegistry has not already been accessed.
+                if ( !iMtmRegistry )
+                    {
+                    AccessMtmL();
+                    }
+                }
+            break;
+            }
+ 
+        // All other events are ignored.
+        default:
+            break;
+        }
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::AccessMtmL()
+// Access the MTM Registry and create a SMS specific Client MTM instance.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::AccessMtmL()
+    {
+    // Create an MTM Registry object.
+    iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
+ 
+    // Create an SMS Client MTM object.
+    iSmsMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeSMS ) );
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::SendL()
+// Starts the process of creating and sending an SMS message.
+// -----------------------------------------------------------------------------
+//
+TBool CSmsHandler::SendL( const TDesC& aRecipientNumber,
+                            const TDesC& aMessageText )
+    {
+    iRecipientNumber = aRecipientNumber;
+    iMessageText = aMessageText;
+ 
+    if ( CreateMsgL() )
+        {
+        return ETrue;
+        }
+ 
+    return EFalse;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::CreateMsgL()
+// Create an SMS message.
+// -----------------------------------------------------------------------------
+//
+TBool CSmsHandler::CreateMsgL()
+    {
+	if(!iSmsMtm)
+		{
+		return EFalse;
+		}
+    // Current entry is the Draft folder.
+    iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
+ 
+    // Create a new SMS message entry as a child of the current context.
+    iSmsMtm->CreateMessageL( KUidMsgTypeSMS.iUid );
+ 
+    CMsvEntry& serverEntry = iSmsMtm->Entry();
+    TMsvEntry entry( serverEntry.Entry() );
+ 
+    CRichText& body = iSmsMtm->Body();   // the body of the message
+    body.Reset();
+    // Insert the message text gotten as input from user.
+    body.InsertL( 0, iMessageText );
+ 
+    // Message will be sent immediately.
+    entry.SetSendingState( KMsvSendStateWaiting );
+ 
+    entry.iDate.UniversalTime(); // insert current time //Solution for HomeTime()
+
+    // Set the SMS message settings for the message.
+    CSmsHeader& header = iSmsMtm->SmsHeader();
+    CSmsSettings* settings = CSmsSettings::NewL();
+    CleanupStack::PushL( settings );
+ 
+    settings->CopyL( iSmsMtm->ServiceSettings() );    // restore settings
+    settings->SetDelivery( ESmsDeliveryImmediately ); // to be delivered immediately
+    settings->SetDeliveryReport(ETrue);
+    header.SetSmsSettingsL( *settings );              // new settings
+ 
+    // Let's check if there is a service center address.
+    if ( header.Message().ServiceCenterAddress().Length() == 0 )
+        {
+        // No, there isn't. We assume there is at least one service center
+        // number set and use the default service center number.
+        CSmsSettings* serviceSettings = &( iSmsMtm->ServiceSettings() );
+ 
+        // Check if number of service center addresses in the list is null.
+ 
+        //Changed for 3rd Edition specially
+        if ( !serviceSettings->ServiceCenterCount() )
+            {
+            CleanupStack::PopAndDestroy( settings ); 
+            return EFalse;     // quit creating the message
+            }
+ 
+        else
+            {
+            //Changed for 3rd Edition specially            
+            CSmsNumber* smsCenter= CSmsNumber::NewL();
+            CleanupStack::PushL(smsCenter);
+            smsCenter->SetAddressL((serviceSettings->GetServiceCenter( 
+                            serviceSettings->DefaultServiceCenter())).Address());
+            header.Message().SetServiceCenterAddressL( smsCenter->Address() );
+            CleanupStack::PopAndDestroy(smsCenter);
+            }
+        }
+ 
+    CleanupStack::PopAndDestroy( settings );
+ 
+    // Recipient number is displayed also as the recipient alias.
+    entry.iDetails.Set( iRecipientNumber );
+    // Add addressee.
+    iSmsMtm->AddAddresseeL( iRecipientNumber, entry.iDetails );
+ 
+    // Validate message.
+    if ( !ValidateL() )
+        {
+        return EFalse;
+        }
+ 
+    entry.SetVisible( ETrue );          // set message as visible
+    entry.SetInPreparation( EFalse );   // set together with the visibility flag
+    serverEntry.ChangeL( entry );       // commit changes        
+    iSmsMtm->SaveMessageL();            // save message
+ 
+    TMsvSelectionOrdering selection;
+    CMsvEntry* parentEntry = CMsvEntry::NewL( iSmsMtm->Session(), KMsvDraftEntryId, selection );
+    CleanupStack::PushL( parentEntry );
+ 
+    // Move message to Outbox.
+    iOperation =parentEntry->MoveL( entry.Id(), KMsvGlobalOutBoxIndexEntryId, iStatus );
+ 
+    CleanupStack::PopAndDestroy( parentEntry );
+ 
+    iState = EWaitingForMoving;
+    SetActive();
+ 
+    return ETrue;
+  }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::ValidateL()
+// Validate an SMS message.
+// -----------------------------------------------------------------------------
+//
+TBool CSmsHandler::ValidateL()
+    {
+	if( !iSmsMtm )
+		{
+		return EFalse;
+		}
+    // Empty part list to hold the result.
+    TMsvPartList result( KMsvMessagePartNone );
+ 
+    // Validate message body.
+    result = iSmsMtm->ValidateMessage( KMsvMessagePartBody );
+ 
+    if ( result != KMsvMessagePartNone )
+        {
+        return EFalse;
+        }
+ 
+    // Validate recipient.
+    result = iSmsMtm->ValidateMessage( KMsvMessagePartRecipient );
+ 
+    if ( result != KMsvMessagePartNone )
+        {
+        return EFalse;
+        }
+ 
+    return ETrue;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CSmsHandler::ScheduleL()
+// Schedule an SMS message for sending.
+// -----------------------------------------------------------------------------
+//
+void CSmsHandler::ScheduleL()
+    {
+	if( !iSmsMtm )
+		{
+		return;
+		}
+    CMsvEntrySelection* selection = new ( ELeave ) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    selection->AppendL( iSmsMtm->Entry().EntryId() ); // add message to selection
+ 
+    // Add entry to task scheduler.
+    TBuf8<1> dummyParams;   // dummy parameters needed for InvokeAsyncFunctionL
+    iOperation = iSmsMtm->InvokeAsyncFunctionL( ESmsMtmCommandScheduleCopy,
+                          *selection, dummyParams, iStatus );
+ 
+    CleanupStack::PopAndDestroy( selection );
+ 
+    iState = EWaitingForScheduling;
+    SetActive();
+    }
+ 
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+
+
+// INCLUDE FILES
+#include <mtclreg.h>                  // for CClientMtmRegistry 
+#include <msvids.h>                   // for Message type IDs
+#include <mmsclient.h>                // for CMmsClientMtm
+#include <AknQueryDialog.h>           // for CAknTextQueryDialog
+#include <f32file.h>                
+#include <coeutils.h>                  // Check the file exist
+
+#include <cmsvmimeheaders.h>        //Attachemt mimeheader
+#include <mmsvattachmentmanager.h>    //Attachment manager
+
+// -----------------------------------------------------------------------------
+// CMmsHandler::CSmsHandler()
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CMmsHandler::CMmsHandler( CMessageManager& aManager ) : iManager( aManager )
+    {
+    }
+ 
+// -----------------------------------------------------------------------------
+// CMmsHandler::ConstructL()
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CMmsHandler::ConstructL()
+    {
+    // Session to message server is opened asynchronously.
+    iSession = CMsvSession::OpenAsyncL( *this );
+ 
+    }
+ 
+// -----------------------------------------------------------------------------
+// CMmsHandler::NewL()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMmsHandler* CMmsHandler::NewL( CMessageManager& aManager  )
+    {
+    CMmsHandler* self = NewLC( aManager );
+    CleanupStack::Pop( self );
+    return self;
+    }
+ 
+// -----------------------------------------------------------------------------
+// CMmsHandler::NewLC()
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMmsHandler* CMmsHandler::NewLC(  CMessageManager& aManager )
+    {
+    CMmsHandler* self = new ( ELeave ) CMmsHandler( aManager );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+ 
+// ----------------------------------------------------------
+// CMmsHandler::~CSmsHandler()
+// Destructor.
+// ----------------------------------------------------------
+//
+CMmsHandler::~CMmsHandler()
+    {
+    delete iMmsMtm;
+    delete iMtmReg;
+    delete iSession;    // session must be deleted last (and constructed first)
+    }
+
+/*
+-----------------------------------------------------------------------------
+    CMmsHandler::CompleteConstructL()
+    Creates client MTM registry when session is ready for use. 
+    This completes model construction and is called after 'server
+    ready' event is received after async opening of CMsvSession.
+-----------------------------------------------------------------------------
+*/
+void CMmsHandler::CompleteConstructL()
+    {
+    // We get a MtmClientRegistry from our session
+    // this registry is used to instantiate new mtms.
+    iMtmReg = CClientMtmRegistry::NewL( *iSession );
+    iMmsMtm = (CMmsClientMtm*)iMtmReg->NewMtmL( KUidMsgTypeMultimedia );
+    }
+   
+/*
+-----------------------------------------------------------------------------
+    CMmsHandler::HandleSessionEventL()
+
+    Receives session events from observer and calls event handling functions. 
+    Note that if additional session event handlers are defined 
+    in the session, they are called before this function (as this is the
+    main session observer).
+    The type of event is indicated by the value of aEvent. The 
+    interpretation of the TAny arguments depends on this type. 
+-----------------------------------------------------------------------------
+*/
+void CMmsHandler::HandleSessionEventL(TMsvSessionEvent aEvent, 
+                                        TAny* /*aArg1*/, 
+                                        TAny* /*aArg2*/, 
+                                        TAny* /*aArg3*/)
+    {
+    switch ( aEvent )
+        {
+        // This event tells us that the session has been opened
+        case EMsvServerReady:
+            {
+            CompleteConstructL();       // Construct the mtm registry & MMS mtm
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+
+// -----------------------------------------------------------------------------
+// CSmsHandler::SendL()
+// Starts the process of creating and sending an SMS message.
+// -----------------------------------------------------------------------------
+//
+TBool CMmsHandler::SendL( const TDesC& aRecipientNumber,
+                            const TDesC& aMessageText )
+    {
+    TInt result( EFalse );
+    
+    iRecipientNumber = aRecipientNumber;
+    iMessageText = aMessageText;
+ 
+    if ( CreateMsgL() )
+        {
+        if ( SendMessageL() )
+            {
+            result = ETrue;
+            }
+        }
+ 
+    return result;
+    }
+
+/*
+-----------------------------------------------------------------------------
+    CMmsHandler::CreateMsgL()
+    Creates a new message server entry and set up default values.
+    In case the attachment file does not found method return EFalse
+    otherwise ETrue.
+    There are differenses how to add attachment file between 2nd and 3rd edition. 
+-----------------------------------------------------------------------------
+*/
+TBool CMmsHandler::CreateMsgL()
+    {
+
+    // - CMsvEntry accesses and acts upon a particular Message Server entry.
+    // - NewL() does not create a new entry, but simply a new object to access an existing entry.
+    // - It takes in as parameters the client's message server session,
+    //   ID of the entry to access and initial sorting order of the children of the entry. 
+    CMsvEntry* entry = CMsvEntry::NewL( *iSession, 
+                                        KMsvGlobalOutBoxIndexEntryId, 
+                                        TMsvSelectionOrdering() );
+    CleanupStack::PushL( entry );
+
+    // Set context to the parent folder (Outbox)
+    iMmsMtm->SwitchCurrentEntryL( entry->EntryId() );
+    
+    // Create new message in the parent folder (Outbox) and set it as the current context.
+    iMmsMtm->CreateMessageL( iMmsMtm->DefaultServiceL() );
+
+    CleanupStack::PopAndDestroy( entry ); 
+    
+    // Setting recipients
+    // use this to add the "To" recipients.
+    iMmsMtm->AddAddresseeL( iRecipientNumber );
+    
+    //Setting message subject
+    _LIT(KMessageSubject, "MMS Message");
+    iMmsMtm->SetSubjectL( KMessageSubject );
+    
+    // add message text
+    SetMessageBodyL();
+   
+    TMsvEntry ent = iMmsMtm->Entry().Entry();
+    // Set InPreparation to false
+    ent.SetInPreparation( EFalse );
+    ent.SetVisible( ETrue );            // mark as visible, after this the message can be seen in Outbox and, after sending, in Sent folder.
+  
+    iMmsMtm->Entry().ChangeL( ent );    // Commit changes
+    
+    //Save the changes
+    iMmsMtm->SaveMessageL();
+    
+    return ETrue;
+    }
+
+//---------------------------------------------------------------------------------
+void CMmsHandler::SetMessageBodyL()
+    {
+    _LIT (KFilenameText, "msg.txt");
+    CMsvStore* store = iMmsMtm->Entry().EditStoreL();
+    CleanupStack::PushL( store );
+
+    TMsvAttachmentId attachmentId = KMsvNullIndexEntryId;
+
+    iMmsMtm->CreateTextAttachmentL ( *store,
+                                     attachmentId,
+                                     iMessageText,
+                                     KFilenameText );
+
+    store->CommitL();
+
+    CleanupStack::PopAndDestroy( store );
+    }
+
+/* 
+-----------------------------------------------------------------------------
+    CMmsHandler::SendMessageL()
+    Sends the message.
+    Return values: ETrue or EFalse
+-----------------------------------------------------------------------------
+*/
+TBool CMmsHandler::SendMessageL()
+    {
+
+    // Start sending the message via the Server MTM to the MMS server
+    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
+    wait->iStatus = KRequestPending;
+    CMsvOperation* op = NULL;
+       op = iMmsMtm->SendL( wait->iStatus );
+    wait->Start();
+    CleanupStack::PushL( op );
+    CActiveScheduler::Start();
+
+    // The following is to ignore the completion of other active objects. It is not
+    // needed if the app has a command absorbing control.
+    while( wait->iStatus == KRequestPending )
+        {
+        CActiveScheduler::Start();
+        }
+
+    iManager.HandleStatus( wait->iStatus.Int() );
+    CleanupStack::PopAndDestroy(2); // op, wait
+    
+    return ETrue;
+    }
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_netconn.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,293 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_netconn.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+#include <commdb.h>
+
+_LIT(KThreadName, "NetConn %d");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CNetConn* CNetConn::NewL(TNetConnAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CNetConn* self = new(ELeave) CNetConn(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CNetConn::~CNetConn()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CNetConn::CNetConn(TNetConnAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadNetConn;
+
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, 1024*KMinHeapSize, 16*1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CNetConn::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TNetConnAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::GenerateLoad(TNetConnAttributes& aAttributes)
+    {
+    CNetConnManager* netConnManager = NULL;
+    TRAPD(err, netConnManager = CNetConnManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete netConnManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CNetConn::Close()
+    {
+    CLoadBase::Close();
+
+    if (iThread.ExitReason() == 0) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon(waiter);
+        User::WaitForRequest(waiter);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CNetConn::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    
+    _LIT(KNetConnEntry, "[%d] NetConn prio=%S dest=%S idle=%dms random=%d%%");
+    buf.Format(KNetConnEntry, iAttributes.iId, &prioBuf, &iAttributes.iDestination, iAttributes.iIdle, iAttributes.iRandomVariance);
+   
+    return TPtrC(buf);
+    }
+                   
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CNetConnManager* CNetConnManager::NewL(TNetConnAttributes& aAttributes)
+    {
+    CNetConnManager* self = new(ELeave) CNetConnManager(aAttributes);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CNetConnManager::CNetConnManager(TNetConnAttributes& aAttributes) :
+    CActive(EPriorityStandard), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CNetConnManager::~CNetConnManager()
+    {
+    Cancel();
+    
+    iDownloadMgr.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CNetConnManager::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // init
+    TUid dlUid;
+    dlUid.iUid = 0x00011100 + iAttributes.iId; // generate unique identifier instead of using the LoadGen uid for all instances
+    iDownloadMgr.ConnectL(dlUid, *this, ETrue);
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CNetConnManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CNetConnManager::DoCancel()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CNetConnManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CNetConnManager* self = static_cast<CNetConnManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    TRAPD(err,self->StartDownloadL());
+
+    return err;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CNetConnManager::StartDownloadL()
+    {
+    iDownloadMgr.SetIntAttribute(EDlMgrExitAction, EExitPause);
+    iDownloadMgr.DeleteAll();
+
+    // create new download    
+    TBuf8<256> url;
+    url.Copy(iAttributes.iDestination);
+
+    RHttpDownload& download = iDownloadMgr.CreateDownloadL( url );
+    
+    download.SetIntAttribute(EDlAttrAction, EDoNothing);            // do nothing when download has finished
+    download.SetBoolAttribute(EDlAttrHidden, ETrue);                // download is hidden
+    download.SetIntAttribute(EDlAttrRestartAction, ERestartForced); // force to download always ignoring cache
+
+    // start the download
+    download.Start();         
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CNetConnManager::HandleDMgrEventL(RHttpDownload& aDownload, THttpDownloadEvent aEvent)
+    {
+    if (aEvent.iProgressState == EHttpContentTypeReceived)
+        {
+        // need to start the download if already not started
+        aDownload.Start();
+        }
+    
+    switch ( aEvent.iDownloadState )
+        {
+        case EHttpDlPaused:
+        case EHttpDlCompleted:
+        case EHttpDlFailed:
+            {
+            // assume that the download has finished in this stage
+            // delete download and restart
+            aDownload.Delete();
+            iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_phonecall.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_phonecall.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+
+_LIT(KThreadName, "PhoneCall %d");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CPhoneCall* CPhoneCall::NewL(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CPhoneCall* self = new(ELeave) CPhoneCall(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPhoneCall::~CPhoneCall()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPhoneCall::CPhoneCall(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadPhoneCall;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CPhoneCall::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TPhoneCallAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::GenerateLoad(TPhoneCallAttributes& aAttributes)
+    {
+    CPhoneCallManager* phoneCallManager = NULL;
+    TRAPD(err, phoneCallManager = CPhoneCallManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete phoneCallManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCall::Close()
+    {
+    CLoadBase::Close();
+
+    if (iThread.ExitReason() == 0) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon(waiter);
+        User::WaitForRequest(waiter);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CPhoneCall::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    
+    _LIT(KPhoneCallEntry, "[%d] PhoneCall prio=%S dest=%S length=%dms idle=%dms random=%d%%");
+    buf.Format(KPhoneCallEntry, iAttributes.iId, &prioBuf, &iAttributes.iDestination, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
+   
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CPhoneCallManager* CPhoneCallManager::NewL(TPhoneCallAttributes& aAttributes)
+    {
+    CPhoneCallManager* self = new(ELeave) CPhoneCallManager(aAttributes);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPhoneCallManager::CPhoneCallManager(TPhoneCallAttributes& aAttributes) :
+    CActive(EPriorityStandard), iAttributes(aAttributes), iState(EStateIdle)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CPhoneCallManager::~CPhoneCallManager()
+    {
+    Cancel();
+    
+    if (iPeriodicTimer)
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }
+        
+    delete iDialer;
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CPhoneCallManager::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+
+    // init dialer ao
+    iDialer = CDialer::NewL(*this);
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CPhoneCallManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CPhoneCallManager::DoCancel()
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TInt CPhoneCallManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CPhoneCallManager* self = static_cast<CPhoneCallManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    self->HandleCalls();
+
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCallManager::HandleCalls()
+    {
+    if (iState == EStateIdle)
+        {
+        // make a new call
+        iState = EStateCall;
+        iDialer->Dial(iAttributes.iDestination);
+        }
+    
+    else if (iState == EStateCall)
+        {
+        // hangup existing call
+        iState = EStateIdle;
+        iDialer->Hangup();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhoneCallManager::HandleStatus(TInt /*aErr*/)
+    {
+    // call timer after wait
+    if (iState == EStateCall)
+        {
+        iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iLength, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+        }
+
+    else if (iState == EStateIdle)
+        {
+        iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+        }        
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CDialer* CDialer::NewL(CPhoneCallManager& aManager)
+    {
+    CDialer* self = new(ELeave) CDialer(aManager);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CDialer::CDialer(CPhoneCallManager& aManager) :
+    CActive(EPriorityStandard), iManager(aManager), iCallParamsPckg(iCallParams)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CDialer::~CDialer()
+    {
+    Cancel();
+    delete iTelephony;
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CDialer::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // init telephony object
+    iTelephony = CTelephony::NewL();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CDialer::RunL()
+    {
+    // notify the observer that status has changed
+    iManager.HandleStatus(iStatus.Int());
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CDialer::DoCancel()
+    {
+    iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
+    iTelephony->CancelAsync(CTelephony::EHangupCancel);
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+void CDialer::Dial(const TDesC& aDestination)
+    {
+    CTelephony::TTelNumber telNumber(aDestination);
+    iCallParams.iIdRestrict = CTelephony::ESendMyId;
+    iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId);
+    SetActive();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CDialer::Hangup()
+    {
+    iTelephony->Hangup(iStatus, iCallId);
+    SetActive();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+    
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_photocapture.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,389 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_photocapture.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include "loadgen_traces.h"
+#include <loadgen.rsg>
+#include <e32hal.h>
+#include <u32hal.h>
+#include <e32math.h>
+#include <eikenv.h>
+
+_LIT(KThreadName, "PhotoCapture %d");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+
+//TInt CPhotoCapture::iImagesReady = 0;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CPhotoCapture* CPhotoCapture::NewL(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CPhotoCapture* self = new(ELeave) CPhotoCapture(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPhotoCapture::~CPhotoCapture()
+    {    
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPhotoCapture::CPhotoCapture(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {    
+    iAttributes.iId = aReferenceNumber;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::ConstructL()
+    {    
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadPhotoCaptures;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CPhotoCapture::ThreadFunction(TAny* aThreadArg)
+    {
+    TInt err = KErrNone;
+    
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TPhotoCaptureAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return err;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::GenerateLoad(TPhotoCaptureAttributes& aAttributes)
+    {    
+    CCameraManager* cameraManager = 0;
+    TRAPD(err, cameraManager = CCameraManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete cameraManager;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::Resume()
+    {    
+    CLoadBase::Resume();    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::Suspend()
+    {    
+    CLoadBase::Suspend();    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::SetPriority()
+    {    
+    CLoadBase::SetPriority();    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPhotoCapture::Close()
+    {    
+    CLoadBase::Close();
+
+    // kill the thread immediately
+    iThread.Kill(0);   
+
+    iThread.Close();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CPhotoCapture::Description()
+    {    
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+        
+    _LIT(KPhotoCaptureEntry, "[%d] PhotoCapture camera=%d prio=%S idle=%dms random=%d%%");
+    buf.Format(KPhotoCaptureEntry, iAttributes.iId, iAttributes.iCamera, &prioBuf, iAttributes.iIdle, iAttributes.iRandomVariance);
+       
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+
+
+// --------------------------------------------------------------------------------------------
+CCameraManager* CCameraManager::NewL(TPhotoCaptureAttributes& aAttrs)
+    {
+    CCameraManager* self = new (ELeave) CCameraManager(aAttrs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+ 
+// --------------------------------------------------------------------------------------------
+CCameraManager::~CCameraManager()
+    {    
+    delete iCamera;
+    if (iPeriodicTimer)
+        {
+        iPeriodicTimer->Cancel();
+        delete iPeriodicTimer;
+        }
+    }
+ 
+// --------------------------------------------------------------------------------------------
+CCameraManager::CCameraManager(TPhotoCaptureAttributes& aAttrs) 
+: 
+CActive(EPriorityStandard),
+iAttributes(aAttrs)
+    {        
+    iState = ENotReady;
+    iNumOfPics = 0;
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::ConstructL()
+    {   
+    CActiveScheduler::Add(this);    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+        
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+
+// --------------------------------------------------------------------------------------------
+void CCameraManager::DoCancel()
+    {    
+    }
+
+// --------------------------------------------------------------------------------------------
+void CCameraManager::RunL()
+    {    
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::ReserveCameraL()
+    {
+    LOGSTRING2("LoadGen: CCameraManager::ReserveCameraL() - Using Camera %d", iAttributes.iCamera);
+    if( iCamera )
+        {
+        iCamera->Release();
+        }
+    delete iCamera;
+    iCamera = 0;
+    TRAPD( err, iCamera = CCamera::NewL(*this, iAttributes.iCamera));
+    iCurrentCamera = iAttributes.iCamera;
+    if(err != KErrNone)
+        {
+        LOGSTRING2("LoadGen: CCamera::NewL leaves with error: %d", err);
+        User::Leave(err);
+        }
+    iCamera->CameraInfo(iCameraInfo);
+    iCamera->Reserve();    
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::ReserveComplete(TInt aError)
+    {
+    if( aError != KErrNone )
+        LOGSTRING2("LoadGen: CCameraManager::ReserveComplete() - Error: %d", aError);
+    
+    if( aError == KErrNone )
+        {
+        iState = ECameraReserved;
+        iCamera->PowerOn();
+        }
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::PowerOnComplete(TInt aError)
+    {
+    if( aError != KErrNone )
+        {
+        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Error: %d", aError);
+        return;
+        }
+
+    // Define image format, try JPEG images first:
+    CCamera::TFormat format = CCamera::EFormatExif;
+
+    if(iCameraInfo.iImageFormatsSupported & CCamera::EFormatExif)
+        {
+        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - EXIF JPEG supported");
+        format = CCamera::EFormatExif;
+        }
+    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatJpeg )
+        {
+        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - JFIF JPEG supported");
+        format = CCamera::EFormatJpeg;
+        }
+    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor4K )
+        {
+        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 4K Color supported");
+        format = CCamera::EFormatFbsBitmapColor4K;
+        }
+    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor64K )
+        {
+        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 64K Color supported");
+        format = CCamera::EFormatFbsBitmapColor64K;
+        }
+    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor16M )
+        {
+        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 16M Color supported");
+        format = CCamera::EFormatFbsBitmapColor16M;
+        }
+    else
+        {
+        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - JPEGs not supported, trying \"User defined\" (Supported formats: %d)", iCameraInfo.iImageFormatsSupported);
+        format = CCamera::EFormatUserDefined;
+        }
+    const TInt KImageSizeIndex = 0;  // Largest image size
+    TRAPD( err, iCamera->PrepareImageCaptureL(format, KImageSizeIndex));
+    if( err != KErrNone )
+        {
+        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Error while preparing camera: %d", err);        
+        }
+    // Camera ready:
+    iState = EIdle;
+    // Take photo:
+    TRAP(err, CapturePhotoL());
+    if( err != KErrNone )
+        {
+        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Photo capture error: %d", err);
+        }
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+void CCameraManager::ImageReady(CFbsBitmap* aBitmap, HBufC8* aData, TInt aError)
+    {    
+    if( aError != KErrNone )
+        {
+        LOGSTRING2("LoadGen: CCameraManager::ImageReady() - Error: %d", aError);
+        }    
+    else
+        {
+        iNumOfPics++;    
+        LOGSTRING2("LoadGen: CCameraManager::ImageReady() - Images successfully captured: %d", iNumOfPics);
+        }
+    delete aBitmap;
+    delete aData;
+    iState = EIdle;
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/, TInt aError)
+    {
+    if( aError != KErrNone )
+        LOGSTRING2("LoadGen: CCameraManager::FrameBufferReady() - Error: %d", aError);
+    }
+ 
+// --------------------------------------------------------------------------------------------
+void CCameraManager::CapturePhotoL()
+    {    
+    // Camera Manager must be in idle state when taking a photo
+    if( iState == ENotReady )
+        {
+        // Not ready, camera must be reserved:
+        ReserveCameraL();
+        }
+    else if (iState == EIdle)
+        {
+        if( iCurrentCamera != iAttributes.iCamera )
+            {
+            LOGSTRING3("LoadGen: CCameraManager::CapturePhotoL() - Switching from Camera %d to Camera %d", iCurrentCamera, iAttributes.iCamera);
+            ReserveCameraL();
+            }
+        else
+            {
+            iState = ECapture;
+            if( iCameraInfo.iFlashModesSupported & CCamera::EFlashForced)
+                {
+                iCamera->SetFlashL(CCamera::EFlashForced);
+                }
+            iCamera->CaptureImage();
+            iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                iAttributes.iRandomVariance ), KDefaultPeriod, 
+                TCallBack( PeriodicTimerCallBack, this ) );
+            }
+        }
+    else
+        {
+        iPeriodicTimer->Start( CLoadGenUtils::MilliSecondsToMicroSeconds( iAttributes.iIdle,
+                                    iAttributes.iRandomVariance ), KDefaultPeriod, 
+                                    TCallBack( PeriodicTimerCallBack, this ) );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CCameraManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CCameraManager* self = static_cast<CCameraManager*>( aAny );
+    self->iPeriodicTimer->Cancel();
+    TRAP_IGNORE(self->CapturePhotoL());   
+    return KErrNone;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_pointerevent.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_pointerevent.h"
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <e32math.h>
+
+_LIT(KThreadName, "PointerEvent %d");
+
+const TInt KDefaultStart = 50;
+const TInt KDefaultPeriod = 5000000;
+    
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CPointerEvent* CPointerEvent::NewL(TPointerEventAttributes& aAttributes, TInt aReferenceNumber)
+    {
+    CPointerEvent* self = new(ELeave) CPointerEvent(aAttributes, aReferenceNumber);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPointerEvent::~CPointerEvent()
+    {
+    Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPointerEvent::CPointerEvent(TPointerEventAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
+    {
+    iAttributes.iId = aReferenceNumber;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::ConstructL()
+    {
+    CLoadBase::ConstructL();
+    
+    iType = ELoadGenCmdNewLoadPointerEvent;
+    
+    TBuf<64> threadName;
+    threadName.Format(KThreadName, iAttributes.iId);
+    
+    // create a thread
+    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
+    
+    // set priority of the thread
+    SetPriority();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CPointerEvent::ThreadFunction(TAny* aThreadArg)
+    {
+    CTrapCleanup* pC = CTrapCleanup::New();
+    CActiveScheduler* pS = new CActiveScheduler;
+    CActiveScheduler::Install(pS);
+
+    // start generating load, pass pointer to arguments
+    GenerateLoad(*((TPointerEventAttributes*) aThreadArg));
+
+    delete pS;
+    delete pC;
+    
+    return KErrNone;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::GenerateLoad(TPointerEventAttributes& aAttributes)
+    {
+    CPointerEventManager* pointerEventManager = NULL;
+    TRAPD(err, pointerEventManager = CPointerEventManager::NewL(aAttributes));
+    if (err == KErrNone) CActiveScheduler::Start();
+    delete pointerEventManager;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::Resume()
+    {
+    CLoadBase::Resume();
+    
+    iThread.Resume();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::Suspend()
+    {
+    CLoadBase::Suspend();
+    
+    iThread.Suspend();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::SetPriority()
+    {
+    CLoadBase::SetPriority();
+    
+    iThread.SetPriority(CLoadGenUtils::SettingItemToThreadPriority(iAttributes.iPriority));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPointerEvent::Close()
+    {
+    CLoadBase::Close();
+    
+    if (iThread.ExitReason() == 0) // check if the thread is still alive
+        {
+        // signal the thread that it needs to close
+        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
+
+        // wait the thread to die
+        TRequestStatus waiter;
+        iThread.Logon(waiter);
+        User::WaitForRequest(waiter);
+        iThread.Close();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TPtrC CPointerEvent::Description()
+    {
+    TBuf<256> buf;
+    TBuf<16> prioBuf;
+    CLoadGenUtils::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
+    
+    _LIT(KPointerEventEntry, "[%d] PointerEvent prio=%S heartbeat=%dms random=%d%%");
+    buf.Format(KPointerEventEntry, iAttributes.iId, &prioBuf, iAttributes.iHeartBeat, iAttributes.iRandomVariance);
+   
+    return TPtrC(buf);
+    }               
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CPointerEventManager* CPointerEventManager::NewL(TPointerEventAttributes& aAttributes)
+    {
+    CPointerEventManager* self = new(ELeave) CPointerEventManager(aAttributes);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPointerEventManager::CPointerEventManager(TPointerEventAttributes& aAttributes) :
+    CActive(EPriorityStandard), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+CPointerEventManager::~CPointerEventManager()
+    {
+    Cancel();    
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CPointerEventManager::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    // set the status as pending
+    iStatus = KRequestPending;
+    SetActive();
+    
+    // set the death status pointer point to the request status of this ao
+    iAttributes.iDeathStatus = &iStatus;
+    
+    // init    
+    
+    // start timer    
+    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CPointerEventManager::RunL()
+    {
+    // request status has completed by the main thread meaning that we need to stop now
+    CActiveScheduler::Stop();
+    }
+
+// --------------------------------------------------------------------------------------------
+ 
+void CPointerEventManager::DoCancel()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CPointerEventManager::PeriodicTimerCallBack(TAny* aAny)
+    {
+    CPointerEventManager* self = static_cast<CPointerEventManager*>( aAny );
+
+    self->iPeriodicTimer->Cancel();
+    self->SimulatePointerEvent();
+
+    return KErrNone;
+    }
+    
+// --------------------------------------------------------------------------------------------
+ 
+void CPointerEventManager::SimulatePointerEvent()
+    {
+    // Check the screen size and select pointer event position
+    // randomly
+    TSize screenSize = CLoadGenUtils::ScreenSize();
+        
+    TInt x1 = CLoadGenUtils::RandomNumber(0, screenSize.iWidth);
+    TInt y1 = CLoadGenUtils::RandomNumber(0, screenSize.iHeight);
+    
+    // Generate "Pointer down" event:
+    TRawEvent eventPointerDown;    
+    eventPointerDown.Set(TRawEvent::EButton1Down, x1, y1);
+    UserSvr::AddEvent(eventPointerDown);
+    
+    // Get new random position for "Move pointer" and 
+    // "Pointer up" events
+    TInt x2 = CLoadGenUtils::RandomNumber(0, screenSize.iWidth);
+    TInt y2 = CLoadGenUtils::RandomNumber(0, screenSize.iHeight);
+    
+    // Generate "Move pointer" event:
+    TRawEvent eventMovePointer;
+    eventMovePointer.Set(TRawEvent::EPointerMove, x2, y2);
+    UserSvr::AddEvent(eventMovePointer);
+    
+    // Generate "Pointer up" event:
+    TRawEvent eventPointerUp;
+    eventPointerUp.Set(TRawEvent::EButton1Up, x2, y2);
+    UserSvr::AddEvent(eventPointerUp);
+    
+    // call timer
+    iPeriodicTimer->Start(CLoadGenUtils::MilliSecondsToMicroSeconds(iAttributes.iHeartBeat, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/engine/src/loadgen_utils.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32math.h> 
+#include <u32hal.h>
+#include <hal.h> 
+
+#include "loadgen_utils.h"
+#include "loadgen.hrh"
+
+inline TInt64 INIT_SEED()
+{
+    TTime now; 
+    now.HomeTime(); 
+    return now.Int64();
+}
+
+TInt64 CLoadGenUtils::iRandomNumberSeed = INIT_SEED();
+
+TThreadPriority CLoadGenUtils::SettingItemToThreadPriority(TInt aIndex)
+    {
+    TThreadPriority threadPriority = EPriorityNull;
+    
+    switch ( aIndex )
+        {
+        case EThreadPriorityTypeMuchLess:
+            {
+            threadPriority = EPriorityMuchLess; break;
+            }
+        case EThreadPriorityTypeLess:
+            {
+            threadPriority = EPriorityLess; break;
+            }
+        case EThreadPriorityTypeNormal:
+            {
+            threadPriority = EPriorityNormal; break;
+            }
+        case EThreadPriorityTypeMore:
+            {
+            threadPriority = EPriorityMore; break;
+            }
+        case EThreadPriorityTypeMuchMore:
+            {
+            threadPriority = EPriorityMuchMore; break;
+            }
+        case EThreadPriorityTypeRealTime:
+            {
+            threadPriority = EPriorityRealTime; break;
+            }
+        case EThreadPriorityTypeAbsoluteVeryLow:
+            {
+            threadPriority = EPriorityAbsoluteVeryLow; break;
+            }
+        case EThreadPriorityTypeAbsoluteLow:
+            {
+            threadPriority = EPriorityAbsoluteLow; break;
+            }
+        case EThreadPriorityTypeAbsoluteBackground:
+            {
+            threadPriority = EPriorityAbsoluteBackground; break;
+            }
+        case EThreadPriorityTypeAbsoluteForeground:
+            {
+            threadPriority = EPriorityAbsoluteForeground; break;
+            }
+        case EThreadPriorityTypeAbsoluteHigh:
+            {
+            threadPriority = EPriorityAbsoluteHigh; break;
+            }
+
+        default:
+            {
+            User::Panic(_L("Wrong tp index"), 276);
+            break;
+            }
+        }
+
+    return threadPriority;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenUtils::SettingItemToThreadDescription(TInt aIndex, TDes& aBuf)
+    {
+    switch ( aIndex )
+        {
+        case EThreadPriorityTypeMuchLess:
+            {
+            aBuf.Append(_L("ML(-20)")); break;
+            }
+        case EThreadPriorityTypeLess:
+            {
+            aBuf.Append(_L("L(-10)")); break;
+            }
+        case EThreadPriorityTypeNormal:
+            {
+            aBuf.Append(_L("NO(0)")); break;
+            }
+        case EThreadPriorityTypeMore:
+            {
+            aBuf.Append(_L("M(10)")); break;
+            }
+        case EThreadPriorityTypeMuchMore:
+            {
+            aBuf.Append(_L("MM(20)")); break;
+            }
+        case EThreadPriorityTypeRealTime:
+            {
+            aBuf.Append(_L("RL(30)")); break;
+            }
+        case EThreadPriorityTypeAbsoluteVeryLow:
+            {
+            aBuf.Append(_L("AVL(100)")); break;
+            }
+        case EThreadPriorityTypeAbsoluteLow:
+            {
+            aBuf.Append(_L("AL(200)")); break;
+            }
+        case EThreadPriorityTypeAbsoluteBackground:
+            {
+            aBuf.Append(_L("ABG(300)")); break;
+            }
+        case EThreadPriorityTypeAbsoluteForeground:
+            {
+            aBuf.Append(_L("AFG(400)")); break;
+            }
+        case EThreadPriorityTypeAbsoluteHigh:
+            {
+            aBuf.Append(_L("AH(500)")); break;
+            }
+
+        default:
+            {
+            User::Panic(_L("Wrong td index"), 277);
+            break;
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenUtils::SettingItemToSourceDescription(TInt aIndex, TDes& aBuf)
+    {
+    switch ( aIndex )
+        {
+        case EMemoryEatSourceTypeRAM:
+            {
+            aBuf.Append(_L("RAM")); break;
+            }
+        case EMemoryEatSourceTypeDriveC:
+            {
+            aBuf.Append(_L("C:")); break;
+            }
+        case EMemoryEatSourceTypeDriveD:
+            {
+            aBuf.Append(_L("D:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveE:
+            {
+            aBuf.Append(_L("E:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveF:
+            {
+            aBuf.Append(_L("F:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveG:
+            {
+            aBuf.Append(_L("G:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveH:
+            {
+            aBuf.Append(_L("H:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveI:
+            {
+            aBuf.Append(_L("I:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveJ:
+            {
+            aBuf.Append(_L("J:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveK:
+            {
+            aBuf.Append(_L("K:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveL:
+            {
+            aBuf.Append(_L("L:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveM:
+            {
+            aBuf.Append(_L("M:")); break;
+            }            
+        case EMemoryEatSourceTypeDriveN:
+            {
+            aBuf.Append(_L("N:")); break;
+            }            
+
+        default:
+            {
+            User::Panic(_L("Wrong src index"), 278);
+            break;
+            }
+        }
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenUtils::MilliSecondsToMicroSeconds(TInt aMilliSeconds, TInt aRandomVariance)
+    {
+    __ASSERT_ALWAYS(aRandomVariance >= 0 && aRandomVariance <= 100, User::Panic(_L("Inv.var."), 180));
+    __ASSERT_ALWAYS(aMilliSeconds >=0, User::Panic(_L("Inv.ms."), 181));
+    
+    // if no variance defined, just do a quick conversion
+    if (aRandomVariance == 0 || aMilliSeconds == 0)
+        return aMilliSeconds * 1000;
+    
+    // otherwise calculate difference
+    TInt diff = 1000 * aMilliSeconds / 2 * aRandomVariance / 100;  
+    
+    return RandomNumber(aMilliSeconds*1000-diff, aMilliSeconds*1000+diff);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenUtils::RandomNumber(TInt aMin, TInt aMax)
+    {
+    TInt range = (aMax > aMin ? aMax - aMin : aMin - aMax) + 1;
+    TInt random = (TInt) (range * Math::FRand(iRandomNumberSeed));
+    
+    random = (random % range) + aMin;
+
+    if (random > aMax)
+        random = aMax;
+    else if (random < aMin)
+        random = aMin;
+    
+    return random;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TSize CLoadGenUtils::ScreenSize()
+    {    
+    TInt x = 0;
+    TInt y = 0;
+    HAL::Get(HALData::EDisplayXPixels, x);
+    HAL::Get(HALData::EDisplayYPixels, y);
+    return TSize(x, y);
+    }
--- a/loadgen/envpatcher/EnvPatcher.pl	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/envpatcher/EnvPatcher.pl	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
@@ -10,8 +10,8 @@
 # Nokia Corporation - initial contribution.
 #
 # Contributors:
-# 
-# Description:
+#
+# Description: 
 # Environment Patcher - Patches older S60 SDKs for supporting
 # tricks in newer platforms
 #
@@ -49,7 +49,6 @@
 
 # variables for hacked content
 my $dependshack = "\t\t\tif (/^DEPENDS\$/o) {\r\n\t\t\t\tnext LINE;  # Ignore DEPENDS keyword, not needed by ABLD\r\n\t\t\t}\r\n";
-my $smpsafehack = "\t\tif (/^SMPSAFE\$/o) {\r\n\t\t\tnext LINE;  # Ignore SMPSAFE keyword, not needed by older environments\r\n\t\t}\r\n";
 my $forwardslashhack = "\t\t# EnvPatcher forwardslash hack begins\r\n\t\t\$_=~s{/}{\\\\}g;   # convert all forward slashes to backslashes\r\n\t\t# EnvPatcher forwardslash hack ends\r\n\r\n";
 my $coreibyexportsupport = "\r\n// Following definition is used for exporting tools and stubs IBY files to\r\n// Core image.\r\n#define CORE_IBY_EXPORT_PATH(path,exported)  /epoc32/rom/include/##exported\r\n";
 
@@ -149,7 +148,7 @@
     # check if DEPENDS keyword already exists in the file
     if (string_exists_in_file($mmppmpath, "DEPENDS"))
     {
-        print "The SDK can already handle DEPENDS keyword in a MMP file.\n";        
+        print "The SDK has already been patched with DEPENDS keyword hack.\n";        
     }
     else
     {
@@ -190,51 +189,6 @@
             exit(2);    
         }
     }
-
-    # check if SMPSAFE keyword already exists in the file
-    if (string_exists_in_file($mmppmpath, "SMPSAFE"))
-    {
-        print "The SDK can already handle SMPSAFE keyword in a MMP file.\n";        
-    }
-    else
-    {
-        # read content of the mmp.pm file
-        my @filecontent = read_file_to_array($mmppmpath);
-        
-        my $match_found = 0;
-        my $i = 0;
-        my $match_found_pos = 0;
-        
-        # loop through the array to find the correct place
-        foreach (@filecontent)
-        {
-            if ($_ =~ /Unrecognised Keyword/)
-            {
-                $match_found = 1;
-                $match_found_pos = $i;
-                last;
-            } 
-
-            $i++;
-        }
-        
-        if ($match_found)
-        {
-            # insert the patched content to the file
-            splice(@filecontent, $match_found_pos, 0, $smpsafehack);
-            
-            # write the modified array to the file
-            write_file_from_array($mmppmpath, @filecontent);
-        
-            print "Mmp.pm patched with SMPSAFE keyword hack.\n";
-        }
-        else
-        {
-            print "ERROR: Unable to find correct place from $mmppmpath for patching!\n";
-            print "Your SDK environment probably is not supported by this script!\n";
-            exit(2);    
-        }
-    }
 }
 else
 {
--- a/loadgen/envpatcher/ReadMe.txt	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/envpatcher/ReadMe.txt	Fri May 14 15:53:02 2010 +0300
@@ -1,7 +1,7 @@
-Environment Patcher v1.0.1
-==========================
+Environment Patcher
+===================
 
-Updated: 12th November 2009
+Updated: 9th January 2009
 
 
 Introduction:
@@ -12,8 +12,7 @@
 
 This tool can perform the following tasks:
 - Adds support for forward slashes in paths in bld.inf/.mmp files in S60 3.0 
-- Removes an unncessary warning about DEPENDS and SMPSAFE resource keywords in
-  an .mmp file
+- Removes an unncessary warning about DEPENDS resource keyword in an .mmp file
 - Creates a missing epoc32\include\platform_paths.hrh file for supporting
   platform macros introduced since S60 3.2 OEM and Symbian Foundation releases
 - Modifies epoc32\include\platform_paths.hrh for missing macros   
@@ -37,10 +36,12 @@
 
 
 
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
+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 "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
+This material, including documentation and any related computer programs, is
+protected by copyright controlled by Nokia. All rights are reserved. Copying,
+including reproducing, storing, adapting or translating, any or all of this
+material requires the prior written consent of Nokia. This material also
+contains confidential information which may not be disclosed to others without
+the prior written consent of Nokia.
--- a/loadgen/group/ReleaseNotes_LoadGen.txt	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/group/ReleaseNotes_LoadGen.txt	Fri May 14 15:53:02 2010 +0300
@@ -1,7 +1,7 @@
 ===============================================================================
 
-RELEASE NOTES - LOAD GENERATOR v1.4.0
-RELEASED 30th September 2009
+RELEASE NOTES - LOAD GENERATOR v1.5.0
+RELEASED 23rd April 2010
 
 SUPPORTS S60 3.0+
 
@@ -33,11 +33,10 @@
 
 ===============================================================================
 
-What's New in v1.4.0
+What's New in v1.5.0
 ====================
-- Feature: New load: Photo capture.
-- Feature: New load: Bluetooth actions.
-- Feature: New load: Pointer (touch ui) events. 
+- Feature: Orbit UI introduced
+
 
 ===============================================================================
 
@@ -85,6 +84,12 @@
 Version History:
 ================
 
+Version 1.4.0
+====================
+- Feature: New load: Photo capture.
+- Feature: New load: Bluetooth actions.
+- Feature: New load: Pointer (touch ui) events. 
+
 Version 1.3.0 - 30th June 2009
 ==============================
 - Feature: SMP support: CPU can be selected for CPU load.
@@ -119,10 +124,11 @@
 
 ===============================================================================
 
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
 
-This component and the accompanying materials are made available
-under the terms of "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
--- a/loadgen/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -1,60 +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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
+// ============================================================================
+// * Makefile for building: group
+// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T09:27:08
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// * Project:  group.pro
+// * Template: subdirs
+// ============================================================================
 
-
-#include <platform_paths.hrh>
-
-PRJ_EXPORTS
-../group/backup_registration.xml    Z:/private/20011384/backup_registration.xml
-../rom/loadgen.iby CORE_IBY_EXPORT_PATH(tools,loadgen.iby)
+#define BLD_INF_GROUP_0010C4D8
 
 
-PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
-  gnumakefile loadgen_icons_aif.mk
-  gnumakefile loadgen_extraicons.mk
+prj_platforms
 
-  #ifdef MARM
-  gnumakefile loadgen_stub_sis.mk
-  #endif
-#endif
+WINSCW GCCE ARMV5 ARMV6
+#include "bld_generic.inf"
 
-loadgen.mmp
+#include "../ui/avkon/group/bld.inf"
+
+prj_mmpfiles
 
 
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE loadgen_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_loadgen
-  END
+prj_extensions
 
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE loadgen_extraicons.mif
-  OPTION HEADERFILE loadgen_extraicons.mbg
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_prob_status_red -c8,8 qgn_prob_status_green
-  END
-
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME LoadGen_stub
-  END
-  #endif  
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/group/bld_generic.inf	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_EXPORTS
+../group/backup_registration.xml    Z:/private/20011384/backup_registration.xml
+
+
+
+PRJ_MMPFILES
+#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+  gnumakefile loadgen_icons_aif.mk
+  gnumakefile loadgen_extraicons.mk
+
+  #ifdef MARM
+  gnumakefile loadgen_stub_sis.mk
+  #endif
+#endif
+
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
+  PRJ_EXTENSIONS
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE loadgen_aif.mif
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES -c8,8 qgn_menu_loadgen
+  END
+
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE loadgen_extraicons.mif
+  OPTION HEADERFILE loadgen_extraicons.mbg
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES -c8,8 qgn_prob_status_red -c8,8 qgn_prob_status_green
+  END
+
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME LoadGen_stub
+  END
+  #endif  
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/group/group.pro	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_platforms += "$${LITERAL_HASH}include \"bld_generic.inf\""
--- a/loadgen/group/loadgen.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-
-TARGET            LoadGen.exe
-TARGETTYPE        exe
-EPOCSTACKSIZE     0x5000
-EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
-
-UID               0x100039CE 0x20011384
-
-VENDORID          VID_DEFAULT
-CAPABILITY        swevent ReadUserData WriteUserData NetworkServices UserEnvironment CAP_APPLICATION AllFiles
-
-LANG              SC
-
-SMPSAFE
-
-START RESOURCE    ../data/loadgen.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../data/loadgen_reg.rss
-DEPENDS           loadgen.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-APP_LAYER_SYSTEMINCLUDE
-USERINCLUDE       ../inc
-SOURCEPATH        ../src
-
-
-SOURCE            loadgen_app.cpp
-SOURCE            loadgen_document.cpp 
-SOURCE            loadgen_appui.cpp
-SOURCE            loadgen_model.cpp
-SOURCE            loadgen_mainview.cpp 
-SOURCE            loadgen_maincontainer.cpp 
-SOURCE            loadgen_settingsviewdlg.cpp
-SOURCE            loadgen_editors.cpp
-SOURCE            loadgen_loadbase.cpp
-SOURCE            loadgen_cpuload.cpp
-SOURCE            loadgen_memoryeat.cpp
-SOURCE            loadgen_phonecall.cpp
-SOURCE            loadgen_netconn.cpp
-SOURCE            loadgen_keypress.cpp
-SOURCE            loadgen_messages.cpp 
-SOURCE            loadgen_applications.cpp 
-SOURCE 			  loadgen_photocapture.cpp
-SOURCE			  loadgen_bluetooth.cpp 
-SOURCE			  loadgen_pointerevent.cpp
-
-LIBRARY           euser.lib
-LIBRARY           commonengine.lib
-LIBRARY           apparc.lib
-LIBRARY           cone.lib 
-LIBRARY           eikcore.lib
-LIBRARY           eikcoctl.lib
-LIBRARY           eikctl.lib
-LIBRARY           eikdlg.lib  
-LIBRARY           avkon.lib 
-LIBRARY           ws32.lib 
-LIBRARY           apgrfx.lib
-LIBRARY           efsrv.lib
-LIBRARY           bafl.lib
-LIBRARY           gdi.lib
-LIBRARY           aknicon.lib
-LIBRARY           aknskins.lib
-LIBRARY           aknskinsrv.lib
-LIBRARY           egul.lib
-LIBRARY           etel3rdparty.lib
-LIBRARY           downloadmgr.lib
-LIBRARY           commdb.lib
-LIBRARY           flogger.lib
-LIBRARY           estor.lib 
-LIBRARY           msgs.lib
-LIBRARY           smcm.lib
-LIBRARY           gsmu.lib
-LIBRARY           etext.lib
-LIBRARY           sendas2.lib
-LIBRARY  		  ecam.lib
-LIBRARY			  featdiscovery.lib 
-LIBRARY			  centralrepository.lib
-LIBRARY           esock.lib
-LIBRARY           bluetooth.lib
-LIBRARY			  hal.lib
-
-// End of File
--- a/loadgen/group/loadgen_extraicons.mk	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/group/loadgen_extraicons.mk	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 #
 # Contributors:
 #
-# Description:  
+# Description: 
 #
 
 ifeq (WINS,$(findstring WINS, $(PLATFORM)))
--- a/loadgen/group/loadgen_icons_aif.mk	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/group/loadgen_icons_aif.mk	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 #
 # Contributors:
 #
-# Description:  
+# Description: 
 #
 
 ifeq (WINS,$(findstring WINS, $(PLATFORM)))
--- a/loadgen/group/loadgen_stub_sis.mk	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/group/loadgen_stub_sis.mk	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 #
 # Contributors:
 #
-# Description:  
+# Description: 
 #
 
 
--- a/loadgen/inc/loadgen.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_HRH
-#define LOADGEN_HRH
-
-enum TLoadGenCommandIds
-    {
-    ELoadGenCmdNewLoad,    
-    ELoadGenCmdNewLoadCPULoad,    
-    ELoadGenCmdNewLoadEatMemory,    
-    ELoadGenCmdNewLoadPhoneCall,    
-    ELoadGenCmdNewLoadNetConn,    
-    ELoadGenCmdNewLoadKeyPress,    
-    ELoadGenCmdNewLoadMessages,
-    ELoadGenCmdNewLoadApplications,
-    ELoadGenCmdNewLoadPhotoCaptures,
-    ELoadGenCmdNewLoadBluetooth,
-    ELoadGenCmdNewLoadPointerEvent,
-    ELoadGenStopAll,
-    ELoadGenSuspendAll,
-    ELoadGenResumeAll,
-
-    ELoadGenCmdLaunchPerfMon,
-    ELoadGenCmdAbout,
-
-    ELoadGenCmdSettingsChange,
-    ELoadGenCmdSettingsExit,
-    ELoadGenCmdSettingsBack,
-
-    ELoadGenSettingItemList
-    };
-
-enum TEditorFormItemIds
-    {
-    ELoadGenCPULoadQueryPriority = 1000,
-    ELoadGenCPULoadQueryMode,
-    ELoadGenCPULoadQueryType,
-    ELoadGenCPULoadQueryLength,
-    ELoadGenCPULoadQueryIdle,
-    ELoadGenCPULoadQueryVariance,
-    ELoadGenCPULoadQueryCpu,
-
-    ELoadGenMemoryEatQueryPriority,
-    ELoadGenMemoryEatQuerySource,
-    ELoadGenMemoryEatQueryType,
-    ELoadGenMemoryEatQueryBuffer,
-    ELoadGenMemoryEatQueryIdle,
-    ELoadGenMemoryEatQueryAmount,
-    ELoadGenMemoryEatQueryRandomMin,
-    ELoadGenMemoryEatQueryRandomMax,
-    ELoadGenMemoryEatQueryVariance,
-    
-    ELoadGenPhoneCallQueryPriority,
-    ELoadGenPhoneCallQueryDestination,
-    ELoadGenPhoneCallQueryLength,
-    ELoadGenPhoneCallQueryIdle,
-    ELoadGenPhoneCallQueryVariance,
-    
-    ELoadGenNetConnQueryPriority,
-    ELoadGenNetConnQueryDestination,
-    ELoadGenNetConnQueryIdle,
-    ELoadGenNetConnQueryVariance,
-   
-    ELoadGenKeyPressQueryPriority,
-    ELoadGenKeyPressQueryHeartBeat,
-    ELoadGenKeyPressQueryVariance,
-        
-    ELoadGenMessagesQueryPriority,        
-    ELoadGenMessagesQueryType,            // Message type
-    ELoadGenMessagesQueryDestination,     // Phone number
-    ELoadGenMessagesQueryAmount,          // Messages
-    ELoadGenMessagesQueryLength,          // Message length
-    ELoadGenMessagesQueryMessage,         // Message
-    ELoadGenMessagesQueryIdle,            // idle period 
-    ELoadGenMessagesQueryVariance,
-
-    ELoadGenApplicationsQueryPriority,
-    ELoadGenApplicationsLaunchingInterval,
-    ELoadGenApplicationsKeyPressQueryHeartBeat,
-    ELoadGenApplicationsMaxOpen,
-    ELoadGenApplicationsKeyPressType,
-    ELoadGenApplicationsQueryVariance,
-    
-    ELoadGenPhotoCaptureQueryPriority,
-    ELoadGenPhotoCaptureQueryDevice,    
-    ELoadGenPhotoCaptureQueryIdle,
-    ELoadGenPhotoCaptureQueryVariance,
-           
-    ELoadGenBluetoothQueryPriority,
-    ELoadGenBluetoothQueryIdle,
-    ELoadGenBluetoothQueryVariance,
-    
-    ELoadGenPointerEventQueryPriority,
-    ELoadGenPointerEventQueryHeartBeat,
-    ELoadGenPointerEventQueryVariance
-    };
-
-enum TItemActionMenuTypes
-    {
-    EItemActionMenuTypeStop = 0,
-    EItemActionMenuTypeSuspendResume,    
-    EItemActionMenuTypeEdit    
-    };
-
-enum TThreadPriorityTypes
-    {
-    EThreadPriorityTypeMuchLess = 0,    
-    EThreadPriorityTypeLess,    
-    EThreadPriorityTypeNormal,    
-    EThreadPriorityTypeMore,    
-    EThreadPriorityTypeMuchMore,    
-    EThreadPriorityTypeRealTime,    
-    EThreadPriorityTypeAbsoluteVeryLow,    
-    EThreadPriorityTypeAbsoluteLow,    
-    EThreadPriorityTypeAbsoluteBackground,    
-    EThreadPriorityTypeAbsoluteForeground,    
-    EThreadPriorityTypeAbsoluteHigh
-    };
-
-enum TCpuLoadMode
-    {
-    ECpuLoadModeYielding = 0,
-    ECpuLoadModeBlocking    
-    };
-                    
-enum TCpuLoadTypes
-    {
-    ECpuLoadTypeContinuous = 0,
-    ECpuLoadTypePeriodic    
-    };
-
-enum TMemoryEatTypes
-    {
-    EMemoryEatTypeMemoryToEat = 0,
-    EMemoryEatTypeMemoryToBeLeft,
-    EMemoryEatTypeWavy
-    };        
-
-enum TMemoryEatSourceTypes
-    {
-    EMemoryEatSourceTypeRAM = 0,
-    EMemoryEatSourceTypeDriveC,
-    EMemoryEatSourceTypeDriveD,
-    EMemoryEatSourceTypeDriveE,
-    EMemoryEatSourceTypeDriveF,
-    EMemoryEatSourceTypeDriveG,
-    EMemoryEatSourceTypeDriveH,
-    EMemoryEatSourceTypeDriveI,
-    EMemoryEatSourceTypeDriveJ,
-    EMemoryEatSourceTypeDriveK,
-    EMemoryEatSourceTypeDriveL,
-    EMemoryEatSourceTypeDriveM,
-    EMemoryEatSourceTypeDriveN
-    };
-
-enum TMessageTypes
-    {
-    EMessageTypeSMS = 0,
-    EMessageTypeMMS
-    };      
-
-enum TApplicationsKeyPressTypes
-    {
-    EApplicationsKeyPressTypeNone = 0,
-    EApplicationsKeyPressTypeArrows
-    };      
-
-enum TApplicationsEventTypes
-    {
-    EApplicationsCloseApplication = 0,
-    EApplicationsLaunchApplication
-    };      
-
-#endif      // LOADGEN_HRH
--- a/loadgen/inc/loadgen_app.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_APP_H
-#define LOADGEN_APP_H
-
-
-// INCLUDES
-#include <aknapp.h>
-
-// CONSTANTS
-// UID of the application
-const TUid KUidLoadGen = { 0x20011384 };
-
-// CLASS DECLARATION
-
-/**
-* CLoadGenApp application class.
-* Provides factory to create concrete document object.
-* 
-*/
-class CLoadGenApp : public CAknApplication
-    {
-    
-    public: // Functions from base classes
-        /**
-        * From CApaApplication, overridden to enable INI file support.
-        * @return A pointer to the dictionary store
-        */
-    CDictionaryStore* OpenIniFileLC(RFs& aFs) const;
-    private:
-
-        /**
-        * From CApaApplication, creates CLoadGenDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-        
-        /**
-        * From CApaApplication, returns application's UID (KUidLoadGen).
-        * @return The value of KUidLoadGen.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-// End of File
-
--- a/loadgen/inc/loadgen_applications.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_APPLICATIONS_H
-#define LOADGEN_APPLICATIONS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <w32std.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CLauncherEngine;
-
-// CLASS DECLARATIONS
-
-class CAppLauncher : public CLoadBase
-    {
-public:
-    static CAppLauncher* NewL( TApplicationsAttributes& aAttributes,
-                                TInt aReferenceNumber );
-    virtual ~CAppLauncher();
-        
-private: // Constructors
-    CAppLauncher( TApplicationsAttributes& aAttributes, 
-                    TInt aReferenceNumber );
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TApplicationsAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction( TAny* aThreadArg );
-
-private:  // New static methods
-    static void GenerateLoad( TApplicationsAttributes& aAttributes );
-
-private: // Data
-    TApplicationsAttributes         iAttributes;    
-    RThread                         iThread;
-    };
-
-// Class to start launching applications in given period 
-
-// CLASS DECLARATIONS
-class CAppLauncherManager : public CActive
-    {
-public:
-    static CAppLauncherManager* NewL( TApplicationsAttributes& aAttributes );
-    ~CAppLauncherManager();
-
-private:
-    CAppLauncherManager( TApplicationsAttributes& aAttributes );
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack( TAny* aAny );
-    void SimulateEventL();
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TApplicationsAttributes&    iAttributes;    
-    CPeriodic*                  iPeriodicTimer;
-    RWsSession                  iWsSession;
-    CLauncherEngine*            iLauncherEngine;
-    TInt                        iAppEventType;
-    }; 
-
-// A class where applicationg launching and ending is implemented 
-#include <aknappui.h>
-#include <apgcli.h>
-
-// FORWARD DECLARATIONS
-class CAppKeyPressManager;
-
-// CLASS DECLARATIONS
-class CLauncherEngine : public CBase
-    {
-public:
-    static CLauncherEngine* NewL( TApplicationsAttributes& aAttributes );
-    ~CLauncherEngine();
-
-public:
-    void StartAppLaunchingL();
-    void StopApplication( TBool aRandomApplication );
-    
-    
-private:
-    CLauncherEngine( TApplicationsAttributes& aAttributes );
-    void ConstructL();
-    TBool LaunchApplicationL();
-    void DoLaunchApplicationL();
-
-public:    
-    inline TInt AppLaunchCounter() { return iAppLaunchCounter; }
-    
-private:
-    RTimer          iTimer;
-    RApaLsSession   iLs;
-    RWsSession      iWs;
-    TInt            iAppLaunchCounter;
-    TUid            iCurrentAppUid;
-    TThreadId       iCurrentAppThreadId;
-    TBuf<128>       iCurrentAppNameAndExt;
-    RThread         iCurrentAppThread;
-    TInt            iParallelApplicationsCounter;
-    TApplicationsAttributes&    iAttributes;
-
-    CAppKeyPressManager* iAppKeyPressManager;
-    };
-
-
-// A class where key presses can be added to application
-#include <e32cmn.h>
-// FORWARD DECLARATIONS
-class CApplicationKeyPresses;
-// CLASS DECLARATIONS
-class CAppKeyPressManager : public CBase
-    {
-public:
-    static CAppKeyPressManager* NewL( TApplicationsAttributes& aAttributes );
-    ~CAppKeyPressManager();
-    void AddNewApplicationUidToKeyEventsL( TUid aUid );
-    TUid KillApplication( TBool aRandomApplication );
-    
-private:
-    CAppKeyPressManager( TApplicationsAttributes& aAttributes );
-    void ConstructL();
-
-private:
-    RPointerArray<CApplicationKeyPresses> iKeyPresses;
-    TApplicationsAttributes& iAttributes;    
-    }; 
-
-// A class which sends key press events to application
-// CLASS DECLARATIONS
-class CApplicationKeyPresses : public CBase
-    {
-public:
-    static CApplicationKeyPresses* NewL( TUid aUid, 
-                                            TApplicationsAttributes& aAttributes );
-    ~CApplicationKeyPresses();
-    
-private:
-    CApplicationKeyPresses( TUid aUid, TApplicationsAttributes& aAttributes );
-    void ConstructL();
-
-private:
-    static TInt PeriodicTimerCallBack( TAny* aAny );
-    void SimulateKeyEvent();
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TUid                        iUid;
-    TApplicationsAttributes&    iAttributes;
-    CPeriodic*                  iPeriodicTimer;
-    RWsSession                  iWsSession;
-public:
-    inline TUid ApplicationUid() { return iUid; };    
-    }; 
-
-#endif // LOADGEN_APPLICATIONS
--- a/loadgen/inc/loadgen_appui.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_APPUI_H
-#define LOADGEN_APPUI_H
-
-// INCLUDES
-#include <eikapp.h>
-#include <eikdoc.h>
-#include <e32std.h>
-#include <coeccntx.h>
-#include <aknviewappui.h>
-#include <akntabgrp.h>
-#include <aknnavide.h>
-#include "loadgen_std.h"
-
-// FORWARD DECLARATIONS
-class CLoadGenModel;
-class CAknNavigationControlContainer;
-class CAknTabGroup;
-class CAknNavigationDecorator;
-
-
-// CLASS DECLARATIONS
-
-class CLoadGenAppUi : public CAknViewAppUi
-    {
-public: // constructors and destructor
-    void ConstructL();
-    ~CLoadGenAppUi();
-    
-private: // From MEikMenuObserver
-    void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-private:
-    void HandleCommandL(TInt aCommand);
-
-    virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
-
-private: //Data
-    CLoadGenModel*                  iModel;
-    CAknNavigationControlContainer* iNaviPane;
-    CAknTabGroup*                   iTabGroup;
-    CAknNavigationDecorator*        iDecoratedTabGroup;
-    };
-
-#endif
-
-// End of File
--- a/loadgen/inc/loadgen_bluetooth.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_BLUETOOTH_H
-#define LOADGEN_BLUETOOTH_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <centralrepository.h>
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-#include <es_sock.h>
-#include <bt_sock.h>
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATIONS
-
-class CBluetooth : public CLoadBase
-    {
-public:
-    static CBluetooth* NewL(TBluetoothAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CBluetooth();
-        
-private: // Constructors
-    CBluetooth(TBluetoothAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TBluetoothAttributes& Attributes() { return iAttributes; }
-    
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-    
-private:  // New static methods
-    static void GenerateLoad(TBluetoothAttributes& aAttributes);    
-    void InitializeBluetoothL();
-    TBool SetBTPowerState(TBool aState);
-    
-private: // Data
-           
-    TBluetoothAttributes    iAttributes;    
-    RThread                 iThread; 
-    };
- 
-
-
- 
-class CBTManager : public CActive//, public MBTPowerManagerObserver
-    {
-    public:
-        
-        static CBTManager* NewL(TBluetoothAttributes& aAttrs);
-        virtual ~CBTManager();
- 
-    private:
-        
-        CBTManager( TBluetoothAttributes& aAttrs);
-        void ConstructL();
-        TInt StartBTDeviceDiscovery();
- 
-    private:
-            
-        static TInt PeriodicTimerCallBack(TAny* aAny);        
-    public:
-                                                        
-        /**
-         * From CActive:
-         */
-        void RunL();
-        void DoCancel();       
-
-    private:
-        
-        CPeriodic*              iPeriodicTimer;
-        TBluetoothAttributes&   iAttributes;  
-        CRepository*            iBTPowerStateCRepo;
-        RSocketServ             iSocketServerHnd;
-        RHostResolver           iHostResolver;        
-        TNameEntry              iBTNameEntry;        
-    };
-
-
-#endif
-
--- a/loadgen/inc/loadgen_cpuload.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_CPULOAD_H
-#define LOADGEN_CPULOAD_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-
-
-
-// CLASS DECLARATIONS
-
-class CCPULoad : public CLoadBase
-    {
-public:
-    static CCPULoad* NewL(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CCPULoad();
-        
-private: // Constructors
-    CCPULoad(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TCPULoadAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-
-private:  // New static methods
-    static void GenerateLoad(TCPULoadAttributes& aAttributes);
-    static void DoHeaveStuff(TInt aMode);
-
-private: // Data
-    TCPULoadAttributes      iAttributes;    
-    RThread                 iThread;
-    };
- 
-
-#endif
--- a/loadgen/inc/loadgen_document.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_DOCUMENT_H
-#define LOADGEN_DOCUMENT_H
-
-// INCLUDES
-#include <akndoc.h>
-   
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CEikAppUi;
-class CLoadGenModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CLoadGenDocument application class.
-*/
-class CLoadGenDocument : public CAknDocument
-    {
-    public: // Constructors and destructor
-        static CLoadGenDocument* NewL(CEikApplication& aApp);
-        virtual ~CLoadGenDocument();
-
-    public: // New functions
-
-    public:// from CEikDocument
-    CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
-    protected:  // New functions
-
-    protected:  // Functions from base classes
-
-    private:
-
-        /**
-        * EPOC default constructor.
-        */
-        CLoadGenDocument(CEikApplication& aApp);
-        void ConstructL();
-
-    private:
-
-        /**
-        * From CEikDocument, create CLoadGenAppUi "App UI" object.
-        */
-        CEikAppUi* CreateAppUiL();
-
-    public:
-        inline CLoadGenModel* Model() { return iModel; }
-
-    private:
-        CLoadGenModel* iModel;
-
-    };
-
-#endif
-
-// End of File
-
--- a/loadgen/inc/loadgen_editors.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_EDITORS_H
-#define LOADGEN_EDITORS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <aknform.h> 
-
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CAknQueryValueText;
-class CAknQueryValueTextArray;
-
-// CLASS DECLARATIONS
-
-class CLoadGenLoadTypeEditorBase : public CAknForm
-    {
-protected: // Constructors
-    CLoadGenLoadTypeEditorBase(TBool aEditingExisting);
-    void ConstructL(const TDesC& aTitleText);        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-
-protected:  // New methods
-    virtual TBool DoRunQueryLD(TInt aResource);
-    
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-protected:  // New methods
-    void InsertFieldAfterL(TInt aResourceId, TInt aControlId, TInt aPrevControlId);
-    void UpdateFormL();
-
-protected: // Data
-    TBool iEditingExisting;
-    };
-
-
-
-
-class CLoadGenCPULoadEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenCPULoadEditor* NewL(TCPULoadAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenCPULoadEditor();
-
-private: // Constructors
-    CLoadGenCPULoadEditor(TCPULoadAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    void LoadCPUsL();
-    
-private: // Data
-    TCPULoadAttributes&         iAttributes;
-    CAknQueryValueText*         iCpuQueryValText;
-    CAknQueryValueTextArray*    iCpuTextArray;
-    CDesCArray*                 iCPUsArray;
-    };
-
-
-
-
-class CLoadGenMemoryEatEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenMemoryEatEditor* NewL(TMemoryEatAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenMemoryEatEditor();
-
-private: // Constructors
-    CLoadGenMemoryEatEditor(TMemoryEatAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    void UpdateAvailableMemoryL();
-
-private: // Data
-    TMemoryEatAttributes&              iAttributes;
-    }; 
-
-
-
-class CLoadGenPhoneCallEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenPhoneCallEditor* NewL(TPhoneCallAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenPhoneCallEditor();
-
-private: // Constructors
-    CLoadGenPhoneCallEditor(TPhoneCallAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    
-private: // Data
-    TPhoneCallAttributes&              iAttributes;
-    };
-
-
-
-class CLoadGenNetConnEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenNetConnEditor* NewL(TNetConnAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenNetConnEditor();
-
-private: // Constructors
-    CLoadGenNetConnEditor(TNetConnAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    
-private: // Data
-    TNetConnAttributes&              iAttributes;
-    };
-    
- 
- 
-
-class CLoadGenKeyPressEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenKeyPressEditor* NewL(TKeyPressAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenKeyPressEditor();
-
-private: // Constructors
-    CLoadGenKeyPressEditor(TKeyPressAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    
-private: // Data
-    TKeyPressAttributes&              iAttributes;
-    };
-
-class CLoadGenPointerEventEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenPointerEventEditor* NewL(TPointerEventAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenPointerEventEditor();
-
-private: // Constructors
-    CLoadGenPointerEventEditor(TPointerEventAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    
-private: // Data
-    TPointerEventAttributes&              iAttributes;
-    };
-
-
-
-class CLoadGenMessagesEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenMessagesEditor* NewL( TMessageAttributes& aAttributes, 
-                                         TBool aEditingExisting = EFalse );
-    virtual ~CLoadGenMessagesEditor();
-
-private: // Constructors
-    CLoadGenMessagesEditor( TMessageAttributes& aAttributes, 
-                            TBool aEditingExisting = EFalse );
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL( TInt aButtonId );    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL( TInt aControlId );
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL( TBool aFormInit = EFalse );
-    
-private: // Data
-    TMessageAttributes&              iAttributes;
-    };
-
-class CLoadGenApplicationsEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenApplicationsEditor* NewL( TApplicationsAttributes& aAttributes, 
-                                         TBool aEditingExisting = EFalse );
-    virtual ~CLoadGenApplicationsEditor();
-
-private: // Constructors
-    CLoadGenApplicationsEditor( TApplicationsAttributes& aAttributes, 
-                            TBool aEditingExisting = EFalse );
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL( TInt aButtonId );    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL( TInt aControlId );
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL( TBool aFormInit = EFalse );
-    
-private: // Data
-    TApplicationsAttributes&              iAttributes;
-    };
-
-class CLoadGenPhotoCaptureEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenPhotoCaptureEditor* NewL(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenPhotoCaptureEditor();
-
-private: // Constructors
-    CLoadGenPhotoCaptureEditor(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    void LoadCamerasL();
-    
-private: // Data
-    TPhotoCaptureAttributes&    iAttributes;
-    CAknQueryValueText*         iCameraQueryValText;
-    CAknQueryValueTextArray*    iCameraTextArray;
-    CDesCArray*                 iCamerasArray;
-    };
-
-class CLoadGenBluetoothEditor : public CLoadGenLoadTypeEditorBase
-    {
-public:
-    static CLoadGenBluetoothEditor* NewL(TBluetoothAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    virtual ~CLoadGenBluetoothEditor();
-
-private: // Constructors
-    CLoadGenBluetoothEditor(TBluetoothAttributes& aAttributes, TBool aEditingExisting=EFalse);
-    void ConstructL();        
-
-protected:  // From CEikDialog
-    TBool OkToExitL(TInt aButtonId);    
-    void PreLayoutDynInitL();
-    void HandleControlStateChangeL(TInt aControlId);
-        
-public:  // New methods
-    virtual TBool RunQueryLD();
-
-private:  // New methods
-    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
-    
-private: // Data
-    TBluetoothAttributes&              iAttributes;
-    };
-
-#endif
--- a/loadgen/inc/loadgen_keypress.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_KEYPRESS_H
-#define LOADGEN_KEYPRESS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <w32std.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-
-
-
-// CLASS DECLARATIONS
-
-class CKeyPress : public CLoadBase
-    {
-public:
-    static CKeyPress* NewL(TKeyPressAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CKeyPress();
-        
-private: // Constructors
-    CKeyPress(TKeyPressAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TKeyPressAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-
-private:  // New static methods
-    static void GenerateLoad(TKeyPressAttributes& aAttributes);
-
-private: // Data
-    TKeyPressAttributes         iAttributes;    
-    RThread                     iThread;
-    };
-
-
-class CKeyPressManager : public CActive
-    {
-public:
-    static CKeyPressManager* NewL(TKeyPressAttributes& aAttributes);
-    ~CKeyPressManager();
-
-private:
-    CKeyPressManager(TKeyPressAttributes& aAttributes);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack(TAny* aAny);
-    void SimulateKeyEvent();
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TKeyPressAttributes&    iAttributes;    
-    CPeriodic*              iPeriodicTimer;
-    RWsSession              iWsSession;
-    }; 
-
-#endif
--- a/loadgen/inc/loadgen_loadattributes.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_LOADATTRIBUTES_H
-#define LOADGEN_LOADATTRIBUTES_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <badesca.h> // CDesCArray
-
-const TInt KCPUSelection_FreeScheduling = -1;
-const TInt KCPUSelection_AllCPUs        = 999;
-
-// FORWARD DECLARATIONS
-
-
-// CLASS DECLARATIONS
-class TCPULoadAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TUint iMode;        
-    TUint iType;        
-    TUint iLength;        
-    TUint iIdle;        
-    TUint iRandomVariance;
-    // iCpu defines in which CPU the load thread should be executed in 
-    // (in SMP environments). 0 = CPU0, 1 = CPU1 etc. Negative value means 
-    // that CPU is undefined. When CPU is undefined, Scheduler can schedule
-    // the load thread freely to any CPU as it pleases.
-    TInt  iCpu;
-    // Defines how many CPUs the running system has.
-    TUint iCpuCount;
-    };
-
-class TMemoryEatAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TUint iSource;        
-    TUint iType;
-    TUint iBuffer;
-    TUint iIdle;
-    TInt64 iAmount;
-    TInt64 iRandomMin;
-    TInt64 iRandomMax;
-    TBuf<64> iAmountDes;
-    TBuf<64> iRandomMinDes;
-    TBuf<64> iRandomMaxDes;
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    }; 
-
-class TPhoneCallAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TBuf<128> iDestination;
-    TUint iLength;        
-    TUint iIdle;        
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TNetConnAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TBuf<128> iDestination;
-    TUint iIdle;        
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TKeyPressAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TUint iHeartBeat;        
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TPointerEventAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;        
-    TUint iHeartBeat;        
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TMessageAttributes
-    {
-public:
-    TUint iId;
-    TInt iMessageType;
-    TBuf<128> iDestination;
-    TUint iPriority; 
-    TUint iAmount;
-    TInt iLength;    
-    TUint iIdle;    
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TApplicationsAttributes
-    {
-public:
-    TUint iId;        
-    TUint iPriority;
-    TUint iLaunchingInterval;
-    TUint iKeyPressType;
-    TUint iMaxOpen;
-    TUint iHeartBeat;
-    TUint iRandomVariance;
-    CDesCArray* iAppsArray;
-    TRequestStatus* iDeathStatus;
-    };
-
-
-class TPhotoCaptureAttributes
-    {
-public:
-    TUint iId;    
-    TInt iPriority;
-    TInt iCameraCount;
-    TInt iCamera;
-    TUint iIdle;    
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    };
-
-class TBluetoothAttributes
-    {
-public:
-    TUint iId;    
-    TInt iPriority;    
-    TUint iIdle;    
-    TUint iRandomVariance;        
-    TRequestStatus* iDeathStatus;
-    TBool iBluetoothSupported;
-    };
-
-#endif
--- a/loadgen/inc/loadgen_loadbase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_LOADBASE_H
-#define LOADGEN_LOADBASE_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "loadgen_loadbase.h"
-
-
-// FORWARD DECLARATIONS
-
-
-
-// CLASS DECLARATIONS
-
-class CLoadBase : public CBase
-    {
-public:
-    enum TLoadState
-        {
-        ELoadStateInvalid = -1,
-        ELoadStateConstructed,
-        ELoadStateRunning,
-        ELoadStateSuspended,
-        ELoadStateClosed
-        };
-        
-protected: // Constructors
-    CLoadBase();
-    void ConstructL();
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TInt State() { return iState; }
-    inline TInt Type() { return iType; }
-
-protected: // Data
-    TInt iState;
-    TInt iType;
-    };
- 
-
-#endif
--- a/loadgen/inc/loadgen_maincontainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_VALUESCONTAINER_H
-#define LOADGEN_VALUESCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h> 
-#include <aknlists.h> 
-
-// FORWARD DECLARATIONS
-class CLoadGenModel;
-class CLoadGenCAknSingleGraphicStyleListBox;
-
-// CLASS DECLARATIONS
-
-class CLoadGenMainContainer : public CCoeControl, MCoeControlObserver, MEikListBoxObserver
-    {
-public:
-    void ConstructL(const TRect& aRect);
-    ~CLoadGenMainContainer();
-
-private:
-    void SizeChanged();  
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl(TInt aIndex) const;
-    void Draw(const TRect& aRect) const;
-    void HandleResourceChange(TInt aType);
-    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);  // From MEikListBoxObserver
-    void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);  // From MCoeControlObserver
-    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-
-public:
-    const CArrayFix<TInt>* ListBoxSelectionIndexes();
-    TInt ListBoxSelectionIndexesCount();
-    void SetDefaultTitlePaneTextL();
-    TInt CurrentListBoxItemIndex();
-    void SetListBoxTextArrayL(CDesCArray* aTextArray);
-    inline CLoadGenCAknSingleGraphicStyleListBox* ListBox() { return iListBox; }
-
-private:
-    CLoadGenModel*                              iModel;
-    CLoadGenCAknSingleGraphicStyleListBox*      iListBox;
-    };
-
-class CLoadGenCAknSingleGraphicStyleListBox : public CAknSingleGraphicStyleListBox
-    {
-    void SizeChanged();
-    void SizeChangedL();
-    };
-        
-#endif
-
-// End of File
--- a/loadgen/inc/loadgen_mainview.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_VALUESVIEW_H
-#define LOADGEN_VALUESVIEW_H
-
-// INCLUDES
-#include <aknview.h>
-
-#include "loadgen_std.h"
-
-
-
-// CONSTANTS
-// UID of view
-const TUid KMainViewUID = {1};
-
-
-// FORWARD DECLARATIONS
-class CLoadGenMainContainer;
-class CLoadGenModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CLoadGenMainView view class.
-* 
-*/
-class CLoadGenMainView : public CAknView
-    {
-    public: // Constructors and destructor
-        void ConstructL();
-        ~CLoadGenMainView();
-
-    public: // Functions from base classes
-        TUid Id() const;
-        void HandleCommandL(TInt aCommand);
-        void HandleClientRectChange();
-
-    private: // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-    private: // From AknView
-        void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
-        void DoDeactivate();
-
-    private: // Data
-        CLoadGenMainContainer*        iContainer;
-        CLoadGenModel*                  iModel;
-    };
-
-#endif
-
-// End of File
--- a/loadgen/inc/loadgen_memoryeat.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_MEMORYEAT_H
-#define LOADGEN_MEMORYEAT_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-
-
-
-// CLASS DECLARATIONS
-
-class CMemoryEat : public CLoadBase
-    {
-public:
-    static CMemoryEat* NewL(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CMemoryEat();
-        
-private: // Constructors
-    CMemoryEat(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TMemoryEatAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-private:
-    static void GenerateLoad(TMemoryEatAttributes& aAttributes);
-
-private: // Data
-    TMemoryEatAttributes    iAttributes;    
-    RThread                 iThread;
-    };
-
-
-class CMemoryEatManager : public CActive
-    {
-public:
-    static CMemoryEatManager* NewL(TMemoryEatAttributes& aAttributes);
-    ~CMemoryEatManager();
-
-private:
-    CMemoryEatManager(TMemoryEatAttributes& aAttributes);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack(TAny* aAny);
-    void InitMemoryEatL();
-    void DestroyMemoryEat();
-    void EatMemoryL();
-    void DoEatMemoryL( TInt64 aNewSize );
-    void HandleEatMemoryL( TInt64 aNewSize );
-    void AllocMemoryL( TInt64 aNewSize );
-    void FreeMemoryL( TInt64 aNewSize );
-    TInt64 ReadFreeMemory();
-    
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TMemoryEatAttributes&   iAttributes;    
-    CPeriodic*              iPeriodicTimer;
-    RChunk                  iEatChunk;
-    RFile                   iEatFile;
-    RFs                     iFs;
-    TBool                   iWavyEatMoreMemory;
-    TInt     iFilesCounter;
-    };
-     
-
-#endif
--- a/loadgen/inc/loadgen_messages.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,421 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_MESSAGES_H
-#define LOADGEN_MESSAGES_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CSmsHandler;
-class CMmsHandler;
-
-const TInt EMaxMessageLength = 512;
-
-// CLASS DECLARATIONS
-
-class CMessages : public CLoadBase
-    {
-public:
-    static CMessages* NewL( TMessageAttributes& aAttributes, TInt aReferenceNumber );
-    virtual ~CMessages();
-        
-private: // Constructors
-    CMessages( TMessageAttributes& aAttributes, TInt aReferenceNumber );
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TMessageAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction( TAny* aThreadArg );
-
-private:  // New static methods
-    static void GenerateLoad( TMessageAttributes& aAttributes );
-
-private: // Data
-    TMessageAttributes            iAttributes;    
-    RThread                     iThread;
-
-    };
-
-
-class CMessageManager : public CActive
-    { 
-private:
-    enum TState
-        {
-        EStateIdle = 0,
-        EStateSend,
-        EStateSending        
-        };
-public:
-    static CMessageManager* NewL( TMessageAttributes& aAttributes );
-    virtual ~CMessageManager();
-
-
-private:
-    CMessageManager( TMessageAttributes& aAttributes );
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack( TAny* aAny );
-    void HandleMessageSending();
-    void DoDial();
-    void DoHangup();
-    void CreateMessage();    
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-    void HandleStatus( TInt aErr );
-
-private:
-    TMessageAttributes&                   iAttributes;
-    CPeriodic*                          iPeriodicTimer;
-    TInt                                iState;
-    CSmsHandler*                        iSmsHandler;
-    CMmsHandler*                        iMmsHandler;
-    TInt                                iMessageCounter;
-    HBufC*                                iMessage;
-    }; 
-
-//  INCLUDES
-#include <e32base.h>
-#include <msvapi.h>
-#include <mtuireg.h>
-#include <txtrich.h>
-// CONSTANTS
-const TInt KBfrLength = 20;
-const TInt KTelephoneNumberMaxLength = 100;
- 
-// FORWARD DECLARATIONS
-class CSmsAppUi;
-class CClientMtmRegistry;
-class CSmsClientMtm;
- 
-// CLASS DECLARATION
-/**
-* CSmsHandler application engine class.
-* Takes care of sending and receiveing SMS messages using the SMS client MTM.
-* Interacts with the application UI class.
-*/
-class CSmsHandler : public CActive, public MMsvSessionObserver
-    {
-    public: // Constructors and destructor
- 
-        /**
-        * NewL.
-        * Two-phased constructor.
-        * @param aSmsAppUi Pointer to AppUi instance.
-        * @return Pointer to the created instance of CSmsHandler.
-        */
-        static CSmsHandler* NewL( CMessageManager& aManager );
- 
-        /**
-        * NewLC.
-        * Two-phased constructor.
-        * @param aSmsAppUi Pointer to AppUi instance.
-        * @return Pointer to the created instance of CSmsHandler.
-        */
-        static CSmsHandler* NewLC( CMessageManager& aManager );
- 
-        /**
-        * ~CSmsHandler
-        * Destructor.
-        */
-        virtual ~CSmsHandler();
- 
-    public: // New functions
-        /**
-        * SendL.
-        * Starts the process of creating and sending an SMS message.
-        * @param aRecipientNumber The number of the recipent.
-        * @param aMessageText The message text.
-        * @return ETrue if successful, EFalse if not.
-        */
-       TBool SendL( const TDesC& aRecipientNumber,
-                    const TDesC& aMessageText );
- 
-    public: // Functions from base classes
- 
-        /**
-        * From MMsvSessionObserver, HandleSessionEventL.
-        * Handles notifications of events from the Message Server.
-        * @param aEvent The event that has taken place
-        * @param aArg1 Event type-specific argument value
-        * @param aArg2 Event type-specific argument value
-        * @param aArg3 Event type-specific argument value
-        */
-        void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1,
-                                  TAny* aArg2, TAny* aArg3 );
- 
-    protected: // Functions from base classes
- 
-        /**
-        * From CActive, DoCancel.
-        * Cancels any outstanding requests.
-        */
-        void DoCancel();
- 
-        /**
-        * From CActive, RunL.
-        * Handles an active object’s request completion event.
-        */
-        void RunL();
- 
-    private: // Constructors
- 
-        /**
-        * CSmsHandler.
-        * C++ default constructor.
-        * @param aSmsAppUi Pointer to AppUi instance.
-        */
-        CSmsHandler( CMessageManager& aManager );
- 
-        /**
-        * ConstructL.
-        * 2nd phase constructor.
-        */
-        void ConstructL();
- 
-    private: // New functions
- 
-        /**
-        * AccessMtmL.
-        * Access the MTM Registry and create an SMS specific Client MTM instance.
-        */
-        void AccessMtmL();
- 
-        /**
-        * CreateMsgL.
-        * Create an SMS message.
-        * @return ETrue if successful, EFalse is unsuccessful.
-        */
-        TBool CreateMsgL();
- 
-        /**
-        * ScheduleL.
-        * Schedule an SMS message for sending.
-        */
-        void ScheduleL();
- 
-        /**
-        * ValidateL.
-        * Validate an SMS message.
-        * @return ETrue if successful, EFalse is unsuccessful.
-        */
-        TBool ValidateL();
- 
-    private: // Enumeration
- 
-        /**
-        * TState, enumeration for the state of the handler, used by RunL().
-        */
-        enum TState
-            {
-            EWaitingForMoving = 1,
-            EWaitingForScheduling
-            };
- 
-    private: // Data
- 
-        /**
-        * iState, the state of the handler.
-        */
-        TState iState;
- 
-        /**
-        * iSession, the contact database.
-        * Owned by CSmsHandler object.
-        */
-        CMsvSession* iSession;
- 
-        /**
-        * iMtmRegistry, client MTM registry.
-        * Owned by CSmsHandler object.
-        */
-        CClientMtmRegistry* iMtmRegistry;
- 
-        /**
-        * iSmsMtm, SMS specific Client MTM.
-        * Owned by CSmsHandler object.
-        */
-        CSmsClientMtm* iSmsMtm;
- 
-        /**
-        * iOperation, the current message server operation.
-        * Owned by CSmsHandler object.
-        */
-        CMsvOperation* iOperation;
- 
-        /**
-        * iRecipientNumber, telephone number of the recipient.
-        */
-        TBuf<KTelephoneNumberMaxLength> iRecipientNumber;
- 
-        /**
-        * iMessageText, SMS message text.
-        */
-        TBuf<EMaxMessageLength> iMessageText;
-
- 
-        /**
-        * iSmsAppUi, application UI
-        * Not owned by CSmsHandler object.
-        */
-        CSmsAppUi* iSmsAppUi;
- 
-        /**
-        * iMtmUiRegistry, User Interface MTM Registry.
-        * Owned by CSmsHandler object.
-        */
-        CMtmUiRegistry* iMtmUiRegistry;
-        
-        CMessageManager& iManager;
- 
-    };
-
-
-// INCLUDES
-#include <msvapi.h>                         // for MMsvSessionObserver 
-#include <mmsclient.h>                      // for CMmsClientMtm
-#include <coecntrl.h>
-
-// Forward declarations
-class CClientMtmRegistry;
-class CMsvSession;
-
-//
-// Container class to draw text on screen
-//
-class CMmsHandler : public CBase, public MMsvSessionObserver
-    {
-public: // Constructors and destructor
-
-    /**
-    * NewL.
-    * Two-phased constructor.
-    * @param aSmsAppUi Pointer to AppUi instance.
-    * @return Pointer to the created instance of CSmsHandler.
-    */
-    static CMmsHandler* NewL( CMessageManager& aManager );
-
-    /**
-    * NewLC.
-    * Two-phased constructor.
-    * @param aSmsAppUi Pointer to AppUi instance.
-    * @return Pointer to the created instance of CSmsHandler.
-    */
-    static CMmsHandler* NewLC( CMessageManager& aManager );
-
-    /**
-    * ~CSmsHandler
-    * Destructor.
-    */
-    virtual ~CMmsHandler();
-
-private: // Constructors
-
-    /**
-    * CSmsHandler.
-    * C++ default constructor.
-    * @param aSmsAppUi Pointer to AppUi instance.
-    */
-    CMmsHandler( CMessageManager& aManager );
-
-    /**
-    * ConstructL.
-    * 2nd phase constructor.
-    */
-    void ConstructL();
-
-public: // New functions
-    
-    /*
-     * Creates client MTM registry when session is ready for use. 
-     * This completes model construction and is called after 'server
-     * ready' event is received after async opening of CMsvSession.
-     */ 
-    void CompleteConstructL();
-       
-    /*
-     * CMmsHandler::CreateNewMessageL()
-     * Creates a new message server entry and set up default values.
-     * In case the attachment file does not found method return EFalse
-     * otherwise ETrue.
-     * There are differenses how to add attachment file between 2nd and 3rd edition.
-     */  
-     TBool CreateMsgL();
-
-    /**
-     * Send the message.
-     * Return values: ETrue or EFalse
-     */
-    TBool SendMessageL();
-        
-     /**
-      * SendL.
-      * Starts the process of creating and sending an SMS message.
-      * @param aRecipientNumber The number of the recipent.
-      * @param aMessageText The message text.
-      * @return ETrue if successful, EFalse if not.
-      */
-     TBool SendL( const TDesC& aRecipientNumber,
-                 const TDesC& aMessageText );     
-           
-private:    
-    // from MMsvSessionObserver
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-  
-    void SetMessageBodyL();
-
-private:
-
-    CMsvSession* iSession;          // Client session on the message server
-    CMmsClientMtm* iMmsMtm;         // Message Type Module (MMS)
-    CClientMtmRegistry* iMtmReg;    // Mtm client registry for creating new mtms
-
-    /**
-    * iRecipientNumber, telephone number of the recipient.
-    */
-    TBuf<KTelephoneNumberMaxLength> iRecipientNumber;
-
-    /**
-    * iMessageText, SMS message text.
-    */
-    TBuf<EMaxMessageLength> iMessageText;
-    
-    CMessageManager& iManager;
-    
-    };
-#endif // LOADGEN_MESSAGES_H
--- a/loadgen/inc/loadgen_model.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_MODEL_H
-#define LOADGEN_MODEL_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <apgcli.h>
-
-#include "loadgen_loadattributes.h"
-
-// FORWARD DECLARATIONS
-class CLoadGenMainContainer;
-class CLoadGenGraphsContainer;
-class CEikonEnv;
-class CLoadBase;
-
-
-typedef CArrayFixSeg<CLoadBase*> CLoadItemList;
-
-const TUint KMaxCPUs = 4;
-const TUint KHalFunction_EKernelHalNumLogicalCpus = 16; //EKernelHalNumLogicalCpus
-const TUint KHalFunction_EKernelHalLockThreadToCpu = 19; //EKernelHalLockThreadToCpu
-
-// CLASS DECLARATIONS
-
-class TLoadGenSettings
-    {
-public:
-    };
-
-class CLoadGenModel : public CActive
-    {
-private:
-    enum TContainerDrawState
-        {
-        EDrawStateInvalid = -1,
-        EDrawStateMain
-        };
-
-public:
-    static CLoadGenModel* NewL();
-    ~CLoadGenModel();
-    void ActivateModelL();
-    void DeActivateModelL();
-
-private:
-    void RunL();
-    void DoCancel();
-        
-private:
-    CLoadGenModel();
-    void ConstructL();
-    void LoadSettingsL();
-    void EditLoadL(CLoadBase* aItem);
-    void DoStartNewLoadL(TInt aCommand);
-    void AppendToLoadItemListL(CLoadBase* aItem);
-    void DeleteFromLoadItemListL(TInt aIndex);
-    void SuspendOrResumeFromLoadItemListL(TInt aIndex);
-    void DeleteAllLoadItems();
-    void RefreshViewL(TBool aClearSelection=ETrue);
-    CDesCArray* ListOfAllAppsL();    
-    
-public:
-    void StopAllLoadItemsL();
-    void SuspendAllLoadItemsL();
-    void ResumeAllLoadItemsL();
-            
-    TInt LoadItemCount() const;
-    void ShowItemActionMenuL();
-    void StopSelectedOrHighlightedItemsL();
-    void SuspendOrResumeSelectedOrHighlightedItemsL();
-
-    CDesCArray* GenerateListBoxItemTextArrayL();
-    void StartNewLoadL(TInt aCommand);
-    void SaveSettingsL();
-    void SetMainContainer(CLoadGenMainContainer* aContainer);
-    TInt LaunchSettingsDialogL();
-    inline TLoadGenSettings& Settings() { return iSettings; }
-    inline CEikonEnv* EikonEnv() { return iEnv; }
-    inline RApaLsSession& LsSession() { return iLs; }
-    inline CLoadGenMainContainer* MainContainer() { return iMainContainer; }
-    inline TBool LoadItemsExists() { return iLoadItemList->Count() > 0; } 
-
-
-public:
-    static TThreadPriority SettingItemToThreadPriority(TInt aIndex);
-    static void SettingItemToThreadDescription(TInt aIndex, TDes& aBuf);
-    static void SettingItemToSourceDescription(TInt aIndex, TDes& aBuf);
-    static TInt MilliSecondsToMicroSeconds(TInt aMilliSeconds, TInt aRandomVariance=0);
-    static TInt RandomNumber(TInt aMin, TInt aMax);
-    static TSize ScreenSize();
-
-private:
-    RTimer                          iTimer;
-    CLoadGenMainContainer*          iMainContainer;
-    CEikonEnv*                      iEnv;
-    TLoadGenSettings                iSettings;
-    RApaLsSession                   iLs;
-    TInt                            iDrawState;
-    CLoadItemList*                  iLoadItemList;
-    TInt                            iReferenceNumber;
-    TCPULoadAttributes              iCpuLoadAttributes;
-    TMemoryEatAttributes            iMemoryEatAttributes;
-    TPhoneCallAttributes            iPhoneCallAttributes;
-    TNetConnAttributes              iNetConnAttributes;
-    TKeyPressAttributes             iKeyPressAttributes;
-    TMessageAttributes              iMessageAttributes;
-    TApplicationsAttributes			iApplicationsAttributes;
-    TPhotoCaptureAttributes         iPhotoCaptureAttributes;
-    TBluetoothAttributes            iBluetoothAttributes;
-    TPointerEventAttributes         iPointerEventAttributes;
-    static TInt64                   iRandomNumberSeed;
-    };
- 
-
-#endif
--- a/loadgen/inc/loadgen_netconn.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_NETCONN_H
-#define LOADGEN_NETCONN_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <downloadmgrclient.h> 
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CNetConnManager;
-
-
-// CLASS DECLARATIONS
-
-class CNetConn : public CLoadBase
-    {
-public:
-    static CNetConn* NewL(TNetConnAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CNetConn();
-        
-private: // Constructors
-    CNetConn(TNetConnAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TNetConnAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-
-private:  // New static methods
-    static void GenerateLoad(TNetConnAttributes& aAttributes);
-
-private: // Data
-    TNetConnAttributes          iAttributes;    
-    RThread                     iThread;
-    };
-
-
-class CNetConnManager : public CActive, public MHttpDownloadMgrObserver
-    {
-public:
-    static CNetConnManager* NewL(TNetConnAttributes& aAttributes);
-    ~CNetConnManager();
-
-private:
-    CNetConnManager(TNetConnAttributes& aAttributes);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack(TAny* aAny);
-    void StartDownloadL();
-
-private: // MHttpDownloadMgrObserver
-    void HandleDMgrEventL(RHttpDownload& aDownload, THttpDownloadEvent aEvent); 
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TNetConnAttributes&     iAttributes;    
-    CPeriodic*              iPeriodicTimer;
-    RHttpDownloadMgr        iDownloadMgr;
-    }; 
-
-#endif
--- a/loadgen/inc/loadgen_phonecall.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_PHONECALL_H
-#define LOADGEN_PHONECALL_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <etel3rdparty.h>
-
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CPhoneCallManager;
-class CDialer;
-
-
-// CLASS DECLARATIONS
-
-class CPhoneCall : public CLoadBase
-    {
-public:
-    static CPhoneCall* NewL(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CPhoneCall();
-        
-private: // Constructors
-    CPhoneCall(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TPhoneCallAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-
-private:  // New static methods
-    static void GenerateLoad(TPhoneCallAttributes& aAttributes);
-
-private: // Data
-    TPhoneCallAttributes        iAttributes;    
-    RThread                     iThread;
-    };
-
-    
-
-class CPhoneCallManager : public CActive
-    { 
-private:
-    enum TState
-        {
-        EStateIdle = 0,
-        EStateCall
-        };
-public:
-    static CPhoneCallManager* NewL(TPhoneCallAttributes& aAttributes);
-    ~CPhoneCallManager();
-
-private:
-    CPhoneCallManager(TPhoneCallAttributes& aAttributes);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack(TAny* aAny);
-    void HandleCalls();
-    void DoDial();
-    void DoHangup();
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-    void HandleStatus(TInt aErr);
-
-private:
-    TPhoneCallAttributes&               iAttributes;
-    CDialer*                            iDialer;   
-    CPeriodic*                          iPeriodicTimer;
-    TInt                                iState;
-    }; 
-
-
-class CDialer : public CActive
-    { 
-public:
-    static CDialer* NewL(CPhoneCallManager& aManager);
-    ~CDialer();
-
-private:
-    CDialer(CPhoneCallManager& aManager);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-public:
-    void Dial(const TDesC& aDestination);
-    void Hangup();
-
-private:
-    CPhoneCallManager&                  iManager;
-    CTelephony*                         iTelephony;
-    CTelephony::TCallId                 iCallId;
-    CTelephony::TCallParamsV1           iCallParams;
-    CTelephony::TCallParamsV1Pckg       iCallParamsPckg;
-    };
-        
-#endif
--- a/loadgen/inc/loadgen_photocapture.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_PHOTOCAPTURE_H
-#define LOADGEN_PHOTOCAPTURE_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <ECam.h>  // CCamera, MCameraObserver
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-class CCameraManager;
-
-
-// CLASS DECLARATIONS
-
-class CPhotoCapture : public CLoadBase
-    {
-public:
-    static CPhotoCapture* NewL(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CPhotoCapture();
-        
-private: // Constructors
-    CPhotoCapture(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TPhotoCaptureAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-    //static void SetImagesReady(TInt aImages);
-    //static TInt ImagesReady();
-
-private:  // New static methods
-    static void GenerateLoad(TPhotoCaptureAttributes& aAttributes);
-    static void DoHeaveStuff(TInt aMode);
-
-private: // Data
-    TPhotoCaptureAttributes iAttributes;    
-    RThread                 iThread;
-    //static TInt             iImagesReady;
-    };
- 
-
-
- 
-class CCameraManager : public CActive, public MCameraObserver
-    {
-    public:
-        
-        static CCameraManager* NewL(TPhotoCaptureAttributes& aAttrs);        
-        virtual ~CCameraManager();
- 
-    private:
-        
-        CCameraManager(TPhotoCaptureAttributes& aAttrs);
-        void ConstructL();
- 
-    private:
-        /**
-         * From MCameraObserver:
-         */         
-        virtual void ReserveComplete(TInt aError);
-        virtual void PowerOnComplete(TInt aError);
-        virtual void ViewFinderFrameReady(CFbsBitmap& aFrame);
-        virtual void ImageReady(CFbsBitmap* aBitmap,
-                HBufC8* aData, TInt aError);
-        virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,
-                TInt aError);
-    
-        static TInt PeriodicTimerCallBack(TAny* aAny);
-    public:
-        
-        /**
-         * Reserves the camera.
-         */
-        void ReserveCameraL();
-        
-        /**
-         * Takes a picture.
-         */
-        void CapturePhotoL();
-        
-        TInt NumberOfPictures();
-                                        
-        /**
-         * From CActive:
-         */
-        void RunL();
-        void DoCancel();
- 
-    private:
-        
-        enum TState
-            {
-            ENotReady,
-            ECameraReserved,
-            EIdle,
-            ECapture
-            };
-
-        CPeriodic*                  iPeriodicTimer;
-        TPhotoCaptureAttributes&    iAttributes;
-        CCamera*                    iCamera;
-        TState                      iState;
-        TInt                        iNumOfPics;
-        TCameraInfo                 iCameraInfo;
-        TInt                        iCurrentCamera;
-    };
-
-
-#endif
--- a/loadgen/inc/loadgen_pointerevent.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_POINTEREVENT_H
-#define LOADGEN_POINTEREVENT_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <w32std.h>
-
-#include "loadgen_loadbase.h"
-#include "loadgen_loadattributes.h"
-
-
-// FORWARD DECLARATIONS
-
-
-
-// CLASS DECLARATIONS
-
-class CPointerEvent : public CLoadBase
-    {
-public:
-    static CPointerEvent* NewL(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
-    virtual ~CPointerEvent();
-        
-private: // Constructors
-    CPointerEvent(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
-    void ConstructL();  
-
-public:  // New methods
-    virtual void Resume();
-    virtual void Suspend();
-    virtual void SetPriority();
-    virtual void Close();
-    virtual TPtrC Description();
-    inline TPointerEventAttributes& Attributes() { return iAttributes; }
-
-public:  // New static methods
-    static TInt ThreadFunction(TAny* aThreadArg);
-
-private:  // New static methods
-    static void GenerateLoad(TPointerEventAttributes& aAttributes);
-
-private: // Data
-    TPointerEventAttributes         iAttributes;    
-    RThread                     iThread;
-    };
-
-
-class CPointerEventManager : public CActive
-    {
-public:
-    static CPointerEventManager* NewL(TPointerEventAttributes& aAttributes);
-    ~CPointerEventManager();
-
-private:
-    CPointerEventManager(TPointerEventAttributes& aAttributes);
-    void ConstructL();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    static TInt PeriodicTimerCallBack(TAny* aAny);
-    void SimulatePointerEvent();
-
-public:
-    inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
-
-private:
-    TPointerEventAttributes&    iAttributes;    
-    CPeriodic*                  iPeriodicTimer;
-    //RWsSession                  iWsSession;
-    }; 
-
-#endif
--- a/loadgen/inc/loadgen_settingsviewdlg.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_SETTINGSVIEWDLG_H
-#define LOADGEN_SETTINGSVIEWDLG_H
-
-//  INCLUDES
-#include <akndialog.h>
-#include <eiklbo.h>
-#include <akntabobserver.h> 
-#include <akntabgrp.h>
-
-//  FORWARD DECLARATIONS
-class CAknSettingItemArray;
-class CAknSettingStyleListBox;
-class CAknNavigationControlContainer;
-class CAknNavigationDecorator;
-class CAknTabGroup; 
-class TLoadGenSettings;
-
-
-//  CLASS DEFINITIONS
-
-class CLoadGenSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
-    {
-public:
-    static CLoadGenSettingsViewDlg* NewL(TLoadGenSettings& aSettings);
-    virtual ~CLoadGenSettingsViewDlg();
-
-public: // From MEikListBoxObserver
-    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-public: // From MAknTabObserver
-    void TabChangedL(TInt aIndex); 
-
-public: // From CAknDialog
-    void ProcessCommandL(TInt aCommandId);
-
-protected: // From CEikDialog
-    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
-    void PreLayoutDynInitL();
-    TBool OkToExitL(TInt aButtonId);    
-
-private: // New methods
-    void ShowSettingPageL(TBool aCalledFromMenu);
-    void SetVisibilitiesOfSettingItemsL();
-    void UpdateListBoxL();
-    void AddSettingItemL(TInt aId, TInt aTitleResource, TInt aSettingPageResource, TInt aAssociatedResource, TInt aOrdinal);
-
-private: // Constructors
-    CLoadGenSettingsViewDlg(TLoadGenSettings& aSettings);
-    void ConstructL();        
-
-private: // Data
-    CAknSettingItemArray*               iSettingItemArray;
-    CAknSettingStyleListBox*            iListBox;
-    CAknNavigationControlContainer*     iNaviContainer;
-    CAknNavigationDecorator*            iDecoratedTabGroup;
-    CAknTabGroup*                       iTabGroup;
-    TLoadGenSettings&               iSettings;
-    };
-
-
-#endif
-
-// End of File
-
--- a/loadgen/inc/loadgen_std.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef LOADGEN_STD_H
-#define LOADGEN_STD_H
-
-
-
-#endif
-
-// End of File
-
--- a/loadgen/inc/loadgen_traces.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-
-
-#ifndef __LOADGEN_TRACES_H__
-#define __LOADGEN_TRACES_H__
-
-#include <e32def.h>
-
-
-// ---------------------------------------------------------------------------
-// You change these logging method values below! Recompile the application to take changes effect.
-
-    // logging methods
-    // 0 = No logging
-    // 1 = Flogger
-    // 2 = RDebug
-    // 3 = Flogger and RDebug
-    
-    #ifndef _DEBUG
-        
-        // Logging method for UREL builds:
-        #define LOADGEN_LOGGING_METHOD  3
-
-    #else
-
-        // Logging method for UDEB builds:
-        #define LOADGEN_LOGGING_METHOD  3
-
-    #endif    
-    
-
-
-// ---------------------------------------------------------------------------
-// Do not make any changes to lines below...
-
-    #if LOADGEN_LOGGING_METHOD == 1 || LOADGEN_LOGGING_METHOD == 3
-
-        #include <flogger.h>
-        _LIT(KLogFolder,"loadgen");
-        _LIT(KLogFile,"loadgen_trace.txt");
-
-    #endif
-
-    #if LOADGEN_LOGGING_METHOD == 2 || LOADGEN_LOGGING_METHOD == 3
-
-        #include <e32debug.h>
-
-    #endif
-
-
-    #if LOADGEN_LOGGING_METHOD == 0
-    
-        #define LOGTEXT(AAA)
-        #define LOGSTRING(AAA)
-        #define LOGSTRING2(AAA,BBB)
-        #define LOGSTRING3(AAA,BBB,CCC)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD)
-    
-    
-    #elif LOADGEN_LOGGING_METHOD == 1
-    
-        #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-   
-    #elif LOADGEN_LOGGING_METHOD == 2
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
-    
-    #elif LOADGEN_LOGGING_METHOD == 3
-    
-        #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
-        #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
-        #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
-        #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
-        #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
-
-    #endif
-
-// ---------------------------------------------------------------------------
-
-#endif // __LOADGEN_TRACES_H__
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/loadgen.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+#
+
+
+TEMPLATE = subdirs
+
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG
+
+SUBDIRS = group \
+          ui/hb
--- a/loadgen/rom/loadgen.iby	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/rom/loadgen.iby	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  
+* Description: 
 *
 */
 
--- a/loadgen/sis/LoadGen_S60-30.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/sis/LoadGen_S60-30.pkg	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ; All rights reserved.
 ; This component and the accompanying materials are made available
 ; under the terms of "Eclipse Public License v1.0"
@@ -11,7 +11,7 @@
 ;
 ; Contributors:
 ;
-; Description:
+; Description: 
 ;
 
 ; Language - standard language definitions
Binary file loadgen/sis/LoadGen_S60-30.sis has changed
--- a/loadgen/sis/LoadGen_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/loadgen/sis/LoadGen_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ; All rights reserved.
 ; This component and the accompanying materials are made available
 ; under the terms of "Eclipse Public License v1.0"
@@ -11,9 +11,10 @@
 ;
 ; Contributors:
 ;
-; Description:
+; Description: 
 ;
 
+
 ; Language - standard language definitions
 &EN
 
--- a/loadgen/src/loadgen_app.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_app.h"
-#include "loadgen_document.h"
-
-#include <eikstart.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CLoadGenApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CLoadGenApp::AppDllUid() const
-    {
-    return KUidLoadGen;
-    }
-
-// ---------------------------------------------------------
-// CDictionaryStore* CLoadGenApp::OpenIniFileLC(RFs& aFs) const
-// overrides CAknApplication::OpenIniFileLC to enable INI file support
-// ---------------------------------------------------------
-//
-CDictionaryStore* CLoadGenApp::OpenIniFileLC(RFs& aFs) const
-    {
-    return CEikApplication::OpenIniFileLC(aFs);
-    }
-   
-// ---------------------------------------------------------
-// CLoadGenApp::CreateDocumentL()
-// Creates CLoadGenDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CLoadGenApp::CreateDocumentL()
-    {
-    return CLoadGenDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CLoadGenApp;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-   
-
-// End of File  
-
--- a/loadgen/src/loadgen_applications.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,686 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_applications.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-#include "loadgen_traces.h"
-
-_LIT(KThreadName, "Applications %d");
-
-const TInt KDefaultStartDelay = 500;
-const TInt KThreadNameLength = 64;
-const TInt KDescriptorBufSize = 256;
-const TInt KPriorityBufSize = 16;
-const TInt KScanCodeStart = 32;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CAppLauncher* CAppLauncher::NewL( TApplicationsAttributes& aAttributes, TInt aReferenceNumber )
-    {
-    CAppLauncher* self = new(ELeave) CAppLauncher( aAttributes, aReferenceNumber );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CAppLauncher::~CAppLauncher()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CAppLauncher::CAppLauncher(  
-           TApplicationsAttributes& aAttributes, TInt aReferenceNumber ) : 
-           iAttributes( aAttributes )
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadApplications;
-    
-    TBuf<KThreadNameLength> threadName;
-    threadName.Format( KThreadName, iAttributes.iId );
-    
-    // create a thread
-    User::LeaveIfError( iThread.Create( threadName, ThreadFunction, 
-                                        KDefaultStackSize*2, KMinHeapSize, 
-                                        KKilo * KMinHeapSize, (TAny*) &iAttributes ) );
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CAppLauncher::ThreadFunction( TAny* aThreadArg )
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install( pS );
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad( *( ( TApplicationsAttributes* ) aThreadArg ) );
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::GenerateLoad( TApplicationsAttributes& aAttributes )
-    {
-    CAppLauncherManager* appLauncherManager = NULL;
-    TRAPD( err, appLauncherManager = CAppLauncherManager::NewL( aAttributes ) );
-    if ( err == KErrNone ) 
-        {
-        CActiveScheduler::Start();
-        }
-    delete appLauncherManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority( CLoadGenModel::SettingItemToThreadPriority( iAttributes.iPriority ) );
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CAppLauncher::Close()
-    {
-    CLoadBase::Close();
-    
-    if ( iThread.ExitReason() == 0 ) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete( iAttributes.iDeathStatus, KErrCancel );
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon( waiter );
-        User::WaitForRequest( waiter );
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CAppLauncher::Description()
-    {
-    TBuf<KDescriptorBufSize> buf;
-    TBuf<KPriorityBufSize> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription( iAttributes.iPriority, prioBuf );
-    
-    _LIT(KAppLauncherEntry, "[%d] Appls prio=%S max apps=%d heartbeat=%dms random=%d%%");
-    buf.Format( KAppLauncherEntry, iAttributes.iId, &prioBuf, iAttributes.iMaxOpen, 
-                iAttributes.iHeartBeat, iAttributes.iRandomVariance );
-   
-    return TPtrC( buf );
-    }               
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CAppLauncherManager* CAppLauncherManager::NewL( TApplicationsAttributes& aAttributes )
-    {
-    CAppLauncherManager* self = new(ELeave) CAppLauncherManager(aAttributes);
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CAppLauncherManager::CAppLauncherManager( TApplicationsAttributes& aAttributes ) :
-            CActive( EPriorityStandard ), iAttributes( aAttributes )
-    {
-    iAppEventType = EApplicationsLaunchApplication;
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CAppLauncherManager::~CAppLauncherManager()
-    {
-    if ( iPeriodicTimer )
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }
-    delete iLauncherEngine;
-    Cancel();
-    
-    iWsSession.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CAppLauncherManager::ConstructL()
-    {
-    CActiveScheduler::Add( this );
-    
-    // create instance to application launcher
-    iLauncherEngine = CLauncherEngine::NewL( iAttributes );
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // init
-    User::LeaveIfError( iWsSession.Connect() );
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
-    iPeriodicTimer->Start( KDefaultStartDelay, 
-                           CLoadGenModel::MilliSecondsToMicroSeconds( 
-                               iAttributes.iLaunchingInterval, iAttributes.iRandomVariance ),
-                           TCallBack( PeriodicTimerCallBack, this ) );
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CAppLauncherManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CAppLauncherManager::DoCancel()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CAppLauncherManager::PeriodicTimerCallBack( TAny* aAny )
-    {
-    CAppLauncherManager* self = static_cast<CAppLauncherManager*>( aAny );
-
-    TRAPD( err, self->SimulateEventL() );
-    if ( KErrNone != err )
-        {
-        return err;
-        }
-    return KErrNone;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CAppLauncherManager::SimulateEventL()
-    {    
-    // Randomly start new applications.
-    // After maximum applications launched stop one application.
-    // And after that start launching again.
-    if ( iAppEventType == EApplicationsLaunchApplication && 
-         iAttributes.iMaxOpen == iLauncherEngine->AppLaunchCounter() )
-        {
-        iAppEventType = EApplicationsCloseApplication;
-        }
-    if ( iAppEventType == EApplicationsCloseApplication && 
-         iAttributes.iMaxOpen -1 == iLauncherEngine->AppLaunchCounter() )
-        {
-        iAppEventType = EApplicationsLaunchApplication;
-        }
-    
-    // Launch or stop
-    if ( iAppEventType == EApplicationsLaunchApplication )
-        {
-        iLauncherEngine->StartAppLaunchingL();
-        }  
-    else
-        {
-        iLauncherEngine->StopApplication( ETrue );
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-#include <avkon.hrh>
-#include <e32std.h>
-#include <w32std.h>
-#include <apgtask.h>
-#include <bautils.h>
-#include <s32file.h>
-#include <APGWGNAM.H> 
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine* CLauncherEngine::NewL( TApplicationsAttributes& aAttributes )
-    {
-    CLauncherEngine* self = new(ELeave) CLauncherEngine( aAttributes );
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine::CLauncherEngine( TApplicationsAttributes& aAttributes ) : 
-                        iAttributes( aAttributes )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::ConstructL()
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::ConstructL");
-    iAppKeyPressManager = CAppKeyPressManager::NewL( iAttributes );
-    iAppLaunchCounter = 0;
-    User::LeaveIfError( iTimer.CreateLocal() );
-
-    User::LeaveIfError( iLs.Connect() );
-    User::LeaveIfError( iWs.Connect() );
-
-    }
-
-// ---------------------------------------------------------------------------
-
-CLauncherEngine::~CLauncherEngine()
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::~CLauncherEngine");
-    StopApplication( EFalse );
-    iWs.Close();
-    iLs.Close();
-    iTimer.Close();
-    delete iAppKeyPressManager;
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::StartAppLaunchingL()
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::StartAppLaunchingL");
-    if ( iAppLaunchCounter == iAttributes.iMaxOpen )
-        {
-        return;
-        }
-
-    // start launching
-    TBool launched( EFalse );
-    while ( !launched )
-        {
-        launched = LaunchApplicationL();
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CLauncherEngine::LaunchApplicationL()
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::LaunchApplicationL");
-    TBool result( EFalse );
-    // get the uid of the current app
-    iCurrentAppUid = KNullUid;
-    TApaAppInfo appInfo;
-    
-    // get application list size
-    TInt appsListSize = iAttributes.iAppsArray->MdcaCount();
-    // get random application number in the list
-    TInt appTolaunch = CLoadGenModel::RandomNumber( 0,  appsListSize - 1 );
-    // get file name of the application to be launched
-    TFileName launchFileName = iAttributes.iAppsArray->MdcaPoint( appTolaunch );
-    iLs.GetAllApps();
-    while ( iLs.GetNextApp( appInfo ) == KErrNone )
-        {
-        // get file name in  current appInfo
-        TFileName appFileName = appInfo.iFullName;
-        // get AppUid
-        if ( appFileName.CompareF( launchFileName ) == 0 )
-            {
-            iCurrentAppUid = appInfo.iUid;
-            break;
-            }
-        }
-
-    if ( iCurrentAppUid != KNullUid )
-        {        
-        // parse the filename
-        TParse nameParser;
-        nameParser.SetNoWild( iAttributes.iAppsArray->MdcaPoint( appTolaunch ), NULL, NULL );
-        iCurrentAppNameAndExt.Copy( nameParser.Drive() );
-        iCurrentAppNameAndExt.Append( nameParser.NameAndExt() );
-           
-        // do not try to launch these apps
-        if ( iCurrentAppUid != KNullUid &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch).FindF(_L("\\loadgen.")) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\Phone." ) ) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch).FindF( _L("\\Startup.") ) == KErrNotFound &&  
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\SplashScreen.") ) == KErrNotFound &&  
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\cameraapp.") ) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\eshell.") ) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\ConnTest.") ) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\Launcher.") ) == KErrNotFound &&
-              
-#ifdef __WINS__
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\DebugAgent.") ) == KErrNotFound &&
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\redirect.") ) == KErrNotFound &&              
-#endif              
-              iAttributes.iAppsArray->MdcaPoint( appTolaunch ).FindF( _L("\\VoiceRecorder.") ) == KErrNotFound )            
-            {
-        
-            // check if the app is already running
-            TApaTaskList taskList( iWs );
-            TApaTask thisTask = taskList.FindApp( iCurrentAppUid );
-            if ( !thisTask.Exists( ))
-                {
-                // check the program's capabilities
-                TApaAppCapabilityBuf buf;
-                iLs.GetAppCapability( buf, iCurrentAppUid );
-                TApaAppCapability cap = buf();
-        
-                // if it's embeddable only, don't launch if setting is enabled
-                // if it's hidden, don't launch if setting is enabled
-                if ( cap.iEmbeddability != TApaAppCapability::EEmbeddableOnly &&
-                     !cap.iAppIsHidden )
-                    {
-                    LOGSTRING2("launchFileName = %S", &launchFileName);
-                    
-                    DoLaunchApplicationL();
-                    result = ETrue;
-                    }            
-                } 
-            }
-        }
-    return result;
-    }
-
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::DoLaunchApplicationL()
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::DoLaunchApplicationL");
-
-    // Find the task with uid3
-    TApaTaskList tasklist( iWs );
-    TApaTask task=tasklist.FindApp( iCurrentAppUid );
-
-    if ( !task.Exists() )
-        // Task doesn't exist, launch a new instance of an application
-        {
-        TApaAppInfo appInfo;
-        User::LeaveIfError( iLs.GetAppInfo( appInfo, iCurrentAppUid ) );
-        TApaAppCapabilityBuf capBuf;
-        User::LeaveIfError( iLs.GetAppCapability( capBuf, iCurrentAppUid ) );
-        TApaAppCapability& caps = capBuf();
-
-        CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
-        cmdLine->SetExecutableNameL( appInfo.iFullName );
-
-        // app is launched in background
-        cmdLine->SetCommandL( EApaCommandBackground );       
-
-        // start the app
-        User::LeaveIfError( iLs.StartApp( *cmdLine ) );
-        iAppKeyPressManager->AddNewApplicationUidToKeyEventsL( iCurrentAppUid );
-        iAppLaunchCounter++;
-
-        CleanupStack::PopAndDestroy( cmdLine );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CLauncherEngine::StopApplication( TBool aRandomApplication )
-    {
-    LOGSTRING("LoadGen: CLauncherEngine::StopApplication");
-
-    // remove key pressing instance
-    TUid appToDelete = iAppKeyPressManager->KillApplication( aRandomApplication );
-    if ( appToDelete != KNullUid )
-        {
-        TApaTaskList taskList( iWs );
-        TApaTask thisTask = taskList.FindApp( appToDelete );
-    
-        if ( thisTask.Exists() )
-            {
-            // since the application is still open, let's close it
-            thisTask.EndTask();
-            }
-        iAppLaunchCounter--;
-        }
-    
-    // return if only one application requested
-    if ( aRandomApplication )
-        {
-        return;
-        }
-    
-    // remove all launched applications because load is requested to be closed
-    while ( appToDelete != KNullUid )
-        {
-        appToDelete = iAppKeyPressManager->KillApplication( aRandomApplication );
-            
-        if ( appToDelete != KNullUid )
-            {
-            TApaTaskList taskList( iWs );
-            TApaTask thisTask = taskList.FindApp( appToDelete );
-        
-            if ( thisTask.Exists() )
-                {
-                // since the application is still open, let's close it
-                thisTask.EndTask();
-                }
-            iAppLaunchCounter--;
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CAppKeyPressManager* CAppKeyPressManager::NewL( TApplicationsAttributes& aAttributes )
-    {
-    LOGSTRING("LoadGen: CAppKeyPressManager::NewL");
-    CAppKeyPressManager* self = new(ELeave) CAppKeyPressManager( aAttributes );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CAppKeyPressManager::CAppKeyPressManager( TApplicationsAttributes& aAttributes ) :
-                                            iAttributes( aAttributes )
-    {
-    LOGSTRING("LoadGen: CAppKeyPressManager::CAppKeyPressManager");
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CAppKeyPressManager::~CAppKeyPressManager()
-    {
-    LOGSTRING("LoadGen: CAppKeyPressManager::~CAppKeyPressManager");
-    if ( iKeyPresses.Count() != 0 )
-        {
-        iKeyPresses.ResetAndDestroy();
-        }
-
-    iKeyPresses.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CAppKeyPressManager::ConstructL()
-    {
-    LOGSTRING("LoadGen: CAppKeyPressManager::ConstructL");
-    }
-    
-   
-// --------------------------------------------------------------------------------------------
-void CAppKeyPressManager::AddNewApplicationUidToKeyEventsL( TUid aUid )
-    {
-    LOGSTRING("LoadGen: CAppKeyPressManager::AddNewApplicationUidToKeyEventsL");
-    CApplicationKeyPresses* applicationKP = CApplicationKeyPresses::NewL( aUid,
-                                                                    iAttributes );
-    CleanupStack::PushL( applicationKP );
-    User::LeaveIfError( iKeyPresses.Append( applicationKP ) );
-    CleanupStack::Pop( applicationKP );
-    }
-
-// --------------------------------------------------------------------------------------------
-TUid CAppKeyPressManager::KillApplication( TBool aRandomApplication )
-    {
-    TUid applicationUid = KNullUid;
-    TInt appToDelete = iKeyPresses.Count() - 1 ;
-    // remove the newest application if not random 
-    if ( aRandomApplication )
-        {
-         appToDelete = CLoadGenModel::RandomNumber( 0, iKeyPresses.Count() - 1 );
-        }
-    if ( iKeyPresses.Count() )
-        {
-        // get random application and delete it
-        
-        applicationUid = iKeyPresses[appToDelete]->ApplicationUid();
-        delete iKeyPresses[appToDelete];
-        iKeyPresses.Remove( appToDelete );
-        }
-    return applicationUid;
-    }
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CApplicationKeyPresses* CApplicationKeyPresses::NewL( TUid aUid, TApplicationsAttributes&  
-        aAttributes )
-    {
-    LOGSTRING("LoadGen: CApplicationKeyPresses::NewL");
-    CApplicationKeyPresses* self = new(ELeave) CApplicationKeyPresses( aUid, aAttributes );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CApplicationKeyPresses::CApplicationKeyPresses( TUid aUid, 
-                                                        TApplicationsAttributes& aAttributes ) :
-                                                iUid( aUid ), iAttributes( aAttributes ) 
-    {
-    LOGSTRING("LoadGen: CApplicationKeyPresses::CApplicationKeyPresses");
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CApplicationKeyPresses::~CApplicationKeyPresses()
-    {
-    LOGSTRING("LoadGen: CApplicationKeyPresses::~CApplicationKeyPresses");
-    if ( iPeriodicTimer )
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }
-    
-    iWsSession.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CApplicationKeyPresses::ConstructL()
-    {
-    LOGSTRING("LoadGen: CApplicationKeyPresses::ConstructL");
-    // init
-    User::LeaveIfError( iWsSession.Connect() );
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
-    if ( iAttributes.iKeyPressType )
-        {
-        iPeriodicTimer->Start( KDefaultStartDelay,
-                               CLoadGenModel::MilliSecondsToMicroSeconds( 
-                                       iAttributes.iHeartBeat,
-                                       iAttributes.iRandomVariance ),
-                                TCallBack( PeriodicTimerCallBack, this ) );
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CApplicationKeyPresses::PeriodicTimerCallBack( TAny* aAny )
-    {
-    CApplicationKeyPresses* self = static_cast<CApplicationKeyPresses*>( aAny );
-    self->SimulateKeyEvent();
-    return KErrNone;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CApplicationKeyPresses::SimulateKeyEvent()
-    {
-    LOGSTRING("LoadGen: CApplicationKeyPresses::SimulateKeyEvent");
-    // for arrow key events
-    
-    TInt wgId(0);
-    CApaWindowGroupName::FindByAppUid( iUid, iWsSession, wgId );
-    // generate a random arrow key event
-    TWsEvent event;
-    event.SetType( EEventKey );
-    event.Key()->iCode = CLoadGenModel::RandomNumber( EKeyLeftArrow, EKeyDownArrow );
-    event.Key()->iScanCode = event.Key()->iCode - KScanCodeStart;
-    event.Key()->iModifiers = 0;
-    event.Key()->iRepeats = 0;
-    iWsSession.SendEventToWindowGroup( wgId, event );
-    }
-
-// End of File
--- a/loadgen/src/loadgen_appui.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_appui.h"
-#include "loadgen_mainview.h"
-#include "loadgen.hrh"
-#include "loadgen_model.h"
-#include "loadgen_document.h"
-#include <loadgen.rsg>
-
-#include <avkon.hrh>
-#include <aknquerydialog.h>
-#include <aknmessagequerydialog.h> 
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-void CLoadGenAppUi::ConstructL()
-    {
-    // disable window server priority control for this application
-    iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled );
-    
-    // set as system application to prevent getting shut down events 
-    iEikonEnv->SetSystem(ETrue);
-        
-
-    BaseConstructL(EAknEnableSkin);
-
-    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-
-    CLoadGenMainView* mainView = new(ELeave) CLoadGenMainView;
-    CleanupStack::PushL(mainView);
-    mainView->ConstructL();
-    AddViewL(mainView);           // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();          // mainView
-    
-    SetDefaultViewL(*mainView);
-
-    // notify the model that everything has been constructed
-    iModel->ActivateModelL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenAppUi::~CLoadGenAppUi()
-    {
-    // notify the model that the application is closing 
-    if (iModel)   
-        TRAP_IGNORE(iModel->DeActivateModelL());
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_LOADGEN_APP_MENU)
-        {
-        aMenuPane->SetItemDimmed(ELoadGenStopAll, !iModel->LoadItemsExists());
-        aMenuPane->SetItemDimmed(ELoadGenSuspendAll, !iModel->LoadItemsExists());
-        aMenuPane->SetItemDimmed(ELoadGenResumeAll, !iModel->LoadItemsExists());
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CLoadGenAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
-    {
-    return EKeyWasNotConsumed;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch ( aCommand )
-        {
-        case ELoadGenCmdLaunchPerfMon:
-            {
-            // launch Performance Monitor
-            const TUid KUidPerfMon = { 0x20011385 };
-            
-            RWsSession ws;
-            User::LeaveIfError( ws.Connect() );
-            CleanupClosePushL(ws);
-            
-            RApaLsSession ls;
-            User::LeaveIfError( ls.Connect() );
-            CleanupClosePushL(ls);
-            
-            
-            // try to find the task of PerfMon
-            TApaTaskList tasklist(ws);
-            TApaTask task = tasklist.FindApp(KUidPerfMon);
-
-            if (task.Exists())
-                {
-                // task exists, bring it to foreground
-                task.BringToForeground();
-                }
-            else
-                {
-                TApaAppInfo appInfo;
-                User::LeaveIfError(ls.GetAppInfo(appInfo, KUidPerfMon));
-                
-                CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
-                cmdLine->SetExecutableNameL(appInfo.iFullName);
-                cmdLine->SetCommandL(EApaCommandBackground);
-
-                // start the app
-                User::LeaveIfError(ls.StartApp(*cmdLine));
-                
-                CleanupStack::PopAndDestroy(); //cmdLine                
-                }
-            
-            CleanupStack::PopAndDestroy(2); //ws,ls
-            }
-            break;
-            
-        case ELoadGenCmdAbout:
-            {
-            CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-            dialog->ExecuteLD(R_LOADGEN_ABOUT_DIALOG);
-            }
-            break;
-            
-        // a normal way to close an application
-        case EAknCmdExit:
-        case EEikCmdExit:
-        case EAknSoftkeyExit: 
-            {
-            Exit();
-            }
-            break;
-
-        default:
-            break;      
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-// End of File  
--- a/loadgen/src/loadgen_bluetooth.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_bluetooth.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include "loadgen_traces.h"
-#include <loadgen.rsg>
-#include <e32hal.h>
-#include <u32hal.h>
-#include <e32math.h>
-#include <EIKENV.H>
-#include <btserversdkcrkeys.h>
-#include <BtnotifierAPI.h>
-#include <btpm.h>
-
-_LIT(KThreadName, "Bluetooth %d");
-_LIT(KBTLinkManagerStr, "BTLinkManager");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-   
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CBluetooth* CBluetooth::NewL(TBluetoothAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CBluetooth* self = new(ELeave) CBluetooth(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    TRAPD(err, self->ConstructL());
-    if( err != KErrNone )
-        {
-        User::Leave(err);
-        }
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CBluetooth::~CBluetooth()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CBluetooth::CBluetooth(TBluetoothAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::ConstructL()
-    {    
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadBluetooth;
-    
-    InitializeBluetoothL();
-                        
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-            
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    iState = ELoadStateConstructed;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CBluetooth::ThreadFunction(TAny* aThreadArg)
-    {
-    TInt err = KErrNone;
-    
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TBluetoothAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::GenerateLoad(TBluetoothAttributes& aAttributes)
-    {    
-    CBTManager* btManager = 0;
-    TRAPD(err, btManager = CBTManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete btManager;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::Resume()
-    {    
-    CLoadBase::Resume();    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::Suspend()
-    {
-    CLoadBase::Suspend();    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::SetPriority()
-    {
-    CLoadBase::SetPriority();    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CBluetooth::Close()
-    {
-    LOGSTRING2("LoadGen: CBluetooth::~CBluetooth() - State: %d", iState);
-    if( iState != ELoadStateInvalid )
-        {
-        CLoadBase::Close();        
-        // kill the thread immediately
-        iThread.Kill(0);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-TPtrC CBluetooth::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-        
-    _LIT(KBluetoothEntry, "[%d] Bluetooth prio=%S idle=%dms random=%d%%");
-    buf.Format(KBluetoothEntry, iAttributes.iId, &prioBuf, iAttributes.iIdle, iAttributes.iRandomVariance);
-       
-    return TPtrC(buf);
-    }
-
-// --------------------------------------------------------------------------------------------
-void CBluetooth::InitializeBluetoothL()
-    {
-    // Create central repository for checking and setting bluetooth power state    
-    CRepository* btPowerStateCRepo = CRepository::NewL(KCRUidBluetoothPowerState);
-    
-    // Check if the BT is already turned on:    
-    TInt btPowerState = 0;
-    btPowerStateCRepo->Get(KBTPowerState, btPowerState);
-    delete btPowerStateCRepo;
-    btPowerStateCRepo = 0;
-        
-    if(btPowerState == EBTPowerOff)
-        {
-        // Switch bt power on:
-        if (SetBTPowerState(ETrue) == EFalse)
-            {
-            LOGSTRING("LoadGen: Bluetooth could not be switched on");
-            User::Leave(KErrNotReady);
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-TBool CBluetooth::SetBTPowerState(TBool aState)
-    {    
-    // Ask user to turn on the bluetooth device:
-    RNotifier btPowerNotifier;
-    TInt errCode = btPowerNotifier.Connect();
-    
-    TBool retVal = errCode == KErrNone;
-    
-    if( errCode == KErrNone )
-        {
-        TPckgBuf<TBool> powerRequest(aState);
-        TPckgBuf<TBool> powerReply(EFalse);
-        TRequestStatus powerRequestStatus;
-        btPowerNotifier.StartNotifierAndGetResponse(powerRequestStatus, 
-                                                KPowerModeSettingNotifierUid, 
-                                                powerRequest, 
-                                                powerReply);
-        User::WaitForRequest(powerRequestStatus);
-        btPowerNotifier.CancelNotifier(KPowerModeSettingNotifierUid);
-        btPowerNotifier.Close();  
-        if( powerReply() == EFalse )
-            {
-            LOGSTRING("LoadGen: Bluetooth activating cancelled.");
-            }
-        retVal = powerReply();
-        }
-    
-    return retVal; 
-    }
-
-// --------------------------------------------------------------------------------------------
-CBTManager* CBTManager::NewL(   TBluetoothAttributes& aAttrs)
-    {
-    CBTManager* self = new (ELeave) CBTManager( aAttrs);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
- 
-// --------------------------------------------------------------------------------------------
-CBTManager::~CBTManager()
-    {    
-    if (iPeriodicTimer)
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }    
-    iHostResolver.Close();        
-    Cancel();
-    }
- 
-// --------------------------------------------------------------------------------------------
-CBTManager::CBTManager( TBluetoothAttributes& aAttrs) 
-: 
-CActive(EPriorityStandard),
-iAttributes(aAttrs)
-    {    
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CBTManager::ConstructL()
-    {
-    // Socket server session initiation:
-    User::LeaveIfError(iSocketServerHnd.Connect());    
-
-    CActiveScheduler::Add(this);
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-        
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-
-// --------------------------------------------------------------------------------------------
-void CBTManager::DoCancel()
-    {
-    LOGSTRING("LoadGen: CBTManager::DoCancel()");    
-    }
-
-// --------------------------------------------------------------------------------------------
-void CBTManager::RunL()
-    {    
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();    
-    }
-
-// --------------------------------------------------------------------------------------------
-TInt CBTManager::StartBTDeviceDiscovery()
-    {
-    TInt retVal = KErrNone; 
-    RThread myThread;
-           
-    // Initialize host resolver      
-    iHostResolver.Close();        
-    TProtocolDesc protocolInfo;
-    retVal = iSocketServerHnd.FindProtocol(KBTLinkManagerStr(), protocolInfo);
-    if( retVal == KErrNone )
-        {
-        retVal = iHostResolver.Open(iSocketServerHnd, protocolInfo.iAddrFamily, protocolInfo.iProtocol);        
-        }
-    
-    if( retVal == KErrNone )
-        {
-        TInquirySockAddr socketAddress;
-        socketAddress.SetIAC( KGIAC );
-        socketAddress.SetAction(KHostResInquiry|KHostResName|KHostResIgnoreCache);
-        retVal = iHostResolver.GetByAddress(socketAddress, iBTNameEntry);        
-        // Loop all discovered devices:
-        while( retVal == KErrNone )        
-            {
-            LOGSTRING3("LoadGen: Thread %S found device: %S", &(myThread.Name()), &(iBTNameEntry().iName) );
-            // Get next device
-            retVal = iHostResolver.Next(iBTNameEntry);            
-            }
-        }
-    
-    // KErrEof is returned when no more devices to loop
-    if( retVal == KErrEof )
-        {
-        retVal = KErrNone;
-        }
-            
-    iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                        iAttributes.iRandomVariance ), KDefaultPeriod, 
-                        TCallBack( PeriodicTimerCallBack, this ) );
-
-    return retVal;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CBTManager::PeriodicTimerCallBack(TAny* aAny)
-    {        
-    CBTManager* self = static_cast<CBTManager*>( aAny );
-    self->iPeriodicTimer->Cancel();
-    // Perform device discovery:
-    self->StartBTDeviceDiscovery();
-    return KErrNone;
-    }
-
-// End of File
--- a/loadgen/src/loadgen_cpuload.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_cpuload.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-#include <e32hal.h>
-#include <u32hal.h>
-#include <e32math.h>
-
-_LIT(KThreadName, "CPULoad %d");
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CCPULoad* CCPULoad::NewL(TCPULoadAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CCPULoad* self = new(ELeave) CCPULoad(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CCPULoad::~CCPULoad()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CCPULoad::CCPULoad(TCPULoadAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadCPULoad;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CCPULoad::ThreadFunction(TAny* aThreadArg)
-    {
-    TCPULoadAttributes* threadArg = (TCPULoadAttributes*)aThreadArg;
-    TInt err = KErrNone;
-
-    // if a cpu is defined, tie this thread to the given cpu (SMP environment)
-    if (threadArg->iCpu >= 0 && threadArg->iCpu != KCPUSelection_AllCPUs )
-        {
-        UserSvr::HalFunction(EHalGroupKernel, KHalFunction_EKernelHalLockThreadToCpu, (TAny*) threadArg->iCpu, 0);
-        }
-    
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TCPULoadAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::GenerateLoad(TCPULoadAttributes& aAttributes)
-    {
-    for (;;)
-        {   
-        if (aAttributes.iType == ECpuLoadTypeContinuous)
-            {
-            // do constantly heave stuff
-            DoHeaveStuff(aAttributes.iMode);
-            }
-
-        else if (aAttributes.iType == ECpuLoadTypePeriodic)
-            {
-            // do periodically heave stuff
-            TTime startTime;
-            startTime.HomeTime(); // get start time
-
-            TTime currentTime;
-            TTimeIntervalMicroSeconds interval;
-            
-            TInt processPeriod = CLoadGenModel::MilliSecondsToMicroSeconds(aAttributes.iLength, aAttributes.iRandomVariance);
-
-            do
-                {
-                // do heave stuff
-                DoHeaveStuff(aAttributes.iMode);
-
-                currentTime.HomeTime();
-                interval = currentTime.MicroSecondsFrom(startTime);                
-                }
-            while (interval.Int64() < processPeriod);       
-
-
-            // now wait
-            User::After( CLoadGenModel::MilliSecondsToMicroSeconds(aAttributes.iIdle, aAttributes.iRandomVariance) );
-            }   
-
-        else
-            {
-            User::Panic(_L("Unk.type"), 888);
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::DoHeaveStuff(TInt aMode)
-    {
-    TTime now;
-    now.HomeTime();
-    TInt64 seed = now.Int64();
-    
-    TReal random = Math::FRand(seed);
-    
-    TReal target(10);
-    TReal source(10);
-    
-    target += random;
-    
-    Math::Cos(target, source);
-    
-    source = source / 1.0382873;
-    source -= 32.24343;
-    source += 132.24343;
-    source *= random;
-    
-    // yield trick
-    if (aMode == ECpuLoadModeYielding)
-        {
-        // sleep randomly
-        if (User::TickCount() % 50 == 0)
-            User::AfterHighRes(1);            
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CCPULoad::Close()
-    {
-    CLoadBase::Close();
-
-    // kill the thread immediately
-    iThread.Kill(0);   
-
-    iThread.Close();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CCPULoad::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    
-    if (iAttributes.iType == ECpuLoadTypeContinuous)
-        {
-        if (iAttributes.iMode == ECpuLoadModeYielding)
-            {
-            _LIT(KCPULoadEntryContinuous, "[%d] CPULoad prio=%S mode=yielding type=cont");
-            buf.Format(KCPULoadEntryContinuous, iAttributes.iId, &prioBuf);
-            }
-        else if (iAttributes.iMode == ECpuLoadModeBlocking)
-            {
-            _LIT(KCPULoadEntryContinuous, "[%d] CPULoad prio=%S mode=blocking type=cont");
-            buf.Format(KCPULoadEntryContinuous, iAttributes.iId, &prioBuf);
-            }
-        }
-    
-    else if (iAttributes.iType == ECpuLoadTypePeriodic)
-        {
-        if (iAttributes.iMode == ECpuLoadModeYielding)
-            {
-            _LIT(KCPULoadEntryPeriodic, "[%d] CPULoad prio=%S mode=yielding type=period peak=%dms idle=%dms random=%d%%");
-            buf.Format(KCPULoadEntryPeriodic, iAttributes.iId, &prioBuf, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
-            }        
-        else if (iAttributes.iMode == ECpuLoadModeBlocking)
-            {
-            _LIT(KCPULoadEntryPeriodic, "[%d] CPULoad prio=%S mode=blocking type=period peak=%dms idle=%dms random=%d%%");
-            buf.Format(KCPULoadEntryPeriodic, iAttributes.iId, &prioBuf, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
-            }        
-        }
-    
-    // if we are running a load in a specific cpu, add the "name" of the
-    // cpu to the description. (SMP environment)
-    if (iAttributes.iCpu >= 0 && iAttributes.iCpu != KCPUSelection_AllCPUs)
-        {
-        TBuf<15> cpu;
-        _LIT(KCPU, " CPU%d");
-        cpu.Format(KCPU, iAttributes.iCpu);
-        buf.Append(cpu);
-        }
-    
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-
-
-// End of File
--- a/loadgen/src/loadgen_document.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_document.h"
-#include "loadgen_appui.h"
-#include "loadgen_model.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// constructor
-CLoadGenDocument::CLoadGenDocument(CEikApplication& aApp)
-: CAknDocument(aApp)    
-    {
-    }
-
-// ----------------------------------------------------
-
-// destructor
-CLoadGenDocument::~CLoadGenDocument()
-    {
-    delete iModel;
-    }
-
-// ----------------------------------------------------
-
-// EPOC default constructor can leave.
-void CLoadGenDocument::ConstructL()
-    {
-    iModel = CLoadGenModel::NewL();
-    }
-
-// ----------------------------------------------------
-
-// Two-phased constructor.
-CLoadGenDocument* CLoadGenDocument::NewL(CEikApplication& aApp)
-    {
-    CLoadGenDocument* self = new(ELeave) CLoadGenDocument(aApp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-    }
-    
-// ----------------------------------------------------
-// CLoadGenDocument::CreateAppUiL()
-// constructs CLoadGenAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CLoadGenDocument::CreateAppUiL()
-    {
-    return new (ELeave) CLoadGenAppUi;
-    }
-
-// ----------------------------------------------------
-// CLoadGenDocument::OpenFileL
-// Overrides CAknDocument::OpenFileL to support document file
-// ----------------------------------------------------
-//
-CFileStore* CLoadGenDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
-    {
-    return CEikDocument::OpenFileL(aDoOpen, aFilename, aFs);
-    }
-
-// ----------------------------------------------------
-
-// End of File  
--- a/loadgen/src/loadgen_editors.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1437 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_editors.h"
-#include "loadgen_loadattributes.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <aknform.h> 
-#include <eikedwin.h> 
-#include <eikmfne.h>
-#include <aknpopupfieldtext.h>
-#include <aknqueryvaluetext.h>
-#include <eikspane.h> 
-#include <akntitle.h> 
-#include <eikcapc.h>
-#include <e32hal.h> 
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenLoadTypeEditorBase::CLoadGenLoadTypeEditorBase(TBool aEditingExisting):
-    iEditingExisting(aEditingExisting)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenLoadTypeEditorBase::ConstructL(const TDesC& aTitleText)
-    {
-    CAknForm::ConstructL();
-
-    // set title text
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( aTitleText );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenLoadTypeEditorBase::PreLayoutDynInitL()
-    {
-    CAknForm::PreLayoutDynInitL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenLoadTypeEditorBase::OkToExitL(TInt /*aButtonId*/)
-    {
-    return ETrue;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(TInt aControlId)
-    {
-    CAknForm::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenLoadTypeEditorBase::RunQueryLD()
-    {
-    User::Panic(_L("Unk.form"), 222);
-    
-    return ETrue;
-    }
-               
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenLoadTypeEditorBase::DoRunQueryLD(TInt aResource)
-    {
-    return ExecuteLD(aResource);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenLoadTypeEditorBase::InsertFieldAfterL(TInt aResourceId, TInt aControlId, TInt aPrevControlId)
-    {
-    CCoeControl* prevControl = Control(aPrevControlId);
-    __ASSERT_DEBUG(prevControl, User::Panic(_L("Form.Ctrl.Null"), 111));
-    TInt pos = FindLineIndex(*prevControl);
-    pos = pos + 1;
-    InsertLineL(pos, aResourceId);
-    Line(aControlId)->ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenLoadTypeEditorBase::UpdateFormL()
-    {
-    UpdatePageL(ETrue);
-    }
-               
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenCPULoadEditor* CLoadGenCPULoadEditor::NewL(TCPULoadAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenCPULoadEditor* self = new(ELeave) CLoadGenCPULoadEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenCPULoadEditor::~CLoadGenCPULoadEditor()
-    {
-    delete iCpuQueryValText;
-    delete iCpuTextArray;
-    delete iCPUsArray;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenCPULoadEditor::CLoadGenCPULoadEditor(TCPULoadAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCPULoadEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("CPU load"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCPULoadEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryPriority));
-    CAknPopupFieldText* edMode = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryMode));
-    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryType));
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edMode->SetCurrentValueIndex(iAttributes.iMode);
-    edType->SetCurrentValueIndex(iAttributes.iType);
-    
-    LoadCPUsL();
-
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCPULoadEditor::LoadCPUsL()
-    {
-    // if we are running in SMP environment
-    if (iAttributes.iCpuCount > 1)
-        {
-        // insert possibility to select which cpu the load is generated to
-        InsertFieldAfterL(R_CPULOAD_DLG_LINE_CPU, ELoadGenCPULoadQueryCpu, ELoadGenCPULoadQueryType);
-
-        iCPUsArray = new (ELeave) CDesCArrayFlat( 5 );
-        
-        // "Free scheduling" means that no specific cpu is selected. Scheduler desides
-        // which CPUu runs load thread at which time.
-        iCPUsArray->AppendL(_L("Free scheduling"));
-        
-        // add CPUs
-        for (int i = 0; i < iAttributes.iCpuCount; i++) 
-            {
-            TBuf<10> cpu;
-            _LIT(KCPU, "CPU%d");
-            cpu.Format(KCPU, i);
-            iCPUsArray->AppendL(cpu);
-            }
-        
-        // "All CPUs" means that one thread is started for each CPU.
-        iCPUsArray->AppendL(_L("All CPUs"));
-    
-        iCpuTextArray = CAknQueryValueTextArray::NewL();
-        iCpuTextArray->SetArray( *iCPUsArray );  
-        iCpuQueryValText = CAknQueryValueText::NewL();    
-        iCpuQueryValText->SetArrayL( iCpuTextArray );
-        // CPU is not defined, set "Free scheduling" as default selection in query list
-        if (iAttributes.iCpu < 0)
-            {
-            iCpuQueryValText->SetCurrentValueIndex(0);
-            }
-        // "All CPUs" selected. It is last choise in the selection list.
-        else if (iAttributes.iCpu == KCPUSelection_AllCPUs)
-            {
-            iCpuQueryValText->SetCurrentValueIndex(iCpuTextArray->MdcaCount()-1);
-            }
-        // CPU is defined, set the correct CPU as default selection in query list
-        else
-            {
-            // iCpu starts from zero (i.e. CPU0 is first CPU), but index zero
-            // in iCpuQueryValText is "Free scheduling", hence iCpu+1.
-            iCpuQueryValText->SetCurrentValueIndex(iAttributes.iCpu+1);
-            }
-
-        CAknPopupField* popup = static_cast<CAknPopupField*>(Control( ELoadGenCPULoadQueryCpu)); 
-        popup->SetQueryValueL( iCpuQueryValText );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenCPULoadEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryPriority));
-        CAknPopupFieldText* edMode = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryMode));
-        CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryType));
-        CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryLength));
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryVariance));
-        
-        // we are running in SMP environment
-        if (iAttributes.iCpuCount > 1)
-            {
-            TInt currentValueIndex = iCpuQueryValText->CurrentValueIndex();
-            // user selected a specific CPU in which the load thread should be run in.
-            if (currentValueIndex == 0)
-                {
-                // User selected "Free scheduling"
-                iAttributes.iCpu = KCPUSelection_FreeScheduling;
-                }            
-            else if( currentValueIndex == iCpuTextArray->MdcaCount()-1 )
-                {
-                // User selected "All CPUs", which is the last item in the selection list
-                iAttributes.iCpu = KCPUSelection_AllCPUs;
-                }
-            else
-                {                
-                // iCpu should start from zero (CPU0 is the first cpu)
-                // but zero in currentValueIndex means "Free scheduling". CPU0 in
-                // currentValueIndex is at index 1, hence -1.
-                iAttributes.iCpu = currentValueIndex - 1;
-                }
-            }
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iMode = edMode->CurrentValueIndex();
-        iAttributes.iType = edType->CurrentValueIndex();
-        if (edPeak) iAttributes.iLength = edPeak->Number();
-        if (edIdle) iAttributes.iIdle = edIdle->Number();
-        if (edVariance) iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCPULoadEditor::UpdateVisibilitiesOfFieldsL(TBool aFormInit)
-    {
-    // filter based on selected cpu load type
-    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>( Control( ELoadGenCPULoadQueryType ) );
-
-    if ( !aFormInit && edType->CurrentValueIndex() == ECpuLoadTypeContinuous )
-        {
-        // save values before deleting the items
-        CCoeControl* control = ControlOrNull( ELoadGenCPULoadQueryLength );
-        if ( control )
-            {
-            CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>( control );
-            iAttributes.iLength = edPeak->Number();
-            DeleteLine( ELoadGenCPULoadQueryLength );
-            control = NULL;
-            }
-        control = ControlOrNull( ELoadGenCPULoadQueryIdle );
-        if ( control )
-            {
-            CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>( control );
-            iAttributes.iIdle = edIdle->Number();
-            DeleteLine( ELoadGenCPULoadQueryIdle );
-            control = NULL;
-            }
-        control = ControlOrNull( ELoadGenCPULoadQueryVariance );
-        if ( control )
-            {
-            CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>( control );
-            iAttributes.iRandomVariance = edVariance->Number();
-            DeleteLine( ELoadGenCPULoadQueryVariance );
-            }
-        }
-    else if ( edType->CurrentValueIndex() == ECpuLoadTypePeriodic )
-        {
-        // insert new fields
-        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_LENGTH, ELoadGenCPULoadQueryLength, ELoadGenCPULoadQueryType);
-        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_IDLE, ELoadGenCPULoadQueryIdle, ELoadGenCPULoadQueryLength);
-        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_VARIANCE, ELoadGenCPULoadQueryVariance, ELoadGenCPULoadQueryIdle);
-        
-        // load values to just created editors
-        CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryLength));
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryVariance));
-        edPeak->SetNumber(iAttributes.iLength);
-        edIdle->SetNumber(iAttributes.iIdle);
-        edVariance->SetNumber(iAttributes.iRandomVariance);
-        }
-
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCPULoadEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-
-    // update visibilities of fields    
-    if (aControlId == ELoadGenCPULoadQueryType)
-        {
-        UpdateVisibilitiesOfFieldsL();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenCPULoadEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_CPULOAD_FORM_DIALOG);
-    }
-       
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMemoryEatEditor* CLoadGenMemoryEatEditor::NewL(TMemoryEatAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenMemoryEatEditor* self = new(ELeave) CLoadGenMemoryEatEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMemoryEatEditor::~CLoadGenMemoryEatEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMemoryEatEditor::CLoadGenMemoryEatEditor(TMemoryEatAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMemoryEatEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Memory eat"));
-    
-    // convert int64 vals to descs
-    iAttributes.iAmountDes.Copy(KNullDesC);
-    iAttributes.iRandomMinDes.Copy(KNullDesC);
-    iAttributes.iRandomMaxDes.Copy(KNullDesC);
-    
-    iAttributes.iAmountDes.AppendNum(iAttributes.iAmount);
-    iAttributes.iRandomMinDes.AppendNum(iAttributes.iRandomMin);
-    iAttributes.iRandomMaxDes.AppendNum(iAttributes.iRandomMax);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMemoryEatEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryPriority));
-    CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQuerySource));
-    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
-    CEikNumberEditor* edBuffer = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryBuffer));
-    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryIdle));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edSource->SetCurrentValueIndex(iAttributes.iSource);
-    edType->SetCurrentValueIndex(iAttributes.iType);
-    edBuffer->SetNumber(iAttributes.iBuffer);
-    edIdle->SetNumber(iAttributes.iIdle);
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-            
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    UpdateAvailableMemoryL();
-    
-    // set source as dimmed if editing existing item
-    if (iEditingExisting)
-        {
-        SetLineDimmedNow(ELoadGenMemoryEatQuerySource, ETrue); 
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenMemoryEatEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryPriority));
-        CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQuerySource));
-        CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
-        CEikNumberEditor* edBuffer = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryBuffer));
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iSource = edSource->CurrentValueIndex();
-        iAttributes.iType = edType->CurrentValueIndex();
-        iAttributes.iBuffer = edBuffer->Number();
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-
-
-        CEikEdwin* edAmount = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
-        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryRandomMin));
-        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryRandomMax));
-
-        // get desc values and convert to int64
-        if (edAmount)
-            {
-            edAmount->GetText(iAttributes.iAmountDes);
-
-            TLex converter;
-            converter.Assign(iAttributes.iAmountDes);
-            User::LeaveIfError(converter.Val(iAttributes.iAmount));
-            }
-
-        if (edRandomMin)
-            {
-            edRandomMin->GetText(iAttributes.iRandomMinDes);
-
-            TLex converter;
-            converter.Assign(iAttributes.iRandomMinDes);
-            User::LeaveIfError(converter.Val(iAttributes.iRandomMin));
-            }
-
-        if (edRandomMax)
-            {
-            edRandomMax->GetText(iAttributes.iRandomMaxDes);
-
-            TLex converter;
-            converter.Assign(iAttributes.iRandomMaxDes);
-            User::LeaveIfError(converter.Val(iAttributes.iRandomMax));
-            
-            // swap min max values if they in wrong order
-            if (iAttributes.iRandomMin > iAttributes.iRandomMax)
-                {
-                TInt64 temp(iAttributes.iRandomMin);
-                iAttributes.iRandomMin = iAttributes.iRandomMax;
-                iAttributes.iRandomMax = temp; 
-                }
-            
-            }                        
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMemoryEatEditor::UpdateVisibilitiesOfFieldsL(TBool aFormInit)
-    {
-    // filter based on selected memory eat type
-    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
-
-    if (!aFormInit && (edType->CurrentValueIndex() == EMemoryEatTypeMemoryToEat || edType->CurrentValueIndex() == EMemoryEatTypeMemoryToBeLeft))
-        {
-        // no need for changes if amount field is already active
-        CEikNumberEditor* edAmount = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
-        if (edAmount) return;
-        
-        // save values before deleting the items
-        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMin));
-        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMax));
-        edRandomMin->GetText(iAttributes.iRandomMinDes);
-        edRandomMax->GetText(iAttributes.iRandomMaxDes);
-        
-        DeleteLine(ELoadGenMemoryEatQueryRandomMin);
-        DeleteLine(ELoadGenMemoryEatQueryRandomMax);
-        }
-    else if (!aFormInit && edType->CurrentValueIndex() == EMemoryEatTypeWavy)
-        {
-        // save values before deleting the items
-        CEikEdwin* edAmount = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryAmount));
-        edAmount->GetText(iAttributes.iAmountDes);
-        
-        DeleteLine(ELoadGenMemoryEatQueryAmount);
-        }
-    
-    if (edType->CurrentValueIndex() == EMemoryEatTypeMemoryToEat || edType->CurrentValueIndex() == EMemoryEatTypeMemoryToBeLeft)
-        {
-        // insert new fields
-        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_AMOUNT, ELoadGenMemoryEatQueryAmount, ELoadGenMemoryEatQueryType);
-        
-        // load values to just created editors
-        CEikEdwin* edAmount = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryAmount));
-        edAmount->SetTextL(&iAttributes.iAmountDes);
-        }
-    else if (edType->CurrentValueIndex() == EMemoryEatTypeWavy)
-        {
-        // insert new fields
-        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_RANDOM_MIN, ELoadGenMemoryEatQueryRandomMin, ELoadGenMemoryEatQueryType);
-        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_RANDOM_MAX, ELoadGenMemoryEatQueryRandomMax, ELoadGenMemoryEatQueryRandomMin);
-        
-        // load values to just created editors
-        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMin));
-        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMax));
-        edRandomMin->SetTextL(&iAttributes.iRandomMinDes);
-        edRandomMax->SetTextL(&iAttributes.iRandomMaxDes);
-        }
-    
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMemoryEatEditor::UpdateAvailableMemoryL()
-    {
-    // this feature is used only when not editing existing load
-    if (!iEditingExisting)
-        {
-        CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(ControlOrNull(ELoadGenMemoryEatQuerySource));
-        CEikEdwin* edAmount = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
-        
-        if (edAmount && edSource)
-            {
-            iAttributes.iAmountDes.Copy(KNullDesC);
-
-            if (edSource->CurrentValueIndex() == EMemoryEatSourceTypeRAM)
-                {
-                // RAM
-                TMemoryInfoV1Buf ramMemory;
-                UserHal::MemoryInfo(ramMemory);
-                
-                iAttributes.iAmountDes.AppendNum(ramMemory().iFreeRamInBytes);
-                }
-            else
-                {
-                // get drive
-                TVolumeInfo volumeInfo;
-                if (CEikonEnv::Static()->FsSession().Volume(volumeInfo, edSource->CurrentValueIndex()+1) == KErrNone)
-                    {
-                    iAttributes.iAmountDes.AppendNum(volumeInfo.iFree);
-                    }
-                else
-                    {
-                    iAttributes.iAmountDes.AppendNum(0);
-                    }
-                }
-
-            edAmount->SetTextL(&iAttributes.iAmountDes);
-            }        
-        }
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMemoryEatEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    
-    // update visibilities of fields    
-    if (aControlId == ELoadGenMemoryEatQueryType)
-        {
-        UpdateVisibilitiesOfFieldsL();
-        }
-    
-    // update memory when source changes
-    else if (aControlId == ELoadGenMemoryEatQuerySource)
-        {
-        UpdateAvailableMemoryL();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenMemoryEatEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_MEMORYEAT_FORM_DIALOG);
-    }
-
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhoneCallEditor* CLoadGenPhoneCallEditor::NewL(TPhoneCallAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenPhoneCallEditor* self = new(ELeave) CLoadGenPhoneCallEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhoneCallEditor::~CLoadGenPhoneCallEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhoneCallEditor::CLoadGenPhoneCallEditor(TPhoneCallAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhoneCallEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Phone calls"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhoneCallEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-    
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhoneCallQueryPriority));
-    CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenPhoneCallQueryDestination));
-    CEikNumberEditor* edLength = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryLength));
-    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryIdle));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edDestination->SetTextL(&iAttributes.iDestination);   
-    edLength->SetNumber(iAttributes.iLength);   
-    edIdle->SetNumber(iAttributes.iIdle);   
-    edVariance->SetNumber(iAttributes.iRandomVariance);   
-    
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPhoneCallEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhoneCallQueryPriority));
-        CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenPhoneCallQueryDestination));
-        CEikNumberEditor* edLength = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryLength));
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        edDestination->GetText(iAttributes.iDestination);
-        iAttributes.iLength = edLength->Number();
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhoneCallEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhoneCallEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPhoneCallEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_PHONECALL_FORM_DIALOG);
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenNetConnEditor* CLoadGenNetConnEditor::NewL(TNetConnAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenNetConnEditor* self = new(ELeave) CLoadGenNetConnEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenNetConnEditor::~CLoadGenNetConnEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenNetConnEditor::CLoadGenNetConnEditor(TNetConnAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenNetConnEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Network conn."));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenNetConnEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-    
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenNetConnQueryPriority));
-    CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenNetConnQueryDestination));
-    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryIdle));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edDestination->SetTextL(&iAttributes.iDestination);   
-    edIdle->SetNumber(iAttributes.iIdle);   
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-       
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenNetConnEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenNetConnQueryPriority));
-        CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenNetConnQueryDestination));
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        edDestination->GetText(iAttributes.iDestination);
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenNetConnEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenNetConnEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenNetConnEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_NETCONN_FORM_DIALOG);
-    }
-
-// --------------------------------------------------------------------------------------------
-       
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenKeyPressEditor* CLoadGenKeyPressEditor::NewL(TKeyPressAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenKeyPressEditor* self = new(ELeave) CLoadGenKeyPressEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenKeyPressEditor::~CLoadGenKeyPressEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenKeyPressEditor::CLoadGenKeyPressEditor(TKeyPressAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenKeyPressEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Key presses"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenKeyPressEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenKeyPressQueryPriority));
-    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryHeartBeat));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edHeartBeat->SetNumber(iAttributes.iHeartBeat);
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenKeyPressEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenKeyPressQueryPriority));
-        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryHeartBeat));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iHeartBeat = edHeartBeat->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenKeyPressEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenKeyPressEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenKeyPressEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_KEYPRESS_FORM_DIALOG);
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMessagesEditor* CLoadGenMessagesEditor::NewL( TMessageAttributes& aAttributes, 
-                                                      TBool aEditingExisting )
-    {
-    CLoadGenMessagesEditor* self = new(ELeave) CLoadGenMessagesEditor( aAttributes, 
-                                                                        aEditingExisting );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMessagesEditor::~CLoadGenMessagesEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMessagesEditor::CLoadGenMessagesEditor( TMessageAttributes& aAttributes, 
-                                                TBool aEditingExisting ) :
-                                            CLoadGenLoadTypeEditorBase( aEditingExisting ), 
-                                            iAttributes( aAttributes )
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMessagesEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL( _L("Messages") );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMessagesEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-    
-    // load values to static editors
-    CAknPopupFieldText* edPriority = 
-                    static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryPriority ) );
-    CAknPopupFieldText* edType = 
-                    static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryType ) );                    
-    CEikEdwin* edDestination = 
-                    static_cast<CEikEdwin*>( Control( ELoadGenMessagesQueryDestination ) );
-    CEikNumberEditor* edAmount = 
-                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryAmount ) );                
-    CEikNumberEditor* edLength = 
-                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryLength ) );
-    CEikNumberEditor* edIdle = 
-                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryIdle ) );
-    CEikNumberEditor* edVariance = 
-                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryVariance ) );
-
-    edPriority->SetCurrentValueIndex( iAttributes.iPriority );
-    edType->SetCurrentValueIndex( iAttributes.iMessageType );
-    edDestination->SetTextL( &iAttributes.iDestination );
-    edAmount->SetNumber( iAttributes.iAmount );
-    edLength->SetNumber( iAttributes.iLength );   
-    edIdle->SetNumber( iAttributes.iIdle );   
-    edVariance->SetNumber( iAttributes.iRandomVariance );   
-       
-    UpdateVisibilitiesOfFieldsL( ETrue );
-    // set type selection as dimmed if editing existing item
-    if (iEditingExisting)
-        {
-        SetLineDimmedNow(ELoadGenMessagesQueryType, ETrue); 
-        }
-    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenMessagesEditor::OkToExitL( TInt aButtonId )
-    {
-    if ( aButtonId == EAknSoftkeyOk )
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = 
-                static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryPriority ) );
-        CAknPopupFieldText* edType = 
-                static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryType ) );                
-        CEikEdwin* edDestination = 
-                static_cast<CEikEdwin*>( Control( ELoadGenMessagesQueryDestination ) );
-        CEikNumberEditor* edLength = 
-                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryLength ) );
-        CEikNumberEditor* edAmount = 
-                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryAmount ) );                
-        CEikNumberEditor* edIdle = 
-                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryIdle ) );
-        CEikNumberEditor* edVariance =
-                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryVariance ) );
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iMessageType = edType->CurrentValueIndex();
-        edDestination->GetText( iAttributes.iDestination );
-        iAttributes.iAmount = edAmount->Number();
-        iAttributes.iLength = edLength->Number();
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMessagesEditor::UpdateVisibilitiesOfFieldsL( TBool /*aFormInit*/ )
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMessagesEditor::HandleControlStateChangeL( TInt aControlId )
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL( aControlId );
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenMessagesEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD( R_MESSAGES_FORM_DIALOG );
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenApplicationsEditor* CLoadGenApplicationsEditor::NewL( TApplicationsAttributes& aAttributes, 
-                                                      TBool aEditingExisting )
-    {
-    CLoadGenApplicationsEditor* self = new(ELeave) CLoadGenApplicationsEditor( aAttributes, 
-                                                                        aEditingExisting );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenApplicationsEditor::~CLoadGenApplicationsEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenApplicationsEditor::CLoadGenApplicationsEditor( TApplicationsAttributes& aAttributes, 
-                                                TBool aEditingExisting ) :
-                                            CLoadGenLoadTypeEditorBase( aEditingExisting ), 
-                                            iAttributes( aAttributes )
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenApplicationsEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL( _L("Applications") );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenApplicationsEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsQueryPriority));
-    CEikNumberEditor* edLaunchingInterval = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsLaunchingInterval));
-    CAknPopupFieldText* edKeyPressType = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsKeyPressType));
-    CEikNumberEditor* edMaxOpen = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsMaxOpen));
-    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsKeyPressQueryHeartBeat));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsQueryVariance));
-
-    edPriority->SetCurrentValueIndex( iAttributes.iPriority );
-    edLaunchingInterval->SetNumber( iAttributes.iLaunchingInterval );
-    edKeyPressType->SetCurrentValueIndex( iAttributes.iKeyPressType );
-    edMaxOpen->SetNumber( iAttributes.iMaxOpen );
-    edHeartBeat->SetNumber( iAttributes.iHeartBeat );
-    edVariance->SetNumber( iAttributes.iRandomVariance );
-
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenApplicationsEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsQueryPriority));
-        CEikNumberEditor* edLaunchingInterval = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsLaunchingInterval));
-        CAknPopupFieldText* edKeyPressType = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsKeyPressType));
-        CEikNumberEditor* edMaxOpen = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsMaxOpen));
-        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsKeyPressQueryHeartBeat));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iLaunchingInterval = edLaunchingInterval->Number();
-        iAttributes.iKeyPressType = edKeyPressType->CurrentValueIndex();
-        iAttributes.iMaxOpen = edMaxOpen->Number();
-        iAttributes.iHeartBeat = edHeartBeat->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenApplicationsEditor::UpdateVisibilitiesOfFieldsL( TBool /*aFormInit*/ )
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenApplicationsEditor::HandleControlStateChangeL( TInt aControlId )
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL( aControlId );
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenApplicationsEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD( R_APPLICATIONS_FORM_DIALOG );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhotoCaptureEditor* CLoadGenPhotoCaptureEditor::NewL(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenPhotoCaptureEditor* self = new(ELeave) CLoadGenPhotoCaptureEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhotoCaptureEditor::~CLoadGenPhotoCaptureEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPhotoCaptureEditor::CLoadGenPhotoCaptureEditor(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhotoCaptureEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Photo captures"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhotoCaptureEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-    
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryPriority));
-    //CAknPopupFieldText* edDevice = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryDevice));    
-    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryIdle));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    //edDevice->SetCurrentValueIndex(0);
-    edIdle->SetNumber(iAttributes.iIdle);   
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-    
-    LoadCamerasL();
-    
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-void CLoadGenPhotoCaptureEditor::LoadCamerasL()
-    {    
-    if (iAttributes.iCameraCount > 0)
-        {
-        // insert possibility to select which cpu the load is generated to
-        InsertFieldAfterL(R_PHOTOCAPTURE_DLG_LINE_DEVICE, ELoadGenPhotoCaptureQueryDevice, ELoadGenPhotoCaptureQueryPriority);
-        
-        iCamerasArray = new (ELeave) CDesCArrayFlat( iAttributes.iCameraCount );   
-        
-        // add Cameras
-        for (int i = 0; i < iAttributes.iCameraCount; i++) 
-            {
-            TBuf<16> cam;
-            _LIT(KCam, "Camera %d");
-            cam.Format(KCam, i);
-            iCamerasArray->AppendL(cam);
-            }    
-       
-        iCameraTextArray = CAknQueryValueTextArray::NewL();
-        iCameraTextArray->SetArray( *iCamerasArray );  
-        iCameraQueryValText = CAknQueryValueText::NewL();    
-        iCameraQueryValText->SetArrayL( iCameraTextArray );
-        if( iAttributes.iCameraCount > 0 )
-            {
-            iCameraQueryValText->SetCurrentValueIndex(iAttributes.iCamera);
-            }
-        CAknPopupField* popup = static_cast<CAknPopupField*>(Control( ELoadGenPhotoCaptureQueryDevice)); 
-        popup->SetQueryValueL( iCameraQueryValText );        
-        }    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPhotoCaptureEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryPriority));        
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();        
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        
-        if (iAttributes.iCameraCount > 1)
-            {
-            iAttributes.iCamera = iCameraQueryValText->CurrentValueIndex();
-            }
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhotoCaptureEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPhotoCaptureEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPhotoCaptureEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_PHOTOCAPTURE_FORM_DIALOG);
-    }
-
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenBluetoothEditor* CLoadGenBluetoothEditor::NewL(TBluetoothAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenBluetoothEditor* self = new(ELeave) CLoadGenBluetoothEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenBluetoothEditor::~CLoadGenBluetoothEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenBluetoothEditor::CLoadGenBluetoothEditor(TBluetoothAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenBluetoothEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Bluetooth"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenBluetoothEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-    
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenBluetoothQueryPriority));        
-    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryIdle));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);    
-    edIdle->SetNumber(iAttributes.iIdle);   
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-        
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenBluetoothEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenBluetoothQueryPriority));        
-        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryIdle));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();        
-        iAttributes.iIdle = edIdle->Number();
-        iAttributes.iRandomVariance = edVariance->Number();                
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenBluetoothEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenBluetoothEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenBluetoothEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_BLUETOOTH_FORM_DIALOG);
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPointerEventEditor* CLoadGenPointerEventEditor::NewL(TPointerEventAttributes& aAttributes, TBool aEditingExisting)
-    {
-    CLoadGenPointerEventEditor* self = new(ELeave) CLoadGenPointerEventEditor(aAttributes, aEditingExisting);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPointerEventEditor::~CLoadGenPointerEventEditor()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenPointerEventEditor::CLoadGenPointerEventEditor(TPointerEventAttributes& aAttributes, TBool aEditingExisting) :
-    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPointerEventEditor::ConstructL()
-    {
-    CLoadGenLoadTypeEditorBase::ConstructL(_L("Pointer events"));
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPointerEventEditor::PreLayoutDynInitL()
-    {
-    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
-
-    // load values to static editors
-    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPointerEventQueryPriority));
-    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryHeartBeat));
-    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryVariance));
-
-    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
-    edHeartBeat->SetNumber(iAttributes.iHeartBeat);
-    edVariance->SetNumber(iAttributes.iRandomVariance);
-
-    UpdateVisibilitiesOfFieldsL(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPointerEventEditor::OkToExitL(TInt aButtonId)
-    {
-    if (aButtonId == EAknSoftkeyOk)
-        {
-        // store values from editors
-        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPointerEventQueryPriority));
-        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryHeartBeat));
-        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryVariance));
-
-        iAttributes.iPriority = edPriority->CurrentValueIndex();
-        iAttributes.iHeartBeat = edHeartBeat->Number();
-        iAttributes.iRandomVariance = edVariance->Number();
-        }
-    
-    return ETrue;
-    }       
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPointerEventEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
-    {
-    UpdateFormL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenPointerEventEditor::HandleControlStateChangeL(TInt aControlId)
-    {
-    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenPointerEventEditor::RunQueryLD()
-    {
-    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_POINTEREVENT_FORM_DIALOG);
-    }
-
-// End of File
--- a/loadgen/src/loadgen_keypress.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_keypress.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-
-_LIT(KThreadName, "KeyPress %d");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CKeyPress* CKeyPress::NewL(TKeyPressAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CKeyPress* self = new(ELeave) CKeyPress(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CKeyPress::~CKeyPress()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CKeyPress::CKeyPress(TKeyPressAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadKeyPress;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CKeyPress::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TKeyPressAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::GenerateLoad(TKeyPressAttributes& aAttributes)
-    {
-    CKeyPressManager* keyPressManager = NULL;
-    TRAPD(err, keyPressManager = CKeyPressManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete keyPressManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CKeyPress::Close()
-    {
-    CLoadBase::Close();
-    
-    if (iThread.ExitReason() == 0) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon(waiter);
-        User::WaitForRequest(waiter);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CKeyPress::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    
-    _LIT(KKeyPressEntry, "[%d] KeyPress prio=%S heartbeat=%dms random=%d%%");
-    buf.Format(KKeyPressEntry, iAttributes.iId, &prioBuf, iAttributes.iHeartBeat, iAttributes.iRandomVariance);
-   
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CKeyPressManager* CKeyPressManager::NewL(TKeyPressAttributes& aAttributes)
-    {
-    CKeyPressManager* self = new(ELeave) CKeyPressManager(aAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CKeyPressManager::CKeyPressManager(TKeyPressAttributes& aAttributes) :
-    CActive(EPriorityStandard), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CKeyPressManager::~CKeyPressManager()
-    {
-    Cancel();
-    
-    iWsSession.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CKeyPressManager::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // init
-    User::LeaveIfError( iWsSession.Connect() );
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CKeyPressManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CKeyPressManager::DoCancel()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CKeyPressManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CKeyPressManager* self = static_cast<CKeyPressManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    self->SimulateKeyEvent();
-
-    return KErrNone;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CKeyPressManager::SimulateKeyEvent()
-    {
-    // generate a random key event from a to z
-    TKeyEvent keyEvent;
-    keyEvent.iCode = CLoadGenModel::RandomNumber('a','z');
-    keyEvent.iScanCode = keyEvent.iCode - 32;
-    keyEvent.iModifiers = 0;
-    keyEvent.iRepeats = 0;
-    
-    iWsSession.SimulateKeyEvent(keyEvent);
-    iWsSession.Flush();
-    
-    // call timer
-    iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iHeartBeat, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/loadgen/src/loadgen_loadbase.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_loadbase.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CLoadBase::CLoadBase()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadBase::ConstructL()
-    {
-    iState = ELoadStateInvalid;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadBase::Resume()
-    {
-    iState = ELoadStateRunning;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadBase::Suspend()
-    {
-    iState = ELoadStateSuspended;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadBase::SetPriority()
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadBase::Close()
-    {
-    iState = ELoadStateClosed;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CLoadBase::Description()
-    {
-    return TPtrC(KNullDesC);
-    }               
-               
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/loadgen/src/loadgen_maincontainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,457 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_maincontainer.h"
-#include "loadgen.hrh"
-#include "loadgen_document.h"
-#include "loadgen_appui.h"
-#include "loadgen_model.h"
-#include <loadgen_extraicons.mbg>
-
-#include <aknlists.h>
-#include <eikclb.h>
-#include <eikclbd.h>
-#include <aknconsts.h>
-#include <aknutils.h>
-#include <aknnotewrappers.h>
-#include <akniconarray.h> 
-#include <f32file.h>
-#include <AknIconUtils.h>
-#include <akndef.h>
-#include <akntitle.h>
-#include <eikspane.h> 
-
-_LIT(KExtraIconsPath, "\\resource\\apps\\loadgen_extraicons.mif");
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-void CLoadGenMainContainer::ConstructL(const TRect& aRect)
-    {
-    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    iModel->SetMainContainer(this);
-
-    CreateWindowL();
-    SetRect(aRect);
-    SetBlank();
-    
-    // init listbox
-    iListBox = new(ELeave) CLoadGenCAknSingleGraphicStyleListBox;
-    iListBox->SetContainerWindowL(*this);
-    iListBox->ConstructL(this, EAknListBoxMarkableList);
-    iListBox->View()->SetListEmptyTextL(_L("No loads activated\n(Select new load from Options to generate new load)"));
-
-    // create icon array and add marking indicator to it
-    CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
-    CleanupStack::PushL(iconArray);
-    CFbsBitmap* markBitmap = NULL;
-    CFbsBitmap* markBitmapMask = NULL;
-    
-    TRgb defaultColor;
-    defaultColor = iEikonEnv->Color(EColorControlText);
-
-    AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
-            KAknsIIDQgnIndiMarkedAdd,
-            KAknsIIDQsnIconColors,
-            EAknsCIQsnIconColorsCG13,
-            markBitmap,
-            markBitmapMask,
-            AknIconUtils::AvkonIconFileName(),
-            EMbmAvkonQgn_indi_marked_add,
-            EMbmAvkonQgn_indi_marked_add_mask,
-            defaultColor
-            );
-     
-    CGulIcon* markIcon = CGulIcon::NewL(markBitmap, markBitmapMask);
-    iconArray->AppendL(markIcon);                       
-    
-    // append icons from loadgen_extraicons.mif
-    TFileName extraIconsPath;
-    extraIconsPath.Copy(KExtraIconsPath);
-    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->AppFullName()); // get path where this app is installed
-    extraIconsPath.Insert(0, parse.Drive()); // drive letter
-    
-    CFbsBitmap* redBitmap = NULL;
-    CFbsBitmap* redBitmapMask = NULL;
-    CFbsBitmap* greenBitmap = NULL;
-    CFbsBitmap* greenBitmapMask = NULL;
-    
-    AknIconUtils::CreateIconL(redBitmap, redBitmapMask, extraIconsPath, EMbmLoadgen_extraiconsQgn_prob_status_red, EMbmLoadgen_extraiconsQgn_prob_status_red_mask);
-    AknIconUtils::CreateIconL(greenBitmap, greenBitmapMask, extraIconsPath, EMbmLoadgen_extraiconsQgn_prob_status_green, EMbmLoadgen_extraiconsQgn_prob_status_green_mask);
-
-    CGulIcon* redIcon = CGulIcon::NewL(redBitmap, redBitmapMask);
-    iconArray->AppendL(redIcon);  
-    
-    CGulIcon* greenIcon = CGulIcon::NewL(greenBitmap, greenBitmapMask);
-    iconArray->AppendL(greenIcon);  
-
-    // set icon array
-    CleanupStack::Pop(); // iconArray
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
-
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-    
-    // set size of the listbox
-    TSize outputRectSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-    TRect outputRect(outputRectSize);
-    iListBox->SetRect(outputRect);
-
-    iListBox->ActivateL();    
-    
-    ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenMainContainer::~CLoadGenMainContainer()
-    {
-    if (iListBox)
-        delete iListBox;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::SizeChanged()
-{
-    TSize outputRectSize;
-    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-    TRect outputRect(outputRectSize);
-    
-    if (iListBox)
-        iListBox->SetRect(outputRect);
-}
-
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenMainContainer::CountComponentControls() const
-    {
-    if (iListBox)
-        return 1;
-    else
-        return 0;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CCoeControl* CLoadGenMainContainer::ComponentControl(TInt /*aIndex*/) const
-    {
-    if (iListBox)
-        return iListBox;
-    else
-        return NULL;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenMainContainer::CurrentListBoxItemIndex()
-    {
-    if (iListBox)
-        {
-        return iListBox->CurrentItemIndex();
-        }
-    else
-        return KErrNotFound;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::SetListBoxTextArrayL(CDesCArray* aTextArray)
-    {
-    if (iListBox)
-        {    
-        iListBox->Model()->SetItemTextArray(aTextArray);
-        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-        iListBox->HandleItemAdditionL();
-        iListBox->UpdateScrollBarsL();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-const CArrayFix<TInt>* CLoadGenMainContainer::ListBoxSelectionIndexes()
-    {
-    if (iListBox)
-        {
-        const CListBoxView::CSelectionIndexArray* indices = iListBox->SelectionIndexes();
-        return static_cast<const CArrayFix<TInt>*>(indices);
-        }
-    else
-        return NULL;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenMainContainer::ListBoxSelectionIndexesCount()
-    {
-    if (iListBox)
-        {
-        return iListBox->SelectionIndexes()->Count();
-        }
-    else
-        return KErrNotFound;
-    }
-                        
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.Clear(aRect);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::SetDefaultTitlePaneTextL()
-    {
-    _LIT(KTitleText, "Load Gener.");
-
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( KTitleText );
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CLoadGenMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if(aType != EEventKey)
-        return EKeyWasNotConsumed;
-    
-    if (iListBox && iListBox->Model()->NumberOfItems() > 0)
-        {
-        /*
-        if (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)
-            {
-            iModel->StopSelectedOrHighlightedItemsL();
-            return EKeyWasConsumed;
-            }
-        else    
-            {
-            return iListBox->OfferKeyEventL(aKeyEvent, aType);
-            }
-        */
-        TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift) ||
-                                (aKeyEvent.iModifiers & EModifierLeftShift) ||
-                                (aKeyEvent.iModifiers & EModifierRightShift);
-        TBool controlKeyPressed = (aKeyEvent.iModifiers & EModifierCtrl) || 
-                                  (aKeyEvent.iModifiers & EModifierRightCtrl); 
-                                  
-        
-        // handle OK/Enter keys
-        if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) && (shiftKeyPressed || controlKeyPressed))
-            {
-            return iListBox->OfferKeyEventL(aKeyEvent, aType); //send to listbox if modifiers
-            }
-
-        // handle OK/Enter keys
-        else if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
-            {
-            iModel->ShowItemActionMenuL();
-            }
-
-        // handle delete key
-        else if (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)
-            {
-            iModel->StopSelectedOrHighlightedItemsL();
-            }
-
-        else
-            return iListBox->OfferKeyEventL(aKeyEvent, aType);
-        }
-    
-    return EKeyWasNotConsumed;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            {
-            iModel->ShowItemActionMenuL();
-            }
-            break;
-        default:
-            break;
-        }
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenMainContainer::HandleResourceChange(TInt aType)
-    {
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-
-        TSize outputRectSize;
-        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
-        TRect outputRect(outputRectSize);
-        iListBox->SetRect(outputRect);
-        }
-    else
-        {
-        CCoeControl::HandleResourceChange(aType);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCAknSingleGraphicStyleListBox::SizeChanged()
-    {
-    // call the base class function first
-    CAknSingleGraphicStyleListBox::SizeChanged();
-
-    // customize the list box
-    TRAP_IGNORE(SizeChangedL());
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenCAknSingleGraphicStyleListBox::SizeChangedL()
-    {
-    const TInt KEmptySize = 2;
-    
-    // disable separator line
-    ItemDrawer()->ColumnData()->SetSeparatorLinePosition(ENoLine);
-    
-    // enable marquee
-    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-    
-    // set fonts
-    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
-    ItemDrawer()->ColumnData()->SetColumnFontL(0, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(1, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(2, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(3, font);
-
-    // set row height
-    TInt rowHeight = font->HeightInPixels()+5;    
-    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
-    itemCellSize.iHeight = rowHeight; 
-    SetItemHeightL(rowHeight);
-    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
-    
-    // set icon sizes
-    TInt normalIconSize = rowHeight * 0.7;
-    TInt markingIconSize = rowHeight * 0.8;
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(2, TSize(markingIconSize,markingIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(KEmptySize,KEmptySize));
-
-    // set column widths
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0, normalIconSize + 2*normalIconSize * 0.15);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1, itemCellSize.iWidth-KEmptySize-markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(2, markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(3, KEmptySize);
-
-    // set baseline for the text
-    ItemDrawer()->ColumnData()->SetColumnBaselinePosL(1, font->HeightInPixels()-font->BaselineOffsetInPixels());
-
-    // set margins
-    TMargins iconMargins;
-    iconMargins.iBottom = 0;
-    iconMargins.iLeft = normalIconSize * 0.15;
-    iconMargins.iRight = normalIconSize * 0.15;
-    iconMargins.iTop = 0;
-
-    TMargins textMargins;
-    textMargins.iBottom = 0;
-    textMargins.iLeft = markingIconSize * 0.15;
-    textMargins.iRight = markingIconSize * 0.15;
-    textMargins.iTop = 0;
-
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(0, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(1, textMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(2, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(3, iconMargins);
-    
-/*
-    const TInt KEmptySize = 2;
-    
-    // enable marquee
-    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-    
-    // set fonts
-    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
-    ItemDrawer()->ColumnData()->SetColumnFontL(0, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(1, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(2, font);
-    ItemDrawer()->ColumnData()->SetColumnFontL(3, font);
-
-    // set row height
-    TInt rowHeight = font->HeightInPixels()+7;    
-    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
-    itemCellSize.iHeight = rowHeight; 
-    SetItemHeightL(rowHeight);
-    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
-
-    // set icon sizes
-    TInt normalIconSize = rowHeight * 0.6;
-    TInt markingIconSize = rowHeight * 0.8;
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(2, TSize(markingIconSize,markingIconSize));
-    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(KEmptySize,KEmptySize));
-
-    // set column widths
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0, normalIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1, itemCellSize.iWidth-KEmptySize-markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(2, markingIconSize);
-    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(3, KEmptySize);
-
-    // set baseline for the text
-    ItemDrawer()->ColumnData()->SetColumnBaselinePosL(1, font->HeightInPixels()-font->BaselineOffsetInPixels());
-
-    // set margins
-    TMargins iconMargins;
-    iconMargins.iBottom = 0;
-    iconMargins.iLeft = 0;
-    iconMargins.iRight = 0;
-    iconMargins.iTop = 0;
-
-    TMargins textMargins;
-    textMargins.iBottom = 0;
-    textMargins.iLeft = markingIconSize * 0.15;
-    textMargins.iRight = markingIconSize * 0.15;
-    textMargins.iTop = 0;
-
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(0, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(1, textMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(2, iconMargins);
-    ItemDrawer()->ColumnData()->SetColumnMarginsL(3, iconMargins);
-*/
-    }
-
-// --------------------------------------------------------------------------------------------
-        
-// End of File  
--- a/loadgen/src/loadgen_mainview.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen.hrh"
-#include "loadgen_mainview.h"
-#include "loadgen_maincontainer.h"
-#include "loadgen_document.h" 
-#include "loadgen_model.h"
-#include "loadgen_traces.h"
-#include <loadgen.rsg>
-
-#include <eikenv.h>
-#include <aknviewappui.h> 
-#include <aknnotewrappers.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CLoadGenMainView::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::ConstructL()
-    {
-    BaseConstructL( R_LOADGEN_VIEW_MAIN );
-    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    }
-
-// ---------------------------------------------------------
-// CLoadGenMainView::~CLoadGenMainView()
-// ---------------------------------------------------------
-//
-CLoadGenMainView::~CLoadGenMainView()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// TUid CLoadGenMainView::Id()
-// ---------------------------------------------------------
-//
-TUid CLoadGenMainView::Id() const
-    {
-    return KMainViewUID;
-    }
-
-// ---------------------------------------------------------
-// TUid CLoadGenMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-    }
-
-  
-// ---------------------------------------------------------
-// CLoadGenMainView::HandleCommandL(TInt aCommand)
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case ELoadGenCmdNewLoadCPULoad:
-        case ELoadGenCmdNewLoadEatMemory:
-        case ELoadGenCmdNewLoadPhoneCall:
-        case ELoadGenCmdNewLoadNetConn:
-        case ELoadGenCmdNewLoadKeyPress:
-        case ELoadGenCmdNewLoadMessages:
-        case ELoadGenCmdNewLoadApplications:
-        case ELoadGenCmdNewLoadPhotoCaptures:
-        case ELoadGenCmdNewLoadBluetooth:
-        case ELoadGenCmdNewLoadPointerEvent:
-            {            
-            TRAPD(err, iModel->StartNewLoadL(aCommand));
-            if( err != KErrNone )
-                {
-                LOGSTRING2("LoadGen: Load (command: %d) start failed!", aCommand);
-                _LIT(message, "Load start failed!");
-                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-                errorNote->ExecuteLD(message);                
-                }
-            break;
-            }
-        case ELoadGenStopAll:
-            {
-            iModel->StopAllLoadItemsL();
-            break;
-            }
-        case ELoadGenSuspendAll:
-            {
-            iModel->SuspendAllLoadItemsL();
-            break;
-            }
-        case ELoadGenResumeAll:
-            {
-            iModel->ResumeAllLoadItemsL();
-            break;
-            }            
-        default:
-            {
-            AppUi()->HandleCommandL(aCommand);
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CLoadGenMainView::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CLoadGenMainView::DoActivateL(...)
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CLoadGenMainContainer;
-        iModel->SetMainContainer(iContainer);
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-   }
-
-// ---------------------------------------------------------
-// CLoadGenMainView::DoDeactivate()
-// ---------------------------------------------------------
-//
-void CLoadGenMainView::DoDeactivate()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// End of File
--- a/loadgen/src/loadgen_memoryeat.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,603 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_memoryeat.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include "loadgen_traces.h"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-
-_LIT(KThreadName, "MemEat %d");
-_LIT(KChunkName, "LoadGen %d");
-_LIT(KFilePath, "%c:\\system\\temp\\LoadGen-%d_%d.$$$");
-
-// currently can only handle 2GB
-const TInt64 KMaxEatSize = 2147483647;
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CMemoryEat* CMemoryEat::NewL(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CMemoryEat* self = new(ELeave) CMemoryEat(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CMemoryEat::~CMemoryEat()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CMemoryEat::CMemoryEat(TMemoryEatAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadEatMemory;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 32*1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CMemoryEat::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start memory eat, pass pointer to arguments
-    GenerateLoad(*((TMemoryEatAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::GenerateLoad(TMemoryEatAttributes& aAttributes)
-    {
-    CMemoryEatManager* memoryEatManager = NULL;
-    TRAPD(err, memoryEatManager = CMemoryEatManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete memoryEatManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEat::Close()
-    {
-    CLoadBase::Close();
-    
-    if (iThread.ExitReason() == 0) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon(waiter);
-        User::WaitForRequest(waiter);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CMemoryEat::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    TBuf<16> srcBuf;
-    CLoadGenModel::SettingItemToSourceDescription(iAttributes.iSource, srcBuf);
-    
-    if (iAttributes.iType == EMemoryEatTypeMemoryToEat)
-        {
-        _LIT(KMemoryEatEntryMemoryToEat, "[%d] MemEat src=%S prio=%S type=MemToEat amount=%LDB buf=%dB idle=%dms");
-        
-        buf.Format(KMemoryEatEntryMemoryToEat, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iAmount, iAttributes.iBuffer, iAttributes.iIdle);
-        }
-    else if (iAttributes.iType == EMemoryEatTypeMemoryToBeLeft)
-        {
-        _LIT(KMemoryEatEntryMemoryToBeLeft, "[%d] MemEat src=%S prio=%S type=MemToBeLeft amount=%LDB buf=%dB idle=%dms");
-        
-        buf.Format(KMemoryEatEntryMemoryToBeLeft, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iAmount, iAttributes.iBuffer, iAttributes.iIdle);
-        }        
-
-    else if (iAttributes.iType == EMemoryEatTypeWavy)
-        {
-        _LIT(KMemoryEatEntryRandom, "[%d] MemEat src=%S prio=%S type=Random min=%LDB max=%LDB buf=%dB idle=%dms");
-        
-        buf.Format(KMemoryEatEntryRandom, iAttributes.iId, &srcBuf, &prioBuf, iAttributes.iRandomMin, iAttributes.iRandomMax, iAttributes.iBuffer, iAttributes.iIdle);
-        } 
-            
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CMemoryEatManager* CMemoryEatManager::NewL(TMemoryEatAttributes& aAttributes)
-    {
-    CMemoryEatManager* self = new(ELeave) CMemoryEatManager(aAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CMemoryEatManager::CMemoryEatManager(TMemoryEatAttributes& aAttributes) :
-    CActive(EPriorityStandard), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CMemoryEatManager::~CMemoryEatManager()
-    {
-    Cancel();
-    DestroyMemoryEat();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // init
-    InitMemoryEatL();
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::DoCancel()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CMemoryEatManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    TInt result = KErrNone;
-    CMemoryEatManager* self = static_cast<CMemoryEatManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    TRAP( result, self->EatMemoryL() );
-
-    return result;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::InitMemoryEatL()
-    {
-    // create a chunk for RAM
-    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
-        {
-        TBuf<64> chunkName;
-        chunkName.Format(KChunkName, iAttributes.iId);
-        
-        // set max size of the chunk to be size of the RAM memory
-        TMemoryInfoV1Buf ramMemory;
-        UserHal::MemoryInfo(ramMemory);
-    
-        User::LeaveIfError( iEatChunk.CreateGlobal(chunkName, 0, ramMemory().iMaxFreeRamInBytes-1, EOwnerThread) );
-        }
-    
-    // create a temporary file to disk
-    else
-        {
-        // connect to RFs
-        User::LeaveIfError( iFs.Connect() );
-        
-        iFilesCounter = 0;
-        
-        TFileName eatFileName;
-        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, 1 );
-
-        iFs.MkDirAll( eatFileName );
-        User::LeaveIfError( iEatFile.Replace( iFs, eatFileName, EFileWrite ) );
-        iFilesCounter++;        
-        } 
-    
-    iWavyEatMoreMemory = ETrue;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEatManager::DestroyMemoryEat()
-    {
-    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
-        {
-        iEatChunk.Adjust(0);
-        iEatChunk.Close();
-        }
-    else
-        {
-        // close current file
-        
-        iEatFile.Flush();
-        iEatFile.Close();
-
-        // delete created files
-        for ( TInt k = 1; k <= iFilesCounter; k++ )
-            {            
-            TFileName eatFileName;
-            eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, k );
-            iFs.Delete( eatFileName );
-            }
-        iFs.Close();
-        } 
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::EatMemoryL()
-    {
-    // get current sizes
-    TInt64 eatSizeNow(0);
-    TInt sizeNow(0);
-    TInt64 freeSystemMemory(0);
-
-    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
-        {
-        eatSizeNow = iEatChunk.Size(); // get current chunk size
-        }
-    else
-        {
-        User::LeaveIfError( iEatFile.Size( sizeNow ) );
-        if ( iFilesCounter > 1)
-            {
-            eatSizeNow += sizeNow + ( ( iFilesCounter - 1 ) * KMaxEatSize );
-        	}
-        else
-            { 
-            eatSizeNow = sizeNow ; 
-            }
-        }
-    LOGSTRING2("Loadgen:EatMemoryL eatSizeNow = %d", eatSizeNow );
-    
-    freeSystemMemory = ReadFreeMemory();
-    
-    // eat until specific amount of memory at most amount of buffer at a time  
-    if (iAttributes.iType == EMemoryEatTypeMemoryToEat)
-        {
-        // grow partial buffer to match exact amount 
-        if ( ( iAttributes.iAmount - eatSizeNow >= 0 && 
-               iAttributes.iAmount - eatSizeNow < iAttributes.iBuffer ) )
-            {
-               DoEatMemoryL( eatSizeNow + ( iAttributes.iAmount - eatSizeNow ) );
-            }
-        
-        // grow full buffer
-        else if ( eatSizeNow < iAttributes.iAmount )
-            {
-            DoEatMemoryL( eatSizeNow + iAttributes.iBuffer );
-            }
-        // shrink partial buffer to match exact amount
-        else if (eatSizeNow - iAttributes.iAmount >= 0 && eatSizeNow - iAttributes.iAmount < iAttributes.iBuffer)
-            {
-            DoEatMemoryL(eatSizeNow - (eatSizeNow - iAttributes.iAmount));
-            }                
-        
-        // shrink full buffer
-        else if (eatSizeNow > iAttributes.iAmount)
-            {
-            DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
-            }                
-        }
-
-    
-    // eat until specific amount of free memory has been reached at most amount of buffer at a time
-    else if (iAttributes.iType == EMemoryEatTypeMemoryToBeLeft)
-        {
-        // grow partial buffer to match exact amount
-        if (freeSystemMemory - iAttributes.iAmount >= 0 && freeSystemMemory - iAttributes.iAmount < iAttributes.iBuffer)
-            {
-            DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iAmount));
-            }
-
-        // grow full buffer
-        else if (freeSystemMemory > iAttributes.iAmount)
-            {
-            DoEatMemoryL(eatSizeNow + iAttributes.iBuffer);
-            }
-
-        // shrink partial buffer to match exact amount
-        if (iAttributes.iAmount - freeSystemMemory >= 0 && iAttributes.iAmount - freeSystemMemory < iAttributes.iBuffer)
-            {
-            DoEatMemoryL(eatSizeNow - (iAttributes.iAmount - freeSystemMemory));
-            }
-
-        // shrink full buffer
-        else if (freeSystemMemory < iAttributes.iAmount)
-            {
-            DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
-            }
-        }        
-        
-    // wavy memory eat
-    else if (iAttributes.iType == EMemoryEatTypeWavy)
-        {
-        // grow to max value if not under it
-        if (freeSystemMemory > iAttributes.iRandomMax)
-            {
-            DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iRandomMax) + iAttributes.iBuffer);
-            iWavyEatMoreMemory = ETrue; // change direction
-            }
-        
-        // shrink to min value if not below it
-        else if (freeSystemMemory < iAttributes.iRandomMin)
-            {
-            DoEatMemoryL(eatSizeNow - (iAttributes.iRandomMin - freeSystemMemory) - iAttributes.iBuffer);
-            iWavyEatMoreMemory = EFalse; // change direction
-            }                
-        
-        // grow or shrink
-        else
-            {
-            if (iWavyEatMoreMemory)
-                {
-                // grow partial buffer to match exact amount
-                if (freeSystemMemory - iAttributes.iRandomMin >= 0 && freeSystemMemory - iAttributes.iRandomMin < iAttributes.iBuffer)
-                    {
-                    DoEatMemoryL(eatSizeNow + (freeSystemMemory - iAttributes.iRandomMin));
-                    iWavyEatMoreMemory = EFalse; // change direction since limit reached
-                    }
-                
-                // grow full buffer
-                else
-                    {
-                    DoEatMemoryL(eatSizeNow + iAttributes.iBuffer);
-                    }
-                }
-
-            else // shrink
-                {
-                // shrink partial buffer to match exact amount
-                if (iAttributes.iRandomMax - freeSystemMemory >= 0 && iAttributes.iRandomMax - freeSystemMemory < iAttributes.iBuffer)
-                    {
-                    DoEatMemoryL(eatSizeNow - (iAttributes.iRandomMax - freeSystemMemory));
-                    iWavyEatMoreMemory = ETrue; // change direction since limit reached
-                    }                
-                
-                // shrink full buffer
-                else
-                    {
-                    DoEatMemoryL(eatSizeNow - iAttributes.iBuffer);
-                    }                 
-                }
-            }
-        }
-        
-
-    // call timer
-    iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CMemoryEatManager::DoEatMemoryL( TInt64 aNewSize )
-    {
-    // check that new size is in valid range
-    if (aNewSize < 0)
-        {
-        aNewSize = 0;
-        }
-    LOGSTRING2("Loadgen::DoEatMemoryL aNewSize = %d", aNewSize );
-    // set new size
-    if (iAttributes.iSource == EMemoryEatSourceTypeRAM)
-        {
-        TInt err = iEatChunk.Adjust( aNewSize );
-        }
-    else
-        {
-        HandleEatMemoryL( aNewSize );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMemoryEatManager::HandleEatMemoryL( TInt64 aNewSize )
-    {
-    // current size = open file size + full files sizes
-    TInt currentFileSize = 0;        
-    User::LeaveIfError( iEatFile.Size( currentFileSize ) );    
-    TInt64 currentSize = currentFileSize + ( ( iFilesCounter - 1 ) * KMaxEatSize );
-    
-    if ( aNewSize > currentSize ) // increasing
-        {
-        AllocMemoryL( aNewSize );
-        }
-    else if ( aNewSize < currentSize )//decreasing
-        {
-        FreeMemoryL( aNewSize );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-void CMemoryEatManager::AllocMemoryL( TInt64 aNewSize )
-    {
-    LOGSTRING("Loadgen: CMemoryEatManager::AllocMemoryL =>");
-    // size of the file that remains open
-    TInt64 sizeLeft = aNewSize % KMaxEatSize;
-    // amount of the files that is needed
-    TInt64 filesNeeded = aNewSize / KMaxEatSize; 
-    if ( sizeLeft > 0 )
-        {
-        filesNeeded++;
-        }
-
-    if ( filesNeeded > iFilesCounter )
-        {
-        // update current file size to 2 GB
-        User::LeaveIfError( iEatFile.SetSize( KMaxEatSize ) );
-        // close current file
-        iEatFile.Flush();
-        iEatFile.Close();
-        
-        // open new file
-        TFileName eatFileName;
-        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, ++iFilesCounter );
-        
-        iFs.MkDirAll( eatFileName );
-        User::LeaveIfError( iEatFile.Replace( iFs, eatFileName, EFileWrite ) );
-        
-        }
-    User::LeaveIfError( iEatFile.SetSize( sizeLeft ) );
-    LOGSTRING("Loadgen: CMemoryEatManager::AllocMemoryL <=");
-    }
-
-// --------------------------------------------------------------------------------------------
-void CMemoryEatManager::FreeMemoryL( TInt64 aNewSize )    
-    {
-    LOGSTRING("Loadgen: CMemoryEatManager::FreeMemoryL =>");
-    // size of the file that remains open
-    TInt sizeLeft = aNewSize % KMaxEatSize;
-        
-    LOGSTRING2("Loadgen: sizeLeft = %d ",  sizeLeft );
-    // amount of the files that is needed
-    TInt filesNeeded = aNewSize / KMaxEatSize; 
-  
-    if ( filesNeeded == 0 )
-            {
-            filesNeeded = 1;
-            }
-
-    if ( iFilesCounter > 1 && filesNeeded < iFilesCounter )
-        {
-        TFileName eatFileName;
-
-        // close current open file 
-        iEatFile.Flush();
-        iEatFile.Close();
-        // remove file
-        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter-- );
-        iFs.Delete( eatFileName );
-        
-        // remove files not needed
-        while ( iFilesCounter > filesNeeded )
-            {
-            eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter-- );
-            iFs.Delete( eatFileName );
-            }
-
-        // open new file
-        eatFileName.Format( KFilePath, 'B'+iAttributes.iSource, iAttributes.iId, iFilesCounter );
-        User::LeaveIfError( iEatFile.Open( iFs, eatFileName, EFileWrite ) );
-        }
-    User::LeaveIfError( iEatFile.SetSize( sizeLeft ) );
-    LOGSTRING("Loadgen: CMemoryEatManager::FreeMemoryL <=");
-    }
-
-// --------------------------------------------------------------------------------------------
-TInt64 CMemoryEatManager::ReadFreeMemory()    
-    {
-    if ( iAttributes.iSource == EMemoryEatSourceTypeRAM )
-        {   
-        TMemoryInfoV1Buf ramMemory;
-        UserHal::MemoryInfo( ramMemory ); // get available RAM
-        return (TInt64)ramMemory().iFreeRamInBytes;
-        }
-    else
-        {   
-        TVolumeInfo volumeInfo;
-        iFs.Volume( volumeInfo, iAttributes.iSource + 1 ); // get available disk      
-        return volumeInfo.iFree;
-        }
-    }
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/loadgen/src/loadgen_messages.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,978 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_messages.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-#include <e32math.h>
-
-_LIT(KThreadName, "Messages %d");
-_LIT(KMessageSMS, "A test message from LoadGen S60 RnD tool. ");
-_LIT( KMessageSMSType, "SMS" );
-_LIT( KMessageMMSType, "MMS" );
-
-const TInt KTestMessageLength = 42;
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CMessages* CMessages::NewL( TMessageAttributes& aAttributes, TInt aReferenceNumber )
-    {
-    CMessages* self = new(ELeave) CMessages( aAttributes, aReferenceNumber );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CMessages::~CMessages()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CMessages::CMessages( TMessageAttributes& aAttributes, 
-                       TInt aReferenceNumber ) 
-                            : iAttributes( aAttributes )
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessages::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadMessages;
-    
-    TBuf<64> threadName;
-    threadName.Format( KThreadName, iAttributes.iId );
-    
-    // create a thread
-    User::LeaveIfError( iThread.Create( threadName, 
-                                        ThreadFunction, 
-                                        KDefaultStackSize * 2, 
-                                        KMinHeapSize, 
-                                        1024 * KMinHeapSize, 
-                                        (TAny*) &iAttributes ) );
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CMessages::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install( pS );
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad( *( ( TMessageAttributes* ) aThreadArg ) );
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessages::GenerateLoad( TMessageAttributes& aAttributes )
-    {
-    CMessageManager* messagesManager = NULL;
-    TRAPD( err, messagesManager = CMessageManager::NewL( aAttributes ) );
-
-    if ( err == KErrNone )
-        {
-        CActiveScheduler::Start();
-        }
-    delete messagesManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessages::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessages::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessages::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority( CLoadGenModel::SettingItemToThreadPriority( iAttributes.iPriority ) );
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CMessages::Close()
-    {
-    CLoadBase::Close();
-
-    if ( iThread.ExitReason() == 0 ) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete( iAttributes.iDeathStatus, KErrCancel );
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon( waiter );
-        User::WaitForRequest( waiter );
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CMessages::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    TBuf<3> typeBuf;
-    CLoadGenModel::SettingItemToThreadDescription( iAttributes.iPriority, prioBuf );
-    if ( iAttributes.iMessageType == EMessageTypeSMS )
-        {
-        typeBuf.Copy( KMessageSMSType );
-        }
-    else
-        {
-        typeBuf.Copy( KMessageMMSType );
-        }
-    _LIT(KMessagesEntry, "[%d] Type=%S prio=%S dest=%S idle=%dms random=%d%%");
-    buf.Format( KMessagesEntry,  iAttributes.iId, &typeBuf, &prioBuf, &iAttributes.iDestination, 
-                iAttributes.iIdle, iAttributes.iRandomVariance );
-    
-    return TPtrC( buf );
-    }               
-// --------------------------------------------------------------------------------------------
-
-CMessageManager* CMessageManager::NewL( TMessageAttributes& aAttributes )
-    {
-    CMessageManager* self = new(ELeave) CMessageManager( aAttributes );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-CMessageManager::CMessageManager( TMessageAttributes& aAttributes ) :
-    CActive( EPriorityStandard ), iAttributes( aAttributes ), iState( EStateIdle )
-    {
-    iMessageCounter = 0;
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CMessageManager::~CMessageManager()
-    {
-    Cancel();
-    delete iMessage;
-    if ( iPeriodicTimer )
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }
-    if ( iAttributes.iMessageType == EMessageTypeSMS && iSmsHandler )
-        {
-        delete iSmsHandler;
-        }
-    else if ( iMmsHandler )
-        {
-        delete iMmsHandler;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CMessageManager::ConstructL()
-    {
-    CActiveScheduler::Add( this );
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    if ( iAttributes.iAmount > 0 )
-        {
-        iState = EStateSend;
-        }
-    iMessage = HBufC::NewL( iAttributes.iLength );
-    CreateMessage();
-
-    // init SMS sender ao
-    if ( iAttributes.iMessageType == EMessageTypeSMS )
-        {
-        iSmsHandler = CSmsHandler::NewL( *this );
-        }
-    else
-        {
-        iMmsHandler = CMmsHandler::NewL( *this );
-        }
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard );
-    iPeriodicTimer->Start( KDefaultStart, KDefaultPeriod, 
-                        TCallBack( PeriodicTimerCallBack, this ) );
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CMessageManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CMessageManager::DoCancel()
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CMessageManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CMessageManager* self = static_cast<CMessageManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    self->HandleMessageSending();
-
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessageManager::CreateMessage()
-    {
-    // Message body
-    TBuf<KTestMessageLength> mToYou( KMessageSMS );
-    TPtr ptr = iMessage->Des();
-
-    // Take as many characters as user requested to create the message
-    for ( TInt j = 0; j < iAttributes.iLength; j++ )
-          {
-           for ( TInt k = 0; k < KTestMessageLength;  k++ )
-               {
-               ptr.Append( mToYou[k] );
-               j++;
-               if ( j == iAttributes.iLength )
-                   {
-                   break;
-                   }
-               }        
-           }
-    }
-
-
-// --------------------------------------------------------------------------------------------
-
-void CMessageManager::HandleMessageSending()
-    {
-    if ( iState == EStateSend && iAttributes.iDestination.Length() <= KTelephoneNumberMaxLength )
-        {
-        TBool err( KErrNone );        
-
-        // make a new call
-        iState = EStateSending;
- 
-        iMessageCounter++;
-        if ( iAttributes.iMessageType == EMessageTypeSMS )
-            {
-            TRAP( err, iSmsHandler->SendL( iAttributes.iDestination, *iMessage ) );
-            if ( !err )
-                {
-                iState = EStateIdle;
-                iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                            iAttributes.iRandomVariance ), KDefaultPeriod, 
-                            TCallBack( PeriodicTimerCallBack, this ) );
-
-                }
-            }
-        else
-            {
-            TRAP( err, iMmsHandler->SendL( iAttributes.iDestination, *iMessage ) );            
-            if ( err )
-                {
-                HandleStatus( EStateIdle );
-                }
-            }
-        }
-    else
-        {
-        iState = EStateIdle;
-        iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                    iAttributes.iRandomVariance ), KDefaultPeriod, 
-                    TCallBack( PeriodicTimerCallBack, this ) );
-
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CMessageManager::HandleStatus( TInt /*aErr*/ )
-    {
-    // timer after wait
-    if ( iMessageCounter < iAttributes.iAmount )
-        {
-        iState = EStateSend;
-        iPeriodicTimer->Cancel();
-        iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                    iAttributes.iRandomVariance ), KDefaultPeriod, 
-                    TCallBack( PeriodicTimerCallBack, this ) );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-// INCLUDE FILES
-#include <eikenv.h>
-#include <coemain.h>
-#include <e32std.h>
-#include <msvids.h>
-#include <msvstd.h>
-#include <smsclnt.h>
-#include <smut.h>
-#include <mtclreg.h>
-#include <txtrich.h>
-#include <smscmds.h>
-#include <mtmuibas.h>
-#include <mtmdef.h>
-#include <stringloader.h>
-#include "smutset.h"
-#include "smuthdr.h"
- 
- 
- 
-// ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// CSmsHandler::CSmsHandler()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-CSmsHandler::CSmsHandler( CMessageManager& aManager )
-    : CActive( CActive::EPriorityStandard ), iManager( aManager )
-    {
-    CActiveScheduler::Add( this );
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::ConstructL()
-    {
-    // Session to message server is opened asynchronously.
-    iSession = CMsvSession::OpenAsyncL( *this );
- 
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::NewL()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CSmsHandler* CSmsHandler::NewL( CMessageManager& aManager  )
-    {
-    CSmsHandler* self = NewLC( aManager );
-    CleanupStack::Pop( self );
-    return self;
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::NewLC()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CSmsHandler* CSmsHandler::NewLC(  CMessageManager& aManager )
-    {
-    CSmsHandler* self = new ( ELeave ) CSmsHandler( aManager );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
- 
-// ----------------------------------------------------------
-// CSmsHandler::~CSmsHandler()
-// Destructor.
-// ----------------------------------------------------------
-//
-CSmsHandler::~CSmsHandler()
-    {
-    Cancel();           // cancel any outstanding request
- 
-    delete iOperation;
-    delete iMtmUiRegistry;
-    delete iSmsMtm;
-    delete iMtmRegistry;
-    delete iSession;    // session must be deleted last
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::DoCancel()
-// Cancels a request.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::DoCancel()
-    {
-    if ( iOperation )
-        {
-        iOperation->Cancel();
-        }
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::RunL()
-// Handles request completion events.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::RunL()
-    {
-    User::LeaveIfError( iStatus != KErrNone );
- 
-    // Determine the current operations progress.
-    // ProgressL returns an 8 bit descriptor.
-    TBufC8<KMsvProgressBufferLength> progress( iOperation->ProgressL() );
-    _LIT8( KCompare, "KErrNone" );
-    User::LeaveIfError( !progress.Compare( KCompare ) );
- 
-    // The pointer to the current CMsvOperation object is no longer needed.
-    delete iOperation;
-    iOperation = NULL;
- 
-    // Determine which request has finished.
-    switch ( iState )
-        {
-        case EWaitingForMoving:
-            // Once a message is moved to Outbox it is scheduled for sending.
-            ScheduleL();
-            break;
- 
-        case EWaitingForScheduling:
-            {
-            TMsvEntry entry( iSmsMtm->Entry().Entry() );
-            TInt state( entry.SendingState() );
- 
-            if ( state == KMsvSendStateWaiting || state == KMsvSendStateScheduled)
-                {
-                // notify the observer that status has changed
-                iManager.HandleStatus( iStatus.Int() );
-                }
-            break;
-            }
- 
-        default:
-            break;
-        }
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::HandleSessionEventL()
-// Handles notifications of events from the Message Server.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::HandleSessionEventL( TMsvSessionEvent aEvent,
-                                      TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-    {
-    switch ( aEvent )
-        {
-        // Session to server established
-        case EMsvServerReady:
-            {
-            TMsvId serviceId( KUidMsgTypeSMS.iUid ); // SMS service id
- 
-            // Determine if the event was succesful.
-            // ServiceProgress inserts TBuf8 value in progress.
-            TBuf8<KBfrLength> progress;
-            iSession->ServiceProgress( serviceId, progress );
-            _LIT8( KCompare, "KErrNone" );
- 
-            if ( progress.Compare( KCompare ) )
-                {
-                // Check that MtmRegistry has not already been accessed.
-                if ( !iMtmRegistry )
-                    {
-                    AccessMtmL();
-                    }
-                }
-            break;
-            }
- 
-        // All other events are ignored.
-        default:
-            break;
-        }
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::AccessMtmL()
-// Access the MTM Registry and create a SMS specific Client MTM instance.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::AccessMtmL()
-    {
-    // Create an MTM Registry object.
-    iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
- 
-    // Create an SMS Client MTM object.
-    iSmsMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeSMS ) );
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::SendL()
-// Starts the process of creating and sending an SMS message.
-// -----------------------------------------------------------------------------
-//
-TBool CSmsHandler::SendL( const TDesC& aRecipientNumber,
-                            const TDesC& aMessageText )
-    {
-    iRecipientNumber = aRecipientNumber;
-    iMessageText = aMessageText;
- 
-    if ( CreateMsgL() )
-        {
-        return ETrue;
-        }
- 
-    return EFalse;
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::CreateMsgL()
-// Create an SMS message.
-// -----------------------------------------------------------------------------
-//
-TBool CSmsHandler::CreateMsgL()
-    {
-    // Current entry is the Draft folder.
-    iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
- 
-    // Create a new SMS message entry as a child of the current context.
-    iSmsMtm->CreateMessageL( KUidMsgTypeSMS.iUid );
- 
-    CMsvEntry& serverEntry = iSmsMtm->Entry();
-    TMsvEntry entry( serverEntry.Entry() );
- 
-    CRichText& body = iSmsMtm->Body();   // the body of the message
-    body.Reset();
-    // Insert the message text gotten as input from user.
-    body.InsertL( 0, iMessageText );
- 
-    // Message will be sent immediately.
-    entry.SetSendingState( KMsvSendStateWaiting );
- 
-    entry.iDate.UniversalTime(); // insert current time //Solution for HomeTime()
-
-    // Set the SMS message settings for the message.
-    CSmsHeader& header = iSmsMtm->SmsHeader();
-    CSmsSettings* settings = CSmsSettings::NewL();
-    CleanupStack::PushL( settings );
- 
-    settings->CopyL( iSmsMtm->ServiceSettings() );    // restore settings
-    settings->SetDelivery( ESmsDeliveryImmediately ); // to be delivered immediately
-    settings->SetDeliveryReport(ETrue);
-    header.SetSmsSettingsL( *settings );              // new settings
- 
-    // Let's check if there is a service center address.
-    if ( header.Message().ServiceCenterAddress().Length() == 0 )
-        {
-        // No, there isn't. We assume there is at least one service center
-        // number set and use the default service center number.
-        CSmsSettings* serviceSettings = &( iSmsMtm->ServiceSettings() );
- 
-        // Check if number of service center addresses in the list is null.
- 
-        //Changed for 3rd Edition specially
-        if ( !serviceSettings->ServiceCenterCount() )
-            {
-            CleanupStack::PopAndDestroy( settings ); 
-            return EFalse;     // quit creating the message
-            }
- 
-        else
-            {
-            //Changed for 3rd Edition specially            
-            CSmsNumber* smsCenter= CSmsNumber::NewL();
-            CleanupStack::PushL(smsCenter);
-            smsCenter->SetAddressL((serviceSettings->GetServiceCenter( 
-                            serviceSettings->DefaultServiceCenter())).Address());
-            header.Message().SetServiceCenterAddressL( smsCenter->Address() );
-            CleanupStack::PopAndDestroy(smsCenter);
-            }
-        }
- 
-    CleanupStack::PopAndDestroy( settings );
- 
-    // Recipient number is displayed also as the recipient alias.
-    entry.iDetails.Set( iRecipientNumber );
-    // Add addressee.
-    iSmsMtm->AddAddresseeL( iRecipientNumber, entry.iDetails );
- 
-    // Validate message.
-    if ( !ValidateL() )
-        {
-        return EFalse;
-        }
- 
-    entry.SetVisible( ETrue );          // set message as visible
-    entry.SetInPreparation( EFalse );   // set together with the visibility flag
-    serverEntry.ChangeL( entry );       // commit changes        
-    iSmsMtm->SaveMessageL();            // save message
- 
-    TMsvSelectionOrdering selection;
-    CMsvEntry* parentEntry = CMsvEntry::NewL( iSmsMtm->Session(), KMsvDraftEntryId, selection );
-    CleanupStack::PushL( parentEntry );
- 
-    // Move message to Outbox.
-    iOperation =parentEntry->MoveL( entry.Id(), KMsvGlobalOutBoxIndexEntryId, iStatus );
- 
-    CleanupStack::PopAndDestroy( parentEntry );
- 
-    iState = EWaitingForMoving;
-    SetActive();
- 
-    return ETrue;
-  }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::ValidateL()
-// Validate an SMS message.
-// -----------------------------------------------------------------------------
-//
-TBool CSmsHandler::ValidateL()
-    {
-    // Empty part list to hold the result.
-    TMsvPartList result( KMsvMessagePartNone );
- 
-    // Validate message body.
-    result = iSmsMtm->ValidateMessage( KMsvMessagePartBody );
- 
-    if ( result != KMsvMessagePartNone )
-        {
-        return EFalse;
-        }
- 
-    // Validate recipient.
-    result = iSmsMtm->ValidateMessage( KMsvMessagePartRecipient );
- 
-    if ( result != KMsvMessagePartNone )
-        {
-        return EFalse;
-        }
- 
-    return ETrue;
-    }
- 
-// -----------------------------------------------------------------------------
-// CSmsHandler::ScheduleL()
-// Schedule an SMS message for sending.
-// -----------------------------------------------------------------------------
-//
-void CSmsHandler::ScheduleL()
-    {
-    CMsvEntrySelection* selection = new ( ELeave ) CMsvEntrySelection;
-    CleanupStack::PushL( selection );
-    selection->AppendL( iSmsMtm->Entry().EntryId() ); // add message to selection
- 
-    // Add entry to task scheduler.
-    TBuf8<1> dummyParams;   // dummy parameters needed for InvokeAsyncFunctionL
-    iOperation = iSmsMtm->InvokeAsyncFunctionL( ESmsMtmCommandScheduleCopy,
-                          *selection, dummyParams, iStatus );
- 
-    CleanupStack::PopAndDestroy( selection );
- 
-    iState = EWaitingForScheduling;
-    SetActive();
-    }
- 
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-
-
-// INCLUDE FILES
-#include <mtclreg.h>                  // for CClientMtmRegistry 
-#include <msvids.h>                   // for Message type IDs
-#include <mmsclient.h>                // for CMmsClientMtm
-#include <AknQueryDialog.h>           // for CAknTextQueryDialog
-#include <f32file.h>                
-#include <coeutils.h>                  // Check the file exist
-
-#include <CMsvMimeHeaders.h>        //Attachemt mimeheader
-#include <MMsvAttachmentManager.h>    //Attachment manager
-
-// -----------------------------------------------------------------------------
-// CMmsHandler::CSmsHandler()
-// C++ default constructor can NOT contain any code, that might leave.
-// -----------------------------------------------------------------------------
-//
-CMmsHandler::CMmsHandler( CMessageManager& aManager ) : iManager( aManager )
-    {
-    }
- 
-// -----------------------------------------------------------------------------
-// CMmsHandler::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CMmsHandler::ConstructL()
-    {
-    // Session to message server is opened asynchronously.
-    iSession = CMsvSession::OpenAsyncL( *this );
- 
-    }
- 
-// -----------------------------------------------------------------------------
-// CMmsHandler::NewL()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CMmsHandler* CMmsHandler::NewL( CMessageManager& aManager  )
-    {
-    CMmsHandler* self = NewLC( aManager );
-    CleanupStack::Pop( self );
-    return self;
-    }
- 
-// -----------------------------------------------------------------------------
-// CMmsHandler::NewLC()
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CMmsHandler* CMmsHandler::NewLC(  CMessageManager& aManager )
-    {
-    CMmsHandler* self = new ( ELeave ) CMmsHandler( aManager );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
- 
-// ----------------------------------------------------------
-// CMmsHandler::~CSmsHandler()
-// Destructor.
-// ----------------------------------------------------------
-//
-CMmsHandler::~CMmsHandler()
-    {
-    delete iMmsMtm;
-    delete iMtmReg;
-    delete iSession;    // session must be deleted last (and constructed first)
-    }
-
-/*
------------------------------------------------------------------------------
-    CMmsHandler::CompleteConstructL()
-    Creates client MTM registry when session is ready for use. 
-    This completes model construction and is called after 'server
-    ready' event is received after async opening of CMsvSession.
------------------------------------------------------------------------------
-*/
-void CMmsHandler::CompleteConstructL()
-    {
-    // We get a MtmClientRegistry from our session
-    // this registry is used to instantiate new mtms.
-    iMtmReg = CClientMtmRegistry::NewL( *iSession );
-    iMmsMtm = (CMmsClientMtm*)iMtmReg->NewMtmL( KUidMsgTypeMultimedia );
-    }
-   
-/*
------------------------------------------------------------------------------
-    CMmsHandler::HandleSessionEventL()
-
-    Receives session events from observer and calls event handling functions. 
-    Note that if additional session event handlers are defined 
-    in the session, they are called before this function (as this is the
-    main session observer).
-    The type of event is indicated by the value of aEvent. The 
-    interpretation of the TAny arguments depends on this type. 
------------------------------------------------------------------------------
-*/
-void CMmsHandler::HandleSessionEventL(TMsvSessionEvent aEvent, 
-                                        TAny* /*aArg1*/, 
-                                        TAny* /*aArg2*/, 
-                                        TAny* /*aArg3*/)
-    {
-    switch ( aEvent )
-        {
-        // This event tells us that the session has been opened
-        case EMsvServerReady:
-            {
-            CompleteConstructL();       // Construct the mtm registry & MMS mtm
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSmsHandler::SendL()
-// Starts the process of creating and sending an SMS message.
-// -----------------------------------------------------------------------------
-//
-TBool CMmsHandler::SendL( const TDesC& aRecipientNumber,
-                            const TDesC& aMessageText )
-    {
-    TInt result( EFalse );
-    
-    iRecipientNumber = aRecipientNumber;
-    iMessageText = aMessageText;
- 
-    if ( CreateMsgL() )
-        {
-        if ( SendMessageL() )
-            {
-            result = ETrue;
-            }
-        }
- 
-    return result;
-    }
-
-/*
------------------------------------------------------------------------------
-    CMmsHandler::CreateMsgL()
-    Creates a new message server entry and set up default values.
-    In case the attachment file does not found method return EFalse
-    otherwise ETrue.
-    There are differenses how to add attachment file between 2nd and 3rd edition. 
------------------------------------------------------------------------------
-*/
-TBool CMmsHandler::CreateMsgL()
-    {
-
-    // - CMsvEntry accesses and acts upon a particular Message Server entry.
-    // - NewL() does not create a new entry, but simply a new object to access an existing entry.
-    // - It takes in as parameters the client's message server session,
-    //   ID of the entry to access and initial sorting order of the children of the entry. 
-    CMsvEntry* entry = CMsvEntry::NewL( *iSession, 
-                                        KMsvGlobalOutBoxIndexEntryId, 
-                                        TMsvSelectionOrdering() );
-    CleanupStack::PushL( entry );
-
-    // Set context to the parent folder (Outbox)
-    iMmsMtm->SwitchCurrentEntryL( entry->EntryId() );
-    
-    // Create new message in the parent folder (Outbox) and set it as the current context.
-    iMmsMtm->CreateMessageL( iMmsMtm->DefaultServiceL() );
-
-    CleanupStack::PopAndDestroy( entry ); 
-    
-    // Setting recipients
-    // use this to add the "To" recipients.
-    iMmsMtm->AddAddresseeL( iRecipientNumber );
-    
-    //Setting message subject
-    _LIT(KMessageSubject, "MMS Message");
-    iMmsMtm->SetSubjectL( KMessageSubject );
-    
-    // add message text
-    SetMessageBodyL();
-   
-    TMsvEntry ent = iMmsMtm->Entry().Entry();
-    // Set InPreparation to false
-    ent.SetInPreparation( EFalse );
-    ent.SetVisible( ETrue );            // mark as visible, after this the message can be seen in Outbox and, after sending, in Sent folder.
-  
-    iMmsMtm->Entry().ChangeL( ent );    // Commit changes
-    
-    //Save the changes
-    iMmsMtm->SaveMessageL();
-    
-    return ETrue;
-    }
-
-//---------------------------------------------------------------------------------
-void CMmsHandler::SetMessageBodyL()
-    {
-    _LIT (KFilenameText, "msg.txt");
-    CMsvStore* store = iMmsMtm->Entry().EditStoreL();
-    CleanupStack::PushL( store );
-
-    TMsvAttachmentId attachmentId = KMsvNullIndexEntryId;
-
-    iMmsMtm->CreateTextAttachmentL ( *store,
-                                     attachmentId,
-                                     iMessageText,
-                                     KFilenameText );
-
-    store->CommitL();
-
-    CleanupStack::PopAndDestroy( store );
-    }
-
-/* 
------------------------------------------------------------------------------
-    CMmsHandler::SendMessageL()
-    Sends the message.
-    Return values: ETrue or EFalse
------------------------------------------------------------------------------
-*/
-TBool CMmsHandler::SendMessageL()
-    {
-
-    // Start sending the message via the Server MTM to the MMS server
-    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-    wait->iStatus = KRequestPending;
-    CMsvOperation* op = NULL;
-       op = iMmsMtm->SendL( wait->iStatus );
-    wait->Start();
-    CleanupStack::PushL( op );
-    CActiveScheduler::Start();
-
-    // The following is to ignore the completion of other active objects. It is not
-    // needed if the app has a command absorbing control.
-    while( wait->iStatus == KRequestPending )
-        {
-        CActiveScheduler::Start();
-        }
-
-    iManager.HandleStatus( wait->iStatus.Int() );
-    CleanupStack::PopAndDestroy(2); // op, wait
-    
-    return ETrue;
-    }
-// End of File
--- a/loadgen/src/loadgen_model.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1140 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_cpuload.h"
-#include "loadgen_memoryeat.h"
-#include "loadgen_phonecall.h"
-#include "loadgen_netconn.h"
-#include "loadgen_keypress.h"
-#include "loadgen_pointerevent.h"
-#include "loadgen_messages.h"
-#include "loadgen_applications.h"
-#include "loadgen_photocapture.h"
-#include "loadgen_bluetooth.h"
-
-#include "loadgen_traces.h"
-#include "loadgen_editors.h"
-#include "loadgen_loadattributes.h"
-#include "loadgen_model.h"
-#include "loadgen_app.h"
-#include "loadgen_settingsviewdlg.h"
-#include "loadgen_maincontainer.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <coeutils.h>
-#include <bautils.h>
-#include <eikenv.h>
-#include <aknquerydialog.h>
-#include <e32math.h> 
-#include <u32hal.h>
-#include <hal.h> 
-#include <hal_data.h>
-
-#include <ECam.h>
-#include <aknnotewrappers.h>
-#include <featdiscovery.h>
-
-inline TInt64 INIT_SEED()
-{
-    TTime now; 
-    now.HomeTime(); 
-    return now.Int64();
-}
-
-TInt64 CLoadGenModel::iRandomNumberSeed = INIT_SEED();
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CLoadGenModel* CLoadGenModel::NewL()
-    {
-    CLoadGenModel* self = new(ELeave) CLoadGenModel;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenModel::CLoadGenModel() : CActive(EPriorityStandard)
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::ConstructL()
-    {
-    iDrawState = EDrawStateInvalid;
-    iReferenceNumber = 0;
-    
-    iEnv = CEikonEnv::Static();
-    User::LeaveIfError(iLs.Connect());
-    
-    iLoadItemList = new(ELeave) CLoadItemList(64);
-
-    User::LeaveIfError(iTimer.CreateLocal());
-    CActiveScheduler::Add(this);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::ActivateModelL()
-    {
-    // load settings
-    //TRAP_IGNORE(LoadSettingsL());
-
-    // set defaults to attributes
-    iCpuLoadAttributes.iId = 0;
-    iCpuLoadAttributes.iPriority = EThreadPriorityTypeNormal;
-    iCpuLoadAttributes.iMode = ECpuLoadModeYielding;
-    iCpuLoadAttributes.iType = ECpuLoadTypePeriodic;
-    iCpuLoadAttributes.iLength = 4000;
-    iCpuLoadAttributes.iIdle = 2000;
-    iCpuLoadAttributes.iRandomVariance = 0;
-    iCpuLoadAttributes.iCpu = KCPUSelection_FreeScheduling; // set CPU as "undefined" (can be >= 0 only in SMP environments)
-    iCpuLoadAttributes.iCpuCount = UserSvr::HalFunction(EHalGroupKernel, KHalFunction_EKernelHalNumLogicalCpus, 0, 0);
-    if( iCpuLoadAttributes.iCpuCount < 1 || iCpuLoadAttributes.iCpuCount > KMaxCPUs )
-        {
-        // HAL may not support this function, so let's use CPU count 1:
-        iCpuLoadAttributes.iCpuCount = 1;
-        }
-    iMemoryEatAttributes.iId = 0;
-    iMemoryEatAttributes.iPriority = EThreadPriorityTypeNormal;
-    iMemoryEatAttributes.iSource = 0;
-    iMemoryEatAttributes.iType = EMemoryEatTypeMemoryToBeLeft;
-    iMemoryEatAttributes.iBuffer = 16*1024;
-    iMemoryEatAttributes.iIdle = 0;
-    iMemoryEatAttributes.iAmount = 0;
-    iMemoryEatAttributes.iRandomMin = 1000000;
-    iMemoryEatAttributes.iRandomMax = 1500000;
-    iMemoryEatAttributes.iAmountDes.Copy(KNullDesC);
-    iMemoryEatAttributes.iRandomMinDes.Copy(KNullDesC);
-    iMemoryEatAttributes.iRandomMaxDes.Copy(KNullDesC);
-    iMemoryEatAttributes.iRandomVariance = 0;
-
-    iPhoneCallAttributes.iId = 0;
-    iPhoneCallAttributes.iPriority = EThreadPriorityTypeNormal;
-    iPhoneCallAttributes.iDestination.Copy(_L("+358"));
-    iPhoneCallAttributes.iLength = 60000;
-    iPhoneCallAttributes.iIdle = 10000;
-    iPhoneCallAttributes.iRandomVariance = 0;
-
-    iNetConnAttributes.iId = 0;
-    iNetConnAttributes.iPriority = EThreadPriorityTypeNormal;
-    iNetConnAttributes.iDestination.Copy(_L("http://www.nokia.com"));
-    iNetConnAttributes.iIdle = 10000;
-    iNetConnAttributes.iRandomVariance = 0;
-
-    iKeyPressAttributes.iId = 0;
-    iKeyPressAttributes.iPriority = EThreadPriorityTypeNormal;
-    iKeyPressAttributes.iHeartBeat = 100;
-    iKeyPressAttributes.iRandomVariance = 0;
-    
-    iPointerEventAttributes.iId = 0;
-    iPointerEventAttributes.iPriority = EThreadPriorityTypeNormal;
-    iPointerEventAttributes.iHeartBeat = 1000;
-    iPointerEventAttributes.iRandomVariance = 0;
-
-    iMessageAttributes.iId = 0;
-    iMessageAttributes.iPriority = EThreadPriorityTypeNormal;
-    iMessageAttributes.iMessageType = EMessageTypeSMS;
-    iMessageAttributes.iDestination.Copy(_L("+358"));
-    iMessageAttributes.iAmount = 5;
-    iMessageAttributes.iLength = 160;
-    iMessageAttributes.iIdle = 15000;
-    iMessageAttributes.iRandomVariance = 0;
-    
-    iApplicationsAttributes.iId = 0;
-    iApplicationsAttributes.iLaunchingInterval = 2000;
-    iApplicationsAttributes.iPriority = EThreadPriorityTypeNormal;
-    iApplicationsAttributes.iKeyPressType = EApplicationsKeyPressTypeNone;
-    iApplicationsAttributes.iMaxOpen = 20;
-    iApplicationsAttributes.iHeartBeat = 50;
-    iApplicationsAttributes.iRandomVariance = 0;
-    
-    iPhotoCaptureAttributes.iId = 0;
-    iPhotoCaptureAttributes.iPriority = EThreadPriorityTypeNormal;
-    iPhotoCaptureAttributes.iIdle = 10000;
-    iPhotoCaptureAttributes.iRandomVariance = 0;        
-    iPhotoCaptureAttributes.iCameraCount = CCamera::CamerasAvailable();
-    if(iPhotoCaptureAttributes.iCameraCount > 0)
-        {
-        iPhotoCaptureAttributes.iCamera = 0; // Main camera
-        }
-    else
-        {
-        iPhotoCaptureAttributes.iCamera = -1;
-        }
-    
-    iBluetoothAttributes.iId = 0;
-    iBluetoothAttributes.iPriority = EThreadPriorityTypeNormal;
-    iBluetoothAttributes.iIdle = 10000;
-    iBluetoothAttributes.iRandomVariance = 0;
-    iBluetoothAttributes.iBluetoothSupported = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdBt);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::DeActivateModelL()
-    {
-    Cancel();
-    
-    // for a faster exit, send the application to background
-    TApaTask selfTask(iEnv->WsSession());
-    selfTask.SetWgId(iEnv->RootWin().Identifier());
-    selfTask.SendToBackground();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-CLoadGenModel::~CLoadGenModel()
-    {
-    if (iLoadItemList)
-        {
-        DeleteAllLoadItems();
-        delete iLoadItemList;
-        }
-    if ( iApplicationsAttributes.iAppsArray )
-        {
-        delete iApplicationsAttributes.iAppsArray;
-        }
-    iTimer.Close();
-    iLs.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::DoCancel()
-    {
-    iTimer.Cancel();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::RunL()
-    {
-    // continue    
-    //iTimer.After(iStatus, 400000);
-    //SetActive();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SetMainContainer(CLoadGenMainContainer* aContainer)
-    {
-    iMainContainer = aContainer;
-    iDrawState = EDrawStateMain;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::StartNewLoadL(TInt aCommand)
-    {
-    // show new load query
-    CLoadGenLoadTypeEditorBase* dlg = NULL;
-
-    switch ( aCommand )
-        {
-        case ELoadGenCmdNewLoadCPULoad:
-            {
-            dlg = CLoadGenCPULoadEditor::NewL(iCpuLoadAttributes);
-            break;
-            }
-        case ELoadGenCmdNewLoadEatMemory:
-            {
-            dlg = CLoadGenMemoryEatEditor::NewL(iMemoryEatAttributes);
-            break;
-            }
-        case ELoadGenCmdNewLoadPhoneCall:
-            {
-            dlg = CLoadGenPhoneCallEditor::NewL(iPhoneCallAttributes);
-            break;
-            }
-        case ELoadGenCmdNewLoadNetConn:
-            {
-            dlg = CLoadGenNetConnEditor::NewL(iNetConnAttributes);
-            break;
-            }
-        case ELoadGenCmdNewLoadKeyPress:
-            {
-            dlg = CLoadGenKeyPressEditor::NewL(iKeyPressAttributes);
-            break;
-            }               
-        case ELoadGenCmdNewLoadMessages:
-            {
-            dlg = CLoadGenMessagesEditor::NewL( iMessageAttributes );
-            break;
-            }
-        case ELoadGenCmdNewLoadApplications:
-            {
-            dlg = CLoadGenApplicationsEditor::NewL( iApplicationsAttributes );
-            break;
-            }
-        case ELoadGenCmdNewLoadPhotoCaptures:
-            {
-            if( iPhotoCaptureAttributes.iCameraCount > 0 )
-                {
-                dlg = CLoadGenPhotoCaptureEditor::NewL( iPhotoCaptureAttributes );
-                }
-            else
-                {
-                _LIT(message, "Cameras not available");
-                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-                errorNote->ExecuteLD(message);
-                return;
-                }
-            break;
-            }
-        case ELoadGenCmdNewLoadBluetooth:
-            {
-            if( iBluetoothAttributes.iBluetoothSupported )
-                {
-                dlg = CLoadGenBluetoothEditor::NewL(iBluetoothAttributes);                
-                }
-            else
-                {
-                _LIT(message, "Bluetooth device not available");
-                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
-                errorNote->ExecuteLD(message);
-                return;
-                }
-            break;
-            }
-        case ELoadGenCmdNewLoadPointerEvent:
-            {
-            dlg = CLoadGenPointerEventEditor::NewL(iPointerEventAttributes);
-            break;
-            } 
-
-        default:
-            {
-            User::Panic(_L("Wrong new load"), 111);
-            break;
-            }
-        }
-
-    TBool dlgResult = dlg->RunQueryLD();
-
-    // set back title
-    if (iMainContainer)
-        iMainContainer->SetDefaultTitlePaneTextL();
-
-    // start creating new load if dialog accepted
-    if (dlgResult)
-        {
-        DoStartNewLoadL(aCommand);
-        }
-
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::EditLoadL(CLoadBase* aItem)
-    {
-    // suspend current
-    aItem->Suspend();
-    
-    // show new load query
-    CLoadGenLoadTypeEditorBase* dlg = NULL;
-
-    switch ( aItem->Type() )
-        {
-        case ELoadGenCmdNewLoadCPULoad:
-            {
-            dlg = CLoadGenCPULoadEditor::NewL(static_cast<CCPULoad*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        case ELoadGenCmdNewLoadEatMemory:
-            {
-            dlg = CLoadGenMemoryEatEditor::NewL(static_cast<CMemoryEat*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        case ELoadGenCmdNewLoadPhoneCall:
-            {
-            dlg = CLoadGenPhoneCallEditor::NewL(static_cast<CPhoneCall*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        case ELoadGenCmdNewLoadNetConn:
-            {
-            dlg = CLoadGenNetConnEditor::NewL(static_cast<CNetConn*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        case ELoadGenCmdNewLoadKeyPress:
-            {
-            dlg = CLoadGenKeyPressEditor::NewL(static_cast<CKeyPress*>(aItem)->Attributes(), ETrue);
-            break;
-            }       
-        case ELoadGenCmdNewLoadMessages:
-            {
-            dlg = CLoadGenMessagesEditor::NewL(static_cast<CMessages*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        case ELoadGenCmdNewLoadApplications:
-            {
-            dlg = CLoadGenApplicationsEditor::NewL( static_cast<CAppLauncher*>(aItem)->Attributes(), ETrue );
-            break;
-            }
-        case ELoadGenCmdNewLoadPhotoCaptures:
-            {
-            dlg = CLoadGenPhotoCaptureEditor::NewL( static_cast<CPhotoCapture*>(aItem)->Attributes(), ETrue );
-            break;
-            }
-        case ELoadGenCmdNewLoadBluetooth:
-            {
-            dlg = CLoadGenBluetoothEditor::NewL( static_cast<CBluetooth*>(aItem)->Attributes(), ETrue );
-            break;
-            }
-        case ELoadGenCmdNewLoadPointerEvent:
-            {
-            dlg = CLoadGenPointerEventEditor::NewL(static_cast<CPointerEvent*>(aItem)->Attributes(), ETrue);
-            break;
-            }
-        default:
-            {
-            User::Panic(_L("Wrong edit load"), 114);
-            break;
-            }
-        }
-
-    TBool dlgResult = dlg->RunQueryLD();
-
-    // set back title
-    if (iMainContainer)
-        iMainContainer->SetDefaultTitlePaneTextL();
-    
-    // change priority of the load item
-    aItem->SetPriority();
-
-    // resume execution the item
-    aItem->Resume();
-    
-    if (dlgResult)
-        RefreshViewL(EFalse);
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::DoStartNewLoadL(TInt aCommand)
-    {
-    CLoadBase* item = NULL;
-    
-    switch ( aCommand )
-        {
-        case ELoadGenCmdNewLoadCPULoad:
-            {
-            if( iCpuLoadAttributes.iCpu == KCPUSelection_AllCPUs )
-                {
-                // Call this function recursively for all CPUs:
-                for( TUint i = 0; i < iCpuLoadAttributes.iCpuCount; ++i )
-                    {                    
-                    iCpuLoadAttributes.iCpu = i;
-                    DoStartNewLoadL(aCommand);
-                    }
-                // And finally set user selection back to "All CPUs"
-                iCpuLoadAttributes.iCpu = KCPUSelection_AllCPUs;
-                return;
-                }
-            else
-                {
-                item = CCPULoad::NewL(iCpuLoadAttributes, iReferenceNumber);
-                }
-            break;
-            }
-        case ELoadGenCmdNewLoadEatMemory:
-            {
-            item = CMemoryEat::NewL(iMemoryEatAttributes, iReferenceNumber);
-            break;
-            }
-        case ELoadGenCmdNewLoadPhoneCall:
-            {
-            item = CPhoneCall::NewL(iPhoneCallAttributes, iReferenceNumber);
-            break;
-            }
-        case ELoadGenCmdNewLoadNetConn:
-            {
-            item = CNetConn::NewL(iNetConnAttributes, iReferenceNumber);
-            break;
-            }
-        case ELoadGenCmdNewLoadKeyPress:
-            {
-            item = CKeyPress::NewL(iKeyPressAttributes, iReferenceNumber);
-            break;
-            }        
-        case ELoadGenCmdNewLoadMessages:
-            {
-            item = CMessages::NewL( iMessageAttributes, iReferenceNumber );
-            break;
-            }
-        case ELoadGenCmdNewLoadApplications:
-            {
-            iApplicationsAttributes.iAppsArray = ListOfAllAppsL();
-            item = CAppLauncher::NewL( iApplicationsAttributes, iReferenceNumber );            
-            break;
-            }
-        case ELoadGenCmdNewLoadPhotoCaptures:
-            {
-            item = CPhotoCapture::NewL( iPhotoCaptureAttributes, iReferenceNumber);
-            break;
-            }
-        case ELoadGenCmdNewLoadBluetooth:
-            {
-            item = CBluetooth::NewL( iBluetoothAttributes, iReferenceNumber);            
-            break;
-            }
-        case ELoadGenCmdNewLoadPointerEvent:
-            {
-            item = CPointerEvent::NewL(iPointerEventAttributes, iReferenceNumber);
-            break;
-            }
-            
-        default:
-            {
-            User::Panic(_L("Wrong new load"), 112);
-            break;
-            }
-        }
-    
-    iReferenceNumber++;
-
-    // add item to the array
-    AppendToLoadItemListL(item);
-
-    // update the listbox
-    RefreshViewL(EFalse);
-
-    // set item index to the end
-    iMainContainer->ListBox()->SetCurrentItemIndexAndDraw( iMainContainer->ListBox()->Model()->NumberOfItems()-1 );
-
-    // start the load
-    item->Resume();
-        
-    // refresh again
-    RefreshViewL(EFalse);    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-
-void CLoadGenModel::StopAllLoadItemsL()
-    {
-    DeleteAllLoadItems();
-    
-    RefreshViewL();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SuspendAllLoadItemsL()
-    {
-    for (TInt i=0; i<LoadItemCount(); i++)
-        {
-        if ( iLoadItemList->At(i) )
-            {
-            iLoadItemList->At(i)->Suspend();
-            }
-        }
-        
-    RefreshViewL();    
-    }
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::ResumeAllLoadItemsL()
-    {
-    for (TInt i=0; i<LoadItemCount(); i++)
-        {
-        if ( iLoadItemList->At(i) )
-            {
-            iLoadItemList->At(i)->Resume();
-            }
-        }
-
-    RefreshViewL();    
-    }    
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::RefreshViewL(TBool aClearSelection)
-    {
-    if (iMainContainer && iDrawState == EDrawStateMain && iMainContainer->ListBox())
-        {
-        // clear selections if any
-        iMainContainer->ListBox()->ClearSelection();
-        
-        // set item index to 0
-        if (aClearSelection)
-            iMainContainer->ListBox()->SetCurrentItemIndex(0); 
-        
-        // set text items
-        iMainContainer->SetListBoxTextArrayL(GenerateListBoxItemTextArrayL());
-        }
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::AppendToLoadItemListL(CLoadBase* aItem)
-    {
-    if (iLoadItemList)
-        iLoadItemList->AppendL( aItem );
-    else
-        User::Leave(KErrNotReady);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::DeleteFromLoadItemListL(TInt aIndex)
-    {
-    if (iLoadItemList)
-        {
-        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
-            {
-            // first call delete on the item
-            if (iLoadItemList->At(aIndex))
-                {                                
-                delete iLoadItemList->At(aIndex);
-                iLoadItemList->At(aIndex) = NULL;
-                }
-            
-            // and them remove the array entry
-            iLoadItemList->Delete(aIndex);
-            iLoadItemList->Compress();
-            }
-        else
-            User::Leave(KErrNotFound);
-        }
-    else
-        User::Leave(KErrNotReady);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SuspendOrResumeFromLoadItemListL(TInt aIndex)
-    {
-    if (iLoadItemList)
-        {
-        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
-            {
-            if (iLoadItemList->At(aIndex))
-                {
-                if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateRunning)
-                    {
-                    iLoadItemList->At(aIndex)->Suspend();
-                    }
-                else if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateSuspended)
-                    {
-                    iLoadItemList->At(aIndex)->Resume();
-                    }
-                }
-            }
-        else
-            User::Leave(KErrNotFound);
-        }
-    else
-        User::Leave(KErrNotReady);
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenModel::LoadItemCount() const
-    {
-    TInt count(0);
-    
-    if (iLoadItemList)
-        count = iLoadItemList->Count();
-    
-    return count;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::DeleteAllLoadItems()
-    {
-    // call delete for each entry and free memory allocated for the array
-    for (TInt i=0; i<LoadItemCount(); i++)
-        {
-        if ( iLoadItemList->At(i) )
-            {            
-            delete iLoadItemList->At(i);
-            iLoadItemList->At(i) = NULL;
-            }
-        }
-        
-    iLoadItemList->Reset();    
-    }  
-          
-// --------------------------------------------------------------------------------------------
-
-CDesCArray* CLoadGenModel::GenerateListBoxItemTextArrayL()
-    {
-    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(64);
-    CleanupStack::PushL(textArray);
-
-    _LIT(KEntryTemplateRedIcon,   "1\t%S\t\t");
-    _LIT(KEntryTemplateGreenIcon, "2\t%S\t\t");
-    
-    for (TInt i=0; i<LoadItemCount(); i++)
-        {
-        // add description from each entry
-        TBuf<256> textEntry;
-        TBuf<256> description = iLoadItemList->At(i)->Description();
-        
-        if (iLoadItemList->At(i)->State() == CLoadBase::ELoadStateRunning)
-            textEntry.Format(KEntryTemplateGreenIcon, &description);
-        else
-            textEntry.Format(KEntryTemplateRedIcon, &description);
-        
-        textArray->AppendL(textEntry);
-        }    
-    
-    CleanupStack::Pop(); //textArray
-    return textArray;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::ShowItemActionMenuL()
-    {
-    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
-    
-    if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
-        {
-        // show a query dialog    
-        TInt queryIndex(0);
-        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
-
-        if (listQueryDlg->ExecuteLD(R_ITEM_ACTION_QUERY))
-            {
-            // stop
-            if (queryIndex == EItemActionMenuTypeStop)
-                {
-                StopSelectedOrHighlightedItemsL();
-                }
-            
-            // suspend or resume
-            else if (queryIndex == EItemActionMenuTypeSuspendResume)
-                {
-                SuspendOrResumeSelectedOrHighlightedItemsL();
-                }
-                           
-            // edit
-            else if (queryIndex == EItemActionMenuTypeEdit)
-                {
-                EditLoadL(iLoadItemList->At(currentItemIndex));
-                }
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::StopSelectedOrHighlightedItemsL()
-    {
-    const CArrayFix<TInt>* selectionIndexes = iMainContainer->ListBoxSelectionIndexes();
-
-    TInt err(KErrNone);
-
-    // by default use selected items
-    if (selectionIndexes && selectionIndexes->Count() > 0)
-        {
-        CAknQueryDialog* query = CAknQueryDialog::NewL();
-        _LIT(KQueryMessage, "Stop %d selections?");
-        TFileName queryMsg;
-        queryMsg.Format(KQueryMessage, selectionIndexes->Count());
-        
-
-        if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, queryMsg))
-            {
-            TInt deleteIndexCounter(0);
-            TInt ref(0);
-            TKeyArrayFix key(0, ECmpTUint16);
-            TInt index(0);
-            
-            TInt loadCount = LoadItemCount();
-
-            for (TInt i=0; i<loadCount; i++)
-                {
-                ref = i;
-
-                if (selectionIndexes->Find(ref, key, index) == 0)  
-                    {
-                    TRAP(err, DeleteFromLoadItemListL(i-deleteIndexCounter));
-                    deleteIndexCounter++; // amount of indexes decreases after each delete
-                    }
-                }
-            
-            RefreshViewL();
-            User::LeaveIfError(err);
-            }
-        }
-    
-    // or if none selected, use the current item index
-    else
-        {
-        TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
-        
-        if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
-            {
-            CAknQueryDialog* query = CAknQueryDialog::NewL();
-           _LIT(KQueryMessage, "Stop hightlighted item?");
-
-            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, KQueryMessage))
-                {
-                TRAP(err, DeleteFromLoadItemListL(currentItemIndex));
-                
-                RefreshViewL();
-                User::LeaveIfError(err);
-                }
-            }
-        }  
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SuspendOrResumeSelectedOrHighlightedItemsL()
-    {
-    const CArrayFix<TInt>* selectionIndexes = iMainContainer->ListBoxSelectionIndexes();
-
-    // by default use selected items
-    if (selectionIndexes && selectionIndexes->Count() > 0)
-        {
-        TInt ref(0);
-        TKeyArrayFix key(0, ECmpTUint16);
-        TInt index(0);
-
-        for (TInt i=0; i<LoadItemCount(); i++)
-            {
-            ref = i;
-
-            if (selectionIndexes->Find(ref, key, index) == 0)  
-                {
-                SuspendOrResumeFromLoadItemListL(i);
-                }
-            }
-        
-        RefreshViewL(EFalse);
-        }
-    
-    // or if none selected, use the current item index
-    else
-        {
-        TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
-        
-        if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
-            {
-            SuspendOrResumeFromLoadItemListL(currentItemIndex);
-            
-            RefreshViewL(EFalse);
-            }
-        }  
-    }                                
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::LoadSettingsL()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SaveSettingsL()
-    {
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenModel::LaunchSettingsDialogL()
-    {
-    return 0;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TThreadPriority CLoadGenModel::SettingItemToThreadPriority(TInt aIndex)
-    {
-    TThreadPriority threadPriority = EPriorityNull;
-    
-    switch ( aIndex )
-        {
-        case EThreadPriorityTypeMuchLess:
-            {
-            threadPriority = EPriorityMuchLess; break;
-            }
-        case EThreadPriorityTypeLess:
-            {
-            threadPriority = EPriorityLess; break;
-            }
-        case EThreadPriorityTypeNormal:
-            {
-            threadPriority = EPriorityNormal; break;
-            }
-        case EThreadPriorityTypeMore:
-            {
-            threadPriority = EPriorityMore; break;
-            }
-        case EThreadPriorityTypeMuchMore:
-            {
-            threadPriority = EPriorityMuchMore; break;
-            }
-        case EThreadPriorityTypeRealTime:
-            {
-            threadPriority = EPriorityRealTime; break;
-            }
-        case EThreadPriorityTypeAbsoluteVeryLow:
-            {
-            threadPriority = EPriorityAbsoluteVeryLow; break;
-            }
-        case EThreadPriorityTypeAbsoluteLow:
-            {
-            threadPriority = EPriorityAbsoluteLow; break;
-            }
-        case EThreadPriorityTypeAbsoluteBackground:
-            {
-            threadPriority = EPriorityAbsoluteBackground; break;
-            }
-        case EThreadPriorityTypeAbsoluteForeground:
-            {
-            threadPriority = EPriorityAbsoluteForeground; break;
-            }
-        case EThreadPriorityTypeAbsoluteHigh:
-            {
-            threadPriority = EPriorityAbsoluteHigh; break;
-            }
-
-        default:
-            {
-            User::Panic(_L("Wrong tp index"), 276);
-            break;
-            }
-        }
-
-    return threadPriority;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SettingItemToThreadDescription(TInt aIndex, TDes& aBuf)
-    {
-    switch ( aIndex )
-        {
-        case EThreadPriorityTypeMuchLess:
-            {
-            aBuf.Append(_L("ML(-20)")); break;
-            }
-        case EThreadPriorityTypeLess:
-            {
-            aBuf.Append(_L("L(-10)")); break;
-            }
-        case EThreadPriorityTypeNormal:
-            {
-            aBuf.Append(_L("NO(0)")); break;
-            }
-        case EThreadPriorityTypeMore:
-            {
-            aBuf.Append(_L("M(10)")); break;
-            }
-        case EThreadPriorityTypeMuchMore:
-            {
-            aBuf.Append(_L("MM(20)")); break;
-            }
-        case EThreadPriorityTypeRealTime:
-            {
-            aBuf.Append(_L("RL(30)")); break;
-            }
-        case EThreadPriorityTypeAbsoluteVeryLow:
-            {
-            aBuf.Append(_L("AVL(100)")); break;
-            }
-        case EThreadPriorityTypeAbsoluteLow:
-            {
-            aBuf.Append(_L("AL(200)")); break;
-            }
-        case EThreadPriorityTypeAbsoluteBackground:
-            {
-            aBuf.Append(_L("ABG(300)")); break;
-            }
-        case EThreadPriorityTypeAbsoluteForeground:
-            {
-            aBuf.Append(_L("AFG(400)")); break;
-            }
-        case EThreadPriorityTypeAbsoluteHigh:
-            {
-            aBuf.Append(_L("AH(500)")); break;
-            }
-
-        default:
-            {
-            User::Panic(_L("Wrong td index"), 277);
-            break;
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenModel::SettingItemToSourceDescription(TInt aIndex, TDes& aBuf)
-    {
-    switch ( aIndex )
-        {
-        case EMemoryEatSourceTypeRAM:
-            {
-            aBuf.Append(_L("RAM")); break;
-            }
-        case EMemoryEatSourceTypeDriveC:
-            {
-            aBuf.Append(_L("C:")); break;
-            }
-        case EMemoryEatSourceTypeDriveD:
-            {
-            aBuf.Append(_L("D:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveE:
-            {
-            aBuf.Append(_L("E:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveF:
-            {
-            aBuf.Append(_L("F:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveG:
-            {
-            aBuf.Append(_L("G:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveH:
-            {
-            aBuf.Append(_L("H:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveI:
-            {
-            aBuf.Append(_L("I:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveJ:
-            {
-            aBuf.Append(_L("J:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveK:
-            {
-            aBuf.Append(_L("K:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveL:
-            {
-            aBuf.Append(_L("L:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveM:
-            {
-            aBuf.Append(_L("M:")); break;
-            }            
-        case EMemoryEatSourceTypeDriveN:
-            {
-            aBuf.Append(_L("N:")); break;
-            }            
-
-        default:
-            {
-            User::Panic(_L("Wrong src index"), 278);
-            break;
-            }
-        }
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenModel::MilliSecondsToMicroSeconds(TInt aMilliSeconds, TInt aRandomVariance)
-    {
-    __ASSERT_ALWAYS(aRandomVariance >= 0 && aRandomVariance <= 100, User::Panic(_L("Inv.var."), 180));
-    __ASSERT_ALWAYS(aMilliSeconds >=0, User::Panic(_L("Inv.ms."), 181));
-    
-    // if no variance defined, just do a quick conversion
-    if (aRandomVariance == 0 || aMilliSeconds == 0)
-        return aMilliSeconds * 1000;
-    
-    // otherwise calculate difference
-    TInt diff = 1000 * aMilliSeconds / 2 * aRandomVariance / 100;  
-    
-    return RandomNumber(aMilliSeconds*1000-diff, aMilliSeconds*1000+diff);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CLoadGenModel::RandomNumber(TInt aMin, TInt aMax)
-    {
-    TInt range = (aMax > aMin ? aMax - aMin : aMin - aMax) + 1;
-    TInt random = (TInt) (range * Math::FRand(iRandomNumberSeed));
-    
-    random = (random % range) + aMin;
-
-    if (random > aMax)
-        random = aMax;
-    else if (random < aMin)
-        random = aMin;
-    
-    return random;
-    }
-
-// --------------------------------------------------------------------------------------------
-CDesCArray* CLoadGenModel::ListOfAllAppsL()
-    {
-    const TInt KMaxAppsArraySize=250;
-    RApaLsSession ls;
-    CleanupClosePushL(ls);
-
-    User::LeaveIfError( ls.Connect() );
-    CDesCArray* allAppsArray = new(ELeave) CDesCArrayFlat( KMaxAppsArraySize );
-    CleanupStack::PushL( allAppsArray );
-    // reset the apps list
-    allAppsArray->Reset();
-
-    // search all apps
-    TApaAppInfo appInfo;
-    User::LeaveIfError(ls.GetAllApps());
-
-
-    while ( ls.GetNextApp( appInfo ) == KErrNone )
-        {
-        allAppsArray->AppendL( appInfo.iFullName );      
-        }
-    CleanupStack::Pop( allAppsArray );
-    CleanupStack::PopAndDestroy( &ls );
-   
-
-    // remove loadgen.* from the list
-    for ( TInt i = 0; i < allAppsArray->MdcaCount(); i++ )
-        {
-        if ( allAppsArray->MdcaPoint(i).FindF( _L("\\loadgen.") ) != KErrNotFound )
-            {
-            allAppsArray->Delete(i);
-            allAppsArray->Compress();
-            break;
-            }
-        }
-
-    // sort the elements
-    allAppsArray->Sort();
-
-    return allAppsArray; // ownership transferred
-    }
-
-TSize CLoadGenModel::ScreenSize()
-    {    
-    TInt x = 0;
-    TInt y = 0;
-    HAL::Get(HALData::EDisplayXPixels, x);
-    HAL::Get(HALData::EDisplayYPixels, y);
-    return TSize(x, y);
-    }
-
-// End of File
--- a/loadgen/src/loadgen_netconn.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_netconn.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-#include <commdb.h>
-
-_LIT(KThreadName, "NetConn %d");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CNetConn* CNetConn::NewL(TNetConnAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CNetConn* self = new(ELeave) CNetConn(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CNetConn::~CNetConn()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CNetConn::CNetConn(TNetConnAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadNetConn;
-
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, 1024*KMinHeapSize, 16*1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CNetConn::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TNetConnAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::GenerateLoad(TNetConnAttributes& aAttributes)
-    {
-    CNetConnManager* netConnManager = NULL;
-    TRAPD(err, netConnManager = CNetConnManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete netConnManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CNetConn::Close()
-    {
-    CLoadBase::Close();
-
-    if (iThread.ExitReason() == 0) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon(waiter);
-        User::WaitForRequest(waiter);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CNetConn::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    
-    _LIT(KNetConnEntry, "[%d] NetConn prio=%S dest=%S idle=%dms random=%d%%");
-    buf.Format(KNetConnEntry, iAttributes.iId, &prioBuf, &iAttributes.iDestination, iAttributes.iIdle, iAttributes.iRandomVariance);
-   
-    return TPtrC(buf);
-    }
-                   
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CNetConnManager* CNetConnManager::NewL(TNetConnAttributes& aAttributes)
-    {
-    CNetConnManager* self = new(ELeave) CNetConnManager(aAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CNetConnManager::CNetConnManager(TNetConnAttributes& aAttributes) :
-    CActive(EPriorityStandard), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CNetConnManager::~CNetConnManager()
-    {
-    Cancel();
-    
-    iDownloadMgr.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CNetConnManager::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // init
-    TUid dlUid;
-    dlUid.iUid = 0x00011100 + iAttributes.iId; // generate unique identifier instead of using the LoadGen uid for all instances
-    iDownloadMgr.ConnectL(dlUid, *this, ETrue);
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CNetConnManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CNetConnManager::DoCancel()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CNetConnManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CNetConnManager* self = static_cast<CNetConnManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    TRAPD(err,self->StartDownloadL());
-
-    return err;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CNetConnManager::StartDownloadL()
-    {
-    iDownloadMgr.SetIntAttribute(EDlMgrExitAction, EExitPause);
-    iDownloadMgr.DeleteAll();
-
-    // create new download    
-    TBuf8<256> url;
-    url.Copy(iAttributes.iDestination);
-
-    RHttpDownload& download = iDownloadMgr.CreateDownloadL( url );
-    
-    download.SetIntAttribute(EDlAttrAction, EDoNothing);            // do nothing when download has finished
-    download.SetBoolAttribute(EDlAttrHidden, ETrue);                // download is hidden
-    download.SetIntAttribute(EDlAttrRestartAction, ERestartForced); // force to download always ignoring cache
-
-    // start the download
-    download.Start();         
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CNetConnManager::HandleDMgrEventL(RHttpDownload& aDownload, THttpDownloadEvent aEvent)
-    {
-    if (aEvent.iProgressState == EHttpContentTypeReceived)
-        {
-        // need to start the download if already not started
-        aDownload.Start();
-        }
-    
-    switch ( aEvent.iDownloadState )
-        {
-        case EHttpDlPaused:
-        case EHttpDlCompleted:
-        case EHttpDlFailed:
-            {
-            // assume that the download has finished in this stage
-            // delete download and restart
-            aDownload.Delete();
-            iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-            break;
-            }
-
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/loadgen/src/loadgen_phonecall.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_phonecall.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-
-_LIT(KThreadName, "PhoneCall %d");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CPhoneCall* CPhoneCall::NewL(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CPhoneCall* self = new(ELeave) CPhoneCall(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPhoneCall::~CPhoneCall()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPhoneCall::CPhoneCall(TPhoneCallAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadPhoneCall;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CPhoneCall::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TPhoneCallAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::GenerateLoad(TPhoneCallAttributes& aAttributes)
-    {
-    CPhoneCallManager* phoneCallManager = NULL;
-    TRAPD(err, phoneCallManager = CPhoneCallManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete phoneCallManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCall::Close()
-    {
-    CLoadBase::Close();
-
-    if (iThread.ExitReason() == 0) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon(waiter);
-        User::WaitForRequest(waiter);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CPhoneCall::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    
-    _LIT(KPhoneCallEntry, "[%d] PhoneCall prio=%S dest=%S length=%dms idle=%dms random=%d%%");
-    buf.Format(KPhoneCallEntry, iAttributes.iId, &prioBuf, &iAttributes.iDestination, iAttributes.iLength, iAttributes.iIdle, iAttributes.iRandomVariance);
-   
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CPhoneCallManager* CPhoneCallManager::NewL(TPhoneCallAttributes& aAttributes)
-    {
-    CPhoneCallManager* self = new(ELeave) CPhoneCallManager(aAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPhoneCallManager::CPhoneCallManager(TPhoneCallAttributes& aAttributes) :
-    CActive(EPriorityStandard), iAttributes(aAttributes), iState(EStateIdle)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CPhoneCallManager::~CPhoneCallManager()
-    {
-    Cancel();
-    
-    if (iPeriodicTimer)
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }
-        
-    delete iDialer;
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CPhoneCallManager::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-
-    // init dialer ao
-    iDialer = CDialer::NewL(*this);
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CPhoneCallManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CPhoneCallManager::DoCancel()
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TInt CPhoneCallManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CPhoneCallManager* self = static_cast<CPhoneCallManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    self->HandleCalls();
-
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCallManager::HandleCalls()
-    {
-    if (iState == EStateIdle)
-        {
-        // make a new call
-        iState = EStateCall;
-        iDialer->Dial(iAttributes.iDestination);
-        }
-    
-    else if (iState == EStateCall)
-        {
-        // hangup existing call
-        iState = EStateIdle;
-        iDialer->Hangup();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhoneCallManager::HandleStatus(TInt /*aErr*/)
-    {
-    // call timer after wait
-    if (iState == EStateCall)
-        {
-        iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iLength, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-        }
-
-    else if (iState == EStateIdle)
-        {
-        iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iIdle, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-        }        
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CDialer* CDialer::NewL(CPhoneCallManager& aManager)
-    {
-    CDialer* self = new(ELeave) CDialer(aManager);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CDialer::CDialer(CPhoneCallManager& aManager) :
-    CActive(EPriorityStandard), iManager(aManager), iCallParamsPckg(iCallParams)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CDialer::~CDialer()
-    {
-    Cancel();
-    delete iTelephony;
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CDialer::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // init telephony object
-    iTelephony = CTelephony::NewL();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CDialer::RunL()
-    {
-    // notify the observer that status has changed
-    iManager.HandleStatus(iStatus.Int());
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CDialer::DoCancel()
-    {
-    iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
-    iTelephony->CancelAsync(CTelephony::EHangupCancel);
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-void CDialer::Dial(const TDesC& aDestination)
-    {
-    CTelephony::TTelNumber telNumber(aDestination);
-    iCallParams.iIdRestrict = CTelephony::ESendMyId;
-    iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId);
-    SetActive();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CDialer::Hangup()
-    {
-    iTelephony->Hangup(iStatus, iCallId);
-    SetActive();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-    
-
-// End of File
--- a/loadgen/src/loadgen_photocapture.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_photocapture.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include "loadgen_traces.h"
-#include <loadgen.rsg>
-#include <e32hal.h>
-#include <u32hal.h>
-#include <e32math.h>
-#include <EIKENV.H>
-
-_LIT(KThreadName, "PhotoCapture %d");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-
-//TInt CPhotoCapture::iImagesReady = 0;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CPhotoCapture* CPhotoCapture::NewL(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CPhotoCapture* self = new(ELeave) CPhotoCapture(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPhotoCapture::~CPhotoCapture()
-    {    
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPhotoCapture::CPhotoCapture(TPhotoCaptureAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {    
-    iAttributes.iId = aReferenceNumber;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::ConstructL()
-    {    
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadPhotoCaptures;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CPhotoCapture::ThreadFunction(TAny* aThreadArg)
-    {
-    TInt err = KErrNone;
-    
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TPhotoCaptureAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return err;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::GenerateLoad(TPhotoCaptureAttributes& aAttributes)
-    {    
-    CCameraManager* cameraManager = 0;
-    TRAPD(err, cameraManager = CCameraManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete cameraManager;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::Resume()
-    {    
-    CLoadBase::Resume();    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::Suspend()
-    {    
-    CLoadBase::Suspend();    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::SetPriority()
-    {    
-    CLoadBase::SetPriority();    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPhotoCapture::Close()
-    {    
-    CLoadBase::Close();
-
-    // kill the thread immediately
-    iThread.Kill(0);   
-
-    iThread.Close();
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CPhotoCapture::Description()
-    {    
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-        
-    _LIT(KPhotoCaptureEntry, "[%d] PhotoCapture camera=%d prio=%S idle=%dms random=%d%%");
-    buf.Format(KPhotoCaptureEntry, iAttributes.iId, iAttributes.iCamera, &prioBuf, iAttributes.iIdle, iAttributes.iRandomVariance);
-       
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-
-
-// --------------------------------------------------------------------------------------------
-CCameraManager* CCameraManager::NewL(TPhotoCaptureAttributes& aAttrs)
-    {
-    CCameraManager* self = new (ELeave) CCameraManager(aAttrs);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
- 
-// --------------------------------------------------------------------------------------------
-CCameraManager::~CCameraManager()
-    {    
-    delete iCamera;
-    if (iPeriodicTimer)
-        {
-        iPeriodicTimer->Cancel();
-        delete iPeriodicTimer;
-        }
-    }
- 
-// --------------------------------------------------------------------------------------------
-CCameraManager::CCameraManager(TPhotoCaptureAttributes& aAttrs) 
-: 
-CActive(EPriorityStandard),
-iAttributes(aAttrs)
-    {        
-    iState = ENotReady;
-    iNumOfPics = 0;
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::ConstructL()
-    {   
-    CActiveScheduler::Add(this);    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-        
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-
-// --------------------------------------------------------------------------------------------
-void CCameraManager::DoCancel()
-    {    
-    }
-
-// --------------------------------------------------------------------------------------------
-void CCameraManager::RunL()
-    {    
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::ReserveCameraL()
-    {
-    LOGSTRING2("LoadGen: CCameraManager::ReserveCameraL() - Using Camera %d", iAttributes.iCamera);
-    if( iCamera )
-        {
-        iCamera->Release();
-        }
-    delete iCamera;
-    iCamera = 0;
-    TRAPD( err, iCamera = CCamera::NewL(*this, iAttributes.iCamera));
-    iCurrentCamera = iAttributes.iCamera;
-    if(err != KErrNone)
-        {
-        LOGSTRING2("LoadGen: CCamera::NewL leaves with error: %d", err);
-        User::Leave(err);
-        }
-    iCamera->CameraInfo(iCameraInfo);
-    iCamera->Reserve();    
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::ReserveComplete(TInt aError)
-    {
-    if( aError != KErrNone )
-        LOGSTRING2("LoadGen: CCameraManager::ReserveComplete() - Error: %d", aError);
-    
-    if( aError == KErrNone )
-        {
-        iState = ECameraReserved;
-        iCamera->PowerOn();
-        }
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::PowerOnComplete(TInt aError)
-    {
-    if( aError != KErrNone )
-        {
-        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Error: %d", aError);
-        return;
-        }
-
-    // Define image format, try JPEG images first:
-    CCamera::TFormat format = CCamera::EFormatExif;
-
-    if(iCameraInfo.iImageFormatsSupported & CCamera::EFormatExif)
-        {
-        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - EXIF JPEG supported");
-        format = CCamera::EFormatExif;
-        }
-    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatJpeg )
-        {
-        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - JFIF JPEG supported");
-        format = CCamera::EFormatJpeg;
-        }
-    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor4K )
-        {
-        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 4K Color supported");
-        format = CCamera::EFormatFbsBitmapColor4K;
-        }
-    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor64K )
-        {
-        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 64K Color supported");
-        format = CCamera::EFormatFbsBitmapColor64K;
-        }
-    else if( iCameraInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor16M )
-        {
-        LOGSTRING("LoadGen: CCameraManager::PowerOnComplete() - Bitmap 16M Color supported");
-        format = CCamera::EFormatFbsBitmapColor16M;
-        }
-    else
-        {
-        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - JPEGs not supported, trying \"User defined\" (Supported formats: %d)", iCameraInfo.iImageFormatsSupported);
-        format = CCamera::EFormatUserDefined;
-        }
-    const TInt KImageSizeIndex = 0;  // Largest image size
-    TRAPD( err, iCamera->PrepareImageCaptureL(format, KImageSizeIndex));
-    if( err != KErrNone )
-        {
-        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Error while preparing camera: %d", err);        
-        }
-    // Camera ready:
-    iState = EIdle;
-    // Take photo:
-    TRAP(err, CapturePhotoL());
-    if( err != KErrNone )
-        {
-        LOGSTRING2("LoadGen: CCameraManager::PowerOnComplete() - Photo capture error: %d", err);
-        }
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-void CCameraManager::ImageReady(CFbsBitmap* aBitmap, HBufC8* aData, TInt aError)
-    {    
-    if( aError != KErrNone )
-        {
-        LOGSTRING2("LoadGen: CCameraManager::ImageReady() - Error: %d", aError);
-        }    
-    else
-        {
-        iNumOfPics++;    
-        LOGSTRING2("LoadGen: CCameraManager::ImageReady() - Images successfully captured: %d", iNumOfPics);
-        }
-    delete aBitmap;
-    delete aData;
-    iState = EIdle;
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/, TInt aError)
-    {
-    if( aError != KErrNone )
-        LOGSTRING2("LoadGen: CCameraManager::FrameBufferReady() - Error: %d", aError);
-    }
- 
-// --------------------------------------------------------------------------------------------
-void CCameraManager::CapturePhotoL()
-    {    
-    // Camera Manager must be in idle state when taking a photo
-    if( iState == ENotReady )
-        {
-        // Not ready, camera must be reserved:
-        ReserveCameraL();
-        }
-    else if (iState == EIdle)
-        {
-        if( iCurrentCamera != iAttributes.iCamera )
-            {
-            LOGSTRING3("LoadGen: CCameraManager::CapturePhotoL() - Switching from Camera %d to Camera %d", iCurrentCamera, iAttributes.iCamera);
-            ReserveCameraL();
-            }
-        else
-            {
-            iState = ECapture;
-            if( iCameraInfo.iFlashModesSupported & CCamera::EFlashForced)
-                {
-                iCamera->SetFlashL(CCamera::EFlashForced);
-                }
-            iCamera->CaptureImage();
-            iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                iAttributes.iRandomVariance ), KDefaultPeriod, 
-                TCallBack( PeriodicTimerCallBack, this ) );
-            }
-        }
-    else
-        {
-        iPeriodicTimer->Start( CLoadGenModel::MilliSecondsToMicroSeconds( iAttributes.iIdle,
-                                    iAttributes.iRandomVariance ), KDefaultPeriod, 
-                                    TCallBack( PeriodicTimerCallBack, this ) );
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CCameraManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CCameraManager* self = static_cast<CCameraManager*>( aAny );
-    self->iPeriodicTimer->Cancel();
-    TRAP_IGNORE(self->CapturePhotoL());   
-    return KErrNone;
-    }
-
-// End of File
--- a/loadgen/src/loadgen_pointerevent.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_pointerevent.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include <loadgen.rsg>
-
-#include <e32math.h>
-
-_LIT(KThreadName, "PointerEvent %d");
-
-const TInt KDefaultStart = 50;
-const TInt KDefaultPeriod = 5000000;
-    
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CPointerEvent* CPointerEvent::NewL(TPointerEventAttributes& aAttributes, TInt aReferenceNumber)
-    {
-    CPointerEvent* self = new(ELeave) CPointerEvent(aAttributes, aReferenceNumber);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPointerEvent::~CPointerEvent()
-    {
-    Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPointerEvent::CPointerEvent(TPointerEventAttributes& aAttributes, TInt aReferenceNumber) : iAttributes(aAttributes)
-    {
-    iAttributes.iId = aReferenceNumber;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::ConstructL()
-    {
-    CLoadBase::ConstructL();
-    
-    iType = ELoadGenCmdNewLoadPointerEvent;
-    
-    TBuf<64> threadName;
-    threadName.Format(KThreadName, iAttributes.iId);
-    
-    // create a thread
-    User::LeaveIfError(iThread.Create(threadName, ThreadFunction, KDefaultStackSize*2, KMinHeapSize, 1024*KMinHeapSize, (TAny*) &iAttributes ));
-    
-    // set priority of the thread
-    SetPriority();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CPointerEvent::ThreadFunction(TAny* aThreadArg)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    // start generating load, pass pointer to arguments
-    GenerateLoad(*((TPointerEventAttributes*) aThreadArg));
-
-    delete pS;
-    delete pC;
-    
-    return KErrNone;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::GenerateLoad(TPointerEventAttributes& aAttributes)
-    {
-    CPointerEventManager* pointerEventManager = NULL;
-    TRAPD(err, pointerEventManager = CPointerEventManager::NewL(aAttributes));
-    if (err == KErrNone) CActiveScheduler::Start();
-    delete pointerEventManager;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::Resume()
-    {
-    CLoadBase::Resume();
-    
-    iThread.Resume();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::Suspend()
-    {
-    CLoadBase::Suspend();
-    
-    iThread.Suspend();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::SetPriority()
-    {
-    CLoadBase::SetPriority();
-    
-    iThread.SetPriority(CLoadGenModel::SettingItemToThreadPriority(iAttributes.iPriority));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPointerEvent::Close()
-    {
-    CLoadBase::Close();
-    
-    if (iThread.ExitReason() == 0) // check if the thread is still alive
-        {
-        // signal the thread that it needs to close
-        iThread.RequestComplete(iAttributes.iDeathStatus, KErrCancel);
-
-        // wait the thread to die
-        TRequestStatus waiter;
-        iThread.Logon(waiter);
-        User::WaitForRequest(waiter);
-        iThread.Close();
-        }
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-TPtrC CPointerEvent::Description()
-    {
-    TBuf<256> buf;
-    TBuf<16> prioBuf;
-    CLoadGenModel::SettingItemToThreadDescription(iAttributes.iPriority, prioBuf);
-    
-    _LIT(KPointerEventEntry, "[%d] PointerEvent prio=%S heartbeat=%dms random=%d%%");
-    buf.Format(KPointerEventEntry, iAttributes.iId, &prioBuf, iAttributes.iHeartBeat, iAttributes.iRandomVariance);
-   
-    return TPtrC(buf);
-    }               
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CPointerEventManager* CPointerEventManager::NewL(TPointerEventAttributes& aAttributes)
-    {
-    CPointerEventManager* self = new(ELeave) CPointerEventManager(aAttributes);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPointerEventManager::CPointerEventManager(TPointerEventAttributes& aAttributes) :
-    CActive(EPriorityStandard), iAttributes(aAttributes)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-CPointerEventManager::~CPointerEventManager()
-    {
-    Cancel();    
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CPointerEventManager::ConstructL()
-    {
-    CActiveScheduler::Add(this);
-    
-    // set the status as pending
-    iStatus = KRequestPending;
-    SetActive();
-    
-    // set the death status pointer point to the request status of this ao
-    iAttributes.iDeathStatus = &iStatus;
-    
-    // init    
-    
-    // start timer    
-    iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-    iPeriodicTimer->Start(KDefaultStart, KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CPointerEventManager::RunL()
-    {
-    // request status has completed by the main thread meaning that we need to stop now
-    CActiveScheduler::Stop();
-    }
-
-// --------------------------------------------------------------------------------------------
- 
-void CPointerEventManager::DoCancel()
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TInt CPointerEventManager::PeriodicTimerCallBack(TAny* aAny)
-    {
-    CPointerEventManager* self = static_cast<CPointerEventManager*>( aAny );
-
-    self->iPeriodicTimer->Cancel();
-    self->SimulatePointerEvent();
-
-    return KErrNone;
-    }
-    
-// --------------------------------------------------------------------------------------------
- 
-void CPointerEventManager::SimulatePointerEvent()
-    {
-    // Check the screen size and select pointer event position
-    // randomly
-    TSize screenSize = CLoadGenModel::ScreenSize();
-        
-    TInt x1 = CLoadGenModel::RandomNumber(0, screenSize.iWidth);
-    TInt y1 = CLoadGenModel::RandomNumber(0, screenSize.iHeight);
-    
-    // Generate "Pointer down" event:
-    TRawEvent eventPointerDown;    
-    eventPointerDown.Set(TRawEvent::EButton1Down, x1, y1);
-    UserSvr::AddEvent(eventPointerDown);
-    
-    // Get new random position for "Move pointer" and 
-    // "Pointer up" events
-    TInt x2 = CLoadGenModel::RandomNumber(0, screenSize.iWidth);
-    TInt y2 = CLoadGenModel::RandomNumber(0, screenSize.iHeight);
-    
-    // Generate "Move pointer" event:
-    TRawEvent eventMovePointer;
-    eventMovePointer.Set(TRawEvent::EPointerMove, x2, y2);
-    UserSvr::AddEvent(eventMovePointer);
-    
-    // Generate "Pointer up" event:
-    TRawEvent eventPointerUp;
-    eventPointerUp.Set(TRawEvent::EButton1Up, x2, y2);
-    UserSvr::AddEvent(eventPointerUp);
-    
-    // call timer
-    iPeriodicTimer->Start(CLoadGenModel::MilliSecondsToMicroSeconds(iAttributes.iHeartBeat, iAttributes.iRandomVariance), KDefaultPeriod, TCallBack(PeriodicTimerCallBack, this));
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-// End of File
--- a/loadgen/src/loadgen_settingsviewdlg.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "loadgen_settingsviewdlg.h"
-#include "loadgen_model.h"
-#include "loadgen.hrh"
-#include "loadgen_std.h"
-#include <loadgen.rsg>
-
-#include <aknsettingitemlist.h>
-#include <caknmemoryselectionsettingitem.h> 
-#include <aknlists.h>
-#include <akntitle.h>
-#include <aknnavi.h>
-#include <aknnavide.h>
-#include <stringloader.h>
-#include <aknnotewrappers.h> 
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CLoadGenSettingsViewDlg* CLoadGenSettingsViewDlg::NewL(TLoadGenSettings& aSettings)
-    {
-    CLoadGenSettingsViewDlg* self = new(ELeave) CLoadGenSettingsViewDlg(aSettings);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenSettingsViewDlg::~CLoadGenSettingsViewDlg()
-    {
-    // restore default navi pane
-    if (iNaviContainer)
-        iNaviContainer->Pop();
-    
-    if (iSettingItemArray)
-        {
-        iSettingItemArray->ResetAndDestroy();
-        delete iSettingItemArray; 
-        }
-    
-    delete iDecoratedTabGroup;   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CLoadGenSettingsViewDlg::CLoadGenSettingsViewDlg(TLoadGenSettings& aSettings) : iSettings(aSettings)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::ConstructL()
-    {
-    // construct a menu bar
-    CAknDialog::ConstructL(R_LOADGEN_SETTINGS_MENUBAR);
-   
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    
-    // set empty navi pane label
-    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
-    //iNaviContainer->PushDefaultL();
-    
-    // set title text
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Settings") );
-    
-    // create a tab group
-    iDecoratedTabGroup = iNaviContainer->CreateTabGroupL(this);
-    iTabGroup = static_cast<CAknTabGroup*>(iDecoratedTabGroup->DecoratedControl());
-    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs); 
-    
-    // add tabs
-    //iTabGroup->AddTabL(ETabGeneral, _L("General"));
-    //iTabGroup->AddTabL(ETabScreenShot, _L("Screen shot"));
-    //iTabGroup->SetActiveTabByIndex(ETabGeneral);
-    
-    iNaviContainer->PushL( *iDecoratedTabGroup );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            ShowSettingPageL(EFalse);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
-    {
-    iListBox->SetCurrentItemIndex(0);
-
-    SetVisibilitiesOfSettingItemsL();   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::ProcessCommandL(TInt aCommandId)
-    {
-    CAknDialog::ProcessCommandL(aCommandId);
-
-    switch (aCommandId)
-        {
-        case ELoadGenCmdSettingsChange:
-            ShowSettingPageL(ETrue);
-            break;
-        case ELoadGenCmdSettingsExit:
-            TryExitL(EAknCmdExit);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CLoadGenSettingsViewDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if (iTabGroup == NULL)
-        {
-        return EKeyWasNotConsumed;
-        }
-
-    TInt active = iTabGroup->ActiveTabIndex();
-    TInt count = iTabGroup->TabCount();
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-            if (active > 0)
-                {
-                active--;
-                iTabGroup->SetActiveTabByIndex(active);
-                TabChangedL(active); 
-                }
-            break;
-        
-        case EKeyRightArrow:
-            if((active + 1) < count)
-                {
-                active++;
-                iTabGroup->SetActiveTabByIndex(active);
-                TabChangedL(active); 
-                }
-            break;
-        }
-
-    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
-    }    
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::PreLayoutDynInitL()
-    {
-    iListBox = static_cast<CAknSettingStyleListBox*>( Control(ELoadGenSettingItemList) );
-    iListBox->SetMopParent(this);
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
-    iListBox->SetListBoxObserver(this);
-
-    iSettingItemArray = new(ELeave) CAknSettingItemArray(16, EFalse, 0);
-
-    CTextListBoxModel* model = iListBox->Model();
-    model->SetItemTextArray(iSettingItemArray);
-    model->SetOwnershipType(ELbmDoesNotOwnItemArray);
-
-    UpdateListBoxL();    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CLoadGenSettingsViewDlg::OkToExitL(TInt aButtonId)
-    {
-    return CAknDialog::OkToExitL(aButtonId);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::ShowSettingPageL(TInt aCalledFromMenu)
-    {
-    TInt listIndex = iListBox->CurrentItemIndex();
-    TInt realIndex = iSettingItemArray->ItemIndexFromVisibleIndex(listIndex);
-    CAknSettingItem* item = iSettingItemArray->At(realIndex);
-    item->EditItemL(aCalledFromMenu);
-    item->StoreL();
-    SetVisibilitiesOfSettingItemsL();
-    DrawNow();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
-    {
-    if (iSettingItemArray->Count() > 0)
-        {
-/*
-        switch (iTabGroup->ActiveTabIndex())
-            {
-
-            case ETabGeneral:
-                {
-                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(EFalse);
-                break;
-                }
-            
-            case ETabScreenShot:
-                {
-                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(ETrue);
-                break;            
-                }
-
-            default:
-                User::Panic(_L("TabIOOB"), 50);
-                break;
-            }
-*/
-        iSettingItemArray->RecalculateVisibleIndicesL();
-        iListBox->HandleItemAdditionL();
-        iListBox->UpdateScrollBarsL();
-        }
-    }   
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::UpdateListBoxL()
-    {
-    iSettingItemArray->ResetAndDestroy();
-
-/* 
-    // create items
-    TInt ordinal(0);
-
-    AddSettingItemL(ESettingListDisplayModeSelection,
-                    R_DISPLAYMODESELECTION_SETTING_TITLE,
-                    R_DISPLAYMODESELECTION_SETTING_PAGE,
-                    R_DISPLAYMODESELECTION_SETTING_TEXTS,
-                    ordinal++);
-                    
-    AddSettingItemL(ESettingListFileViewModeSelection,
-                    R_FILEVIEWMODESELECTION_SETTING_TITLE,
-                    R_FILEVIEWMODESELECTION_SETTING_PAGE,
-                    R_FILEVIEWMODESELECTION_SETTING_TEXTS,
-                    ordinal++); 
-*/                                                              
-    SetVisibilitiesOfSettingItemsL(); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CLoadGenSettingsViewDlg::AddSettingItemL(TInt aId,
-                                                 TInt aTitleResource,
-                                                 TInt aSettingPageResource,
-                                                 TInt aAssociatedResource,
-                                                 TInt aOrdinal)
-    {
-    // create a setting item
-    CAknSettingItem* settingItem = NULL;
-    
-    switch (aId)
-        {
-/*
-        case ESettingListDisplayModeSelection:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDisplayMode);
-            break;
-            
-        case ESettingListFileViewModeSelection:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iFileViewMode);
-            break;
-
-        default:
-            User::Panic(_L("NotSetItem"), 50);
-            break;
-*/
-        }
-        
-    CleanupStack::PushL(settingItem);
-
-    // get title text
-    HBufC* itemTitle = StringLoader::LoadLC(aTitleResource);
-
-    // construct the setting item
-    settingItem->ConstructL(EFalse, aOrdinal, *itemTitle, NULL, aSettingPageResource,
-                            EAknCtPopupSettingList, NULL, aAssociatedResource);
-
-    // append the setting item to settingitem array
-    iSettingItemArray->InsertL(aOrdinal, settingItem);
-
-    CleanupStack::PopAndDestroy(); //itemTitle
-    CleanupStack::Pop(); //settingItem
-    }
-
-// --------------------------------------------------------------------------------------------
-    
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/data/loadgen.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1421 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+NAME MATT
+
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <eikon.hrh>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <avkon.mbg>
+#include <CommonDialogs.hrh>
+#include <CommonDialogs.rh>
+#include <pathconfiguration.hrh>
+#include <data_caging_paths_strings.hrh>
+#include <appinfo.rh>
+
+#include "loadgen.hrh"
+#include "loadgen_std.h"
+
+
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//   
+//    Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name { buf=""; }
+
+// ---------------------------------------------------------
+//   
+//    Define default menu and CBA key.
+//
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    //status_pane = r_loadgen_status_pane;
+    //menubar = r_loadgen_menubar;
+    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+    
+//----------------------------------------------------
+//   
+//    r_loadgen_hotkeys
+//
+//----------------------------------------------------
+//
+RESOURCE HOTKEYS r_loadgen_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EAknCmdExit; key='e'; }
+        };
+    }
+
+
+//----------------------------------------------------
+//    r_loadgen_view_main
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_loadgen_view_main
+    {
+    hotkeys=r_loadgen_hotkeys;
+    menubar=r_loadgen_menubar_view_main;  
+    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
+    }
+
+//----------------------------------------------------
+//    r_loadgen_menubar_view_main
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_loadgen_menubar_view_main
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_loadgen_app_menu; txt="App"; },
+        MENU_TITLE { menu_pane=r_loadgen_view_main_menu; txt="Main"; }
+        };
+    }
+
+//----------------------------------------------------
+//    r_loadgen_view_main_menu
+//----------------------------------------------------
+//
+
+RESOURCE MENU_PANE r_loadgen_view_main_menu
+    {
+    items=
+        {
+        };
+    }
+
+           
+        
+//----------------------------------------------------
+//    r_loadgen_app_menu
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_loadgen_app_menu
+    {
+    items=
+        {
+        MENU_ITEM { command=ELoadGenCmdNewLoad; txt="New load"; cascade=r_loadgen_newload_submenu; },
+        MENU_ITEM { command=ELoadGenStopAll; txt="Stop all"; },
+        MENU_ITEM { command=ELoadGenSuspendAll; txt="Suspend all"; },
+        MENU_ITEM { command=ELoadGenResumeAll; txt="Resume all"; },
+        MENU_ITEM { command=ELoadGenCmdLaunchPerfMon; txt="Launch PerfMon"; },
+        MENU_ITEM { command=ELoadGenCmdAbout; txt="About"; },
+        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
+        };
+    }
+
+RESOURCE MENU_PANE r_loadgen_newload_submenu
+    {
+    items = 
+        {
+        MENU_ITEM { command=ELoadGenCmdNewLoadCPULoad; txt="CPU load"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadEatMemory; txt="Eat memory"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadPhoneCall; txt="Phone calls"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadMessages; txt="Messages"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadNetConn; txt="Network conn."; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadKeyPress; txt="Key presses"; },        
+        MENU_ITEM { command=ELoadGenCmdNewLoadApplications; txt="Applications"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadPhotoCaptures; txt="Photo captures"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadBluetooth; txt="Bluetooth actions"; },
+        MENU_ITEM { command=ELoadGenCmdNewLoadPointerEvent; txt="Pointer events"; }
+        };
+    }
+    
+//----------------------------------------------------
+//    r_loadgen_settings_dialog
+//    Dialog for setting list
+//----------------------------------------------------
+//
+RESOURCE DIALOG r_loadgen_settings_dialog
+    {
+    flags =
+        EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
+        EEikDialogFlagButtonsRight | EEikDialogFlagCbaButtons |
+        EEikDialogFlagWait | EEikDialogFlagNoTitleBar;
+    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtSettingListBox;
+            id = ELoadGenSettingItemList;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = LISTBOX
+                {
+                flags = EAknListBoxSelectionList;
+                };
+            }
+        };
+    }
+
+//----------------------------------------------------
+//    r_loadgen_settings_menubar
+//----------------------------------------------------
+//
+
+RESOURCE MENU_BAR r_loadgen_settings_menubar
+    {
+    titles =
+        {
+        MENU_TITLE
+            {
+            menu_pane = r_loadgen_settings_menupane;
+            txt = " ";   // dummy
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_loadgen_settings_menupane
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = ELoadGenCmdSettingsChange;
+            txt = "Change";
+            },
+        MENU_ITEM
+            {
+            command = ELoadGenCmdSettingsExit;
+            txt = "Exit";
+            }
+        };
+    }
+
+
+
+  
+// ---------------------------------------------------------
+//   
+//   r_loadgen_about_dialog
+//   About dialog - show version and copyright info etc.
+//
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_loadgen_about_dialog
+    {
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+                {
+                label = "About LoadGen";
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+                {
+                message = "Version 1.5.0 - 23rd April 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_general_confirmation_query
+// ---------------------------------------------------------
+//
+
+RESOURCE DIALOG r_general_confirmation_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_YES_NO;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_CONFIRMATION_QUERY
+                {
+                layout = EConfirmationQueryLayout;
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_general_text_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_general_text_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items=
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control = AVKON_DATA_QUERY
+                {
+                layout = EDataLayout;
+                control = EDWIN
+                    {
+                    width = 256;
+                    lines = 3;
+                    maxlength = 256;
+                    };
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_general_text_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_general_numeric_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        DLG_LINE
+            {
+            type = EAknCtQuery;
+            id = EGeneralQuery;
+            control= AVKON_DATA_QUERY
+                {
+                layout = ENumberLayout;
+                control = AVKON_INTEGER_EDWIN
+                    {
+                    min = -999999;
+                    max = 999999;
+                    };
+                };
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   r_item_action_query
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_item_action_query
+    {
+    flags = EGeneralQueryFlags;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    items =
+        {
+        AVKON_LIST_QUERY_DLG_LINE
+            {
+            control= AVKON_LIST_QUERY_CONTROL
+                {
+                listtype = EAknCtSinglePopupMenuListBox;
+                listbox = AVKON_LIST_QUERY_LIST
+                    {
+                    array_id = r_item_action_query_array;
+                    };
+                heading = "";
+                };
+            }
+        };
+    }
+
+RESOURCE ARRAY r_item_action_query_array
+    {
+    items =
+        {
+        LBUF {txt = "Stop"; },
+        LBUF {txt = "Resume/suspend"; },
+        LBUF {txt = "Edit"; }
+        };
+    }     
+
+
+// ---------------------------------------------------------
+//   r_cpuload_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_cpuload_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_cpuload_form;
+    }
+
+RESOURCE FORM r_cpuload_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenCPULoadQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Load mode";
+            id = ELoadGenCPULoadQueryMode;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_cpuloadmode_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Type";
+            id = ELoadGenCPULoadQueryType;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_cpuloadtype_textarray;
+                active = 0;    
+                };
+            }
+        };
+    }
+
+RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_length
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Length (ms)";
+    id = ELoadGenCPULoadQueryLength;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 0;    
+        max = 999999999;    
+        };
+    }
+
+RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_idle
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Idle (ms)";
+    id = ELoadGenCPULoadQueryIdle;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 0;    
+        max = 999999999;    
+        };
+    }
+
+RESOURCE DLG_LINE r_cpuload_dlg_line_periodic_variance
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Random variance (%)";
+    id = ELoadGenCPULoadQueryVariance;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 0;    
+        max = 100;    
+        };
+    }
+
+RESOURCE DLG_LINE r_cpuload_dlg_line_cpu
+    {
+    type = EAknCtPopupFieldText;
+    prompt = "CPU";
+    id = ELoadGenCPULoadQueryCpu;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = POPUP_FIELD_TEXT
+        {
+        popupfield = POPUP_FIELD
+            {
+            width = 100;
+            };
+        textarray = r_cpuloadcpu_textarray;
+        active = 0;    
+        };
+    }
+
+                
+// ---------------------------------------------------------
+//   r_memoryeat_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_memoryeat_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_memoryeat_form;
+    }
+
+RESOURCE FORM r_memoryeat_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenMemoryEatQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Source";
+            id = ELoadGenMemoryEatQuerySource;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_memoryeatsource_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Type";
+            id = ELoadGenMemoryEatQueryType;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_memoryeattype_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Buffer (B)";
+            id = ELoadGenMemoryEatQueryBuffer;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Idle after buffer (ms)";
+            id = ELoadGenMemoryEatQueryIdle;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenMemoryEatQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }
+
+RESOURCE DLG_LINE r_memoryeat_dlg_line_amount
+    {
+    type = EEikCtEdwin;
+    prompt = "Amount (B)";
+    id = ELoadGenMemoryEatQueryAmount;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = EDWIN
+        {
+        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
+        maxlength = 14;    
+        width = 6;
+        default_input_mode = EAknEditorNumericInputMode;
+        allowed_input_modes = EAknEditorNumericInputMode;    
+        };
+    }
+    
+RESOURCE DLG_LINE r_memoryeat_dlg_line_random_min
+    {
+    type = EEikCtEdwin;
+    prompt = "Min to be left (B)";
+    id = ELoadGenMemoryEatQueryRandomMin;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = EDWIN
+        {
+        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
+        maxlength = 14;    
+        width = 6;
+        default_input_mode = EAknEditorNumericInputMode;
+        allowed_input_modes = EAknEditorNumericInputMode;    
+        };
+    }
+
+RESOURCE DLG_LINE r_memoryeat_dlg_line_random_max
+    {
+    type = EEikCtEdwin;
+    prompt = "Max to be left (B)";
+    id = ELoadGenMemoryEatQueryRandomMax;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = EDWIN
+        {
+        flags = KMultiLineExpandingEditorFlags | EEikEdwinNoLineOrParaBreaks;
+        maxlength = 14;    
+        width = 6;
+        default_input_mode = EAknEditorNumericInputMode;
+        allowed_input_modes = EAknEditorNumericInputMode;    
+        };
+    }
+
+
+
+// ---------------------------------------------------------
+//   r_phonecall_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_phonecall_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_phonecall_form;
+    }
+
+RESOURCE FORM r_phonecall_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenPhoneCallQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtEdwin;
+            prompt = "Phone number";
+            id = ELoadGenPhoneCallQueryDestination;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = EDWIN
+                {
+                width = 255;    
+                maxlength = 255;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Length (ms)";
+            id = ELoadGenPhoneCallQueryLength;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Idle (ms)";
+            id = ELoadGenPhoneCallQueryIdle;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenPhoneCallQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   r_netconn_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_netconn_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_netconn_form;
+    }
+
+RESOURCE FORM r_netconn_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenNetConnQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtEdwin;
+            prompt = "Destination URL";
+            id = ELoadGenNetConnQueryDestination;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = EDWIN
+                {
+                width = 255;    
+                maxlength = 255;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Idle (ms)";
+            id = ELoadGenNetConnQueryIdle;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenNetConnQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }
+
+
+// ---------------------------------------------------------
+//   r_keypress_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_keypress_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_keypress_form;
+    }
+
+RESOURCE FORM r_keypress_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenKeyPressQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Heartbeat (ms)";
+            id = ELoadGenKeyPressQueryHeartBeat;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenKeyPressQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }    
+
+// ---------------------------------------------------------
+//   r_pointerevent_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_pointerevent_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_pointerevent_form;
+    }
+
+RESOURCE FORM r_pointerevent_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenPointerEventQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Heartbeat (ms)";
+            id = ELoadGenPointerEventQueryHeartBeat;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenPointerEventQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_messages_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_messages_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_messages_form;
+    }
+
+RESOURCE FORM r_messages_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenMessagesQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },
+            DLG_LINE
+                {
+                type = EAknCtPopupFieldText;
+                prompt = "Type";
+                id = ELoadGenMessagesQueryType;
+                itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                control = POPUP_FIELD_TEXT
+                    {
+                    popupfield = POPUP_FIELD
+                        {
+                        width = 100;
+                        };
+                    textarray = r_message_type_textarray;
+                    active = 0;    
+                    };
+                },            
+        DLG_LINE
+            {
+            type = EEikCtEdwin;
+            prompt = "Phone number";
+            id = ELoadGenMessagesQueryDestination;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = EDWIN
+                {
+                width = 255;    
+                maxlength = 255;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Maximum amount of messages";
+            id = ELoadGenMessagesQueryAmount;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 1000;    
+                };
+            },            
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Message length";
+            id = ELoadGenMessagesQueryLength;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 512;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Idle (ms)";
+            id = ELoadGenMessagesQueryIdle;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenMessagesQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_applicatios_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_applications_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_applications_form;
+    }
+
+RESOURCE FORM r_applications_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Priority";
+            id = ELoadGenApplicationsQueryPriority;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_thread_priority_textarray;
+                active = 0;    
+                };
+            },            
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Max parallel applications";
+            id = ELoadGenApplicationsMaxOpen;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Launching interval (ms)";
+            id = ELoadGenApplicationsLaunchingInterval;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+            
+        DLG_LINE
+            {
+            type = EAknCtPopupFieldText;
+            prompt = "Key press type";
+            id = ELoadGenApplicationsKeyPressType;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = POPUP_FIELD_TEXT
+                {
+                popupfield = POPUP_FIELD
+                    {
+                    width = 100;
+                    };
+                textarray = r_applications_keypress_type_textarray;
+                active = 0;    
+                };
+            },            
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Key press interval (ms)";
+            id = ELoadGenApplicationsKeyPressQueryHeartBeat;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 999999999;    
+                };
+            },
+        DLG_LINE
+            {
+            type = EEikCtNumberEditor;
+            prompt = "Random variance (%)";
+            id = ELoadGenApplicationsQueryVariance;
+            itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+            control = NUMBER_EDITOR
+                {
+                min = 0;    
+                max = 100;    
+                };
+            }
+        };
+    }    
+
+// ---------------------------------------------------------
+//   r_photocapture_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_photocapture_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_photocapture_form;
+    }
+
+RESOURCE FORM r_photocapture_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+                DLG_LINE
+                    {
+                    type = EAknCtPopupFieldText;
+                    prompt = "Priority";
+                    id = ELoadGenPhotoCaptureQueryPriority;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = POPUP_FIELD_TEXT
+                        {
+                        popupfield = POPUP_FIELD
+                            {
+                            width = 100;
+                            };
+                        textarray = r_thread_priority_textarray;
+                        active = 0;    
+                        };
+                    },
+                DLG_LINE
+                    {
+                    type = EEikCtNumberEditor;
+                    prompt = "Idle (ms)";
+                    id = ELoadGenPhotoCaptureQueryIdle;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = NUMBER_EDITOR
+                        {
+                        min = 0;    
+                        max = 999999999;    
+                        };
+                    },
+                DLG_LINE
+                    {
+                    type = EEikCtNumberEditor;
+                    prompt = "Random variance (%)";
+                    id = ELoadGenPhotoCaptureQueryVariance;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = NUMBER_EDITOR
+                        {
+                        min = 0;    
+                        max = 100;    
+                        };
+                    }
+        };
+    }
+
+/*RESOURCE DLG_LINE r_photocapture_dlg_line_periodic_idle
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Idle (ms)";
+    id = ELoadGenPhotoCaptureQueryIdle;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 0;    
+        max = 999999999;    
+        };
+    }
+
+RESOURCE DLG_LINE r_photocapture_dlg_line_periodic_variance
+    {
+    type = EEikCtNumberEditor;
+    prompt = "Random variance (%)";
+    id = ELoadGenPhotoCaptureQueryVariance;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = NUMBER_EDITOR
+        {
+        min = 0;    
+        max = 100;    
+        };
+    }*/
+
+RESOURCE DLG_LINE r_photocapture_dlg_line_device
+    {
+    type = EAknCtPopupFieldText;
+    prompt = "Device";
+    id = ELoadGenPhotoCaptureQueryDevice;
+    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+    control = POPUP_FIELD_TEXT
+        {
+        popupfield = POPUP_FIELD
+            {
+            width = 100;
+            };
+        textarray = r_photocapturedevice_textarray;
+        active = 0;    
+        };
+    }
+
+// ---------------------------------------------------------
+//   r_photocapture_form_dialog
+// ---------------------------------------------------------
+//
+RESOURCE DIALOG r_bluetooth_form_dialog
+    {
+    flags = EAknDialogGenericFullScreen;
+    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
+    form = r_bluetooth_form;
+    }
+
+RESOURCE FORM r_bluetooth_form
+    {
+    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
+    items = 
+        {
+                DLG_LINE
+                    {
+                    type = EAknCtPopupFieldText;
+                    prompt = "Priority";
+                    id = ELoadGenBluetoothQueryPriority;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = POPUP_FIELD_TEXT
+                        {
+                        popupfield = POPUP_FIELD
+                            {
+                            width = 100;
+                            };
+                        textarray = r_thread_priority_textarray;
+                        active = 0;    
+                        };
+                    },
+                DLG_LINE
+                    {
+                    type = EEikCtNumberEditor;
+                    prompt = "Idle (ms)";
+                    id = ELoadGenBluetoothQueryIdle;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = NUMBER_EDITOR
+                        {
+                        min = 0;    
+                        max = 999999999;    
+                        };
+                    },
+                DLG_LINE
+                    {
+                    type = EEikCtNumberEditor;
+                    prompt = "Random variance (%)";
+                    id = ELoadGenBluetoothQueryVariance;
+                    itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
+                    control = NUMBER_EDITOR
+                        {
+                        min = 0;    
+                        max = 100;    
+                        };
+                    }
+        };
+    }
+
+// ---------------------------------------------------------
+// Arrays for forms:    
+    
+RESOURCE ARRAY r_thread_priority_textarray
+    {
+    items =
+        {
+        LBUF { txt = "Much less (-20)"; },
+        LBUF { txt = "Less (-10)"; },
+        LBUF { txt = "Normal (0)"; },
+        LBUF { txt = "More (10)"; },
+        LBUF { txt = "Much more (20)"; },
+        LBUF { txt = "Real time (30)"; },
+        LBUF { txt = "Abs. very low (100)"; },
+        LBUF { txt = "Abs. low (200)"; },
+        LBUF { txt = "Abs. backgr. (300)"; },
+        LBUF { txt = "Abs. foregr. (400)"; },
+        LBUF { txt = "Abs. high (500)"; }
+        };
+    } 
+
+RESOURCE ARRAY r_cpuloadmode_textarray
+    {
+    items =
+        {
+        LBUF { txt = "Yielding"; },
+        LBUF { txt = "Blocking"; }
+        };
+    } 
+    
+RESOURCE ARRAY r_cpuloadtype_textarray
+    {
+    items =
+        {
+        LBUF { txt = "Continuous"; },
+        LBUF { txt = "Periodic"; }
+        };
+    }       
+
+RESOURCE ARRAY r_cpuloadcpu_textarray
+    {
+    items =
+        {
+        LBUF { txt = "CPU0"; }
+        };
+    }       
+
+RESOURCE ARRAY r_memoryeatsource_textarray
+    {
+    items =
+        {
+        LBUF { txt = "RAM"; },
+        LBUF { txt = "C:"; },
+        LBUF { txt = "D:"; },
+        LBUF { txt = "E:"; },
+        LBUF { txt = "F:"; },
+        LBUF { txt = "G:"; },
+        LBUF { txt = "H:"; },
+        LBUF { txt = "I:"; },
+        LBUF { txt = "J:"; },
+        LBUF { txt = "K:"; },
+        LBUF { txt = "L:"; },
+        LBUF { txt = "M:"; },
+        LBUF { txt = "N:"; }
+        };
+    }
+    
+RESOURCE ARRAY r_memoryeattype_textarray
+    {
+    items =
+        {
+        LBUF { txt = "Memory to eat"; },
+        LBUF { txt = "Memory to be left"; },
+        LBUF { txt = "Alternate min/max"; }
+        };
+    }
+    
+RESOURCE ARRAY r_message_type_textarray
+    {
+    items =
+        {
+        LBUF { txt = "SMS"; },
+        LBUF { txt = "MMS"; }
+        };
+    } 
+
+RESOURCE ARRAY r_applications_keypress_type_textarray
+    {
+    items =
+        {
+        LBUF { txt = "None"; },
+        LBUF { txt = "Arrow keys"; }
+        };
+    } 
+
+RESOURCE ARRAY r_photocapturedevice_textarray
+    {
+    items =
+        {
+        LBUF { txt = "Camera 1"; }
+        };
+    } 
+
+
+RESOURCE LOCALISABLE_APP_INFO r_loadgen_localisable_app_info
+    {
+    short_caption = "LoadGen";
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = "Load Gener.";
+
+        number_of_icons = 1;
+
+        // Note for ROM-based apps it is recommended to add the drive letter
+        // icon_file = "z:"APP_BITMAP_DIR"\\myapp_aif.mif";
+        icon_file = APP_BITMAP_DIR"\\loadgen_aif.mif";
+        };
+    }
+
+
+
+// ---------------------------------------------------------
+//   
+//    RESOURCE LOCALISABLE_APP_INFO
+//
+// ---------------------------------------------------------
+//
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/data/loadgen_reg.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <loadgen.rsg>
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x20011384
+
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "LoadGen";
+    localisable_resource_file = APP_RESOURCE_DIR"\\LoadGen";
+    localisable_resource_id = R_LOADGEN_LOCALISABLE_APP_INFO;
+    group_name = "RnD Tools";    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* ============================================================================
+*  Name        : bld.inf
+*  Part of     : LoadGen / LoadGenUI
+*  Description : Build information file for project LoadGen
+*  Version     : %version: 1 %
+*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+PRJ_PLATFORMS
+
+WINSCW ARMV5
+
+
+PRJ_EXPORTS
+../rom/loadgen.iby CORE_IBY_EXPORT_PATH(tools,loadgen.iby)
+
+PRJ_MMPFILES
+
+
+loadgen.mmp
+
+
+PRJ_TESTMMPFILES
+
+
+PRJ_TESTEXPORTS
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/group/loadgen.mmp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET            LoadGen.exe
+TARGETTYPE        exe
+EPOCSTACKSIZE     0x5000
+EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
+
+UID               0x100039CE 0x20011384
+
+VENDORID          VID_DEFAULT
+CAPABILITY        swevent ReadUserData WriteUserData NetworkServices UserEnvironment CAP_APPLICATION AllFiles
+
+LANG              SC
+
+SMPSAFE
+
+START RESOURCE    ../data/loadgen.rss
+HEADER
+TARGETPATH        APP_RESOURCE_DIR
+END
+
+START RESOURCE    ../data/loadgen_reg.rss
+DEPENDS           loadgen.rsg
+TARGETPATH        /private/10003a3f/apps
+END
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE       ../inc
+SOURCEPATH        ../src
+
+SOURCE            loadgen_app.cpp
+SOURCE            loadgen_document.cpp 
+SOURCE            loadgen_appui.cpp
+SOURCE            loadgen_model.cpp
+SOURCE            loadgen_mainview.cpp 
+SOURCE            loadgen_maincontainer.cpp 
+SOURCE            loadgen_settingsviewdlg.cpp
+SOURCE            loadgen_editors.cpp
+
+USERINCLUDE       ../../../engine/inc
+SOURCEPATH        ../../../engine/src
+
+
+
+SOURCE            loadgen_loadbase.cpp
+SOURCE            loadgen_cpuload.cpp
+SOURCE            loadgen_memoryeat.cpp
+SOURCE            loadgen_phonecall.cpp
+SOURCE            loadgen_netconn.cpp
+SOURCE            loadgen_keypress.cpp
+SOURCE            loadgen_messages.cpp 
+SOURCE            loadgen_applications.cpp 
+SOURCE 			  loadgen_photocapture.cpp
+SOURCE			  loadgen_bluetooth.cpp 
+SOURCE			  loadgen_pointerevent.cpp
+SOURCE			  loadgen_utils.cpp
+
+LIBRARY           euser.lib
+LIBRARY           commonengine.lib
+LIBRARY           apparc.lib
+LIBRARY           cone.lib 
+LIBRARY           eikcore.lib
+LIBRARY           eikcoctl.lib
+LIBRARY           eikctl.lib
+LIBRARY           eikdlg.lib  
+LIBRARY           avkon.lib 
+LIBRARY           ws32.lib 
+LIBRARY           apgrfx.lib
+LIBRARY           efsrv.lib
+LIBRARY           bafl.lib
+LIBRARY           gdi.lib
+LIBRARY           aknicon.lib
+LIBRARY           aknskins.lib
+LIBRARY           aknskinsrv.lib
+LIBRARY           egul.lib
+LIBRARY           etel3rdparty.lib
+LIBRARY           downloadmgr.lib
+LIBRARY           commdb.lib
+LIBRARY           flogger.lib
+LIBRARY           estor.lib 
+LIBRARY           msgs.lib
+LIBRARY           smcm.lib
+LIBRARY           gsmu.lib
+LIBRARY           etext.lib
+LIBRARY           sendas2.lib
+LIBRARY  		  ecam.lib
+LIBRARY			  featdiscovery.lib 
+LIBRARY			  centralrepository.lib
+LIBRARY           esock.lib
+LIBRARY           bluetooth.lib
+LIBRARY			  hal.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_app.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_APP_H
+#define LOADGEN_APP_H
+
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidLoadGen = { 0x20011384 };
+
+// CLASS DECLARATION
+
+/**
+* CLoadGenApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CLoadGenApp : public CAknApplication
+    {
+    
+    public: // Functions from base classes
+        /**
+        * From CApaApplication, overridden to enable INI file support.
+        * @return A pointer to the dictionary store
+        */
+    CDictionaryStore* OpenIniFileLC(RFs& aFs) const;
+    private:
+
+        /**
+        * From CApaApplication, creates CLoadGenDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidLoadGen).
+        * @return The value of KUidLoadGen.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_appui.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_APPUI_H
+#define LOADGEN_APPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknViewAppUi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include "loadgen_std.h"
+
+// FORWARD DECLARATIONS
+class CLoadGenModel;
+class CAknNavigationControlContainer;
+class CAknTabGroup;
+class CAknNavigationDecorator;
+
+
+// CLASS DECLARATIONS
+
+class CLoadGenAppUi : public CAknViewAppUi
+    {
+public: // constructors and destructor
+    void ConstructL();
+    ~CLoadGenAppUi();
+    
+private: // From MEikMenuObserver
+    void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+private:
+    void HandleCommandL(TInt aCommand);
+
+    virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+
+private: //Data
+    CLoadGenModel*                  iModel;
+    CAknNavigationControlContainer* iNaviPane;
+    CAknTabGroup*                   iTabGroup;
+    CAknNavigationDecorator*        iDecoratedTabGroup;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_document.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_DOCUMENT_H
+#define LOADGEN_DOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CLoadGenModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CLoadGenDocument application class.
+*/
+class CLoadGenDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        static CLoadGenDocument* NewL(CEikApplication& aApp);
+        virtual ~CLoadGenDocument();
+
+    public: // New functions
+
+    public:// from CEikDocument
+    CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
+    protected:  // New functions
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * EPOC default constructor.
+        */
+        CLoadGenDocument(CEikApplication& aApp);
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CLoadGenAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    public:
+        inline CLoadGenModel* Model() { return iModel; }
+
+    private:
+        CLoadGenModel* iModel;
+
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_editors.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,339 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_EDITORS_H
+#define LOADGEN_EDITORS_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <AknForm.h> 
+
+#include "loadgen_loadattributes.h"
+
+
+// FORWARD DECLARATIONS
+class CAknQueryValueText;
+class CAknQueryValueTextArray;
+
+// CLASS DECLARATIONS
+
+class CLoadGenLoadTypeEditorBase : public CAknForm
+    {
+protected: // Constructors
+    CLoadGenLoadTypeEditorBase(TBool aEditingExisting);
+    void ConstructL(const TDesC& aTitleText);        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+
+protected:  // New methods
+    virtual TBool DoRunQueryLD(TInt aResource);
+    
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+protected:  // New methods
+    void InsertFieldAfterL(TInt aResourceId, TInt aControlId, TInt aPrevControlId);
+    void UpdateFormL();
+
+protected: // Data
+    TBool iEditingExisting;
+    };
+
+
+
+
+class CLoadGenCPULoadEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenCPULoadEditor* NewL(TCPULoadAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenCPULoadEditor();
+
+private: // Constructors
+    CLoadGenCPULoadEditor(TCPULoadAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    void LoadCPUsL();
+    
+private: // Data
+    TCPULoadAttributes&         iAttributes;
+    CAknQueryValueText*         iCpuQueryValText;
+    CAknQueryValueTextArray*    iCpuTextArray;
+    CDesCArray*                 iCPUsArray;
+    };
+
+
+
+
+class CLoadGenMemoryEatEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenMemoryEatEditor* NewL(TMemoryEatAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenMemoryEatEditor();
+
+private: // Constructors
+    CLoadGenMemoryEatEditor(TMemoryEatAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    void UpdateAvailableMemoryL();
+
+private: // Data
+    TMemoryEatAttributes&              iAttributes;
+    }; 
+
+
+
+class CLoadGenPhoneCallEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenPhoneCallEditor* NewL(TPhoneCallAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenPhoneCallEditor();
+
+private: // Constructors
+    CLoadGenPhoneCallEditor(TPhoneCallAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    
+private: // Data
+    TPhoneCallAttributes&              iAttributes;
+    };
+
+
+
+class CLoadGenNetConnEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenNetConnEditor* NewL(TNetConnAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenNetConnEditor();
+
+private: // Constructors
+    CLoadGenNetConnEditor(TNetConnAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    
+private: // Data
+    TNetConnAttributes&              iAttributes;
+    };
+    
+ 
+ 
+
+class CLoadGenKeyPressEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenKeyPressEditor* NewL(TKeyPressAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenKeyPressEditor();
+
+private: // Constructors
+    CLoadGenKeyPressEditor(TKeyPressAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    
+private: // Data
+    TKeyPressAttributes&              iAttributes;
+    };
+
+class CLoadGenPointerEventEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenPointerEventEditor* NewL(TPointerEventAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenPointerEventEditor();
+
+private: // Constructors
+    CLoadGenPointerEventEditor(TPointerEventAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    
+private: // Data
+    TPointerEventAttributes&              iAttributes;
+    };
+
+
+
+class CLoadGenMessagesEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenMessagesEditor* NewL( TMessageAttributes& aAttributes, 
+                                         TBool aEditingExisting = EFalse );
+    virtual ~CLoadGenMessagesEditor();
+
+private: // Constructors
+    CLoadGenMessagesEditor( TMessageAttributes& aAttributes, 
+                            TBool aEditingExisting = EFalse );
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL( TInt aButtonId );    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL( TInt aControlId );
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL( TBool aFormInit = EFalse );
+    
+private: // Data
+    TMessageAttributes&              iAttributes;
+    };
+
+class CLoadGenApplicationsEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenApplicationsEditor* NewL( TApplicationsAttributes& aAttributes, 
+                                         TBool aEditingExisting = EFalse );
+    virtual ~CLoadGenApplicationsEditor();
+
+private: // Constructors
+    CLoadGenApplicationsEditor( TApplicationsAttributes& aAttributes, 
+                            TBool aEditingExisting = EFalse );
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL( TInt aButtonId );    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL( TInt aControlId );
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL( TBool aFormInit = EFalse );
+    
+private: // Data
+    TApplicationsAttributes&              iAttributes;
+    };
+
+class CLoadGenPhotoCaptureEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenPhotoCaptureEditor* NewL(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenPhotoCaptureEditor();
+
+private: // Constructors
+    CLoadGenPhotoCaptureEditor(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    void LoadCamerasL();
+    
+private: // Data
+    TPhotoCaptureAttributes&    iAttributes;
+    CAknQueryValueText*         iCameraQueryValText;
+    CAknQueryValueTextArray*    iCameraTextArray;
+    CDesCArray*                 iCamerasArray;
+    };
+
+class CLoadGenBluetoothEditor : public CLoadGenLoadTypeEditorBase
+    {
+public:
+    static CLoadGenBluetoothEditor* NewL(TBluetoothAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    virtual ~CLoadGenBluetoothEditor();
+
+private: // Constructors
+    CLoadGenBluetoothEditor(TBluetoothAttributes& aAttributes, TBool aEditingExisting=EFalse);
+    void ConstructL();        
+
+protected:  // From CEikDialog
+    TBool OkToExitL(TInt aButtonId);    
+    void PreLayoutDynInitL();
+    void HandleControlStateChangeL(TInt aControlId);
+        
+public:  // New methods
+    virtual TBool RunQueryLD();
+
+private:  // New methods
+    void UpdateVisibilitiesOfFieldsL(TBool aFormInit=EFalse);
+    
+private: // Data
+    TBluetoothAttributes&              iAttributes;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_maincontainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_VALUESCONTAINER_H
+#define LOADGEN_VALUESCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h> 
+#include <aknlists.h> 
+
+// FORWARD DECLARATIONS
+class CLoadGenModel;
+class CLoadGenCAknSingleGraphicStyleListBox;
+
+// CLASS DECLARATIONS
+
+class CLoadGenMainContainer : public CCoeControl, MCoeControlObserver, MEikListBoxObserver
+    {
+public:
+    void ConstructL(const TRect& aRect);
+    ~CLoadGenMainContainer();
+
+private:
+    void SizeChanged();  
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl(TInt aIndex) const;
+    void Draw(const TRect& aRect) const;
+    void HandleResourceChange(TInt aType);
+    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);  // From MEikListBoxObserver
+    void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);  // From MCoeControlObserver
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+public:
+    const CArrayFix<TInt>* ListBoxSelectionIndexes();
+    TInt ListBoxSelectionIndexesCount();
+    void SetDefaultTitlePaneTextL();
+    TInt CurrentListBoxItemIndex();
+    void SetListBoxTextArrayL(CDesCArray* aTextArray);
+    inline CLoadGenCAknSingleGraphicStyleListBox* ListBox() { return iListBox; }
+
+private:
+    CLoadGenModel*                              iModel;
+    CLoadGenCAknSingleGraphicStyleListBox*      iListBox;
+    };
+
+class CLoadGenCAknSingleGraphicStyleListBox : public CAknSingleGraphicStyleListBox
+    {
+    void SizeChanged();
+    void SizeChangedL();
+    };
+        
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_mainview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_VALUESVIEW_H
+#define LOADGEN_VALUESVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+
+#include "loadgen_std.h"
+
+
+
+// CONSTANTS
+// UID of view
+const TUid KMainViewUID = {1};
+
+
+// FORWARD DECLARATIONS
+class CLoadGenMainContainer;
+class CLoadGenModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CLoadGenMainView view class.
+* 
+*/
+class CLoadGenMainView : public CAknView
+    {
+    public: // Constructors and destructor
+        void ConstructL();
+        ~CLoadGenMainView();
+
+    public: // Functions from base classes
+        TUid Id() const;
+        void HandleCommandL(TInt aCommand);
+        void HandleClientRectChange();
+
+    private: // From MEikMenuObserver
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+
+    private: // From AknView
+        void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage);
+        void DoDeactivate();
+
+    private: // Data
+        CLoadGenMainContainer*        iContainer;
+        CLoadGenModel*                  iModel;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_model.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_MODEL_H
+#define LOADGEN_MODEL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <apgcli.h>
+
+#include "loadgen_loadattributes.h"
+
+// FORWARD DECLARATIONS
+class CLoadGenMainContainer;
+class CLoadGenGraphsContainer;
+class CEikonEnv;
+class CLoadBase;
+
+
+typedef CArrayFixSeg<CLoadBase*> CLoadItemList;
+
+const TUint KMaxCPUs = 4;
+
+// CLASS DECLARATIONS
+
+class TLoadGenSettings
+    {
+public:
+    };
+
+class CLoadGenModel : public CActive
+    {
+private:
+    enum TContainerDrawState
+        {
+        EDrawStateInvalid = -1,
+        EDrawStateMain
+        };
+
+public:
+    static CLoadGenModel* NewL();
+    ~CLoadGenModel();
+    void ActivateModelL();
+    void DeActivateModelL();
+
+private:
+    void RunL();
+    void DoCancel();
+        
+private:
+    CLoadGenModel();
+    void ConstructL();
+    void LoadSettingsL();
+    void EditLoadL(CLoadBase* aItem);
+    void DoStartNewLoadL(TInt aCommand);
+    void AppendToLoadItemListL(CLoadBase* aItem);
+    void DeleteFromLoadItemListL(TInt aIndex);
+    void SuspendOrResumeFromLoadItemListL(TInt aIndex);
+    void DeleteAllLoadItems();
+    void RefreshViewL(TBool aClearSelection=ETrue);
+    CDesCArray* ListOfAllAppsL();    
+    
+public:
+    void StopAllLoadItemsL();
+    void SuspendAllLoadItemsL();
+    void ResumeAllLoadItemsL();
+            
+    TInt LoadItemCount() const;
+    void ShowItemActionMenuL();
+    void StopSelectedOrHighlightedItemsL();
+    void SuspendOrResumeSelectedOrHighlightedItemsL();
+
+    CDesCArray* GenerateListBoxItemTextArrayL();
+    void StartNewLoadL(TInt aCommand);
+    void SaveSettingsL();
+    void SetMainContainer(CLoadGenMainContainer* aContainer);
+    TInt LaunchSettingsDialogL();
+    inline TLoadGenSettings& Settings() { return iSettings; }
+    inline CEikonEnv* EikonEnv() { return iEnv; }
+    inline RApaLsSession& LsSession() { return iLs; }
+    inline CLoadGenMainContainer* MainContainer() { return iMainContainer; }
+    inline TBool LoadItemsExists() { return iLoadItemList->Count() > 0; } 
+
+
+private:
+    RTimer                          iTimer;
+    CLoadGenMainContainer*          iMainContainer;
+    CEikonEnv*                      iEnv;
+    TLoadGenSettings                iSettings;
+    RApaLsSession                   iLs;
+    TInt                            iDrawState;
+    CLoadItemList*                  iLoadItemList;
+    TInt                            iReferenceNumber;
+    TCPULoadAttributes              iCpuLoadAttributes;
+    TMemoryEatAttributes            iMemoryEatAttributes;
+    TPhoneCallAttributes            iPhoneCallAttributes;
+    TNetConnAttributes              iNetConnAttributes;
+    TKeyPressAttributes             iKeyPressAttributes;
+    TMessageAttributes              iMessageAttributes;
+    TApplicationsAttributes			iApplicationsAttributes;
+    TPhotoCaptureAttributes         iPhotoCaptureAttributes;
+    TBluetoothAttributes            iBluetoothAttributes;
+    TPointerEventAttributes         iPointerEventAttributes;
+    static TInt64                   iRandomNumberSeed;
+    };
+ 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/inc/loadgen_settingsviewdlg.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_SETTINGSVIEWDLG_H
+#define LOADGEN_SETTINGSVIEWDLG_H
+
+//  INCLUDES
+#include <AknDialog.h>
+#include <eiklbo.h>
+#include <AknTabObserver.h> 
+#include <akntabgrp.h>
+
+//  FORWARD DECLARATIONS
+class CAknSettingItemArray;
+class CAknSettingStyleListBox;
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+class CAknTabGroup; 
+class TLoadGenSettings;
+
+
+//  CLASS DEFINITIONS
+
+class CLoadGenSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
+    {
+public:
+    static CLoadGenSettingsViewDlg* NewL(TLoadGenSettings& aSettings);
+    virtual ~CLoadGenSettingsViewDlg();
+
+public: // From MEikListBoxObserver
+    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+public: // From MAknTabObserver
+    void TabChangedL(TInt aIndex); 
+
+public: // From CAknDialog
+    void ProcessCommandL(TInt aCommandId);
+
+protected: // From CEikDialog
+    TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
+    void PreLayoutDynInitL();
+    TBool OkToExitL(TInt aButtonId);    
+
+private: // New methods
+    void ShowSettingPageL(TBool aCalledFromMenu);
+    void SetVisibilitiesOfSettingItemsL();
+    void UpdateListBoxL();
+    void AddSettingItemL(TInt aId, TInt aTitleResource, TInt aSettingPageResource, TInt aAssociatedResource, TInt aOrdinal);
+
+private: // Constructors
+    CLoadGenSettingsViewDlg(TLoadGenSettings& aSettings);
+    void ConstructL();        
+
+private: // Data
+    CAknSettingItemArray*               iSettingItemArray;
+    CAknSettingStyleListBox*            iListBox;
+    CAknNavigationControlContainer*     iNaviContainer;
+    CAknNavigationDecorator*            iDecoratedTabGroup;
+    CAknTabGroup*                       iTabGroup;
+    TLoadGenSettings&               iSettings;
+    };
+
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_app.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_app.h"
+#include "loadgen_document.h"
+
+#include <eikstart.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CLoadGenApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CLoadGenApp::AppDllUid() const
+    {
+    return KUidLoadGen;
+    }
+
+// ---------------------------------------------------------
+// CDictionaryStore* CLoadGenApp::OpenIniFileLC(RFs& aFs) const
+// overrides CAknApplication::OpenIniFileLC to enable INI file support
+// ---------------------------------------------------------
+//
+CDictionaryStore* CLoadGenApp::OpenIniFileLC(RFs& aFs) const
+    {
+    return CEikApplication::OpenIniFileLC(aFs);
+    }
+   
+// ---------------------------------------------------------
+// CLoadGenApp::CreateDocumentL()
+// Creates CLoadGenDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CLoadGenApp::CreateDocumentL()
+    {
+    return CLoadGenDocument::NewL( *this );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CLoadGenApp;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+   
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_appui.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_appui.h"
+#include "loadgen_mainview.h"
+#include "loadgen.hrh"
+#include "loadgen_model.h"
+#include "loadgen_document.h"
+#include <loadgen.rsg>
+
+#include <avkon.hrh>
+#include <AknQueryDialog.h>
+#include <aknmessagequerydialog.h> 
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+void CLoadGenAppUi::ConstructL()
+    {
+    // disable window server priority control for this application
+    iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled );
+    
+    // set as system application to prevent getting shut down events 
+    iEikonEnv->SetSystem(ETrue);
+        
+
+    BaseConstructL(EAknEnableSkin);
+
+    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+
+    CLoadGenMainView* mainView = new(ELeave) CLoadGenMainView;
+    CleanupStack::PushL(mainView);
+    mainView->ConstructL();
+    AddViewL(mainView);           // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();          // mainView
+    
+    SetDefaultViewL(*mainView);
+
+    // notify the model that everything has been constructed
+    iModel->ActivateModelL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenAppUi::~CLoadGenAppUi()
+    {
+    // notify the model that the application is closing 
+    if (iModel)   
+        TRAP_IGNORE(iModel->DeActivateModelL());
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    if (aResourceId == R_LOADGEN_APP_MENU)
+        {
+        aMenuPane->SetItemDimmed(ELoadGenStopAll, !iModel->LoadItemsExists());
+        aMenuPane->SetItemDimmed(ELoadGenSuspendAll, !iModel->LoadItemsExists());
+        aMenuPane->SetItemDimmed(ELoadGenResumeAll, !iModel->LoadItemsExists());
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CLoadGenAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
+    {
+    return EKeyWasNotConsumed;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch ( aCommand )
+        {
+        case ELoadGenCmdLaunchPerfMon:
+            {
+            // launch Performance Monitor
+            const TUid KUidPerfMon = { 0x20011385 };
+            
+            RWsSession ws;
+            User::LeaveIfError( ws.Connect() );
+            CleanupClosePushL(ws);
+            
+            RApaLsSession ls;
+            User::LeaveIfError( ls.Connect() );
+            CleanupClosePushL(ls);
+            
+            
+            // try to find the task of PerfMon
+            TApaTaskList tasklist(ws);
+            TApaTask task = tasklist.FindApp(KUidPerfMon);
+
+            if (task.Exists())
+                {
+                // task exists, bring it to foreground
+                task.BringToForeground();
+                }
+            else
+                {
+                TApaAppInfo appInfo;
+                User::LeaveIfError(ls.GetAppInfo(appInfo, KUidPerfMon));
+                
+                CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+                cmdLine->SetExecutableNameL(appInfo.iFullName);
+                cmdLine->SetCommandL(EApaCommandBackground);
+
+                // start the app
+                User::LeaveIfError(ls.StartApp(*cmdLine));
+                
+                CleanupStack::PopAndDestroy(); //cmdLine                
+                }
+            
+            CleanupStack::PopAndDestroy(2); //ws,ls
+            }
+            break;
+            
+        case ELoadGenCmdAbout:
+            {
+            CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+            dialog->ExecuteLD(R_LOADGEN_ABOUT_DIALOG);
+            }
+            break;
+            
+        // a normal way to close an application
+        case EAknCmdExit:
+        case EEikCmdExit:
+        case EAknSoftkeyExit: 
+            {
+            Exit();
+            }
+            break;
+
+        default:
+            break;      
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_document.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_document.h"
+#include "loadgen_appui.h"
+#include "loadgen_model.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CLoadGenDocument::CLoadGenDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+// ----------------------------------------------------
+
+// destructor
+CLoadGenDocument::~CLoadGenDocument()
+    {
+    delete iModel;
+    }
+
+// ----------------------------------------------------
+
+// EPOC default constructor can leave.
+void CLoadGenDocument::ConstructL()
+    {
+    iModel = CLoadGenModel::NewL();
+    }
+
+// ----------------------------------------------------
+
+// Two-phased constructor.
+CLoadGenDocument* CLoadGenDocument::NewL(CEikApplication& aApp)
+    {
+    CLoadGenDocument* self = new(ELeave) CLoadGenDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CLoadGenDocument::CreateAppUiL()
+// constructs CLoadGenAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CLoadGenDocument::CreateAppUiL()
+    {
+    return new (ELeave) CLoadGenAppUi;
+    }
+
+// ----------------------------------------------------
+// CLoadGenDocument::OpenFileL
+// Overrides CAknDocument::OpenFileL to support document file
+// ----------------------------------------------------
+//
+CFileStore* CLoadGenDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
+    {
+    return CEikDocument::OpenFileL(aDoOpen, aFilename, aFs);
+    }
+
+// ----------------------------------------------------
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_editors.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1437 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_editors.h"
+#include "loadgen_loadattributes.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <AknForm.h> 
+#include <eikedwin.h> 
+#include <eikmfne.h>
+#include <AknPopupFieldText.h>
+#include <AknQueryValueText.h>
+#include <eikspane.h> 
+#include <akntitle.h> 
+#include <eikcapc.h>
+#include <e32hal.h> 
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenLoadTypeEditorBase::CLoadGenLoadTypeEditorBase(TBool aEditingExisting):
+    iEditingExisting(aEditingExisting)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenLoadTypeEditorBase::ConstructL(const TDesC& aTitleText)
+    {
+    CAknForm::ConstructL();
+
+    // set title text
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( aTitleText );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenLoadTypeEditorBase::PreLayoutDynInitL()
+    {
+    CAknForm::PreLayoutDynInitL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenLoadTypeEditorBase::OkToExitL(TInt /*aButtonId*/)
+    {
+    return ETrue;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(TInt aControlId)
+    {
+    CAknForm::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenLoadTypeEditorBase::RunQueryLD()
+    {
+    User::Panic(_L("Unk.form"), 222);
+    
+    return ETrue;
+    }
+               
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenLoadTypeEditorBase::DoRunQueryLD(TInt aResource)
+    {
+    return ExecuteLD(aResource);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenLoadTypeEditorBase::InsertFieldAfterL(TInt aResourceId, TInt aControlId, TInt aPrevControlId)
+    {
+    CCoeControl* prevControl = Control(aPrevControlId);
+    __ASSERT_DEBUG(prevControl, User::Panic(_L("Form.Ctrl.Null"), 111));
+    TInt pos = FindLineIndex(*prevControl);
+    pos = pos + 1;
+    InsertLineL(pos, aResourceId);
+    Line(aControlId)->ActivateL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenLoadTypeEditorBase::UpdateFormL()
+    {
+    UpdatePageL(ETrue);
+    }
+               
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenCPULoadEditor* CLoadGenCPULoadEditor::NewL(TCPULoadAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenCPULoadEditor* self = new(ELeave) CLoadGenCPULoadEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenCPULoadEditor::~CLoadGenCPULoadEditor()
+    {
+    delete iCpuQueryValText;
+    delete iCpuTextArray;
+    delete iCPUsArray;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenCPULoadEditor::CLoadGenCPULoadEditor(TCPULoadAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCPULoadEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("CPU load"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCPULoadEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryPriority));
+    CAknPopupFieldText* edMode = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryMode));
+    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryType));
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edMode->SetCurrentValueIndex(iAttributes.iMode);
+    edType->SetCurrentValueIndex(iAttributes.iType);
+    
+    LoadCPUsL();
+
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCPULoadEditor::LoadCPUsL()
+    {
+    // if we are running in SMP environment
+    if (iAttributes.iCpuCount > 1)
+        {
+        // insert possibility to select which cpu the load is generated to
+        InsertFieldAfterL(R_CPULOAD_DLG_LINE_CPU, ELoadGenCPULoadQueryCpu, ELoadGenCPULoadQueryType);
+
+        iCPUsArray = new (ELeave) CDesCArrayFlat( 5 );
+        
+        // "Free scheduling" means that no specific cpu is selected. Scheduler desides
+        // which CPUu runs load thread at which time.
+        iCPUsArray->AppendL(_L("Free scheduling"));
+        
+        // add CPUs
+        for (int i = 0; i < iAttributes.iCpuCount; i++) 
+            {
+            TBuf<10> cpu;
+            _LIT(KCPU, "CPU%d");
+            cpu.Format(KCPU, i);
+            iCPUsArray->AppendL(cpu);
+            }
+        
+        // "All CPUs" means that one thread is started for each CPU.
+        iCPUsArray->AppendL(_L("All CPUs"));
+    
+        iCpuTextArray = CAknQueryValueTextArray::NewL();
+        iCpuTextArray->SetArray( *iCPUsArray );  
+        iCpuQueryValText = CAknQueryValueText::NewL();    
+        iCpuQueryValText->SetArrayL( iCpuTextArray );
+        // CPU is not defined, set "Free scheduling" as default selection in query list
+        if (iAttributes.iCpu < 0)
+            {
+            iCpuQueryValText->SetCurrentValueIndex(0);
+            }
+        // "All CPUs" selected. It is last choise in the selection list.
+        else if (iAttributes.iCpu == KCPUSelection_AllCPUs)
+            {
+            iCpuQueryValText->SetCurrentValueIndex(iCpuTextArray->MdcaCount()-1);
+            }
+        // CPU is defined, set the correct CPU as default selection in query list
+        else
+            {
+            // iCpu starts from zero (i.e. CPU0 is first CPU), but index zero
+            // in iCpuQueryValText is "Free scheduling", hence iCpu+1.
+            iCpuQueryValText->SetCurrentValueIndex(iAttributes.iCpu+1);
+            }
+
+        CAknPopupField* popup = static_cast<CAknPopupField*>(Control( ELoadGenCPULoadQueryCpu)); 
+        popup->SetQueryValueL( iCpuQueryValText );
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenCPULoadEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryPriority));
+        CAknPopupFieldText* edMode = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryMode));
+        CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenCPULoadQueryType));
+        CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryLength));
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenCPULoadQueryVariance));
+        
+        // we are running in SMP environment
+        if (iAttributes.iCpuCount > 1)
+            {
+            TInt currentValueIndex = iCpuQueryValText->CurrentValueIndex();
+            // user selected a specific CPU in which the load thread should be run in.
+            if (currentValueIndex == 0)
+                {
+                // User selected "Free scheduling"
+                iAttributes.iCpu = KCPUSelection_FreeScheduling;
+                }            
+            else if( currentValueIndex == iCpuTextArray->MdcaCount()-1 )
+                {
+                // User selected "All CPUs", which is the last item in the selection list
+                iAttributes.iCpu = KCPUSelection_AllCPUs;
+                }
+            else
+                {                
+                // iCpu should start from zero (CPU0 is the first cpu)
+                // but zero in currentValueIndex means "Free scheduling". CPU0 in
+                // currentValueIndex is at index 1, hence -1.
+                iAttributes.iCpu = currentValueIndex - 1;
+                }
+            }
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iMode = edMode->CurrentValueIndex();
+        iAttributes.iType = edType->CurrentValueIndex();
+        if (edPeak) iAttributes.iLength = edPeak->Number();
+        if (edIdle) iAttributes.iIdle = edIdle->Number();
+        if (edVariance) iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCPULoadEditor::UpdateVisibilitiesOfFieldsL(TBool aFormInit)
+    {
+    // filter based on selected cpu load type
+    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>( Control( ELoadGenCPULoadQueryType ) );
+
+    if ( !aFormInit && edType->CurrentValueIndex() == ECpuLoadTypeContinuous )
+        {
+        // save values before deleting the items
+        CCoeControl* control = ControlOrNull( ELoadGenCPULoadQueryLength );
+        if ( control )
+            {
+            CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>( control );
+            iAttributes.iLength = edPeak->Number();
+            DeleteLine( ELoadGenCPULoadQueryLength );
+            control = NULL;
+            }
+        control = ControlOrNull( ELoadGenCPULoadQueryIdle );
+        if ( control )
+            {
+            CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>( control );
+            iAttributes.iIdle = edIdle->Number();
+            DeleteLine( ELoadGenCPULoadQueryIdle );
+            control = NULL;
+            }
+        control = ControlOrNull( ELoadGenCPULoadQueryVariance );
+        if ( control )
+            {
+            CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>( control );
+            iAttributes.iRandomVariance = edVariance->Number();
+            DeleteLine( ELoadGenCPULoadQueryVariance );
+            }
+        }
+    else if ( edType->CurrentValueIndex() == ECpuLoadTypePeriodic )
+        {
+        // insert new fields
+        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_LENGTH, ELoadGenCPULoadQueryLength, ELoadGenCPULoadQueryType);
+        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_IDLE, ELoadGenCPULoadQueryIdle, ELoadGenCPULoadQueryLength);
+        InsertFieldAfterL(R_CPULOAD_DLG_LINE_PERIODIC_VARIANCE, ELoadGenCPULoadQueryVariance, ELoadGenCPULoadQueryIdle);
+        
+        // load values to just created editors
+        CEikNumberEditor* edPeak = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryLength));
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenCPULoadQueryVariance));
+        edPeak->SetNumber(iAttributes.iLength);
+        edIdle->SetNumber(iAttributes.iIdle);
+        edVariance->SetNumber(iAttributes.iRandomVariance);
+        }
+
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCPULoadEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+
+    // update visibilities of fields    
+    if (aControlId == ELoadGenCPULoadQueryType)
+        {
+        UpdateVisibilitiesOfFieldsL();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenCPULoadEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_CPULOAD_FORM_DIALOG);
+    }
+       
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMemoryEatEditor* CLoadGenMemoryEatEditor::NewL(TMemoryEatAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenMemoryEatEditor* self = new(ELeave) CLoadGenMemoryEatEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMemoryEatEditor::~CLoadGenMemoryEatEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMemoryEatEditor::CLoadGenMemoryEatEditor(TMemoryEatAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMemoryEatEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Memory eat"));
+    
+    // convert int64 vals to descs
+    iAttributes.iAmountDes.Copy(KNullDesC);
+    iAttributes.iRandomMinDes.Copy(KNullDesC);
+    iAttributes.iRandomMaxDes.Copy(KNullDesC);
+    
+    iAttributes.iAmountDes.AppendNum(iAttributes.iAmount);
+    iAttributes.iRandomMinDes.AppendNum(iAttributes.iRandomMin);
+    iAttributes.iRandomMaxDes.AppendNum(iAttributes.iRandomMax);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMemoryEatEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryPriority));
+    CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQuerySource));
+    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
+    CEikNumberEditor* edBuffer = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryBuffer));
+    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryIdle));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edSource->SetCurrentValueIndex(iAttributes.iSource);
+    edType->SetCurrentValueIndex(iAttributes.iType);
+    edBuffer->SetNumber(iAttributes.iBuffer);
+    edIdle->SetNumber(iAttributes.iIdle);
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+            
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    UpdateAvailableMemoryL();
+    
+    // set source as dimmed if editing existing item
+    if (iEditingExisting)
+        {
+        SetLineDimmedNow(ELoadGenMemoryEatQuerySource, ETrue); 
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenMemoryEatEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryPriority));
+        CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQuerySource));
+        CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
+        CEikNumberEditor* edBuffer = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryBuffer));
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenMemoryEatQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iSource = edSource->CurrentValueIndex();
+        iAttributes.iType = edType->CurrentValueIndex();
+        iAttributes.iBuffer = edBuffer->Number();
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+
+
+        CEikEdwin* edAmount = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
+        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryRandomMin));
+        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryRandomMax));
+
+        // get desc values and convert to int64
+        if (edAmount)
+            {
+            edAmount->GetText(iAttributes.iAmountDes);
+
+            TLex converter;
+            converter.Assign(iAttributes.iAmountDes);
+            User::LeaveIfError(converter.Val(iAttributes.iAmount));
+            }
+
+        if (edRandomMin)
+            {
+            edRandomMin->GetText(iAttributes.iRandomMinDes);
+
+            TLex converter;
+            converter.Assign(iAttributes.iRandomMinDes);
+            User::LeaveIfError(converter.Val(iAttributes.iRandomMin));
+            }
+
+        if (edRandomMax)
+            {
+            edRandomMax->GetText(iAttributes.iRandomMaxDes);
+
+            TLex converter;
+            converter.Assign(iAttributes.iRandomMaxDes);
+            User::LeaveIfError(converter.Val(iAttributes.iRandomMax));
+            
+            // swap min max values if they in wrong order
+            if (iAttributes.iRandomMin > iAttributes.iRandomMax)
+                {
+                TInt64 temp(iAttributes.iRandomMin);
+                iAttributes.iRandomMin = iAttributes.iRandomMax;
+                iAttributes.iRandomMax = temp; 
+                }
+            
+            }                        
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMemoryEatEditor::UpdateVisibilitiesOfFieldsL(TBool aFormInit)
+    {
+    // filter based on selected memory eat type
+    CAknPopupFieldText* edType = static_cast<CAknPopupFieldText*>(Control(ELoadGenMemoryEatQueryType));
+
+    if (!aFormInit && (edType->CurrentValueIndex() == EMemoryEatTypeMemoryToEat || edType->CurrentValueIndex() == EMemoryEatTypeMemoryToBeLeft))
+        {
+        // no need for changes if amount field is already active
+        CEikNumberEditor* edAmount = static_cast<CEikNumberEditor*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
+        if (edAmount) return;
+        
+        // save values before deleting the items
+        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMin));
+        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMax));
+        edRandomMin->GetText(iAttributes.iRandomMinDes);
+        edRandomMax->GetText(iAttributes.iRandomMaxDes);
+        
+        DeleteLine(ELoadGenMemoryEatQueryRandomMin);
+        DeleteLine(ELoadGenMemoryEatQueryRandomMax);
+        }
+    else if (!aFormInit && edType->CurrentValueIndex() == EMemoryEatTypeWavy)
+        {
+        // save values before deleting the items
+        CEikEdwin* edAmount = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryAmount));
+        edAmount->GetText(iAttributes.iAmountDes);
+        
+        DeleteLine(ELoadGenMemoryEatQueryAmount);
+        }
+    
+    if (edType->CurrentValueIndex() == EMemoryEatTypeMemoryToEat || edType->CurrentValueIndex() == EMemoryEatTypeMemoryToBeLeft)
+        {
+        // insert new fields
+        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_AMOUNT, ELoadGenMemoryEatQueryAmount, ELoadGenMemoryEatQueryType);
+        
+        // load values to just created editors
+        CEikEdwin* edAmount = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryAmount));
+        edAmount->SetTextL(&iAttributes.iAmountDes);
+        }
+    else if (edType->CurrentValueIndex() == EMemoryEatTypeWavy)
+        {
+        // insert new fields
+        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_RANDOM_MIN, ELoadGenMemoryEatQueryRandomMin, ELoadGenMemoryEatQueryType);
+        InsertFieldAfterL(R_MEMORYEAT_DLG_LINE_RANDOM_MAX, ELoadGenMemoryEatQueryRandomMax, ELoadGenMemoryEatQueryRandomMin);
+        
+        // load values to just created editors
+        CEikEdwin* edRandomMin = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMin));
+        CEikEdwin* edRandomMax = static_cast<CEikEdwin*>(Control(ELoadGenMemoryEatQueryRandomMax));
+        edRandomMin->SetTextL(&iAttributes.iRandomMinDes);
+        edRandomMax->SetTextL(&iAttributes.iRandomMaxDes);
+        }
+    
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMemoryEatEditor::UpdateAvailableMemoryL()
+    {
+    // this feature is used only when not editing existing load
+    if (!iEditingExisting)
+        {
+        CAknPopupFieldText* edSource = static_cast<CAknPopupFieldText*>(ControlOrNull(ELoadGenMemoryEatQuerySource));
+        CEikEdwin* edAmount = static_cast<CEikEdwin*>(ControlOrNull(ELoadGenMemoryEatQueryAmount));
+        
+        if (edAmount && edSource)
+            {
+            iAttributes.iAmountDes.Copy(KNullDesC);
+
+            if (edSource->CurrentValueIndex() == EMemoryEatSourceTypeRAM)
+                {
+                // RAM
+                TMemoryInfoV1Buf ramMemory;
+                UserHal::MemoryInfo(ramMemory);
+                
+                iAttributes.iAmountDes.AppendNum(ramMemory().iFreeRamInBytes);
+                }
+            else
+                {
+                // get drive
+                TVolumeInfo volumeInfo;
+                if (CEikonEnv::Static()->FsSession().Volume(volumeInfo, edSource->CurrentValueIndex()+1) == KErrNone)
+                    {
+                    iAttributes.iAmountDes.AppendNum(volumeInfo.iFree);
+                    }
+                else
+                    {
+                    iAttributes.iAmountDes.AppendNum(0);
+                    }
+                }
+
+            edAmount->SetTextL(&iAttributes.iAmountDes);
+            }        
+        }
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMemoryEatEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    
+    // update visibilities of fields    
+    if (aControlId == ELoadGenMemoryEatQueryType)
+        {
+        UpdateVisibilitiesOfFieldsL();
+        }
+    
+    // update memory when source changes
+    else if (aControlId == ELoadGenMemoryEatQuerySource)
+        {
+        UpdateAvailableMemoryL();
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenMemoryEatEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_MEMORYEAT_FORM_DIALOG);
+    }
+
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhoneCallEditor* CLoadGenPhoneCallEditor::NewL(TPhoneCallAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenPhoneCallEditor* self = new(ELeave) CLoadGenPhoneCallEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhoneCallEditor::~CLoadGenPhoneCallEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhoneCallEditor::CLoadGenPhoneCallEditor(TPhoneCallAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhoneCallEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Phone calls"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhoneCallEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+    
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhoneCallQueryPriority));
+    CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenPhoneCallQueryDestination));
+    CEikNumberEditor* edLength = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryLength));
+    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryIdle));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edDestination->SetTextL(&iAttributes.iDestination);   
+    edLength->SetNumber(iAttributes.iLength);   
+    edIdle->SetNumber(iAttributes.iIdle);   
+    edVariance->SetNumber(iAttributes.iRandomVariance);   
+    
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPhoneCallEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhoneCallQueryPriority));
+        CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenPhoneCallQueryDestination));
+        CEikNumberEditor* edLength = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryLength));
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhoneCallQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        edDestination->GetText(iAttributes.iDestination);
+        iAttributes.iLength = edLength->Number();
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhoneCallEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhoneCallEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPhoneCallEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_PHONECALL_FORM_DIALOG);
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenNetConnEditor* CLoadGenNetConnEditor::NewL(TNetConnAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenNetConnEditor* self = new(ELeave) CLoadGenNetConnEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenNetConnEditor::~CLoadGenNetConnEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenNetConnEditor::CLoadGenNetConnEditor(TNetConnAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenNetConnEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Network conn."));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenNetConnEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+    
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenNetConnQueryPriority));
+    CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenNetConnQueryDestination));
+    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryIdle));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edDestination->SetTextL(&iAttributes.iDestination);   
+    edIdle->SetNumber(iAttributes.iIdle);   
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+       
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenNetConnEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenNetConnQueryPriority));
+        CEikEdwin* edDestination = static_cast<CEikEdwin*>(Control(ELoadGenNetConnQueryDestination));
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenNetConnQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        edDestination->GetText(iAttributes.iDestination);
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenNetConnEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenNetConnEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenNetConnEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_NETCONN_FORM_DIALOG);
+    }
+
+// --------------------------------------------------------------------------------------------
+       
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenKeyPressEditor* CLoadGenKeyPressEditor::NewL(TKeyPressAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenKeyPressEditor* self = new(ELeave) CLoadGenKeyPressEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenKeyPressEditor::~CLoadGenKeyPressEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenKeyPressEditor::CLoadGenKeyPressEditor(TKeyPressAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenKeyPressEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Key presses"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenKeyPressEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenKeyPressQueryPriority));
+    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryHeartBeat));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edHeartBeat->SetNumber(iAttributes.iHeartBeat);
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenKeyPressEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenKeyPressQueryPriority));
+        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryHeartBeat));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenKeyPressQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iHeartBeat = edHeartBeat->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenKeyPressEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenKeyPressEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenKeyPressEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_KEYPRESS_FORM_DIALOG);
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMessagesEditor* CLoadGenMessagesEditor::NewL( TMessageAttributes& aAttributes, 
+                                                      TBool aEditingExisting )
+    {
+    CLoadGenMessagesEditor* self = new(ELeave) CLoadGenMessagesEditor( aAttributes, 
+                                                                        aEditingExisting );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMessagesEditor::~CLoadGenMessagesEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMessagesEditor::CLoadGenMessagesEditor( TMessageAttributes& aAttributes, 
+                                                TBool aEditingExisting ) :
+                                            CLoadGenLoadTypeEditorBase( aEditingExisting ), 
+                                            iAttributes( aAttributes )
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMessagesEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL( _L("Messages") );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMessagesEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+    
+    // load values to static editors
+    CAknPopupFieldText* edPriority = 
+                    static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryPriority ) );
+    CAknPopupFieldText* edType = 
+                    static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryType ) );                    
+    CEikEdwin* edDestination = 
+                    static_cast<CEikEdwin*>( Control( ELoadGenMessagesQueryDestination ) );
+    CEikNumberEditor* edAmount = 
+                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryAmount ) );                
+    CEikNumberEditor* edLength = 
+                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryLength ) );
+    CEikNumberEditor* edIdle = 
+                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryIdle ) );
+    CEikNumberEditor* edVariance = 
+                    static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryVariance ) );
+
+    edPriority->SetCurrentValueIndex( iAttributes.iPriority );
+    edType->SetCurrentValueIndex( iAttributes.iMessageType );
+    edDestination->SetTextL( &iAttributes.iDestination );
+    edAmount->SetNumber( iAttributes.iAmount );
+    edLength->SetNumber( iAttributes.iLength );   
+    edIdle->SetNumber( iAttributes.iIdle );   
+    edVariance->SetNumber( iAttributes.iRandomVariance );   
+       
+    UpdateVisibilitiesOfFieldsL( ETrue );
+    // set type selection as dimmed if editing existing item
+    if (iEditingExisting)
+        {
+        SetLineDimmedNow(ELoadGenMessagesQueryType, ETrue); 
+        }
+    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenMessagesEditor::OkToExitL( TInt aButtonId )
+    {
+    if ( aButtonId == EAknSoftkeyOk )
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = 
+                static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryPriority ) );
+        CAknPopupFieldText* edType = 
+                static_cast<CAknPopupFieldText*>( Control( ELoadGenMessagesQueryType ) );                
+        CEikEdwin* edDestination = 
+                static_cast<CEikEdwin*>( Control( ELoadGenMessagesQueryDestination ) );
+        CEikNumberEditor* edLength = 
+                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryLength ) );
+        CEikNumberEditor* edAmount = 
+                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryAmount ) );                
+        CEikNumberEditor* edIdle = 
+                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryIdle ) );
+        CEikNumberEditor* edVariance =
+                static_cast<CEikNumberEditor*>( Control( ELoadGenMessagesQueryVariance ) );
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iMessageType = edType->CurrentValueIndex();
+        edDestination->GetText( iAttributes.iDestination );
+        iAttributes.iAmount = edAmount->Number();
+        iAttributes.iLength = edLength->Number();
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMessagesEditor::UpdateVisibilitiesOfFieldsL( TBool /*aFormInit*/ )
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMessagesEditor::HandleControlStateChangeL( TInt aControlId )
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL( aControlId );
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenMessagesEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD( R_MESSAGES_FORM_DIALOG );
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenApplicationsEditor* CLoadGenApplicationsEditor::NewL( TApplicationsAttributes& aAttributes, 
+                                                      TBool aEditingExisting )
+    {
+    CLoadGenApplicationsEditor* self = new(ELeave) CLoadGenApplicationsEditor( aAttributes, 
+                                                                        aEditingExisting );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenApplicationsEditor::~CLoadGenApplicationsEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenApplicationsEditor::CLoadGenApplicationsEditor( TApplicationsAttributes& aAttributes, 
+                                                TBool aEditingExisting ) :
+                                            CLoadGenLoadTypeEditorBase( aEditingExisting ), 
+                                            iAttributes( aAttributes )
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenApplicationsEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL( _L("Applications") );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenApplicationsEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsQueryPriority));
+    CEikNumberEditor* edLaunchingInterval = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsLaunchingInterval));
+    CAknPopupFieldText* edKeyPressType = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsKeyPressType));
+    CEikNumberEditor* edMaxOpen = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsMaxOpen));
+    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsKeyPressQueryHeartBeat));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsQueryVariance));
+
+    edPriority->SetCurrentValueIndex( iAttributes.iPriority );
+    edLaunchingInterval->SetNumber( iAttributes.iLaunchingInterval );
+    edKeyPressType->SetCurrentValueIndex( iAttributes.iKeyPressType );
+    edMaxOpen->SetNumber( iAttributes.iMaxOpen );
+    edHeartBeat->SetNumber( iAttributes.iHeartBeat );
+    edVariance->SetNumber( iAttributes.iRandomVariance );
+
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenApplicationsEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsQueryPriority));
+        CEikNumberEditor* edLaunchingInterval = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsLaunchingInterval));
+        CAknPopupFieldText* edKeyPressType = static_cast<CAknPopupFieldText*>(Control(ELoadGenApplicationsKeyPressType));
+        CEikNumberEditor* edMaxOpen = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsMaxOpen));
+        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsKeyPressQueryHeartBeat));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenApplicationsQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iLaunchingInterval = edLaunchingInterval->Number();
+        iAttributes.iKeyPressType = edKeyPressType->CurrentValueIndex();
+        iAttributes.iMaxOpen = edMaxOpen->Number();
+        iAttributes.iHeartBeat = edHeartBeat->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenApplicationsEditor::UpdateVisibilitiesOfFieldsL( TBool /*aFormInit*/ )
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenApplicationsEditor::HandleControlStateChangeL( TInt aControlId )
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL( aControlId );
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenApplicationsEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD( R_APPLICATIONS_FORM_DIALOG );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhotoCaptureEditor* CLoadGenPhotoCaptureEditor::NewL(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenPhotoCaptureEditor* self = new(ELeave) CLoadGenPhotoCaptureEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhotoCaptureEditor::~CLoadGenPhotoCaptureEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPhotoCaptureEditor::CLoadGenPhotoCaptureEditor(TPhotoCaptureAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhotoCaptureEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Photo captures"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhotoCaptureEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+    
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryPriority));
+    //CAknPopupFieldText* edDevice = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryDevice));    
+    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryIdle));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    //edDevice->SetCurrentValueIndex(0);
+    edIdle->SetNumber(iAttributes.iIdle);   
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+    
+    LoadCamerasL();
+    
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+void CLoadGenPhotoCaptureEditor::LoadCamerasL()
+    {    
+    if (iAttributes.iCameraCount > 0)
+        {
+        // insert possibility to select which cpu the load is generated to
+        InsertFieldAfterL(R_PHOTOCAPTURE_DLG_LINE_DEVICE, ELoadGenPhotoCaptureQueryDevice, ELoadGenPhotoCaptureQueryPriority);
+        
+        iCamerasArray = new (ELeave) CDesCArrayFlat( iAttributes.iCameraCount );   
+        
+        // add Cameras
+        for (int i = 0; i < iAttributes.iCameraCount; i++) 
+            {
+            TBuf<16> cam;
+            _LIT(KCam, "Camera %d");
+            cam.Format(KCam, i);
+            iCamerasArray->AppendL(cam);
+            }    
+       
+        iCameraTextArray = CAknQueryValueTextArray::NewL();
+        iCameraTextArray->SetArray( *iCamerasArray );  
+        iCameraQueryValText = CAknQueryValueText::NewL();    
+        iCameraQueryValText->SetArrayL( iCameraTextArray );
+        if( iAttributes.iCameraCount > 0 )
+            {
+            iCameraQueryValText->SetCurrentValueIndex(iAttributes.iCamera);
+            }
+        CAknPopupField* popup = static_cast<CAknPopupField*>(Control( ELoadGenPhotoCaptureQueryDevice)); 
+        popup->SetQueryValueL( iCameraQueryValText );        
+        }    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPhotoCaptureEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPhotoCaptureQueryPriority));        
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPhotoCaptureQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();        
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        
+        if (iAttributes.iCameraCount > 1)
+            {
+            iAttributes.iCamera = iCameraQueryValText->CurrentValueIndex();
+            }
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhotoCaptureEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPhotoCaptureEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPhotoCaptureEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_PHOTOCAPTURE_FORM_DIALOG);
+    }
+
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenBluetoothEditor* CLoadGenBluetoothEditor::NewL(TBluetoothAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenBluetoothEditor* self = new(ELeave) CLoadGenBluetoothEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenBluetoothEditor::~CLoadGenBluetoothEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenBluetoothEditor::CLoadGenBluetoothEditor(TBluetoothAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenBluetoothEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Bluetooth"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenBluetoothEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+    
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenBluetoothQueryPriority));        
+    CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryIdle));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);    
+    edIdle->SetNumber(iAttributes.iIdle);   
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+        
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenBluetoothEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenBluetoothQueryPriority));        
+        CEikNumberEditor* edIdle = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryIdle));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenBluetoothQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();        
+        iAttributes.iIdle = edIdle->Number();
+        iAttributes.iRandomVariance = edVariance->Number();                
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenBluetoothEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenBluetoothEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenBluetoothEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_BLUETOOTH_FORM_DIALOG);
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPointerEventEditor* CLoadGenPointerEventEditor::NewL(TPointerEventAttributes& aAttributes, TBool aEditingExisting)
+    {
+    CLoadGenPointerEventEditor* self = new(ELeave) CLoadGenPointerEventEditor(aAttributes, aEditingExisting);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPointerEventEditor::~CLoadGenPointerEventEditor()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenPointerEventEditor::CLoadGenPointerEventEditor(TPointerEventAttributes& aAttributes, TBool aEditingExisting) :
+    CLoadGenLoadTypeEditorBase(aEditingExisting), iAttributes(aAttributes)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPointerEventEditor::ConstructL()
+    {
+    CLoadGenLoadTypeEditorBase::ConstructL(_L("Pointer events"));
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPointerEventEditor::PreLayoutDynInitL()
+    {
+    CLoadGenLoadTypeEditorBase::PreLayoutDynInitL();
+
+    // load values to static editors
+    CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPointerEventQueryPriority));
+    CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryHeartBeat));
+    CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryVariance));
+
+    edPriority->SetCurrentValueIndex(iAttributes.iPriority);
+    edHeartBeat->SetNumber(iAttributes.iHeartBeat);
+    edVariance->SetNumber(iAttributes.iRandomVariance);
+
+    UpdateVisibilitiesOfFieldsL(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPointerEventEditor::OkToExitL(TInt aButtonId)
+    {
+    if (aButtonId == EAknSoftkeyOk)
+        {
+        // store values from editors
+        CAknPopupFieldText* edPriority = static_cast<CAknPopupFieldText*>(Control(ELoadGenPointerEventQueryPriority));
+        CEikNumberEditor* edHeartBeat = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryHeartBeat));
+        CEikNumberEditor* edVariance = static_cast<CEikNumberEditor*>(Control(ELoadGenPointerEventQueryVariance));
+
+        iAttributes.iPriority = edPriority->CurrentValueIndex();
+        iAttributes.iHeartBeat = edHeartBeat->Number();
+        iAttributes.iRandomVariance = edVariance->Number();
+        }
+    
+    return ETrue;
+    }       
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPointerEventEditor::UpdateVisibilitiesOfFieldsL(TBool /*aFormInit*/)
+    {
+    UpdateFormL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenPointerEventEditor::HandleControlStateChangeL(TInt aControlId)
+    {
+    CLoadGenLoadTypeEditorBase::HandleControlStateChangeL(aControlId);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenPointerEventEditor::RunQueryLD()
+    {
+    return CLoadGenLoadTypeEditorBase::DoRunQueryLD(R_POINTEREVENT_FORM_DIALOG);
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_maincontainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,457 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_maincontainer.h"
+#include "loadgen.hrh"
+#include "loadgen_document.h"
+#include "loadgen_appui.h"
+#include "loadgen_model.h"
+#include <loadgen_extraicons.mbg>
+
+#include <aknlists.h>
+#include <eikclb.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <AknUtils.h>
+#include <aknnotewrappers.h>
+#include <AknIconArray.h> 
+#include <f32file.h>
+#include <AknIconUtils.h>
+#include <AknDef.h>
+#include <akntitle.h>
+#include <eikspane.h> 
+
+_LIT(KExtraIconsPath, "\\resource\\apps\\loadgen_extraicons.mif");
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+void CLoadGenMainContainer::ConstructL(const TRect& aRect)
+    {
+    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    iModel->SetMainContainer(this);
+
+    CreateWindowL();
+    SetRect(aRect);
+    SetBlank();
+    
+    // init listbox
+    iListBox = new(ELeave) CLoadGenCAknSingleGraphicStyleListBox;
+    iListBox->SetContainerWindowL(*this);
+    iListBox->ConstructL(this, EAknListBoxMarkableList);
+    iListBox->View()->SetListEmptyTextL(_L("No loads activated\n(Select new load from Options to generate new load)"));
+
+    // create icon array and add marking indicator to it
+    CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
+    CleanupStack::PushL(iconArray);
+    CFbsBitmap* markBitmap = NULL;
+    CFbsBitmap* markBitmapMask = NULL;
+    
+    TRgb defaultColor;
+    defaultColor = iEikonEnv->Color(EColorControlText);
+
+    AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
+            KAknsIIDQgnIndiMarkedAdd,
+            KAknsIIDQsnIconColors,
+            EAknsCIQsnIconColorsCG13,
+            markBitmap,
+            markBitmapMask,
+            AknIconUtils::AvkonIconFileName(),
+            EMbmAvkonQgn_indi_marked_add,
+            EMbmAvkonQgn_indi_marked_add_mask,
+            defaultColor
+            );
+     
+    CGulIcon* markIcon = CGulIcon::NewL(markBitmap, markBitmapMask);
+    iconArray->AppendL(markIcon);                       
+    
+    // append icons from loadgen_extraicons.mif
+    TFileName extraIconsPath;
+    extraIconsPath.Copy(KExtraIconsPath);
+    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->AppFullName()); // get path where this app is installed
+    extraIconsPath.Insert(0, parse.Drive()); // drive letter
+    
+    CFbsBitmap* redBitmap = NULL;
+    CFbsBitmap* redBitmapMask = NULL;
+    CFbsBitmap* greenBitmap = NULL;
+    CFbsBitmap* greenBitmapMask = NULL;
+    
+    AknIconUtils::CreateIconL(redBitmap, redBitmapMask, extraIconsPath, EMbmLoadgen_extraiconsQgn_prob_status_red, EMbmLoadgen_extraiconsQgn_prob_status_red_mask);
+    AknIconUtils::CreateIconL(greenBitmap, greenBitmapMask, extraIconsPath, EMbmLoadgen_extraiconsQgn_prob_status_green, EMbmLoadgen_extraiconsQgn_prob_status_green_mask);
+
+    CGulIcon* redIcon = CGulIcon::NewL(redBitmap, redBitmapMask);
+    iconArray->AppendL(redIcon);  
+    
+    CGulIcon* greenIcon = CGulIcon::NewL(greenBitmap, greenBitmapMask);
+    iconArray->AppendL(greenIcon);  
+
+    // set icon array
+    CleanupStack::Pop(); // iconArray
+    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);
+
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    iListBox->SetListBoxObserver(this);
+    
+    // set size of the listbox
+    TSize outputRectSize;
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+    TRect outputRect(outputRectSize);
+    iListBox->SetRect(outputRect);
+
+    iListBox->ActivateL();    
+    
+    ActivateL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenMainContainer::~CLoadGenMainContainer()
+    {
+    if (iListBox)
+        delete iListBox;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::SizeChanged()
+{
+    TSize outputRectSize;
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+    TRect outputRect(outputRectSize);
+    
+    if (iListBox)
+        iListBox->SetRect(outputRect);
+}
+
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenMainContainer::CountComponentControls() const
+    {
+    if (iListBox)
+        return 1;
+    else
+        return 0;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CCoeControl* CLoadGenMainContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    if (iListBox)
+        return iListBox;
+    else
+        return NULL;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenMainContainer::CurrentListBoxItemIndex()
+    {
+    if (iListBox)
+        {
+        return iListBox->CurrentItemIndex();
+        }
+    else
+        return KErrNotFound;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::SetListBoxTextArrayL(CDesCArray* aTextArray)
+    {
+    if (iListBox)
+        {    
+        iListBox->Model()->SetItemTextArray(aTextArray);
+        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+const CArrayFix<TInt>* CLoadGenMainContainer::ListBoxSelectionIndexes()
+    {
+    if (iListBox)
+        {
+        const CListBoxView::CSelectionIndexArray* indices = iListBox->SelectionIndexes();
+        return static_cast<const CArrayFix<TInt>*>(indices);
+        }
+    else
+        return NULL;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenMainContainer::ListBoxSelectionIndexesCount()
+    {
+    if (iListBox)
+        {
+        return iListBox->SelectionIndexes()->Count();
+        }
+    else
+        return KErrNotFound;
+    }
+                        
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.Clear(aRect);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::SetDefaultTitlePaneTextL()
+    {
+    _LIT(KTitleText, "Load Gener.");
+
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( KTitleText );
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CLoadGenMainContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    if(aType != EEventKey)
+        return EKeyWasNotConsumed;
+    
+    if (iListBox && iListBox->Model()->NumberOfItems() > 0)
+        {
+        /*
+        if (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)
+            {
+            iModel->StopSelectedOrHighlightedItemsL();
+            return EKeyWasConsumed;
+            }
+        else    
+            {
+            return iListBox->OfferKeyEventL(aKeyEvent, aType);
+            }
+        */
+        TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift) ||
+                                (aKeyEvent.iModifiers & EModifierLeftShift) ||
+                                (aKeyEvent.iModifiers & EModifierRightShift);
+        TBool controlKeyPressed = (aKeyEvent.iModifiers & EModifierCtrl) || 
+                                  (aKeyEvent.iModifiers & EModifierRightCtrl); 
+                                  
+        
+        // handle OK/Enter keys
+        if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) && (shiftKeyPressed || controlKeyPressed))
+            {
+            return iListBox->OfferKeyEventL(aKeyEvent, aType); //send to listbox if modifiers
+            }
+
+        // handle OK/Enter keys
+        else if (aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter)
+            {
+            iModel->ShowItemActionMenuL();
+            }
+
+        // handle delete key
+        else if (aKeyEvent.iCode == EKeyBackspace || aKeyEvent.iCode == EKeyDelete)
+            {
+            iModel->StopSelectedOrHighlightedItemsL();
+            }
+
+        else
+            return iListBox->OfferKeyEventL(aKeyEvent, aType);
+        }
+    
+    return EKeyWasNotConsumed;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            {
+            iModel->ShowItemActionMenuL();
+            }
+            break;
+        default:
+            break;
+        }
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenMainContainer::HandleResourceChange(TInt aType)
+    {
+    if ( aType == KEikDynamicLayoutVariantSwitch )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+
+        TSize outputRectSize;
+        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, outputRectSize);
+        TRect outputRect(outputRectSize);
+        iListBox->SetRect(outputRect);
+        }
+    else
+        {
+        CCoeControl::HandleResourceChange(aType);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCAknSingleGraphicStyleListBox::SizeChanged()
+    {
+    // call the base class function first
+    CAknSingleGraphicStyleListBox::SizeChanged();
+
+    // customize the list box
+    TRAP_IGNORE(SizeChangedL());
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenCAknSingleGraphicStyleListBox::SizeChangedL()
+    {
+    const TInt KEmptySize = 2;
+    
+    // disable separator line
+    ItemDrawer()->ColumnData()->SetSeparatorLinePosition(ENoLine);
+    
+    // enable marquee
+    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
+    
+    // set fonts
+    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
+    ItemDrawer()->ColumnData()->SetColumnFontL(0, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(1, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(2, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(3, font);
+
+    // set row height
+    TInt rowHeight = font->HeightInPixels()+5;    
+    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
+    itemCellSize.iHeight = rowHeight; 
+    SetItemHeightL(rowHeight);
+    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
+    
+    // set icon sizes
+    TInt normalIconSize = rowHeight * 0.7;
+    TInt markingIconSize = rowHeight * 0.8;
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(2, TSize(markingIconSize,markingIconSize));
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(KEmptySize,KEmptySize));
+
+    // set column widths
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0, normalIconSize + 2*normalIconSize * 0.15);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1, itemCellSize.iWidth-KEmptySize-markingIconSize);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(2, markingIconSize);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(3, KEmptySize);
+
+    // set baseline for the text
+    ItemDrawer()->ColumnData()->SetColumnBaselinePosL(1, font->HeightInPixels()-font->BaselineOffsetInPixels());
+
+    // set margins
+    TMargins iconMargins;
+    iconMargins.iBottom = 0;
+    iconMargins.iLeft = normalIconSize * 0.15;
+    iconMargins.iRight = normalIconSize * 0.15;
+    iconMargins.iTop = 0;
+
+    TMargins textMargins;
+    textMargins.iBottom = 0;
+    textMargins.iLeft = markingIconSize * 0.15;
+    textMargins.iRight = markingIconSize * 0.15;
+    textMargins.iTop = 0;
+
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(0, iconMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(1, textMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(2, iconMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(3, iconMargins);
+    
+/*
+    const TInt KEmptySize = 2;
+    
+    // enable marquee
+    ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
+    
+    // set fonts
+    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
+    ItemDrawer()->ColumnData()->SetColumnFontL(0, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(1, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(2, font);
+    ItemDrawer()->ColumnData()->SetColumnFontL(3, font);
+
+    // set row height
+    TInt rowHeight = font->HeightInPixels()+7;    
+    TSize itemCellSize = View()->ItemDrawer()->ItemCellSize();
+    itemCellSize.iHeight = rowHeight; 
+    SetItemHeightL(rowHeight);
+    View()->ItemDrawer()->SetItemCellSize(itemCellSize);
+
+    // set icon sizes
+    TInt normalIconSize = rowHeight * 0.6;
+    TInt markingIconSize = rowHeight * 0.8;
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(0, TSize(normalIconSize,normalIconSize));
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(2, TSize(markingIconSize,markingIconSize));
+    ItemDrawer()->ColumnData()->SetSubCellIconSize(3, TSize(KEmptySize,KEmptySize));
+
+    // set column widths
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(0, normalIconSize);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(1, itemCellSize.iWidth-KEmptySize-markingIconSize);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(2, markingIconSize);
+    ItemDrawer()->ColumnData()->SetColumnWidthPixelL(3, KEmptySize);
+
+    // set baseline for the text
+    ItemDrawer()->ColumnData()->SetColumnBaselinePosL(1, font->HeightInPixels()-font->BaselineOffsetInPixels());
+
+    // set margins
+    TMargins iconMargins;
+    iconMargins.iBottom = 0;
+    iconMargins.iLeft = 0;
+    iconMargins.iRight = 0;
+    iconMargins.iTop = 0;
+
+    TMargins textMargins;
+    textMargins.iBottom = 0;
+    textMargins.iLeft = markingIconSize * 0.15;
+    textMargins.iRight = markingIconSize * 0.15;
+    textMargins.iTop = 0;
+
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(0, iconMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(1, textMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(2, iconMargins);
+    ItemDrawer()->ColumnData()->SetColumnMarginsL(3, iconMargins);
+*/
+    }
+
+// --------------------------------------------------------------------------------------------
+        
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen.hrh"
+#include "loadgen_mainview.h"
+#include "loadgen_maincontainer.h"
+#include "loadgen_document.h" 
+#include "loadgen_model.h"
+#include "loadgen_traces.h"
+#include <loadgen.rsg>
+
+#include <eikenv.h>
+#include <aknViewAppUi.h> 
+#include <aknnotewrappers.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CLoadGenMainView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::ConstructL()
+    {
+    BaseConstructL( R_LOADGEN_VIEW_MAIN );
+    iModel = static_cast<CLoadGenDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    }
+
+// ---------------------------------------------------------
+// CLoadGenMainView::~CLoadGenMainView()
+// ---------------------------------------------------------
+//
+CLoadGenMainView::~CLoadGenMainView()
+    {
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// TUid CLoadGenMainView::Id()
+// ---------------------------------------------------------
+//
+TUid CLoadGenMainView::Id() const
+    {
+    return KMainViewUID;
+    }
+
+// ---------------------------------------------------------
+// TUid CLoadGenMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
+    }
+
+  
+// ---------------------------------------------------------
+// CLoadGenMainView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+        case ELoadGenCmdNewLoadEatMemory:
+        case ELoadGenCmdNewLoadPhoneCall:
+        case ELoadGenCmdNewLoadNetConn:
+        case ELoadGenCmdNewLoadKeyPress:
+        case ELoadGenCmdNewLoadMessages:
+        case ELoadGenCmdNewLoadApplications:
+        case ELoadGenCmdNewLoadPhotoCaptures:
+        case ELoadGenCmdNewLoadBluetooth:
+        case ELoadGenCmdNewLoadPointerEvent:
+            {            
+            TRAPD(err, iModel->StartNewLoadL(aCommand));
+            if( err != KErrNone )
+                {
+                LOGSTRING2("LoadGen: Load (command: %d) start failed!", aCommand);
+                _LIT(message, "Load start failed!");
+                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
+                errorNote->ExecuteLD(message);                
+                }
+            break;
+            }
+        case ELoadGenStopAll:
+            {
+            iModel->StopAllLoadItemsL();
+            break;
+            }
+        case ELoadGenSuspendAll:
+            {
+            iModel->SuspendAllLoadItemsL();
+            break;
+            }
+        case ELoadGenResumeAll:
+            {
+            iModel->ResumeAllLoadItemsL();
+            break;
+            }            
+        default:
+            {
+            AppUi()->HandleCommandL(aCommand);
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CLoadGenMainView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CLoadGenMainView::DoActivateL(...)
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CLoadGenMainContainer;
+        iModel->SetMainContainer(iContainer);
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+   }
+
+// ---------------------------------------------------------
+// CLoadGenMainView::DoDeactivate()
+// ---------------------------------------------------------
+//
+void CLoadGenMainView::DoDeactivate()
+    {
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_model.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,910 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_cpuload.h"
+#include "loadgen_memoryeat.h"
+#include "loadgen_phonecall.h"
+#include "loadgen_netconn.h"
+#include "loadgen_keypress.h"
+#include "loadgen_pointerevent.h"
+#include "loadgen_messages.h"
+#include "loadgen_applications.h"
+#include "loadgen_photocapture.h"
+#include "loadgen_bluetooth.h"
+#include "loadgen_utils.h"
+
+#include "loadgen_traces.h"
+#include "loadgen_editors.h"
+#include "loadgen_loadattributes.h"
+#include "loadgen_model.h"
+#include "loadgen_app.h"
+#include "loadgen_settingsviewdlg.h"
+#include "loadgen_maincontainer.h"
+#include "loadgen.hrh"
+#include <loadgen.rsg>
+
+#include <coeutils.h>
+#include <bautils.h>
+#include <eikenv.h>
+#include <AknQueryDialog.h>
+#include <e32math.h> 
+#include <u32hal.h>
+#include <hal.h> 
+#include <hal_data.h>
+
+#include <ecam.h>
+#include <aknnotewrappers.h>
+#include <featdiscovery.h>
+
+inline TInt64 INIT_SEED()
+{
+    TTime now; 
+    now.HomeTime(); 
+    return now.Int64();
+}
+
+TInt64 CLoadGenModel::iRandomNumberSeed = INIT_SEED();
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CLoadGenModel* CLoadGenModel::NewL()
+    {
+    CLoadGenModel* self = new(ELeave) CLoadGenModel;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenModel::CLoadGenModel() : CActive(EPriorityStandard)
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::ConstructL()
+    {
+    iDrawState = EDrawStateInvalid;
+    iReferenceNumber = 0;
+    
+    iEnv = CEikonEnv::Static();
+    User::LeaveIfError(iLs.Connect());
+    
+    iLoadItemList = new(ELeave) CLoadItemList(64);
+
+    User::LeaveIfError(iTimer.CreateLocal());
+    CActiveScheduler::Add(this);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::ActivateModelL()
+    {
+    // load settings
+    //TRAP_IGNORE(LoadSettingsL());
+
+    // set defaults to attributes
+    iCpuLoadAttributes.iId = 0;
+    iCpuLoadAttributes.iPriority = EThreadPriorityTypeNormal;
+    iCpuLoadAttributes.iMode = ECpuLoadModeYielding;
+    iCpuLoadAttributes.iType = ECpuLoadTypePeriodic;
+    iCpuLoadAttributes.iLength = 4000;
+    iCpuLoadAttributes.iIdle = 2000;
+    iCpuLoadAttributes.iRandomVariance = 0;
+    iCpuLoadAttributes.iCpu = KCPUSelection_FreeScheduling; // set CPU as "undefined" (can be >= 0 only in SMP environments)
+    iCpuLoadAttributes.iCpuCount = UserSvr::HalFunction(EHalGroupKernel, KHalFunction_EKernelHalNumLogicalCpus, 0, 0);
+    if( iCpuLoadAttributes.iCpuCount < 1 || iCpuLoadAttributes.iCpuCount > KMaxCPUs )
+        {
+        // HAL may not support this function, so let's use CPU count 1:
+        iCpuLoadAttributes.iCpuCount = 1;
+        }
+    iMemoryEatAttributes.iId = 0;
+    iMemoryEatAttributes.iPriority = EThreadPriorityTypeNormal;
+    iMemoryEatAttributes.iSource = 0;
+    iMemoryEatAttributes.iType = EMemoryEatTypeMemoryToBeLeft;
+    iMemoryEatAttributes.iBuffer = 16*1024;
+    iMemoryEatAttributes.iIdle = 0;
+    iMemoryEatAttributes.iAmount = 0;
+    iMemoryEatAttributes.iRandomMin = 1000000;
+    iMemoryEatAttributes.iRandomMax = 1500000;
+    iMemoryEatAttributes.iAmountDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomMinDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomMaxDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomVariance = 0;
+
+    iPhoneCallAttributes.iId = 0;
+    iPhoneCallAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPhoneCallAttributes.iDestination.Copy(_L("+358"));
+    iPhoneCallAttributes.iLength = 60000;
+    iPhoneCallAttributes.iIdle = 10000;
+    iPhoneCallAttributes.iRandomVariance = 0;
+
+    iNetConnAttributes.iId = 0;
+    iNetConnAttributes.iPriority = EThreadPriorityTypeNormal;
+    iNetConnAttributes.iDestination.Copy(_L("http://www.nokia.com"));
+    iNetConnAttributes.iIdle = 10000;
+    iNetConnAttributes.iRandomVariance = 0;
+
+    iKeyPressAttributes.iId = 0;
+    iKeyPressAttributes.iPriority = EThreadPriorityTypeNormal;
+    iKeyPressAttributes.iHeartBeat = 100;
+    iKeyPressAttributes.iRandomVariance = 0;
+    
+    iPointerEventAttributes.iId = 0;
+    iPointerEventAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPointerEventAttributes.iHeartBeat = 1000;
+    iPointerEventAttributes.iRandomVariance = 0;
+
+    iMessageAttributes.iId = 0;
+    iMessageAttributes.iPriority = EThreadPriorityTypeNormal;
+    iMessageAttributes.iMessageType = EMessageTypeSMS;
+    iMessageAttributes.iDestination.Copy(_L("+358"));
+    iMessageAttributes.iAmount = 5;
+    iMessageAttributes.iLength = 160;
+    iMessageAttributes.iIdle = 15000;
+    iMessageAttributes.iRandomVariance = 0;
+    
+    iApplicationsAttributes.iId = 0;
+    iApplicationsAttributes.iLaunchingInterval = 2000;
+    iApplicationsAttributes.iPriority = EThreadPriorityTypeNormal;
+    iApplicationsAttributes.iKeyPressType = EApplicationsKeyPressTypeNone;
+    iApplicationsAttributes.iMaxOpen = 20;
+    iApplicationsAttributes.iHeartBeat = 50;
+    iApplicationsAttributes.iRandomVariance = 0;
+    
+    iPhotoCaptureAttributes.iId = 0;
+    iPhotoCaptureAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPhotoCaptureAttributes.iIdle = 10000;
+    iPhotoCaptureAttributes.iRandomVariance = 0;        
+    iPhotoCaptureAttributes.iCameraCount = CCamera::CamerasAvailable();
+    if(iPhotoCaptureAttributes.iCameraCount > 0)
+        {
+        iPhotoCaptureAttributes.iCamera = 0; // Main camera
+        }
+    else
+        {
+        iPhotoCaptureAttributes.iCamera = -1;
+        }
+    
+    iBluetoothAttributes.iId = 0;
+    iBluetoothAttributes.iPriority = EThreadPriorityTypeNormal;
+    iBluetoothAttributes.iIdle = 10000;
+    iBluetoothAttributes.iRandomVariance = 0;
+    iBluetoothAttributes.iBluetoothSupported = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdBt);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::DeActivateModelL()
+    {
+    Cancel();
+    
+    // for a faster exit, send the application to background
+    TApaTask selfTask(iEnv->WsSession());
+    selfTask.SetWgId(iEnv->RootWin().Identifier());
+    selfTask.SendToBackground();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+CLoadGenModel::~CLoadGenModel()
+    {
+    if (iLoadItemList)
+        {
+        DeleteAllLoadItems();
+        delete iLoadItemList;
+        }
+    if ( iApplicationsAttributes.iAppsArray )
+        {
+        delete iApplicationsAttributes.iAppsArray;
+        }
+    iTimer.Close();
+    iLs.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::RunL()
+    {
+    // continue    
+    //iTimer.After(iStatus, 400000);
+    //SetActive();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::SetMainContainer(CLoadGenMainContainer* aContainer)
+    {
+    iMainContainer = aContainer;
+    iDrawState = EDrawStateMain;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::StartNewLoadL(TInt aCommand)
+    {
+    // show new load query
+    CLoadGenLoadTypeEditorBase* dlg = NULL;
+
+    switch ( aCommand )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            dlg = CLoadGenCPULoadEditor::NewL(iCpuLoadAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            dlg = CLoadGenMemoryEatEditor::NewL(iMemoryEatAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            dlg = CLoadGenPhoneCallEditor::NewL(iPhoneCallAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            dlg = CLoadGenNetConnEditor::NewL(iNetConnAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            dlg = CLoadGenKeyPressEditor::NewL(iKeyPressAttributes);
+            break;
+            }               
+        case ELoadGenCmdNewLoadMessages:
+            {
+            dlg = CLoadGenMessagesEditor::NewL( iMessageAttributes );
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            dlg = CLoadGenApplicationsEditor::NewL( iApplicationsAttributes );
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            if( iPhotoCaptureAttributes.iCameraCount > 0 )
+                {
+                dlg = CLoadGenPhotoCaptureEditor::NewL( iPhotoCaptureAttributes );
+                }
+            else
+                {
+                _LIT(message, "Cameras not available");
+                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
+                errorNote->ExecuteLD(message);
+                return;
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            if( iBluetoothAttributes.iBluetoothSupported )
+                {
+                dlg = CLoadGenBluetoothEditor::NewL(iBluetoothAttributes);                
+                }
+            else
+                {
+                _LIT(message, "Bluetooth device not available");
+                CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
+                errorNote->ExecuteLD(message);
+                return;
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            dlg = CLoadGenPointerEventEditor::NewL(iPointerEventAttributes);
+            break;
+            } 
+
+        default:
+            {
+            User::Panic(_L("Wrong new load"), 111);
+            break;
+            }
+        }
+
+    TBool dlgResult = dlg->RunQueryLD();
+
+    // set back title
+    if (iMainContainer)
+        iMainContainer->SetDefaultTitlePaneTextL();
+
+    // start creating new load if dialog accepted
+    if (dlgResult)
+        {
+        DoStartNewLoadL(aCommand);
+        }
+
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::EditLoadL(CLoadBase* aItem)
+    {
+    // suspend current
+    aItem->Suspend();
+    
+    // show new load query
+    CLoadGenLoadTypeEditorBase* dlg = NULL;
+
+    switch ( aItem->Type() )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            dlg = CLoadGenCPULoadEditor::NewL(static_cast<CCPULoad*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            dlg = CLoadGenMemoryEatEditor::NewL(static_cast<CMemoryEat*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            dlg = CLoadGenPhoneCallEditor::NewL(static_cast<CPhoneCall*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            dlg = CLoadGenNetConnEditor::NewL(static_cast<CNetConn*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            dlg = CLoadGenKeyPressEditor::NewL(static_cast<CKeyPress*>(aItem)->Attributes(), ETrue);
+            break;
+            }       
+        case ELoadGenCmdNewLoadMessages:
+            {
+            dlg = CLoadGenMessagesEditor::NewL(static_cast<CMessages*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            dlg = CLoadGenApplicationsEditor::NewL( static_cast<CAppLauncher*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            dlg = CLoadGenPhotoCaptureEditor::NewL( static_cast<CPhotoCapture*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            dlg = CLoadGenBluetoothEditor::NewL( static_cast<CBluetooth*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            dlg = CLoadGenPointerEventEditor::NewL(static_cast<CPointerEvent*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        default:
+            {
+            User::Panic(_L("Wrong edit load"), 114);
+            break;
+            }
+        }
+
+    TBool dlgResult = dlg->RunQueryLD();
+
+    // set back title
+    if (iMainContainer)
+        iMainContainer->SetDefaultTitlePaneTextL();
+    
+    // change priority of the load item
+    aItem->SetPriority();
+
+    // resume execution the item
+    aItem->Resume();
+    
+    if (dlgResult)
+        RefreshViewL(EFalse);
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::DoStartNewLoadL(TInt aCommand)
+    {
+    CLoadBase* item = NULL;
+    
+    switch ( aCommand )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            if( iCpuLoadAttributes.iCpu == KCPUSelection_AllCPUs )
+                {
+                // Call this function recursively for all CPUs:
+                for( TUint i = 0; i < iCpuLoadAttributes.iCpuCount; ++i )
+                    {                    
+                    iCpuLoadAttributes.iCpu = i;
+                    DoStartNewLoadL(aCommand);
+                    }
+                // And finally set user selection back to "All CPUs"
+                iCpuLoadAttributes.iCpu = KCPUSelection_AllCPUs;
+                return;
+                }
+            else
+                {
+                item = CCPULoad::NewL(iCpuLoadAttributes, iReferenceNumber);
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            item = CMemoryEat::NewL(iMemoryEatAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            item = CPhoneCall::NewL(iPhoneCallAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            item = CNetConn::NewL(iNetConnAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            item = CKeyPress::NewL(iKeyPressAttributes, iReferenceNumber);
+            break;
+            }        
+        case ELoadGenCmdNewLoadMessages:
+            {
+            item = CMessages::NewL( iMessageAttributes, iReferenceNumber );
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            iApplicationsAttributes.iAppsArray = ListOfAllAppsL();
+            item = CAppLauncher::NewL( iApplicationsAttributes, iReferenceNumber );            
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            item = CPhotoCapture::NewL( iPhotoCaptureAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            item = CBluetooth::NewL( iBluetoothAttributes, iReferenceNumber);            
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            item = CPointerEvent::NewL(iPointerEventAttributes, iReferenceNumber);
+            break;
+            }
+            
+        default:
+            {
+            User::Panic(_L("Wrong new load"), 112);
+            break;
+            }
+        }
+    
+    iReferenceNumber++;
+
+    // add item to the array
+    AppendToLoadItemListL(item);
+
+    // update the listbox
+    RefreshViewL(EFalse);
+
+    // set item index to the end
+    iMainContainer->ListBox()->SetCurrentItemIndexAndDraw( iMainContainer->ListBox()->Model()->NumberOfItems()-1 );
+
+    // start the load
+    item->Resume();
+        
+    // refresh again
+    RefreshViewL(EFalse);    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+
+void CLoadGenModel::StopAllLoadItemsL()
+    {
+    DeleteAllLoadItems();
+    
+    RefreshViewL();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::SuspendAllLoadItemsL()
+    {
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {
+            iLoadItemList->At(i)->Suspend();
+            }
+        }
+        
+    RefreshViewL();    
+    }
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::ResumeAllLoadItemsL()
+    {
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {
+            iLoadItemList->At(i)->Resume();
+            }
+        }
+
+    RefreshViewL();    
+    }    
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::RefreshViewL(TBool aClearSelection)
+    {
+    if (iMainContainer && iDrawState == EDrawStateMain && iMainContainer->ListBox())
+        {
+        // clear selections if any
+        iMainContainer->ListBox()->ClearSelection();
+        
+        // set item index to 0
+        if (aClearSelection)
+            iMainContainer->ListBox()->SetCurrentItemIndex(0); 
+        
+        // set text items
+        iMainContainer->SetListBoxTextArrayL(GenerateListBoxItemTextArrayL());
+        }
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::AppendToLoadItemListL(CLoadBase* aItem)
+    {
+    if (iLoadItemList)
+        iLoadItemList->AppendL( aItem );
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::DeleteFromLoadItemListL(TInt aIndex)
+    {
+    if (iLoadItemList)
+        {
+        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
+            {
+            // first call delete on the item
+            if (iLoadItemList->At(aIndex))
+                {                                
+                delete iLoadItemList->At(aIndex);
+                iLoadItemList->At(aIndex) = NULL;
+                }
+            
+            // and them remove the array entry
+            iLoadItemList->Delete(aIndex);
+            iLoadItemList->Compress();
+            }
+        else
+            User::Leave(KErrNotFound);
+        }
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::SuspendOrResumeFromLoadItemListL(TInt aIndex)
+    {
+    if (iLoadItemList)
+        {
+        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
+            {
+            if (iLoadItemList->At(aIndex))
+                {
+                if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateRunning)
+                    {
+                    iLoadItemList->At(aIndex)->Suspend();
+                    }
+                else if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateSuspended)
+                    {
+                    iLoadItemList->At(aIndex)->Resume();
+                    }
+                }
+            }
+        else
+            User::Leave(KErrNotFound);
+        }
+    else
+        User::Leave(KErrNotReady);
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenModel::LoadItemCount() const
+    {
+    TInt count(0);
+    
+    if (iLoadItemList)
+        count = iLoadItemList->Count();
+    
+    return count;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::DeleteAllLoadItems()
+    {
+    // call delete for each entry and free memory allocated for the array
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {            
+            delete iLoadItemList->At(i);
+            iLoadItemList->At(i) = NULL;
+            }
+        }
+        
+    iLoadItemList->Reset();    
+    }  
+          
+// --------------------------------------------------------------------------------------------
+
+CDesCArray* CLoadGenModel::GenerateListBoxItemTextArrayL()
+    {
+    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(64);
+    CleanupStack::PushL(textArray);
+
+    _LIT(KEntryTemplateRedIcon,   "1\t%S\t\t");
+    _LIT(KEntryTemplateGreenIcon, "2\t%S\t\t");
+    
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        // add description from each entry
+        TBuf<256> textEntry;
+        TBuf<256> description = iLoadItemList->At(i)->Description();
+        
+        if (iLoadItemList->At(i)->State() == CLoadBase::ELoadStateRunning)
+            textEntry.Format(KEntryTemplateGreenIcon, &description);
+        else
+            textEntry.Format(KEntryTemplateRedIcon, &description);
+        
+        textArray->AppendL(textEntry);
+        }    
+    
+    CleanupStack::Pop(); //textArray
+    return textArray;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::ShowItemActionMenuL()
+    {
+    TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+    
+    if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
+        {
+        // show a query dialog    
+        TInt queryIndex(0);
+        CAknListQueryDialog* listQueryDlg = new(ELeave) CAknListQueryDialog(&queryIndex);
+
+        if (listQueryDlg->ExecuteLD(R_ITEM_ACTION_QUERY))
+            {
+            // stop
+            if (queryIndex == EItemActionMenuTypeStop)
+                {
+                StopSelectedOrHighlightedItemsL();
+                }
+            
+            // suspend or resume
+            else if (queryIndex == EItemActionMenuTypeSuspendResume)
+                {
+                SuspendOrResumeSelectedOrHighlightedItemsL();
+                }
+                           
+            // edit
+            else if (queryIndex == EItemActionMenuTypeEdit)
+                {
+                EditLoadL(iLoadItemList->At(currentItemIndex));
+                }
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::StopSelectedOrHighlightedItemsL()
+    {
+    const CArrayFix<TInt>* selectionIndexes = iMainContainer->ListBoxSelectionIndexes();
+
+    TInt err(KErrNone);
+
+    // by default use selected items
+    if (selectionIndexes && selectionIndexes->Count() > 0)
+        {
+        CAknQueryDialog* query = CAknQueryDialog::NewL();
+        _LIT(KQueryMessage, "Stop %d selections?");
+        TFileName queryMsg;
+        queryMsg.Format(KQueryMessage, selectionIndexes->Count());
+        
+
+        if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, queryMsg))
+            {
+            TInt deleteIndexCounter(0);
+            TInt ref(0);
+            TKeyArrayFix key(0, ECmpTUint16);
+            TInt index(0);
+            
+            TInt loadCount = LoadItemCount();
+
+            for (TInt i=0; i<loadCount; i++)
+                {
+                ref = i;
+
+                if (selectionIndexes->Find(ref, key, index) == 0)  
+                    {
+                    TRAP(err, DeleteFromLoadItemListL(i-deleteIndexCounter));
+                    deleteIndexCounter++; // amount of indexes decreases after each delete
+                    }
+                }
+            
+            RefreshViewL();
+            User::LeaveIfError(err);
+            }
+        }
+    
+    // or if none selected, use the current item index
+    else
+        {
+        TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+        
+        if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
+            {
+            CAknQueryDialog* query = CAknQueryDialog::NewL();
+           _LIT(KQueryMessage, "Stop hightlighted item?");
+
+            if (query->ExecuteLD(R_GENERAL_CONFIRMATION_QUERY, KQueryMessage))
+                {
+                TRAP(err, DeleteFromLoadItemListL(currentItemIndex));
+                
+                RefreshViewL();
+                User::LeaveIfError(err);
+                }
+            }
+        }  
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::SuspendOrResumeSelectedOrHighlightedItemsL()
+    {
+    const CArrayFix<TInt>* selectionIndexes = iMainContainer->ListBoxSelectionIndexes();
+
+    // by default use selected items
+    if (selectionIndexes && selectionIndexes->Count() > 0)
+        {
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+
+        for (TInt i=0; i<LoadItemCount(); i++)
+            {
+            ref = i;
+
+            if (selectionIndexes->Find(ref, key, index) == 0)  
+                {
+                SuspendOrResumeFromLoadItemListL(i);
+                }
+            }
+        
+        RefreshViewL(EFalse);
+        }
+    
+    // or if none selected, use the current item index
+    else
+        {
+        TInt currentItemIndex = iMainContainer->CurrentListBoxItemIndex();
+        
+        if (LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
+            {
+            SuspendOrResumeFromLoadItemListL(currentItemIndex);
+            
+            RefreshViewL(EFalse);
+            }
+        }  
+    }                                
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::LoadSettingsL()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenModel::SaveSettingsL()
+    {
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CLoadGenModel::LaunchSettingsDialogL()
+    {
+    return 0;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CDesCArray* CLoadGenModel::ListOfAllAppsL()
+    {
+    const TInt KMaxAppsArraySize=250;
+    RApaLsSession ls;
+    CleanupClosePushL(ls);
+
+    User::LeaveIfError( ls.Connect() );
+    CDesCArray* allAppsArray = new(ELeave) CDesCArrayFlat( KMaxAppsArraySize );
+    CleanupStack::PushL( allAppsArray );
+    // reset the apps list
+    allAppsArray->Reset();
+
+    // search all apps
+    TApaAppInfo appInfo;
+    User::LeaveIfError(ls.GetAllApps());
+
+
+    while ( ls.GetNextApp( appInfo ) == KErrNone )
+        {
+        allAppsArray->AppendL( appInfo.iFullName );      
+        }
+    CleanupStack::Pop( allAppsArray );
+    CleanupStack::PopAndDestroy( &ls );
+   
+
+    // remove loadgen.* from the list
+    for ( TInt i = 0; i < allAppsArray->MdcaCount(); i++ )
+        {
+        if ( allAppsArray->MdcaPoint(i).FindF( _L("\\loadgen.") ) != KErrNotFound )
+            {
+            allAppsArray->Delete(i);
+            allAppsArray->Compress();
+            break;
+            }
+        }
+
+    // sort the elements
+    allAppsArray->Sort();
+
+    return allAppsArray; // ownership transferred
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/avkon/src/loadgen_settingsviewdlg.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,323 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "loadgen_settingsviewdlg.h"
+#include "loadgen_model.h"
+#include "loadgen.hrh"
+#include "loadgen_std.h"
+#include <loadgen.rsg>
+
+#include <aknsettingitemlist.h>
+#include <CAknMemorySelectionSettingItem.h> 
+#include <aknlists.h>
+#include <akntitle.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
+#include <StringLoader.h>
+#include <aknnotewrappers.h> 
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CLoadGenSettingsViewDlg* CLoadGenSettingsViewDlg::NewL(TLoadGenSettings& aSettings)
+    {
+    CLoadGenSettingsViewDlg* self = new(ELeave) CLoadGenSettingsViewDlg(aSettings);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenSettingsViewDlg::~CLoadGenSettingsViewDlg()
+    {
+    // restore default navi pane
+    if (iNaviContainer)
+        iNaviContainer->Pop();
+    
+    if (iSettingItemArray)
+        {
+        iSettingItemArray->ResetAndDestroy();
+        delete iSettingItemArray; 
+        }
+    
+    delete iDecoratedTabGroup;   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CLoadGenSettingsViewDlg::CLoadGenSettingsViewDlg(TLoadGenSettings& aSettings) : iSettings(aSettings)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::ConstructL()
+    {
+    // construct a menu bar
+    CAknDialog::ConstructL(R_LOADGEN_SETTINGS_MENUBAR);
+   
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    
+    // set empty navi pane label
+    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+    //iNaviContainer->PushDefaultL();
+    
+    // set title text
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( _L("Settings") );
+    
+    // create a tab group
+    iDecoratedTabGroup = iNaviContainer->CreateTabGroupL(this);
+    iTabGroup = static_cast<CAknTabGroup*>(iDecoratedTabGroup->DecoratedControl());
+    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs); 
+    
+    // add tabs
+    //iTabGroup->AddTabL(ETabGeneral, _L("General"));
+    //iTabGroup->AddTabL(ETabScreenShot, _L("Screen shot"));
+    //iTabGroup->SetActiveTabByIndex(ETabGeneral);
+    
+    iNaviContainer->PushL( *iDecoratedTabGroup );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            ShowSettingPageL(EFalse);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
+    {
+    iListBox->SetCurrentItemIndex(0);
+
+    SetVisibilitiesOfSettingItemsL();   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::ProcessCommandL(TInt aCommandId)
+    {
+    CAknDialog::ProcessCommandL(aCommandId);
+
+    switch (aCommandId)
+        {
+        case ELoadGenCmdSettingsChange:
+            ShowSettingPageL(ETrue);
+            break;
+        case ELoadGenCmdSettingsExit:
+            TryExitL(EAknCmdExit);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CLoadGenSettingsViewDlg::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    if (iTabGroup == NULL)
+        {
+        return EKeyWasNotConsumed;
+        }
+
+    TInt active = iTabGroup->ActiveTabIndex();
+    TInt count = iTabGroup->TabCount();
+
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+            if (active > 0)
+                {
+                active--;
+                iTabGroup->SetActiveTabByIndex(active);
+                TabChangedL(active); 
+                }
+            break;
+        
+        case EKeyRightArrow:
+            if((active + 1) < count)
+                {
+                active++;
+                iTabGroup->SetActiveTabByIndex(active);
+                TabChangedL(active); 
+                }
+            break;
+        }
+
+    return CAknDialog::OfferKeyEventL(aKeyEvent, aType);
+    }    
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::PreLayoutDynInitL()
+    {
+    iListBox = static_cast<CAknSettingStyleListBox*>( Control(ELoadGenSettingItemList) );
+    iListBox->SetMopParent(this);
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+    iListBox->SetListBoxObserver(this);
+
+    iSettingItemArray = new(ELeave) CAknSettingItemArray(16, EFalse, 0);
+
+    CTextListBoxModel* model = iListBox->Model();
+    model->SetItemTextArray(iSettingItemArray);
+    model->SetOwnershipType(ELbmDoesNotOwnItemArray);
+
+    UpdateListBoxL();    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CLoadGenSettingsViewDlg::OkToExitL(TInt aButtonId)
+    {
+    return CAknDialog::OkToExitL(aButtonId);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::ShowSettingPageL(TInt aCalledFromMenu)
+    {
+    TInt listIndex = iListBox->CurrentItemIndex();
+    TInt realIndex = iSettingItemArray->ItemIndexFromVisibleIndex(listIndex);
+    CAknSettingItem* item = iSettingItemArray->At(realIndex);
+    item->EditItemL(aCalledFromMenu);
+    item->StoreL();
+    SetVisibilitiesOfSettingItemsL();
+    DrawNow();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
+    {
+    if (iSettingItemArray->Count() > 0)
+        {
+/*
+        switch (iTabGroup->ActiveTabIndex())
+            {
+
+            case ETabGeneral:
+                {
+                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(EFalse);
+                break;
+                }
+            
+            case ETabScreenShot:
+                {
+                ((*iSettingItemArray)[ESettingListDisplayModeSelection])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListFileViewModeSelection])->SetHidden(ETrue);
+                break;            
+                }
+
+            default:
+                User::Panic(_L("TabIOOB"), 50);
+                break;
+            }
+*/
+        iSettingItemArray->RecalculateVisibleIndicesL();
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }   
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::UpdateListBoxL()
+    {
+    iSettingItemArray->ResetAndDestroy();
+
+/* 
+    // create items
+    TInt ordinal(0);
+
+    AddSettingItemL(ESettingListDisplayModeSelection,
+                    R_DISPLAYMODESELECTION_SETTING_TITLE,
+                    R_DISPLAYMODESELECTION_SETTING_PAGE,
+                    R_DISPLAYMODESELECTION_SETTING_TEXTS,
+                    ordinal++);
+                    
+    AddSettingItemL(ESettingListFileViewModeSelection,
+                    R_FILEVIEWMODESELECTION_SETTING_TITLE,
+                    R_FILEVIEWMODESELECTION_SETTING_PAGE,
+                    R_FILEVIEWMODESELECTION_SETTING_TEXTS,
+                    ordinal++); 
+*/                                                              
+    SetVisibilitiesOfSettingItemsL(); 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CLoadGenSettingsViewDlg::AddSettingItemL(TInt aId,
+                                                 TInt aTitleResource,
+                                                 TInt aSettingPageResource,
+                                                 TInt aAssociatedResource,
+                                                 TInt aOrdinal)
+    {
+    // create a setting item
+    CAknSettingItem* settingItem = NULL;
+    
+    switch (aId)
+        {
+/*
+        case ESettingListDisplayModeSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDisplayMode);
+            break;
+            
+        case ESettingListFileViewModeSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iFileViewMode);
+            break;
+
+        default:
+            User::Panic(_L("NotSetItem"), 50);
+            break;
+*/
+        }
+        
+    CleanupStack::PushL(settingItem);
+
+    // get title text
+    HBufC* itemTitle = StringLoader::LoadLC(aTitleResource);
+
+    // construct the setting item
+    settingItem->ConstructL(EFalse, aOrdinal, *itemTitle, NULL, aSettingPageResource,
+                            EAknCtPopupSettingList, NULL, aAssociatedResource);
+
+    // append the setting item to settingitem array
+    iSettingItemArray->InsertL(aOrdinal, settingItem);
+
+    CleanupStack::PopAndDestroy(); //itemTitle
+    CleanupStack::Pop(); //settingItem
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/hb.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,111 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+#
+
+
+TEMPLATE = app
+TARGET = LoadGen
+DEPENDPATH += .
+
+INCLUDEPATH += . /inc
+INCLUDEPATH += ./inc \
+			   ../../engine/inc \
+			   /epoc32/include \
+				 /epoc32/include/mw \
+				 /epoc32/include/platform/mw \
+				 /epoc32/include/platform \
+				 /epoc32/include/app \
+				 /epoc32/include/platform/app \
+				 /epoc32/include/platform/loc \
+				 /epoc32/include/platform/mw/loc \
+				 /epoc32/include/platform/app/loc \
+				 /epoc32/include/platform/loc/sc \
+				 /epoc32/include/platform/mw/loc/sc \
+				 /epoc32/include/platform/app/loc/sc
+
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
+
+HEADERS += inc/mainview.h inc/settingsview.h inc/notifications.h 
+SOURCES += src/main.cpp src/mainview.cpp src/settingsview.cpp src/notifications.cpp 
+RESOURCES += loadgen.qrc
+
+symbian: {
+		BLD_INF_RULES.prj_exports += "./rom/loadgen.iby CORE_IBY_EXPORT_PATH(tools,loadgen.iby)"
+
+		HEADERS += inc/engine.h \ 
+		           inc/enginewrapper.h 
+		SOURCES += src/engine.cpp \
+		           src/enginewrapper.cpp \
+				   ../../engine/src/loadgen_utils.cpp  \
+        		   ../../engine/src/loadgen_loadbase.cpp  \
+ 				   ../../engine/src/loadgen_cpuload.cpp \
+ 				   ../../engine/src/loadgen_memoryeat.cpp \
+ 				   ../../engine/src/loadgen_phonecall.cpp \
+ 				   ../../engine/src/loadgen_netconn.cpp \
+ 				   ../../engine/src/loadgen_keypress.cpp \
+ 				   ../../engine/src/loadgen_messages.cpp \ 
+ 				   ../../engine/src/loadgen_applications.cpp \ 
+ 				   ../../engine/src/loadgen_photocapture.cpp \
+ 				   ../../engine/src/loadgen_bluetooth.cpp \ 
+ 				   ../../engine/src/loadgen_pointerevent.cpp 
+		
+		
+		RSS_RULES += "group_name = \"RnD Tools\"";
+		LIBS += -leuser \
+				-lcommonengine \
+				-lapparc \
+				-lcone \ 
+				-leikcore \
+				-leikcoctl \
+				-leikctl \
+				-leikdlg \  
+				-lws32 \ 
+				-lapgrfx \
+				-lefsrv \
+				-lbafl \
+				-lgdi \
+				-legul \
+				-letel3rdparty \
+				-ldownloadmgr \
+				-lcommdb \
+				-lflogger \
+				-lestor \ 
+				-lmsgs \
+				-lsmcm \
+				-lgsmu \
+				-letext \
+				-lsendas2 \
+				-lecam \
+				-lfeatdiscovery \ 
+				-lcentralrepository \
+				-lesock \
+				-lbluetooth \
+				-lhal
+    TARGET.CAPABILITY = swevent ReadUserData WriteUserData NetworkServices UserEnvironment CAP_APPLICATION AllFiles
+
+    TARGET.UID2 = 0x100039CE
+    TARGET.UID3 = 0x20011384
+    // TARGET.SID = 0x20011384
+    TARGET.VID = 0x101FB657 // Nokia
+	
+    TARGET.EPOCHEAPSIZE = 0x10000 0x1000000  // Min 64Kb, Max 16Mb
+
+    ICON = ../../icons/qgn_menu_loadgen.svg 
+
+} else {
+    error("Only Symbian supported!")
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/inc/engine.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef LOADGEN_MODEL_H
+#define LOADGEN_MODEL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <apgcli.h>
+
+#include "loadgen_loadattributes.h"
+#include "loadgen_loadbase.h"
+
+// FORWARD DECLARATIONS
+class EngineWrapper;
+class MainView;
+class CLoadGenGraphsContainer;
+class CEikonEnv;
+//class CLoadBase;
+
+
+typedef CArrayFixSeg<CLoadBase*> CLoadItemList;
+
+const TUint KMaxCPUs = 4;
+
+// CLASS DECLARATIONS
+
+class TLoadGenSettings
+    {
+public:
+    };
+
+class CEngine : public CActive
+    {
+private:
+    enum TContainerDrawState
+        {
+        EDrawStateInvalid = -1,
+        EDrawStateMain
+        };
+
+public:
+    static CEngine* NewL(EngineWrapper *aEngineWrapper);
+    ~CEngine();
+    void ActivateEngineL();
+    void DeActivateEngineL();
+	void LaunchPerfMonL();
+    void EditLoadL(TInt aIndex);
+	void ExistingLoadEditedL();
+	void ExistingLoadEditCancelled();
+	
+private:
+    void RunL();
+    void DoCancel();
+        
+private:
+    CEngine();
+    void ConstructL(EngineWrapper *aEngineWrapper);
+    void LoadSettingsL();
+    void AppendToLoadItemListL(CLoadBase* aItem);
+    void DeleteFromLoadItemListL(TInt aIndex);
+    void SuspendOrResumeFromLoadItemListL(TInt aIndex);
+    void DeleteAllLoadItems();
+    void RefreshViewL(TBool aClearSelection=ETrue);
+    CDesCArray* ListOfAllAppsL();    
+    
+public:
+    void StopAllLoadItemsL();
+    void SuspendAllLoadItemsL();
+    void ResumeAllLoadItemsL();
+            
+    TInt LoadItemCount() const;
+    void StopSelectedOrHighlightedItemsL(const CArrayFix<TInt>* aSelectionIndexes);
+    void SuspendOrResumeSelectedOrHighlightedItemsL();
+
+    CDesCArray* GenerateListBoxItemTextArrayL();
+    void StartNewLoadL(TInt aCommand);
+	void DoStartNewLoadL(TInt aCommand);
+    void SaveSettingsL();
+    TInt LaunchSettingsDialogL();
+	TCPULoadAttributes GetCPULoadAttributes();
+	TMemoryEatAttributes GetMemoryEatAttributes();
+	TPhoneCallAttributes GetPhoneCallAttributes();
+	TNetConnAttributes GetNetConnAttributes();
+	TKeyPressAttributes GetKeyPressAttributes();
+	TMessageAttributes GetMessageAttributes();
+	TApplicationsAttributes GetApplicationsAttributes();
+	TPhotoCaptureAttributes GetPhotoCaptureAttributes();
+	TBluetoothAttributes    GetBluetoothAttributes();
+	TPointerEventAttributes GetPointerEventAttributes();
+	void ChangeCPULoadAttributes(TCPULoadAttributes aAttributes); 
+	void ChangeMemoryEatAttributes(TMemoryEatAttributes aAttributes);
+	void ChangePhoneCallAttributes(TPhoneCallAttributes aAttributes);
+	void ChangeNetConnAttributes(TNetConnAttributes aAttributes);
+	void ChangeKeyPressAttributes(TKeyPressAttributes aAttributes);
+	void ChangeMessageAttributes(TMessageAttributes aAttributes);
+	void ChangeApplicationsAttributes(TApplicationsAttributes aAttributes);
+	void ChangePhotoCaptureAttributes(TPhotoCaptureAttributes aAttributes);
+	void ChangeBluetoothAttributes(TBluetoothAttributes aAttributes);
+	void ChangePointerEventAttributes(TPointerEventAttributes aAttributes);
+	
+    inline TLoadGenSettings& Settings() { return iSettings; }
+    inline CEikonEnv* EikonEnv() 		{ return iEnv; }
+    inline RApaLsSession& LsSession() 	{ return iLs; }
+    inline TBool LoadItemsExists() 		{ return iLoadItemList->Count() > 0; } 
+
+
+private:
+    RTimer                  iTimer;
+    CEikonEnv*              iEnv;
+    TLoadGenSettings        iSettings;
+    RApaLsSession           iLs;
+    CLoadItemList*          iLoadItemList;
+    TInt                    iReferenceNumber;
+    TCPULoadAttributes      iCpuLoadAttributes;
+    TMemoryEatAttributes    iMemoryEatAttributes;
+    TPhoneCallAttributes    iPhoneCallAttributes;
+    TNetConnAttributes      iNetConnAttributes;
+    TKeyPressAttributes     iKeyPressAttributes;
+    TMessageAttributes      iMessageAttributes;
+    TApplicationsAttributes	iApplicationsAttributes;
+    TPhotoCaptureAttributes iPhotoCaptureAttributes;
+    TBluetoothAttributes    iBluetoothAttributes;
+    TPointerEventAttributes iPointerEventAttributes;
+	EngineWrapper*          iEngineWrapper; // used for communicating between QT and Symbian
+	TInt 					iCurrentItemIndex;
+	TBool                   iEditExistingLoad;
+	CLoadBase::TLoadState   iLoadStatusBeforeEdit;
+    };
+ 
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/inc/enginewrapper.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef ENGINEWRAPPER_H
+#define ENGINEWRAPPER_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include <badesca.h>
+#include <engine.h>
+#include "loadgen.hrh"
+
+#include <QObject>
+
+class HbMainWindow;
+class HbAction;
+class MainView; 
+class SettingsView;
+class CPULoadAttributes;
+class MemoryEatAttributes;
+class PhoneCallAttributes;
+class NetConnAttributes;
+class KeyPressAttributes;
+class PointerEventAttributes;
+class MessageAttributes;
+class ApplicationsAttributes;
+class PhotoCaptureAttributes;
+class BluetoothAttributes;
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class EngineWrapper : public QObject
+ { 
+	Q_OBJECT
+
+public:
+    
+    /**
+     * Constructor
+     */
+    EngineWrapper(HbMainWindow &mainWindow, MainView &mainView);
+    
+    /**
+     * Destructor
+     */
+    ~EngineWrapper();
+    
+    /**
+     * Initializes Engine Wrapper
+     * @return true if engine was started successfully
+     */
+    bool init();
+		
+public slots:
+    void StopLoadYesNoDialogClosed(HbAction *action);
+	void loadAddedOrEdited(TLoadGenCommandIds cmdId);
+	void loadSettingsCanclled();	
+
+public:
+
+	/* Functions that are called from UI: */
+    
+	/**
+	* Start new load
+	*/
+	bool startNewLoad(int commandId);
+
+	/**
+	* Launch Performance Monitor application.
+	*/
+	void launchPerfMonApp();
+	
+	/**
+	* Edit operation for load settings
+	*/
+	void loadEdit(int rowIndex);
+	
+	/**
+	* CPU load attributes
+	*/
+	CPULoadAttributes getCpuLoadAttributes();
+	
+	/**
+	* Memory eat attributes
+	*/
+	MemoryEatAttributes getMemoryEatAttributes();
+
+	/**
+	* Phone call attributes
+	*/
+	PhoneCallAttributes getPhoneCallAttributes();
+	
+	/**
+	* Network connection attributes
+	*/
+	NetConnAttributes getNetConnAttributes();
+	
+	/**
+	* Key presses attributes
+	*/
+	KeyPressAttributes getKeyPressAttributes();
+
+	/**
+	* Pointer event attributes
+	*/
+	PointerEventAttributes getPointerEventAttributes();
+	
+	/**
+	* Message attributes
+	*/
+	MessageAttributes getMessageAttributes();
+	
+	/**
+	* Applications attributes
+	*/
+	ApplicationsAttributes getApplicationsAttributes();
+	
+	/**
+	* Photo capture attributes
+	*/
+	PhotoCaptureAttributes getPhotoCaptureAttributes();
+	
+	/**
+	* BT attributes
+	*/
+	BluetoothAttributes getBluetoothAttributes();
+	
+	/**
+	* Set attributes for CPU load
+	*/
+	void setCpuLoadAttributes(CPULoadAttributes attributes);
+	
+	/**
+	* Set attributes for memory eat
+	*/
+	void setMemoryEatAttributes(MemoryEatAttributes attributes);
+
+	/**
+	* Set attributes for phone call
+	*/	
+	void setPhoneCallAttributes(PhoneCallAttributes attributes);
+
+	/**
+	* Set attributes for network connection
+	*/		
+	void setNetConnAttributes(NetConnAttributes attributes);
+	
+	/**
+	* Set attributes for key presses
+	*/
+	void setKeyPressAttributes(KeyPressAttributes attributes);
+	
+	/**
+	* Set pointer event for messages
+	*/
+	void setPointerEventAttributes(PointerEventAttributes attributes);
+
+	/**
+	* Set message attributes
+	*/
+	void setMessageAttributes(MessageAttributes attributes);
+	
+	/**
+	* Set applications attributes
+	*/
+	void setApplicationsAttributes(ApplicationsAttributes attributes);
+	
+	/**
+	* Set photo capture attributes
+	*/
+	void setPhotoCaptureAttributes(PhotoCaptureAttributes attributes);
+	
+	/**
+	* Set BT attributes
+	*/	
+	void setBluetoothAttributes(BluetoothAttributes attributes);
+	
+	/**
+	* Stop load
+	*/
+	bool stopLoad(bool stopAll);
+	
+	/**
+	* Resume all loads
+	*/ 
+	void resumeAllLoadItems();
+
+	/**
+	* Suspend all loads
+	*/ 	
+	void suspendAllLoadItems();
+	
+	/**
+	* Suspend or resume selected/highlighted item from load list.
+	*/
+	void suspendOrResumeSelectedOrHighlightedItems();
+    
+public:
+
+    /* Functions that are called from engine: */
+    
+	/** 
+     * uses Notifications class to show error message 
+     */
+    void ShowErrorMessage(const TDesC& aErrorMessage);
+
+    /**
+	* uses Notifications class to show user note
+	*/
+	void ShowNote(const TDesC& aNoteMessage);
+	
+	/**
+	* Query item index
+	* @return selected row in load list view
+	*/
+	TInt QueryCurrentItemIndex();
+	
+	/**
+	* selected indexes
+	*/
+	const CArrayFix<TInt>*  QueryListSelectedIndexesOrCurrentItemL();
+
+	/**
+	* Open settings for load.
+	*/
+	void OpenLoadSettings(TInt loadType, bool editExistingLoad);
+	
+	void ReFreshView(CDesCArray* aTextArray);
+	/**
+	* Clear load list selection(s) in Ui
+	*/
+	void ClearSelection();
+	
+	/**
+	* Set current index in load list
+	*/
+	void SetCurrentItemIndex(TInt aIndex);
+	
+public: 
+	inline MainView& ViewReference() { return mMainView; };	
+	inline HbMainWindow& WindowReference() { return mMainWindow; };
+	
+private:
+
+	enum LoadTypes {
+		Cpu,
+		EatMemory,
+		PhoneCalls,
+		Messages,
+		NWConnections,
+		KeyPresses,
+		Apps,
+		Photos,
+		BTAct,
+		PointerEvents
+	};
+    
+    
+    /* LoadGen engine */
+    CEngine* mEngine;
+    
+	MainView &mMainView;
+	HbMainWindow &mMainWindow;
+	bool mEditExistingLoad;
+};
+
+#endif //ENGINEWRAPPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/inc/mainview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef MAINVIEW_H
+#define MAINVIEW_H
+
+#include <hbview.h>
+
+class EngineWrapper;
+class HbMainWindow;
+class HbApplication;
+class HbAction;
+class HbLabel;
+class HbProgressNote;
+class HbListView;
+class HbAbstractViewItem;
+
+class QStandardItemModel;
+class QSignalMapper;
+class QPointF;
+
+class MainView : public HbView
+{
+    Q_OBJECT
+    
+public:
+
+    MainView(HbMainWindow &mainWindow);
+	~MainView();
+	void init(HbApplication &app);
+	int currentItemIndex();
+	void setCurrentItemIndex(int index);
+	void clearListSelection();
+	void setLoadListData(QStringList& items);
+	QList<int> listSelectionIndexes();
+	
+private:
+    void createMenu(HbApplication &app);
+	void loadListIinit();
+	bool showItemActionPopup(int &index);
+	void loadListDelete();
+	bool stopLoad(bool stopAll /*, int selectedLoad = 0*/);
+   
+private slots:
+    void handleLoadListEvent(HbAbstractViewItem */*listViewItem*/, const QPointF &/*coords*/);
+    void ItemActionPopupClosed(HbAction* action );
+	void showAboutPopup();
+	void stopAllLoads();
+	void updateMenu();
+	void launchPerfMon();
+	void suspendAllLoads();
+	void resumeAllLoads();
+	
+	/**
+	* calls engine wrapper to complete service request, specified by cmd.
+	*/
+	void executeMenuCommand(int cmd);
+    
+private:
+    HbMainWindow &mMainWindow;
+    EngineWrapper *mEngineWrapper;
+	HbListView *mListView;
+	QStandardItemModel *mListModel;
+	QSignalMapper *mSm;
+	bool mIsLoadListEmpty;
+	
+	HbAction *mActionAbout;
+	HbMenu   *mLoadSubMenu1;
+	HbMenu   *mLoadSubMenu2;
+	HbAction *mActionExit;
+	HbAction *mStopAll;
+	HbAction *mSuspendAll;	
+	HbAction *mResumeAll;	
+	HbAction *mActionPerfMon;
+	HbAction *mCpuLoadAction;
+	HbAction *mMemoryEatLoadAction;
+	HbAction *mPhoneCallLoadAction;
+	HbAction *mMessagesLoadAction;
+	HbAction *mNetConnLoadAction;
+	HbAction *mAppsLoadAction;
+	HbAction *mKeyPressLoadAction;
+	HbAction *mPhotoCapturesLoadAction;
+	HbAction *mBtActionsLoadAction;
+	HbAction *mPointerEventsLoadAction;
+	
+};
+
+#endif // MAINVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/inc/notifications.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef NOTIFICATIONS_H_
+#define NOTIFICATIONS_H_
+
+#include <hbmessagebox.h>
+
+
+class Notifications : public HbPopup
+    {
+
+	Q_OBJECT 	
+	
+public:
+    
+    /**
+     * shows about box
+     */
+    static void about();
+    
+    /** 
+     * shows error message 
+     */
+    static void error(const QString& errorMessage);
+	
+    /**
+     * shows global HbGlobalCommonNote type note
+     */
+	static void showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout = HbPopup::ConfirmationNoteTimeout);
+    };
+
+
+
+#endif // NOTIFICATIONS_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/inc/settingsview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef SETTINGSVIEW_H
+#define SETTINGSVIEW_H
+
+#include <hbmainwindow.h>
+#include <hbview.h>
+#include "loadgen.hrh"
+
+class EngineWrapper;
+class HbDataFormModelItem;
+class HbDataFormModel;
+class HbDataForm;
+class HbDataFormViewItem;
+class HbRadioButtonList;
+
+class CPULoadAttributes
+    {
+public:
+    uint mId;        
+    uint mPriority;        
+    uint mMode;        
+    uint mType;        
+    uint mLength;        
+    uint mIdle;        
+    uint mRandomVariance;
+    int  mCpu;
+    uint mCpuCount;
+    };
+
+class MemoryEatAttributes
+    {
+public:
+    uint    mId;        
+    uint    mPriority;        
+    uint    mSource;        
+    uint    mType;
+    uint    mBuffer;
+    uint    mIdle;
+    qint64  mAmount;
+    qint64  mRandomMin;
+    qint64  mRandomMax;
+    QString mAmountDes;
+    QString mRandomMinDes;
+    QString mRandomMaxDes;
+    uint    mRandomVariance;        
+    }; 
+
+class PhoneCallAttributes
+    {
+public:
+    uint    mId;        
+    uint    mPriority;        
+    QString mDestination;
+    uint    mLength;        
+    uint    mIdle;        
+    uint    mRandomVariance;        
+    };
+	
+class NetConnAttributes
+    {
+public:
+    uint    mId;        
+    uint    mPriority;        
+    QString mDestination;
+    uint    mIdle;        
+    uint    mRandomVariance;        
+    };
+	
+class KeyPressAttributes
+    {
+public:
+    uint mId;        
+    uint mPriority;        
+    uint mHeartBeat;        
+    uint mRandomVariance;        
+    };	
+	
+class PointerEventAttributes
+    {
+public:
+    uint mId;        
+    uint mPriority;        
+    uint mHeartBeat;        
+    uint mRandomVariance;        
+    };
+
+class MessageAttributes
+    {
+public:
+    uint    mId;
+    int     mMessageType;
+    QString mDestination;
+    uint    mPriority; 
+    uint    mAmount;
+    int     mLength;    
+    uint    mIdle;    
+    uint    mRandomVariance;        
+    };
+
+class ApplicationsAttributes
+    {
+public:
+    uint        mId;        
+    uint        mPriority;
+    uint        mLaunchingInterval;
+    uint        mKeyPressType;
+    uint        mMaxOpen;
+    uint        mHeartBeat;
+    uint        mRandomVariance;
+    QStringList mAppsArray;
+
+    };
+
+
+class PhotoCaptureAttributes
+    {
+public:
+    uint mId;    
+    int  mPriority;
+    int  mCameraCount;
+    int  mCamera;
+    uint mIdle;    
+    uint mRandomVariance;        
+    };
+
+class BluetoothAttributes
+    {
+public:
+    uint mId;    
+    int mPriority;    
+    uint mIdle;    
+    uint mRandomVariance;        
+    bool mBluetoothSupported;
+    };
+	
+
+class SettingsView : public HbView
+{
+    Q_OBJECT
+    
+public:
+    SettingsView(HbView &mainView, HbMainWindow &parent, EngineWrapper &engine);
+    ~SettingsView();
+    void open(const QString &settingsName, TLoadGenCommandIds cmdId);
+
+signals:
+	void loadCompleted(TLoadGenCommandIds cmdId);
+	void loadCanclled();
+	
+private slots:
+   void backButtonPressed();
+   void okExit();
+   void cancelled();
+   void selectionChanged(int index);
+   void dataItemDisplayed(const QModelIndex &index);
+   
+private:
+    void createItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createCpuLoadItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createEatMemoryItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createPhoneCallItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createNetConnItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createKeyOrPointerItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createMessageItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createAppsItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createPhotoItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+	void createBtItems(HbDataFormModel *model, HbDataFormModelItem *parent);
+    void loadAttributes();
+    void saveSettings();
+	void saveCpuLoadSettings();
+	void saveEatMemorySettings();
+	void savePhoneCallSettings();
+	void saveNetConnSettings();
+	void saveKeyPressSettings();
+	void saveMessageSettings();
+	void savePointerEventSettings();
+	void saveApplicationsSettings();
+	void savePhotoSettings();
+	void saveBtSettings();
+    void exit();
+    void setDefaultSettings();
+	void setLoadAttributes();
+    
+private:
+    HbMainWindow &mMainWindow;
+    HbView &mMainView;
+    EngineWrapper &mEngineWrapper;
+	TLoadGenCommandIds mCmdId;
+
+    /* Setting form */
+    HbDataForm *mSettingForm;
+    
+    /* Model for Setting form */
+    HbDataFormModel *mModel;
+    
+    /* Components for the model: */   
+
+    /* grouped load settings */
+    HbDataFormModelItem *mLoadSettings;
+    
+    HbDataFormModelItem *mPriority;
+    HbDataFormModelItem *mLoadMode;
+	HbDataFormModelItem *mSource;
+    HbDataFormModelItem *mType;
+	HbDataFormModelItem *mAmount;
+	HbDataFormModelItem *mMinAmountToBeLeft;
+	HbDataFormModelItem *mMaxAmountToBeLeft;
+	HbDataFormModelItem *mBuffer;
+    HbDataFormModelItem *mLength;
+	HbDataFormModelItem *mDestination;
+	HbDataFormModelItem *mIdle;
+	HbDataFormModelItem *mHeartBeat;
+	HbDataFormModelItem *mRandomVar;
+	HbDataFormModelItem *mMaxParallelApps;
+	HbDataFormModelItem *mLaunchingInterval;
+	HbDataFormModelItem *mKeyPressType;
+	HbDataFormModelItem *mCamera;
+	HbDataFormModelItem *mCpu;
+	
+	HbRadioButtonList *mModes;
+	HbRadioButtonList *mTypes;
+	
+	/* load attributes for each load type*/
+	CPULoadAttributes      mCPULoadAttributes;
+	MemoryEatAttributes    mMemoryEatAttributes;
+	PhoneCallAttributes	   mPhoneCallAttributes;
+	NetConnAttributes	   mNetConnAttributes;
+	KeyPressAttributes     mKeyPressAttributes;
+	PointerEventAttributes mPointerEventAttributes;
+	MessageAttributes      mMessageAttributes;
+	ApplicationsAttributes mApplicationsAttributes;
+	PhotoCaptureAttributes mPhotoCaptureAttributes;
+	BluetoothAttributes    mBluetoothAttributes;
+};
+
+#endif // SETTINGSVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/loadgen.qrc	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,7 @@
+<RCC>
+    <qresource prefix="/" >
+        <file alias="loadgen.svg">..\..\icons\qgn_menu_loadgen.svg</file>
+		<file alias="active.svg">..\..\icons\qgn_prob_status_green.svg</file>
+		<file alias="paused.svg">..\..\icons\qgn_prob_status_red.svg</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/rom/loadgen.iby	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef __LOADGEN_IBY__
+#define __LOADGEN_IBY__
+
+S60_APP_EXE(LoadGen)
+S60_APP_AIF_ICONS(LoadGen)
+S60_APP_RESOURCE(LoadGen)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,LoadGen_ExtraIcons)
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,LoadGen)
+
+//#ifdef S60_UPGRADABLE_APP_REG_RSC
+//  S60_UPGRADABLE_APP_REG_RSC(LoadGen)
+//#else
+//  S60_APP_AIF_RSC(LoadGen)
+//#endif
+
+data=ZPRIVATE\10003a3f\import\APPS\LoadGen_reg.RSC Private\10003a3f\import\Apps\LoadGen_reg.rsc
+
+data=ZPRIVATE\20011384\backup_registration.xml        	private\20011384\backup_registration.xml
+data=ZSYSTEM\Install\LoadGen_stub.sis                   \system\install\LoadGen_stub.sis
+
+#endif // __LOADGEN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/engine.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1235 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+// INCLUDE FILES
+#include "engine.h"
+#include "enginewrapper.h"
+#include "settingsview.h"
+#include "loadgen_utils.h"
+#include "loadgen_cpuload.h"
+#include "loadgen_memoryeat.h"
+#include "loadgen_phonecall.h"
+#include "loadgen_netconn.h"
+#include "loadgen_keypress.h"
+#include "loadgen_pointerevent.h"
+#include "loadgen_messages.h"
+#include "loadgen_applications.h"
+#include "loadgen_photocapture.h"
+#include "loadgen_bluetooth.h"
+#include "loadgen_traces.h"
+#include "loadgen_loadattributes.h"
+#include "loadgen.hrh"
+
+//#include "loadgen_editors.h"
+//#include "loadgen_app.h"
+//#include "loadgen_settingsviewdlg.h"
+//#include "loadgen_maincontainer.h"
+
+//#include <loadgen.rsg>
+
+#include <coeutils.h>
+#include <bautils.h>
+#include <eikenv.h>
+//#include <AknQueryDialog.h>
+#include <e32math.h> 
+#include <u32hal.h>
+#include <hal.h> 
+#include <hal_data.h>
+
+#include <ecam.h>
+//#include <aknnotewrappers.h>
+#include <featdiscovery.h>
+
+const TInt KZeroIndex = 0;
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CEngine* CEngine::NewL(EngineWrapper *aEngineWrapper)
+    {
+    CEngine* self = new(ELeave) CEngine;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEngineWrapper);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CEngine::CEngine() : CActive(EPriorityStandard)
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ConstructL(EngineWrapper *aEngineWrapper)
+    {
+	iEngineWrapper = aEngineWrapper;
+
+    iReferenceNumber = 0;
+	iCurrentItemIndex = 0;
+	iEditExistingLoad = EFalse;
+    
+    iEnv = CEikonEnv::Static();
+    User::LeaveIfError(iLs.Connect());
+    
+    iLoadItemList = new(ELeave) CLoadItemList(64);
+
+    User::LeaveIfError(iTimer.CreateLocal());
+    CActiveScheduler::Add(this);
+  
+  }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ActivateEngineL()
+    {
+    // load settings
+    //TRAP_IGNORE(LoadSettingsL());
+
+	// RAM
+	TMemoryInfoV1Buf ramMemory;
+	UserHal::MemoryInfo(ramMemory);
+	                
+	TInt freeRam = ramMemory().iFreeRamInBytes;
+
+	
+    // set defaults to attributes
+    iCpuLoadAttributes.iId = 0;
+    iCpuLoadAttributes.iPriority = EThreadPriorityTypeNormal;
+    iCpuLoadAttributes.iMode = ECpuLoadModeYielding;
+    iCpuLoadAttributes.iType = ECpuLoadTypePeriodic;
+    iCpuLoadAttributes.iLength = 4000;
+    iCpuLoadAttributes.iIdle = 2000;
+    iCpuLoadAttributes.iRandomVariance = 0;
+    iCpuLoadAttributes.iCpu = KCPUSelection_FreeScheduling; // set CPU as "undefined" (can be >= 0 only in SMP environments)
+    iCpuLoadAttributes.iCpuCount = UserSvr::HalFunction(EHalGroupKernel, KHalFunction_EKernelHalNumLogicalCpus, 0, 0);
+    if( iCpuLoadAttributes.iCpuCount < 1 || iCpuLoadAttributes.iCpuCount > KMaxCPUs )
+        {
+        // HAL may not support this function, so let's use CPU count 1:
+        iCpuLoadAttributes.iCpuCount = 1;
+        }
+    iMemoryEatAttributes.iId = 0;
+    iMemoryEatAttributes.iPriority = EThreadPriorityTypeNormal;
+    iMemoryEatAttributes.iSource = 0;
+    iMemoryEatAttributes.iType = EMemoryEatTypeMemoryToBeLeft;
+    iMemoryEatAttributes.iBuffer = 16*1024;
+    iMemoryEatAttributes.iIdle = 0;
+    iMemoryEatAttributes.iAmount = freeRam;//0;
+    iMemoryEatAttributes.iRandomMin = 1000000;
+    iMemoryEatAttributes.iRandomMax = 1500000;
+    iMemoryEatAttributes.iAmountDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomMinDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomMaxDes.Copy(KNullDesC);
+    iMemoryEatAttributes.iRandomVariance = 0;
+
+    iPhoneCallAttributes.iId = 0;
+    iPhoneCallAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPhoneCallAttributes.iDestination.Copy(_L("+358"));
+    iPhoneCallAttributes.iLength = 60000;
+    iPhoneCallAttributes.iIdle = 10000;
+    iPhoneCallAttributes.iRandomVariance = 0;
+
+    iNetConnAttributes.iId = 0;
+    iNetConnAttributes.iPriority = EThreadPriorityTypeNormal;
+    iNetConnAttributes.iDestination.Copy(_L("http://www.nokia.com"));
+    iNetConnAttributes.iIdle = 10000;
+    iNetConnAttributes.iRandomVariance = 0;
+
+    iKeyPressAttributes.iId = 0;
+    iKeyPressAttributes.iPriority = EThreadPriorityTypeNormal;
+    iKeyPressAttributes.iHeartBeat = 100;
+    iKeyPressAttributes.iRandomVariance = 0;
+    
+    iPointerEventAttributes.iId = 0;
+    iPointerEventAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPointerEventAttributes.iHeartBeat = 1000;
+    iPointerEventAttributes.iRandomVariance = 0;
+
+    iMessageAttributes.iId = 0;
+    iMessageAttributes.iPriority = EThreadPriorityTypeNormal;
+    iMessageAttributes.iMessageType = EMessageTypeSMS;
+    iMessageAttributes.iDestination.Copy(_L("+358"));
+    iMessageAttributes.iAmount = 5;
+    iMessageAttributes.iLength = 160;
+    iMessageAttributes.iIdle = 15000;
+    iMessageAttributes.iRandomVariance = 0;
+    
+    iApplicationsAttributes.iId = 0;
+    iApplicationsAttributes.iLaunchingInterval = 2000;
+    iApplicationsAttributes.iPriority = EThreadPriorityTypeNormal;
+    iApplicationsAttributes.iKeyPressType = EApplicationsKeyPressTypeNone;
+    iApplicationsAttributes.iMaxOpen = 20;
+    iApplicationsAttributes.iHeartBeat = 50;
+    iApplicationsAttributes.iRandomVariance = 0;
+    
+    iPhotoCaptureAttributes.iId = 0;
+    iPhotoCaptureAttributes.iPriority = EThreadPriorityTypeNormal;
+    iPhotoCaptureAttributes.iIdle = 10000;
+    iPhotoCaptureAttributes.iRandomVariance = 0;        
+    iPhotoCaptureAttributes.iCameraCount = CCamera::CamerasAvailable();
+    if(iPhotoCaptureAttributes.iCameraCount > 0)
+        {
+        iPhotoCaptureAttributes.iCamera = 0; // Main camera
+        }
+    else
+        {
+        iPhotoCaptureAttributes.iCamera = -1;
+        }
+    
+    iBluetoothAttributes.iId = 0;
+    iBluetoothAttributes.iPriority = EThreadPriorityTypeNormal;
+    iBluetoothAttributes.iIdle = 10000;
+    iBluetoothAttributes.iRandomVariance = 0;
+    iBluetoothAttributes.iBluetoothSupported = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdBt);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::DeActivateEngineL()
+    {
+    Cancel();
+    
+    // for a faster exit, send the application to background
+    TApaTask selfTask(iEnv->WsSession());
+    selfTask.SetWgId(iEnv->RootWin().Identifier());
+    selfTask.SendToBackground();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+CEngine::~CEngine()
+    {
+    if (iLoadItemList)
+        {
+        DeleteAllLoadItems();
+        delete iLoadItemList;
+        }
+    if ( iApplicationsAttributes.iAppsArray )
+        {
+        delete iApplicationsAttributes.iAppsArray;
+        }
+    iTimer.Close();
+    iLs.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::RunL()
+    {
+    // continue    
+    //iTimer.After(iStatus, 400000);
+    //SetActive();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CEngine::StartNewLoadL(TInt aCommand)
+    {
+    // show new load query
+	//CLoadGenLoadTypeEditorBase* dlg = NULL;
+	
+	if(aCommand == ELoadGenCmdNewLoadPhotoCaptures && 
+	   iPhotoCaptureAttributes.iCameraCount == 0)
+		{
+		_LIT(message, "Cameras not available");
+		iEngineWrapper->ShowNote(message);
+		return;
+		}
+	if(aCommand == ELoadGenCmdNewLoadBluetooth &&
+	   iBluetoothAttributes.iBluetoothSupported == EFalse)
+		{
+		_LIT(message, "Bluetooth device not available");
+		iEngineWrapper->ShowNote(message); 
+		return;
+		}
+	/*
+    switch ( aCommand )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            //dlg = CLoadGenCPULoadEditor::NewL(iCpuLoadAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            //dlg = CLoadGenMemoryEatEditor::NewL(iMemoryEatAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            //dlg = CLoadGenPhoneCallEditor::NewL(iPhoneCallAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            //dlg = CLoadGenNetConnEditor::NewL(iNetConnAttributes);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            //dlg = CLoadGenKeyPressEditor::NewL(iKeyPressAttributes);
+            break;
+            }               
+        case ELoadGenCmdNewLoadMessages:
+            {
+            //dlg = CLoadGenMessagesEditor::NewL( iMessageAttributes );
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            //dlg = CLoadGenApplicationsEditor::NewL( iApplicationsAttributes );
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            if( iPhotoCaptureAttributes.iCameraCount > 0 )
+                {
+                //dlg = CLoadGenPhotoCaptureEditor::NewL( iPhotoCaptureAttributes );
+                }
+            else
+                {
+                _LIT(message, "Cameras not available");
+				iEngineWrapper->ShowNote(message); 
+                //CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
+                //errorNote->ExecuteLD(message);
+				return;
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            if( iBluetoothAttributes.iBluetoothSupported )
+                {
+                //dlg = CLoadGenBluetoothEditor::NewL(iBluetoothAttributes);                
+                }
+            else
+                {
+                _LIT(message, "Bluetooth device not available");
+				iEngineWrapper->ShowNote(message); 
+                //CAknErrorNote* errorNote = new(ELeave) CAknErrorNote;
+                //errorNote->ExecuteLD(message);
+                return;
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            //dlg = CLoadGenPointerEventEditor::NewL(iPointerEventAttributes);
+            break;
+            } 
+
+        default:
+            {
+            User::Panic(_L("Wrong new load"), 111);
+            break;
+            }
+        }
+	*/
+	iEditExistingLoad = EFalse;
+    iEngineWrapper->OpenLoadSettings(aCommand, EFalse); // = dlg->RunQueryLD();
+
+    // set back title
+    
+	//if (iMainContainer) 
+    //    iMainContainer->SetDefaultTitlePaneTextL();
+
+    // start creating new load if dialog accepted
+    //if (dlgResult)
+    //    {
+    //    DoStartNewLoadL(aCommand);
+    //    }
+	// DoStartNewLoadL() called from engine wrapper slot function newLoadAdded() after
+	// load settings closed by user select: ok.
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::EditLoadL(TInt aIndex)
+    {
+	CLoadBase* aItem = iLoadItemList->At(aIndex);
+	iCurrentItemIndex = aIndex;
+	iEditExistingLoad = ETrue;
+    // suspend current
+	if (aItem->State() == CLoadBase::ELoadStateRunning)
+		{
+		iLoadStatusBeforeEdit = CLoadBase::ELoadStateRunning;
+		aItem->Suspend();
+		}
+    
+    // show new load query
+
+	/* CLoadGenLoadTypeEditorBase* dlg = NULL;
+	
+
+    switch ( aItem->Type() )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            //dlg = CLoadGenCPULoadEditor::NewL(static_cast<CCPULoad*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            //dlg = CLoadGenMemoryEatEditor::NewL(static_cast<CMemoryEat*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            //dlg = CLoadGenPhoneCallEditor::NewL(static_cast<CPhoneCall*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            //dlg = CLoadGenNetConnEditor::NewL(static_cast<CNetConn*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            //dlg = CLoadGenKeyPressEditor::NewL(static_cast<CKeyPress*>(aItem)->Attributes(), ETrue);
+            break;
+            }       
+        case ELoadGenCmdNewLoadMessages:
+            {
+            //dlg = CLoadGenMessagesEditor::NewL(static_cast<CMessages*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            //dlg = CLoadGenApplicationsEditor::NewL( static_cast<CAppLauncher*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            //dlg = CLoadGenPhotoCaptureEditor::NewL( static_cast<CPhotoCapture*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            //dlg = CLoadGenBluetoothEditor::NewL( static_cast<CBluetooth*>(aItem)->Attributes(), ETrue );
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            //dlg = CLoadGenPointerEventEditor::NewL(static_cast<CPointerEvent*>(aItem)->Attributes(), ETrue);
+            break;
+            }
+        default:
+            {
+            User::Panic(_L("Wrong edit load"), 114);
+            break;
+            }
+        }
+		*/
+	iEngineWrapper->OpenLoadSettings(aItem->Type(), iEditExistingLoad);
+    // ExistingLoadEditedL method called from engine wrapper when load settings view close signal received.
+    
+	//TBool dlgResult = ETrue; //dlg->RunQueryLD();
+
+    // set back title
+	// TODO: check this.
+    //if (iMainContainer)
+    //    iMainContainer->SetDefaultTitlePaneTextL();
+    
+    // change priority of the load item
+    //aItem->SetPriority();
+
+    // resume execution the item
+    //aItem->Resume();
+    
+    //if (dlgResult)
+    //    RefreshViewL(EFalse);
+    }
+
+// --------------------------------------------------------------------------------------------    
+	
+void CEngine::ExistingLoadEditedL()
+	{
+	CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+	// change priority of the load item
+    aItem->SetPriority();
+	if (iLoadStatusBeforeEdit == CLoadBase::ELoadStateRunning)
+		{
+		// resume execution the item
+		aItem->Resume();
+		RefreshViewL(EFalse);
+		}
+	// cancel:
+	
+	}
+	
+// --------------------------------------------------------------------------------------------    
+	
+void CEngine::ExistingLoadEditCancelled()
+	{
+	if (iLoadStatusBeforeEdit == CLoadBase::ELoadStateRunning)
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		// resume execution due to suspend action before edit started:
+		aItem->Resume();
+		}	
+	RefreshViewL(EFalse);
+	}
+	
+// --------------------------------------------------------------------------------------------
+
+void CEngine::DoStartNewLoadL(TInt aCommand)
+    {
+    CLoadBase* item = NULL;
+    
+    switch ( aCommand )
+        {
+        case ELoadGenCmdNewLoadCPULoad:
+            {
+            if( iCpuLoadAttributes.iCpu == KCPUSelection_AllCPUs )
+                {
+                // Call this function recursively for all CPUs:
+                for( TUint i = 0; i < iCpuLoadAttributes.iCpuCount; ++i )
+                    {                    
+                    iCpuLoadAttributes.iCpu = i;
+                    DoStartNewLoadL(aCommand);
+                    }
+                // And finally set user selection back to "All CPUs"
+                iCpuLoadAttributes.iCpu = KCPUSelection_AllCPUs;
+                return;
+                }
+            else
+                {
+                item = CCPULoad::NewL(iCpuLoadAttributes, iReferenceNumber);
+                }
+            break;
+            }
+        case ELoadGenCmdNewLoadEatMemory:
+            {
+            item = CMemoryEat::NewL(iMemoryEatAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadPhoneCall:
+            {
+            item = CPhoneCall::NewL(iPhoneCallAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadNetConn:
+            {
+            item = CNetConn::NewL(iNetConnAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadKeyPress:
+            {
+            item = CKeyPress::NewL(iKeyPressAttributes, iReferenceNumber);
+            break;
+            }        
+        case ELoadGenCmdNewLoadMessages:
+            {
+            item = CMessages::NewL( iMessageAttributes, iReferenceNumber );
+            break;
+            }
+        case ELoadGenCmdNewLoadApplications:
+            {
+            iApplicationsAttributes.iAppsArray = ListOfAllAppsL();
+            item = CAppLauncher::NewL( iApplicationsAttributes, iReferenceNumber );            
+            break;
+            }
+        case ELoadGenCmdNewLoadPhotoCaptures:
+            {
+            item = CPhotoCapture::NewL( iPhotoCaptureAttributes, iReferenceNumber);
+            break;
+            }
+        case ELoadGenCmdNewLoadBluetooth:
+            {
+            item = CBluetooth::NewL( iBluetoothAttributes, iReferenceNumber);            
+            break;
+            }
+        case ELoadGenCmdNewLoadPointerEvent:
+            {
+            item = CPointerEvent::NewL(iPointerEventAttributes, iReferenceNumber);
+            break;
+            }
+            
+        default:
+            {
+            User::Panic(_L("Wrong new load"), 112);
+            break;
+            }
+        }
+    
+    iReferenceNumber++;
+
+    // add item to the array
+    AppendToLoadItemListL(item);
+
+    // update the listbox
+    RefreshViewL(EFalse);
+
+    // set item index to the end
+	// Check this feature to be done in Orbit UI.
+    // iMainContainer->ListBox()->SetCurrentItemIndexAndDraw( iMainContainer->ListBox()->Model()->NumberOfItems()-1 );
+
+    // start the load
+    item->Resume();
+        
+    // refresh again
+    RefreshViewL(EFalse);    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+
+void CEngine::StopAllLoadItemsL()
+    {
+    DeleteAllLoadItems();
+    
+    RefreshViewL();
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CEngine::SuspendAllLoadItemsL()
+    {
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {
+            iLoadItemList->At(i)->Suspend();
+            }
+        }
+        
+    RefreshViewL();    
+    }
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ResumeAllLoadItemsL()
+    {
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {
+            iLoadItemList->At(i)->Resume();
+            }
+        }
+
+    RefreshViewL();    
+    }    
+    
+// --------------------------------------------------------------------------------------------
+
+void CEngine::RefreshViewL(TBool aClearSelection)
+    {
+	// clear selections if any
+	iEngineWrapper->ClearSelection();
+	if (aClearSelection) 
+		{
+		iEngineWrapper->SetCurrentItemIndex(KZeroIndex);
+		}
+	iEngineWrapper->ReFreshView(GenerateListBoxItemTextArrayL());
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CDesCArray* CEngine::GenerateListBoxItemTextArrayL()
+    {
+    CDesCArray* textArray = new(ELeave) CDesCArrayFlat(64);
+    CleanupStack::PushL(textArray);
+
+    _LIT(KEntryTemplateRedIcon,   "1\t%S\t\t");
+    _LIT(KEntryTemplateGreenIcon, "2\t%S\t\t");
+    TInt cnt = LoadItemCount();
+    for (TInt i=0; i< cnt; i++)
+        {
+        // add description from each entry
+        TBuf<256> textEntry;
+        TBuf<256> description = iLoadItemList->At(i)->Description();
+        
+        if (iLoadItemList->At(i)->State() == CLoadBase::ELoadStateRunning)
+            textEntry.Format(KEntryTemplateGreenIcon, &description);
+        else
+            textEntry.Format(KEntryTemplateRedIcon, &description);
+        
+        textArray->AppendL(textEntry);
+        }    
+    
+    CleanupStack::Pop(); //textArray
+    return textArray;
+    }
+	
+// --------------------------------------------------------------------------------------------
+
+void CEngine::AppendToLoadItemListL(CLoadBase* aItem)
+    {
+    if (iLoadItemList)
+        iLoadItemList->AppendL( aItem );
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::DeleteFromLoadItemListL(TInt aIndex)
+    {
+    if (iLoadItemList)
+        {
+        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
+            {
+            // first call delete on the item
+            if (iLoadItemList->At(aIndex))
+                {                                
+                delete iLoadItemList->At(aIndex);
+                iLoadItemList->At(aIndex) = NULL;
+                }
+            
+            // and them remove the array entry
+            iLoadItemList->Delete(aIndex);
+            iLoadItemList->Compress();
+            }
+        else
+            User::Leave(KErrNotFound);
+        }
+    else
+        User::Leave(KErrNotReady);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::SuspendOrResumeFromLoadItemListL(TInt aIndex)
+    {
+    if (iLoadItemList)
+        {
+        if (iLoadItemList->Count() > aIndex && aIndex >= 0)
+            {
+            if (iLoadItemList->At(aIndex))
+                {
+                if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateRunning)
+                    {
+                    iLoadItemList->At(aIndex)->Suspend();
+                    }
+                else if (iLoadItemList->At(aIndex)->State() == CLoadBase::ELoadStateSuspended)
+                    {
+                    iLoadItemList->At(aIndex)->Resume();
+                    }
+                }
+            }
+        else
+            User::Leave(KErrNotFound);
+        }
+    else
+        User::Leave(KErrNotReady);
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+TInt CEngine::LoadItemCount() const
+    {
+    TInt count(0);
+    
+    if (iLoadItemList)
+        count = iLoadItemList->Count();
+    
+    return count;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CEngine::DeleteAllLoadItems()
+    {
+    // call delete for each entry and free memory allocated for the array
+    for (TInt i=0; i<LoadItemCount(); i++)
+        {
+        if ( iLoadItemList->At(i) )
+            {            
+            delete iLoadItemList->At(i);
+            iLoadItemList->At(i) = NULL;
+            }
+        }
+        
+    iLoadItemList->Reset();    
+    }  
+          
+// --------------------------------------------------------------------------------------------
+
+void CEngine::StopSelectedOrHighlightedItemsL(const CArrayFix<TInt>* aSelectionIndexes)
+    {
+    TInt err(KErrNone);
+
+    // by default use selected items
+    if (aSelectionIndexes && aSelectionIndexes->Count() > 0)
+        {
+        TInt deleteIndexCounter(0);
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+        
+        TInt loadCount = LoadItemCount();
+
+        for (TInt i=0; i<loadCount; i++)
+            {
+            ref = i;
+
+            if (aSelectionIndexes->Find(ref, key, index) == 0)  
+                {
+                TRAP(err, DeleteFromLoadItemListL(i-deleteIndexCounter));
+                deleteIndexCounter++; // amount of indexes decreases after each delete
+                }
+            }
+            
+            RefreshViewL();
+            User::LeaveIfError(err);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::SuspendOrResumeSelectedOrHighlightedItemsL()
+    {
+    const CArrayFix<TInt>* selectionIndexes = iEngineWrapper->QueryListSelectedIndexesOrCurrentItemL(); //iMainContainer->ListBoxSelectionIndexes();
+
+    // by default use selected items
+    if (selectionIndexes && selectionIndexes->Count() > 0)
+        {
+        TInt ref(0);
+        TKeyArrayFix key(0, ECmpTUint16);
+        TInt index(0);
+
+        for (TInt i=0; i<LoadItemCount(); i++)
+            {
+            ref = i;
+
+            if (selectionIndexes->Find(ref, key, index) == 0)  
+                {
+                SuspendOrResumeFromLoadItemListL(i);
+                }
+            }
+        
+        RefreshViewL(EFalse);
+        }  
+    }                                
+// --------------------------------------------------------------------------------------------
+
+void CEngine::LoadSettingsL()
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::SaveSettingsL()
+    {
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+TInt CEngine::LaunchSettingsDialogL()
+    {
+    return 0;
+    }
+    
+// --------------------------------------------------------------------------------------------
+CDesCArray* CEngine::ListOfAllAppsL()
+    {
+    const TInt KMaxAppsArraySize=250;
+    RApaLsSession ls;
+    CleanupClosePushL(ls);
+
+    User::LeaveIfError( ls.Connect() );
+    CDesCArray* allAppsArray = new(ELeave) CDesCArrayFlat( KMaxAppsArraySize );
+    CleanupStack::PushL( allAppsArray );
+    // reset the apps list
+    allAppsArray->Reset();
+
+    // search all apps
+    TApaAppInfo appInfo;
+    User::LeaveIfError(ls.GetAllApps());
+
+
+    while ( ls.GetNextApp( appInfo ) == KErrNone )
+        {
+        allAppsArray->AppendL( appInfo.iFullName );      
+        }
+    CleanupStack::Pop( allAppsArray );
+    CleanupStack::PopAndDestroy( &ls );
+   
+
+    // remove loadgen.* from the list
+    for ( TInt i = 0; i < allAppsArray->MdcaCount(); i++ )
+        {
+        if ( allAppsArray->MdcaPoint(i).FindF( _L("\\loadgen.") ) != KErrNotFound )
+            {
+            allAppsArray->Delete(i);
+            allAppsArray->Compress();
+            break;
+            }
+        }
+
+    // sort the elements
+    allAppsArray->Sort();
+
+    return allAppsArray; // ownership transferred
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::LaunchPerfMonL()
+	{
+	// launch Performance Monitor
+	const TUid KUidPerfMon = { 0x20011385 };
+	
+	RWsSession ws;
+	User::LeaveIfError( ws.Connect() );
+	CleanupClosePushL(ws);
+	
+	RApaLsSession ls;
+	User::LeaveIfError( ls.Connect() );
+	CleanupClosePushL(ls);
+	
+	
+	// try to find the task of PerfMon
+	TApaTaskList tasklist(ws);
+	TApaTask task = tasklist.FindApp(KUidPerfMon);
+
+	if (task.Exists())
+		{
+		// task exists, bring it to foreground
+		task.BringToForeground();
+		}
+	else
+		{
+		TApaAppInfo appInfo;
+		User::LeaveIfError(ls.GetAppInfo(appInfo, KUidPerfMon));
+		
+		CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+		cmdLine->SetExecutableNameL(appInfo.iFullName);
+		cmdLine->SetCommandL(EApaCommandBackground);
+
+		// start the app
+		User::LeaveIfError(ls.StartApp(*cmdLine));
+		
+		CleanupStack::PopAndDestroy(); //cmdLine                
+		}
+	
+	CleanupStack::PopAndDestroy(2); //ws,ls
+	}
+
+// --------------------------------------------------------------------------------------------
+	
+TCPULoadAttributes CEngine::GetCPULoadAttributes()
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		return iCpuLoadAttributes;
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CCPULoad*>(aItem)->Attributes());
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ChangeCPULoadAttributes(TCPULoadAttributes aAttributes) 
+	{ 
+	if (iEditExistingLoad == EFalse) 
+		{
+		iCpuLoadAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CCPULoad*>(aItem)->SetAttributes(aAttributes);
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+
+TMemoryEatAttributes CEngine::GetMemoryEatAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iMemoryEatAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CMemoryEat*>(aItem)->Attributes());
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CEngine::ChangeMemoryEatAttributes(TMemoryEatAttributes aAttributes) 
+	{ 
+	if (iEditExistingLoad == EFalse) 
+		{
+		iMemoryEatAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CMemoryEat*>(aItem)->SetAttributes(aAttributes);
+		}
+	}	
+	
+// --------------------------------------------------------------------------------------------
+
+TPhoneCallAttributes CEngine::GetPhoneCallAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iPhoneCallAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CPhoneCall*>(aItem)->Attributes());
+		}
+	}
+
+// --------------------------------------------------------------------------------------------	
+
+void CEngine::ChangePhoneCallAttributes(TPhoneCallAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iPhoneCallAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CPhoneCall*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}
+	
+// --------------------------------------------------------------------------------------------	
+
+TNetConnAttributes CEngine::GetNetConnAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iNetConnAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CNetConn*>(aItem)->Attributes());
+		}
+	}
+
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangeNetConnAttributes(TNetConnAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iNetConnAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CNetConn*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}
+	
+// --------------------------------------------------------------------------------------------	
+
+TKeyPressAttributes CEngine::GetKeyPressAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iKeyPressAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CKeyPress*>(aItem)->Attributes());
+		}
+	}	
+
+	
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangeKeyPressAttributes(TKeyPressAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iKeyPressAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CKeyPress*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}	
+	
+// --------------------------------------------------------------------------------------------	
+
+TMessageAttributes CEngine::GetMessageAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iMessageAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CMessages*>(aItem)->Attributes());
+		}
+	}	
+	
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangeMessageAttributes(TMessageAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iMessageAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CMessages*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}
+
+// --------------------------------------------------------------------------------------------	
+
+TApplicationsAttributes CEngine::GetApplicationsAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iApplicationsAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CAppLauncher*>(aItem)->Attributes());
+		}
+	}	
+
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangeApplicationsAttributes(TApplicationsAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iApplicationsAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CAppLauncher*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}
+	
+// --------------------------------------------------------------------------------------------	
+
+TPhotoCaptureAttributes CEngine::GetPhotoCaptureAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iPhotoCaptureAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CPhotoCapture*>(aItem)->Attributes());
+		}
+	}	
+
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangePhotoCaptureAttributes(TPhotoCaptureAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iPhotoCaptureAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CPhotoCapture*>(aItem)->SetAttributes(aAttributes);
+		}	
+	}	
+	
+// --------------------------------------------------------------------------------------------	
+	
+TBluetoothAttributes CEngine::GetBluetoothAttributes()
+	{ 
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iBluetoothAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CBluetooth*>(aItem)->Attributes());
+		}
+	}		
+
+	
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangeBluetoothAttributes(TBluetoothAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iBluetoothAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CBluetooth*>(aItem)->SetAttributes(aAttributes);
+		}	
+	} 	
+	
+// --------------------------------------------------------------------------------------------	
+	
+TPointerEventAttributes CEngine::GetPointerEventAttributes()
+	{
+	if (iEditExistingLoad == EFalse)
+		{	
+		return iPointerEventAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		return (static_cast<CPointerEvent*>(aItem)->Attributes());
+		}
+	}
+
+// --------------------------------------------------------------------------------------------		
+	
+void CEngine::ChangePointerEventAttributes(TPointerEventAttributes aAttributes)
+	{
+	if (iEditExistingLoad == EFalse) 
+		{
+		iPointerEventAttributes = aAttributes; 
+		}
+	else 
+		{
+		CLoadBase* aItem = iLoadItemList->At(iCurrentItemIndex);
+		static_cast<CPointerEvent*>(aItem)->SetAttributes(aAttributes);
+		}	
+	} 
+	
+// --------------------------------------------------------------------------------------------
+	
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,737 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <hbmainwindow.h>
+//#include <hbcommonnote.h>
+#include <hbpopup.h>
+
+#include <QString>
+ #include <QStringList>
+ 
+#include <e32std.h>
+#include <e32base.h>
+
+#include "notifications.h"
+#include "enginewrapper.h"
+#include "settingsview.h"
+#include "engine.h"
+#include "mainview.h"
+
+QStringList LOADTYPES = (QStringList() << "CPU load" << "Memory eat" << "Phone calls" << "Messages" 
+									   << "Network conn." << "Key presses" << "Applications" << "Photo captures" 
+									   << "Bluetooth actions" << "Pointer events");
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::EngineWrapper(HbMainWindow &mainWindow, MainView &mainView)
+: mEngine(0), 
+  mMainView(mainView),
+  mMainWindow(mainWindow),
+  mEditExistingLoad(false)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+EngineWrapper::~EngineWrapper()
+{
+    if (mEngine != 0) {
+		TRAP_IGNORE(mEngine->DeActivateEngineL());
+        delete mEngine;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+bool EngineWrapper::init()
+{
+	TInt err = KErrNone;
+    TRAP(err, mEngine = CEngine::NewL(this));
+    if(err != KErrNone) {
+        return false;
+    }
+    else {
+		TRAP(err, mEngine->ActivateEngineL());
+		if (err != KErrNone) {
+			return false;
+		}
+		else {
+			return true;
+		}
+    }
+}
+
+// ---------------------------------------------------------------------------	
+
+bool EngineWrapper::startNewLoad(int commandId)
+{
+	TRAPD(err, mEngine->StartNewLoadL(commandId));
+
+	// error handling
+    if(err != KErrNone) {
+        return false;
+    }
+    else {
+        return true;
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::launchPerfMonApp()
+{
+	TRAPD(err, mEngine->LaunchPerfMonL());
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Perf Mon launch failed.");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::loadAddedOrEdited(TLoadGenCommandIds cmdId)
+{
+	if (mEditExistingLoad == false) {
+		TRAP_IGNORE(mEngine->DoStartNewLoadL(cmdId));
+	}
+	else {
+		TRAP_IGNORE(mEngine->ExistingLoadEditedL());
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::loadSettingsCanclled()
+{
+	if (mEditExistingLoad == true) {
+		TRAP_IGNORE(mEngine->ExistingLoadEditCancelled());
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::loadEdit(int rowIndex)
+{
+	TRAPD(err, mEngine->EditLoadL(rowIndex));
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Load edit failed.");
+    }
+}
+
+void EngineWrapper::StopLoadYesNoDialogClosed(HbAction *action)
+{
+    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+    if(action == dlg->primaryAction()){
+        const CArrayFix<TInt>* selectionIndexes = NULL;
+        try{
+            QT_TRAP_THROWING( selectionIndexes = QueryListSelectedIndexesOrCurrentItemL() );
+            if(selectionIndexes)
+                QT_TRAP_THROWING( mEngine->StopSelectedOrHighlightedItemsL(selectionIndexes) );
+        }
+        catch(...){
+            Notifications::error("Stop load failed.");
+        }
+        if(selectionIndexes)
+            delete selectionIndexes;
+    }
+}
+
+// ---------------------------------------------------------------------------
+bool EngineWrapper::stopLoad(bool stopAll)
+{
+	TInt err = KErrNone;
+	if (stopAll == true) {
+		TRAP(err, mEngine->StopAllLoadItemsL());
+		// error handling
+        if(err != KErrNone) {
+            return false;
+        }
+        else {
+            return true;
+        }   
+	}
+	else {
+        // by default use selected items
+        QList<int> listIndices = mMainView.listSelectionIndexes();
+        if (listIndices.count() > 0)
+            {
+            QString message = QString("Stop %1 selections?").arg( listIndices.count() );
+            HbMessageBox::question(message, this, SLOT(StopLoadYesNoDialogClosed(HbAction *)));
+            }
+        else{
+             TInt currentItemIndex = mMainView.currentItemIndex();
+             if (mEngine->LoadItemCount() > currentItemIndex && currentItemIndex >= 0)
+                 {
+                 QString message("Stop highlighted selections?");
+                 HbMessageBox::question(message, this, SLOT(StopLoadYesNoDialogClosed(HbAction *)));
+                 }
+            }
+        return true;
+	}
+	
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::resumeAllLoadItems()
+{
+	TRAPD(err, mEngine->ResumeAllLoadItemsL());
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Error in loads resume.");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::suspendAllLoadItems()
+{
+	TRAPD(err, mEngine->SuspendAllLoadItemsL());
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Error in loads resume.");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::suspendOrResumeSelectedOrHighlightedItems()
+{
+	TRAPD(err, mEngine->SuspendOrResumeSelectedOrHighlightedItemsL());
+	// error handling
+    if(err != KErrNone) {
+        Notifications::error("Error to show item action menu.");
+    }
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowErrorMessage(const TDesC& aErrorMessage)
+{
+    QString errorMessage((QChar*)aErrorMessage.Ptr(),aErrorMessage.Length());
+    Notifications::error(errorMessage);
+ 
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ShowNote(const TDesC& aNoteMessage)
+{
+    QString note((QChar*)aNoteMessage.Ptr(),aNoteMessage.Length());
+    Notifications::showGlobalNote(note, HbMessageBox::MessageTypeInformation, HbPopup::StandardTimeout);
+}
+ 
+// ---------------------------------------------------------------------------
+
+TInt EngineWrapper::QueryCurrentItemIndex()
+{
+	return mMainView.currentItemIndex();
+}
+
+// ---------------------------------------------------------------------------
+
+const CArrayFix<TInt>*  EngineWrapper::QueryListSelectedIndexesOrCurrentItemL()
+{
+	QList<int> listIndices = mMainView.listSelectionIndexes();
+	TInt cnt = listIndices.count();
+    CArrayFix<TInt>* indices = new(ELeave)CArrayFixFlat<TInt>( cnt > 0 ? cnt : 1 );
+    CleanupDeletePushL(indices);
+    if(cnt > 0){
+        for (TInt i = 0; i < cnt; i++) {
+            indices->AppendL(listIndices.at(i));
+        }
+    }
+    else{
+        indices->AppendL(mMainView.currentItemIndex());
+    }
+    CleanupStack::Pop(indices);
+    return static_cast<const CArrayFix<TInt>*>(indices);	
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::OpenLoadSettings(TInt loadType, bool editExistingLoad)
+{
+	SettingsView* settings = new SettingsView((HbView&)ViewReference(), 
+											  WindowReference(), 
+											  *this);
+	mEditExistingLoad = editExistingLoad;
+
+	switch (loadType) {
+		case ELoadGenCmdNewLoadCPULoad: {
+			settings->open(LOADTYPES.at(Cpu), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			settings->open(LOADTYPES.at(EatMemory), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhoneCall: {
+			settings->open(LOADTYPES.at(PhoneCalls), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadNetConn: {
+			settings->open(LOADTYPES.at(NWConnections),
+                           (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadKeyPress: {
+			settings->open(LOADTYPES.at(KeyPresses), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadMessages: {
+			settings->open(LOADTYPES.at(Messages), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadApplications: {
+			settings->open(LOADTYPES.at(Apps), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhotoCaptures: {
+			settings->open(LOADTYPES.at(Photos), 
+			               (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadBluetooth: {
+			settings->open(LOADTYPES.at(BTAct), 
+						   (TLoadGenCommandIds)loadType);
+			break;
+		}
+		case ELoadGenCmdNewLoadPointerEvent: {
+			settings->open(LOADTYPES.at(PointerEvents),
+						   (TLoadGenCommandIds)loadType);
+			break;
+		}
+		default: {
+			User::Panic(_L("Wrong new load"), 111);
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------	
+
+CPULoadAttributes EngineWrapper::getCpuLoadAttributes()
+{
+    TCPULoadAttributes tCpuLoadAttributes = mEngine->GetCPULoadAttributes();
+    CPULoadAttributes attributes;
+	
+	attributes.mId = tCpuLoadAttributes.iId;
+	attributes.mPriority = tCpuLoadAttributes.iPriority;
+	attributes.mMode = tCpuLoadAttributes.iMode;
+	attributes.mType = tCpuLoadAttributes.iType;
+	attributes.mLength = tCpuLoadAttributes.iLength;
+	attributes.mIdle = tCpuLoadAttributes.iIdle;
+	attributes.mRandomVariance = tCpuLoadAttributes.iRandomVariance;
+	attributes.mCpu = tCpuLoadAttributes.iCpu;
+	attributes.mCpuCount = tCpuLoadAttributes.iCpuCount;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setCpuLoadAttributes(CPULoadAttributes attributes)
+{
+    TCPULoadAttributes tCpuLoadAttributes;
+
+	tCpuLoadAttributes.iId = attributes.mId;
+	tCpuLoadAttributes.iPriority = attributes.mPriority;
+	tCpuLoadAttributes.iMode = attributes.mMode;
+	tCpuLoadAttributes.iType = attributes.mType;
+	tCpuLoadAttributes.iLength = attributes.mLength;
+	tCpuLoadAttributes.iIdle = attributes.mIdle;
+	tCpuLoadAttributes.iRandomVariance = attributes.mRandomVariance;
+	tCpuLoadAttributes.iCpu = attributes.mCpu;
+	tCpuLoadAttributes.iCpuCount = attributes.mCpuCount;	
+	
+	mEngine->ChangeCPULoadAttributes(tCpuLoadAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+MemoryEatAttributes EngineWrapper::getMemoryEatAttributes()
+{
+
+    TMemoryEatAttributes tMemoryEatAttributes = mEngine->GetMemoryEatAttributes();
+    MemoryEatAttributes attributes;
+
+    // Convert TMemoryEatAttributes to MemoryEatAttributes 
+    attributes.mId         = tMemoryEatAttributes.iId;
+    attributes.mPriority   = tMemoryEatAttributes.iPriority; 
+	attributes.mSource     = tMemoryEatAttributes.iSource;
+	attributes.mType       = tMemoryEatAttributes.iType;
+	attributes.mBuffer     = tMemoryEatAttributes.iBuffer;
+	attributes.mIdle       = tMemoryEatAttributes.iIdle;
+	attributes.mAmount     = tMemoryEatAttributes.iAmount;
+	attributes.mRandomMin  = tMemoryEatAttributes.iRandomMin;
+	attributes.mRandomMax  = tMemoryEatAttributes.iRandomMax;
+
+    TBuf<64> amount;
+    amount.Copy(tMemoryEatAttributes.iAmountDes);
+    attributes.mAmountDes = QString((QChar*)amount.Ptr(), amount.Length()); 
+
+    TBuf<64> min;
+    min.Copy(tMemoryEatAttributes.iRandomMinDes);
+    attributes.mAmountDes = QString((QChar*)min.Ptr(), min.Length()); 
+
+    TBuf<64> max;
+    max.Copy(tMemoryEatAttributes.iRandomMaxDes);
+    attributes.mAmountDes = QString((QChar*)max.Ptr(), max.Length());
+	
+	attributes.mRandomVariance  = tMemoryEatAttributes.iRandomVariance;
+    return attributes;
+}	
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setMemoryEatAttributes(MemoryEatAttributes attributes)
+{
+	TMemoryEatAttributes tMemoryEatAttributes = mEngine->GetMemoryEatAttributes();//TMemoryEatAttributes tMemoryEatAttributes;
+
+	tMemoryEatAttributes.iId = attributes.mId;
+	tMemoryEatAttributes.iPriority = attributes.mPriority;
+	tMemoryEatAttributes.iSource = attributes.mSource;
+	tMemoryEatAttributes.iType = attributes.mType;
+	tMemoryEatAttributes.iBuffer = attributes.mBuffer;
+	tMemoryEatAttributes.iIdle = attributes.mIdle;
+	tMemoryEatAttributes.iAmount = attributes.mAmount;
+	tMemoryEatAttributes.iRandomMin = attributes.mRandomMin;
+	tMemoryEatAttributes.iRandomMax = attributes.mRandomMax;
+
+    TBuf<64> amount = attributes.mAmountDes.utf16();
+    tMemoryEatAttributes.iAmountDes.Copy(amount);	
+	
+    TBuf<64> min = attributes.mRandomMinDes.utf16();
+    tMemoryEatAttributes.iRandomMinDes.Copy(min);
+      
+    TBuf<64> max = attributes.mRandomMaxDes.utf16();
+    tMemoryEatAttributes.iRandomMaxDes.Copy(max);
+	
+	tMemoryEatAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeMemoryEatAttributes(tMemoryEatAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+PhoneCallAttributes EngineWrapper::getPhoneCallAttributes()
+{
+    TPhoneCallAttributes tPhoneCallAttributes = mEngine->GetPhoneCallAttributes();
+    PhoneCallAttributes attributes;
+	
+	attributes.mId = tPhoneCallAttributes.iId;
+	attributes.mPriority = tPhoneCallAttributes.iPriority;
+
+    TBuf<128> dest;
+    dest.Copy(tPhoneCallAttributes.iDestination);
+    attributes.mDestination = QString((QChar*)dest.Ptr(), dest.Length()); 	
+	
+	attributes.mLength = tPhoneCallAttributes.iLength;
+	attributes.mIdle = tPhoneCallAttributes.iIdle;
+	attributes.mRandomVariance = tPhoneCallAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setPhoneCallAttributes(PhoneCallAttributes attributes)
+{
+	TPhoneCallAttributes tPhoneCallAttributes = mEngine->GetPhoneCallAttributes(); //TPhoneCallAttributes tPhoneCallAttributes;
+
+	tPhoneCallAttributes.iId = attributes.mId;
+	tPhoneCallAttributes.iPriority = attributes.mPriority;
+
+    TBuf<128> dest = attributes.mDestination.utf16();
+    tPhoneCallAttributes.iDestination.Copy(dest);	
+
+	tPhoneCallAttributes.iLength = attributes.mLength;
+	tPhoneCallAttributes.iIdle = attributes.mIdle;
+	tPhoneCallAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangePhoneCallAttributes(tPhoneCallAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+NetConnAttributes EngineWrapper::getNetConnAttributes()
+{
+    TNetConnAttributes tNetConnAttributes = mEngine->GetNetConnAttributes();
+    NetConnAttributes attributes;
+	
+	attributes.mId = tNetConnAttributes.iId;
+	attributes.mPriority = tNetConnAttributes.iPriority;
+
+    TBuf<128> dest;
+    dest.Copy(tNetConnAttributes.iDestination);
+    attributes.mDestination = QString((QChar*)dest.Ptr(), dest.Length()); 	
+
+	attributes.mIdle = tNetConnAttributes.iIdle;
+	attributes.mRandomVariance = tNetConnAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setNetConnAttributes(NetConnAttributes attributes)
+{
+	TNetConnAttributes tNetConnAttributes = mEngine->GetNetConnAttributes(); //TNetConnAttributes tNetConnAttributes;
+
+	tNetConnAttributes.iId = attributes.mId;
+	tNetConnAttributes.iPriority = attributes.mPriority;
+
+    TBuf<128> dest = attributes.mDestination.utf16();
+    tNetConnAttributes.iDestination.Copy(dest);	
+
+	tNetConnAttributes.iIdle = attributes.mIdle;
+	tNetConnAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeNetConnAttributes(tNetConnAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+KeyPressAttributes EngineWrapper::getKeyPressAttributes()
+{
+    TKeyPressAttributes tKeyPressAttributes = mEngine->GetKeyPressAttributes();
+    KeyPressAttributes attributes;
+	
+	attributes.mId = tKeyPressAttributes.iId;
+	attributes.mPriority = tKeyPressAttributes.iPriority;
+	attributes.mHeartBeat = tKeyPressAttributes.iHeartBeat;	
+	attributes.mRandomVariance = tKeyPressAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setKeyPressAttributes(KeyPressAttributes attributes)
+{
+	TKeyPressAttributes tKeyPressAttributes = mEngine->GetKeyPressAttributes(); //TKeyPressAttributes tKeyPressAttributes;
+
+	tKeyPressAttributes.iId = attributes.mId;
+	tKeyPressAttributes.iPriority = attributes.mPriority;
+	tKeyPressAttributes.iHeartBeat = attributes.mHeartBeat;
+	tKeyPressAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeKeyPressAttributes(tKeyPressAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+PointerEventAttributes EngineWrapper::getPointerEventAttributes()
+{
+    TPointerEventAttributes tPointerEventAttributes = mEngine->GetPointerEventAttributes();
+    PointerEventAttributes attributes;
+	
+	attributes.mId = tPointerEventAttributes.iId;
+	attributes.mPriority = tPointerEventAttributes.iPriority;
+	attributes.mHeartBeat = tPointerEventAttributes.iHeartBeat;	
+	attributes.mRandomVariance = tPointerEventAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setPointerEventAttributes(PointerEventAttributes attributes)
+{
+	TPointerEventAttributes tPointerEventAttributes = mEngine->GetPointerEventAttributes();//TPointerEventAttributes tPointerEventAttributes;
+
+	tPointerEventAttributes.iId = attributes.mId;
+	tPointerEventAttributes.iPriority = attributes.mPriority;
+	tPointerEventAttributes.iHeartBeat = attributes.mHeartBeat;
+	tPointerEventAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangePointerEventAttributes(tPointerEventAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+MessageAttributes EngineWrapper::getMessageAttributes()
+{
+    TMessageAttributes tMessageAttributes = mEngine->GetMessageAttributes();
+    MessageAttributes attributes;
+	
+	attributes.mId = tMessageAttributes.iId;
+	attributes.mMessageType = tMessageAttributes.iMessageType;
+
+    TBuf<128> dest;
+    dest.Copy(tMessageAttributes.iDestination);
+    attributes.mDestination = QString((QChar*)dest.Ptr(), dest.Length()); 	
+	
+	attributes.mPriority = tMessageAttributes.iPriority;
+	attributes.mAmount = tMessageAttributes.iAmount;
+	attributes.mLength = tMessageAttributes.iLength;
+	attributes.mIdle = tMessageAttributes.iIdle;
+	attributes.mRandomVariance = tMessageAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setMessageAttributes(MessageAttributes attributes)
+{
+	TMessageAttributes tMessageAttributes = mEngine->GetMessageAttributes();//TMessageAttributes tMessageAttributes;
+
+	tMessageAttributes.iId = attributes.mId;
+	tMessageAttributes.iMessageType = attributes.mMessageType;
+    
+	TBuf<128> dest = attributes.mDestination.utf16();
+    tMessageAttributes.iDestination.Copy(dest);	
+	
+	tMessageAttributes.iPriority = attributes.mPriority;
+	tMessageAttributes.iAmount = attributes.mAmount;
+	tMessageAttributes.iLength = attributes.mLength;
+	tMessageAttributes.iIdle = attributes.mIdle;
+	tMessageAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeMessageAttributes(tMessageAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+ApplicationsAttributes EngineWrapper::getApplicationsAttributes()
+{
+    TApplicationsAttributes tApplicationsAttributes = mEngine->GetApplicationsAttributes();
+    ApplicationsAttributes attributes;
+	
+	attributes.mId = tApplicationsAttributes.iId;
+	attributes.mPriority = tApplicationsAttributes.iPriority;
+	attributes.mLaunchingInterval = tApplicationsAttributes.iLaunchingInterval;
+	attributes.mKeyPressType = tApplicationsAttributes.iKeyPressType;
+	attributes.mMaxOpen = tApplicationsAttributes.iMaxOpen;
+	attributes.mHeartBeat = tApplicationsAttributes.iHeartBeat;
+	attributes.mRandomVariance = tApplicationsAttributes.iRandomVariance;
+
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setApplicationsAttributes(ApplicationsAttributes attributes)
+{
+	TApplicationsAttributes tApplicationsAttributes = mEngine->GetApplicationsAttributes(); //TApplicationsAttributes tApplicationsAttributes;
+
+	tApplicationsAttributes.iId = attributes.mId;
+	tApplicationsAttributes.iPriority = attributes.mPriority;
+	tApplicationsAttributes.iLaunchingInterval = attributes.mLaunchingInterval;
+	tApplicationsAttributes.iKeyPressType = attributes.mKeyPressType;
+	tApplicationsAttributes.iMaxOpen = attributes.mMaxOpen;
+	tApplicationsAttributes.iHeartBeat = attributes.mHeartBeat;	
+	tApplicationsAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeApplicationsAttributes(tApplicationsAttributes);
+}
+
+    QStringList mAppsArray;
+
+// ---------------------------------------------------------------------------	
+
+PhotoCaptureAttributes EngineWrapper::getPhotoCaptureAttributes()
+{
+    TPhotoCaptureAttributes tPhotoCaptureAttributes = mEngine->GetPhotoCaptureAttributes();
+    PhotoCaptureAttributes attributes;
+	
+	attributes.mId = tPhotoCaptureAttributes.iId;
+	attributes.mPriority = tPhotoCaptureAttributes.iPriority;
+	attributes.mCameraCount = tPhotoCaptureAttributes.iCameraCount;	
+	attributes.mCamera = tPhotoCaptureAttributes.iCamera;
+	attributes.mIdle = tPhotoCaptureAttributes.iIdle;
+	attributes.mRandomVariance = tPhotoCaptureAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setPhotoCaptureAttributes(PhotoCaptureAttributes attributes)
+{
+	TPhotoCaptureAttributes tPhotoCaptureAttributes;
+
+	tPhotoCaptureAttributes.iId = attributes.mId;
+	tPhotoCaptureAttributes.iPriority = attributes.mPriority;
+	tPhotoCaptureAttributes.iCameraCount = attributes.mCameraCount;	
+	tPhotoCaptureAttributes.iCamera = attributes.mCamera;
+	tPhotoCaptureAttributes.iIdle = attributes.mIdle;
+	tPhotoCaptureAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangePhotoCaptureAttributes(tPhotoCaptureAttributes);
+}
+
+// ---------------------------------------------------------------------------	
+
+BluetoothAttributes EngineWrapper::getBluetoothAttributes()
+{
+    TBluetoothAttributes tBluetoothAttributes = mEngine->GetBluetoothAttributes();
+    BluetoothAttributes attributes;
+	
+	attributes.mId = tBluetoothAttributes.iId;
+	attributes.mPriority = tBluetoothAttributes.iPriority;
+	attributes.mIdle = tBluetoothAttributes.iIdle;
+	attributes.mRandomVariance = tBluetoothAttributes.iRandomVariance;
+	return attributes;
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::setBluetoothAttributes(BluetoothAttributes attributes)
+{
+    TBluetoothAttributes tBluetoothAttributes;
+
+	tBluetoothAttributes.iId = attributes.mId;
+	tBluetoothAttributes.iPriority = attributes.mPriority;
+	tBluetoothAttributes.iIdle = attributes.mIdle;
+	tBluetoothAttributes.iRandomVariance = attributes.mRandomVariance;
+	
+	mEngine->ChangeBluetoothAttributes(tBluetoothAttributes);
+}
+
+// ---------------------------------------------------------------------------
+
+void EngineWrapper::ReFreshView(CDesCArray* aTextArray) 
+{
+	QStringList itemList;
+	TInt arrayCnt = aTextArray->Count();
+	for (int i = 0; i < arrayCnt; i++) {
+		itemList.append(QString::fromUtf16(
+				  aTextArray->MdcaPoint(i).Ptr(),
+				  aTextArray->MdcaPoint(i).Length()));
+	}
+	mMainView.setLoadListData(itemList);
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::ClearSelection()
+{
+	mMainView.clearListSelection();
+}
+
+// ---------------------------------------------------------------------------	
+
+void EngineWrapper::SetCurrentItemIndex(TInt aIndex) 
+{
+	mMainView.setCurrentItemIndex(aIndex); 
+}
+
+// ---------------------------------------------------------------------------	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+
+#include "mainview.h"
+
+
+int main(int argc, char *argv[])
+{
+	HbApplication app(argc, argv);
+    HbMainWindow mainWindow;
+    
+    //Create main view
+    MainView* view = new MainView(mainWindow);
+
+    //initialize main view
+    view->init(app);
+	// Add Views to main window and reveal it.
+    mainWindow.addView(view);
+    mainWindow.show();
+
+    return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,398 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "mainview.h"
+#include "enginewrapper.h"
+#include "notifications.h"
+#include "loadgen.hrh"
+#include <hblabel.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+//#include <hbcommonnote.h>
+//#include <hbconfirmationquery.h>
+#include <hbprogressdialog.h>
+#include <hbtextedit.h>
+#include <hblistview.h>
+#include <hbselectiondialog.h>
+
+#include <QGraphicsLinearLayout>
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <QSignalMapper>
+
+// ---------------------------------------------------------------------------
+
+MainView::MainView(HbMainWindow &mainWindow) :
+					  mMainWindow(mainWindow),
+					  mEngineWrapper(0),
+					  mIsLoadListEmpty(true),
+					  mStopAll(NULL),
+					  mSuspendAll(NULL),
+					  mResumeAll(NULL)
+					  
+{
+}
+
+// ---------------------------------------------------------------------------
+
+MainView::~MainView()
+{
+    if (mEngineWrapper != 0) {
+        delete mEngineWrapper;
+    }
+    delete mListModel;    
+    delete mListView;
+	delete mSm;	
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::init(HbApplication &app)
+{
+	this->setTitle("Load Gener.");
+    mEngineWrapper = new EngineWrapper(mMainWindow, *this);
+    int error = mEngineWrapper->init();
+    Q_ASSERT_X(error == 1, "LoadGen", "Engine initialization failed");
+    createMenu(app);
+	loadListIinit();
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::createMenu(HbApplication &app)
+{
+    HbMenu *menu = this->menu();
+	
+    // signal mapper for identifying the different command actions  
+	// in executeCommand() handler function:
+    mSm = new QSignalMapper(this);
+    connect(mSm, SIGNAL(mapped(int)), this, SLOT(executeMenuCommand(int)));
+
+    if (menu != NULL) {
+		// Temp work-around for menu item bug in Orbit Wk38,
+		// sub menu cannot contain more than 6 functional action items!
+		// two sub menus created to fix this problem.
+		mLoadSubMenu1 = menu->addMenu("New loads");
+		mLoadSubMenu2 = menu->addMenu("More new loads");
+		mCpuLoadAction = mLoadSubMenu1->addAction("CPU load");
+		connect(mCpuLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mCpuLoadAction, ELoadGenCmdNewLoadCPULoad);
+
+		mMemoryEatLoadAction = mLoadSubMenu1->addAction("Eat memory");
+		connect(mMemoryEatLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mMemoryEatLoadAction, ELoadGenCmdNewLoadEatMemory);
+
+		mPhoneCallLoadAction = mLoadSubMenu1->addAction("Phone calls");
+		connect(mPhoneCallLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mPhoneCallLoadAction, ELoadGenCmdNewLoadPhoneCall);
+
+		mMessagesLoadAction = mLoadSubMenu1->addAction("Messages");
+		connect(mMessagesLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mMessagesLoadAction, ELoadGenCmdNewLoadMessages);
+
+		mNetConnLoadAction = mLoadSubMenu1->addAction("Network conn.");
+		connect(mNetConnLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mNetConnLoadAction, ELoadGenCmdNewLoadNetConn);
+	
+		mKeyPressLoadAction = mLoadSubMenu2->addAction("Key presses");
+		connect(mKeyPressLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mKeyPressLoadAction, ELoadGenCmdNewLoadKeyPress);
+
+		mAppsLoadAction = mLoadSubMenu2->addAction("Applications");
+		connect(mAppsLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mAppsLoadAction, ELoadGenCmdNewLoadApplications);
+		
+		mPhotoCapturesLoadAction = mLoadSubMenu2->addAction("Photo captures");
+		connect(mPhotoCapturesLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mPhotoCapturesLoadAction, ELoadGenCmdNewLoadPhotoCaptures);
+
+		mBtActionsLoadAction = mLoadSubMenu2->addAction("Bluetooth actions");
+		connect(mBtActionsLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mBtActionsLoadAction, ELoadGenCmdNewLoadBluetooth);
+
+		mPointerEventsLoadAction = mLoadSubMenu2->addAction("Pointer events");
+		connect(mPointerEventsLoadAction, SIGNAL( triggered() ), mSm, SLOT(map()));
+		mSm->setMapping(mPointerEventsLoadAction, ELoadGenCmdNewLoadPointerEvent);
+		
+		mActionPerfMon = menu->addAction("Launch PerfMon");
+		connect(mActionPerfMon, SIGNAL(triggered()), this, SLOT( launchPerfMon()));
+		
+		mActionAbout = menu->addAction("About");
+		connect(mActionAbout, SIGNAL(triggered()), this, SLOT( showAboutPopup()));
+
+		mActionExit = menu->addAction("Exit");
+		connect(mActionExit, SIGNAL(triggered()), &app, SLOT(quit()));
+
+		// menu dynamic update
+		connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));        		
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::loadListIinit()
+{
+    // Create list view and model for it
+    mListView = new HbListView(this);
+	mListModel = new QStandardItemModel(this);
+	mListView->setModel(mListModel); 
+	mListView->setSelectionMode(HbListView::NoSelection);
+	mListView->setVisible( false ); //HighlightMode(HbItemHighlight::Hidden);
+
+	QStandardItem *item = new QStandardItem(QString("No loads activated. (Select new load from menu to generate new load)"));
+    mListModel->setItem(0, item);
+
+    connect(mListView, 
+			SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), 
+			this, 
+			SLOT(handleLoadListEvent(HbAbstractViewItem*, QPointF)));	
+
+	
+    // Create layout and add list view there:
+    QGraphicsLinearLayout *mainlayout = new QGraphicsLinearLayout(Qt::Vertical, this);
+    mainlayout->addItem(mListView);
+	mainlayout->setAlignment(mListView, Qt::AlignCenter);
+    setLayout(mainlayout);
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::showAboutPopup()
+{
+    Notifications::about();
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::executeMenuCommand(int cmd)
+{
+	mEngineWrapper->startNewLoad(cmd);
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::handleLoadListEvent(HbAbstractViewItem */*listViewItem*/, const QPointF &/*coords*/)
+{
+    const QStringList items = (QStringList() << "Stop" << "Resume/Suspend" << "Edit");
+    HbSelectionDialog *dlg = new HbSelectionDialog();
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->setStringItems(items);
+    dlg->setSelectionMode(HbAbstractItemView::SingleSelection);
+    dlg->open(this, SLOT(ItemActionPopupClosed(HbAction*)));
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::ItemActionPopupClosed(HbAction* action)
+{
+    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
+    if(!action && dlg->selectedItems().count()){
+        int userSelectionIndex = dlg->selectedItems().at(0).toInt();   
+        // all operations for selected list item only. Query selected load list item index from model.
+        if (userSelectionIndex == 0) {
+            // stop selected load from the load list:
+            stopLoad(false);
+        }
+        else if (userSelectionIndex == 1) {
+            // Suspend or Resume
+            mEngineWrapper->suspendOrResumeSelectedOrHighlightedItems();
+        }
+        else {
+            // current selected row number from the load list. 
+            int selectedRow = mListView->selectionModel()->currentIndex().row();
+            // edit load setttings:
+            mEngineWrapper->loadEdit(selectedRow);
+        }
+    }
+}
+
+// --------------------------------------------------------------------------
+
+void MainView::stopAllLoads()
+{
+	stopLoad(true);
+}
+
+// ---------------------------------------------------------------------------
+
+bool MainView::stopLoad(bool stopAll)
+{
+	int success = false;
+	if (mListView != NULL) {
+		if (stopAll == true) {
+			success = mEngineWrapper->stopLoad(stopAll);
+			mIsLoadListEmpty = true;
+		}
+		else {
+			success = mEngineWrapper->stopLoad(stopAll);
+		}
+	}
+	return success;
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::updateMenu()
+{
+	if (mIsLoadListEmpty != true) {
+		if (mStopAll == NULL) {
+			mStopAll = new HbAction("Stop all", menu());
+			connect(mStopAll, SIGNAL(triggered()), this, SLOT(stopAllLoads()));
+			menu()->insertAction(mActionAbout, mStopAll);
+		}
+		else{
+            mStopAll->setVisible(true);
+		}
+		if (mSuspendAll == NULL) {
+			mSuspendAll = new HbAction("Suspend all", menu());
+			connect(mSuspendAll, SIGNAL(triggered()), this, SLOT(suspendAllLoads()));
+			menu()->insertAction(mActionAbout, mSuspendAll);
+		}
+		else{
+            mSuspendAll->setVisible(true);
+        }
+		if (mResumeAll == NULL) {
+			mResumeAll = new HbAction("Resume all", menu());
+			connect(mResumeAll, SIGNAL(triggered()), this, SLOT(resumeAllLoads()));
+			menu()->insertAction(mActionAbout, mResumeAll);
+		}
+		else{
+            mResumeAll->setVisible(true);
+        }
+	}
+	else if (mIsLoadListEmpty == true) {
+		if (mStopAll != NULL && mStopAll->text() == "Stop all") {
+            mStopAll->setVisible(false);
+		}
+		if (mSuspendAll != NULL && mSuspendAll->text() == "Suspend all") {
+            mSuspendAll->setVisible(false);
+		}
+		if (mResumeAll != NULL && mResumeAll->text() == "Resume all") {
+            mSuspendAll->setVisible(false);
+		}		
+	}
+}
+
+
+// ---------------------------------------------------------------------------
+
+int MainView::currentItemIndex()
+{
+	return mListView->selectionModel()->currentIndex().row();
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::setCurrentItemIndex(int index) 
+{
+    QModelIndex newIndex = mListView->model()->index(index, 0);
+    mListView->selectionModel()->setCurrentIndex(newIndex, 
+                                                QItemSelectionModel::SelectCurrent);
+	//mListView->setCurrentIndex( index ); //setCurrentRow(index);
+}	
+
+// ---------------------------------------------------------------------------
+
+void MainView::launchPerfMon()
+{
+	mEngineWrapper->launchPerfMonApp();
+}
+
+// ---------------------------------------------------------------------------
+
+QList<int> MainView::listSelectionIndexes()
+    {
+	QList<int> indices;
+    if (mListView != NULL) {
+		QItemSelectionModel *selectionModel = mListView->selectionModel();
+		if (selectionModel->hasSelection()) {
+			QModelIndexList modelIndexes = selectionModel->selectedIndexes();
+			QModelIndex index;
+			foreach (index, modelIndexes) {
+				indices.append(index.row());
+			}
+		}
+    }
+    return indices;
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void MainView::suspendAllLoads()
+{
+	mEngineWrapper->suspendAllLoadItems();
+}
+
+// ---------------------------------------------------------------------------
+	
+void MainView::resumeAllLoads()
+{
+	mEngineWrapper->resumeAllLoadItems();
+}
+
+void MainView::clearListSelection()
+{
+    if (mListView != NULL) {
+		mListView->clearSelection();
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::setLoadListData(QStringList& items)
+{
+	QString loadItem;
+	QString iconName;
+
+	if (mListView) {
+		mListView->setSelectionMode(HbListView::MultiSelection);
+		mListView->setVisible(true); //setHighlightMode(HbItemHighlight::AlwaysVisible);
+		if(mListModel->rowCount())
+			{
+			mListModel->removeRows(0,mListModel->rowCount());
+			}
+//		mListModel->clear();
+	}
+	if (items.count() > 0) {
+		mIsLoadListEmpty = false;
+	}
+	else if (items.count() == 0) {
+		mIsLoadListEmpty = true;
+	}
+	for (int i = 0; i < items.count(); i++) {
+		QStandardItem *item = new QStandardItem();
+		loadItem = items.at(i);
+		if (loadItem.startsWith("1")) {
+			iconName = ":/paused.svg";
+		}
+		else {
+			iconName = ":/active.svg";
+		}
+		// remove icon indicator info from string
+		// to show in load in load list
+		loadItem.remove(0,2); 
+		item->setText(loadItem);
+		item->setIcon(QIcon(iconName));
+		// set new load to correct row in load list
+		mListModel->insertRow(i, item);
+	}
+}	
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/notifications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <hbmessagebox.h>
+#include <hblabel.h>
+#include <QString>
+
+#include "notifications.h"
+
+
+// ---------------------------------------------------------------------------
+
+void Notifications::about()
+{
+    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+    messageBox->setText("Version 1.5.0 - March 10th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    HbLabel *header = new HbLabel("About LoadGen", messageBox);
+    messageBox->setHeadingWidget(header);
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(HbPopup::NoTimeout);
+    messageBox->open();
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::error(const QString& errorMessage)
+{
+	showGlobalNote(errorMessage, HbMessageBox::MessageTypeWarning );
+}
+
+// ---------------------------------------------------------------------------
+
+void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout)
+{
+    HbMessageBox *messageBox = new HbMessageBox(type);
+    messageBox->setText(text);
+    messageBox->setTimeout(timeout);
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->open();
+}
+
+// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/ui/hb/src/settingsview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1255 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "settingsview.h"
+#include "enginewrapper.h"
+#include "loadgen.hrh"
+#include "loadgen_loadattributes.h"
+#include <hbmainwindow.h>
+#include <hbview.h>
+//#include <hbformitem.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hbmessagebox.h>
+//#include <hbcommonnote.h>
+#include <hbtoolbar.h>
+#include <hbdataform.h>
+#include <hbdataformmodelitem.h>
+#include <hbdataformmodel.h>
+#include <hbdataformviewitem.h>
+#include <hbabstractviewitem.h>
+#include <hbradiobuttonlist.h>
+
+
+#include <QStringList>
+
+QStringList PRIORITIES = (QStringList() << "Much less (-20)" << "Less (-10)" << "Normal (0)" << "More (10)" 
+						 << "Much more (20)" << "Real time (30)" << "Abs. very low (100)" << "Abs. low (200)" 
+						 << "Abs. backgr. (300)" << "Abs. foregr. (400)" << "Abs. high (500)");
+QStringList LOADMODES = (QStringList() << "Yielding" << "Blocking");
+QStringList CPULOADTYPES = (QStringList() << "Continuous" << "Periodic");		   
+QStringList MEMSOURCES = (QStringList() << "RAM" << "C:" << "D:" << "E:" << "F:" << "G:" << "H:" << "J:" << "K:" 
+										<< "L:" << "M:" << "N:");
+QStringList MEMEATTYPES = (QStringList() << "Memory to eat" << "Memory to be left" << "Alternate min/max");
+QStringList KEYPRESSTYPES = (QStringList() << "None" << "Arrow keys");
+QStringList MESSAGETYPES = (QStringList() << "SMS" << "MMS");
+
+		   
+SettingsView::SettingsView(HbView &mainView, HbMainWindow &parent, EngineWrapper &engine)
+                          
+    : mMainWindow(parent),
+      mMainView(mainView),
+      mEngineWrapper(engine),
+	  mAmount(NULL),
+	  mMinAmountToBeLeft(NULL),
+	  mMaxAmountToBeLeft(NULL),
+	  mLength(NULL),
+	  mIdle(NULL),
+	  mRandomVar(NULL)
+{
+}
+
+SettingsView::~SettingsView()
+{
+
+}
+
+// TODO HbDataFormModelItem data operations does not work correctly with WK38.
+// Item data does not get updated correctly as set by initial settings(HbDataFormModelItem::RadioButtonListItem) 
+// or user settings.(HbDataFormModelItem::TextItem)
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::open(const QString &settingsName, TLoadGenCommandIds cmdId)
+{
+	mCmdId = cmdId;
+    // Remove main view from main window and add this view to main window
+    mMainWindow.addView(this);
+    mMainWindow.setCurrentView(this);
+    setTitle(settingsName);
+
+    //create toolbar showing launch popup
+    HbToolBar *toolBar = this->toolBar();
+    HbAction *actionOk = new HbAction("Ok", toolBar);
+    HbAction *actionCancel = new HbAction("Cancel", toolBar);
+    toolBar->addAction( actionOk );
+    toolBar->addAction( actionCancel );	
+
+    //create setting form
+    mSettingForm = new HbDataForm();
+    
+    //create a model class
+    mModel = new HbDataFormModel(this);
+	createItems(mModel, 0);
+    // Set created model to form
+    mSettingForm->setModel(mModel);
+    setWidget(mSettingForm);
+	loadAttributes();	
+	
+    connect(actionOk, SIGNAL(triggered()), this, SLOT(okExit()));
+	connect(actionCancel, SIGNAL(triggered()), this, SLOT(cancelled()));
+	connect(this, SIGNAL(aboutToClose()), this, SLOT(backButtonPressed()));
+	connect(mSettingForm, SIGNAL(activated(const QModelIndex)), this, SLOT(dataItemDisplayed(const QModelIndex)));  
+	show();
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createItems(HbDataFormModel *model, 
+							   HbDataFormModelItem *parent)
+{
+	switch (mCmdId) {
+		case ELoadGenCmdNewLoadCPULoad: {
+			createCpuLoadItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			createEatMemoryItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhoneCall: {
+			createPhoneCallItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadNetConn: {
+			createNetConnItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadKeyPress:
+		case ELoadGenCmdNewLoadPointerEvent: {
+			createKeyOrPointerItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadMessages: {
+			createMessageItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadApplications: {
+			createAppsItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhotoCaptures: {
+			createPhotoItems(model, parent);
+			break;
+		}
+		case ELoadGenCmdNewLoadBluetooth: {
+			createBtItems(model, parent);
+			break;
+		}
+		default: {
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createCpuLoadItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+
+	mLoadSettings = model->appendDataFormGroup(QString("CPU load settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	// DataFormItem for load mode selection
+	mLoadMode = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Load mode"), 
+										  mLoadSettings);
+	mLoadMode->setContentWidgetData(QString("items"), LOADMODES);		
+
+	// DataFormItem for load type selection
+	mType = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+									  QString("Type"), 
+									  mLoadSettings);
+	mType->setContentWidgetData(QString("items"), CPULOADTYPES);
+
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createEatMemoryItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	mLoadSettings = model->appendDataFormGroup(QString("Eat memory settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	// DataFormItem for memory eat type selection
+	mSource = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+									  QString("Source"), 
+									  mLoadSettings);
+	mSource->setContentWidgetData(QString("items"), MEMSOURCES);
+
+	
+	// DataFormItem for memory eat type selection
+	mType = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+									  QString("Type"), 
+									  mLoadSettings);
+	mType->setContentWidgetData(QString("items"), MEMEATTYPES);
+
+	// DataFormItem for idle length selection
+	mBuffer = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Buffer (B)"), 
+									  mLoadSettings);
+	mBuffer->setContentWidgetData("maximum" , 999999999);
+	mBuffer->setContentWidgetData("minimum", 0);	
+	
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle after buffer (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);			
+
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}	
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createPhoneCallItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+
+	mLoadSettings = model->appendDataFormGroup(QString("Phone calls settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	mDestination = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										QString("Phone number:"), 
+										mLoadSettings);
+	mDestination->setContentWidgetData("maximum" , 99999999999999999999.0 );
+	mDestination->setContentWidgetData("minimum", 0);
+
+	mLength = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										QString("Length (ms)"), 
+										mLoadSettings);
+	mLength->setContentWidgetData("maximum" , 999999999);
+	mLength->setContentWidgetData("minimum", 0);
+	
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);			
+
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createNetConnItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+
+	mLoadSettings = model->appendDataFormGroup(QString("Network conn. settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	mDestination = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										QString("Destination URL:"), 
+										mLoadSettings);
+	
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);			
+
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createKeyOrPointerItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	QString settingsName;
+	if (mCmdId == ELoadGenCmdNewLoadPointerEvent) {
+		settingsName = "Pointer events settings";
+	}
+	else {
+		settingsName = "Key presses settings";
+	}
+	mLoadSettings = model->appendDataFormGroup(settingsName, parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	
+	// DataFormItem for heartbeat length selection
+	mHeartBeat = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Heartbeat (ms)"), 
+									  mLoadSettings);
+	mHeartBeat->setContentWidgetData("maximum" , 999999999);
+	mHeartBeat->setContentWidgetData("minimum", 0);		
+	
+	// Random variance
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createMessageItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	mLoadSettings = model->appendDataFormGroup(QString("Messages settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	
+	mType = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+									  QString("Type"), 
+									  mLoadSettings);
+	mType->setContentWidgetData(QString("items"), MESSAGETYPES);	
+
+
+	mDestination = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										QString("Phone number:"), 
+										mLoadSettings);
+	mDestination->setContentWidgetData("maximum" , 99999999999999999999.0 );
+	mDestination->setContentWidgetData("minimum", 0);
+	
+	mAmount	= mModel->insertDataFormItem(3, HbDataFormModelItem::TextItem, 
+									  QString("Maximum amount of messages"), 
+									  mLoadSettings);
+	mAmount->setContentWidgetData("maximum" , 1000);
+	mAmount->setContentWidgetData("minimum", 0);
+
+	mLength = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										QString("Message length"), 
+										mLoadSettings);
+	mLength->setContentWidgetData("maximum" , 999999999);
+	mLength->setContentWidgetData("minimum", 0);
+
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);			
+
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createAppsItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	mLoadSettings = model->appendDataFormGroup(QString("Applications settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	mMaxParallelApps = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Max parallel applications"), 
+									  mLoadSettings);
+	mMaxParallelApps->setContentWidgetData("maximum" , 100);
+	mMaxParallelApps->setContentWidgetData("minimum", 0);	
+
+
+	// DataFormItem for launching interval length selection
+	mLaunchingInterval = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Launching interval (ms)"), 
+									  mLoadSettings);
+	mLaunchingInterval->setContentWidgetData("maximum" , 999999999);
+	mLaunchingInterval->setContentWidgetData("minimum", 0);	
+	
+	// DataFormItem for key press type selection
+	mKeyPressType = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Key press type"), 
+										  mLoadSettings);
+	mKeyPressType->setContentWidgetData(QString("items"), KEYPRESSTYPES);	
+
+	// DataFormItem for heartbeat length selection
+	mHeartBeat = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Key press interval (ms)"), 
+									  mLoadSettings);
+	mHeartBeat->setContentWidgetData("maximum" , 999999999);
+	mHeartBeat->setContentWidgetData("minimum", 0);		
+	
+	// Random variance
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createPhotoItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	mLoadSettings = model->appendDataFormGroup(QString("Camera settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);		
+	
+	// Random variance
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::createBtItems(HbDataFormModel *model, HbDataFormModelItem *parent)
+{
+	mLoadSettings = model->appendDataFormGroup(QString("Bluetooth settings"), parent);
+	
+	// DataFormItem for priority selection
+	mPriority = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+										  QString("Priority"), 
+										  mLoadSettings);
+	mPriority->setContentWidgetData(QString("items"), PRIORITIES);
+
+	
+	// DataFormItem for idle length selection
+	mIdle = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+									  QString("Idle (ms)"), 
+									  mLoadSettings);
+	mIdle->setContentWidgetData("maximum" , 999999999);
+	mIdle->setContentWidgetData("minimum", 0);		
+	
+	// Random variance
+	mRandomVar = model->appendDataFormItem(HbDataFormModelItem::TextItem, 
+										   QString("Random variance (%)"), 
+										   mLoadSettings);
+	mRandomVar->setContentWidgetData("maximum" , 100);
+	mRandomVar->setContentWidgetData("minimum", 0);	
+}
+
+// ---------------------------------------------------------------------------
+// Load attributes from engine & set the data into each form model item:
+
+void SettingsView::loadAttributes()
+{
+	switch (mCmdId)
+	{
+		case ELoadGenCmdNewLoadCPULoad: {
+			mCPULoadAttributes = mEngineWrapper.getCpuLoadAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mCPULoadAttributes.mPriority);
+			mLoadMode->setContentWidgetData(QString("selected"), mCPULoadAttributes.mMode);
+			mType->setContentWidgetData(QString("selected"), mCPULoadAttributes.mType);
+			
+			if (mCPULoadAttributes.mType == ECpuLoadTypePeriodic) {	//if (mCPULoadAttributes.mMode == ECpuLoadTypePeriodic) {
+			// Create and append to model these items: Length, Idle, Random variance, if load type is peridodic.
+				
+				// DataFormItem for load length selection
+				mLength = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+													QString("Length (ms)"), 
+													mLoadSettings);
+				mLength->setContentWidgetData("maximum" , 999999999);
+				mLength->setContentWidgetData("minimum", 0);
+				
+				
+				// DataFormItem for load length selection
+				mIdle = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+												  QString("Idle (ms)"), 
+												  mLoadSettings);
+				mIdle->setContentWidgetData("maximum" , 999999999);
+				mIdle->setContentWidgetData("minimum", 0);			
+
+				mRandomVar = mModel->appendDataFormItem(HbDataFormModelItem::TextItem, 
+													   QString("Random variance (%)"), 
+													   mLoadSettings);
+				mRandomVar->setContentWidgetData("maximum" , 100);
+				mRandomVar->setContentWidgetData("minimum", 0);	
+			
+				mLength->setContentWidgetData(QString("text"), mCPULoadAttributes.mLength);
+				mIdle->setContentWidgetData(QString("text"), mCPULoadAttributes.mIdle);
+				mRandomVar->setContentWidgetData(QString("text"), mCPULoadAttributes.mRandomVariance);
+			}
+
+			// if there's more than one cpu available in the system, 
+			// insert possibility to select which cpu the load is generated to
+			if (mCPULoadAttributes.mCpuCount > 1)
+            {
+				QStringList cpuArray;
+				cpuArray.append("Free scheduling");
+				// add cpus to list:
+				for (int i = 0; i < mCPULoadAttributes.mCpuCount; i++) 
+					{
+					QString cpu = QString("CPU%1").arg(i);
+					cpuArray.append(cpu);
+					}    
+				// "All CPUs" means that one thread is started for each CPU.	
+				cpuArray.append("All CPUs");
+
+				mCpu = mModel->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, 
+													 QString("CPU"), 
+													 mLoadSettings);
+				mCpu->setContentWidgetData(QString("items"), cpuArray);				
+
+				if (mCPULoadAttributes.mCpu < 0) {
+					mCpu->setContentWidgetData(QString("selected"), 0);
+				}				
+
+				else if (mCPULoadAttributes.mCpu == KCPUSelection_AllCPUs) {
+					mCpu->setContentWidgetData(QString("selected"), cpuArray.count()-1);
+				}
+				// CPU is defined, set the correct CPU as default selection in query list
+				else {
+				// mCpu starts from zero (i.e. CPU0 is first CPU), but index zero
+				// in settings Ui form item is reserved for "Free scheduling", hence iCpu+1.
+					mCpu->setContentWidgetData(QString("selected"), mCPULoadAttributes.mCpu+1);
+				}
+            }
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			mMemoryEatAttributes = mEngineWrapper.getMemoryEatAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mMemoryEatAttributes.mPriority);
+			mSource->setContentWidgetData(QString("selected"), mMemoryEatAttributes.mSource);
+			mType->setContentWidgetData(QString("selected"), mMemoryEatAttributes.mType);
+			
+			if (mMemoryEatAttributes.mType == EMemoryEatTypeWavy) {
+				mMinAmountToBeLeft	= mModel->insertDataFormItem(3, HbDataFormModelItem::TextItem, 
+												  QString("Min to be left (B)"), 
+												  mLoadSettings);
+				mMinAmountToBeLeft->setContentWidgetData("maximum" , 99999999999999);
+				mMinAmountToBeLeft->setContentWidgetData("minimum", 0);
+				
+				mMaxAmountToBeLeft	= mModel->insertDataFormItem(4, HbDataFormModelItem::TextItem, 
+												  QString("Max to be left (B)"), 
+												  mLoadSettings);
+				mMaxAmountToBeLeft->setContentWidgetData("maximum" , 99999999999999);
+				mMaxAmountToBeLeft->setContentWidgetData("minimum", 0);
+
+				mMinAmountToBeLeft->setContentWidgetData(QString("text"), mMemoryEatAttributes.mRandomMinDes);
+				mMaxAmountToBeLeft->setContentWidgetData(QString("text"), mMemoryEatAttributes.mRandomMaxDes);
+			}
+			else if (mMemoryEatAttributes.mType == EMemoryEatTypeMemoryToEat ||
+			         mMemoryEatAttributes.mType == EMemoryEatTypeMemoryToBeLeft ) {
+				mAmount	= mModel->insertDataFormItem(3, HbDataFormModelItem::TextItem, 
+												  QString("Amout(B)"), 
+												  mLoadSettings);
+				mAmount->setContentWidgetData("maximum" , 99999999999999);
+				mAmount->setContentWidgetData("minimum", 0);
+				
+				mAmount->setContentWidgetData(QString("text"), mMemoryEatAttributes.mAmount);	 
+			}
+			mBuffer->setContentWidgetData(QString("text"), mMemoryEatAttributes.mBuffer);
+			mIdle->setContentWidgetData(QString("text"), mMemoryEatAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mMemoryEatAttributes.mRandomVariance);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhoneCall: {
+			mPhoneCallAttributes = mEngineWrapper.getPhoneCallAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mPhoneCallAttributes.mPriority);
+			mDestination->setContentWidgetData(QString("text"), mPhoneCallAttributes.mDestination);
+			mLength->setContentWidgetData(QString("text"), mPhoneCallAttributes.mLength);
+			mIdle->setContentWidgetData(QString("text"), mPhoneCallAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mPhoneCallAttributes.mRandomVariance);
+			break;
+		}
+		case ELoadGenCmdNewLoadNetConn: {
+			mNetConnAttributes = mEngineWrapper.getNetConnAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mNetConnAttributes.mPriority);
+			mDestination->setContentWidgetData(QString("text"), mNetConnAttributes.mDestination);
+			mIdle->setContentWidgetData(QString("text"), mNetConnAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mNetConnAttributes.mRandomVariance);
+			break;
+		}
+		case ELoadGenCmdNewLoadKeyPress: {
+			mKeyPressAttributes = mEngineWrapper.getKeyPressAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mKeyPressAttributes.mPriority);
+			mHeartBeat->setContentWidgetData(QString("text"), mKeyPressAttributes.mHeartBeat);
+			mRandomVar->setContentWidgetData(QString("text"), mKeyPressAttributes.mRandomVariance);			
+			break;
+		}
+		case ELoadGenCmdNewLoadPointerEvent: { 
+			mPointerEventAttributes = mEngineWrapper.getPointerEventAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mPointerEventAttributes.mPriority);
+			mHeartBeat->setContentWidgetData(QString("text"), mPointerEventAttributes.mHeartBeat);
+			mRandomVar->setContentWidgetData(QString("text"), mPointerEventAttributes.mRandomVariance);				
+			break;
+		}
+		case ELoadGenCmdNewLoadMessages: {
+			mMessageAttributes = mEngineWrapper.getMessageAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mMessageAttributes.mPriority);
+			mType->setContentWidgetData(QString("selected"), mMessageAttributes.mMessageType);
+			mDestination->setContentWidgetData(QString("text"), mMessageAttributes.mDestination);
+			mAmount->setContentWidgetData(QString("text"), mMessageAttributes.mAmount);	 
+			mLength->setContentWidgetData(QString("text"), mMessageAttributes.mLength);
+			mIdle->setContentWidgetData(QString("text"), mMessageAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mMessageAttributes.mRandomVariance);
+			break;
+		}
+		case ELoadGenCmdNewLoadApplications: {
+			mApplicationsAttributes = mEngineWrapper.getApplicationsAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mApplicationsAttributes.mPriority);
+			mMaxParallelApps->setContentWidgetData(QString("text"), mApplicationsAttributes.mMaxOpen);
+			mHeartBeat->setContentWidgetData(QString("text"), mApplicationsAttributes.mHeartBeat);
+			mLaunchingInterval->setContentWidgetData(QString("text"), mApplicationsAttributes.mLaunchingInterval);
+			mKeyPressType->setContentWidgetData(QString("selected"), mApplicationsAttributes.mKeyPressType);
+			mRandomVar->setContentWidgetData(QString("text"), mApplicationsAttributes.mRandomVariance);						
+			break;
+		}
+		case ELoadGenCmdNewLoadPhotoCaptures: {
+			mPhotoCaptureAttributes = mEngineWrapper.getPhotoCaptureAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mPhotoCaptureAttributes.mPriority);
+			mIdle->setContentWidgetData(QString("text"), mPhotoCaptureAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mPhotoCaptureAttributes.mRandomVariance);
+			
+			// if there's any cameras avaialable in system, construct form item for it/them:
+			if (mPhotoCaptureAttributes.mCameraCount > 0)
+            {
+				QStringList devices;
+				// add cameras to list:
+				for (int i = 0; i < mPhotoCaptureAttributes.mCameraCount; i++) 
+					{
+					QString cam = QString("Camera %1").arg(i);
+					devices.append(cam);
+					}    
+				mCamera = mModel->insertDataFormItem(1, HbDataFormModelItem::RadioButtonListItem, 
+													 QString("Device"), 
+													 mLoadSettings);
+				mCamera->setContentWidgetData(QString("items"), devices);
+				mCamera->setContentWidgetData(QString("selected"), mPhotoCaptureAttributes.mCamera);
+            }
+			break;
+		}
+		case ELoadGenCmdNewLoadBluetooth: {
+			mBluetoothAttributes = mEngineWrapper.getBluetoothAttributes();
+			mPriority->setContentWidgetData(QString("selected"), mBluetoothAttributes.mPriority);
+			mIdle->setContentWidgetData(QString("text"), mBluetoothAttributes.mIdle);
+			mRandomVar->setContentWidgetData(QString("text"), mBluetoothAttributes.mRandomVariance);	
+			break;
+		}
+		
+		default: {
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::setDefaultSettings()
+{
+
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::backButtonPressed()
+{
+	okExit();	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveSettings()
+{
+	switch (mCmdId) {
+		case ELoadGenCmdNewLoadCPULoad: {
+			saveCpuLoadSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			saveEatMemorySettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadPhoneCall: {
+			savePhoneCallSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadNetConn: {
+			saveNetConnSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadKeyPress: {
+			saveKeyPressSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadPointerEvent: {
+			savePointerEventSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadMessages: {
+			saveMessageSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadApplications: {
+			saveApplicationsSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadPhotoCaptures: {
+			savePhotoSettings();
+			break;
+		}
+		case ELoadGenCmdNewLoadBluetooth: {
+			saveBtSettings();
+			break;
+		}
+		default: {
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------	
+	
+void SettingsView::saveCpuLoadSettings()
+{
+	mCPULoadAttributes.mPriority = mPriority->contentWidgetData("selected").toInt();
+	mCPULoadAttributes.mMode = mLoadMode->contentWidgetData("selected").toInt();
+	mCPULoadAttributes.mType = mType->contentWidgetData("selected").toInt();
+	if (mType->contentWidgetData("selected").toInt() == ECpuLoadTypePeriodic) {
+		// TODO: remove temp checks if (mLength != NULL) etc. when HbDataFormModelItem bugs fixed.
+		if (mLength != NULL) {
+			mCPULoadAttributes.mLength = mLength->contentWidgetData("text").toInt();
+		}
+		if (mIdle != NULL) {			
+			mCPULoadAttributes.mIdle = mIdle->contentWidgetData("text").toInt();
+		}
+		if (mRandomVar != NULL) {
+			int randVar = mRandomVar->contentWidgetData("text").toInt();
+			if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+				{
+				mCPULoadAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+				}
+			else
+				{
+				mCPULoadAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+				}
+		}
+	}
+
+	// we are running in SMP environment
+	if (mCPULoadAttributes.mCpuCount > 1)
+		{
+		TInt currentValueIndex = mCpu->contentWidgetData("selected").toInt();
+		// user selected a specific CPU in which the load thread should be run in.
+		if (currentValueIndex == 0)
+			{
+			// User selected "Free scheduling"
+			mCPULoadAttributes.mCpu = KCPUSelection_FreeScheduling;
+			}            
+		else if( currentValueIndex == (mCpu->childCount()-1) )
+			{
+			// User selected "All CPUs", which is the last item in the form radio button selection list
+			mCPULoadAttributes.mCpu = KCPUSelection_AllCPUs;
+			}
+		else
+			{                
+			// mCpu should start from zero (CPU0 is the first cpu)
+			// but zero in Ui form item index means "Free scheduling". CPU0 in
+			// index of form radio button list is at index 1, hence -1.
+			mCPULoadAttributes.mCpu = currentValueIndex - 1;
+			}
+		}
+
+	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveEatMemorySettings()
+{
+	mMemoryEatAttributes.mPriority = mPriority->contentWidgetData("selected").toInt();
+	mMemoryEatAttributes.mSource = mSource->contentWidgetData("selected").toInt();
+	mMemoryEatAttributes.mType = mType->contentWidgetData("selected").toInt();
+	
+	if (mType->contentWidgetData("selected").toInt() == EMemoryEatTypeWavy) {
+		// TODO: remove temp checks if (mLength != NULL) etc. when HbDataFormModelItem bugs fixed.
+		if (mMinAmountToBeLeft != NULL) {
+			mMemoryEatAttributes.mRandomMin = 
+				mMinAmountToBeLeft->contentWidgetData("text").toInt();
+		}
+		if (mMaxAmountToBeLeft != NULL) {
+			mMemoryEatAttributes.mRandomMax = 
+				mMaxAmountToBeLeft->contentWidgetData("text").toInt();
+		}
+	}
+	else if (mType->contentWidgetData("selected").toInt() == EMemoryEatTypeMemoryToEat ||
+	         mType->contentWidgetData("selected").toInt() == EMemoryEatTypeMemoryToBeLeft) {
+		if (mAmount != NULL) {
+			mMemoryEatAttributes.mAmount = mAmount->contentWidgetData("text").toInt();
+		}
+	}
+	mMemoryEatAttributes.mBuffer = mBuffer->contentWidgetData("text").toInt();
+	mMemoryEatAttributes.mIdle = mIdle->contentWidgetData("text").toInt();
+	
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mMemoryEatAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mMemoryEatAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+    // swap min- & max values if they are in wrong order
+	if (mMemoryEatAttributes.mRandomMin > mMemoryEatAttributes.mRandomMax)
+		{
+		qint64 temp(mMemoryEatAttributes.mRandomMin);
+		mMemoryEatAttributes.mRandomMin = mMemoryEatAttributes.mRandomMax;
+		mMemoryEatAttributes.mRandomMax = temp; 
+		}	
+}
+
+// ---------------------------------------------------------------------------	
+	
+void SettingsView::savePhoneCallSettings()
+{
+	mPhoneCallAttributes.mPriority = mPriority->contentWidgetData("selected").toInt();
+	mPhoneCallAttributes.mLength   = mLength->contentWidgetData("text").toInt();
+	mPhoneCallAttributes.mIdle     = mIdle->contentWidgetData("text").toInt();
+	
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mPhoneCallAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mPhoneCallAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+	
+	mPhoneCallAttributes.mDestination    = mDestination->contentWidgetData("text").toString();
+}
+
+// ---------------------------------------------------------------------------	
+	
+void SettingsView::saveNetConnSettings()
+{
+	mPhoneCallAttributes.mPriority = mPriority->contentWidgetData("selected").toInt();
+	mPhoneCallAttributes.mIdle     = mIdle->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mPhoneCallAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mPhoneCallAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	mPhoneCallAttributes.mDestination    = mDestination->contentWidgetData("text").toString();
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveKeyPressSettings()
+{
+	mKeyPressAttributes.mPriority  = mPriority->contentWidgetData("selected").toInt();
+	mKeyPressAttributes.mHeartBeat = mHeartBeat->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mKeyPressAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mKeyPressAttributes.mRandomVariance =  mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::savePointerEventSettings()
+{
+	mPointerEventAttributes.mPriority  = mPriority->contentWidgetData("selected").toInt();
+	mPointerEventAttributes.mHeartBeat = mHeartBeat->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mPointerEventAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mPointerEventAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveMessageSettings()
+{
+	mMessageAttributes.mPriority    = mPriority->contentWidgetData("selected").toInt();
+	mMessageAttributes.mMessageType = mType->contentWidgetData("selected").toInt();
+	mMessageAttributes.mDestination = mDestination->contentWidgetData("text").toString();
+	int amount = mAmount->contentWidgetData("text").toInt();
+	if( amount  >=0 && amount <= mAmount->contentWidgetData("maximum").toInt() )
+		{
+		mMessageAttributes.mAmount = mAmount->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mMessageAttributes.mAmount = mAmount->contentWidgetData("maximum").toInt();
+		}
+	mMessageAttributes.mLength = mLength->contentWidgetData("text").toInt();
+	mMessageAttributes.mIdle = mIdle->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mMessageAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mMessageAttributes.mRandomVariance =  mRandomVar->contentWidgetData("maximum").toInt();
+		}
+
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveApplicationsSettings()
+{
+	mApplicationsAttributes.mPriority  = mPriority->contentWidgetData("selected").toInt();
+	int maxApps = mMaxParallelApps->contentWidgetData("text").toInt();
+	if( maxApps >=0 && maxApps <= mMaxParallelApps->contentWidgetData("maximum").toInt() )
+		{
+		mApplicationsAttributes.mMaxOpen   = mMaxParallelApps->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mApplicationsAttributes.mMaxOpen   = mMaxParallelApps->contentWidgetData("maximum").toInt();
+		}
+	mApplicationsAttributes.mLaunchingInterval   = mLaunchingInterval->contentWidgetData("text").toInt();
+	mApplicationsAttributes.mKeyPressType  = mKeyPressType->contentWidgetData("selected").toInt();
+	mPointerEventAttributes.mHeartBeat = mHeartBeat->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mApplicationsAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mApplicationsAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::savePhotoSettings()
+{
+	mPhotoCaptureAttributes.mPriority  = mPriority->contentWidgetData("selected").toInt();
+	mPhotoCaptureAttributes.mIdle = mIdle->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mPhotoCaptureAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mPhotoCaptureAttributes.mRandomVariance = mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+	// update only if there's more than one camera device available in the system, 
+	// for use case of one camera available, the selection cannot be changed by user.
+	if (mPhotoCaptureAttributes.mCameraCount > 1)
+	{
+	mPhotoCaptureAttributes.mCamera = mCamera->contentWidgetData("selected").toInt();
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::saveBtSettings()
+{
+	mBluetoothAttributes.mPriority  = mPriority->contentWidgetData("selected").toInt();
+	mBluetoothAttributes.mIdle = mIdle->contentWidgetData("text").toInt();
+	int randVar = mRandomVar->contentWidgetData("text").toInt();
+	if( randVar >=0 && randVar <= mRandomVar->contentWidgetData("maximum").toInt() )
+		{
+		mBluetoothAttributes.mRandomVariance = mRandomVar->contentWidgetData("text").toInt();
+		}
+	else
+		{
+		mBluetoothAttributes.mRandomVariance =  mRandomVar->contentWidgetData("maximum").toInt();
+		}
+	
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::cancelled()
+{
+	connect(this, 
+		SIGNAL(loadCanclled()), 
+		&mEngineWrapper, 
+		SLOT(loadSettingsCanclled()));
+	emit loadCanclled();
+	
+    mMainWindow.removeView(this);
+    mMainWindow.setCurrentView(&mMainView, true);
+    deleteLater();
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::okExit()
+{
+	saveSettings();
+	setLoadAttributes();
+    connect(this, 
+			SIGNAL(loadCompleted(TLoadGenCommandIds)), 
+			&mEngineWrapper, 
+			SLOT(loadAddedOrEdited(TLoadGenCommandIds)));
+	emit loadCompleted(mCmdId);
+			
+    mMainWindow.removeView(this);
+    mMainWindow.setCurrentView(&mMainView, true);
+    deleteLater();
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::setLoadAttributes()
+{
+	switch (mCmdId) {
+		case ELoadGenCmdNewLoadCPULoad: {
+			mEngineWrapper.setCpuLoadAttributes(mCPULoadAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			mEngineWrapper.setMemoryEatAttributes(mMemoryEatAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhoneCall: {
+			mEngineWrapper.setPhoneCallAttributes(mPhoneCallAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadNetConn: {
+			mEngineWrapper.setNetConnAttributes(mNetConnAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadKeyPress: {
+			mEngineWrapper.setKeyPressAttributes(mKeyPressAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadPointerEvent: {
+			mEngineWrapper.setPointerEventAttributes(mPointerEventAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadMessages: {
+			mEngineWrapper.setMessageAttributes(mMessageAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadApplications: {
+			mEngineWrapper.setApplicationsAttributes(mApplicationsAttributes);
+			break;
+		}
+		case ELoadGenCmdNewLoadPhotoCaptures: {
+			mEngineWrapper.setPhotoCaptureAttributes(mPhotoCaptureAttributes); 
+			break;		
+		}
+		case ELoadGenCmdNewLoadBluetooth: {
+			mEngineWrapper.setBluetoothAttributes(mBluetoothAttributes);
+			break;
+		}
+		default: {
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::dataItemDisplayed(const QModelIndex &index)
+{
+	HbDataFormViewItem *item = static_cast<HbDataFormViewItem*>(mSettingForm->itemByIndex(index)); 
+	HbWidget *contentWidget = static_cast<HbWidget*>(item->dataItemContentWidget());
+	switch(mCmdId){
+		case ELoadGenCmdNewLoadCPULoad: {
+			if (index.row() == 2) { // Cpu load type selection is in this row: periodic vs. continuous
+				mModes = static_cast<HbRadioButtonList*>(contentWidget);
+				connect(mModes , SIGNAL(itemSelected(int)), this, SLOT(selectionChanged(int)));
+			}
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+				// Memory eat type is in this row: mem to eat/ mem to be left vs. alternate min/max
+				if (index.row() == 2) { 
+				mTypes = static_cast<HbRadioButtonList*>(contentWidget );
+				connect(mTypes ,SIGNAL(itemSelected(int)), this,SLOT(selectionChanged(int)));
+				}
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------
+
+void SettingsView::selectionChanged(int index)
+{
+	switch (mCmdId) {
+		case ELoadGenCmdNewLoadCPULoad: {
+			if (index == ECpuLoadTypePeriodic) {
+			// if periodic selected, add Length, Idle and Random variance to settings,
+			// if they does not exist yet.
+				if (mLength == NULL) {
+					mLength = mModel->insertDataFormItem(3, 
+														 HbDataFormModelItem::TextItem, 
+														 QString("Length (ms)"), 
+														 mLoadSettings);
+					mLength->setContentWidgetData("maximum" , 999999999);
+					mLength->setContentWidgetData("minimum", 0);
+					mLength->setContentWidgetData(QString("text"), mCPULoadAttributes.mLength);
+					}
+				if (mIdle == NULL) {
+					// DataFormItem for load length selection
+					mIdle = mModel->insertDataFormItem(4,
+					                                   HbDataFormModelItem::TextItem, 
+													   QString("Idle (ms)"), 
+													   mLoadSettings);
+					mIdle->setContentWidgetData("maximum" , 999999999);
+					mIdle->setContentWidgetData("minimum", 0);			
+					mIdle->setContentWidgetData(QString("text"), mCPULoadAttributes.mIdle);
+					}
+				if (mRandomVar == NULL) {
+					mRandomVar = mModel->insertDataFormItem(5,
+					                                        HbDataFormModelItem::TextItem,  
+														    QString("Random variance (%)"), 
+														    mLoadSettings);
+					mRandomVar->setContentWidgetData("maximum" , 100);
+					mRandomVar->setContentWidgetData("minimum", 0);	
+					mRandomVar->setContentWidgetData(QString("text"), mCPULoadAttributes.mRandomVariance);
+				}
+			}
+			else if (index == ECpuLoadTypeContinuous) {
+				// if continuous selected, remove existing Length, Idle and Random variance from settings view:
+				// if they does not exist do nothing.
+				if (mLength != NULL) {
+					mModel->removeItem(mLength);
+					mLength = NULL;
+				}
+				if (mIdle != NULL) {
+					mModel->removeItem(mIdle);
+					mIdle = NULL;
+				}
+				if (mRandomVar != NULL) {
+					mModel->removeItem(mRandomVar);
+					mRandomVar = NULL;
+				}	
+			}
+			break;
+		}
+		case ELoadGenCmdNewLoadEatMemory: {
+			if (index == EMemoryEatTypeWavy) {
+				// remove one item, if exists. 
+				if (mAmount != NULL) {
+					mModel->removeItem(mAmount);
+					mAmount = NULL;
+				}
+				// insert two new item rows, if not exists.
+				if (mMinAmountToBeLeft == NULL) {
+					mMinAmountToBeLeft	= mModel->insertDataFormItem(3, HbDataFormModelItem::TextItem, 
+													  QString("Min to be left (B)"), 
+													  mLoadSettings);
+					mMinAmountToBeLeft->setContentWidgetData("maximum" , 99999999999999);
+					mMinAmountToBeLeft->setContentWidgetData("minimum", 0);
+					mMinAmountToBeLeft->setContentWidgetData( QString("text"),mMemoryEatAttributes.mRandomMin );
+				}
+				if (mMaxAmountToBeLeft == NULL) {
+					mMaxAmountToBeLeft	= mModel->insertDataFormItem(4, HbDataFormModelItem::TextItem, 
+													  QString("Max to be left (B)"), 
+													  mLoadSettings);
+					mMaxAmountToBeLeft->setContentWidgetData("maximum" , 99999999999999);
+					mMaxAmountToBeLeft->setContentWidgetData("minimum", 0);				
+					mMaxAmountToBeLeft->setContentWidgetData( QString("text"),mMemoryEatAttributes.mRandomMax );
+				}
+			}
+			else if (index == EMemoryEatTypeMemoryToEat || index == EMemoryEatTypeMemoryToBeLeft) {
+				// remove two item rows, if exists.
+				if (mMinAmountToBeLeft != NULL) {
+					mModel->removeItem(mMinAmountToBeLeft);
+					mMinAmountToBeLeft = NULL;
+				}
+				if (mMaxAmountToBeLeft != NULL) {
+					mModel->removeItem(mMaxAmountToBeLeft);
+					mMaxAmountToBeLeft = NULL;
+				}
+				// insert one item, if not exists.
+				if (mAmount == NULL) {
+					mAmount	= mModel->insertDataFormItem(3, HbDataFormModelItem::TextItem, 
+													  QString("Amout(B)"), 
+													  mLoadSettings);
+					mAmount->setContentWidgetData("maximum" , 99999999999999);
+					mAmount->setContentWidgetData("minimum", 0);
+					mAmount->setContentWidgetData( QString("text"),mMemoryEatAttributes.mAmount );
+				}				
+			}
+		}
+		default: {
+			break;
+		}
+	}
+}
+
+// ---------------------------------------------------------------------------
--- a/memspyui/group/MemSpyCapabilities.mmh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-CAPABILITY      ReadUserData WriteUserData ReadDeviceData WriteDeviceData SwEvent PowerMgmt
--- a/memspyui/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ b/memspyui/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -11,44 +11,20 @@
 *
 * Contributors:
 *
-* Description:
+* Description:  
 *
 */
 
-
 #include <platform_paths.hrh>
-#include "../memspywindowserverhelper/group/bld.inf"
 
-PRJ_EXPORTS
-../data/MemSpyEComInterfaceIds.xml                      z:/private/2002129F/memspyecominterfaceids.xml
-../data/MemSpyProcessMemoryTrackingAutoStartConfig.xml	z:/private/2002129F/memspyprocessmemorytrackingautostartconfig.xml
-../data/backup_registration.xml							z:/private/2002129F/backup_registration.xml
-../rom/memspyui.iby                                     CORE_IBY_EXPORT_PATH(tools,memspyui.iby)
+prj_platforms
 
-
-PRJ_MMPFILES
-memspyui.mmp
-
-#ifndef SBSV2
-  gnumakefile memspyui_icons_aif.mk
+WINSCW GCCE ARMV5 ARMV6
 
-  #ifdef MARM
-  gnumakefile memspyui_stub_sis.mk
-  #endif
-#endif
+#include "bld_generic.inf"
+
+#include "../ui/avkon/group/bld.inf"
 
-#ifdef SBSV2
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE memspyui_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_memspyui
-  END
+prj_mmpfiles
 
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME MemSpy_stub
-  END
-  #endif 
-#endif
+prj_extensions
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/group/bld_generic.inf	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <platform_paths.hrh>
+#include "../memspywindowserverhelper/group/bld.inf"
+
+PRJ_EXPORTS
+../data/MemSpyEComInterfaceIds.xml                      z:/private/2002129F/memspyecominterfaceids.xml
+../data/MemSpyProcessMemoryTrackingAutoStartConfig.xml	z:/private/2002129F/memspyprocessmemorytrackingautostartconfig.xml
+../data/backup_registration.xml							z:/private/2002129F/backup_registration.xml
+../rom/memspyui.iby                                     CORE_IBY_EXPORT_PATH(tools,memspyui.iby)
+
+#ifndef SBSV2
+  gnumakefile memspyui_icons_aif.mk
+
+  #ifdef MARM
+  gnumakefile memspyui_stub_sis.mk
+  #endif
+#endif
+
+#ifdef SBSV2
+  PRJ_EXTENSIONS
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE memspyui_aif.mif
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES -c8,8 qgn_menu_memspyui
+  END
+
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME MemSpy_stub
+  END
+  #endif 
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/group/group.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+#
+
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_platforms += "$${LITERAL_HASH}include \"bld_generic.inf\""
--- a/memspyui/group/memspyui.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include <bldvariant.hrh>
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-TARGET          memspyui.exe
-TARGETTYPE      exe
-UID             0x100039CE 0x2002129F
-VENDORID		VID_DEFAULT
-SMPSAFE
-
-EPOCSTACKSIZE	0x4000
-EPOCHEAPSIZE	0x100000 0x4000000
-
-#include		"MemSpyCapabilities.mmh"
-
-SOURCEPATH      ../source
-source          MemSpyApp.cpp 
-source          MemSpyAppUi.cpp
-source          MemSpyDocument.cpp
-source          MemSpyContainer.cpp
-source          MemSpyDeviceWideOperationDialog.cpp
-source          MemSpyExportBitmapsToMemoryCardDialog.cpp
-source          MemSpyUiUtils.cpp
-source          MemSpySettings.cpp
-//
-source          MemSpyViewBase.cpp
-source          MemSpyViewMainMenu.cpp
-source          MemSpyViewType.cpp
-source          MemSpyViewProcesses.cpp
-source          MemSpyViewServerList.cpp
-source          MemSpyViewOpenFiles.cpp
-source          MemSpyViewRAMInfo.cpp
-source          MemSpyViewROMInfo.cpp
-source          MemSpyViewFBServBitmaps.cpp
-source          MemSpyViewSystemConfig.cpp
-source          MemSpyViewCodeSegList.cpp
-source          MemSpyViewChunkList.cpp
-source          MemSpyViewKernel.cpp
-source          MemSpyViewKernelContainers.cpp
-source          MemSpyViewKernelHeap.cpp
-source			MemSpyViewDriveInfo.cpp
-source			MemSpyViewECom.cpp
-source          MemSpyViewThreads.cpp
-source          MemSpyViewThreadInfoItemList.cpp
-source          MemSpyViewThreadInfoItemGeneric.cpp
-source          MemSpyViewThreadInfoItemHeap.cpp
-source          MemSpyViewThreadInfoItemStack.cpp
-source          MemSpyViewThreadInfoItemCodeSeg.cpp
-source          MemSpyViewThreadInfoItemChunk.cpp
-source          MemSpyViewThreadInfoItemServer.cpp
-source          MemSpyViewThreadInfoItemActiveObject.cpp
-source          MemSpyViewThreadInfoItemGeneralInfo.cpp
-source          MemSpyViewHeapTracking.cpp
-source          MemSpyViewHeapTrackingResults.cpp
-source          MemSpyViewHeapTrackingSettings.cpp
-source			MemSpyViewThreadInfoItemMemoryTracking.cpp
-source			MemSpyViewMemoryTrackingAutoStartConfig.cpp
-source			MemSpyViewWindowGroups.cpp
-source          MemSpyViewKernelObjects.cpp
-
-USERINCLUDE		../include
-
-APP_LAYER_SYSTEMINCLUDE
-
-
-START RESOURCE    ../data/memspyui.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../data/memspyui_reg.rss
-DEPENDS           memspyui.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-
-LIBRARY			fbscli.lib				imageconversion.lib		estor.lib		apgrfx.lib
-LIBRARY			euser.lib				apparc.lib				cone.lib		eikcore.lib 
-LIBRARY			eikcoctl.lib			avkon.lib				etext.lib		eikctl.lib		
-LIBRARY			efsrv.lib				bafl.lib				egul.lib		hal.lib
-LIBRARY			cdlengine.lib			xmlframework.lib		charconv.lib	viewcli.lib
-LIBRARY			eikdlg.lib				ws32.lib				bitgdi.lib
-
-LIBRARY			memspydriverclient.lib
-LIBRARY			memspyengine.lib 
-
--- a/memspyui/include/MemSpy.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPY_HRH
-#define MEMSPY_HRH
-
-#define KMemSpyMenuCommandBase 50000
-#define KMemSpyMenuCommandViewSpecific (KMemSpyMenuCommandBase + 10000)
-
-enum TMemSpyCommandIds
-    {
-	////////////////////////////////
-	// GENERIC MENU COMMANDS
-	////////////////////////////////
-	EMemSpyCmdOpen = KMemSpyMenuCommandBase,
-    //
-    EMemSpyCmdView,
-	EMemSpyCmdViewRefresh,
-	EMemSpyCmdViewOutputToSink,
-    //
-    EMemSpyCmdTools,
-    EMemSpyCmdToolsListOpenFiles,
-	EMemSpyCmdToolsAbout,
-    //
-    EMemSpyCmdPhoneInfo,
-	EMemSpyCmdPhoneInfoGeneral,
-    EMemSpyCmdPhoneInfoGeneralSummary,
-	EMemSpyCmdPhoneInfoGeneralDetailed,
-	EMemSpyCmdPhoneInfoGeneralHandles,
-	EMemSpyCmdPhoneInfoGeneralKernelContainers,
-	EMemSpyCmdPhoneInfoHeap,
-	EMemSpyCmdPhoneInfoHeapInfoSummary,
-    EMemSpyCmdPhoneInfoHeapInfoCompact,
-	EMemSpyCmdPhoneInfoHeapCellListing,
-	EMemSpyCmdPhoneInfoHeapDump,
-    EMemSpyCmdPhoneInfoStack,
-	EMemSpyCmdPhoneInfoStackInfo,
-    EMemSpyCmdPhoneInfoStackInfoCompact,
-	EMemSpyCmdPhoneInfoStackDumpUser,
-	EMemSpyCmdPhoneInfoStackDumpKernel,
-    //
-    EMemSpyCmdAutoCapture,
-    EMemSpyCmdAutoCaptureToggle,
-    EMemSpyCmdAutoCaptureRetryTime,
-    EMemSpyCmdAutoCaptureOperationType,
-	
-	////////////////////////////////
-	// VIEW SPECIFIC MENU COMMANDS
-	////////////////////////////////
-    EMemSpyCmdProcess = KMemSpyMenuCommandViewSpecific,
-	EMemSpyCmdProcessInfo,
-	EMemSpyCmdProcessInfoSummary,
-	EMemSpyCmdProcessInfoHandles,
-    EMemSpyCmdProcessSort,
-    EMemSpyCmdProcessSortById,
-    EMemSpyCmdProcessSortByName,
-    EMemSpyCmdProcessSortByThreadCount,
-    EMemSpyCmdProcessSortByCodeSegs,
-    EMemSpyCmdProcessSortByHeapUsage,
-    EMemSpyCmdProcessSortByStackUsage,
-    EMemSpyCmdProcessEnd,
-    EMemSpyCmdProcessEndKill,
-    EMemSpyCmdProcessEndPanic,
-    EMemSpyCmdProcessEndTerminate,
-    //
-    EMemSpyCmdThread,
-    EMemSpyCmdThreadEnd,
-    EMemSpyCmdThreadEndKill,
-    EMemSpyCmdThreadEndPanic,
-    EMemSpyCmdThreadEndTerminate,
-    EMemSpyCmdThreadSetPriority,
-	EMemSpyCmdThreadSetPriorityAbsoluteVeryLow,
-	EMemSpyCmdThreadSetPriorityAbsoluteLowNormal,
-	EMemSpyCmdThreadSetPriorityAbsoluteLow,
-	EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal,
-	EMemSpyCmdThreadSetPriorityAbsoluteBackground,
-	EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal,
-	EMemSpyCmdThreadSetPriorityAbsoluteForeground,
-	EMemSpyCmdThreadSetPriorityAbsoluteHighNormal,
-	EMemSpyCmdThreadSetPriorityAbsoluteHigh,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime1,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime2,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime3,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime4,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime5,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime6,
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime7, 
-	EMemSpyCmdThreadSetPriorityAbsoluteRealTime8,
-	EMemSpyCmdThreadInfo,
-	EMemSpyCmdThreadInfoHandles,
-    //
-    EMemSpyCmdOutput,
-    EMemSpyCmdOutputToDebug,
-    EMemSpyCmdOutputToFile,
-    //
-    EMemSpyCmdHeap,
-    EMemSpyCmdHeapInfoThread,
-    EMemSpyCmdHeapData,
-    EMemSpyCmdHeapCellListing,
-    EMemSpyCmdHeapDataDump,
-    //
-    EMemSpyCmdStack,
-    EMemSpyCmdStackInfoThread,
-    EMemSpyCmdStackData,
-    EMemSpyCmdStackDataUser,
-    EMemSpyCmdStackDataKernel,
-    //
-    EMemSpyCmdChunk,
-    EMemSpyCmdChunkSort,
-    EMemSpyCmdChunkSortByName,
-    EMemSpyCmdChunkSortBySize,
-    EMemSpyCmdChunkListing,
-    //
-    EMemSpyCmdCodeSeg,
-    EMemSpyCmdCodeSegShow,
-    EMemSpyCmdCodeSegShowItemsAll,
-    EMemSpyCmdCodeSegShowItemsGlobalData,
-    EMemSpyCmdCodeSegShowCaps,
-    EMemSpyCmdCodeSegShowCapsWithTCBProcess,              
-    EMemSpyCmdCodeSegShowCapsWithTCBAll,                  
-    EMemSpyCmdCodeSegShowCapsWithCommDDProcess,           
-    EMemSpyCmdCodeSegShowCapsWithCommDDAll,               
-    EMemSpyCmdCodeSegShowCapsWithPowerMgmtProcess,        
-    EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll,            
-    EMemSpyCmdCodeSegShowCapsWithMultimediaDDProcess,     
-    EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll,         
-    EMemSpyCmdCodeSegShowCapsWithReadDeviceDataProcess,   
-    EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll,       
-    EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataProcess,  
-    EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll,      
-    EMemSpyCmdCodeSegShowCapsWithDRMProcess,              
-    EMemSpyCmdCodeSegShowCapsWithDRMAll,                  
-    EMemSpyCmdCodeSegShowCapsWithTrustedUIProcess,        
-    EMemSpyCmdCodeSegShowCapsWithTrustedUIAll,            
-    EMemSpyCmdCodeSegShowCapsWithProtServProcess,         
-    EMemSpyCmdCodeSegShowCapsWithProtServAll,             
-    EMemSpyCmdCodeSegShowCapsWithDiskAdminProcess,        
-    EMemSpyCmdCodeSegShowCapsWithDiskAdminAll,            
-    EMemSpyCmdCodeSegShowCapsWithNetworkControlProcess,   
-    EMemSpyCmdCodeSegShowCapsWithNetworkControlAll,       
-    EMemSpyCmdCodeSegShowCapsWithAllFilesProcess,         
-    EMemSpyCmdCodeSegShowCapsWithAllFilesAll,             
-    EMemSpyCmdCodeSegShowCapsWithSwEventProcess,          
-    EMemSpyCmdCodeSegShowCapsWithSwEventAll,              
-    EMemSpyCmdCodeSegShowCapsWithNetworkServicesProcess,  
-    EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll,      
-    EMemSpyCmdCodeSegShowCapsWithLocalServicesProcess,    
-    EMemSpyCmdCodeSegShowCapsWithLocalServicesAll,        
-    EMemSpyCmdCodeSegShowCapsWithReadUserDataProcess,     
-    EMemSpyCmdCodeSegShowCapsWithReadUserDataAll,         
-    EMemSpyCmdCodeSegShowCapsWithWriteUserDataProcess,    
-    EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll,        
-    EMemSpyCmdCodeSegShowCapsWithLocationProcess,         
-    EMemSpyCmdCodeSegShowCapsWithLocationAll,             
-    EMemSpyCmdCodeSegShowCapsWithSurroundingsDDProcess,   
-    EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll,       
-    EMemSpyCmdCodeSegShowCapsWithUserEnvProcess,          
-    EMemSpyCmdCodeSegShowCapsWithUserEnvAll,              
-    EMemSpyCmdCodeSegSort,
-    EMemSpyCmdCodeSegSortByName,
-    EMemSpyCmdCodeSegSortByCodeSize,
-    EMemSpyCmdCodeSegSortByDataSize,
-    EMemSpyCmdCodeSegSortByUid,
-    EMemSpyCmdCodeSegListing,
-    //
-    EMemSpyCmdImages,
-    EMemSpyCmdImagesSlideshow,
-    EMemSpyCmdImagesSaveAllToMemoryCard,
-    EMemSpyCmdImagesListing,
-    //
-    EMemSpyCmdActiveObject,
-    EMemSpyCmdActiveObjectListing,
-    //
-    EMemSpyCmdServerList,
-    EMemSpyCmdServerListOutput,
-    EMemSpyCmdServerListOutputListCSV,
-    EMemSpyCmdServerListOutputListDetailed,
-    EMemSpyCmdServerListSort,
-    EMemSpyCmdServerListSortByName,
-    EMemSpyCmdServerListSortBySessionCount,
-    //
-    EMemSpyCmdKernelContainers,
-    EMemSpyCmdKernelContainersOutput,
-    EMemSpyCmdKernelObjects,
-    EMemSpyCmdKernelObjectTerminate,
-    EMemSpyCmdKernelObjectSwitchTo,
-    EMemSpyCmdKernelObjectEnd,
-    EMemSpyCmdKernelObjectPanic,
-    
-    //
-    EMemSpyCmdKernelHeap,
-    EMemSpyCmdKernelHeapDump,
-    //
-    EMemSpyCmdRAM,
-    EMemSpyCmdRAMAvkonIconCacheDisabled,
-    EMemSpyCmdRAMAvkonIconCacheEnabled,
-    //
-    EMemSpyCmdBTrace,
-    EMemSpyCmdBTraceCaptureToggle,
-    //
-    EMemSpyCmdMemoryTracking,
-    EMemSpyCmdMemoryTrackingStart,
-    EMemSpyCmdMemoryTrackingStop,
-    EMemSpyCmdMemoryTrackingAutoStart,
-    EMemSpyCmdMemoryTrackingAutoStartItemAdd,
-    EMemSpyCmdMemoryTrackingAutoStartItemEdit,
-    EMemSpyCmdMemoryTrackingAutoStartItemDelete,
-    EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll,
-    EMemSpyCmdMemoryTrackingAutoStartItemImport,
-    EMemSpyCmdMemoryTrackingHWM,
-    EMemSpyCmdMemoryTrackingHWMReset,
-    EMemSpyCmdMemoryTrackingTotalWithSharedMem,
-    EMemSpyCmdMemoryTrackingTotalWithoutSharedMem,
-
-    //
-    EMemSpyCmdWindowGroups,
-    EMemSpyCmdWindowGroupTerminate,
-    EMemSpyCmdWindowGroupSwitchTo,
-    EMemSpyCmdWindowGroupEnd,
-    EMemSpyCmdWindowGroupPanic
-    };
-
-enum TMemSpyControlIds
-    {
-    EMemSpyCtrlIdProgressNote = 1000,
-    EMemSpyCtrlIdSlideShowImage,
-    EMemSpyCtrlIdWaitNote
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyApp.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYAPP_H
-#define MEMSPYAPP_H
-
-// System includes
-#include <aknapp.h>
-
-// Constants
-const TUid KUidMemSpy = { 0x2002129F };
-
-
-class CMemSpyApp : public CAknApplication
-    {
-private: // From CApaApplication
-    CApaDocument* CreateDocumentL();
-    TUid AppDllUid() const;
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyAppUi.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYAPPUI_H
-#define MEMSPYAPPUI_H
-
-// System includes
-#include <eikapp.h>
-#include <eikdoc.h>
-#include <e32std.h>
-#include <coeccntx.h>
-#include <aknappui.h>
-#include <coecobs.h>
-
-// User includes
-#include "MemSpyDeviceWideOperationDialog.h"
-#include "MemSpyContainerObserver.h"
-#include <memspy/engine/memspyengineobserver.h>
-
-// Classes referenced
-class CEikMenuBar;
-class CMemSpyEngine;
-class CMemSpyContainer;
-class CMemSpyDocument;
-
-
-class CMemSpyAppUi : public CAknAppUi, public MMemSpyContainerObserver, public MCoeControlObserver, public MMemSpyEngineObserver, public MMemSpyDeviceWideOperationDialogObserver
-    {
-public:
-    CMemSpyAppUi( CMemSpyEngine& aEngine );
-    ~CMemSpyAppUi();
-    void ConstructL();
-
-public: // API
-    CMemSpyDocument& MemSpyDocument();
-    const CMemSpyDocument& MemSpyDocument() const;
-    inline CMemSpyContainer& Container() { return *iAppContainer; }
-
-private: // From Avkon
-    void HandleStatusPaneSizeChange();
-
-private: // From MCoeControlObserver
-    void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
-
-private: // From MEikMenuObserver
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // From CEikAppUi
-	void HandleForegroundEventL(TBool aForeground);
-    void HandleCommandL(TInt aCommand);
-    TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-private: // From MMemSpyContainerObserver
-    void HandleThreadSelectedL( const CMemSpyThread& aThread );
-
-private: // From MMemSpyEngineObserver
-    void HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext );
-
-private: // From MMemSpyDeviceWideOperationDialogObserver
-    void DWOperationStarted();
-    void DWOperationCancelled();
-    void DWOperationCompleted();
-
-private: // Internal methods
-    void UpdateCBAL();
-    void InitiateMemSpyClientServerOperationL( TInt aOpCode );
-    void SetViewServerTimeOutStatus( TBool aEnabled );
-    
-private: // Command handlers
-    void OnCmdBackL();
-    void OnCmdExitL();
-    void OnCmdOpenL();
-    void OnCmdAboutL();
-
-    // Output
-    void OnCmdOutputToDebugL();
-    void OnCmdOutputToFileL();
- 
-    // Phone-information
-    void OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::TOperation aOp );
-    void OnCmdPhoneInformationOperationKernelContainersL();
-    
-    // Automatic capture
-    void OnCmdAutoCaptureToggleL();
-    void OnCmdAutoCaptureRetryTimeL();
-    void OnCmdAutoCaptureOperationTypeL();
-
-    // Misc
-    void OnCmdToolsBitmapsSaveToMemoryCardL();
-    void OnCmdToolsSendToBackgroundL();
-    void OnCmdToolsBringToForegroundL();
-
-private: // Auto capture related
-    static TInt AutoCaptureCallBack( TAny* aSelf );
-    void AutoCaptureCallBackL();
-
-private: // Member data
-    CMemSpyEngine& iEngine;
-    CMemSpyContainer* iAppContainer;
-    
-    // For phone information dialog
-    TBool iRunningDeviceWideOperation;
-    
-    // For auto-capture
-    TInt iAutoCaptureTimerPeriod;
-    CMemSpyDeviceWideOperations::TOperation iAutoCaptureOperationType;
-    CPeriodic* iAutoCaptureTimer;
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYCONTAINER_H
-#define MEMSPYCONTAINER_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-#include "MemSpyViewObserver.h"
-
-// Classes referenced
-class CMemSpyEngine;
-class CMemSpyProcess;
-class CMemSpyThread;
-class CMemSpyThreadInfoItemBase;
-class CMemSpyEngineObjectContainer;
-class MMemSpyContainerObserver;
-
-
-class CMemSpyContainer : public CCoeControl, public MMemSpyViewObserver
-    {
-public:
-    CMemSpyContainer( CMemSpyEngine& aEngine, MMemSpyContainerObserver& aObserver );
-    ~CMemSpyContainer();
-    void ConstructL( const TRect& aRect );
-
-public: // API
-    inline TMemSpyViewType ActiveViewType() const { return iActiveView->ViewType(); }
-    inline CMemSpyViewBase& ActiveView() const { return *iActiveView; }
-
-public: // API
-    void NavigateToParentViewL();
-    void NavigateToChildViewL();
-    void HandleCommandL( TInt aCommand );
-    void SetNewActiveViewL( CMemSpyViewBase* aNewView );
-
-public: // Command handlers
-    void OnCmdViewRefreshL();
-
-private: // From CCoeControl
-    void SizeChanged();
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl(TInt aIndex) const;
-    void Draw(const TRect& aRect) const;
-	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-private: // From MMemSpyViewObserver
-    void HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType aViewType, CMemSpyViewBase& aReportingView, TAny* aContext );
-
-private: // Internal methods
-    CMemSpyViewBase* PrepareTopLevelViewL();
-
-private: // Member data
-    CMemSpyEngine& iEngine;
-    MMemSpyContainerObserver& iObserver;
-    CMemSpyViewBase* iActiveView;
-    CMemSpyViewBase* iPreviousView;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyContainerObserver.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYCONTAINEROBSERVER_H
-#define MEMSPYCONTAINEROBSERVER_H
-
-// Classes referenced
-class CMemSpyThread;
-
-
-class MMemSpyContainerObserver
-    {
-public:
-    virtual void HandleThreadSelectedL( const CMemSpyThread& aThread ) = 0;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyDeviceWideOperationDialog.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYDEVICEWIDEOPERATIONDIALOG_H
-#define MEMSPYDEVICEWIDEOPERATIONDIALOG_H
-
-// System includes
-#include <AknProgressDialog.h>
-#include <AknWaitDialog.h>
-
-// Engine includes
-#include <memspy/engine/memspydevicewideoperations.h>
-
-// Classes referenced
-class CMemSpyEngine;
-
-class MMemSpyDeviceWideOperationDialogObserver
-    {
-public:
-    virtual void DWOperationStarted() = 0;
-    virtual void DWOperationCancelled() = 0;
-    virtual void DWOperationCompleted() = 0;
-    };
-
-
-class CMemSpyDeviceWideOperationDialog : public CBase, public MProgressDialogCallback, public MMemSpyDeviceWideOperationsObserver
-    {
-public:
-    static void ExecuteLD( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation );
-    ~CMemSpyDeviceWideOperationDialog();
-
-private:
-    CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver );
-    void ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation );
-
-public: // API
-    void Cancel();
-
-private: // From MProgressDialogCallback
-    void DialogDismissedL( TInt aButtonId );
-
-private: // From MMemSpyDeviceWideOperationsObserver
-    void HandleDeviceWideOperationEvent( TEvent aEvent, TInt aParam1, const TDesC& aParam2 );
-
-private: // Internal methods
-    void SetDialogCaptionL( const TDesC& aText );
-
-private: // Member data
-    CMemSpyEngine& iEngine;
-    MMemSpyDeviceWideOperationDialogObserver& iObserver;
-    TBool iForcedCancel;
-    CEikProgressInfo* iProgressInfo;
-    CAknProgressDialog* iProgressDialog;
-    CMemSpyDeviceWideOperations* iOperation;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyDocument.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYDOCUMENT_H
-#define MEMSPYDOCUMENT_H
-
-// System includes
-#include <AknDoc.h>
-   
-// Classes referenced
-class CMemSpyEngine;
-class CEikAppUi;
-class CMemSpySettings;
-
-
-class CMemSpyDocument : public CAknDocument
-    {
-public: // Constructors and destructor
-    static CMemSpyDocument* NewL(CEikApplication& aApp);
-    ~CMemSpyDocument();
-
-private:
-    CMemSpyDocument(CEikApplication& aApp);
-    void ConstructL();
-
-public:
-    CMemSpyEngine& Engine();
-    const CMemSpyEngine& Engine() const;
-    CMemSpySettings& Settings();
-    const CMemSpySettings& Settings() const;
-
-private: // Framework
-    CEikAppUi* CreateAppUiL();
-
-private: // Data members
-    CMemSpyEngine* iEngine;
-    CMemSpySettings* iSettings;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyExportBitmapsToMemoryCardDialog.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYEXPORTBITMAPSTOMEMORYCARDDIALOG_H
-#define MEMSPYEXPORTBITMAPSTOMEMORYCARDDIALOG_H
-
-// System includes
-#include <AknProgressDialog.h>
-#include <AknWaitDialog.h>
-#include <imageconversion.h>
-
-// Classes referenced
-class CMemSpyEngineFbServBitmap;
-class CMemSpyEngineFbServBitmapArray;
-
-
-
-class CMemSpyExportBitmapsToMemoryCardDialog : public CActive, public MProgressDialogCallback
-    {
-public:
-    static CMemSpyExportBitmapsToMemoryCardDialog* NewL( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps );
-    ~CMemSpyExportBitmapsToMemoryCardDialog();
-
-private:
-    CMemSpyExportBitmapsToMemoryCardDialog( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps );
-    void ConstructL();
-
-public: // API
-    void Cancel();
-    static TBool CheckMemoryCardAvailableL( RFs& aFsSession );
-
-private: // From CActive
-    void RunL();
-    void DoCancel();
-    TInt RunError(TInt aError);
-
-private: // From MProgressDialogCallback
-    void DialogDismissedL( TInt aButtonId );
-
-private: // Internal methods
-    void CompleteSelf( TInt aError );
-    void ExportBitmapL( const CMemSpyEngineFbServBitmap& aBitmap );
-    void IdentifyBmpMimeTypeL();
-    void PruneExistingBitmapFilesL();
-    void PrepareFolderNameSpecL();
-    TBool TryToExportSingleBitmapL();
-
-private: // Member data
-    RFs& iFsSession;
-    const CMemSpyEngineFbServBitmapArray& iBitmaps;
-    TInt iBitmapIndex;
-    TBool iDialogDismissed;
-    CEikProgressInfo* iProgressInfo;
-    CAknProgressDialog* iProgressDialog;
-    CImageEncoder* iEncoder;
-    HBufC8* iBmpMimeType;
-    HBufC* iFolderName;
-    RFileExtensionMIMETypeArray iMimeTypeArray;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpySettings.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYSETTINGS_H
-#define MEMSPYSETTINGS_H
-
-// System includes
-#include <e32base.h>
-#include <badesca.h>
-#include <f32file.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineoutputsink.h>
-
-// Classes referenced
-class CMemSpyEngine;
-
-
-class CMemSpySettings : public CBase
-    {
-public:
-    static CMemSpySettings* NewL( RFs& aFsSession, CMemSpyEngine& aEngine );
-    ~CMemSpySettings();
-
-private:
-    CMemSpySettings( RFs& aFsSession, CMemSpyEngine& aEngine );
-    void ConstructL();
-
-public: // API
-    inline RFs& FsSession() { return iFsSession; }
-    void StoreSettingsL();
-
-private: // Settings methods
-    void RestoreSettingsL();
-    void GetSettingsFileNameL( TDes& aFileName );
-    void GetSettingsPathL( TDes& aPath );
-    RFile SettingsFileLC( TBool aReplace = EFalse );
-
-private: // Data members
-    RFs& iFsSession;
-    CMemSpyEngine& iEngine;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyUiUtils.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYUIUTILS_H
-#define MEMSPYUIUTILS_H
-
-// System includes
-#include <e32std.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineutils.h>
-
-
-class MemSpyUiUtils : public MemSpyEngineUtils
-    {
-public:
-    static void Format( TDes& aBuf, TInt aResourceId, ...);
-    static void GetErrorText( TDes& aBuf, TInt aError );
-    };
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewBase.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWBASE_H
-#define MEMSPYVIEWBASE_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <memspyui.rsg>
-
-// User includes
-#include "MemSpy.hrh"
-#include "MemSpyViewType.h"
-#include "MemSpyViewObserver.h"
-#include "MemSpySettings.h"
-
-// Classes referenced
-class CMemSpyEngine;
-class CMemSpyContainer;
-class MMemSpyViewObserver;
-
-
-class CMemSpyViewBase : public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver
-    {
-public:
-    CMemSpyViewBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewBase();
-    virtual void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // API
-    virtual TMemSpyViewType ViewType() const = 0;
-    virtual CMemSpyViewBase* PrepareParentViewL();
-    virtual CMemSpyViewBase* PrepareChildViewL();
-    virtual void RefreshL();
-    virtual TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-    virtual TUint MenuCascadeResourceId() const;
-    virtual TInt MenuCascadeCommandId() const;
-
-private: // Command handlers
-    virtual void OnCmdViewOutputToSinkL();
-
-protected: // Construction support
-    void SetTitleL( const TDesC& aText );
-    TPtrC TitleL() const;
-    virtual CEikListBox* ConstructListBoxL();
-    virtual void SetListBoxModelL() = 0;
-
-protected: // Internal framework
-    virtual void HandleListBoxItemActionedL( TInt aIndex );
-    virtual void HandleListBoxItemSelectedL( TInt aIndex );
- 
-protected: // Event reporting
-    void ReportEventL( MMemSpyViewObserver::TViewEventType aEvent, TAny* aContext = NULL );
-    void SetListBoxCurrentItemIndexL( TInt aIndex );
-
-protected: // Utility methods
-    CMemSpyContainer& Container();
-    CMemSpySettings& Settings();
-    const CMemSpySettings& Settings() const;
-
-public: // From CCoeControl
-	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-protected: // From CCoeControl
-    void Draw( const TRect& aRect ) const;
-    void SizeChanged();
-    void FocusChanged( TDrawNow aDrawNow );
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl( TInt aIndex ) const;
-
-protected: // From MCoeControlObserver
-    void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
-
-protected: // From MEikListBoxObserver
-    void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType);
-
-protected: // Member data
-    CMemSpyEngine& iEngine;
-    MMemSpyViewObserver& iObserver;
-    //
-    CEikListBox* iListBox;
-
-private:
-    CMemSpySettings* iSettings;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewChunkList.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWCHUNKLIST_H
-#define MEMSPYVIEWCHUNKLIST_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineChunkList;
-class CMemSpyEngineChunkEntry;
-
-
-
-
-class CMemSpyViewChunkBase : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewChunkBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList* aList );
-    ~CMemSpyViewChunkBase();
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_CHUNK_LIST; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdChunk; }
-
-protected: // Command handlers
-    void OnCmdListingL();
-
-protected: // Data members
-    CMemSpyEngineChunkList* iList;
-    };
-
-
-
-
-class CMemSpyViewChunkList : public CMemSpyViewChunkBase
-    {
-public:
-    CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineChunkEntry* iCurrentChunk;
-    };
-
-
-
-class CMemSpyViewChunkDetails : public CMemSpyViewChunkBase
-    {
-public:
-    CMemSpyViewChunkDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList, CMemSpyEngineChunkEntry& aSelectedChunk );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Data members
-    CMemSpyEngineChunkEntry& iChunk;
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewCodeSegList.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWCODESEGLIST_H
-#define MEMSPYVIEWCODESEGLIST_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineCodeSegList;
-class CMemSpyEngineCodeSegEntry;
-
-
-class CMemSpyViewCodeSegBase : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewCodeSegBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList* aList );
-    ~CMemSpyViewCodeSegBase();
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    void RefreshL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_CODESEG_LIST; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdCodeSeg; }
-
-protected: // Command handlers
-    void OnCmdCodeSegmentListingL();
-    void OnCmdShowItemsAllL();
-    void OnCmdShowItemsGlobalDataL();
-    void OnCmdFilterByCapabilityL( TCapability aCapability, TBool aAllBinaries );
-
-protected: // Data members
-    CMemSpyEngineCodeSegList* iList;
-    };
-
-
-
-
-class CMemSpyViewCodeSegList : public CMemSpyViewCodeSegBase
-    {
-public:
-    CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineCodeSegEntry* iCurrentCodeSegment;
-    };
-
-
-
-class CMemSpyViewCodeSegDetails : public CMemSpyViewCodeSegBase
-    {
-public:
-    CMemSpyViewCodeSegDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList, CMemSpyEngineCodeSegEntry& aSelectedCodeSegment );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Data members
-    CMemSpyEngineCodeSegEntry& iCodeSegment;
-    };
-
-
-
-
-
-
-class TMemSpyViewCodeSegFilter
-    {
-public:
-    inline TMemSpyViewCodeSegFilter( TCapability aCapability, TBool aAllBinaries = ETrue )
-    :   iCapability( aCapability ), iAllBinaries( aAllBinaries )
-        {
-        }
-
-public:
-    static TBool FilterItem( const CMemSpyEngineCodeSegEntry*& aItem, TAny* aRune );
-
-private:
-    TCapability iCapability;
-    TBool iAllBinaries;
-    };
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewDriveInfo.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWDRIVEINFO_H
-#define MEMSPYVIEWDRIVEINFO_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyenginehelperfilesystem.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-
-
-class CMemSpyViewDriveInfoBase : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewDriveInfoBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewDriveInfoBase();
-    void BaseConstructL();
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-protected: // Data members
-    CMemSpyEngineDriveList* iList;
-    };
-
-
-
-
-class CMemSpyViewDriveList : public CMemSpyViewDriveInfoBase, public MMemSpyEngineDriveListObserver
-    {
-public:
-    CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void RefreshL();
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // From MMemSpyEngineDriveListObserver
-    void HandleDriveListChangedL( const CMemSpyEngineDriveList& aList );
-
-private: // Data members
-    TBool iUseDriveNumber;
-    TDriveNumber iDriveNumber;
-    CMemSpyEngineDriveEntry* iCurrentDrive;
-    };
-
-
-
-class CMemSpyViewDriveInfo : public CMemSpyViewDriveInfoBase, public MMemSpyEngineDriveEntryObserver
-    {
-public:
-    CMemSpyViewDriveInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineDriveEntryObserver
-    void HandleDriveEntryChangedL( const CMemSpyEngineDriveEntry& aEntry );
-
-private: // Data members
-    const TDriveNumber iDriveNumber;
-    CMemSpyEngineDriveEntry* iDriveInfo;
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewECom.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWECOM_H
-#define MEMSPYVIEWECOM_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <eikimage.h>
-#include <AknDialog.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Engine includes
-#include <memspy/engine/memspyenginehelperecom.h>
-
-
-class CMemSpyViewECom : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewECom( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineEComCategory* iCurrent;
-    };
-
-
-
-class CMemSpyViewEComCategory : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewEComCategory( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComCategory& aCategory );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineEComCategory& iCategory;
-    CMemSpyEngineEComInterface* iCurrent;
-    };
-
-
-
-
-class CMemSpyViewEComInterface : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewEComInterface( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComInterface& aInterface );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineEComInterface& iInterface;
-    CMemSpyEngineEComImplementation* iCurrent;
-    };
-
-
-
-
-
-
-class CMemSpyViewEComImplementation : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewEComImplementation( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComImplementation& aImplementation );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Data members
-    CMemSpyEngineEComImplementation& iImplementation;
-    };
-
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewFBServBitmaps.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWFBSERVBITMAPS_H
-#define MEMSPYVIEWFBSERVBITMAPS_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <eikimage.h>
-#include <AknDialog.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Engine includes
-#include <memspy/engine/memspyenginehelperfbserv.h>
-
-
-
-class CMemSpyViewFBServBase : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewFBServBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps );
-    ~CMemSpyViewFBServBase();
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_IMAGES; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdImages; }
-
-protected: // Command handlers
-    void OnCmdSlideShowL();
-    void OnCmdExportToMemoryCardL();
-    void OnCmdImageListingL();
-
-protected: // Data members
-    CMemSpyEngineFbServBitmapArray* iBitmaps;
-    };
-
-
-
-
-
-class CMemSpyViewFBServBitmaps : public CMemSpyViewFBServBase, public MMemSpyEngineFbSerbBitmapArrayObserver
-    {
-public:
-    CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps );
-    ~CMemSpyViewFBServBitmaps();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From MMemSpyEngineFbSerbBitmapArrayObserver
-    void HandleFbServBitmapArrayEventL( TEvent aEvent );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-
-private: // Idle timer update
-    static TInt IdleUpdateListBoxModel( TAny* aSelf );
-    void DoIdleUpdateListBoxModelL();
-
-private: // Data members
-    RArray<TInt> iBitmapHandles;
-    CMemSpyEngineFbServBitmap* iCurrentBitmap;
-    CPeriodic* iIdleResetListboxTimer;
-    };
-
-
-
-class CMemSpyViewFBServBitmapInfo : public CMemSpyViewFBServBase
-    {
-public:
-    CMemSpyViewFBServBitmapInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-
-private: // Data members
-    CMemSpyEngineFbServBitmap& iBitmapObject;
-    };
-
-
-
-
-class CMemSpyViewFBServBitmapViewer : public CMemSpyViewFBServBase
-    {
-public:
-    CMemSpyViewFBServBitmapViewer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap );
-    ~CMemSpyViewFBServBitmapViewer();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    CEikListBox* ConstructListBoxL();
-
-private: // From CCoeControl
-    void Draw(const TRect& aRect) const;
-    void SizeChanged();
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl( TInt aIndex ) const;
-
-private: // Data members
-    CMemSpyEngineFbServBitmap& iBitmapObject;
-    CEikImage* iImage;
-    TRect iBorderRect;
-    };
-
-
-
-
-
-class CMemSpyViewFBServSlideshow : public CAknDialog
-    {
-public:
-    static void NewLD( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex );
-    ~CMemSpyViewFBServSlideshow();
-
-private:
-    CMemSpyViewFBServSlideshow( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex );
-    void ConstructL();
-
-private:
-    void PreLayoutDynInitL();
-	TBool OkToExitL(TInt aButtonId);
-
-private: // Idle timer update
-    static TInt IdleUpdate( TAny* aSelf );
-    void ShowNextImageL();
-
-private: // Data members
-    CMemSpyEngineFbServBitmapArray& iBitmaps;
-    TInt& iIndex;
-    CPeriodic* iTimer;
-    };
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewHeapTracking.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWHEAPTRACKING_H
-#define MEMSPYVIEWHEAPTRACKING_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerobserver.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewHeapTracking : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
-    {
-public:
-    CMemSpyViewHeapTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewHeapTracking();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public:
-    static TInt AsyncStopTimerCallback( TAny* aParam );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineHelperSysMemTrackerObserver
-    void HandleCyclesResetL();
-    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    
-private: // Internal methods
-    TInt IndexByViewType( TMemSpyViewType aType );
-    void SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode aMode, TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
-    TInt AsyncStopTimerCallback();
-
-private: // Enum
-    enum TMemSpyViewHeapTrackingState
-        {
-        EMemSpyViewHeapTrackingStateIdle = 0,
-        EMemSpyViewHeapTrackingStateTimerOn,
-        EMemSpyViewHeapTrackingStateSingleOn        
-        };
-
-private: // Data
-    TMemSpyEngineHelperSysMemTrackerConfig iOriginalConfig;
-    TMemSpyViewHeapTrackingState iState;
-    CAsyncCallBack* iStopTimerCallBack;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewHeapTrackingResults.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWHEAPTRACKINGRESULTS_H
-#define MEMSPYVIEWHEAPTRACKINGRESULTS_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyenginehelpersysmemtrackerobserver.h>
-
-// Driver includes
-#include <memspy/driver/memspydriverobjectsshared.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineHelperSysMemTrackerCycle;
-class CMemSpyEngineHelperSysMemTrackerCycleChange;
-
-
-class CMemSpyViewHeapTrackingResults : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
-    {
-public:
-    CMemSpyViewHeapTrackingResults( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewHeapTrackingResults();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineHelperSysMemTrackerObserver
-    void HandleCyclesResetL();
-    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    };
-
-
-
-
-
-
-
-class CMemSpyViewHeapTrackingResultsCycleInfo : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
-    {
-public:
-    CMemSpyViewHeapTrackingResultsCycleInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    ~CMemSpyViewHeapTrackingResultsCycleInfo();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineHelperSysMemTrackerObserver
-    void HandleCyclesResetL();
-    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-
-private: // Data members
-    const CMemSpyEngineHelperSysMemTrackerCycle& iCycle;
-    };
-
-
-
-
-
-/*
-class CMemSpyViewHeapTrackingResultsChangeDescriptor : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
-    {
-public:
-    CMemSpyViewHeapTrackingResultsChangeDescriptor( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle, const CMemSpyEngineHelperSysMemTrackerCycleChange& aChangeDescriptor, TInt aIndex );
-    ~CMemSpyViewHeapTrackingResultsChangeDescriptor();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineHelperSysMemTrackerObserver
-    void HandleCyclesResetL();
-    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
-
-private: // Data members
-    const CMemSpyEngineHelperSysMemTrackerCycle& iCycle;
-    const CMemSpyEngineHelperSysMemTrackerCycleChange& iChangeDescriptor;
-    TInt iIndex; // For selection rune when moving to parent view
-    };
-*/
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewHeapTrackingSettings.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWHEAPTRACKINGSETTINGS_H
-#define MEMSPYVIEWHEAPTRACKINGSETTINGS_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <aknsettingitemlist.h> 
-#include <akncheckboxsettingpage.h>
-#include <AknQueryDialog.h> 
-
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewHeapTrackingSettings : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewHeapTrackingSettings( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewHeapTrackingSettings();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Internal methods
-    static void PrepareItemBufL( TDes& aBuf, const TDesC& aCaption, TBool aStatus, TBool aHeapCategorySelected );
-    };
-
-
-
-
-class CSWMTCategorySelectionCheckBoxSettingItem : public CAknSettingItem
-    {
-public:
-    CSWMTCategorySelectionCheckBoxSettingItem( TInt aIdentifier, TInt& aCategories );
-    virtual ~CSWMTCategorySelectionCheckBoxSettingItem();
-
-public:
-    CSelectionItemList* ItemArray() const;
-    
-protected:
-    void CompleteConstructionL();
-    void StoreL();
-    void LoadL();
-    void HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType );
-
-private:
-    void AddNewItemToArrayL(const TDesC& aLabel); 
-    
-private:
-    CSelectionItemList*     iItemArray;
-    HBufC*                  iSettingText;
-    TInt&                   iExtCategories;
-    };
-
-
-
-
-
-
-class CMemSpySWMTCategorySelectionCheckBoxSettingPage : public CAknCheckBoxSettingPage
-    {
-    public:
-        CMemSpySWMTCategorySelectionCheckBoxSettingPage( TInt aResourceID, CSelectionItemList* aItemArray );
-    public:     // New functions
-        void UpdateCba();
-    };
-    
-
-
-
-
-
-class CMemSpyAllowEmptyDataDialog : public CAknTextQueryDialog
-    {
-    public:
-        CMemSpyAllowEmptyDataDialog( TDes& aText, const TTone& aTone = ENoTone );
-    protected: // from CAknTextQueryDialog
-        void UpdateLeftSoftKeyL();
-    };
-
-#endif
--- a/memspyui/include/MemSpyViewKernel.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWKERNEL_H
-#define MEMSPYVIEWKERNEL_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewKernel : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewKernel( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewKernel();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Internal methods
-    static TInt IndexByViewType( TMemSpyViewType aType );
-
-private: // Data members
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewKernelContainers.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWKERNELCONTAINERS_H
-#define MEMSPYVIEWKERNELCONTAINERS_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineGenericKernelObjectContainer;
-
-
-class CMemSpyViewKernelContainers : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewKernelContainers( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewKernelContainers();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_CONTAINERS; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelContainers; }
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    TBool HandleCommandL( TInt aCommand );
-
-private: // Command handlers
-    void OnCmdOutputAllContainerContentsL();
-
-private: // Internal methods
-
-private: // Data members
-    CMemSpyEngineGenericKernelObjectContainer* iModel;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewKernelHeap.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWKERNELHEAP_H
-#define MEMSPYVIEWKERNELHEAP_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineGenericKernelObjectContainer;
-
-
-class CMemSpyViewKernelHeap : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewKernelHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewKernelHeap();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_HEAP; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelHeap; }
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    TBool HandleCommandL( TInt aCommand );
-
-private: // Command handlers
-    void OnCmdDumpKernelHeapL();
-
-private: // Internal methods
-
-private: // Data members
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewKernelObjects.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWKERNELOBJECTS_H
-#define MEMSPYVIEWKERNELOBJECTS_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <AknTabObserver.h> 
-
-// User includes
-#include "MemSpyViewBase.h"
-#include <memspy/driver/memspydriverenumerationsshared.h>
-
-// Classes referenced
-class CMemSpyEngineGenericKernelObjectContainer;
-class CMemSpyEngineGenericKernelObjectList;
-class CAknNavigationDecorator;
-class CAknNavigationControlContainer;
-class CAknTabGroup;
-
-
-class CMemSpyViewKernelObjects : public CMemSpyViewBase, public MAknTabObserver
-    {
-public:
-    CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType );
-    ~CMemSpyViewKernelObjects();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    CEikListBox* ConstructListBoxL();
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_OBJECTS; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelObjects; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    TBool HandleCommandL( TInt aCommand );
-
-private: // From CCoeControl
-    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-
-private: // From MAknTabObserver
-    void TabChangedL( TInt aIndex ); 
-    
-private: // Command handlers
-    void OnCmdTerminateL();
-    void OnCmdSwitchToL();
-    void OnCmdEndL();
-    void OnCmdPanicL();
-
-private: // Internal methods
-    void CreateTabsL();
-    void DetailsL();
-    void AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... );
-
-private: // Data members
-    CMemSpyEngineGenericKernelObjectContainer* iModel;
-    CDesCArrayFlat* iItems;
-    TMemSpyDriverContainerType iObjectType;
-    CMemSpyEngineGenericKernelObjectList* iObjectList;
-    CAknNavigationDecorator* iNavDecorator;
-    CAknNavigationControlContainer* iNavContainer;
-    CAknTabGroup* iTabs;
-    TInt iCurrItemIndex;
-    };
-
-#endif
--- a/memspyui/include/MemSpyViewMainMenu.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWMAINMENU_H
-#define MEMSPYVIEWMAINMENU_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyProcess;
-
-
-class CMemSpyViewMainMenu : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewMainMenu( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Internal methods
-    static TInt IndexByViewType( TMemSpyViewType aType );
-
-private: // Data members
-    };
-
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewMemoryTrackingAutoStartConfig.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
-#define MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <ecom/ecom.h>
-#include <xml/contenthandler.h> // MContentHandler mix in class
-#include <xml/parser.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Literal constants
-_LIT( KMemSpyProcessMemoryTrackingAutoStartConfigSearchPath, "E:\\MemSpy\\" );
-_LIT( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, "MemSpyProcessMemoryTrackingAutoStartConfig.xml" );
-
-// Classes referenced
-class CCnvCharacterSetConverter;
-
-// Namespaces referenced
-using namespace Xml;
-
-
-class CMemSpyViewMemoryTrackingAutoStartConfig : public CMemSpyViewBase, public MContentHandler
-    {
-public:
-    CMemSpyViewMemoryTrackingAutoStartConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewMemoryTrackingAutoStartConfig();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    TBool HandleCommandL( TInt aCommand );
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void SetListBoxModelL();
-    void RefreshL();
-
-public: // Menu framework
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-    TUint MenuCascadeResourceId() const;
-    TInt MenuCascadeCommandId() const;
-
-private: // Command handlers
-    void OnCmdItemAddL();
-    void OnCmdItemEditL();
-    void OnCmdItemDeleteL();
-    void OnCmdItemDeleteAllL();
-    void OnCmdItemImportL();
-
-private: // Internal methods
-    TUid ShowDialogL( TUid aUid );
-    void SaveChangesL();
-    static TUid ValidateProcessUid( const TDesC& aUid );
-
-private: // Internal XML methods
-    void FindXmlInstallTimeL();
-    void FindXmlUserSuppliedL();
-    HBufC* FindEComXmlFileNameLC();
-    void ConvertL( const TDesC8& aInput, TDes16& aOutput );
-    void ParseL( const TDesC& aFileName );
-
-private: // XML helper functions
-    void OnSectionProcessL( const RAttributeArray& aAttributes );
-
-private: // From MContentHandler
-	void OnStartDocumentL( const RDocumentParameters& aDocParam, TInt aErrorCode );
-	void OnEndDocumentL( TInt aErrorCode );
-	void OnStartElementL( const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode );
-	void OnEndElementL( const RTagInfo& aElement, TInt aErrorCode );
-	void OnContentL( const TDesC8& aBytes, TInt aErrorCode );
-	void OnStartPrefixMappingL( const RString& aPrefix, const RString& aUri, TInt aErrorCode );
-	void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode );
-	void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode );
-	void OnSkippedEntityL( const RString& aName, TInt aErrorCode );
-	void OnProcessingInstructionL( const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode );
-	void OnError( TInt aErrorCode );
-	TAny* GetExtendedInterface( const TInt32 aUid );
-
-private: // Data members
-    RArray< TUid > iProcessUids;
-    TInt iParserErrorCode;
-    TInt iCharconvConverterState;
-    TBool iSeenMasterSection;
-    CParser* iParser;
-    CCnvCharacterSetConverter* iConverter;
-    HBufC* iXMLFileNameInstallTime;
-    HBufC* iXMLFileNameUserSupplied;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewObserver.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWOBSERVER_H
-#define MEMSPYVIEWOBSERVER_H
-
-// User includes
-#include "MemSpyViewType.h"
-
-// Classes referenced
-class CMemSpyViewBase;
-
-class MMemSpyViewObserver
-    {
-public: // Enumerations
-    enum TViewEventType
-        {
-        EEventItemActioned = 0,
-        EEventItemSelected
-        };
-
-public: // From MMemSpyViewObserver
-    virtual void HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType aViewType, CMemSpyViewBase& aReportingView, TAny* aContext ) = 0;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewOpenFiles.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWOPENFILES_H
-#define MEMSPYVIEWOPENFILES_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewOpenFiles : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewOpenFiles( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewOpenFiles();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    CEikListBox* ConstructListBoxL();
-    void RefreshL();
-    TBool HandleCommandL( TInt aCommand );
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // Command handlers
-    void OnCmdListOpenFilesL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-
-private: // Internal
-    static TBool CompareTEntryObjects( const TEntry& aLeft, const TEntry& aRight );
-
-private: // Data members
-    RArray<TThreadId> iThreadIds;
-    const TThreadId* iActionedThreadId;
-    RArray<TEntry> iFileNames;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewProcesses.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWPROCESSES_H
-#define MEMSPYVIEWPROCESSES_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyProcess;
-class CAknSearchField;
-
-
-class CMemSpyViewProcesses : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
-    ~CMemSpyViewProcesses();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // API
-    CMemSpyProcess& CurrentProcess() const;
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_PROCESS; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdProcess; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // Command handlers
-
-    // Sorting
-    void OnCmdSortByIdL();
-    void OnCmdSortByNameL();
-    void OnCmdSortByThreadCountL();
-    void OnCmdSortByCodeSegsL();
-    void OnCmdSortByHeapUsageL();
-    void OnCmdSortByStackUsageL();
-
-    // Info
-    void OnCmdInfoSummaryL();
-    void OnCmdInfoHandlesL();
-
-    // Ending
-    void OnCmdEndTerminateL();
-    void OnCmdEndPanicL();
-    void OnCmdEndKillL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void HandleListBoxItemSelectedL( TInt aIndex );
-    
-private: // From CCoeControl
-    void SizeChanged();
-    TInt CountComponentControls() const;
-    CCoeControl* ComponentControl( TInt aIndex ) const;
-	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
-    void FocusChanged( TDrawNow /*aDrawNow*/ );
-
-private: // From MCoeControlObserver
-    void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
-
-private: // Internal methods
-    void SelectListBoxItemByFindTextL();
-
-private: // Data members
-    CMemSpyProcess* iCurrentProcess;
-    CAknSearchField* iSearchField;
-    HBufC* iMatcherBuffer;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewRAMInfo.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWRAMINFO_H
-#define MEMSPYVIEWRAMINFO_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewRAMInfo : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewRAMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_RAM; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdRAM; }
-
-private: // Command handlers
-    void OnCmdSetIconCacheStatusL( TBool aEnabled );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Data members
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewROMInfo.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWROMINFO_H
-#define MEMSPYVIEWROMINFO_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewROMInfo : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewROMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Data members
-    };
-
-
-#endif
-
--- a/memspyui/include/MemSpyViewServerList.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWSERVERLIST_H
-#define MEMSPYVIEWSERVERLIST_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyEngineServerList;
-class CMemSpyEngineServerEntry;
-
-
-class CMemSpyViewServerList : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewServerList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewServerList();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_SERVER_LIST; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdServerList; }
-
-private: // Command handlers
-    void OnCmdServerListSortByNameL();
-    void OnCmdServerListSortBySessionCountL();
-    void OnCmdServerListOutputSummaryL();
-    void OnCmdServerListOutputDetailedL();
-    void OnCmdServerListOutputGenericL( TBool aDetailed );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-
-private: // Data members
-    CMemSpyEngineServerList* iList;
-    const CMemSpyEngineServerEntry* iActionedItem;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewSystemConfig.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWSYSTEMCONFIG_H
-#define MEMSPYVIEWSYSTEMCONFIG_H
-
-// System includes
-#include <hal.h>
-#include <f32file.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewSystemConfig : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewSystemConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewSystemConfig();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Internal enumerations 
-
-    enum TMemSpyDisplayMode
-	    {
-	    ENone,
-	    EGray2,
-	    EGray4,
-	    EGray16,
-	    EGray256,
-	    EColor16,
-	    EColor256,
-	    EColor64K,
-	    EColor16M,
-	    ERgb,
-	    EColor4K,
-	    EColor16MU,
-	    EColor16MA,
-	    EColor16MAP,
-	    EColorLast
-	    };
-
-private: // Internal methods
-    static void GetManufacturer( TDes& aBuf );
-    static void GetDeviceFamily( TDes& aBuf );
-    static void GetCPU( TDes& aBuf );
-    static void GetCPUABI( TDes& aBuf );
-    static void GetStartupReason( TDes& aBuf );
-    static void GetKeyboard( TDes& aBuf );
-    static void GetMachineUid( TDes& aBuf );
-    static void GetDisplayType( TDes& aBuf );
-    static void GetDisplayMode( TDes& aBuf, TMemSpyDisplayMode aMode );
-    //
-    static TInt GetHALValue( HALData::TAttribute aAttribute, TInt& aValue );
-    TInt GetHALValueAsStringL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
-    TInt GetHALValueAsNumericL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL, TInt aWidth = -1 );
-    TInt GetHALValueAsHexL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
-    TInt GetHALValueAsYesNoL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
-    TInt GetHALValueAsDriveLetterL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
-
-private:
-    void AddItemL( const TDesC& aCaption, const TDesC& aValue, const TDesC* aSuffix = NULL );
-    void AddItemL( TDriveNumber aDrive, const TDesC& aCaption, const TDesC* aSuffix = NULL );
-
-private: // Data members
-    CDesCArrayFlat* iModel;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemActiveObject.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMACTIVEOBJECT_H
-#define MEMSPYVIEWTHREADINFOITEMACTIVEOBJECT_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-// Classes referenced
-class CMemSpyEngineActiveObjectArray;
-
-
-
-class CMemSpyViewThreadInfoItemActiveObjectBase : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_ACTIVE_OBJECTS; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdActiveObject; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-protected:
-    CMemSpyEngineActiveObjectArray& ActiveObjectArray() const;
-
-private: // Command handlers
-    void OnCmdWriteAOListingL();
-    };
-
-
-
-class CMemSpyViewThreadInfoItemActiveObject : public CMemSpyViewThreadInfoItemActiveObjectBase
-    {
-public:
-    CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareChildViewL();
-    };
-
-
-
-
-class CMemSpyViewThreadInfoItemActiveObjectDetails : public CMemSpyViewThreadInfoItemActiveObjectBase
-    {
-public:
-    CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress );
-
-public: // From CMemSpyViewBase
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    
-private: // Data members
-    TAny* iObjectAddress;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemChunk.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMCHUNK_H
-#define MEMSPYVIEWTHREADINFOITEMCHUNK_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-
-class CMemSpyViewThreadInfoItemChunk : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-private: // From CMemSpyViewBase
-    CMemSpyViewBase* PrepareChildViewL();
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemCodeSeg.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMCODESEG_H
-#define MEMSPYVIEWTHREADINFOITEMCODESEG_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-
-class CMemSpyViewThreadInfoItemCodeSeg : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-private: // From CMemSpyViewBase
-    CMemSpyViewBase* PrepareChildViewL();
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemGeneralInfo.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
-#define MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-
-class CMemSpyViewThreadInfoItemGeneralInfo : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-
-private: // Command handlers
-    void OnCmdToggleKernelEventHooksL();
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemGeneric.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMGENERIC_H
-#define MEMSPYVIEWTHREADINFOITEMGENERIC_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CAknWaitDialog;
-class CMemSpyProcess;
-class CMemSpyThread;
-class CMemSpyThreadInfoContainer;
-class CMemSpyThreadInfoItemBase;
-
-
-class CMemSpyViewThreadInfoItemGeneric : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType );
-    ~CMemSpyViewThreadInfoItemGeneric();
-
-public: // From CMemSpyViewBase
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // API
-    CMemSpyProcess& Process() const;
-    CMemSpyThread& Thread() const;
-    CMemSpyThreadInfoContainer& Container() const;
-    CMemSpyThreadInfoItemBase& InfoItem() const;
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-
-protected: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
-
-private: // Internal methods
-    void ShowWaitNoteL();
-    void DestroyWaitNote();
-    static TInt CheckForItemConstructionComplete( TAny* aSelf );
-
-protected: // Member data
-    CMemSpyThreadInfoContainer& iContainer;
-    CMemSpyThreadInfoItemBase* iInfoItem;
-
-private: // Member data
-    CAknWaitDialog* iWaitNote;
-    CPeriodic* iWaitConstructionChecker;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemHeap.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMHEAP_H
-#define MEMSPYVIEWTHREADINFOITEMHEAP_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-
-class CMemSpyViewThreadInfoItemHeap : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_HEAP; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdHeap; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // Command handlers
-    void OnCmdHeapDataL();
-    void OnCmdHeapCellListingL();
-    void OnCmdHeapInfoL();
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemList.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMLIST_H
-#define MEMSPYVIEWTHREADINFOITEMLIST_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-
-// Classes referenced
-class CMemSpyProcess;
-class CMemSpyThread;
-class CMemSpyThreadInfoItemBase;
-
-
-class CMemSpyViewThreadInfoItemList : public CMemSpyViewBase, public MMemSpyThreadInfoContainerObserver
-    {
-public:
-    CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread );
-    ~CMemSpyViewThreadInfoItemList();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // API
-    const CMemSpyProcess& Process() const;
-    const CMemSpyThread& Thread() const;
-    const CMemSpyThreadInfoItemBase& CurrentInfoItem() const;
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_THREAD; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdThread; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // Command handlers
-    void OnCmdInfoHandlesL();
-
-private: // From MMemSpyThreadInfoContainerObserver
-    void HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType );
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
-    static TInt IdleUpdateListBoxModel( TAny* aSelf );
-    void DoIdleUpdateListBoxModelL();
-
-private: // Member data
-    CMemSpyThread& iThread;
-    CMemSpyThreadInfoItemBase* iCurrentInfoItem;
-    CPeriodic* iIdleResetListboxTimer;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemMemoryTracking.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMMEMORYTRACKING_H
-#define MEMSPYVIEWTHREADINFOITEMMEMORYTRACKING_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineprocessmemorytracker.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-// Classes referenced
-class CMemSpyEngineProcessMemoryTracker;
-
-
-class CMemSpyViewThreadInfoItemMemoryTracking : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
-    {
-public:
-    CMemSpyViewThreadInfoItemMemoryTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-    TInt IndexByViewType( TMemSpyViewType aType );
-    void HandleListBoxItemActionedL( TInt aIndex );
-    void RefreshL();
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_MEMORY_TRACKING; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdMemoryTracking; }
-
-private: // From MMemSpyEngineProcessMemoryTrackerObserver
-    void HandleMemoryTrackingStartedL();
-    void HandleMemoryTrackingStoppedL();
-    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
-
-private: // Command handlers
-    void OnCmdTrackingStartL();
-    void OnCmdTrackingStopL();
-    void OnCmdHWMResetL();
-    void OnCmdTotalWithSharedMemL();
-    void OnCmdTotalWithoutSharedMemL();
-    };
-
-
-class CMemSpyViewThreadInfoItemMemoryTrackingCurrent : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
-    {
-public:
-    CMemSpyViewThreadInfoItemMemoryTrackingCurrent( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    void RefreshL();
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineProcessMemoryTrackerObserver
-    void HandleMemoryTrackingStartedL() { }
-    void HandleMemoryTrackingStoppedL() { }
-    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
-    };
-
-
-
-class CMemSpyViewThreadInfoItemMemoryTrackingHWM : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
-    {
-public:
-    CMemSpyViewThreadInfoItemMemoryTrackingHWM( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    TBool HandleCommandL( TInt aCommand );
-    void RefreshL();
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineProcessMemoryTrackerObserver
-    void HandleMemoryTrackingStartedL() { }
-    void HandleMemoryTrackingStoppedL() { }
-    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_MEMORY_TRACKING_HWM; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdMemoryTrackingHWM; }
-
-private: // Command handlers
-    void OnCmdHWMResetL();
-    };
-    
-
-
-
-class CMemSpyViewThreadInfoItemMemoryTrackingPeak : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
-    {
-public:
-    CMemSpyViewThreadInfoItemMemoryTrackingPeak( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    TBool HandleCommandL( TInt aCommand );
-    void RefreshL();
-    void SetListBoxModelL();
-
-private: // From MMemSpyEngineProcessMemoryTrackerObserver
-    void HandleMemoryTrackingStartedL() { }
-    void HandleMemoryTrackingStoppedL() { }
-    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
-    };
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemServer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMSERVER_H
-#define MEMSPYVIEWTHREADINFOITEMSERVER_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-#include <badesca.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-// Classes referenced
-class TMemSpyDriverHandleInfoGeneric;
-
-
-
-class CMemSpyViewThreadInfoItemServer : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
-
-public: // From CMemSpyViewBase
-    CMemSpyViewBase* PrepareChildViewL();
-
-private: // Data members
-    TMemSpyDriverHandleInfoGeneric iCurrentInfoItemDetails;
-    };
-
-
-
-class CMemSpyViewThreadInfoItemServerDetails : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemServerDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails );
-
-public: // From CMemSpyViewBase
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareChildViewL();
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
-
-private: // Internal methods
-
-private: // Member data
-    const TMemSpyDriverHandleInfoGeneric iInfoItemDetails;
-    };
-
-
-
-class CMemSpyViewThreadInfoItemServerSessions : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemServerSessions( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails );
-
-public: // From CMemSpyViewBase
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-
-private: // Member data
-    const TMemSpyDriverHandleInfoGeneric iInfoItemDetails;
-    };
-
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreadInfoItemStack.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMSTACK_H
-#define MEMSPYVIEWTHREADINFOITEMSTACK_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-
-class CMemSpyViewThreadInfoItemStack : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_STACK; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdStack; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-private: // Command handlers
-    void OnCmdDeviceStackSummaryL();
-    void OnCmdStackInfoL();
-    void OnCmdStackDataUserL();
-    void OnCmdStackDataKernelL();
-    void OnCmdStackDataUserAllThreadsL();
-    void OnCmdStackDataKernelAllThreadsL();
-    void OnCmdStackWatchForHighWatermarkL();
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewThreads.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADS_H
-#define MEMSPYVIEWTHREADS_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CMemSpyProcess;
-class CMemSpyThread;
-
-
-class CMemSpyViewThreads : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewThreads( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
-    ~CMemSpyViewThreads();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // API
-    const CMemSpyProcess& Process() const;
-    CMemSpyThread& CurrentThread();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_THREAD; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdThread; }
-    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
-
-public: // From CMemSpyViewBase
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-    TBool HandleCommandL( TInt aCommand );
-
-private: // Command handlers
-    void OnCmdEndKillL();
-    void OnCmdEndTerminateL();
-    void OnCmdEndPanicL();
-    void OnCmdSetPriorityL( TInt aCommand );
-    void OnCmdInfoHandlesL();
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
-
-private: // Member data
-    CMemSpyProcess& iParentProcess;
-    CMemSpyThread* iCurrentThread;
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewType.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWTYPE_H
-#define MEMSPYVIEWTYPE_H
-
-// System includes
-#include <e32std.h>
-
-// Enumerations
-enum TMemSpyViewType
-    {
-    EMemSpyViewTypeNone = -1,
-    EMemSpyViewTypeMainMenu = 0,
-    EMemSpyViewTypeProcesses,
-    EMemSpyViewTypeRAMInfo,
-    EMemSpyViewTypeROMInfo,
-    EMemSpyViewTypeServerList,
-    EMemSpyViewTypeOpenFiles,
-    EMemSpyViewTypeFBServBitmaps,
-    EMemSpyViewTypeFBServBitmapInfo,
-    EMemSpyViewTypeFBServBitmapViewer,
-    EMemSpyViewTypeCodeSegmentList,
-    EMemSpyViewTypeCodeSegmentDetails,
-    EMemSpyViewTypeChunkList,
-    EMemSpyViewTypeChunkDetails,
-    EMemSpyViewTypeSystemConfig,
-    EMemSpyViewTypeKernel,
-    EMemSpyViewTypeKernelContainers,
-    EMemSpyViewTypeKernelObjects,
-    EMemSpyViewTypeKernelHeap,
-    EMemSpyViewTypeDriveSummary,
-    EMemSpyViewTypeDriveInfo,
-    EMemSpyViewTypeECom,
-    EMemSpyViewTypeEComCategory,
-    EMemSpyViewTypeEComInterface,
-    EMemSpyViewTypeEComImplementation,
-    EMemSpyViewTypeThreads,
-    EMemSpyViewTypeThreadInfoItemList,
-    EMemSpyViewTypeThreadInfoItemHeap,
-    EMemSpyViewTypeThreadInfoItemStack,
-    EMemSpyViewTypeThreadInfoItemChunk,
-    EMemSpyViewTypeThreadInfoItemCodeSeg,
-    EMemSpyViewTypeThreadInfoItemServer,
-    EMemSpyViewTypeThreadInfoItemServerDetails,
-    EMemSpyViewTypeThreadInfoItemServerSessions,
-    EMemSpyViewTypeThreadInfoItemSession,
-    EMemSpyViewTypeThreadInfoItemSemaphore,
-    EMemSpyViewTypeThreadInfoItemMutex,
-    EMemSpyViewTypeThreadInfoItemTimer,
-    EMemSpyViewTypeThreadInfoItemLDD,
-    EMemSpyViewTypeThreadInfoItemPDD,
-    EMemSpyViewTypeThreadInfoItemLogicalChannel,
-    EMemSpyViewTypeThreadInfoItemChangeNotifier,
-    EMemSpyViewTypeThreadInfoItemUndertaker,
-    EMemSpyViewTypeThreadInfoItemMessageQueue,
-    EMemSpyViewTypeThreadInfoItemConditionalVariable,
-    EMemSpyViewTypeThreadInfoItemOpenFiles,
-    EMemSpyViewTypeThreadInfoItemActiveObject,
-    EMemSpyViewTypeThreadInfoItemActiveObjectDetails,
-    EMemSpyViewTypeThreadInfoItemGeneralInfo,
-    EMemSpyViewTypeThreadInfoItemOtherThreads,
-    EMemSpyViewTypeThreadInfoItemOtherProcesses,
-    EMemSpyViewTypeThreadInfoItemOwnedThreadHandles,
-    EMemSpyViewTypeThreadInfoItemOwnedProcessHandles,
-    EMemSpyViewTypeHeapTracking,
-    EMemSpyViewTypeHeapTrackingSettings,
-    EMemSpyViewTypeHeapTrackingResults,
-    EMemSpyViewTypeHeapTrackingResultsCycleInfo,
-    EMemSpyViewTypeHeapTrackingResultsCycleChangeDescriptor,
-    EMemSpyViewTypeThreadInfoItemMemoryTracking,
-    EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig,
-    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatistics,
-    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent,
-    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM,
-    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak,
-    EMemSpyViewTypeWindowGroups
-    };
-
-
-class MemSpyViewTypeUtils
-    {
-public:
-    static TBool IsOpenableItem( TMemSpyViewType aType );
-    static TBool IsThreadInfoItem( TMemSpyViewType aType );
-    static TBool IsExitableView( TMemSpyViewType aType );
-    };
-
-
-#endif
--- a/memspyui/include/MemSpyViewWindowGroups.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef MEMSPYVIEWWINDOWGROUPS_H
-#define MEMSPYVIEWWINDOWGROUPS_H
-
-// System includes
-#include <hal.h>
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyenginehelperwindowserver.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-
-
-class CMemSpyViewWindowGroups : public CMemSpyViewBase
-    {
-public:
-    CMemSpyViewWindowGroups( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
-    ~CMemSpyViewWindowGroups();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
-
-public: // From CMemSpyViewBase
-    CEikListBox* ConstructListBoxL();
-    void RefreshL();
-    TMemSpyViewType ViewType() const;
-    CMemSpyViewBase* PrepareParentViewL();
-    CMemSpyViewBase* PrepareChildViewL();
-
-public: // Menu framework
-    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_WINDOW_GROUPS; }
-    TInt MenuCascadeCommandId() const { return EMemSpyCmdWindowGroups; }
-
-private: // From CMemSpyViewBase
-    void SetListBoxModelL();
-    TBool HandleCommandL( TInt aCommand );
-
-private: // Command handlers
-    void OnCmdSwitchToL();
-    void OnCmdEndL( TInt aCommand );
-
-private: // Internal methods
-    void DetailsL();
-    void AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... );
-
-private: // Data members
-    MMemSpyEngineWindowGroupList* iWindowGroupList;
-    };
-
-
-#endif
--- a/memspyui/include/viewcli.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-// 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 "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:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __VIEWCLI_H__
-#define __VIEWCLI_H__
-
-#include <e32base.h>
-#include <gdi.h>
-#include <vwsdef.h>
-
-//
-// Forward declarations.
-//
-
-class RVwsSession;
-class CVwsSessionEventHandler;
-class MVwsAppStarter;
-
-class MVwsSessionWrapperObserver
-/**
-The MVwsSessionObserver specifies an interface through which server events to be handled by the owner of
-a client session are notified
-
-@publishedAll 
-@deprecated
-*/
-//@internalTechnology @released
-
-	{
-public:	
-
-	/**
-	 * Handles the view event aEvent for a view added through the client session being observed.
-	 * Handles events for all the views added by the client.
-	 */
-	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
-	};
-
-
-class CVwsSessionWrapper : public CBase
-/**
-The CVwsSessionWrapper class mediates access to the view server client session which it creates, and wraps in
-support for notification of server events. A session observer will be called back with server events if
-it maintains an outstanding request for asynchronous event notification.
-
-@publishedPartner 
-@released 
-*/
-//@internalTechnology @released
-
-	{
-public:	
-	IMPORT_C static CVwsSessionWrapper* NewL();
-	IMPORT_C static CVwsSessionWrapper* NewLC();
-	IMPORT_C static CVwsSessionWrapper* NewL(MVwsSessionWrapperObserver& aObserver);
-	IMPORT_C static CVwsSessionWrapper* NewLC(MVwsSessionWrapperObserver& aObserver);
-	IMPORT_C ~CVwsSessionWrapper();
-	IMPORT_C static TInt StartViewServer(MVwsAppStarter& aAppStarter);
-	IMPORT_C TInt ShutdownViewServer();
-	IMPORT_C TInt AddView(const TVwsViewId& aViewId);
-	IMPORT_C TInt RemoveView(const TVwsViewId& aViewId) const;
-	IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId,TInt aMode);
-	IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId);
-	IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
-	IMPORT_C TInt ActivateViewViaViewEvent(const TVwsViewIdAndMessage& aViewIdAndMessage);
-	IMPORT_C TInt RequestCustomMessage(TDes8& aMessageBufPtr) const;
-	IMPORT_C void QueueAsyncRequest();
-	IMPORT_C TInt StartApp(TUid aAppToStart);
-	IMPORT_C TInt DeactivateActiveView();
-	IMPORT_C TInt DeactivateActiveViewIfOwnerMatch();
-	IMPORT_C TInt NotifyNextDeactivation(const TVwsViewId& aViewId);
-	IMPORT_C TInt NotifyNextDeactivation();
-	IMPORT_C TInt NotifyNextActivation(const TVwsViewId& aViewId);
-	IMPORT_C TInt NotifyNextActivation();
-	IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId,TInt aMode) const;
-	IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId) const;
-	IMPORT_C TInt GetSystemDefaultView(TVwsViewId& aViewId);
-	IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
-	IMPORT_C TInt SetClientRequestTimeOut(TTimeIntervalMicroSeconds32 aDuration);
-	IMPORT_C TInt SetServerEventTimeOut(TTimeIntervalMicroSeconds32 aDuration);
-	IMPORT_C TInt EnableServerEventTimeOut(TBool aEnable);
-	IMPORT_C TInt CheckSourceOfViewSwitch(TBool& aResult,const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic);
-	IMPORT_C TInt EnableServerBlankScreen(TBool aEnable);
-	IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
-	IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus);
-	IMPORT_C TInt SetCrossCheckUid(const TUid& aCrossCheckUid);
-	IMPORT_C TInt SetWindowBackgroundColor(const TRgb& aBgColor);
-public:	
-	/**
-	@internalComponent
-	@released
-	*/
-	IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
-	/**
-	@internalComponent
-	@released
-	*/
-	IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl);
-	/**
-	@internalComponent
-	@released
-	*/IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
-	/**
-	@internalComponent
-	@released
-	*/
-	IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId);
-private:
-	CVwsSessionWrapper();
-	CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver);
-	void ConstructL();
-	TInt CheckCreateViewServerSession();
-	TBool IsSchedulerRunning();
-private:
-	RVwsSession* iVwsSession;
-	CVwsSessionEventHandler* iViewEventHandler;
-	MVwsSessionWrapperObserver* iObserver;
-	};
-
-
-//
-// Panic.
-//
-/**
-@internalComponent
-*/
-enum TVwsPanic
-	{
-	EVwsCreateScheduler=1,
-	EVwsThreadRename
-	};
-
-/**
-@internalComponent
-*/
-GLREF_C void Panic(TVwsPanic aPanic);
-
-/**
-Server thread start.
-
-@internalComponent
-*/
-GLDEF_C TInt ViewServerThreadStart(TAny* aPtr);
-
-/**
-@internalComponent
-*/
-struct SVwsCommandLine
-	{
-	MVwsAppStarter* iAppStarter;
-	};
-
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/memspyui.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+#
+
+TEMPLATE = subdirs
+
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG
+
+SUBDIRS = group \
+          ui/hb
--- a/memspyui/rom/memspyui.iby	Mon May 03 12:32:02 2010 +0300
+++ b/memspyui/rom/memspyui.iby	Fri May 14 15:53:02 2010 +0300
@@ -22,11 +22,8 @@
 S60_APP_EXE(MemSpyUI)
 S60_APP_AIF_ICONS(MemSpyUI)
 S60_APP_RESOURCE(MemSpyUI)
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(MemSpyUI)
-#else
-  S60_APP_AIF_RSC(MemSpyUI)
-#endif
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,MemSpyUI)
+data=ZPRIVATE\10003a3f\import\APPS\MemSpyUI_reg.RSC Private\10003a3f\import\Apps\MemSpyUI_reg.rsc
 
 
 data=ZPRIVATE\2002129F\MemSpyEComInterfaceIds.xml							\private\2002129F\MemSpyEComInterfaceIds.xml
--- a/memspyui/source/MemSpyApp.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyApp.h"
-
-// System includes
-#include <eikstart.h>
-
-// User includes
-#include "MemSpyDocument.h"
-
-
-
-TUid CMemSpyApp::AppDllUid() const
-    {
-    return KUidMemSpy;
-    }
-
-
-CApaDocument* CMemSpyApp::CreateDocumentL()
-    {
-    return CMemSpyDocument::NewL( *this );
-    }
-
-
-EXPORT_C CApaApplication* NewApplication()
-    {
-    return new CMemSpyApp;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-
--- a/memspyui/source/MemSpyAppUi.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,721 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyAppUi.h"
-
-// System includes
-#include <AknQueryDialog.h>
-#include <aknmessagequerydialog.h> 
-#include <aknradiobuttonsettingpage.h>
-#include <eikaufty.h>
-#include <eikmenub.h>
-#include <avkon.hrh>
-#include <barsread.h>
-#include <f32file.h>
-#include <apgtask.h>
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineoutputsink.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyenginehelperchunk.h>
-#include <memspy/engine/memspyenginehelperthread.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperkernelcontainers.h>
-#include <memspy/engine/memspyenginehelperfbserv.h>
-#include <memspyengineclientinterface.h>
-#include <memspy/driver/memspydriverenumerationsshared.h>
-#include <memspy/engine/memspyenginehelperkernelcontainers.h>
-
-// User includes
-#include "MemSpyContainer.h"
-#include "MemSpyDocument.h"
-#include "MemSpySettings.h"
-#include "MemSpyDeviceWideOperationDialog.h"
-#include "MemSpyViewRAMInfo.h" // for aknicon config check
-#include "MemSpyExportBitmapsToMemoryCardDialog.h"
-#include "MemSpy.hrh"
-#include "viewcli.h"
-
-// Constants
-const TInt KMemSpyDefaultAutoCaptureTimerPeriod = 60;
-const TUint32 KMemSpyEikSrvSID = 0x10003a4a;
-
-
-CMemSpyAppUi::CMemSpyAppUi( CMemSpyEngine& aEngine )
-:   iEngine( aEngine ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo )
-    {
-    iEngine.SetObserver( this );
-    }
-
-
-CMemSpyAppUi::~CMemSpyAppUi()
-    {
-    RDebug::Printf( "[MemSpy] MemSpy is now closing." );
-    //
-    delete iAutoCaptureTimer;
-    //
-    if (iAppContainer)
-        {
-        RemoveFromStack( iAppContainer );
-        delete iAppContainer;
-        }
-    //
-    iEngine.SetObserver( NULL );
-    SetViewServerTimeOutStatus( ETrue );
-    }
-
-
-void CMemSpyAppUi::ConstructL()
-    {
-    BaseConstructL( EAknEnableSkin );
-    //
-    iAppContainer = new (ELeave) CMemSpyContainer( iEngine, *this );
-    iAppContainer->SetMopParent(this);
-    iAppContainer->ConstructL( ClientRect() );
-    iAppContainer->SetObserver( this );
-    iAppContainer->SetFocus( ETrue );
-    AddToStackL( iAppContainer );
-    //
-    iAutoCaptureTimer = CPeriodic::NewL( CActive::EPriorityIdle );
-	//
-	iEikonEnv->SetSystem( ETrue );
-    //
-    SetViewServerTimeOutStatus( EFalse );
-    }
-
-
-CMemSpyDocument& CMemSpyAppUi::MemSpyDocument()
-    {
-	CMemSpyDocument* doc = static_cast< CMemSpyDocument* >( Document() );
-    return *doc;
-    }
-
-
-const CMemSpyDocument& CMemSpyAppUi::MemSpyDocument() const
-    {
-	const CMemSpyDocument* doc = static_cast< const CMemSpyDocument* >( Document() );
-    return *doc;
-    }
-
-
-void CMemSpyAppUi::HandleStatusPaneSizeChange()
-	{
-	iAppContainer->SetRect( ClientRect() );
-	} 
-
-
-void CMemSpyAppUi::HandleControlEventL( CCoeControl* aControl, TCoeEvent /*aEventType*/ )
-    {
-    if  ( aControl == iAppContainer )
-        {
-        UpdateCBAL();
-        }
-    }
-
-
-void CMemSpyAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    CMemSpyViewBase& view = iAppContainer->ActiveView();
-    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
-    //
-    const TBool openableView = MemSpyViewTypeUtils::IsOpenableItem( viewType );
-    const TBool exitable = MemSpyViewTypeUtils::IsExitableView( viewType );
-    //
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - START - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
-#endif
-    //
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        const TInt count = aMenuPane->NumberOfItemsInPane();
-        for( TInt i=0; i<count; i++ )
-            {
-            TBool dimItem = EFalse;
-            CEikMenuPaneItem::SData& menuPaneMetaData = aMenuPane->ItemDataByIndexL( i );
-
-            // If the command is inside the view-specific range then we'll hide it
-            // unless the view and command id matches.
-            const TBool isViewSpecific = ( menuPaneMetaData.iCommandId >= KMemSpyMenuCommandViewSpecific );
-            if  ( isViewSpecific )
-                {
-                // Check whether this view requires this command item.
-                dimItem = ( view.MenuCascadeCommandId() != menuPaneMetaData.iCommandId );
-                }
-
-            aMenuPane->SetItemDimmed( menuPaneMetaData.iCommandId, dimItem );
-            }
-
-        aMenuPane->SetItemDimmed( EMemSpyCmdOpen, !openableView );
-        aMenuPane->SetItemDimmed( EAknSoftkeyBack, exitable );
-        aMenuPane->SetItemDimmed( EAknCmdExit, !exitable );
-        }
-    else if ( aResourceId == R_MEMSPY_MENUPANE_TOOLS )
-        {
-        const TBool inOpenFilesView = ( viewType == EMemSpyViewTypeOpenFiles );
-        aMenuPane->SetItemDimmed( EMemSpyCmdToolsListOpenFiles, !inOpenFilesView );
-        }
-    else if ( aResourceId == R_MEMSPY_MENUPANE_VIEW )
-        {
-        // Hide the refresh item when in the thread info container view
-        aMenuPane->SetItemDimmed( EMemSpyCmdViewRefresh, viewType == EMemSpyViewTypeThreadInfoItemList );
-        aMenuPane->SetItemDimmed( EMemSpyCmdViewOutputToSink, viewType == EMemSpyViewTypeThreadInfoItemList );
-        }
-    else if ( aResourceId == R_MEMSPY_MENUPANE_OUTPUT )
-        {
-        const TMemSpySinkType currentSink = iEngine.SinkType();
-        aMenuPane->SetItemDimmed( EMemSpyCmdOutputToDebug, currentSink == ESinkTypeDebug );
-        aMenuPane->SetItemDimmed( EMemSpyCmdOutputToFile, currentSink == ESinkTypeFile );
-        }
-    else if ( aResourceId == R_MEMSPY_MENUPANE_AUTO_CAPTURE )
-        {
-        // Change the auto-capture toggle caption appropriately...
-        TInt resId = R_MEMSPY_AUTO_CAPTURE_ENABLE;
-        if  ( iAutoCaptureTimer->IsActive() )
-            {
-            resId = R_MEMSPY_AUTO_CAPTURE_DISABLE;
-            }
-        aMenuPane->SetItemTextL( EMemSpyCmdAutoCaptureToggle, resId );
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - sending to view..." );
-#endif
-
-    view.DynInitMenuPaneL( aResourceId, aMenuPane );
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - END - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
-#endif
-    }
-
-
-TKeyResponse CMemSpyAppUi::HandleKeyEventL( const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
-    {
-    return EKeyWasNotConsumed;
-    }
-
-
-void CMemSpyAppUi::HandleCommandL( TInt aCommand )
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - START - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-
-    switch ( aCommand )
-        {
-    case EAknSoftkeyBack:
-        OnCmdBackL();
-        break;
-
-    case EEikCmdExit:
-    case EAknCmdExit:
-    case EAknSoftkeyExit:
-        OnCmdExitL();
-        break;
-
-    case EMemSpyCmdOpen:
-        OnCmdOpenL();
-        break;
-
-    case EMemSpyCmdOutputToDebug:
-        OnCmdOutputToDebugL();
-		break;
-    case EMemSpyCmdOutputToFile:
-        OnCmdOutputToFileL();
-		break;
-
-    case EMemSpyCmdToolsAbout:
-        OnCmdAboutL();
-        break;
-    //
-    case EMemSpyCmdPhoneInfoGeneralSummary:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralSummary );
-        break;
-    case EMemSpyCmdPhoneInfoGeneralDetailed:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralDetailed );
-        break;
-    case EMemSpyCmdPhoneInfoGeneralHandles:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralHandles );
-        break;
-    case EMemSpyCmdPhoneInfoGeneralKernelContainers:
-        OnCmdPhoneInformationOperationKernelContainersL();
-        break;
-    //
-    case EMemSpyCmdPhoneInfoHeapInfoSummary:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapInfo );
-        break;
-    case EMemSpyCmdPhoneInfoHeapInfoCompact:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceHeapInfoCompact );
-        break;
-    case EMemSpyCmdPhoneInfoHeapCellListing:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapCellListing );
-        break;
-    case EMemSpyCmdPhoneInfoHeapDump:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapData );
-        break;
-    //
-    case EMemSpyCmdPhoneInfoStackInfo:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackInfo );
-        break;
-    case EMemSpyCmdPhoneInfoStackInfoCompact:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceStackInfoCompact );
-        break;
-    case EMemSpyCmdPhoneInfoStackDumpUser:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataUser );
-        break;
-    case EMemSpyCmdPhoneInfoStackDumpKernel:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataKernel );
-        break;
-
-    case EMemSpyCmdAutoCaptureToggle:
-        OnCmdAutoCaptureToggleL();
-        break;
-    case EMemSpyCmdAutoCaptureRetryTime:
-        OnCmdAutoCaptureRetryTimeL();
-        break;
-    case EMemSpyCmdAutoCaptureOperationType:
-        OnCmdAutoCaptureOperationTypeL();
-        break;
-
-    default:
-        iAppContainer->HandleCommandL( aCommand );
-        break;
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - END - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::HandleForegroundEventL( TBool aForeground)
-    {
-    // Refresh the container when coming to the foreground
-    if  ( aForeground )
-        {
-        iAppContainer->OnCmdViewRefreshL();
-        }
-    }
-
-
-void CMemSpyAppUi::HandleThreadSelectedL( const CMemSpyThread& /*aThread*/ )
-    {
-	MEikAppUiFactory* appUiFactory = (iEikonEnv)->AppUiFactory();
-    appUiFactory->MenuBar()->TryDisplayMenuBarL();
-    }
-
-
-void CMemSpyAppUi::HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext )
-    {
-    if  ( aEvent == MMemSpyEngineObserver::EHandleThreadsOrProcessesChanged )
-        {
-        // Get the original container
-        const CMemSpyEngineObjectContainer& oldContainer = *reinterpret_cast< CMemSpyEngineObjectContainer* >( aContext );
-        (void) oldContainer;
-
-        // Refresh the container
-        iAppContainer->OnCmdViewRefreshL();
-        }
-    else if ( aEvent == MMemSpyEngineObserver::EHandleClientServerOperationRequest )
-        {
-        const TInt function = reinterpret_cast<TInt>( aContext );
-        InitiateMemSpyClientServerOperationL( function );
-        }
-    }
-
-
-void CMemSpyAppUi::DWOperationStarted()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-
-    iRunningDeviceWideOperation = ETrue;
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::DWOperationCancelled()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-
-    iAutoCaptureTimer->Cancel();
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::DWOperationCompleted()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-
-    iRunningDeviceWideOperation = EFalse;
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - END - iAutoCaptureTimer is active: %d", iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::UpdateCBAL()
-    {
-    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
-    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
-    //
-    if  ( MemSpyViewTypeUtils::IsExitableView( viewType ) )
-        {
-        cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
-        }
-    else
-        {
-        cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
-        }
-
-    cba->MakeVisible( ETrue );
-    cba->DrawNow();
-    }
-
-
-void CMemSpyAppUi::InitiateMemSpyClientServerOperationL( TInt aOpCode )
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - START - aOpCode: %d", aOpCode );
-#endif
-
-    switch( aOpCode )
-        {
-    case EMemSpyClientServerOpSummaryInfo:
-        HandleCommandL( EMemSpyCmdPhoneInfoGeneralSummary );
-        break;
-    case EMemSpyClientServerOpSummaryInfoDetailed:
-        HandleCommandL( EMemSpyCmdPhoneInfoGeneralDetailed );
-        break;
-    //
-    case EMemSpyClientServerOpHeapInfo:
-        HandleCommandL( EMemSpyCmdPhoneInfoHeapInfoSummary );
-        break;
-    case EMemSpyClientServerOpHeapCellListing:
-        HandleCommandL( EMemSpyCmdPhoneInfoHeapCellListing );
-        break;
-    case EMemSpyClientServerOpHeapData:
-        HandleCommandL( EMemSpyCmdPhoneInfoHeapDump );
-        break;
-    //
-    case EMemSpyClientServerOpStackInfo:
-        HandleCommandL( EMemSpyCmdPhoneInfoStackInfo );
-        break;
-    case EMemSpyClientServerOpStackDataUser:
-        HandleCommandL( EMemSpyCmdPhoneInfoStackDumpUser );
-        break;
-    case EMemSpyClientServerOpStackDataKernel:
-        HandleCommandL( EMemSpyCmdPhoneInfoStackDumpKernel );
-        break;
-    //
-    case EMemSpyClientServerOpBitmapsSave:
-        OnCmdToolsBitmapsSaveToMemoryCardL();
-        break;
-    case EMemSpyClientServerOpSendToBackground:
-        OnCmdToolsSendToBackgroundL();
-        break;
-    case EMemSpyClientServerOpBringToForeground:
-        OnCmdToolsBringToForegroundL();
-        break;
-    case EMemSpyClientServerOpExit:
-        OnCmdExitL();
-        break;
-    //
-    default:
-        User::Leave( KErrNotSupported );
-        break;
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - END - aOpCode: %d", aOpCode );
-#endif
-    }
-
-
-void CMemSpyAppUi::SetViewServerTimeOutStatus( TBool aEnabled )
-    {
-    TRAP_IGNORE(
-        iEngine.HelperProcess().ImpersonateL( KMemSpyEikSrvSID );
-        //
-        CVwsSessionWrapper* ses = CVwsSessionWrapper::NewLC();
-        ses->EnableServerEventTimeOut( aEnabled );
-        CleanupStack::PopAndDestroy( ses );
-        //
-        iEngine.HelperProcess().ImpersonateL( 0 );
-        );
-    }
-
-
-void CMemSpyAppUi::OnCmdBackL()
-    {
-    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
-    //
-    if  ( !MemSpyViewTypeUtils::IsExitableView( viewType ) )
-        {
-        // Should go back one view
-        iAppContainer->NavigateToParentViewL();
-        }
-    }
-
-
-void CMemSpyAppUi::OnCmdExitL()
-    {
-    Exit();
-    }
-
-
-void CMemSpyAppUi::OnCmdOpenL()
-    {
-    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
-    //
-    if  ( !MemSpyViewTypeUtils::IsOpenableItem( viewType ) )
-        {
-        // Should go back one view
-        iAppContainer->NavigateToChildViewL();
-        }
-    }
-
-
-void CMemSpyAppUi::OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::TOperation aOp )
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - START - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-
-    if  ( !iRunningDeviceWideOperation )
-        {
-        CMemSpyDeviceWideOperationDialog::ExecuteLD( iEngine, *this, aOp );
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - END - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::OnCmdPhoneInformationOperationKernelContainersL()
-    {
-    CMemSpyEngineGenericKernelObjectContainer* list = iEngine.HelperKernelContainers().ObjectsAllL();
-    CleanupStack::PushL( list );
-    iEngine.HelperKernelContainers().OutputL( *list );
-    CleanupStack::PopAndDestroy( list );
-    }
-
-
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-
-
-void CMemSpyAppUi::OnCmdAutoCaptureToggleL()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-
-    if  ( iAutoCaptureTimer->IsActive() )
-        {
-        iAutoCaptureTimer->Cancel();
-        }
-    else
-        {
-        iAutoCaptureTimer->Cancel();
-        //
-        const TTimeIntervalMicroSeconds32 interval( iAutoCaptureTimerPeriod * 1000000 );
-        iAutoCaptureTimer->Start( 0, interval, TCallBack(AutoCaptureCallBack, this) );
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-void CMemSpyAppUi::OnCmdAutoCaptureRetryTimeL()
-    {
-    CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( iAutoCaptureTimerPeriod );
-    dialog->ExecuteLD( R_MEMSPY_DEVICE_WIDE_SETTINGS );
-    }
-
-
-void CMemSpyAppUi::OnCmdAutoCaptureOperationTypeL()
-    {
-    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES );
-    CleanupStack::PushL(items);
-    //
-    TInt currentItem = iAutoCaptureOperationType;
-    //
-    CAknRadioButtonSettingPage* dialog = new(ELeave) CAknRadioButtonSettingPage( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES_SETTINGS_PAGE, currentItem, items );
-    if  ( dialog->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
-        {
-        iAutoCaptureOperationType = static_cast< CMemSpyDeviceWideOperations::TOperation >( currentItem );
-        }
-    //
-    CleanupStack::PopAndDestroy( items ); 
-    }
-
-
-TInt CMemSpyAppUi::AutoCaptureCallBack( TAny* aSelf )
-    {
-    CMemSpyAppUi* self = reinterpret_cast< CMemSpyAppUi* >( aSelf );
-    TRAPD( err, self->AutoCaptureCallBackL() );
-    //
-    const TBool callMeBackAgain = ( err == KErrNone );
-    return callMeBackAgain;
-    }
-
-
-void CMemSpyAppUi::AutoCaptureCallBackL()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-
-    OnCmdPhoneInformationOperationL( iAutoCaptureOperationType );
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - END - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
-#endif
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-void CMemSpyAppUi::OnCmdOutputToDebugL()
-    {
-    iEngine.InstallSinkL( ESinkTypeDebug );
-    MemSpyDocument().Settings().StoreSettingsL();
-    }
-
-
-void CMemSpyAppUi::OnCmdOutputToFileL()
-    {
-    iEngine.InstallSinkL( ESinkTypeFile );
-    MemSpyDocument().Settings().StoreSettingsL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-void CMemSpyAppUi::OnCmdAboutL()
-    {
-    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-    dialog->ExecuteLD( R_MEMSPYUI_ABOUT_DIALOG );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-void CMemSpyAppUi::OnCmdToolsBitmapsSaveToMemoryCardL()
-    {
-    // Get bitmap handles
-    RArray<TInt> handles;
-    CleanupClosePushL( handles );
-    iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( handles );
-
-    // Build bitmap list
-    CMemSpyEngineFbServBitmapArray* array = CMemSpyEngineFbServBitmapArray::NewL( handles );
-    CleanupStack::PopAndDestroy( &handles );
-    CleanupStack::PushL( array );
-
-    // Export...
-    CMemSpyExportBitmapsToMemoryCardDialog* dialog = CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *array );
-    
-    // All done
-    CleanupStack::PopAndDestroy( array );
-    }
-
-
-void CMemSpyAppUi::OnCmdToolsSendToBackgroundL()
-    {
-    TApaTask task( iCoeEnv->WsSession() );
-    task.SendToBackground();
-    }
-
-
-void CMemSpyAppUi::OnCmdToolsBringToForegroundL()
-    {
-    iCoeEnv->BringOwnerToFront();
-    }
-
-
-
-
--- a/memspyui/source/MemSpyContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyContainer.h"
-
-// System includes
-#include <eikrted.h>  // for example label control
-#include <txtrich.h>
-#include <apgtask.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-
-// User includes
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-
-CMemSpyContainer::CMemSpyContainer( CMemSpyEngine& aEngine, MMemSpyContainerObserver& aObserver  )
-:   iEngine( aEngine ), iObserver( aObserver )
-    {
-    }
-
-
-CMemSpyContainer::~CMemSpyContainer()
-    {
-    delete iPreviousView;
-    delete iActiveView;
-    }
-
-
-void CMemSpyContainer::ConstructL(const TRect& aRect)
-    {
-    CreateWindowL();
-    SetRect(aRect);
-    PrepareTopLevelViewL();
-    ActivateL();
-    }
-
-
-void CMemSpyContainer::NavigateToParentViewL()
-    {
-    CMemSpyViewBase* parentView = iActiveView->PrepareParentViewL();
-    //
-    if  ( parentView == NULL )
-        {
-        // Parent can be null, in which case, revert to top-level view
-        PrepareTopLevelViewL();
-        }
-    else
-        {
-        SetNewActiveViewL( parentView );
-        }
-    }
-
-
-void CMemSpyContainer::NavigateToChildViewL()
-    {
-    CMemSpyViewBase* childView = iActiveView->PrepareChildViewL();
-    //
-    if  ( childView != NULL )
-        {
-        SetNewActiveViewL( childView );
-        }
-    }
-
-
-void CMemSpyContainer::HandleCommandL( TInt aCommand )
-    {
-    switch( aCommand )
-        {
-	case EMemSpyCmdViewRefresh:
-        OnCmdViewRefreshL();
-        break;
-    default:
-        if  ( iActiveView )
-            {
-            iActiveView->HandleCommandL( aCommand );
-            }
-        break;
-        }
-    }
-
-
-void CMemSpyContainer::OnCmdViewRefreshL()
-    {
-    if  ( iActiveView )
-        {
-        TRAPD(err, iActiveView->RefreshL());
-        if  ( err != KErrNone )
-            {
-            // Error during view refreshing (perhaps the thread doesn't exist anymore).
-            // Try to replace the active view with its parent...
-            NavigateToParentViewL();
-            }
-        }
-    }
-
-
-void CMemSpyContainer::SizeChanged()
-    {
-    if  ( iActiveView )
-        {
-        iActiveView->SetRect( Rect() );
-        }
-    }
-
-
-TInt CMemSpyContainer::CountComponentControls() const
-    {
-    return 1;
-    }
-
-
-CCoeControl* CMemSpyContainer::ComponentControl(TInt /*aIndex*/) const
-    {
-    return iActiveView;
-    }
-
-
-void CMemSpyContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    //
-    gc.SetPenStyle(CGraphicsContext::ENullPen);
-    gc.SetBrushColor(KRgbGray);
-    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-    gc.DrawRect(aRect);
-    }
-
-
-TKeyResponse CMemSpyContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    TKeyResponse response = EKeyWasNotConsumed;
-    //
-    if  ( iActiveView )
-        {
-        response = iActiveView->OfferKeyEventL( aKeyEvent, aType );
-        }
-    //
-    return response;
-    }
-
-
-void CMemSpyContainer::HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType /*aViewType*/, CMemSpyViewBase& aReportingView, TAny* /*aContext*/ )
-    {
-    if  ( aEvent == EEventItemActioned )
-        {
-        // Get the view to generate a child
-        CMemSpyViewBase* child = aReportingView.PrepareChildViewL();
-        if  ( child == NULL )
-            {
-            // View doesn't have a child - treat it as item activation and
-            // report event to observer.
-
-            }
-        else
-            {
-            // Child view becomes the active one
-            SetNewActiveViewL( child );
-            }
-        }
-    }
-
-
-CMemSpyViewBase* CMemSpyContainer::PrepareTopLevelViewL()
-    {
-    CMemSpyViewMainMenu* view = new(ELeave) CMemSpyViewMainMenu( iEngine, *this );
-    CleanupStack::PushL( view );
-    view->ConstructL( Rect(), *this );
-    SetNewActiveViewL( view );
-    CleanupStack::Pop( view );
-    return view;
-    }
-
-
-void CMemSpyContainer::SetNewActiveViewL( CMemSpyViewBase* aNewView )
-    {
-    delete iPreviousView;
-    //
-    iPreviousView = iActiveView;
-    if  ( iPreviousView )
-        {
-        iPreviousView->MakeVisible( EFalse );
-        iPreviousView->SetFocus( EFalse );
-        }
-    //
-    iActiveView = aNewView;
-    iActiveView->RefreshL();
-    iActiveView->SetFocus( ETrue );
-    //
-    ReportEventL( MCoeControlObserver::EEventStateChanged );
-    }
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyDeviceWideOperationDialog.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyDeviceWideOperationDialog.h"
-
-// System includes
-#include <eikprogi.h>
-#include <AknWaitDialog.h>
-#include <AknQueryDialog.h>
-#include <coemain.h>
-#include <eikenv.h>
-#include <avkon.hrh>
-#include <memspyui.rsg>
-
-
-CMemSpyDeviceWideOperationDialog::CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver )
-:   iEngine( aEngine ), iObserver( aObserver )
-    {
-    }
-
-
-CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog()
-    {
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - START - iForcedCancel: %d", iForcedCancel );
-#endif
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - deleting operation...: 0x%08x", iOperation );
-#endif
-    delete iOperation;
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - deleting dialog...: 0x%08x", iProgressDialog );
-#endif
-    iProgressInfo = NULL;
-    delete iProgressDialog;
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - sending EDialogDismissed to observer..." );
-#endif
-
-    iObserver.DWOperationCompleted();
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - END" );
-#endif
-    }
-
-
-void CMemSpyDeviceWideOperationDialog::ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - START" );
-#endif
-
-    iOperation = CMemSpyDeviceWideOperations::NewL( iEngine, *this, aOperation );
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - constructed operation..." );
-#endif
-
-    ASSERT( iProgressDialog == NULL );
-    iProgressDialog = new( ELeave ) CAknProgressDialog( reinterpret_cast< CEikDialog** >( &iProgressDialog ), ETrue );
-    iProgressDialog->PrepareLC( R_MEMSPY_DEVICE_WIDE_OPERATION_PROGRESS_DIALOG );
-    iProgressDialog->SetCallback( this );
-    iProgressDialog->SetGloballyCapturing( ETrue );
-    //
-    iProgressInfo = iProgressDialog->GetProgressInfoL();
-    iProgressInfo->SetFinalValue( iOperation->TotalOperationSize() );
-    //
-    iProgressDialog->RunLD();
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - END" );
-#endif
-    }
-
-void CMemSpyDeviceWideOperationDialog::ExecuteLD( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation )
-    {
-    CMemSpyDeviceWideOperationDialog* self = new(ELeave) CMemSpyDeviceWideOperationDialog( aEngine, aObserver );
-    CleanupStack::PushL( self );
-    self->ExecuteL( aOperation );
-    CleanupStack::PopAndDestroy( self );
-    }
-
-
-void CMemSpyDeviceWideOperationDialog::Cancel()
-    {
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::Cancel() - START - iOperation: 0x%08x, iForcedCancel: %d", iOperation, iForcedCancel );
-#endif
-
-    iForcedCancel = ETrue;
-    //
-    if  ( iOperation )
-        {
-        iOperation->Cancel();
-        }
-    //
-    iObserver.DWOperationCancelled();
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::Cancel() - END" );
-#endif
-    }
-
-
-void CMemSpyDeviceWideOperationDialog::DialogDismissedL( TInt aButtonId )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::DialogDismissedL() - START - aButtonId: %d, iForcedCancel: %d", aButtonId, iForcedCancel );
-#else
-    (void) aButtonId;
-#endif
-
-    Cancel();
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::DialogDismissedL() - END - aButtonId: %d, iForcedCancel: %d", aButtonId, iForcedCancel );
-#endif
-    }
-
-
-void CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent( TEvent aEvent, TInt aParam1, const TDesC& aParam2 )
-    {
-#ifdef _DEBUG
-    RDebug::Print( _L("[MemSpy] CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent() - START - aEvent: %d, iProgressDialog: 0x%08x, aParam1: %d, aParam2: %S"), aEvent, iProgressDialog, aParam1, &aParam2 );
-#endif
-
-    switch( aEvent )
-        {
-    case MMemSpyDeviceWideOperationsObserver::EOperationSized:
-        break;
-    case MMemSpyDeviceWideOperationsObserver::EOperationStarting:
-        iObserver.DWOperationStarted();
-        break;
-    case MMemSpyDeviceWideOperationsObserver::EOperationProgressStart:
-        ASSERT( iProgressDialog != NULL );
-        SetDialogCaptionL( aParam2 );
-        break;
-    case MMemSpyDeviceWideOperationsObserver::EOperationProgressEnd:
-        ASSERT( iProgressDialog != NULL );
-        iProgressInfo->IncrementAndDraw( aParam1 );
-        break;
-    case MMemSpyDeviceWideOperationsObserver::EOperationCancelled:
-        break;
-    case MMemSpyDeviceWideOperationsObserver::EOperationCompleting:
-        {
-        ASSERT( iProgressDialog != NULL );
-        const TInt finalValue = iProgressInfo->Info().iFinalValue;
-        iProgressInfo->SetAndDraw( finalValue );
-        break;
-        }
-    case MMemSpyDeviceWideOperationsObserver::EOperationCompleted:
-        if  ( iProgressDialog )
-            {
-            iProgressDialog->ProcessFinishedL();
-            }
-        break;
-    default:
-        break;
-        }
-
-#ifdef _DEBUG
-    RDebug::Print( _L("[MemSpy] CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent() - END - aEvent: %d, aParam1: %d, aParam2: %S"), aEvent, aParam1, &aParam2 );
-#endif
-    }
-
-
-void CMemSpyDeviceWideOperationDialog::SetDialogCaptionL( const TDesC& aText )
-    {
-    if  ( aText.Length() )
-        {
-        iProgressDialog->SetTextL( aText );
-        iProgressDialog->DrawNow();
-        }
-    }
-
-
-
-
-
--- a/memspyui/source/MemSpyDocument.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyDocument.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-
-// User includes
-#include "MemSpyAppUi.h"
-#include "MemSpySettings.h"
-
-
-CMemSpyDocument::CMemSpyDocument(CEikApplication& aApp)
-:   CAknDocument(aApp)    
-    {
-    }
-
-
-CMemSpyDocument::~CMemSpyDocument()
-    {
-    delete iSettings;
-    delete iEngine;
-    }
-
-
-void CMemSpyDocument::ConstructL()
-    {
-    RFs& fsSession = CCoeEnv::Static()->FsSession();
-    //
-    iEngine = CMemSpyEngine::NewL( fsSession );
-    iSettings = CMemSpySettings::NewL( fsSession, *iEngine );
-    }
-
-
-CMemSpyDocument* CMemSpyDocument::NewL(CEikApplication& aApp)
-    {
-    CMemSpyDocument* self = new (ELeave) CMemSpyDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-    }
-
-
-CMemSpyEngine& CMemSpyDocument::Engine()
-    {
-    return *iEngine;
-    }
-
-
-const CMemSpyEngine& CMemSpyDocument::Engine() const
-    {
-    return *iEngine;
-    }
-
-
-CMemSpySettings& CMemSpyDocument::Settings()
-    {
-    return *iSettings;
-    }
-
-
-const CMemSpySettings& CMemSpyDocument::Settings() const
-    {
-    return *iSettings;
-    }
-
-
-CEikAppUi* CMemSpyDocument::CreateAppUiL()
-    {
-    return new (ELeave) CMemSpyAppUi( *iEngine );
-    }
-
--- a/memspyui/source/MemSpyExportBitmapsToMemoryCardDialog.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyExportBitmapsToMemoryCardDialog.h"
-
-// System includes
-#include <eikprogi.h>
-#include <AknWaitDialog.h>
-#include <AknQueryDialog.h>
-#include <coemain.h>
-#include <eikenv.h>
-#include <avkon.hrh>
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyenginehelperchunk.h>
-#include <memspy/engine/memspyenginehelpercodesegment.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-#include <memspy/engine/memspyenginehelperstack.h>
-#include <memspy/engine/memspyenginehelperthread.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperfbserv.h>
-
-// Driver includes
-#include <memspy/driver/memspydriverenumerationsshared.h>
-
-// Literal constants
-_LIT( KMemSpyBitmapExportFolderAndFileName, "e:\\MemSpy\\Images\\%04d%02d%02d_%02d.%02d.%02d\\");
-
-
-CMemSpyExportBitmapsToMemoryCardDialog::CMemSpyExportBitmapsToMemoryCardDialog( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps )
-:   CActive(EPriorityIdle), iFsSession(aFsSession), iBitmaps(aBitmaps)
-    {
-    CActiveScheduler::Add(this);
-    }
-
-
-CMemSpyExportBitmapsToMemoryCardDialog::~CMemSpyExportBitmapsToMemoryCardDialog()
-    {
-    Cancel();
-    //
-    delete iProgressDialog;
-    //
-    iMimeTypeArray.ResetAndDestroy();
-    iMimeTypeArray.Close();
-    //
-    if ( iEncoder )
-        {
-        iEncoder->Cancel();
-        }
-    delete iEncoder;
-    delete iFolderName;
-    delete iBmpMimeType;
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::ConstructL()
-    {
-    // Check card is ready
-    if  ( CheckMemoryCardAvailableL( iFsSession ) == EFalse )
-        {
-        User::Leave( KErrNotReady );
-        }
-
-    // Get mime type for BMP file
-    IdentifyBmpMimeTypeL();
-
-    // Prepare unique empty folder
-    PrepareFolderNameSpecL();
-
-    // Prepare UI stuff
-    iProgressDialog = new( ELeave ) CAknProgressDialog( reinterpret_cast< CEikDialog** >( &iProgressDialog ) );
-    iProgressDialog->SetCallback( this );
-    iProgressDialog->SetGloballyCapturing( ETrue );
-    iProgressDialog->PrepareLC( R_MEMSPY_EXPORT_TO_MEMORYCARD_DIALOG );
-    //
-    iProgressInfo = iProgressDialog->GetProgressInfoL( );
-    iProgressInfo->SetFinalValue( iBitmaps.Count() );
-    //
-    iProgressDialog->MakeVisible( ETrue ); // Visible right away
-    //
-    iDialogDismissed = EFalse;
-    iProgressInfo->SetAndDraw( 0 );
-
-    // Start the process rolling...
-    CompleteSelf(KErrNone);
-
-    //
-    iProgressDialog->RunLD( );
-    }
-
-
-CMemSpyExportBitmapsToMemoryCardDialog* CMemSpyExportBitmapsToMemoryCardDialog::NewL( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps )
-    {
-    CMemSpyExportBitmapsToMemoryCardDialog* self = new(ELeave) CMemSpyExportBitmapsToMemoryCardDialog( aFsSession, aBitmaps );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::Cancel()
-    {
-    CActive::Cancel();
-    }
-
-
-TBool CMemSpyExportBitmapsToMemoryCardDialog::CheckMemoryCardAvailableL( RFs& aFsSession )
-    {
-    TBool available = EFalse;
-    //
-    TDriveInfo driveInfo;
-    if  ( aFsSession.Drive( driveInfo, EDriveE ) == KErrNone )
-        {
-        // Other checks needed?
-        available = ETrue;
-        }
-    //
-    return available;
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::RunL()
-    {
-    const TInt error = iStatus.Int();
-    User::LeaveIfError( error );
- 
-    if  ( !iDialogDismissed )
-        {
-        // Do we have more items to process?
-        if  ( TryToExportSingleBitmapL() )
-            {
-            _LIT(KTextFormat, "Saving image\n%d/%d");
-            TBuf<128> buf;
-            buf.Format( KTextFormat, iBitmapIndex, iBitmaps.Count() );
-            //
-            iProgressDialog->SetTextL( buf );
-            iProgressInfo->SetAndDraw( iBitmapIndex );
-            iProgressDialog->DrawDeferred();
-            }
-        else
-            {
-            // We're done - RunL will not be called again
-            if  (iProgressInfo)
-                {
-                const TInt finalValue = iProgressInfo->Info().iFinalValue;
-                iProgressInfo->SetAndDraw( finalValue );
-                //
-                delete iProgressDialog;
-                iProgressDialog = NULL;
-                //
-                delete this;
-                }
-            }
-
-        User::ResetInactivityTime();
-        }
-    else
-        {
-        delete iProgressDialog;
-        iProgressDialog = NULL;
-        //
-        delete this;
-        }
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::DoCancel()
-    {
-    if  ( iEncoder )
-        {
-        iEncoder->Cancel();
-        }
-
-    iDialogDismissed = ETrue;
-    }
-
-
-TInt CMemSpyExportBitmapsToMemoryCardDialog::RunError( TInt /*aError*/ )
-    {
-    TRAP_IGNORE(
-
-        // Try the next image
-        if  ( TryToExportSingleBitmapL() == EFalse )
-            {
-            iDialogDismissed = ETrue;
-            delete this;
-            }
-    );
-    //
-    return KErrNone;
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::DialogDismissedL( TInt /*aButtonId*/ )
-    {
-    iDialogDismissed = ETrue;
-    iProgressDialog = NULL;
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::CompleteSelf( TInt aError )
-    {
-    TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, aError );
-    SetActive();
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::ExportBitmapL( const CMemSpyEngineFbServBitmap& aBitmap )
-    {
-    // Create a filename
-    TFileName fileName( *iFolderName );
-    aBitmap.GetExportableFileNameL( fileName );
-
-    // Create encoder object...
-    CImageEncoder* encoder = CImageEncoder::FileNewL( iFsSession, fileName, *iBmpMimeType );
-    delete iEncoder;
-    iEncoder = encoder;
-
-    // Start operation
-    iEncoder->Convert( &iStatus, aBitmap.Bitmap() );
-    SetActive();
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::IdentifyBmpMimeTypeL()
-    {
-    _LIT(KBmpExtension, ".bmp");
-    CImageEncoder::GetFileTypesL( iMimeTypeArray );
-    //
-    const TInt count = iMimeTypeArray.Count();
-    //
-    for( TInt i=0; i<count; i++ )
-        {
-        CFileExtensionMIMEType* extension = iMimeTypeArray[ i ];
-        if  ( extension->FileExtension().FindF( KBmpExtension ) >= 0 )
-            {
-            // Found it - save mime type info
-            iBmpMimeType = extension->MIMEType().AllocL();
-            iMimeTypeArray.ResetAndDestroy();
-            iMimeTypeArray.Close();
-            return;
-            }
-        }
-    //
-    User::Leave( KErrNotFound );    
-    }
-
-
-void CMemSpyExportBitmapsToMemoryCardDialog::PrepareFolderNameSpecL()
-    {
-    delete iFolderName;
-    iFolderName = NULL;
-    
-    // Make a unique filename format specifier.
-    TTime now;
-    now.HomeTime();
-    const TDateTime dt( now.DateTime() );
-
-    // Build it up...
-    iFolderName = HBufC::NewL( KMaxFileName );
-    TPtr pName( iFolderName->Des() );
-    pName.Format( KMemSpyBitmapExportFolderAndFileName, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second());
-    
-    // Create directory
-    const TInt error = iFsSession.MkDirAll( pName );
-    User::LeaveIfError( error );
-    }
-
-
-TBool CMemSpyExportBitmapsToMemoryCardDialog::TryToExportSingleBitmapL()
-    {
-    TBool startedExport = EFalse;
-    
-    const TInt count = iBitmaps.Count();
-    for( ; ( iBitmapIndex < count ) && ( startedExport == EFalse ); iBitmapIndex++ )
-        {
-        const CMemSpyEngineFbServBitmap& memSpyBitmap = iBitmaps.At( iBitmapIndex );
-        const CFbsBitmap& fbsBitmap = memSpyBitmap.Bitmap();
-        const TSize size( fbsBitmap.SizeInPixels() );
-
-        // We don't want to export bitmaps which have a zero-pixel dimension.
-        if  ( size.iHeight > 0 && size.iWidth > 0 )
-            {
-            // This completes the object's request status and will therefore
-            // result in a further call to RunL() when the export to BMP
-            // is completed.
-            ExportBitmapL( memSpyBitmap );
-
-            // And indicate we managed to start an operation...
-            startedExport = ETrue;
-            }
-        }
-    //
-    return startedExport;
-    }
-
-
-
-
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpySettings.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpySettings.h"
-
-// System includes
-#include <e32svr.h>
-#include <s32file.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyenginelogger.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelpersysmemtracker.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
-
-// Constants
-_LIT( KMemSpySettingsFileName, "settings.dat" );
-
-// Version 03 dumped some of the system wide memory tracker settings
-const TInt KMemSpySettingsFileFormatVersion = 6;
-
-
-CMemSpySettings::CMemSpySettings( RFs& aFsSession, CMemSpyEngine& aEngine )
-:   iFsSession( aFsSession ), iEngine( aEngine )
-    {
-    }
-
-
-CMemSpySettings::~CMemSpySettings()
-    {
-    TRACE( RDebug::Printf( "CMemSpySettings::~CMemSpySettings() - START" ) );
-    TRAP_IGNORE( StoreSettingsL() );
-    TRACE( RDebug::Printf( "CMemSpySettings::~CMemSpySettings() - END" ) );
-    }
-
-
-void CMemSpySettings::ConstructL()
-    {
-    TRACE( RDebug::Print( _L("CMemSpySettings::ConstructL() - START") ) );
-
-    TRAP_IGNORE( RestoreSettingsL() );
-
-    TRACE( RDebug::Print( _L("CMemSpySettings::ConstructL() - END") ) );
-    }
-
-
-CMemSpySettings* CMemSpySettings::NewL( RFs& aFsSession, CMemSpyEngine& aEngine )
-    {
-    CMemSpySettings* self = new(ELeave) CMemSpySettings( aFsSession, aEngine );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-void CMemSpySettings::GetSettingsFileNameL( TDes& aFileName )
-    {
-    GetSettingsPathL( aFileName );
-    aFileName.Append( KMemSpySettingsFileName );
-    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsFileNameL() - aFileName: %S"), &aFileName ) );
-    }
-
-
-void CMemSpySettings::GetSettingsPathL( TDes& aPath )
-    {
-    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - START") ) );
-    aPath.Zero();
-
-    // Get private data cage path
-    TInt err = iFsSession.PrivatePath( aPath );
-    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - priv path err: %d"), err ) );
-    User::LeaveIfError( err );
-
-    // Combine with C: drive
-    const TDriveUnit cDrive( EDriveC );
-    const TDriveName cDriveName( cDrive.Name() );
-    aPath.Insert( 0, cDriveName );
-
-    iFsSession.MkDirAll( aPath );
-    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - END - %S"), &aPath ) );
-    }
-
-
-RFile CMemSpySettings::SettingsFileLC( TBool aReplace )
-    {
-    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - START - aReplace: %d"), aReplace ) );
-
-    TFileName* fileName = new(ELeave) TFileName();
-    CleanupStack::PushL( fileName );
-    GetSettingsFileNameL( *fileName );
-    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - fileName: %S"), fileName ) );
-
-    RFile file;
-    TInt error = KErrNone;
-    //
-    if  ( aReplace )
-        {
-        error = file.Replace( iFsSession, *fileName, EFileWrite );
-        TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - replace err: %d"), error ) );
-        }
-    else
-        {
-        error = file.Open( iFsSession, *fileName, EFileWrite );
-        TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - open err: %d"), error ) );
-        //
-        if  ( error == KErrNotFound )
-            {
-            error = file.Create( iFsSession, *fileName, EFileWrite );
-            }
-        }
-    //
-    User::LeaveIfError( error );
-    CleanupStack::PopAndDestroy( fileName );
-    CleanupClosePushL( file );
-    //
-    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - END") ) );
-    return file;
-    }
-
-
-void CMemSpySettings::StoreSettingsL()
-    {
-    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - START" ) );
-
-    RFile file = SettingsFileLC( ETrue );
-    RFileWriteStream stream( file );
-    CleanupStack::Pop(); // file
-    CleanupClosePushL( stream );
-    
-    // Verion info
-    stream.WriteInt32L( KMemSpySettingsFileFormatVersion );
-    
-    // Engine settings
-    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - sinkType: %d", iEngine.SinkType() ) );
-    stream.WriteUint8L( iEngine.SinkType() );
-
-    // Get SWMT config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
-    swmt.GetConfig( swmtConfig );
-
-    // Write SWMT settings
-    stream.WriteInt32L( swmtConfig.TimerPeriod().Int() );
-    stream.WriteUint8L( swmtConfig.DumpData() );
-    
-    // Write memory tracking auto-start process list
-    const RArray<TUid>& processUidList = iEngine.HelperProcess().MemoryTrackingAutoStartProcessList();
-    stream.WriteInt32L( processUidList.Count() );
-    for( TInt i=0; i<processUidList.Count(); i++ )
-        {
-        const TUid uid = processUidList[ i ];
-        TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, uid.iUid ) );
-        stream << uid;
-        }
-
-    // Write memory tracking categories
-    stream.WriteInt32L( swmtConfig.iEnabledCategories );
-    
-    // Write heap tracking thread name filter
-    stream.WriteInt32L( swmtConfig.iThreadNameFilter.Length() );
-    if ( swmtConfig.iThreadNameFilter.Length() > 0 )
-        {
-        stream.WriteL( swmtConfig.iThreadNameFilter, swmtConfig.iThreadNameFilter.Length() );
-        }
-    
-    // Write mode
-    stream.WriteInt32L( swmtConfig.iMode );
-    
-    stream.CommitL();
-    CleanupStack::PopAndDestroy( &stream ); // Closes file
-    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - END - sinkType: %d", iEngine.SinkType() ) );
-    }
-
-
-void CMemSpySettings::RestoreSettingsL()
-    {
-    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - START - current engine sinkType: %d", iEngine.SinkType() ) );
-
-    RFile file = SettingsFileLC();
-    RFileReadStream stream( file );
-    CleanupStack::Pop(); // file
-    CleanupClosePushL( stream );
-    
-    // Version info
-    const TInt version = stream.ReadInt32L(); // discarded for now
-    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - version: %d", version ) );
-
-    // Engine settings
-    TMemSpySinkType type = static_cast< TMemSpySinkType >( stream.ReadUint8L() );
-    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - read sinkType: %d", type ) );
-    iEngine.InstallSinkL( type );
-    
-    // Set SWMT config
-    TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
-    swmtConfig.iTimerPeriod = TTimeIntervalMicroSeconds32( stream.ReadInt32L() );
-    swmtConfig.iDumpData = static_cast< TBool >( stream.ReadUint8L() );
-
-    if  ( version < 3 )
-        {
-        // Restore but ignore old delta tracker settings which aren't used anymore
-        //
-        /* iHeapDeltaTrackerIncludeKernel =*/ static_cast< TBool >( stream.ReadUint8L() );
-        /* iHeapDeltaTrackerCheckAllocCellCounts =*/ static_cast< TBool >( stream.ReadUint8L() );
-        /* iHeapDeltaTrackerCheckFreeCellCounts =*/ static_cast< TBool >( stream.ReadUint8L() );
-        }
-    
-    // Restore memory tracking auto-start process uids if file format supports it...
-    if ( version >= 2 )
-        {
-        RArray<TUid> list;
-        CleanupClosePushL( list );
-        //
-        const TInt count = stream.ReadInt32L();
-        for( TInt i=0; i<count; i++ )
-            {
-            TUid processUid;
-            stream >> processUid;
-            //
-            TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, processUid.iUid ) );
-            User::LeaveIfError( list.Append( processUid ) );
-            }
-        //
-        CMemSpyEngineHelperProcess& processHelper = iEngine.HelperProcess();
-        processHelper.SetMemoryTrackingAutoStartProcessListL( list );
-        CleanupStack::PopAndDestroy( &list );
-        }
-    
-    // Restore memory tracking categories 
-    if ( version > 3 )
-        {
-        swmtConfig.iEnabledCategories = stream.ReadInt32L();
-        }
-    
-    // Write heap tracking thread name filter 
-    if ( version > 4 )
-        {
-        TInt len = stream.ReadInt32L();
-        if ( len > 0 )
-            {
-            stream.ReadL( swmtConfig.iThreadNameFilter, len );
-            }
-        }
-
-    // Write mode
-    if ( version > 5 )
-        {
-        swmtConfig.iMode = (TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode)stream.ReadInt32L();
-        }
-    
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    swmt.SetConfigL( swmtConfig );
-
-    CleanupStack::PopAndDestroy( &stream ); // Closes file
-    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - END - engine sink type: %d", iEngine.SinkType() ) );
-    }
-
-
--- a/memspyui/source/MemSpyUiUtils.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyUiUtils.h"
-
-// System includes
-#include <coemain.h>
-#include <memspyui.rsg>
-
-
-
-
-void MemSpyUiUtils::Format( TDes& aBuf, TInt aResourceId, ...)
-    {
-	VA_LIST list;
-    VA_START(list,aResourceId);
-	TBuf<128> format;
-	CCoeEnv::Static()->ReadResource( format, aResourceId );
-	aBuf.FormatList( format, list );
-    }
-
-
-void MemSpyUiUtils::GetErrorText( TDes& aBuf, TInt aError )
-    {
-    if  ( aError == KErrNotSupported )
-        {
-        _LIT( KMemSpyErrorText, "Not Supported" );
-        aBuf = KMemSpyErrorText;
-        }
-    else if ( aError == KErrNotReady )
-        {
-        _LIT( KMemSpyErrorText, "Not Ready" );
-        aBuf = KMemSpyErrorText;
-        }
-    else if ( aError == KErrNotFound )
-        {
-        _LIT( KMemSpyErrorText, "Missing" );
-        aBuf = KMemSpyErrorText;
-        }
-    else if ( aError == KErrGeneral )
-        {
-        _LIT( KMemSpyErrorText, "General Error" );
-        aBuf = KMemSpyErrorText;
-        }
-    else
-        {
-        _LIT( KMemSpyItemValueError, "Error: %d" );
-        aBuf.Format( KMemSpyItemValueError, aError );
-        }
-    }
-
--- a/memspyui/source/MemSpyViewBase.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,413 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewBase.h"
-
-// System includes
-#include <eikrted.h>  // for example label control
-#include <txtrich.h>
-#include <apgtask.h>
-#include <akntitle.h>
-#include <akncontext.h>
-#include <aknnavi.h>
-#include <eiklbx.h>
-#include <eiklbm.h>
-#include <avkon.hrh>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineutils.h>
-#include <memspy/engine/memspyengineoutputsink.h>
-
-// User includes
-#include "MemSpyAppUi.h"
-#include "MemSpyDocument.h"
-#include "MemSpyContainer.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-
-CMemSpyViewBase::CMemSpyViewBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   iEngine( aEngine ), iObserver( aObserver )
-    {
-    }
-
-
-CMemSpyViewBase::~CMemSpyViewBase()
-    {
-    delete iListBox;
-    }
- 
-
-void CMemSpyViewBase::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* /*aSelectionRune*/ )
-    {
-    iSettings = &static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() )->MemSpyDocument().Settings();
-    //
-    User::LeaveIfError( SetParent( &aContainer ) );
-    SetContainerWindowL( aContainer );
-    
-    SetComponentsToInheritVisibility( ETrue );
-
-    iListBox = ConstructListBoxL();
-    if  ( iListBox )
-        {
-        iListBox->SetFocus( ETrue );
-        }
-
-    SetRect( aRect );
-    ActivateL();
-    }
-
-
-void CMemSpyViewBase::SetTitleL( const TDesC& aText )
-    {
-    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
-    CAknTitlePane* title = static_cast<CAknTitlePane*> ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    title->SetTextL( aText );
-    }
-
-
-TPtrC CMemSpyViewBase::TitleL() const
-    {
-    TPtrC ret( KNullDesC );
-    //
-    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
-    CAknTitlePane* title = static_cast<CAknTitlePane*> ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    if  ( title->Text() )
-        {
-        ret.Set( *title->Text() );
-        }
-    //
-    return ret;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewBase::PrepareParentViewL()
-    {
-    return NULL;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewBase::PrepareChildViewL()
-    {
-    return NULL;
-    }
-    
-    
-void CMemSpyViewBase::RefreshL()
-    {
-    if  ( iListBox )
-        {
-        iListBox->UpdateScrollBarsL();
-        }
-
-    DrawDeferred();
-    }
-
-
-TBool CMemSpyViewBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch( aCommand )
-        {
-	case EMemSpyCmdViewOutputToSink:
-        OnCmdViewOutputToSinkL();
-        break;
-    default:
-        handled = EFalse;
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewBase::DynInitMenuPaneL( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ )
-    {
-    }
-
-
-TUint CMemSpyViewBase::MenuCascadeResourceId() const
-    {
-    return 0;
-    }
-
-
-TInt CMemSpyViewBase::MenuCascadeCommandId() const
-    {
-    return 0;
-    }
-
-
-void CMemSpyViewBase::OnCmdViewOutputToSinkL()
-    {
-    if  ( iListBox )
-        {
-        // Prepare sink
-        CMemSpyEngineOutputSink& sink = iEngine.Sink();
-        HBufC* name = MemSpyEngineUtils::CleanupTextLC( TitleL() );
-        sink.OutputSectionHeadingL( *name, TChar('-') );
-        CleanupStack::PopAndDestroy( name );
-        sink.OutputPrefixSetLC( _L("  ") ); // Slight insertion
-        
-        // Get text from underlying listbox model...
-        MTextListBoxModel* model = static_cast< MTextListBoxModel* >( iListBox->Model() );
-        const TInt count = model->NumberOfItems();
-
-        // First pass to get max lengths
-        TInt maxLengthCaption = 0;
-        TInt maxLengthValue = 0;
-
-        for( TInt j=0; j<count; j++ )
-            {
-            const TPtrC pItem( model->ItemText( j ) );
-            const TInt length = pItem.Length();
-    
-            // Check if its split or not?
-            const TInt splitPos = pItem.FindF( _L("\t\t") );
-            if  ( splitPos > 0 )
-                {
-                maxLengthCaption = Max( maxLengthCaption, splitPos );
-                maxLengthValue = Max( maxLengthValue, length - splitPos + 1 );
-                }
-            else
-                {
-                maxLengthCaption = Max( maxLengthCaption, length );
-                }
-            }
-
-        // Second pass - real this time - to print the values
-        HBufC* line = HBufC::NewLC( ( maxLengthCaption + maxLengthValue ) + 20 );
-        TPtr pLine( line->Des() );
-        //
-        for( TInt i=0; i<count; i++ )
-            {
-            const TPtrC pItem( model->ItemText( i ) );
-            const TInt length = pItem.Length();
-            //
-            TPtrC pCaption( KNullDesC );
-            TPtrC pValue( KNullDesC );
-            //
-            const TInt splitPos = pItem.FindF( _L("\t\t") );
-            if  ( splitPos > 0 )
-                {
-                pCaption.Set( pItem.Left( splitPos ) );
-                pValue.Set( pItem.Mid( splitPos + 1 ) );
-                }
-            else
-                {
-                pCaption.Set( pItem );
-                }
-
-            // Remove initial tabs in caption
-            HBufC* caption = MemSpyEngineUtils::CleanupTextLC( pCaption );
-        
-            // Create value item & replace any further tabs
-            HBufC* value = MemSpyEngineUtils::CleanupTextLC( pValue );
-
-            // Now format the final line, with padding.
-            pLine.Justify( *caption, maxLengthCaption + 3, ELeft, TChar(' ') );
-            pLine.Append( *value );
-            CleanupStack::PopAndDestroy( 2, caption );
-
-            // Sink output
-            sink.OutputLineL( pLine );
-            }
-
-        // Remove prefix & tidy up
-        CleanupStack::PopAndDestroy( line );
-        sink.OutputBlankLineL();
-        CleanupStack::PopAndDestroy(); // clear prefix
-        }
-    }
-
-
-CEikListBox* CMemSpyViewBase::ConstructListBoxL()
-    {
-    delete iListBox;
-    iListBox = NULL;
-    CAknSettingStyleListBox* listbox = new(ELeave) CAknSettingStyleListBox();
-    iListBox = listbox;
-    //
-    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
-    listbox->SetContainerWindowL( *this );
-    listbox->CreateScrollBarFrameL( ETrue );
-    SetListBoxModelL();
-    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
-    listbox->SetListBoxObserver( this );
-    listbox->SetObserver( this );
-    listbox->SetComponentsToInheritVisibility( ETrue );
-    //
-    return listbox;
-    }
-
-
-void CMemSpyViewBase::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewBase::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
-    {
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-void CMemSpyViewBase::ReportEventL( MMemSpyViewObserver::TViewEventType aEvent, TAny* aContext )
-    {
-    iObserver.HandleMemSpyViewEventL( aEvent, ViewType(), *this, aContext );
-    }
-
-
-void CMemSpyViewBase::SetListBoxCurrentItemIndexL( TInt aIndex )
-    {
-    if  ( iListBox )
-        {
-        iListBox->SetCurrentItemIndex( aIndex );
-        HandleListBoxItemSelectedL( aIndex );
-        }
-    }
-
-
-CMemSpyContainer& CMemSpyViewBase::Container()
-    {
-    CMemSpyAppUi* appUi = static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() );
-    return appUi->Container();
-    }
-
-
-CMemSpySettings& CMemSpyViewBase::Settings()
-    {
-    return *iSettings;
-    }
-
-
-const CMemSpySettings& CMemSpyViewBase::Settings() const
-    {
-    return *iSettings;
-    }
-
-    
-void CMemSpyViewBase::Draw( const TRect& aRect ) const
-    {
-    CWindowGc& gc = SystemGc();
-    //
-    gc.SetPenStyle( CGraphicsContext::ENullPen );
-    gc.SetBrushColor( KRgbWhite );
-    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
-    gc.DrawRect( aRect );
-    }
-
-
-void CMemSpyViewBase::SizeChanged()
-    {
-    if  ( iListBox )
-        {
-        iListBox->SetRect( Rect() );
-        }
-    }
-
-
-void CMemSpyViewBase::FocusChanged(TDrawNow /*aDrawNow*/)
-    {
-    if  ( iListBox )
-        {
-        iListBox->SetFocus( IsFocused() );
-        }
-    }
-
-
-TInt CMemSpyViewBase::CountComponentControls() const
-    {
-    TInt count = 0;
-    if  ( iListBox )
-        {
-        ++count;
-        }
-    //
-    return count;
-    }
-
-
-CCoeControl* CMemSpyViewBase::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-    case 0:
-        return iListBox;
-    default:
-        return NULL;
-        }
-    }
-
-
-TKeyResponse CMemSpyViewBase::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-	{
-    TKeyResponse resp = EKeyWasNotConsumed;
-    if  ( iListBox )
-        {
-        resp = iListBox->OfferKeyEventL( aKeyEvent, aType );
-        }
-    //
-    if ( resp == EKeyWasNotConsumed && aType == EEventKeyDown && aKeyEvent.iCode == EKeyBackspace )
-        {
-        // When backspace is pushed, go to the parent view
-        CMemSpyAppUi* appUi = static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() );
-        appUi->Container().NavigateToParentViewL();
-        resp = EKeyWasConsumed;
-        }
-    //
-	return resp;
-	}
-
-
-void CMemSpyViewBase::HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType )
-    {
-    if  ( aControl == iListBox )
-        {
-        if  ( aEventType == MCoeControlObserver::EEventStateChanged )
-            {
-            const TInt index = iListBox->CurrentItemIndex();
-            HandleListBoxItemSelectedL( index );
-            }
-        }
-    }
-
-
-void CMemSpyViewBase::HandleListBoxEventL( CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
-    {
-    const TInt index = iListBox->CurrentItemIndex();
-    //
-    switch (aEventType)
-        {
-    case EEventItemActioned:
-    case EEventEnterKeyPressed:
-    case EEventItemDoubleClicked:
-        HandleListBoxItemActionedL( index );
-        break;
-
-    default:
-        break;
-        }
-    }
-
-
-
-
--- a/memspyui/source/MemSpyViewChunkList.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,346 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewChunkList.h"
-
-// System includes
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperchunk.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-
-
-
-CMemSpyViewChunkBase::CMemSpyViewChunkBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList* aList )
-:   CMemSpyViewBase( aEngine, aObserver ), iList( aList )
-    {
-    }
-
-
-CMemSpyViewChunkBase::~CMemSpyViewChunkBase()
-    {
-    delete iList;
-    }
-
-
-TBool CMemSpyViewChunkBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdChunkSortByName:
-        iList->SortByNameL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdChunkSortBySize:
-        iList->SortBySizeL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdChunkListing:
-        OnCmdListingL();
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewChunkBase::OnCmdListingL()
-    {
-    // Begin a new data stream
-    _LIT( KMemSpyContext, "Chunk List" );
-    _LIT( KMemSpyFolder, "Chunks" );
-    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
-
-    // Set prefix for overall listing
-    _LIT( KOverallPrefix, "Chunk List - " );
-    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
-
-    // Create header
-    CMemSpyEngineChunkList::OutputDataColumnsL( iEngine );
-    
-    // List items
-    const TInt count = iList->Count();
-    for(TInt i=0; i<count; i++)
-        {
-        const CMemSpyEngineChunkEntry& entry = iList->At( i );
-        //
-        entry.OutputDataL( iEngine.HelperChunk() );
-        }
-
-    // Tidy up
-    CleanupStack::PopAndDestroy(); // prefix
-
-    // End data stream
-    iEngine.Sink().DataStreamEndL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewChunkList::CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewChunkBase( aEngine, aObserver, NULL )
-    {
-    }
-
-
-CMemSpyViewChunkList::CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList )
-:   CMemSpyViewChunkBase( aEngine, aObserver, &aList )
-    {
-    }
-
-
-void CMemSpyViewChunkList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Chunks" );
-    SetTitleL( KTitle );
-
-    if  ( iList == NULL )
-        {
-        // Prepare code segment list
-        iList = iEngine.HelperChunk().ListL();
-        }
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    if  ( aSelectionRune != NULL )
-        {
-        iCurrentChunk = reinterpret_cast< CMemSpyEngineChunkEntry* >( aSelectionRune );
-        const TInt index = iList->ItemIndex( *iCurrentChunk );
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        }
-
-    iListBox->DrawDeferred();
-    }
-
-
-TMemSpyViewType CMemSpyViewChunkList::ViewType() const
-    {
-    return EMemSpyViewTypeChunkList;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewChunkList::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewChunkList::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewChunkDetails( iEngine, iObserver, *iList, *iCurrentChunk );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iList = NULL;
-
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewChunkList::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iList );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewChunkList::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineChunkEntry& chunk = iList->At( aIndex );
-        iCurrentChunk = &chunk;
-        }
-    else
-        {
-        iCurrentChunk = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewChunkList::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineChunkEntry& chunk = iList->At( aIndex );
-        iCurrentChunk = &chunk;
-        }
-    else
-        {
-        iCurrentChunk = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewChunkDetails::CMemSpyViewChunkDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList, CMemSpyEngineChunkEntry& aSelectedChunk )
-:   CMemSpyViewChunkBase( aEngine, aObserver, &aList ), iChunk( aSelectedChunk )
-    {
-    }
-
-
-void CMemSpyViewChunkDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Chunk Details" );
-    SetTitleL( KTitle );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewChunkDetails::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewChunkDetails::ViewType() const
-    {
-    return EMemSpyViewTypeChunkDetails;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewChunkDetails::PrepareParentViewL()
-    {
-    CMemSpyViewChunkList* parent = new(ELeave) CMemSpyViewChunkList( iEngine, iObserver, *iList );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iList = NULL;
-
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iChunk );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewChunkDetails::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iChunk );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewCodeSegList.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,500 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewCodeSegList.h"
-
-// System includes
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelpercodesegment.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyExportBitmapsToMemoryCardDialog.h"
-
-
-
-CMemSpyViewCodeSegBase::CMemSpyViewCodeSegBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList* aList )
-:   CMemSpyViewBase( aEngine, aObserver ), iList( aList )
-    {
-    }
-
-
-CMemSpyViewCodeSegBase::~CMemSpyViewCodeSegBase()
-    {
-    delete iList;
-    }
-
-
-TBool CMemSpyViewCodeSegBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdCodeSegSortByName:
-        iList->SortByFileNameL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdCodeSegSortByCodeSize:
-        iList->SortByCodeSizeL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdCodeSegSortByDataSize:
-        iList->SortByDataSizeL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdCodeSegSortByUid:
-        iList->SortByUidsL();
-        CMemSpyViewBase::RefreshL();
-        break;
-    case EMemSpyCmdCodeSegListing:
-        OnCmdCodeSegmentListingL();
-        break;
-    case EMemSpyCmdCodeSegShowItemsAll:
-        OnCmdShowItemsAllL();
-        break;
-    case EMemSpyCmdCodeSegShowItemsGlobalData:
-        OnCmdShowItemsGlobalDataL();
-        break;
-
-    case EMemSpyCmdCodeSegShowCapsWithTCBProcess:
-    case EMemSpyCmdCodeSegShowCapsWithTCBAll:              
-        OnCmdFilterByCapabilityL( ECapabilityTCB, aCommand == EMemSpyCmdCodeSegShowCapsWithTCBAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithCommDDProcess:
-    case EMemSpyCmdCodeSegShowCapsWithCommDDAll:
-        OnCmdFilterByCapabilityL( ECapabilityCommDD, aCommand == EMemSpyCmdCodeSegShowCapsWithCommDDAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithPowerMgmtProcess:
-    case EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll:
-        OnCmdFilterByCapabilityL( ECapabilityPowerMgmt, aCommand == EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithMultimediaDDProcess:
-    case EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll:
-        OnCmdFilterByCapabilityL( ECapabilityMultimediaDD, aCommand == EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithReadDeviceDataProcess:
-    case EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll:
-        OnCmdFilterByCapabilityL( ECapabilityReadDeviceData, aCommand == EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataProcess:
-    case EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll:
-        OnCmdFilterByCapabilityL( ECapabilityWriteDeviceData, aCommand == EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithDRMProcess:
-    case EMemSpyCmdCodeSegShowCapsWithDRMAll:
-        OnCmdFilterByCapabilityL( ECapabilityDRM, aCommand == EMemSpyCmdCodeSegShowCapsWithDRMAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithTrustedUIProcess:
-    case EMemSpyCmdCodeSegShowCapsWithTrustedUIAll:
-        OnCmdFilterByCapabilityL( ECapabilityTrustedUI, aCommand == EMemSpyCmdCodeSegShowCapsWithTrustedUIAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithProtServProcess:
-    case EMemSpyCmdCodeSegShowCapsWithProtServAll:
-        OnCmdFilterByCapabilityL( ECapabilityProtServ, aCommand == EMemSpyCmdCodeSegShowCapsWithProtServAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithDiskAdminProcess:
-    case EMemSpyCmdCodeSegShowCapsWithDiskAdminAll:
-        OnCmdFilterByCapabilityL( ECapabilityDiskAdmin, aCommand == EMemSpyCmdCodeSegShowCapsWithDiskAdminAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithNetworkControlProcess:
-    case EMemSpyCmdCodeSegShowCapsWithNetworkControlAll:
-        OnCmdFilterByCapabilityL( ECapabilityNetworkControl, aCommand == EMemSpyCmdCodeSegShowCapsWithNetworkControlAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithAllFilesProcess:
-    case EMemSpyCmdCodeSegShowCapsWithAllFilesAll:
-        OnCmdFilterByCapabilityL( ECapabilityAllFiles, aCommand == EMemSpyCmdCodeSegShowCapsWithAllFilesAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithSwEventProcess:
-    case EMemSpyCmdCodeSegShowCapsWithSwEventAll:
-        OnCmdFilterByCapabilityL( ECapabilitySwEvent, aCommand == EMemSpyCmdCodeSegShowCapsWithSwEventAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithNetworkServicesProcess:
-    case EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll:
-        OnCmdFilterByCapabilityL( ECapabilityNetworkServices, aCommand == EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithLocalServicesProcess:
-    case EMemSpyCmdCodeSegShowCapsWithLocalServicesAll:
-        OnCmdFilterByCapabilityL( ECapabilityLocalServices, aCommand == EMemSpyCmdCodeSegShowCapsWithLocalServicesAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithReadUserDataProcess:
-    case EMemSpyCmdCodeSegShowCapsWithReadUserDataAll:
-        OnCmdFilterByCapabilityL( ECapabilityReadUserData, aCommand == EMemSpyCmdCodeSegShowCapsWithReadUserDataAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithWriteUserDataProcess:
-    case EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll:
-        OnCmdFilterByCapabilityL( ECapabilityWriteUserData, aCommand == EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithLocationProcess:
-    case EMemSpyCmdCodeSegShowCapsWithLocationAll:
-        OnCmdFilterByCapabilityL( ECapabilityLocation, aCommand == EMemSpyCmdCodeSegShowCapsWithLocationAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithSurroundingsDDProcess:
-    case EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll:
-        OnCmdFilterByCapabilityL( ECapabilitySurroundingsDD, aCommand == EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll );
-        break;
-    case EMemSpyCmdCodeSegShowCapsWithUserEnvProcess:
-    case EMemSpyCmdCodeSegShowCapsWithUserEnvAll:
-        OnCmdFilterByCapabilityL( ECapabilityUserEnvironment, aCommand == EMemSpyCmdCodeSegShowCapsWithUserEnvAll );
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewCodeSegBase::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewCodeSegBase::OnCmdCodeSegmentListingL()
-    {
-    // Begin a new data stream
-    _LIT( KMemSpyContext, "CodeSeg List - " );
-    _LIT( KMemSpyFolder, "CodeSegs" );
-    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
-
-    // Set prefix for overall listing
-    _LIT(KOverallPrefix, "CodeSeg List - ");
-    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
-
-    // Create header
-    CMemSpyEngineCodeSegList::OutputDataColumnsL( iEngine );
-    
-    // List items
-    const TInt count = iList->Count();
-    for(TInt i=0; i<count; i++)
-        {
-        const CMemSpyEngineCodeSegEntry& entry = iList->At( i );
-        //
-        entry.OutputDataL( iEngine.HelperCodeSegment() );
-        }
-
-    // Tidy up
-    CleanupStack::PopAndDestroy(); // prefix
-
-    // End data stream
-    iEngine.Sink().DataStreamEndL();
-    }
-
-
-void CMemSpyViewCodeSegBase::OnCmdShowItemsAllL()
-    {
-    iList->ShowAllL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewCodeSegBase::OnCmdShowItemsGlobalDataL()
-    {
-    iList->ShowOnlyEntriesWithGlobalDataL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewCodeSegBase::OnCmdFilterByCapabilityL( TCapability aCapability, TBool aAllBinaries )
-    {
-    TMemSpyViewCodeSegFilter filterLogic( aCapability, aAllBinaries );
-    TMemSpyEngineVisibiltyFunction<CMemSpyEngineCodeSegEntry> filterFunction( TMemSpyViewCodeSegFilter::FilterItem, &filterLogic );
-    iList->ShowL( filterFunction );
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewCodeSegList::CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewCodeSegBase( aEngine, aObserver, NULL )
-    {
-    }
-
-
-CMemSpyViewCodeSegList::CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList )
-:   CMemSpyViewCodeSegBase( aEngine, aObserver, &aList )
-    {
-    }
-
-
-void CMemSpyViewCodeSegList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Code Segments" );
-    SetTitleL( KTitle );
-
-    if  ( iList == NULL )
-        {
-        // Prepare code segment list
-        iList = iEngine.HelperCodeSegment().CodeSegmentListL();
-        iList->SortByCodeSizeL();
-        }
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    if  ( aSelectionRune != NULL )
-        {
-        iCurrentCodeSegment = reinterpret_cast< CMemSpyEngineCodeSegEntry* >( aSelectionRune );
-        const TInt index = iList->ItemIndex( *iCurrentCodeSegment );
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        }
-
-    iListBox->DrawDeferred();
-    }
-
-
-TMemSpyViewType CMemSpyViewCodeSegList::ViewType() const
-    {
-    return EMemSpyViewTypeCodeSegmentList;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewCodeSegList::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewCodeSegList::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewCodeSegDetails( iEngine, iObserver, *iList, *iCurrentCodeSegment );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iList = NULL;
-
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewCodeSegList::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iList );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewCodeSegList::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineCodeSegEntry& codeSeg = iList->At( aIndex );
-        iCurrentCodeSegment = &codeSeg;
-        }
-    else
-        {
-        iCurrentCodeSegment = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewCodeSegList::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineCodeSegEntry& codeSeg = iList->At( aIndex );
-        iCurrentCodeSegment = &codeSeg;
-        }
-    else
-        {
-        iCurrentCodeSegment = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewCodeSegDetails::CMemSpyViewCodeSegDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList, CMemSpyEngineCodeSegEntry& aSelectedCodeSegment )
-:   CMemSpyViewCodeSegBase( aEngine, aObserver, &aList ), iCodeSegment( aSelectedCodeSegment )
-    {
-    }
-
-
-void CMemSpyViewCodeSegDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Code Segment Details" );
-    SetTitleL( KTitle );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewCodeSegDetails::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewCodeSegDetails::ViewType() const
-    {
-    return EMemSpyViewTypeCodeSegmentDetails;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewCodeSegDetails::PrepareParentViewL()
-    {
-    CMemSpyViewCodeSegList* parent = new(ELeave) CMemSpyViewCodeSegList( iEngine, iObserver, *iList );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iList = NULL;
-
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iCodeSegment );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewCodeSegDetails::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iCodeSegment );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-TBool TMemSpyViewCodeSegFilter::FilterItem( const CMemSpyEngineCodeSegEntry*& aItem, TAny* aRune )
-    {
-    TMemSpyViewCodeSegFilter* self = reinterpret_cast< TMemSpyViewCodeSegFilter* >( aRune );
-
-    TBool match = aItem->HasCapability( self->iCapability );
-    if  ( match && self->iAllBinaries == EFalse )
-        {
-        // We're only looking for EXE's...
-        TParsePtrC parser( aItem->FileName() );
-        const TPtrC pExtension( parser.Ext() );
-        _LIT(KProcessExtension, ".exe");
-        //
-        match = ( pExtension.CompareF( KProcessExtension ) == 0 );
-        }
-    //
-    return match;
-    }
-
-
-
--- a/memspyui/source/MemSpyViewDriveInfo.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,381 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewDriveInfo.h"
-
-// System includes
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperfilesystem.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-
-
-
-CMemSpyViewDriveInfoBase::CMemSpyViewDriveInfoBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewDriveInfoBase::~CMemSpyViewDriveInfoBase()
-    {
-    if  ( iList )
-        {
-        iList->SetObserver( NULL );
-        }
-    //
-    delete iList;
-    }
-
-
-void CMemSpyViewDriveInfoBase::BaseConstructL()
-    {
-    iList = iEngine.HelperFileSystem().DriveListL();
-    }
-
-
-TBool CMemSpyViewDriveInfoBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewDriveList::CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iUseDriveNumber( EFalse ), iDriveNumber( EDriveA )
-    {
-    }
-
-
-CMemSpyViewDriveList::CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber )
-:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iUseDriveNumber( ETrue ), iDriveNumber( aDriveNumber )
-    {
-    }
-
-
-void CMemSpyViewDriveList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    BaseConstructL();
-
-    _LIT( KTitle, "Drive Summary" );
-    SetTitleL( KTitle );
-
-    // Start watching list
-    iList->SetObserver( this );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    if  ( iUseDriveNumber )
-        {
-#ifdef _DEBUG
-        RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - iDriveNumber: %c:", iDriveNumber + 'A' );
-#endif
-        iCurrentDrive = iList->EntryByDriveNumber( iDriveNumber );
-
-#ifdef _DEBUG
-        RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - iCurrentDrive: 0x%08x", iCurrentDrive );
-#endif
-        if  ( iCurrentDrive )
-            {
-            const TInt index = iList->ItemIndex( *iCurrentDrive );
-#ifdef _DEBUG
-            RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - index: %d", index );
-#endif
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }
-        }
-    
-    iListBox->DrawDeferred();
-    }
-
-
-TMemSpyViewType CMemSpyViewDriveList::ViewType() const
-    {
-    return EMemSpyViewTypeDriveSummary;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewDriveList::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    //
-    if  ( parent )
-        {
-        iList->SetObserver( NULL );
-        }
-    //
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewDriveList::PrepareChildViewL()
-    {
-    ASSERT( iCurrentDrive );
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewDriveInfo( iEngine, iObserver, iCurrentDrive->DriveNumber() );
-
-    // Stop watching list
-    if  ( child )
-        {
-        iList->SetObserver( NULL );
-        }
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iList = NULL;
-
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewDriveList::RefreshL()
-    {
-    if  ( iList )
-        {
-        iList->SetObserver( NULL );
-        }
-    //
-    CMemSpyEngineDriveList* list = iEngine.HelperFileSystem().DriveListL();
-    delete iList;
-    iList = list;
-    iList->SetObserver( this );
-    //
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewDriveList::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iList );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewDriveList::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineDriveEntry& entry = iList->At( aIndex );
-        iCurrentDrive = &entry;
-        }
-    else
-        {
-        iCurrentDrive = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewDriveList::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iList->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineDriveEntry& entry = iList->At( aIndex );
-        iCurrentDrive = &entry;
-        }
-    else
-        {
-        iCurrentDrive = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-void CMemSpyViewDriveList::HandleDriveListChangedL( const CMemSpyEngineDriveList& /*aList*/ )
-    {
-    RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewDriveInfo::CMemSpyViewDriveInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber )
-:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iDriveNumber( aDriveNumber )
-    {
-    }
-
-
-void CMemSpyViewDriveInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    BaseConstructL();
-    //
-    iDriveInfo = iList->EntryByDriveNumber( iDriveNumber );
-    if  ( !iDriveInfo )
-        {
-        User::Leave( KErrNotFound );
-        }
-    iDriveInfo->SetObserver( this );
-
-    _LIT( KTitleFormat, "Drive %S Info" );
-    const TDriveName name( iDriveInfo->DriveUnit().Name() );
-    TName title;
-    title.Format( KTitleFormat, &name );
-    SetTitleL( title );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewDriveInfo::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewDriveInfo::ViewType() const
-    {
-    return EMemSpyViewTypeDriveInfo;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewDriveInfo::PrepareParentViewL()
-    {
-    ASSERT( iDriveInfo );
-    CMemSpyViewDriveList* parent = new(ELeave) CMemSpyViewDriveList( iEngine, iObserver, iDriveInfo->DriveNumber() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( parent );
-    //
-    if  ( parent )
-        {
-        iDriveInfo->SetObserver( NULL );
-        }
-    //
-    return parent;
-    }
-
-
-void CMemSpyViewDriveInfo::SetListBoxModelL()
-    {
-    if  ( iDriveInfo )
-        {
-        CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-        listbox->Model()->SetItemTextArray( iDriveInfo );
-        listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-        }
-    }
-
-
-void CMemSpyViewDriveInfo::HandleDriveEntryChangedL( const CMemSpyEngineDriveEntry& /*aEntry*/ )
-    {
-    RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewECom.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,475 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewECom.h"
-
-// System includes
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyenginehelperecom.h>
-
-// User includes
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-CMemSpyViewECom::CMemSpyViewECom( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-void CMemSpyViewECom::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "ECom" );
-    SetTitleL( KTitle );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Select first item
-    TInt index = KErrNotFound;
-    if  ( aSelectionRune != NULL )
-        {
-        iCurrent = reinterpret_cast< CMemSpyEngineEComCategory* >( aSelectionRune );
-        index = iEngine.HelperECom().IndexOf( *iCurrent );
-        }
-
-    if  ( index >= 0 && index < iEngine.HelperECom().Count() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewECom::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewECom::ViewType() const
-    {
-    return EMemSpyViewTypeECom;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewECom::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewECom::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComCategory( iEngine, iObserver, *iCurrent );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewECom::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iEngine.HelperECom() );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewECom::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iEngine.HelperECom().Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComCategory& category = iEngine.HelperECom().At( aIndex );
-        iCurrent = &category;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewECom::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iEngine.HelperECom().Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComCategory& category = iEngine.HelperECom().At( aIndex );
-        iCurrent = &category;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewEComCategory::CMemSpyViewEComCategory( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComCategory& aCategory )
-:   CMemSpyViewBase( aEngine, aObserver ), iCategory( aCategory )
-    {
-    }
-
-
-void CMemSpyViewEComCategory::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    SetTitleL( iCategory.Name() );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Select first item
-    TInt index = KErrNotFound;
-    if  ( aSelectionRune != NULL )
-        {
-        iCurrent = reinterpret_cast< CMemSpyEngineEComInterface* >( aSelectionRune );
-        index = iCategory.IndexOf( *iCurrent );
-        }
-
-    if  ( index >= 0 && index < iCategory.Count() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewEComCategory::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewEComCategory::ViewType() const
-    {
-    return EMemSpyViewTypeEComCategory;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewEComCategory::PrepareParentViewL()
-    {
-    CMemSpyViewECom* parent = new(ELeave) CMemSpyViewECom( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iCategory );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewEComCategory::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComInterface( iEngine, iObserver, *iCurrent );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewEComCategory::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iCategory );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewEComCategory::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iCategory.Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComInterface& entry = iCategory.At( aIndex );
-        iCurrent = &entry;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewEComCategory::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iCategory.Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComInterface& entry = iCategory.At( aIndex );
-        iCurrent = &entry;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewEComInterface::CMemSpyViewEComInterface( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComInterface& aInterface )
-:   CMemSpyViewBase( aEngine, aObserver ), iInterface( aInterface )
-    {
-    }
-
-
-void CMemSpyViewEComInterface::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    SetTitleL( iInterface.Name() );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Select first item
-    TInt index = KErrNotFound;
-    if  ( aSelectionRune != NULL )
-        {
-        iCurrent = reinterpret_cast< CMemSpyEngineEComImplementation* >( aSelectionRune );
-        index = iInterface.IndexOf( *iCurrent );
-        }
-
-    if  ( index >= 0 && index < iInterface.Count() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewEComInterface::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewEComInterface::ViewType() const
-    {
-    return EMemSpyViewTypeEComInterface;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewEComInterface::PrepareParentViewL()
-    {
-    CMemSpyViewEComCategory* parent = new(ELeave) CMemSpyViewEComCategory( iEngine, iObserver, iInterface.Category() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iInterface );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewEComInterface::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComImplementation( iEngine, iObserver, *iCurrent );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewEComInterface::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iInterface );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewEComInterface::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iInterface.Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComImplementation& entry = iInterface.At( aIndex );
-        iCurrent = &entry;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewEComInterface::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iInterface.Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineEComImplementation& entry = iInterface.At( aIndex );
-        iCurrent = &entry;
-        }
-    else
-        {
-        iCurrent = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewEComImplementation::CMemSpyViewEComImplementation( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComImplementation& aImplementation )
-:   CMemSpyViewBase( aEngine, aObserver ), iImplementation( aImplementation )
-    {
-    }
-
-
-void CMemSpyViewEComImplementation::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    SetTitleL( iImplementation.Name() );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Select first item
-    if  ( iImplementation.MdcaCount() )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewEComImplementation::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewEComImplementation::ViewType() const
-    {
-    return EMemSpyViewTypeEComImplementation;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewEComImplementation::PrepareParentViewL()
-    {
-    CMemSpyViewEComInterface* parent = new(ELeave) CMemSpyViewEComInterface( iEngine, iObserver, iImplementation.Interface() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iImplementation );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewEComImplementation::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iImplementation );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
--- a/memspyui/source/MemSpyViewFBServBitmaps.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,746 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewFBServBitmaps.h"
-
-// System includes
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyExportBitmapsToMemoryCardDialog.h"
-
-// Constants
-const TInt KMemSpyIdleResetListboxTimerPeriod = 500000;
-const TInt KMemSpyImageSlideshowPeriod = 1000000;
-
-
-
-CMemSpyViewFBServBase::CMemSpyViewFBServBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps )
-:   CMemSpyViewBase( aEngine, aObserver ), iBitmaps( aBitmaps )
-    {
-    }
-
-
-CMemSpyViewFBServBase::~CMemSpyViewFBServBase()
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBase::~CMemSpyViewFBServBase() - deleting bitmaps: 0x%08x", iBitmaps );
-#endif
-    delete iBitmaps;
-    }
-
-
-TBool CMemSpyViewFBServBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-	case EMemSpyCmdImagesSlideshow:
-    	OnCmdSlideShowL();
-        break;
-#ifndef __WINS__
-	case EMemSpyCmdImagesSaveAllToMemoryCard:
-        OnCmdExportToMemoryCardL();
-        break;
-#endif
-	case EMemSpyCmdImagesListing:
-        OnCmdImageListingL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewFBServBase::OnCmdSlideShowL()
-    {
-    TInt index = 0;
-    CMemSpyViewFBServSlideshow::NewLD( *iBitmaps, index );
-    
-    // Select the item that was last displayed
-    const TInt count = iBitmaps->Count();
-    if  ( iListBox && index >= 0 && index < count )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewFBServBase::OnCmdExportToMemoryCardL()
-    {
-    // Deletes itself
-    CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *iBitmaps );
-    }
-
-
-void CMemSpyViewFBServBase::OnCmdImageListingL()
-    {
-    // Begin a new data stream
-    _LIT( KMemSpyContext, "Bitmap List - " );
-    _LIT( KMemSpyFolder, "Bitmaps" );
-    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
-
-    // Set prefix for overall listing
-    _LIT(KOverallPrefix, "Bitmap List - ");
-    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
-
-    // Create header
-    CMemSpyEngineFbServBitmap::OutputDataColumnsL( iEngine );
-    
-    // List items
-    const TInt count = iBitmaps->Count();
-    for(TInt i=0; i<count; i++)
-        {
-        const CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( i );
-        //
-        bitmap.OutputDataL( iEngine );
-        }
-
-    // Tidy up
-    CleanupStack::PopAndDestroy(); // prefix
-
-    // End data stream
-    iEngine.Sink().DataStreamEndL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewFBServBase( aEngine, aObserver, NULL )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps(1) - iBitmaps is: 0x%08x", iBitmaps );
-#endif
-    }
-
-
-CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps )
-:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps(2) - iBitmaps is: 0x%08x", iBitmaps );
-#endif
-    }
-
-
-CMemSpyViewFBServBitmaps::~CMemSpyViewFBServBitmaps()
-    {
-    delete iIdleResetListboxTimer;
-    iBitmapHandles.Close();
-    }
-
-
-void CMemSpyViewFBServBitmaps::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Font & Bitmap Server" );
-    SetTitleL( KTitle );
-
-    if  ( iBitmaps == NULL )
-        {
-        // Prepare bitmap handles
-        iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( iBitmapHandles );
-
-        // Create bitmap array - construction occurs asynchronously
-        iBitmaps = CMemSpyEngineFbServBitmapArray::NewL( CActive::EPriorityIdle, iBitmapHandles, *this );
-        }
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Create idle listbox refresh timer
-    if  ( iBitmaps->Count() == 0 )
-        {
-        iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityLow );
-        }
-    else
-        {
-        if  ( aSelectionRune != NULL )
-            {
-            iCurrentBitmap = reinterpret_cast< CMemSpyEngineFbServBitmap* >( aSelectionRune );
-            const TInt index = iBitmaps->BitmapIndexByHandle( iCurrentBitmap->Handle() );
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }
-
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewFBServBitmaps::RefreshL()
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBitmaps::RefreshL() - iBitmaps->Count(): %d", iBitmaps->Count());
-#endif
-
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewFBServBitmaps::ViewType() const
-    {
-    return EMemSpyViewTypeFBServBitmaps;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewFBServBitmaps::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewFBServBitmaps::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = new(ELeave) CMemSpyViewFBServBitmapInfo( iEngine, iObserver, iBitmaps, *iCurrentBitmap );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iBitmaps = NULL;
-
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewFBServBitmaps::HandleFbServBitmapArrayEventL( TEvent aEvent )
-    {
-    if  ( aEvent == EBitmapItemsCreated )
-        {
-        }
-    else if ( aEvent == EBitmapArrayConstructionComplete )
-        {
-        }
-    //
-    iIdleResetListboxTimer->Cancel();
-    iIdleResetListboxTimer->Start( KMemSpyIdleResetListboxTimerPeriod/2, KMemSpyIdleResetListboxTimerPeriod, TCallBack( IdleUpdateListBoxModel, this ) );
-    }
-
-
-void CMemSpyViewFBServBitmaps::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iBitmaps );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewFBServBitmaps::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    const TInt count = iBitmaps->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( aIndex );
-        iCurrentBitmap = &bitmap;
-        }
-    else
-        {
-        iCurrentBitmap = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewFBServBitmaps::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    const TInt count = iBitmaps->Count();
-    if  ( aIndex >= 0 && aIndex < count )
-        {
-        CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( aIndex );
-        iCurrentBitmap = &bitmap;
-        }
-    else
-        {
-        iCurrentBitmap = NULL;
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-TInt CMemSpyViewFBServBitmaps::IdleUpdateListBoxModel( TAny* aSelf )
-    {
-    CMemSpyViewFBServBitmaps* self = reinterpret_cast< CMemSpyViewFBServBitmaps* >( aSelf );
-    TRAP_IGNORE( self->DoIdleUpdateListBoxModelL() );
-    return EFalse;
-    }
-
-
-void CMemSpyViewFBServBitmaps::DoIdleUpdateListBoxModelL()
-    {
-    // Try to maintain current item selection if at all possible.
-    TInt handle = 0;
-    if  ( iCurrentBitmap )
-        {
-        handle = iCurrentBitmap->Handle();
-        iCurrentBitmap = NULL;
-        }
-   
-    // Update list box & model
-    iListBox->HandleItemAdditionL();
-    iListBox->DrawDeferred();
-    
-    // Try to select previous item if it is still available
-    const TInt index = iBitmaps->BitmapIndexByHandle( handle );
-    if  ( index >= 0 && index < iBitmaps->Count() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        }
-
-    iIdleResetListboxTimer->Cancel();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewFBServBitmapInfo::CMemSpyViewFBServBitmapInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap )
-:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps ), iBitmapObject( aSelectedBitmap )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBitmapInfo::CMemSpyViewFBServBitmapInfo() - iBitmaps is: 0x%08x", iBitmaps );
-#endif
-    }
-
-
-void CMemSpyViewFBServBitmapInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Bitmap Details" );
-    SetTitleL( KTitle );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    
-    if  ( iBitmaps->Count() )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-        }
-    }
-
-
-void CMemSpyViewFBServBitmapInfo::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewFBServBitmapInfo::ViewType() const
-    {
-    return EMemSpyViewTypeFBServBitmapInfo;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewFBServBitmapInfo::PrepareParentViewL()
-    {
-    CMemSpyViewFBServBitmaps* parent = new(ELeave) CMemSpyViewFBServBitmaps( iEngine, iObserver, iBitmaps );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iBitmaps = NULL;
-
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iBitmapObject );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewFBServBitmapInfo::PrepareChildViewL()
-    {
-    CMemSpyViewFBServBitmapViewer* child = new(ELeave) CMemSpyViewFBServBitmapViewer( iEngine, iObserver, iBitmaps, iBitmapObject );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iBitmaps = NULL;
-
-    CleanupStack::PushL( child );
-    CEikAppUi* appUi = static_cast< CEikAppUi* >( iEikonEnv->AppUi() );
-    const TRect rect( TPoint( 0, 0 ), appUi->ClientRect().Size() );
-    child->ConstructL( rect, *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewFBServBitmapInfo::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iBitmapObject );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewFBServBitmapInfo::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    // Only report the event if its the first item that was actioned
-    if  ( aIndex == 0 )
-        {
-        ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-        }
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewFBServBitmapViewer::CMemSpyViewFBServBitmapViewer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap )
-:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps ), iBitmapObject( aSelectedBitmap )
-    {
-#ifdef _DEBUG
-    RDebug::Printf("CMemSpyViewFBServBitmapViewer::CMemSpyViewFBServBitmapViewer() - iBitmaps is: 0x%08x", iBitmaps );
-#endif
-    }
-
-
-CMemSpyViewFBServBitmapViewer::~CMemSpyViewFBServBitmapViewer()
-    {
-    delete iImage;
-    }
-
-
-void CMemSpyViewFBServBitmapViewer::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Bitmap Preview" );
-    SetTitleL( KTitle );
-
-    // Finish construction
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Prepare image
-    iImage = new(ELeave) CEikImage();
-    iImage->SetContainerWindowL( *this );
-    iImage->SetPicture( &iBitmapObject.Bitmap(), NULL );
-    iImage->SetPictureOwnedExternally( ETrue );
-    SizeChanged();
-    }
-
-
-void CMemSpyViewFBServBitmapViewer::RefreshL()
-    {
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewFBServBitmapViewer::ViewType() const
-    {
-    return EMemSpyViewTypeFBServBitmapViewer;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewFBServBitmapViewer::PrepareParentViewL()
-    {
-    CMemSpyViewFBServBitmapInfo* parent = new(ELeave) CMemSpyViewFBServBitmapInfo( iEngine, iObserver, iBitmaps, iBitmapObject );
-
-    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-    // This object is about to die in any case.
-    iBitmaps = NULL;
-
-    CleanupStack::PushL( parent );
-    CEikAppUi* appUi = static_cast< CEikAppUi* >( iEikonEnv->AppUi() );
-    const TRect rect( TPoint( 0, 0 ), appUi->ClientRect().Size() );
-    parent->ConstructL( rect, *Parent() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewFBServBitmapViewer::SetListBoxModelL()
-    {
-    }
-
-
-CEikListBox* CMemSpyViewFBServBitmapViewer::ConstructListBoxL()
-    {
-    return NULL;
-    }
-
-
-void CMemSpyViewFBServBitmapViewer::Draw( const TRect& /*aRect*/ ) const
-    {
-    CWindowGc& gc = SystemGc();
-    //
-    gc.SetPenStyle( CGraphicsContext::ENullPen );
-    gc.SetBrushColor( KRgbWhite );
-    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
-    gc.DrawRect( Rect() );
-    //
-    gc.SetBrushColor( KRgbBlack );
-    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
-    gc.DrawRect( iBorderRect );
-    }
-    
-
-void CMemSpyViewFBServBitmapViewer::SizeChanged()
-    {
-    TRect rect( Rect() );
-    TSize size( rect.Size() );
-    //
-    TSize bitmapSize( iBitmapObject.Bitmap().SizeInPixels() );
-
-    // Try to center image, if possible.
-    if  ( bitmapSize.iWidth < size.iWidth )
-        {
-        const TInt offset = ( size.iWidth - bitmapSize.iWidth) / 2;
-        rect.Move( offset, 0 );
-        size.iWidth = bitmapSize.iWidth;
-        }
-    if  ( bitmapSize.iHeight < size.iHeight )
-        {
-        const TInt offset = ( size.iHeight - bitmapSize.iHeight) / 2;
-        rect.Move( 0, offset );
-        size.iHeight = bitmapSize.iHeight;
-        }
-    //
-    rect.SetSize( size );
-    if  ( iImage )
-        {
-        iImage->SetRect( rect );
-        }
-    iBorderRect = rect;
-    iBorderRect.Grow( 2, 2 );
-    }
-
-
-TInt CMemSpyViewFBServBitmapViewer::CountComponentControls() const
-    {
-    TInt count = 0;
-    //
-    if  ( iImage )
-        {
-        ++count;
-        }
-    //
-    return count;
-    }
-
-
-CCoeControl* CMemSpyViewFBServBitmapViewer::ComponentControl( TInt /*aIndex*/ ) const
-    {
-    return iImage;
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewFBServSlideshow::CMemSpyViewFBServSlideshow( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex )
-:   iBitmaps( aBitmaps ), iIndex( aIndex )
-    {
-    }
-
-
-CMemSpyViewFBServSlideshow::~CMemSpyViewFBServSlideshow()
-    {
-    delete iTimer;
-    }
-
-
-void CMemSpyViewFBServSlideshow::ConstructL()
-    {
-    iTimer = CPeriodic::NewL( CActive::EPriorityLow );
-    iTimer->Start( KMemSpyImageSlideshowPeriod, KMemSpyImageSlideshowPeriod, TCallBack( IdleUpdate, this ) );
-    }
-
-
-void CMemSpyViewFBServSlideshow::NewLD( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex )
-    {
-    CMemSpyViewFBServSlideshow* self = new(ELeave) CMemSpyViewFBServSlideshow( aBitmaps, aIndex );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    //
-    self->ExecuteLD( R_MEMSPY_IMAGE_SLIDESHOW );
-    }
-
-
-void CMemSpyViewFBServSlideshow::PreLayoutDynInitL()
-    {
-    ShowNextImageL();
-    }
-
-
-TBool CMemSpyViewFBServSlideshow::OkToExitL( TInt /*aButtonId*/ )
-    {
-    return ETrue;
-    }
-
-
-TInt CMemSpyViewFBServSlideshow::IdleUpdate( TAny* aSelf )
-    {
-    CMemSpyViewFBServSlideshow* self = reinterpret_cast< CMemSpyViewFBServSlideshow* >( aSelf );
-    TRAP_IGNORE( self->ShowNextImageL() );
-    return EFalse;
-    }
-
-
-void CMemSpyViewFBServSlideshow::ShowNextImageL()
-    {
-	CEikImage* imageControl = static_cast< CEikImage* >( Control(EMemSpyCtrlIdSlideShowImage) );
-
-    // Get the right image
-    const TInt imageCount = iBitmaps.Count();
-    if  ( iIndex < imageCount )
-        {
-        CMemSpyEngineFbServBitmap& bitmap = iBitmaps.At( iIndex );
-        imageControl->SetPicture( &bitmap.Bitmap(), NULL );
-        imageControl->SetPictureOwnedExternally( ETrue );
-        
-        // Prepare title
-        const TSize size( bitmap.Bitmap().SizeInPixels() );
-        _LIT(KTitleFormat, "%3d x %3d");
-        TBuf<128> title;
-        title.Format( KTitleFormat, size.iWidth, size.iHeight );
-        SetTitleL( title );
-        //
-        User::ResetInactivityTime();
-        //
-        Layout();
-        //
-        ++iIndex;
-        }
-    else
-        {
-        // Dismiss myself.
-        delete this;
-        }
-    }
-
--- a/memspyui/source/MemSpyViewHeapTracking.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewHeapTracking.h"
-
-// System includes
-#include <hal.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelpersysmemtracker.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewHeapTrackingSettings.h"
-#include "MemSpyViewHeapTrackingResults.h"
-
-
-CMemSpyViewHeapTracking::CMemSpyViewHeapTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver ),
-    iState( EMemSpyViewHeapTrackingStateIdle )
-    {
-    if ( iEngine.HelperSysMemTracker().IsActive() )
-        {
-        iState = EMemSpyViewHeapTrackingStateTimerOn;
-        }
-    }
-
-
-CMemSpyViewHeapTracking::~CMemSpyViewHeapTracking()
-    {
-    delete iStopTimerCallBack;
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    }
-
-
-void CMemSpyViewHeapTracking::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "System-Wide Memory Tracking" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    
-    // Backup current config because it may be overwritten with Basic/Full mode settings.
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-    iOriginalConfig = config;
-    
-    if ( config.iMode != TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
-        {
-        // Set config. Needed for updating config for Basic or Full mode.
-        SetConfigByModeL( config.iMode, config );        
-        }
-        
-    // Make sure the correct item is selected
-    TInt index = 0;
-    if  ( aSelectionRune != NULL )
-        {
-        const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
-        index = IndexByViewType( viewType );
-        }
-    iListBox->SetCurrentItemIndex( index );
-    HandleListBoxItemSelectedL( index );
-    }
-
-
-void CMemSpyViewHeapTracking::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewHeapTracking::ViewType() const
-    {
-    return EMemSpyViewTypeHeapTracking;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTracking::PrepareParentViewL()
-    {
-    
-    // Save custom settings even if mode is Basic or Full
-    TRAP_IGNORE(
-        CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-        TMemSpyEngineHelperSysMemTrackerConfig config;
-        swmt.GetConfig( config );
-        config.iEnabledCategories = iOriginalConfig.iEnabledCategories;
-        config.iThreadNameFilter = iOriginalConfig.iThreadNameFilter;
-        config.iDumpData = iOriginalConfig.iDumpData;
-        swmt.SetConfigL( config );
-        Settings().StoreSettingsL();
-        );
-    
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTracking::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    const TInt index = iListBox->CurrentItemIndex();
-    
-    // Get current config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-    
-    //
-    if  ( index == 0 )
-        {
-        // This is the start/stop toggle so we don't make a child view
-        child = NULL; 
-
-        // ... instead we either start or stop the tracker
-        if  ( !iEngine.HelperSysMemTracker().IsActive() )
-            {
-            iState = EMemSpyViewHeapTrackingStateSingleOn;
-            // Setting observer to be able to stop SWMT after first cycle is completed
-            iEngine.HelperSysMemTracker().SetObserver( this );
-            iEngine.HelperSysMemTracker().StartL();
-            }
-
-        // Redraw listbox 
-        RefreshL();
-        }
-    else if  ( index == 1 )
-        {
-        // This is the start/stop toggle so we don't make a child view
-        child = NULL; 
-
-        // ... instead we either start or stop the tracker
-        if  ( iEngine.HelperSysMemTracker().IsActive() && iState == EMemSpyViewHeapTrackingStateTimerOn )
-            {
-            iState = EMemSpyViewHeapTrackingStateIdle;
-            iEngine.HelperSysMemTracker().StopL();
-            }
-        else if ( iState == EMemSpyViewHeapTrackingStateIdle )
-            {
-            iState = EMemSpyViewHeapTrackingStateTimerOn;
-            iEngine.HelperSysMemTracker().StartL();
-            }
-
-        // Redraw listbox 
-        RefreshL();
-        }
-    else if ( index == 2 )
-        {
-        switch ( config.iMode )
-            {
-            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
-                {
-                // Set Full mode
-                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull, config );
-                break;
-                }
-            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
-                {
-                // Set Custom mode
-                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom, config );
-                break;
-                }
-            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
-                {
-                // Set Basic mode
-                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic, config );
-                break;
-                }
-            default: break;
-            }
-                
-        // Redraw listbox 
-        RefreshL();
-        }
-    else if ( index == 3 )
-        {        
-        if ( config.iMode == TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
-            {
-            child = new(ELeave) CMemSpyViewHeapTrackingSettings( iEngine, iObserver );
-            }
-        else
-            {
-            child = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
-            }
-        }
-    else if ( index == 4 )
-        {
-        child = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
-        }
-    if  ( child )
-        {
-        CleanupStack::PushL( child );
-        child->ConstructL( Rect(), *Parent() );
-        CleanupStack::Pop( child );
-        }
-    
-    //
-    return child;
-    }
-
-
-void CMemSpyViewHeapTracking::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-    
-    // Get current config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-
-    // 1st item
-    _LIT( KItem1FormatEnable, "\tGet dump now" );
-    model->AppendL( KItem1FormatEnable );
-
-    
-    // 1st item
-    if  ( iEngine.HelperSysMemTracker().IsActive() && iState == EMemSpyViewHeapTrackingStateTimerOn )
-        {
-        _LIT( KItem1FormatEnable, "\tStop timer\t\t%d (sec)" );
-        TName item;
-        item.Format( KItem1FormatEnable, config.iTimerPeriod.Int() / 1000000 );
-        model->AppendL( item );
-        }
-    else
-        {
-        _LIT( KItem1FormatEnable, "\tStart timer\t\t%d (sec)" );
-        TName item;
-        item.Format( KItem1FormatEnable, config.iTimerPeriod.Int() / 1000000 );
-        model->AppendL( item );
-        }
-    
-    // 2nd item
-    switch ( config.iMode )
-        {
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
-            {
-            _LIT( KItem2Format, "\tTracking mode\t\tBasic" );
-            model->AppendL( KItem2Format );        
-            break;
-            }
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
-            {
-            _LIT( KItem2Format, "\tTracking mode\t\tFull" );
-            model->AppendL( KItem2Format );        
-            break;
-            }
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
-            {
-            _LIT( KItem2Format, "\tTracking mode\t\tCustom" );
-            model->AppendL( KItem2Format );
-            
-            // 3rd item
-            TFullName item;
-            if ( config.DumpData() && 
-                config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap )
-                {
-                _LIT( KItem3Format, "\tSettings\t\t%d categ., dump" );
-                item.Format( KItem3Format, config.EnabledCategoryCount() );
-                }
-            else
-                {
-                _LIT( KItem3Format, "\tSettings\t\t%d categories" );
-                item.Format( KItem3Format, config.EnabledCategoryCount() );
-                }
-            model->AppendL( item );            
-            break;
-            }
-        default: break;
-        }
-    
-    // 4th item    
-    const TInt cycleCount = iEngine.HelperSysMemTracker().MdcaCount();
-    if ( cycleCount )
-        {
-        _LIT( KItem2Format, "\tResults\t\t%d cycles" );
-        TFullName item;
-        item.Format( KItem2Format, cycleCount );
-        model->AppendL( item );
-        }
-    else
-        {
-        _LIT( KItem2Format, "\tResults\t\tNo results" );
-        model->AppendL( KItem2Format );
-        }
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-void CMemSpyViewHeapTracking::HandleCyclesResetL()
-    {
-    }
-
-
-void CMemSpyViewHeapTracking::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    }
-
-
-void CMemSpyViewHeapTracking::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    // Stopping SWMT does not work directly from this function.
-    // It has to be made asynchronously.
-    iStopTimerCallBack = new (ELeave) CAsyncCallBack( TCallBack( CMemSpyViewHeapTracking::AsyncStopTimerCallback, this ), CActive::EPriorityStandard );
-    iStopTimerCallBack->CallBack();
-    }
-
-
-TInt CMemSpyViewHeapTracking::IndexByViewType( TMemSpyViewType aType )
-    {
-    // Get current config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-    
-    TInt index = 0;
-    //
-    switch( aType )
-        {
-    default:
-    case EMemSpyViewTypeHeapTrackingResults:
-        {
-        if ( config.iMode == TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
-            {
-            index = 4;
-            }
-        else
-            {
-            index = 3;
-            }
-        break;
-        }
-    case EMemSpyViewTypeHeapTrackingSettings:
-        index = 3;
-        break;
-        }
-    //
-    return index;
-    }
-
-
-void CMemSpyViewHeapTracking::SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode aMode, TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
-    {
-    switch ( aMode )
-        {
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
-            {
-            aConfig.iMode = aMode;
-            aConfig.iEnabledCategories = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap |
-                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks |
-                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData |
-                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory;
-            aConfig.iDumpData = EFalse;
-            break;
-            }
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
-            {
-            aConfig.iMode = aMode;
-            aConfig.iEnabledCategories = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryAll;
-            aConfig.iDumpData = ETrue;
-            aConfig.iThreadNameFilter = KNullDesC;
-            break;
-            }
-        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
-            {
-            aConfig.iMode = aMode;
-            aConfig.iEnabledCategories = iOriginalConfig.iEnabledCategories;
-            aConfig.iDumpData = iOriginalConfig.iDumpData;
-            aConfig.iThreadNameFilter = iOriginalConfig.iThreadNameFilter;
-            break;
-            }
-        default: User::Leave( KErrArgument );
-        }
-    // Push changes to SWMT
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    swmt.SetConfigL( aConfig );
-    Settings().StoreSettingsL();
-    }
-
-
-TInt CMemSpyViewHeapTracking::AsyncStopTimerCallback( TAny* aParam )
-    {
-    CMemSpyViewHeapTracking* view = static_cast<CMemSpyViewHeapTracking*>( aParam );
-    return view->AsyncStopTimerCallback();
-    }
-
-
-TInt CMemSpyViewHeapTracking::AsyncStopTimerCallback()
-    {
-    iState = EMemSpyViewHeapTrackingStateIdle;
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    TRAP_IGNORE(
-        iEngine.HelperSysMemTracker().StopL();
-        RefreshL();
-        );
-    delete iStopTimerCallBack;
-    iStopTimerCallBack = NULL;
-    return KErrNone;
-    }
-
-
-
--- a/memspyui/source/MemSpyViewHeapTrackingResults.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,434 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewHeapTrackingResults.h"
-
-// System includes
-#include <hal.h>
-#ifdef __EPOC32__
-#include <e32rom.h>
-#endif
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackercycle.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackercyclechange.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerenums.h>
-#include <memspy/engine/memspyenginehelpersysmemtracker.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
-#include <memspyui.rsg>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyContainer.h"
-#include "MemSpyViewHeapTracking.h"
-#include "MemSpyContainerObserver.h"
-
-
-CMemSpyViewHeapTrackingResults::CMemSpyViewHeapTrackingResults( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    iEngine.HelperSysMemTracker().SetObserver( this );
-    }
-
-
-CMemSpyViewHeapTrackingResults::~CMemSpyViewHeapTrackingResults()
-    {
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    }
-
-
-void CMemSpyViewHeapTrackingResults::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Results Summary" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Make sure the correct item is selected
-    const TInt cycleNumber = ((TInt) aSelectionRune);
-    const TInt maxCycle = iEngine.HelperSysMemTracker().MdcaCount();
-    if  ( cycleNumber > 0 && cycleNumber <= maxCycle )
-        {
-        iListBox->SetCurrentItemIndex( cycleNumber - 1 );
-        HandleListBoxItemSelectedL( cycleNumber );
-        }
-    }
-
-
-void CMemSpyViewHeapTrackingResults::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewHeapTrackingResults::ViewType() const
-    {
-    return EMemSpyViewTypeHeapTrackingResults;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingResults::PrepareParentViewL()
-    {
-    CMemSpyViewHeapTracking* parent = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    //
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    //
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingResults::PrepareChildViewL()
-    {
-    const TInt index = iListBox->CurrentItemIndex();
-    //
-    CMemSpyViewBase* child = NULL;
-    if  ( index >= 0 )
-        {
-        const CMemSpyEngineHelperSysMemTrackerCycle* cycle = iEngine.HelperSysMemTracker().CompletedCycles()[ index ];
-        //
-        child = new(ELeave) CMemSpyViewHeapTrackingResultsCycleInfo( iEngine, iObserver, *cycle );
-        CleanupStack::PushL( child );
-        child->ConstructL( Rect(), *Parent() );
-        CleanupStack::Pop( child );
-        //
-        iEngine.HelperSysMemTracker().RemoveObserver( this );
-        }
-    //
-    return child;
-    }
-
-
-void CMemSpyViewHeapTrackingResults::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    MDesCArray* contents = &iEngine.HelperSysMemTracker();
-    listbox->Model()->SetItemTextArray( contents );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewHeapTrackingResults::HandleCyclesResetL()
-    {
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewHeapTrackingResults::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    }
-
-
-void CMemSpyViewHeapTrackingResults::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    SetListBoxCurrentItemIndexL( iEngine.HelperSysMemTracker().MdcaCount() - 1 );
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewHeapTrackingResultsCycleInfo::CMemSpyViewHeapTrackingResultsCycleInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
-:   CMemSpyViewBase( aEngine, aObserver ), iCycle( aCycle )
-    {
-    iEngine.HelperSysMemTracker().SetObserver( this );
-    }
-
-
-CMemSpyViewHeapTrackingResultsCycleInfo::~CMemSpyViewHeapTrackingResultsCycleInfo()
-    {
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitleFormat, "Cycle Summary [%04d]" );
-    TBuf<30> buf;
-    buf.Format( KTitleFormat, iCycle.CycleNumber() );
-    SetTitleL( buf );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // Make sure the correct item is selected
-    const TInt index = ((TInt) aSelectionRune);
-    iListBox->SetCurrentItemIndex( index );
-    HandleListBoxItemSelectedL( index );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewHeapTrackingResultsCycleInfo::ViewType() const
-    {
-    return EMemSpyViewTypeHeapTrackingResultsCycleInfo;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingResultsCycleInfo::PrepareParentViewL()
-    {
-    CMemSpyViewHeapTrackingResults* parent = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) iCycle.CycleNumber() );
-    CleanupStack::Pop( parent );
-    //
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    //
-    return parent;
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::SetListBoxModelL()
-    {
-    MDesCArray& model = const_cast< MDesCArray& >( static_cast< const MDesCArray&>( iCycle ) );
-    //
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCyclesResetL()
-    {
-    Container().NavigateToParentViewL();
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    }
-
-
-void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
-    {
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
-
-
-
-CMemSpyViewHeapTrackingResultsChangeDescriptor::CMemSpyViewHeapTrackingResultsChangeDescriptor( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle, const CMemSpyEngineHelperSysMemTrackerCycleChange& aChangeDescriptor, TInt aIndex )
-:   CMemSpyViewBase( aEngine, aObserver ), iCycle( aCycle ), iChangeDescriptor( aChangeDescriptor ), iIndex( aIndex )
-    {
-    iEngine.HelperSysMemTracker().SetObserver( this );
-    }
-
-
-CMemSpyViewHeapTrackingResultsChangeDescriptor::~CMemSpyViewHeapTrackingResultsChangeDescriptor()
-    {
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    TBuf<30> buf;
-    if  ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHeapUser )
-        {
-        _LIT( KTitleFormat, "User Heap Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHeapKernel )
-        {
-        _LIT( KTitleFormat, "Kernel Heap Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeChunk )
-        {
-        _LIT( KTitleFormat, "Chunk Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeRamDrive )
-        {
-        _LIT( KTitleFormat, "RAM Drive Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeStack )
-        {
-        _LIT( KTitleFormat, "Stack Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeGlobalData )
-        {
-        _LIT( KTitleFormat, "Global Data Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeCode )
-        {
-        _LIT( KTitleFormat, "RAM-Loaded Code Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHandle )
-        {
-        _LIT( KTitleFormat, "Handle Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeOpenFile )
-        {
-        _LIT( KTitleFormat, "Open File Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeDiskSpace )
-        {
-        _LIT( KTitleFormat, "Disk Space Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeBitmap )
-        {
-        _LIT( KTitleFormat, "Bitmap Change [%04d]" );
-        buf.Format( KTitleFormat, iCycle.CycleNumber() );
-        }
-    //
-    SetTitleL( buf );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewHeapTrackingResultsChangeDescriptor::ViewType() const
-    {
-    return EMemSpyViewTypeHeapTrackingResultsCycleChangeDescriptor;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingResultsChangeDescriptor::PrepareParentViewL()
-    {
-    CMemSpyViewHeapTrackingResultsCycleInfo* parent = new(ELeave) CMemSpyViewHeapTrackingResultsCycleInfo( iEngine, iObserver, iCycle );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) iIndex );
-    CleanupStack::Pop( parent );
-    //
-    iEngine.HelperSysMemTracker().RemoveObserver( this );
-    //
-    return parent;
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::SetListBoxModelL()
-    {
-    MDesCArray& model = const_cast< MDesCArray& >( static_cast< const MDesCArray&>( iChangeDescriptor ) );
-    //
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCyclesResetL()
-    {
-    CMemSpyViewHeapTrackingResults* mainResultsMenu = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
-    CleanupStack::PushL( mainResultsMenu );
-    mainResultsMenu->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( mainResultsMenu );
-    //
-    Container().SetNewActiveViewL( mainResultsMenu );
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
-    {
-    }
-
-
-void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
-    {
-    }
-*/
-
--- a/memspyui/source/MemSpyViewHeapTrackingSettings.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,422 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewHeapTrackingSettings.h"
-
-// System includes
-#include <hal.h>
-#ifdef __EPOC32__
-#include <e32rom.h>
-#endif
-#include <AknQueryDialog.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelpersysmemtracker.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
-#include <memspyui.rsg>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpySettings.h"
-#include "MemSpyViewHeapTracking.h"
-#include "MemSpyContainerObserver.h"
-
-
-CMemSpyViewHeapTrackingSettings::CMemSpyViewHeapTrackingSettings( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewHeapTrackingSettings::~CMemSpyViewHeapTrackingSettings()
-    {
-    }
-
-
-void CMemSpyViewHeapTrackingSettings::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Settings" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewHeapTrackingSettings::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewHeapTrackingSettings::ViewType() const
-    {
-    return EMemSpyViewTypeHeapTrackingSettings;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareParentViewL()
-    {
-    CMemSpyViewHeapTracking* parent = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareChildViewL()
-    {
-    const TInt index = iListBox->CurrentItemIndex();
-
-    // Get current config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-
-    // This view abuses the child view callback to toggle field values and/or
-    // display settings dialogs.
-    if  ( index == 0 )
-        {
-        TInt period = config.iTimerPeriod.Int() / 1000000;
-        CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( period );
-        if  ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_TIMER_PERIOD ) )
-            {
-            config.iTimerPeriod = period * 1000000;
-            }
-        }
-    else if ( index == 1 )
-        {
-        TInt categories( config.iEnabledCategories );
-        CSWMTCategorySelectionCheckBoxSettingItem* settingItem = new (ELeave) CSWMTCategorySelectionCheckBoxSettingItem( 0, categories );
-        CleanupStack::PushL( settingItem );
-        settingItem->ConstructL( EFalse,
-                                 0,
-                                 _L("SWMT Categories"),
-                                 NULL,
-                                 R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE,
-                                 EAknCtPopupSettingList,
-                                 NULL,
-                                 NULL );
-        
-        CMemSpySWMTCategorySelectionCheckBoxSettingPage* dlg = new(ELeave) CMemSpySWMTCategorySelectionCheckBoxSettingPage( R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE, settingItem->ItemArray() );
-        dlg->SetSettingPageObserver( settingItem );
-        if  ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
-            {
-            config.iEnabledCategories = categories;
-            }
-        CleanupStack::PopAndDestroy( settingItem );
-        }
-    else if ( index == 2 )
-        {
-        config.iDumpData = !config.iDumpData;
-        }
-    else if  ( index == 3 )
-        {
-        TName nameFilter;
-        nameFilter.Copy( config.iThreadNameFilter );
-        CMemSpyAllowEmptyDataDialog* dialog = new (ELeave) CMemSpyAllowEmptyDataDialog( nameFilter );
-        if  ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_NAME_FILTER ) )
-            {
-            config.iThreadNameFilter = nameFilter;
-            }
-        }
-    
-    // Push changes to SWMT
-    swmt.SetConfigL( config );
-    Settings().StoreSettingsL();
-
-    RefreshL();
-    return NULL;
-    }
-
-
-void CMemSpyViewHeapTrackingSettings::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    // Get current config
-    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    TMemSpyEngineHelperSysMemTrackerConfig config;
-    swmt.GetConfig( config );
-
-    // 1st item
-    _LIT( KItem1Format, "\tTracking timer period\t\t%d (sec)" );
-    item.Format( KItem1Format, config.iTimerPeriod.Int() / 1000000 );
-    model->AppendL( item );
-    
-    // 2nd item
-    _LIT( KItem3Format, "\tCategories\t\t%d selected" );
-    item.Format( KItem3Format, config.EnabledCategoryCount() );
-    model->AppendL( item );
-
-    // following items are related only to User Heap category, 
-    // so hide them if User Heap is not selected
-    if ( config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap )
-        {
-        // 3th item
-        _LIT( KItem2Format, "\tDump data" );
-        PrepareItemBufL( item, KItem2Format, config.iDumpData, config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap && config.iThreadNameFilter.Length() > 0 );
-        model->AppendL( item );
-        
-        // 4th item
-        if ( config.iDumpData )
-            {
-            _LIT( KItem4Format, "\tHeap data thread filter\t\t%S" );
-            if ( config.iThreadNameFilter.Length() > 0 )
-                {
-                item.Format( KItem4Format, &config.iThreadNameFilter );
-                }
-            else
-                {
-                item.Format( KItem4Format, &_L("No filtering") );
-                }
-            model->AppendL( item );        
-            }        
-        }
-    
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-void CMemSpyViewHeapTrackingSettings::PrepareItemBufL( TDes& aBuf, const TDesC& aCaption, TBool aStatus, TBool aHeapCategorySelected )
-    {
-    aBuf.Copy( aCaption ); 
-    //
-    if  ( aStatus )
-        {
-        if ( aHeapCategorySelected )
-            {
-            _LIT( KItemEnabled, "\t\tCustom" );
-            aBuf.Append( KItemEnabled );            
-            }
-        else
-            {
-            _LIT( KItemEnabled, "\t\tAll user heaps" );
-            aBuf.Append( KItemEnabled );   
-            }
-        }
-    else
-        {
-        _LIT( KItemDisabled, "\t\tDisabled" );
-        aBuf.Append( KItemDisabled );
-        }
-    }
-
-
-
-
-
-
-
-
-
-// --------------------------------------------------------------------------------------------
-
-CSWMTCategorySelectionCheckBoxSettingItem::CSWMTCategorySelectionCheckBoxSettingItem( TInt aIdentifier, TInt& aCategories ): 
-    CAknSettingItem(aIdentifier), iExtCategories( aCategories ) 
-    {
-    }   
-
-
-CSWMTCategorySelectionCheckBoxSettingItem::~CSWMTCategorySelectionCheckBoxSettingItem()
-    {
-    delete iSettingText;
-    if( iItemArray )
-        {
-        iItemArray->ResetAndDestroy();
-        delete iItemArray;
-        }
-    }
-
-
-CSelectionItemList* CSWMTCategorySelectionCheckBoxSettingItem::ItemArray() const
-    {
-    return iItemArray;
-    }
-
-
-void CSWMTCategorySelectionCheckBoxSettingItem::AddNewItemToArrayL(const TDesC& aLabel)
-    {
-    TBuf<64> buf;
-    buf.Copy( aLabel );    
-    CSelectableItem* item = new (ELeave) CSelectableItem( buf, EFalse );
-    CleanupStack::PushL( item );
-    item->ConstructL();
-    iItemArray->AppendL( item ); // Ownership is transferred
-    CleanupStack::Pop(); // item    
-    }
-    
-
-void CSWMTCategorySelectionCheckBoxSettingItem::CompleteConstructionL()
-    {
-    SetEmptyItemTextL(_L("Nothing selected"));
-    iItemArray = new(ELeave) CSelectionItemList(16);
-    AddNewItemToArrayL( _L("User Heap") );       // 0
-    AddNewItemToArrayL( _L("Kernel Heap") );     // 1
-    AddNewItemToArrayL( _L("User Stacks") );     // 2
-    AddNewItemToArrayL( _L("Global Data") );     // 3
-    AddNewItemToArrayL( _L("Disk Usage") );      // 4
-    AddNewItemToArrayL( _L("Open Files") );      // 5
-    AddNewItemToArrayL( _L("RAM-loaded Code") ); // 6
-    AddNewItemToArrayL( _L("System Memory") );   // 7
-    AddNewItemToArrayL( _L("Local Chunks") );    // 8
-    AddNewItemToArrayL( _L("Global Chunks") );   // 9
-    AddNewItemToArrayL( _L("RAM Drive") );       // 10
-    AddNewItemToArrayL( _L("FileServer Cache") );// 11
-    AddNewItemToArrayL( _L("Kernel Handles") );  // 12
-    AddNewItemToArrayL( _L("Bitmap Handles") );  // 13
-    AddNewItemToArrayL( _L("Window Groups") );   // 14
-    }
-
-
-void CSWMTCategorySelectionCheckBoxSettingItem::StoreL()
-    {
-    iExtCategories = 0;
-    if ( iItemArray->At( 11 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache; 
-    if ( iItemArray->At( 13 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles; 
-    if ( iItemArray->At( 0 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap; 
-    if ( iItemArray->At( 1 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap; 
-    if ( iItemArray->At( 8 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks; 
-    if ( iItemArray->At( 9 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks; 
-    if ( iItemArray->At( 10 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive; 
-    if ( iItemArray->At( 2 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks; 
-    if ( iItemArray->At( 3 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData; 
-    if ( iItemArray->At( 6 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode; 
-    if ( iItemArray->At( 12 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles; 
-    if ( iItemArray->At( 5 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles; 
-    if ( iItemArray->At( 4 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage; 
-    if ( iItemArray->At( 7 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory; 
-    if ( iItemArray->At( 14 )->SelectionStatus() )
-        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups; 
-    }
-
-
-void CSWMTCategorySelectionCheckBoxSettingItem::LoadL()
-    {
-    iItemArray->At( 11 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache );
-    iItemArray->At( 13 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles );
-    iItemArray->At( 0 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap );
-    iItemArray->At( 1 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap );
-    iItemArray->At( 8 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks );
-    iItemArray->At( 9 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks );
-    iItemArray->At( 10 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive );
-    iItemArray->At( 2 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks );
-    iItemArray->At( 3 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData );
-    iItemArray->At( 6 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode );
-    iItemArray->At( 12 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles );
-    iItemArray->At( 5 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles );
-    iItemArray->At( 4 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage );
-    iItemArray->At( 7 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory );
-    iItemArray->At( 14 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups );
-    }
-
-
-void CSWMTCategorySelectionCheckBoxSettingItem::HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
-    {
-    switch( aEventType )
-        {
-        case EEventSettingOked:
-            {
-            // If settings oked, save new values
-            StoreL();
-            break;
-            }
-        case EEventSettingCancelled:
-            {
-            // If setting is cancelled, load old values
-            LoadL();
-            break;
-            }
-        case EEventSettingChanged:
-            {
-            // If setting has changed, update CBA visibility
-            static_cast<CMemSpySWMTCategorySelectionCheckBoxSettingPage*>( aSettingPage )->UpdateCba();
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
-    }
-
-
-CMemSpySWMTCategorySelectionCheckBoxSettingPage::CMemSpySWMTCategorySelectionCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray )
-    : CAknCheckBoxSettingPage( aResourceID, aItemArray )
-    {
-    }
-
-
-void CMemSpySWMTCategorySelectionCheckBoxSettingPage::UpdateCba()
-    {
-    // Cache the pointer to button group container
-    CEikButtonGroupContainer* cba = Cba();
-    // Left softkey should be visible if there are items selected,
-    // i.e. the selection index array has items.
-    TBool visible( ListBoxControl()->View()->SelectionIndexes()->Count() > 0 );
-    // Resolve left softkey command id
-    TInt leftId( cba->ButtonGroup()->CommandId( 0 ) );
-    // Check if left softkey visibility has changed
-    if( visible != cba->IsCommandVisible( leftId ) )
-        {
-        // Left softkey visibility has changed, update it
-        cba->MakeCommandVisible( leftId, visible );
-        }
-    }
-
-
-
-
-CMemSpyAllowEmptyDataDialog::CMemSpyAllowEmptyDataDialog( TDes& aText, const TTone& aTone )
-    : CAknTextQueryDialog( aText, aTone )
-    {
-    }
- 
-
-void CMemSpyAllowEmptyDataDialog::UpdateLeftSoftKeyL()
-    {
-    MakeLeftSoftkeyVisible( ETrue );
-    }
--- a/memspyui/source/MemSpyViewKernel.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewKernel.h"
-
-// System includes
-#include <hal.h>
-#ifdef __EPOC32__
-#include <e32rom.h>
-#endif
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewKernelHeap.h"
-#include "MemSpyViewKernelContainers.h"
-
-
-
-CMemSpyViewKernel::CMemSpyViewKernel( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewKernel::~CMemSpyViewKernel()
-    {
-    }
-
-
-void CMemSpyViewKernel::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Kernel" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    
-    // Make sure the correct item is selected
-    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
-    const TInt index = IndexByViewType( viewType );
-    iListBox->SetCurrentItemIndex( index );
-    HandleListBoxItemSelectedL( index );
-    }
-
-
-void CMemSpyViewKernel::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewKernel::ViewType() const
-    {
-    return EMemSpyViewTypeKernel;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernel::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernel::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    const TInt index = iListBox->CurrentItemIndex();
-    //
-    if  ( index == 0 )
-        {
-        child = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
-        }
-    else if ( index == 1 )
-        {
-        child = new(ELeave) CMemSpyViewKernelHeap( iEngine, iObserver );
-        }
-
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewKernel::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    // 1st item = Processes
-    _LIT( KItem1Format, "\tObjects" );
-    item.Format( KItem1Format );
-    model->AppendL( item );
-
-    // 2nd item = System Config
-    _LIT( KItem2Format, "\tHeap" );
-    model->AppendL( KItem2Format );
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-TInt CMemSpyViewKernel::IndexByViewType( TMemSpyViewType aType )
-    {
-    TInt index = 0;
-    //
-    switch( aType )
-        {
-    default:
-    case EMemSpyViewTypeKernelContainers:
-        index = 0;
-        break;
-    case EMemSpyViewTypeKernelHeap:
-        index = 1;
-        break;
-        }
-    //
-    return index;
-    }
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewKernelContainers.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewKernelContainers.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperkernelcontainers.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewKernel.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewKernelObjects.h"
-
-// Literal constants
-
-
-
-CMemSpyViewKernelContainers::CMemSpyViewKernelContainers( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewKernelContainers::~CMemSpyViewKernelContainers()
-    {
-    delete iModel;
-    }
-
-
-void CMemSpyViewKernelContainers::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Kernel Objects" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewKernelContainers::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewKernelContainers::ViewType() const
-    {
-    return EMemSpyViewTypeKernelContainers;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelContainers::PrepareParentViewL()
-    {
-    CMemSpyViewKernel* parent = new(ELeave) CMemSpyViewKernel( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelContainers::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    const TInt index = iListBox->CurrentItemIndex();
-    child = new(ELeave) CMemSpyViewKernelObjects( iEngine, iObserver, iModel->At( index ).Type() );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewKernelContainers::SetListBoxModelL()
-    {
-    // Take ownership of new model
-    CMemSpyEngineHelperKernelContainers& kernelContainerManager = iEngine.HelperKernelContainers();
-    CMemSpyEngineGenericKernelObjectContainer* model = kernelContainerManager.ObjectsAllL();
-    delete iModel;
-    iModel = model;
-    
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-TBool CMemSpyViewKernelContainers::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdKernelContainersOutput:
-        OnCmdOutputAllContainerContentsL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewKernelContainers::OnCmdOutputAllContainerContentsL()
-    {
-    CMemSpyEngineOutputSink& sink = iEngine.Sink();
-    iModel->OutputL( sink );
-    }
-
-
-
-
--- a/memspyui/source/MemSpyViewKernelHeap.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewKernelHeap.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-#include <memspy/engine/memspyengineoutputlist.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewKernel.h"
-#include "MemSpyContainerObserver.h"
-
-// Literal constants
-
-
-
-CMemSpyViewKernelHeap::CMemSpyViewKernelHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewKernelHeap::~CMemSpyViewKernelHeap()
-    {
-    }
-
-
-void CMemSpyViewKernelHeap::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Kernel Heap" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewKernelHeap::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewKernelHeap::ViewType() const
-    {
-    return EMemSpyViewTypeKernelHeap;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelHeap::PrepareParentViewL()
-    {
-    CMemSpyViewKernel* parent = new(ELeave) CMemSpyViewKernel( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelHeap::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    return child;
-    }
-
-
-void CMemSpyViewKernelHeap::SetListBoxModelL()
-    {
-    // Get list contents
-    TMemSpyHeapInfo heapInfo;
-    iEngine.HelperHeap().GetHeapInfoKernelL( heapInfo );
-    CMemSpyEngineOutputList* list = iEngine.HelperHeap().NewHeapSummaryShortLC( heapInfo );
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( list );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( list );
-    }
-
-
-TBool CMemSpyViewKernelHeap::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdKernelHeapDump:
-        OnCmdDumpKernelHeapL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewKernelHeap::OnCmdDumpKernelHeapL()
-    {
-    iEngine.HelperHeap().OutputHeapDataKernelL();
-    }
-
-
-
-
--- a/memspyui/source/MemSpyViewKernelObjects.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,851 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewKernelObjects.h"
-
-// System includes
-#include <eikspane.h>
-#include <aknnavide.h> 
-#include <akntabgrp.h>
-#include <eikclbd.h>
-#include <AknQueryDialog.h>
-#include <aknnotewrappers.h>
-#include <apgwgnam.h>
-#include <aknmessagequerydialog.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperkernelcontainers.h>
-#include <memspy/engine/memspyenginehelperserver.h>
-#include <memspy/engine/memspyenginehelpercondvar.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewKernel.h"
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewKernelContainers.h"
-
-const TInt KMaxInfoLength = 128;
-
-CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
-:   CMemSpyViewBase( aEngine, aObserver ),
-    iObjectType( aObjectType ),
-    iCurrItemIndex( KErrNotFound )
-    {
-    }
-
-
-CMemSpyViewKernelObjects::~CMemSpyViewKernelObjects()
-    {
-    if ( iNavContainer && iNavDecorator )
-        {
-        iNavContainer->Pop( iNavDecorator );
-        delete iNavDecorator;
-        }
-    delete iModel;
-    delete iItems;
-    delete iObjectList;
-    }
-
-
-void CMemSpyViewKernelObjects::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Kernel Objects" );
-    SetTitleL( KTitle );
-    iItems = new(ELeave) CDesCArrayFlat(5);
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    CreateTabsL();
-    }
-
-
-CEikListBox* CMemSpyViewKernelObjects::ConstructListBoxL()
-    {
-    delete iListBox;
-    iListBox = NULL;
-    CAknSingleStyleListBox* listbox = new (ELeave) CAknSingleStyleListBox();
-    iListBox = listbox;
-    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
-    listbox->SetContainerWindowL( *this );
-    listbox->CreateScrollBarFrameL( ETrue );
-    SetListBoxModelL();
-    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
-    listbox->SetListBoxObserver( this );
-    listbox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
-    listbox->SetObserver( this );
-    return listbox;
-    }
-
-
-void CMemSpyViewKernelObjects::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewKernelObjects::ViewType() const
-    {
-    return EMemSpyViewTypeKernelObjects;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareParentViewL()
-    {
-    if ( iNavContainer && iNavDecorator )
-        {
-        iNavContainer->Pop( iNavDecorator );
-        delete iNavDecorator;
-        iNavDecorator = NULL;
-        }
-    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    if ( iListBox && 
-         iListBox->Model()->NumberOfItems() && 
-         iListBox->CurrentItemIndex() > KErrNotFound )
-        {
-        DetailsL();
-        }
-    return child;
-    }
-
-
-void CMemSpyViewKernelObjects::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-       {
-       if ( iObjectType > EMemSpyDriverContainerTypeProcess )
-           {
-           // Display Terminate, Switch to, End and Panic
-           // commands only for Threads and processes
-           aMenuPane->SetItemDimmed( EMemSpyCmdKernelObjects, ETrue );
-           }
-        }
-    }
-
-
-void CMemSpyViewKernelObjects::SetListBoxModelL()
-    {
-    _LIT( KLineFormatSpec, "\t%S" );
-    
-    // Take ownership of new model
-    CMemSpyEngineHelperKernelContainers& kernelContainerManager = iEngine.HelperKernelContainers();
-    CMemSpyEngineGenericKernelObjectContainer* model = kernelContainerManager.ObjectsAllL();
-    
-    delete iModel;
-    iModel = model;
-    
-    iItems->Reset();
-    delete iObjectList;
-    iObjectList = NULL;
-    iObjectList = kernelContainerManager.ObjectsForSpecificContainerL( iObjectType );
-    
-    // TODO: CMemSpyEngineGenericKernelObjectList could inherit MDesCArray like
-    // CMemSpyEngineGenericKernelObjectContainer does. iObjectList could then be passed
-    // to listbox model:
-    // listbox->Model()->SetItemTextArray( iObjectList );
-    
-    TName item;
-    TName name;
-    for ( TInt i = 0; i < iObjectList->Count(); i++ )
-        {
-        name.Copy( iObjectList->At( i ).iName );
-        item.Format( KLineFormatSpec, &name );
-        iItems->AppendL( item );
-        }
-    
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iItems );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-TBool CMemSpyViewKernelObjects::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-        case EMemSpyCmdKernelObjectTerminate:
-            {
-            TRAPD( err, OnCmdTerminateL() );
-            if ( err )
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-                note->ExecuteLD( _L("Cannot terminate task") );
-                }
-            break;
-            }
-        case EMemSpyCmdKernelObjectSwitchTo:
-            {
-            TRAPD( err, OnCmdSwitchToL() );
-            if ( err )
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-                note->ExecuteLD( _L("Cannot bring to foreground") );
-                }
-            break;
-            }
-        case EMemSpyCmdKernelObjectEnd:
-            {
-            TRAPD( err, OnCmdEndL() );
-            if ( err )
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-                note->ExecuteLD( _L("Cannot end task") );
-                }
-            break;
-            }
-        case EMemSpyCmdKernelObjectPanic:
-            {
-            TRAPD( err, OnCmdPanicL() );
-            if ( err )
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-                note->ExecuteLD( _L("Cannot panic task") );
-                }
-            break;
-            }
-        default:
-            {
-            handled = CMemSpyViewBase::HandleCommandL( aCommand );
-            break;        
-            }
-        }
-    //
-    return handled;
-    }
-
-
-TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    TKeyResponse resp = EKeyWasNotConsumed;
-    if  ( iTabs && ( aKeyEvent.iScanCode == EStdKeyRightArrow || aKeyEvent.iScanCode == EStdKeyLeftArrow ) )
-        {
-        resp = iTabs->OfferKeyEventL( aKeyEvent, aType );
-        }
-    else
-        {
-        resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
-        }
-    return resp;
-    }
-
-
-void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
-    {
-    iObjectType = (TMemSpyDriverContainerType)iTabs->ActiveTabId();
-    RefreshL();
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdTerminateL()
-    {
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TBool doTerminate = ETrue;
-            
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            
-            // Try to find the thread in question...
-            CMemSpyProcess* process = NULL;
-            CMemSpyThread* thread = NULL; 
-            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
-
-            if ( thread )
-                {
-                thread->Open();
-                //
-                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
-                    {
-                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                    }
-                //
-                if  ( doTerminate )
-                    {
-                    thread->TerminateL();
-                    }                
-                }
-            RefreshL();
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool doTerminate = ETrue;
-            // Obtain the process that corresponds to the selected item
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
-            process.Open();
-
-            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-                {
-                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                }
-            //
-            if  ( doTerminate )
-                {
-                process.TerminateL();
-                RefreshL();
-                }
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdSwitchToL()
-    {
-    TInt wgCount;
-    RWsSession wsSession;
-    User::LeaveIfError( wsSession.Connect() );
-    CleanupClosePushL( wsSession );
-    User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
-    RArray<RWsSession::TWindowGroupChainInfo> wgArray;
-    CleanupClosePushL( wgArray );
-    User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
-    TApaTask task( wsSession );
-    TBool brought( EFalse );
-    TInt wgId( KErrNotFound );
-    TThreadId threadId;
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            
-            // loop trough all window groups and see if a thread id matches
-            while( !brought && wgCount-- )
-                {
-                wgId = wgArray[wgCount].iId;
-                User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
-                if ( threadId == currentThreadId )
-                    {
-                    CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
-                    task.SetWgId( wgId );
-                    if ( !wgName->Hidden() && task.Exists() )
-                        {
-                        task.BringToForeground();
-                        brought = ETrue;                        
-                        }
-                    CleanupStack::PopAndDestroy( wgName );
-                    }
-                }                
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
-            
-            // loop trough threads in a process
-            for ( TInt i = 0; i < process.MdcaCount(); i++ )
-                {
-                TInt wgCountLocal = wgCount;
-                
-                // loop trough all window groups and see if a thread id matches
-                while( !brought && wgCountLocal-- )
-                    {
-                    wgId = wgArray[wgCountLocal].iId;
-                    User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
-                    if ( threadId == process.At( i ).Id() )
-                        {
-                        CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
-                        task.SetWgId( wgId );
-                        if ( !wgName->Hidden() && task.Exists() )
-                            {
-                            task.BringToForeground();
-                            brought = ETrue;                        
-                            }
-                        CleanupStack::PopAndDestroy( wgName );
-                        }
-                    }
-                }
-
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }
-    if ( !brought )
-        {
-        // Error handling in HandleCommandL
-        User::Leave( KErrGeneral );
-        }
-    CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdEndL()
-    {
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TBool doTerminate = ETrue;
-            
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            
-            // Try to find the thread in question...
-            CMemSpyProcess* process = NULL;
-            CMemSpyThread* thread = NULL; 
-            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
-
-            if ( thread )
-                {
-                thread->Open();
-                //
-                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
-                    {
-                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                    }
-                //
-                if  ( doTerminate )
-                    {
-                    thread->KillL();
-                    }                
-                }
-            RefreshL();
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool doTerminate = ETrue;
-            // Obtain the process that corresponds to the selected item
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
-            process.Open();
-
-            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-                {
-                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                }
-            if  ( doTerminate )
-                {
-                process.KillL();
-                RefreshL();
-                }
-
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }    
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdPanicL()
-    {
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TBool doTerminate = ETrue;
-            
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            
-            // Try to find the thread in question...
-            CMemSpyProcess* process = NULL;
-            CMemSpyThread* thread = NULL; 
-            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
-
-            if ( thread )
-                {
-                thread->Open();
-                //
-                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
-                    {
-                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                    }
-                //
-                if  ( doTerminate )
-                    {
-                    thread->PanicL();
-                    }                
-                }
-            RefreshL();
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool doTerminate = ETrue;
-            // Obtain the process that corresponds to the selected item
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            CMemSpyProcess& process = container.ProcessByIdL( id );
-            process.Open();
-
-            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-                {
-                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                }
-            if  ( doTerminate )
-                {
-                process.PanicL();
-                RefreshL();
-                }
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }
-    }
-
-
-void CMemSpyViewKernelObjects::CreateTabsL()
-    {
-    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
-    TUid uid;
-    uid.iUid = EEikStatusPaneUidNavi;
-    iNavDecorator = ((CAknNavigationControlContainer*)(statusPane->ControlL(uid)))->Top();
-
-    if ( !iNavDecorator )
-        {
-        iNavContainer = (CAknNavigationControlContainer*)statusPane->ControlL(uid);
-        iNavDecorator = iNavContainer->CreateTabGroupL();
-
-        iTabs = ( CAknTabGroup* )iNavDecorator->DecoratedControl();
-        iTabs->SetTabFixedWidthL( KTabWidthWithThreeLongTabs );
-    
-        for ( TInt i = 0; i < iModel->Count(); i++ )
-            {
-            const CMemSpyEngineGenericKernelObjectList& item = iModel->At( i );
-            iTabs->AddTabL( item.Type(), item.TypeAsString( item.Type() ) );
-            }
-        iTabs->SetActiveTabById( iObjectType );
-        iTabs->SetObserver( this );
-        iNavContainer->PushL( *iNavDecorator );
-        }
-    }
-
-
-void CMemSpyViewKernelObjects::DetailsL()
-    {
-    HBufC* messageBuf = HBufC::NewLC( 40960 );
-    TPtr messagePtr = messageBuf->Des();
-
-    const TMemSpyDriverHandleInfoGeneric& selectedObject = iObjectList->At( iListBox->CurrentItemIndex() );
-
-    // General attributes:
-    TFullName name;
-    name.Copy( selectedObject.iNameDetail );
-    AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
-    name.Zero();
-    name.Copy( selectedObject.iName );
-    AppendFormatString( messagePtr, _L("FullName: %S\n"), &name );
-    name.Zero();
-    AppendFormatString( messagePtr, _L("AccessCount: %d\n"), selectedObject.iAccessCount );
-    AppendFormatString( messagePtr, _L("UniqueID: %d\n"), selectedObject.iUniqueID );
-    AppendFormatString( messagePtr, _L("Protection: %u\n"), selectedObject.iProtection );
-    AppendFormatString( messagePtr, _L("OwnrAddr: 0x%08X\n"), selectedObject.iAddressOfKernelOwner );
-    AppendFormatString( messagePtr, _L("KernelAddr: 0x%08X"), selectedObject.iHandle );
-    
-    // Object type specific attributes:
-    switch ( selectedObject.iType )
-        {
-        case EMemSpyDriverContainerTypeUnknown:
-            {
-            break;
-            }
-        case EMemSpyDriverContainerTypeThread:
-            {
-            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), selectedObject.iAddressOfOwningProcess );
-            AppendFormatString( messagePtr, _L("ThreadID: %d\n"), selectedObject.iId );
-            AppendFormatString( messagePtr, _L("Priority: %d\n"), selectedObject.iPriority );
-            TFullName procName;
-            procName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
-            procName.Zero();
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), selectedObject.iAddressOfOwningProcess );
-            AppendFormatString( messagePtr, _L("CreatorId: %u\n"), selectedObject.iCreatorId );
-            AppendFormatString( messagePtr, _L("Attributes: 0x%08X\n"), selectedObject.iAttributes );
-            AppendFormatString( messagePtr, _L("StckChnk: 0x%08X\n"), selectedObject.iAddressOfDataBssStackChunk );
-            AppendFormatString( messagePtr, _L("ProcessID: %d\n"), selectedObject.iId );
-            AppendFormatString( messagePtr, _L("Priority: %d\n"), selectedObject.iPriority );
-            AppendFormatString( messagePtr, _L("SecurityZone: %d"), selectedObject.iSecurityZone );
-            CMemSpyEngineObjectContainer& container = iEngine.Container();
-            TProcessId id( selectedObject.iId );
-            TRAP_IGNORE(
-                CMemSpyProcess& process = container.ProcessByIdL( id );
-                AppendFormatString( messagePtr, _L("\nSID: 0x%08X\n"), process.SID() );
-                AppendFormatString( messagePtr, _L("VID: 0x%08X\n"), process.VID() );
-                AppendFormatString( messagePtr, _L("UID1: 0x%08X\n"), process.UIDs()[0].iUid  );
-                AppendFormatString( messagePtr, _L("UID2: 0x%08X\n"), process.UIDs()[1].iUid  );
-                AppendFormatString( messagePtr, _L("UID3: 0x%08X\n"), process.UIDs()[2].iUid );
-                AppendFormatString( messagePtr, _L("Caps: 0x%08X%08X"), process.Capabilities().iCaps[0], process.Capabilities().iCaps[1]);
-                );
-            break;
-            }
-        case EMemSpyDriverContainerTypeChunk:
-            {
-            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), selectedObject.iAddressOfOwningProcess );
-            AppendFormatString( messagePtr, _L("Size: %d\n"), selectedObject.iSize );
-            AppendFormatString( messagePtr, _L("MaxSize: %d\n"), selectedObject.iMaxSize );
-            AppendFormatString( messagePtr, _L("Bottom: %d\n"), selectedObject.iBottom );
-            AppendFormatString( messagePtr, _L("Top: %d\n"), selectedObject.iTop );
-            AppendFormatString( messagePtr, _L("Attr: 0x%08X\n"), selectedObject.iAttributes );
-            AppendFormatString( messagePtr, _L("Start: %d\n"), selectedObject.iStartPos );
-            AppendFormatString( messagePtr, _L("CntrlID: %u\n"), selectedObject.iControllingOwner );
-            AppendFormatString( messagePtr, _L("Restrictions: %u\n"), selectedObject.iRestrictions );
-            AppendFormatString( messagePtr, _L("MapAttr: %u\n"), selectedObject.iMapAttr );
-            AppendFormatString( messagePtr, _L("Type: %u\n"), selectedObject.iChunkType );
-            TFullName procName;
-            procName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
-            procName.Zero();
-            // OwnerAddr iAddressOfKernelOwner already listed
-            // ProcAddr iAddressOfOwningProcess already listed
-            break;
-            }
-        case EMemSpyDriverContainerTypeLibrary:
-            {
-            AppendFormatString( messagePtr, _L("\nMapCount: %d\n"), selectedObject.iMapCount );
-            AppendFormatString( messagePtr, _L("State: %u\n"), selectedObject.iState );
-            AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), selectedObject.iAddressOfCodeSeg );
-            break;
-            }
-        case EMemSpyDriverContainerTypeSemaphore:
-            {
-            AppendFormatString( messagePtr, _L("\nCount: %d\n"), selectedObject.iCount );
-            AppendFormatString( messagePtr, _L("Resetting: %u"), selectedObject.iResetting );
-            break;
-            }
-        case EMemSpyDriverContainerTypeMutex:
-            {
-            AppendFormatString( messagePtr, _L("\nHoldCount: %d\n"), selectedObject.iCount );
-            AppendFormatString( messagePtr, _L("WaitCount: %d\n"), selectedObject.iWaitCount );
-            AppendFormatString( messagePtr, _L("Resetting: %u\n"), selectedObject.iResetting );
-            AppendFormatString( messagePtr, _L("Order: %u"), selectedObject.iOrder );
-            break;
-            }
-        case EMemSpyDriverContainerTypeTimer:
-            {
-            AppendFormatString( messagePtr, _L("\nState: %d\n"), selectedObject.iTimerState );
-            AppendFormatString( messagePtr, _L("Type: %d"), selectedObject.iTimerType );
-            break;
-            }
-        case EMemSpyDriverContainerTypeServer:
-            {
-            // Owner == ThrdAddr
-            AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), selectedObject.iAddressOfOwningThread );
-            TFullName thrName;
-            thrName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
-            thrName.Zero();
-            AppendFormatString( messagePtr, _L("Type: %d\n"), selectedObject.iSessionType );
-            TBuf8<55>buf;
-            RArray<TMemSpyDriverServerSessionInfo> sessions;
-            CleanupClosePushL( sessions );
-            iEngine.HelperServer().GetServerSessionsL( selectedObject, sessions );
-            const TInt count = sessions.Count();
-            for ( TInt i = 0; i < count; i++ )
-                {
-                const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
-                AppendFormatString( messagePtr, _L("SessAddr: 0x%08X\n"), session.iAddress );
-                TFullName sessName;
-                sessName.Copy( session.iName );
-                AppendFormatString( messagePtr, _L("Sess: %S\n"), &sessName );
-                }
-            CleanupStack::PopAndDestroy( &sessions );
-            break;
-            }
-        case EMemSpyDriverContainerTypeSession:
-            {
-            // Server == SvrAddr
-            AppendFormatString( messagePtr, _L("\nServer: 0x%08X\n"), selectedObject.iAddressOfServer );
-            TFullName srvName;
-            srvName.Copy( selectedObject.iName );
-            AppendFormatString( messagePtr, _L("Srv: %S\n"), &srvName );
-            srvName.Zero();
-            // Session: not supported
-            AppendFormatString( messagePtr, _L("AccCount: %u\n"), selectedObject.iTotalAccessCount );
-            AppendFormatString( messagePtr, _L("SesType: %u\n"), selectedObject.iSessionType );
-            AppendFormatString( messagePtr, _L("SvrType: %u\n"), selectedObject.iSvrSessionType );
-            AppendFormatString( messagePtr, _L("MsgCount: %d\n"),  selectedObject.iMsgCount );
-            AppendFormatString( messagePtr, _L("MsgLimit: %d"), selectedObject.iMsgLimit );
-            break;
-            }
-        case EMemSpyDriverContainerTypeLogicalDevice:
-            {
-            AppendFormatString( messagePtr, 
-                                _L("\nVersion: %d.%d.%d\n"), 
-                                selectedObject.iVersion.iMajor,
-                                selectedObject.iVersion.iMinor,
-                                selectedObject.iVersion.iBuild );
-            AppendFormatString( messagePtr, _L("ParseMask: 0x%08X\n"), selectedObject.iParseMask );
-            AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), selectedObject.iUnitsMask );
-            AppendFormatString( messagePtr, _L("Open channels: %d"), selectedObject.iOpenChannels );
-            break;
-            }
-        case EMemSpyDriverContainerTypePhysicalDevice:
-            {
-            AppendFormatString( messagePtr, 
-                                _L("\nVersion: %d.%d.%d\n"), 
-                                selectedObject.iVersion.iMajor,
-                                selectedObject.iVersion.iMinor,
-                                selectedObject.iVersion.iBuild );
-            AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), selectedObject.iUnitsMask );
-            AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), selectedObject.iAddressOfCodeSeg );
-            break;
-            }
-        case EMemSpyDriverContainerTypeLogicalChannel:
-            {
-            // No other details
-            break;
-            }
-        case EMemSpyDriverContainerTypeChangeNotifier:
-            {
-            AppendFormatString( messagePtr, _L("\nChanges: %u\n"), selectedObject.iChanges );
-            // Thread == ThrdAddr
-            AppendFormatString( messagePtr, _L("ThrdAddr: 0x%08X\n"), selectedObject.iAddressOfOwningThread );
-            TFullName thrName;
-            thrName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
-            thrName.Zero();
-            break;
-            }
-        case EMemSpyDriverContainerTypeUndertaker:
-            {
-            // Thread == ThrdAddr
-            AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), selectedObject.iAddressOfOwningThread );
-            TFullName thrName;
-            thrName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
-            thrName.Zero();
-            break;
-            }
-        case EMemSpyDriverContainerTypeMsgQueue:
-            {
-            // No other details
-            break;
-            }
-        case EMemSpyDriverContainerTypePropertyRef:
-            {
-            /*
-            Not listing details here, as propertyRef is not listed in TaskMgr.
-            Following propertyRef attributes are available at engine side. 
-            
-            IsReady
-            Type
-            Category
-            Key
-            RefCount
-            ThreadId
-            CreatorSID
-            */
-            break;
-            }
-        case EMemSpyDriverContainerTypeCondVar:
-            {
-            AppendFormatString( messagePtr, _L("\nResetting: %u\n"), selectedObject.iResetting );
-            // Using iAddressOfOwningThread for mutex
-            AppendFormatString( messagePtr, _L("Mutex: 0x%08X\n"), selectedObject.iAddressOfOwningThread );
-            // Using iNameOfOwner for mutex
-            TFullName mtxName;
-            mtxName.Copy( selectedObject.iNameOfOwner );
-            AppendFormatString( messagePtr, _L("Mtx: %S\n"), &mtxName );
-            mtxName.Zero();
-            AppendFormatString( messagePtr, _L("WaitCount: %d\n"), selectedObject.iWaitCount );
-            
-            RArray<TMemSpyDriverCondVarSuspendedThreadInfo> threads;
-            CleanupClosePushL( threads );
-            iEngine.HelperCondVar().GetCondVarSuspendedThreadsL( selectedObject, threads );
-            const TInt count = threads.Count();
-            for ( TInt i = 0; i < count; i++ )
-                {
-                const TMemSpyDriverCondVarSuspendedThreadInfo& thr = threads[ i ];
-                AppendFormatString( messagePtr, _L("SuspThrdAddr: 0x%08X\n"), thr.iAddress );
-                TFullName thrName;
-                thrName.Copy( thr.iName );
-                AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
-                }
-            CleanupStack::PopAndDestroy( &threads );
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }
-    
-    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
-    dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
-    TFileName headerText;
-    headerText.Copy( selectedObject.iName );
-    dialog->SetHeaderTextL( headerText );
-    dialog->SetMessageTextL(messagePtr);
-    dialog->RunLD();
-    CleanupStack::PopAndDestroy( messageBuf );
-    }
-
-
-void CMemSpyViewKernelObjects::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
-    {
-    TBuf<KMaxInfoLength> infoString;
-    VA_LIST list;
-    VA_START ( list, aFmt );
-    infoString.FormatList( aFmt, list );
-    aPtr.Append( infoString );
-    }
-
--- a/memspyui/source/MemSpyViewMainMenu.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewMainMenu.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewProcesses.h"
-#include "MemSpyViewRAMInfo.h"
-#include "MemSpyViewROMInfo.h"
-#include "MemSpyViewServerList.h"
-#include "MemSpyViewOpenFiles.h"
-#include "MemSpyViewFBServBitmaps.h"
-#include "MemSpyViewSystemConfig.h"
-#include "MemSpyViewCodeSegList.h"
-#include "MemSpyViewChunkList.h"
-#include "MemSpyViewKernel.h"
-#include "MemSpyViewHeapTracking.h"
-#include "MemSpyViewDriveInfo.h"
-#include "MemSpyViewECom.h"
-#include "MemSpyViewMemoryTrackingAutoStartConfig.h"
-#include "MemSpyViewWindowGroups.h"
-
-// System includes
-#include <aknnotewrappers.h>
-
-
-CMemSpyViewMainMenu::CMemSpyViewMainMenu( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-void CMemSpyViewMainMenu::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "MemSpy" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    
-    // Make sure the correct item is selected
-    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
-    const TInt index = IndexByViewType( viewType );
-    iListBox->SetCurrentItemIndex( index );
-    HandleListBoxItemSelectedL( index );
-    }
-
-
-void CMemSpyViewMainMenu::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewMainMenu::ViewType() const
-    {
-    return EMemSpyViewTypeMainMenu;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewMainMenu::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    const TInt index = iListBox->CurrentItemIndex();
-    
-#ifdef __WINS__
-    // threads & process view is not supported in the emulator environment
-    if  ( index == 0 )
-        {
-        CAknInformationNote* note = new (ELeave) CAknInformationNote;
-        note->ExecuteLD(_L("Not supported in the emulator, try Kernel -> Objects view"));
-        return NULL;
-        }
-#endif
-
-    if  ( index == 0 )
-        {
-        child = new(ELeave) CMemSpyViewProcesses( iEngine, iObserver );
-        }
-    else if ( index == 1 )
-        {
-        child = new(ELeave) CMemSpyViewRAMInfo( iEngine, iObserver );
-        }
-    else if ( index == 2 )
-        {
-        child = new(ELeave) CMemSpyViewROMInfo( iEngine, iObserver );
-        }
-    else if ( index == 3 )
-        {
-        child = new(ELeave) CMemSpyViewFBServBitmaps( iEngine, iObserver );
-        }
-    else if ( index == 4 )
-        {
-        child = new(ELeave) CMemSpyViewServerList( iEngine, iObserver );
-        }
-    else if ( index == 5 )
-        {
-        child = new(ELeave) CMemSpyViewChunkList( iEngine, iObserver );
-        }
-    else if ( index == 6 )
-        {
-        child = new(ELeave) CMemSpyViewCodeSegList( iEngine, iObserver );
-        }
-    else if ( index == 7 )
-        {
-        child = new(ELeave) CMemSpyViewOpenFiles( iEngine, iObserver );
-        }
-    else if ( index == 8 )
-        {
-        child = new(ELeave) CMemSpyViewSystemConfig( iEngine, iObserver );
-        }
-    else if ( index == 9 )
-        {
-        child = new(ELeave) CMemSpyViewKernel( iEngine, iObserver );
-        }
-    else if ( index == 10 )
-        {
-        child = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
-        }
-    else if ( index == 11 )
-        {
-        child = new(ELeave) CMemSpyViewMemoryTrackingAutoStartConfig( iEngine, iObserver );
-        }
-    else if ( index == 12 )
-        {
-        child = new(ELeave) CMemSpyViewDriveList( iEngine, iObserver );
-        }
-    else if ( index == 13 )
-        {
-        child = new(ELeave) CMemSpyViewECom( iEngine, iObserver );
-        }
-    else if ( index == 14 )
-        {
-        child = new(ELeave) CMemSpyViewWindowGroups( iEngine, iObserver );
-        }
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewMainMenu::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    // 1st item = Processes
-    _LIT(KItem1Format, "\tProcesses & Threads");
-    item.Format( KItem1Format );
-    model->AppendL( item );
-
-    // 2nd item = RAM info
-    _LIT(KItem2Format, "\tRAM Info");
-    model->AppendL( KItem2Format );
-
-    // 3rd item = ROM info
-    _LIT(KItem3Format, "\tROM Info");
-    model->AppendL( KItem3Format );
-
-    // 4th item = FBServ Bitmaps
-    _LIT(KItem4Format, "\tFont & Bitmap\nServer");
-    model->AppendL( KItem4Format );
-
-    // 5th item = Servers
-    _LIT(KItem5Format, "\tServers");
-    item.Format( KItem5Format);
-    model->AppendL( item );
-
-    // 6th item = Chunks
-    _LIT(KItem6Format, "\tChunks");
-    model->AppendL( KItem6Format );
-
-    // 7th item = Code Segments
-    _LIT(KItem7Format, "\tCode Segments");
-    model->AppendL( KItem7Format );
-
-    // 8th item = Open Files
-    _LIT(KItem8Format, "\tOpen Files");
-    model->AppendL( KItem8Format );
-
-    // 9th item = System Config
-    _LIT(KItem9Format, "\tSystem\nConfiguration");
-    model->AppendL( KItem9Format );
-
-    // 10th item = Kernel
-    _LIT(KItem10Format, "\tKernel");
-    model->AppendL( KItem10Format );
-
-    // 11th item = Heap Tracking
-    _LIT(KItem11Format, "\tSystem-Wide Memory Tracking");
-    model->AppendL( KItem11Format );
-
-    // 12th item = Process-specific Tracking
-    _LIT(KItem12Format, "\tProcess-Specific Memory Tracking");
-    model->AppendL( KItem12Format );
-
-    // 13th item = Drive Info
-    _LIT(KItem13Format, "\tDrive Summary");
-    model->AppendL( KItem13Format );
-
-    // 14th item = ECOM
-    _LIT(KItem14Format, "\tECom");
-    model->AppendL( KItem14Format );
-
-    // 15th item = Window Groups
-    _LIT(KItem15Format, "\tWindow Groups");
-    model->AppendL( KItem15Format );
-    
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-TInt CMemSpyViewMainMenu::IndexByViewType( TMemSpyViewType aType )
-    {
-    TInt index = 0;
-    //
-    switch( aType )
-        {
-    default:
-    case EMemSpyViewTypeProcesses:
-        index = 0;
-        break;
-    case EMemSpyViewTypeRAMInfo:
-        index = 1;
-        break;
-    case EMemSpyViewTypeROMInfo:
-        index = 2;
-        break;
-    case EMemSpyViewTypeFBServBitmaps:
-        index = 3;
-        break;
-    case EMemSpyViewTypeServerList:
-        index = 4;
-        break;
-    case EMemSpyViewTypeChunkList:
-        index = 5;
-        break;
-    case EMemSpyViewTypeCodeSegmentList:
-        index = 6;
-        break;
-    case EMemSpyViewTypeOpenFiles:
-        index = 7;
-        break;
-    case EMemSpyViewTypeSystemConfig:
-        index = 8;
-        break;
-    case EMemSpyViewTypeKernel:
-        index = 9;
-        break;
-    case EMemSpyViewTypeHeapTracking:
-        index = 10;
-        break;
-    case EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig:
-        index = 11;
-        break;
-    case EMemSpyViewTypeDriveSummary:
-        index = 12;
-        break;
-    case EMemSpyViewTypeECom:
-        index = 13;
-        break;
-    case EMemSpyViewTypeWindowGroups:
-        index = 14;
-        break;        
-        }
-    //
-    return index;
-    }
-
--- a/memspyui/source/MemSpyViewMemoryTrackingAutoStartConfig.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,570 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewMemoryTrackingAutoStartConfig.h"
-
-// System includes
-#include <AknQueryDialog.h>
-#include <charconv.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyengineprocessmemorytracker.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-// Literal constants
-_LIT8( KMemSpyProcessMemoryTrackerXmlFileMimeType, "text/xml" );
-_LIT8( KMemSpyXmlSpec_MasterSection, "memspy_process_memory_tracking" );
-_LIT8( KMemSpyXmlSpec_EntryProcess, "process" );
-_LIT8( KMemSpyXmlSpec_EntryProcess_SID, "sid" );
-_LIT8( KMemSpyXmlSpec_HexPrefix, "0x" );
-
-
-
-CMemSpyViewMemoryTrackingAutoStartConfig::CMemSpyViewMemoryTrackingAutoStartConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewMemoryTrackingAutoStartConfig::~CMemSpyViewMemoryTrackingAutoStartConfig()
-    {
-    iProcessUids.Close();
-    //
-    delete iParser;
-    delete iConverter;
-    //
-    delete iXMLFileNameInstallTime;
-    delete iXMLFileNameUserSupplied;
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    // We only convert from UTF-8 to UTF-16
-	iParser = CParser::NewL( KMemSpyProcessMemoryTrackerXmlFileMimeType, *this );
-    iConverter = CCnvCharacterSetConverter::NewL();
-    if  ( iConverter->PrepareToConvertToOrFromL( KCharacterSetIdentifierUtf8, iEngine.FsSession() ) == CCnvCharacterSetConverter::ENotAvailable )
-	    {
-		User::Leave(KErrNotFound);
-		}
-
-    // Search for standard files
-    FindXmlInstallTimeL();
-    FindXmlUserSuppliedL();
-
-    // Copy items to our own temporary list...
-    const RArray<TUid>& list = iEngine.HelperProcess().MemoryTrackingAutoStartProcessList();
-    for( TInt i=0; i<list.Count(); i++ )
-        {
-        User::LeaveIfError( iProcessUids.Append( list[ i ] ) );
-        }
-
-    // Reset the title
-    _LIT( KCustomTitle, "Process-Specific Memory Tracking" );
-    SetTitleL( KCustomTitle );
-    }
-
-
-TMemSpyViewType CMemSpyViewMemoryTrackingAutoStartConfig::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewMemoryTrackingAutoStartConfig::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-
-    return parent;
-    }
-
-
-TBool CMemSpyViewMemoryTrackingAutoStartConfig::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdMemoryTrackingAutoStartItemAdd:
-        OnCmdItemAddL();
-        break;
-    case EMemSpyCmdMemoryTrackingAutoStartItemEdit:
-        OnCmdItemEditL();
-        break;
-    case EMemSpyCmdMemoryTrackingAutoStartItemDelete:
-        OnCmdItemDeleteL();
-        break;
-    case EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll:
-        OnCmdItemDeleteAllL();
-        break;
-    case EMemSpyCmdMemoryTrackingAutoStartItemImport:
-        OnCmdItemImportL();
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    OnCmdItemEditL();
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<128> buf;
-    _LIT( KProcUidFormatSpec, "\t0x%08x" );
-
-    const TInt count = iProcessUids.Count();
-    for( TInt i=0; i<count; i++ )
-        {
-        const TUid procUid = iProcessUids[ i ];
-        //
-        buf.Format( KProcUidFormatSpec, procUid.iUid );
-        model->AppendL( buf );
-        }
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    iListBox->HandleItemAdditionL();
-    iListBox->DrawDeferred();
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == MenuCascadeResourceId() )
-        {
-        const TInt count = iProcessUids.Count();
-        const TInt index = iListBox->CurrentItemIndex();
-
-        // We cannot edit an item if none exists
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemEdit, ( count == 0 || index < 0 || index > count - 1 ) );
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemDelete, ( count == 0 || index < 0 || index > count - 1 ) );
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll, ( count <= 1 || index > count - 1 ) );
-
-        // We can only import items if an XML file is available
-        const TBool xmlAvailable = ( iXMLFileNameInstallTime->Length() || iXMLFileNameUserSupplied->Length() );
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemImport, !xmlAvailable );
-        }
-    }
-
-
-TUint CMemSpyViewMemoryTrackingAutoStartConfig::MenuCascadeResourceId() const
-    {
-    return R_MEMSPY_MENUPANE_MEMORY_TRACKING_AUTOSTART;
-    }
-
-
-TInt CMemSpyViewMemoryTrackingAutoStartConfig::MenuCascadeCommandId() const
-    {
-    return EMemSpyCmdMemoryTrackingAutoStart;
-    }
-   
-    
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemAddL()
-    {
-    const TUid uid = ShowDialogL( KNullUid );
-    if ( uid != KNullUid )
-        {
-        User::LeaveIfError( iProcessUids.Append( uid ) );
-        SaveChangesL();
-        RefreshL();
-        iListBox->HandleItemAdditionL();
-        iListBox->DrawDeferred();
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemEditL()
-    {
-    const TInt index = iListBox->CurrentItemIndex();
-    if ( index >= 0 && index < iProcessUids.Count() )
-        {
-        TUid processUid = iProcessUids[ index ];
-        processUid = ShowDialogL( processUid );
-        //
-        if ( processUid != KNullUid )
-            {
-            iProcessUids[ index ] = processUid;
-            SaveChangesL();
-            RefreshL();
-            iListBox->HandleItemAdditionL();
-            iListBox->DrawDeferred();
-            }
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemDeleteL()
-    {
-    const TInt index = iListBox->CurrentItemIndex();
-    if ( index >= 0 && index < iProcessUids.Count() )
-        {
-        iProcessUids.Remove( index );
-        SaveChangesL();
-        RefreshL();
-        iListBox->HandleItemRemovalL();
-        iListBox->DrawDeferred();
-        
-        const TInt newIndex = index - 1;
-        const TInt count = iProcessUids.Count();
-        if ( newIndex >=0 && newIndex < count )
-            {
-            iListBox->SetCurrentItemIndex( index );
-            }
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemDeleteAllL()
-    {
-    iProcessUids.Reset();
-    SaveChangesL();
-    RefreshL();
-    iListBox->HandleItemRemovalL();
-    iListBox->DrawDeferred();
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemImportL()
-    {
-    if  ( iXMLFileNameInstallTime->Length() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        if  ( importDialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_IMPORT_FROM_INSTALLED_XML_DIALOG ) )
-            {
-            TRAP_IGNORE( ParseL( *iXMLFileNameInstallTime ) );
-            }
-        }
-    if  ( iXMLFileNameUserSupplied->Length() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        if  ( importDialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_IMPORT_FROM_USERDEFINED_XML_DIALOG ) )
-            {
-            TRAP_IGNORE( ParseL( *iXMLFileNameUserSupplied ) );
-            }
-        }
-
-    SaveChangesL();
-    RefreshL();
-    iListBox->HandleItemRemovalL();
-    iListBox->DrawDeferred();
-    }
-
-
-TUid CMemSpyViewMemoryTrackingAutoStartConfig::ShowDialogL( TUid aUid )
-    {
-    TUid uid = KNullUid;
-    //
-    _LIT( KProcessUidFormat, "%x" );
-    TBuf<128> buf;
-    buf.Format( KProcessUidFormat, aUid );
-    //
-    CAknTextQueryDialog* dialog = new(ELeave) CAknTextQueryDialog( buf );
-    const TBool dialogActioned = ( dialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_PROCESS_UID_DIALOG ) );
-    //
-    if ( dialogActioned )
-        {
-        // Validate the text
-        uid = ValidateProcessUid( buf );
-        }
-    //
-    return uid;
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::SaveChangesL()
-    {
-    iEngine.HelperProcess().SetMemoryTrackingAutoStartProcessListL( iProcessUids );
-    Settings().StoreSettingsL();
-    }
-
-
-TUid CMemSpyViewMemoryTrackingAutoStartConfig::ValidateProcessUid( const TDesC& aUid )
-    {
-    TUid ret = KNullUid;
-    TBool isValid = ETrue;
-    //
-    const TInt length = aUid.Length();
-    for( TInt i=0; i<length && isValid; i++ )
-        {
-        const TChar charValue = aUid[ i ];
-        //
-        switch( charValue )
-            {
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9':
-        case 'a':
-        case 'A':
-        case 'b':
-        case 'B':
-        case 'c':
-        case 'C':
-        case 'd':
-        case 'D':
-        case 'e':
-        case 'E':
-        case 'f':
-        case 'F':
-            break;
-        default:
-            isValid = EFalse;
-            break;
-            }
-        }
-    //
-    if ( isValid )
-        {
-        TUint32 val = 0;
-        TLex lexer( aUid );
-        if ( lexer.Val( val, EHex ) == KErrNone )
-            {
-            ret.iUid = val;
-            }
-        }
-    //
-    return ret;
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlInstallTimeL()
-    {
-    RFs& fsSession = iEngine.FsSession();
-    //
-    TFileName* fileName = new(ELeave) TFileName();
-    CleanupStack::PushL( fileName );
-    //
-    fsSession.PrivatePath( *fileName );
-    //
-    TFindFile findFile( fsSession );
-    if  ( findFile.FindByPath( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, fileName ) == KErrNone )
-        {
-        iXMLFileNameInstallTime = findFile.File().AllocL();
-        }
-    else
-        {
-        iXMLFileNameInstallTime = KNullDesC().AllocL();
-        RDebug::Print( _L("CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlInstallTimeL() - NO FILE FOUND") );
-        }
-    //
-    CleanupStack::PopAndDestroy( fileName );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlUserSuppliedL()
-    {
-    TFindFile findFile( iEngine.FsSession() );
-    if  ( findFile.FindByPath( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, &KMemSpyProcessMemoryTrackingAutoStartConfigSearchPath ) == KErrNone )
-        {
-        iXMLFileNameUserSupplied = findFile.File().AllocL();
-        }
-    else
-        {
-        iXMLFileNameUserSupplied = KNullDesC().AllocL();
-        RDebug::Print( _L("CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlUserSuppliedL() - NO FILE FOUND") );
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::ParseL( const TDesC& aFileName )
-    {
-	Xml::ParseL( *iParser, iEngine.FsSession(), aFileName );
-    //
-    const TInt error = iParserErrorCode;
-    iParserErrorCode = KErrNone;
-    //
-	User::LeaveIfError( error );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnSectionProcessL( const RAttributeArray& aAttributes )
-    {
-    TUid uid = KNullUid;
-    TBool gotSID = EFalse;
-    //
-    const TInt count = aAttributes.Count();
-	for( TInt i=0; i<count; i++ )
-		{
-		const TPtrC8 attrib( aAttributes[ i ].Attribute().LocalName().DesC() );
-		const TPtrC8 value( aAttributes[ i ].Value().DesC() );
-        //
-		if  ( attrib.CompareF( KMemSpyXmlSpec_EntryProcess_SID ) == 0 )
-			{
-            if  ( gotSID )
-                {
-                User::LeaveIfError( KErrCorrupt );
-                }
-            else
-                {
-                if  ( value.Length() >= 8 )
-                    {
-                    TRadix radix = EDecimal;
-                    TPtrC8 pValue( value );
-                    //
-                    if  ( value.Length() == 10 && value.Left( 2 ) == KMemSpyXmlSpec_HexPrefix )
-                        {
-                        pValue.Set( value.Mid( 2 ) );
-                        radix = EHex;
-                        }
-                    //
-                    TUint32 uidVal = 0;
-                    TLex8 lexer( pValue );
-                    const TInt err = lexer.Val( uidVal, radix );
-                    User::LeaveIfError( err );
-                    uid.iUid = uidVal;
-                    gotSID = ETrue;
-                    }
-                }
-			}
-        }
-    //
-    if  ( gotSID )
-        {
-        User::LeaveIfError( iProcessUids.Append( uid ) );
-        }
-    else
-        {
-        User::Leave( KErrCorrupt );
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartDocumentL( const RDocumentParameters& /*aDocParam*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndDocumentL( TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartElementL( const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    //
-	const TPtrC8 name( aElement.LocalName().DesC() );
-    //
-    if  ( name.CompareF( KMemSpyXmlSpec_MasterSection ) == 0 )
-		{
-		iSeenMasterSection = ETrue;
-		}
-    else if ( iSeenMasterSection && name.CompareF( KMemSpyXmlSpec_EntryProcess ) == 0 )
-        {
-        OnSectionProcessL( aAttributes );
-        }
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndElementL( const RTagInfo& /*aElement*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnContentL( const TDesC8& /*aBytes*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartPrefixMappingL( const RString& /*aPrefix*/, const RString& /*aUri*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndPrefixMappingL( const RString& /*aPrefix*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnIgnorableWhiteSpaceL( const TDesC8& /*aBytes*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnSkippedEntityL( const RString& /*aName*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnProcessingInstructionL( const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, TInt aErrorCode )
-    {
-    User::LeaveIfError( aErrorCode );
-    }
-
-
-void CMemSpyViewMemoryTrackingAutoStartConfig::OnError( TInt aErrorCode )
-    {
-    iParserErrorCode = aErrorCode;
-    }
-
-
-TAny* CMemSpyViewMemoryTrackingAutoStartConfig::GetExtendedInterface( const TInt32 /*aUid*/ )
-    {
-    return NULL;
-    }
-
--- a/memspyui/source/MemSpyViewOpenFiles.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewOpenFiles.h"
-
-// System includes
-#include <AknIconArray.h>
-#include <eikdef.h>
-#include <eikclbd.h>
-#include <aknconsts.h>
-#include <gulicon.h>
-#include <avkon.mbg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-
-CMemSpyViewOpenFiles::CMemSpyViewOpenFiles( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewOpenFiles::~CMemSpyViewOpenFiles()
-    {
-    iThreadIds.Close();
-    iFileNames.Close();
-    }
-
-
-void CMemSpyViewOpenFiles::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Open Files" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-CEikListBox* CMemSpyViewOpenFiles::ConstructListBoxL()
-    {
-    delete iListBox;
-    iListBox = NULL;
-    CAknDoubleGraphicStyleListBox* listbox = new (ELeave) CAknDoubleGraphicStyleListBox();
-    iListBox = listbox;
-    //
-    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
-    listbox->SetContainerWindowL( *this );
-    listbox->CreateScrollBarFrameL( ETrue );
-    SetListBoxModelL();
-    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
-    listbox->SetListBoxObserver( this );
-    listbox->SetObserver( this );
-
-    // Create icon array
-    CAknIconArray* iconArray = new (ELeave) CAknIconArray(1);
-    CleanupStack::PushL( iconArray );
-
-    // Create bitmap
-    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-    CleanupStack::PushL( bitmap );
-    const TInt error1 = bitmap->Create( TSize(10,10), EColor16M );
-    User::LeaveIfError( error1 );
-
-    // Create mask
-    CFbsBitmap* mask = new(ELeave) CFbsBitmap();
-    CleanupStack::PushL( mask );
-    const TInt error2 = mask->Create( TSize(10,10), EColor16M );
-    User::LeaveIfError( error2 );
-
-    // Create icon & transfer bitmap
-    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
-    CleanupStack::Pop( 2, bitmap );
-    CleanupStack::PushL( icon );
-
-    // Transfer icon to array
-    iconArray->AppendL( icon );
-    CleanupStack::Pop( icon );
-    
-    // Give icon array to listbox
-    static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->FormattedCellData()->SetIconArrayL(iconArray);
-    CleanupStack::Pop( iconArray );
-    //
-    return listbox;
-    }
-
-
-void CMemSpyViewOpenFiles::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewOpenFiles::ViewType() const
-    {
-    return EMemSpyViewTypeOpenFiles;
-    }
-
-
-TBool CMemSpyViewOpenFiles::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-	case EMemSpyCmdToolsListOpenFiles:
-        OnCmdListOpenFilesL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewOpenFiles::OnCmdListOpenFilesL()
-    {
-    iEngine.ListOpenFilesL();
-    }
-
-
-CMemSpyViewBase* CMemSpyViewOpenFiles::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewOpenFiles::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-
-    // First, try to find the selected thread
-    if  ( iActionedThreadId )
-        {
-        // Try to create a view of the thread in question
-        CMemSpyProcess* process = NULL;
-        CMemSpyThread* thread = NULL;
-        const TInt error = iEngine.Container().ProcessAndThreadByThreadId( *iActionedThreadId, process, thread );
-        if  ( error == KErrNone && thread != NULL )
-            {
-            child = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, thread->Process() );
-            CleanupStack::PushL( child );
-            child->ConstructL( Rect(), *Parent(), thread );
-            CleanupStack::Pop( child );
-            }
-        }
-    //
-    return child;
-    }
-
-
-void CMemSpyViewOpenFiles::SetListBoxModelL()
-    {
-    _LIT(KLineFormatSpec, "%d\t%S\t%S %S");
-
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 50> item;
-    TMemSpySizeText valueBuf;
-    TBuf<64> timeBuf;
-
-    iFileNames.Reset();
-    iThreadIds.Reset();
-    iActionedThreadId = NULL;
-
-    RFs& fsSession = iCoeEnv->FsSession();
-    TOpenFileScan scanner( fsSession );
-
-    CFileList* list = NULL;
-    scanner.NextL( list );
-
-    TIdentityRelation<TEntry> comparer( CompareTEntryObjects );
-
-    while( list != NULL )
-        {
-        CleanupStack::PushL( list );
-    
-        const TInt entryCount = list->Count();
-        for(TInt i=0; i<entryCount; i++)
-            {
-            const TEntry& entry = (*list)[ i ];
-
-            // Check for duplicates
-            const TInt foundIndex = iFileNames.Find( entry, comparer );
-            if  ( foundIndex == KErrNotFound )
-                {
-                // Get time and size format strings
-                valueBuf = MemSpyUiUtils::FormatSizeText( entry.iSize );
-                MemSpyUiUtils::FormatTimeL( timeBuf, entry.iModified );
-
-                // Get just file name
-                TParsePtrC parser( entry.iName );
-                const TPtrC pJustName( parser.NameAndExt() );
-
-                // Create item 
-                item.Format( KLineFormatSpec, 0, &pJustName, &valueBuf, &timeBuf );
-                model->AppendL( item );
-                iThreadIds.AppendL( scanner.ThreadId() );
-                iFileNames.AppendL( entry );
-                }
-            }
-
-        CleanupStack::PopAndDestroy( list );
-        list = NULL;
-        scanner.NextL( list );
-        }
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-void CMemSpyViewOpenFiles::HandleListBoxItemActionedL( TInt aCurrentIndex )
-    {
-    if  ( aCurrentIndex >= 0 && aCurrentIndex < iThreadIds.Count() )
-        {
-        iActionedThreadId = &iThreadIds[ aCurrentIndex ];
-        }
-    else
-        {
-        iActionedThreadId = NULL;
-        }
-
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-TBool CMemSpyViewOpenFiles::CompareTEntryObjects( const TEntry& aLeft, const TEntry& aRight )
-    {
-    return ( aLeft.iName.CompareF( aRight.iName ) == 0 );
-    }
-
-
--- a/memspyui/source/MemSpyViewProcesses.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,513 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewProcesses.h"
-
-// System includes
-#include <aknsfld.h>
-#include <AknQueryDialog.h>
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-// Constants
-const TInt KMemSpyMaxSearchTextLength = 30;
-const TInt KMemSpyMaxSearchTextLengthWithWildcards = KMemSpyMaxSearchTextLength + 4;
-
-
-
-CMemSpyViewProcesses::CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewProcesses::CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess )
-:   CMemSpyViewBase( aEngine, aObserver ), iCurrentProcess( &aProcess )
-    {
-    iCurrentProcess->Open();
-    }
-
-
-CMemSpyViewProcesses::~CMemSpyViewProcesses()
-    {
-    if  ( iCurrentProcess )
-        {
-        iCurrentProcess->Close();
-        }
-    //
-    delete iSearchField;
-    delete iMatcherBuffer;
-    }
-
-
-void CMemSpyViewProcesses::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Processes\n& Threads" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    //
-    iMatcherBuffer = HBufC::NewL( KMemSpyMaxSearchTextLengthWithWildcards );
-    //
-    iSearchField = CAknSearchField::NewL( *this, CAknSearchField::ESearch, NULL, KMemSpyMaxSearchTextLength );
-    iSearchField->SetObserver( this );
-    iSearchField->SetFocus( ETrue );
-    iSearchField->SetComponentsToInheritVisibility( ETrue );
-    //
-    CMemSpyEngineObjectContainer& container = iEngine.Container();
-    if  ( aSelectionRune )
-        {
-        CMemSpyProcess* selectedItem = reinterpret_cast< CMemSpyProcess* >( aSelectionRune );
-        const TInt index = container.ProcessIndexById( selectedItem->Id() );
-        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-            {
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }
-        }
-    else if ( container.Count() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-        }
-    //
-    SizeChanged();
-    ActivateL();
-    }
-
-
-CMemSpyProcess& CMemSpyViewProcesses::CurrentProcess() const
-    {
-    __ASSERT_ALWAYS( iCurrentProcess != NULL, User::Invariant() );
-    return *iCurrentProcess;
-    }
-
-
-void CMemSpyViewProcesses::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewProcesses::ViewType() const
-    {
-    return EMemSpyViewTypeProcesses;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewProcesses::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewProcesses::PrepareChildViewL()
-    {
-    CMemSpyViewThreads* child = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, *iCurrentProcess );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewProcesses::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == MenuCascadeResourceId() )
-        {
-        CMemSpyProcess& process = CurrentProcess();
-        const TBool hide = ( iEngine.Container().Count() == 0 ) || process.IsDead();
-        //
-        aMenuPane->SetItemDimmed( EMemSpyCmdProcessInfo, hide );
-        aMenuPane->SetItemDimmed( EMemSpyCmdProcessEnd, hide );
-        }
-    }
-
-
-TBool CMemSpyViewProcesses::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    // Sorting
-    case EMemSpyCmdProcessSortById:
-        OnCmdSortByIdL();
-		break;
-    case EMemSpyCmdProcessSortByName:
-        OnCmdSortByNameL();
-		break;
-    case EMemSpyCmdProcessSortByThreadCount:
-        OnCmdSortByThreadCountL();
-		break;
-    case EMemSpyCmdProcessSortByCodeSegs:
-        OnCmdSortByCodeSegsL();
-		break;
-    case EMemSpyCmdProcessSortByHeapUsage:
-        OnCmdSortByHeapUsageL();
-		break;
-    case EMemSpyCmdProcessSortByStackUsage:
-        OnCmdSortByStackUsageL();
-		break;
-    // End
-    case EMemSpyCmdProcessEndTerminate:
-        OnCmdEndTerminateL();
-		break;
-    case EMemSpyCmdProcessEndKill:
-        OnCmdEndKillL();
-		break;
-    case EMemSpyCmdProcessEndPanic:
-        OnCmdEndPanicL();
-		break;
-    // Info
-    case EMemSpyCmdProcessInfoSummary:
-        OnCmdInfoSummaryL();
-		break;
-    case EMemSpyCmdProcessInfoHandles:
-        OnCmdInfoHandlesL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByIdL()
-    {
-    iEngine.Container().SortById();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByNameL()
-    {
-    iEngine.Container().SortByName();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByThreadCountL()
-    {
-    iEngine.Container().SortByThreadCount();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByCodeSegsL()
-    {
-    iEngine.Container().SortByCodeSegs();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByHeapUsageL()
-    {
-    iEngine.Container().SortByHeapUsage();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdSortByStackUsageL()
-    {
-    iEngine.Container().SortByStackUsage();
-    RefreshL();
-    }
-
-
-void CMemSpyViewProcesses::OnCmdInfoSummaryL()
-    {
-    CMemSpyProcess& process = CurrentProcess();
-    iEngine.HelperProcess().OutputProcessInfoL( process );
-    }
-
-
-void CMemSpyViewProcesses::OnCmdInfoHandlesL()
-    {
-    CMemSpyProcess& process = CurrentProcess();
-    //
-    const TInt threadCount = process.Count();
-    for( TInt i=0; i<threadCount; i++ )
-        {
-        CMemSpyThread& thread = process.At( i );
-        thread.InfoContainerForceSyncronousConstructionL().PrintL();
-        }
-    }
-
-
-void CMemSpyViewProcesses::OnCmdEndTerminateL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyProcess& process = CurrentProcess();
-    //
-    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        process.TerminateL();
-        RefreshL();
-        }
-    }
-
-
-void CMemSpyViewProcesses::OnCmdEndPanicL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyProcess& process = CurrentProcess();
-    //
-    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        process.PanicL();
-        RefreshL();
-        }
-    }
-
-
-void CMemSpyViewProcesses::OnCmdEndKillL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyProcess& process = CurrentProcess();
-    //
-    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        process.KillL();
-        RefreshL();
-        }
-    }
-
-
-
-
-void CMemSpyViewProcesses::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iEngine.Container() );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewProcesses::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewProcesses::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    if  ( iCurrentProcess )
-        {
-        iCurrentProcess->Close();
-        }
-
-    // Obtain the process that corresponds to the selected item
-    CMemSpyEngineObjectContainer& container = iEngine.Container();
-    CMemSpyProcess& process = container.At( aIndex );
-    iCurrentProcess = &process;
-    iCurrentProcess->Open();
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-void CMemSpyViewProcesses::SizeChanged()
-    {
-    const TRect rect( Rect() );
-    
-    if  ( iListBox && iSearchField )
-        {
-        const TInt lafIndex_H = 1;
-        AknLayoutUtils::LayoutControl( iListBox, rect, AknLayout::list_gen_pane( lafIndex_H ) );
-        AknLayoutUtils::LayoutControl( iSearchField, rect, AknLayout::find_pane() );
-        }
-    else
-        {
-        CMemSpyViewBase::SizeChanged();
-        }
-
-/*
-    // Search field
-    TSize searchFieldSize( iSearchField->MinimumSize() ); // BALLS: search field doesn't implement minimum size correctly?!?!?
-    searchFieldSize.SetWidth( rect.Width() );
-    const TRect searchFieldRect( TPoint( rect.iTl.iX, rect.iBr.iY ), searchFieldSize );
-    iSearchField->SetRect( searchFieldRect );
-
-    // Listbox
-    TSize listBoxSize( rect.Size() - TSize( 0, searchFieldSize.iHeight ) );
-    iListBox->SetRect( rect.iTl, listBoxSize );
-*/
-    }
-
-
-TInt CMemSpyViewProcesses::CountComponentControls() const
-    {
-    TInt count = 0;
-    //
-    if  ( iListBox != NULL )
-        {
-        ++count;
-        }
-    if  ( iSearchField != NULL )
-        {
-        ++count;
-        }
-    //
-    return count;
-    }
-
-
-CCoeControl* CMemSpyViewProcesses::ComponentControl( TInt aIndex ) const
-    {
-    CCoeControl* ret = iListBox;
-    //
-    if  ( aIndex == 1 )
-        {
-        ret = iSearchField;
-        }
-    //
-    return ret;
-    }
-
-
-TKeyResponse CMemSpyViewProcesses::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-    TKeyResponse resp = EKeyWasNotConsumed;
-    //
-    if  ( aType == EEventKey )
-        {
-        switch( aKeyEvent.iCode )
-            {
-        case EKeyUpArrow:
-        case EKeyDownArrow:
-        case EKeyEnter:
-        case EKeyOK:
-            if  ( iListBox )
-                {
-                resp = iListBox->OfferKeyEventL( aKeyEvent, aType );
-                }
-            break;
-        default:
-            break;
-            }
-        //
-        if  ( resp == EKeyWasNotConsumed )
-            {
-            // Do we need to show the find field?
-            resp = iSearchField->OfferKeyEventL( aKeyEvent, aType );
-            }
-        }
-    //
-    return resp;
-    }
-
-
-void CMemSpyViewProcesses::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType )
-    {
-    CMemSpyViewBase::HandleControlEventL( aControl, aEventType );
-    //
-    if  ( aEventType == MCoeControlObserver::EEventStateChanged )
-        {
-        if  ( aControl == iSearchField )
-            {
-            SelectListBoxItemByFindTextL();
-            }
-        }
-    }
-
-
-void CMemSpyViewProcesses::FocusChanged( TDrawNow /*aDrawNow*/ )
-    {
-    if  ( iListBox )
-        {
-        iListBox->SetFocus( IsFocused() );
-        }
-    if  ( iSearchField )
-        {
-        iSearchField->SetFocus( IsFocused() );
-        }
-    }
-
-
-void CMemSpyViewProcesses::SelectListBoxItemByFindTextL()
-    {
-    _LIT( KMemSpyWildcardCharacter, "*" );
-    
-    TPtr pBuffer( iMatcherBuffer->Des() );
-    iSearchField->GetSearchText( pBuffer );
-    //pBuffer.Insert( 0, KMemSpyWildcardCharacter );
-    pBuffer.Append( KMemSpyWildcardCharacter );
-    
-    CMemSpyEngineObjectContainer& container = iEngine.Container();
-    const TInt count = container.Count();
-    //
-    TInt index = 0;
-    while( index < count )
-        {
-        CMemSpyProcess& process = container.At( index );
-        const TPtrC processName( process.Name() );
-        //
-        if  ( processName.MatchF( pBuffer ) >= 0 )
-            {
-            HandleListBoxItemSelectedL( index );
-            iListBox->ScrollToMakeItemVisible( index );
-            iListBox->SetCurrentItemIndexAndDraw( index );
-            return;
-            }
-            
-        ++index;
-        }
-    }
-
-
--- a/memspyui/source/MemSpyViewRAMInfo.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewRAMInfo.h"
-
-// System includes
-#include <hal.h>
-#include <aknnotedialog.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperram.h>
-#include <memspy/engine/memspyengineutils.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-
-
-
-CMemSpyViewRAMInfo::CMemSpyViewRAMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-void CMemSpyViewRAMInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "RAM Info" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewRAMInfo::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewRAMInfo::ViewType() const
-    {
-    return EMemSpyViewTypeRAMInfo;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewRAMInfo::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewRAMInfo::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    return child;
-    }
-
-
-void CMemSpyViewRAMInfo::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    TInt value;
-    TMemSpySizeText size;
-    TMemoryInfoV1Buf memInfoBuf;
-    UserHal::MemoryInfo( memInfoBuf );
-    const TMemoryInfoV1 memInfo( memInfoBuf() );
-
-    // 1st item = Total RAM
-    _LIT(KItem1Format, "\tTotal RAM\t\t%S");
-    size = MemSpyUiUtils::FormatSizeText( memInfo.iTotalRamInBytes );
-    item.Format( KItem1Format, &size );
-    model->AppendL( item );
-
-    // 2nd item = Max free RAM
-    _LIT(KItem2Format, "\tMax Free RAM\t\t%S");
-    size = MemSpyUiUtils::FormatSizeText( memInfo.iMaxFreeRamInBytes );
-    item.Format( KItem2Format, &size );
-    model->AppendL( item );
-
-    // 3rd item = Free RAM
-    _LIT(KItem3Format, "\tFree RAM\t\t%S (%S)");
-    const TMemSpyPercentText freeRamPercentage( MemSpyEngineUtils::FormatPercentage( TReal( memInfo.iTotalRamInBytes ), TReal( memInfo.iFreeRamInBytes ) ) );
-    size = MemSpyUiUtils::FormatSizeText( memInfo.iFreeRamInBytes );
-    item.Format( KItem3Format, &size, &freeRamPercentage );
-    model->AppendL( item );
-
-    // 4th item = RAM disk info
-    _LIT(KItem4Format, "\tRAM Disk Size\t\t%S");
-    size = MemSpyUiUtils::FormatSizeText( memInfo.iInternalDiskRamInBytes );
-    item.Format( KItem4Format, &size );
-    model->AppendL( item );
-
-    // 5th item = Max RAM disk size
-    _LIT(KItem5Format, "\tMax RAM Disk Size\t\t%S");
-    HAL::Get( HALData::EMaxRAMDriveSize, value );
-    size = MemSpyUiUtils::FormatSizeText( value );
-    item.Format( KItem5Format, &size );
-    model->AppendL( item );
-
-    // 6th item = RAM page size
-    _LIT(KItem6Format, "\tMemory Page Size\t\t%S");
-    HAL::Get( HALData::EMemoryPageSize, value );
-    size = MemSpyUiUtils::FormatSizeText( value );
-    item.Format( KItem6Format, &size );
-    model->AppendL( item );
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-TBool CMemSpyViewRAMInfo::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    if  ( iEngine.HelperRAM().IsAknIconCacheConfigurable() )
-        {
-        switch ( aCommand )
-            {
-        case EMemSpyCmdRAMAvkonIconCacheDisabled:
-            OnCmdSetIconCacheStatusL( EFalse );
-		    break;
-        case EMemSpyCmdRAMAvkonIconCacheEnabled:
-            OnCmdSetIconCacheStatusL( ETrue );
-		    break;
-
-        default:
-            handled = CMemSpyViewBase::HandleCommandL( aCommand );
-            break;
-            }
-        }
-    else
-        {
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewRAMInfo::OnCmdSetIconCacheStatusL( TBool aEnabled )
-    {
-    ASSERT( iEngine.HelperRAM().IsAknIconCacheConfigurable() );
-    //
-    const TInt64 savedAmount = iEngine.HelperRAM().SetAknIconCacheStatusL( aEnabled );
-    if ( !aEnabled )
-        {
-        TBuf<128> buf;
-        //
-        if  ( savedAmount != 0 ) 
-            {
-            _LIT(KSavedAmountFormatBuffer, "Saved %S of RAM");
-            const TMemSpySizeText savedAmountString( MemSpyEngineUtils::FormatSizeText( savedAmount, 0, EFalse ) );
-            buf.Format( KSavedAmountFormatBuffer, &savedAmountString );
-            }
-        else
-            {
-            _LIT(KDidNotSaveAnyRAM, "Operation did not save any RAM");
-            buf.Copy( KDidNotSaveAnyRAM );
-            }
-
-        // Show dialog
-	    CAknNoteDialog* note = new( ELeave ) CAknNoteDialog( CAknNoteDialog::ENoTone );
-	    CleanupStack::PushL( note );
-	    note->SetTextWrapping( ETrue );
-	    note->PrepareLC( R_MEMSPY_RAM_MEMORY_DELTA_DIALOG );
-	    note->SetTextL( buf );
-	    CleanupStack::Pop( note );
-	    note->RunLD();
-        }
-    //
-    RefreshL();
-    }
--- a/memspyui/source/MemSpyViewROMInfo.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewROMInfo.h"
-
-// System includes
-#include <hal.h>
-#ifdef __EPOC32__
-#include <e32rom.h>
-#endif
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-// Remap of E32 DP constants, needed so MemSpy can still build on v9.1
-enum TMemSpyDemandPagingKernelConfigFlags
-    {
-    EMemSpyKernelConfigPagingPolicyMask = 3<<5,
-    EMemSpyKernelConfigPagingPolicyNoPaging = 0<<5,
-    EMemSpyKernelConfigPagingPolicyAlwaysPage = 1<<5,
-    EMemSpyKernelConfigPagingPolicyDefaultUnpaged = 2<<5,
-    EMemSpyKernelConfigPagingPolicyDefaultPaged = 3<<5,
-    };
-
-
-
-CMemSpyViewROMInfo::CMemSpyViewROMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-void CMemSpyViewROMInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "ROM Info" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewROMInfo::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewROMInfo::ViewType() const
-    {
-    return EMemSpyViewTypeROMInfo;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewROMInfo::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewROMInfo::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    return child;
-    }
-
-
-void CMemSpyViewROMInfo::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    TInt value = 0;
-    TMemSpySizeText valueBuf;
-    TMemSpySizeText valueBuf2;
-    
-    // 1st item = Total RAM
-    _LIT(KItem1Format, "\tROM Size (HAL)\t\t%S");
-    HAL::Get( HALData::EMemoryROM, value );
-    valueBuf = MemSpyUiUtils::FormatSizeText( value );
-    item.Format( KItem1Format, &valueBuf );
-    model->AppendL( item );
-
-#ifdef __EPOC32__
-    TBuf<128> buf2;
-    _LIT( KTimeFormatSpecLocal, "%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B" );
-	const TUint main_start = UserSvr::RomHeaderAddress();
-    TRomHeader* romHeader = (TRomHeader*) main_start;
-
-    _LIT(KItem2Format, "\tROM Size (Header)\t\t%S");
-    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iRomSize ) );
-    item.Format( KItem2Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem2aFormat, "\tROM Page Size\t\t%S");
-    HAL::Get( HALData::EMemoryPageSize, value );
-    valueBuf = MemSpyUiUtils::FormatSizeText( value );
-    item.Format( KItem2aFormat, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem10Format, "\tVersion\t\tv%2d.%02d.%06d");
-    item.Format( KItem10Format, romHeader->iVersion.iMajor, romHeader->iVersion.iMinor, romHeader->iVersion.iBuild );
-    model->AppendL( item );
-
-    _LIT(KItem3Format, "\tTimestamp\t\t%S");
-    TTime time( romHeader->iTime );
-    time.FormatL( buf2, KTimeFormatSpecLocal );
-    item.Format( KItem3Format, &buf2 );
-    model->AppendL( item );
-
-    _LIT(KItem4Format, "\tAddress Range\t\t%S - %S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iRomBase );
-    MemSpyUiUtils::FormatHex( valueBuf2, (romHeader->iRomBase + romHeader->iRomSize ));
-    item.Format( KItem4Format, &valueBuf, &valueBuf2 );
-    model->AppendL( item );
-
-    _LIT(KItem5Format, "\tPrimary File Address\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iPrimaryFile );
-    item.Format( KItem5Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem6Format, "\tSecondary File Address\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iSecondaryFile );
-    item.Format( KItem6Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem7Format, "\tChecksum\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iCheckSum );
-    item.Format( KItem7Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem8Format, "\tKernel Config Flags\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iKernelConfigFlags );
-    item.Format( KItem8Format, &valueBuf );
-    model->AppendL( item );
-
-    if  ( romHeader->iKernelConfigFlags & EKernelConfigIpcV1Available )
-        {
-        _LIT(KItem8aFormat, "\tIPC v1 Available\t\tYes");
-        item.Copy( KItem8aFormat );
-        model->AppendL( item );
-        }
-    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecEnforcement )
-        {
-        _LIT(KItem8bFormat, "\tPlatSec Enforcement\t\tYes");
-        item.Copy( KItem8bFormat );
-        model->AppendL( item );
-        }
-    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecDiagnostics )
-        {
-        _LIT(KItem8cFormat, "\tPlatSec Diagnostics\t\tYes");
-        item.Copy( KItem8cFormat );
-        model->AppendL( item );
-        }
-    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecProcessIsolation )
-        {
-        _LIT(KItem8dFormat, "\tPlatSec Process Isolation\t\tYes");
-        item.Copy( KItem8dFormat );
-        model->AppendL( item );
-        }
-    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecEnforceSysBin )
-        {
-        _LIT(KItem8eFormat, "\tEnforce \\Sys\\Bin\\\t\tYes");
-        item.Copy( KItem8eFormat );
-        model->AppendL( item );
-        }
-
-    const TUint32 pagingPolicy = ( romHeader->iKernelConfigFlags & EMemSpyKernelConfigPagingPolicyMask );
-#ifdef _DEBUG
-    RDebug::Printf( "pagingPolicy: %u (0x%08x)", pagingPolicy, pagingPolicy );
-#endif
-    _LIT(KItem8eFormat, "\tDemand Paging\t\t%S");
-    //
-    if  ( pagingPolicy & EMemSpyKernelConfigPagingPolicyNoPaging )
-        {
-        _LIT( KDemandPagingPolicyNoPaging, "No Paging" );
-        item.Format( KItem8eFormat, &KDemandPagingPolicyNoPaging );
-        }
-    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyAlwaysPage )
-        {
-        _LIT( KDemandPagingPolicyAlwaysPage, "Always Paging" );
-        item.Format( KItem8eFormat, &KDemandPagingPolicyAlwaysPage);
-        }
-    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyDefaultUnpaged )
-        {
-        _LIT( KDemandPagingPolicyDefaultUnpaged, "Default Unpaged" );
-        item.Format( KItem8eFormat, &KDemandPagingPolicyDefaultUnpaged);
-        }
-    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyDefaultPaged )
-        {
-        _LIT( KDemandPagingPolicyDefaultPaged, "Default Paged" );
-        item.Format( KItem8eFormat, &KDemandPagingPolicyDefaultPaged );
-        }
-    //
-    model->AppendL( item );
-
-    _LIT(KItem9Format, "\tSection Header Address\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iRomSectionHeader );
-    item.Format( KItem9Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem11Format, "\tCompressed Size\t\t%S");
-    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iCompressedSize ) );
-    item.Format( KItem11Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem12Format, "\tUncompressed Size\t\t%S");
-    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iUncompressedSize ) );
-    item.Format( KItem12Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem13Format, "\tDisabled Caps. #1\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iDisabledCapabilities[0] );
-    item.Format( KItem13Format, &valueBuf );
-    model->AppendL( item );
-
-    _LIT(KItem14Format, "\tDisabled Caps. #2\t\t%S");
-    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iDisabledCapabilities[1] );
-    item.Format( KItem14Format, &valueBuf );
-    model->AppendL( item );
-
-    for(TInt i=0; i<TRomHeader::KNumTraceMask; i++)
-        {
-        _LIT(KItem15Format, "\tTrace Mask #%d\t\t%S");
-        MemSpyUiUtils::FormatHex( valueBuf, romHeader->iTraceMask[i] );
-        item.Format( KItem15Format, i+1, &valueBuf );
-        model->AppendL( item );
-        }
-
-#endif
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
--- a/memspyui/source/MemSpyViewServerList.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewServerList.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-#include <memspy/engine/memspyenginehelperserver.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyContainerObserver.h"
-
-
-
-
-CMemSpyViewServerList::CMemSpyViewServerList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewServerList::~CMemSpyViewServerList()
-    {
-    delete iList;
-    }
-
-
-void CMemSpyViewServerList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Running Servers" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-TBool CMemSpyViewServerList::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdServerListSortByName:
-        OnCmdServerListSortByNameL();
-        break;
-    case EMemSpyCmdServerListSortBySessionCount:
-        OnCmdServerListSortBySessionCountL();
-        break;
-    case EMemSpyCmdServerListOutputListCSV:
-        OnCmdServerListOutputSummaryL();
-        break;
-    case EMemSpyCmdServerListOutputListDetailed:
-        OnCmdServerListOutputDetailedL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewServerList::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewServerList::ViewType() const
-    {
-    return EMemSpyViewTypeServerList;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewServerList::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewServerList::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-
-    // First, try to find the selected thread
-    if  ( iActionedItem )
-        {
-        // Try to create a view of the thread in question
-        CMemSpyProcess* process = NULL;
-        CMemSpyThread* thread = NULL;
-        //
-        const TInt error = iEngine.Container().ProcessAndThreadByThreadId( iActionedItem->Id(), process, thread );
-        //
-        if  ( error == KErrNone && thread != NULL )
-            {
-            child = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, thread->Process() );
-            CleanupStack::PushL( child );
-            child->ConstructL( Rect(), *Parent(), thread );
-            CleanupStack::Pop( child );
-            }
-        }
-    //
-    return child;
-    }
-
-
-void CMemSpyViewServerList::SetListBoxModelL()
-    {
-    delete iList;
-    iList = NULL;
-    iList = iEngine.HelperServer().ServerListL();
-    //
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iList );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewServerList::HandleListBoxItemActionedL( TInt aCurrentIndex )
-    {
-    if  ( aCurrentIndex >= 0 && aCurrentIndex < iList->Count() )
-        {
-        const CMemSpyEngineServerEntry& serverInfo = iList->At( aCurrentIndex );
-        iActionedItem = &serverInfo;
-        }
-    else
-        {
-        iActionedItem = NULL;
-        }
-
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewServerList::OnCmdServerListSortByNameL()
-    {
-    iList->SortByNameL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewServerList::OnCmdServerListSortBySessionCountL()
-    {
-    iList->SortBySessionCountL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewServerList::OnCmdServerListOutputSummaryL()
-    {
-    OnCmdServerListOutputGenericL( EFalse );
-    }
-
-
-void CMemSpyViewServerList::OnCmdServerListOutputDetailedL()
-    {
-    OnCmdServerListOutputGenericL( ETrue );
-    }
-
-
-void CMemSpyViewServerList::OnCmdServerListOutputGenericL( TBool aDetailed )
-    {
-    // Begin a new data stream
-    _LIT( KMemSpyContext, "Server List - " );
-    _LIT( KMemSpyFolder, "Servers" );
-    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
-
-    // Set prefix for overall listing
-    iEngine.Sink().OutputPrefixSetLC( KMemSpyContext );
-
-    // Create header
-    CMemSpyEngineServerList::OutputDataColumnsL( iEngine, aDetailed );
-    
-    // List items
-    const TInt count = iList->Count();
-    for(TInt i=0; i<count; i++)
-        {
-        const CMemSpyEngineServerEntry& server = iList->At( i );
-        //
-        server.OutputDataL( iEngine.HelperServer(), aDetailed );
-        }
-
-    // Tidy up
-    CleanupStack::PopAndDestroy(); // prefix
- 
-    // End data stream
-    iEngine.Sink().DataStreamEndL();
-    }
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewSystemConfig.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,883 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewSystemConfig.h"
-
-// System includes
-#include <hal.h>
-#include <bautils.h>
-#include <eikenv.h>
-#ifdef __EPOC32__
-#include <e32rom.h>
-#endif
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperfilesystem.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-// Literal constants
-_LIT( KMemSpyItemValueNotKnown, "Unknown" );
-
-
-
-CMemSpyViewSystemConfig::CMemSpyViewSystemConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewSystemConfig::~CMemSpyViewSystemConfig()
-    {
-    delete iModel;
-    }
-
-
-void CMemSpyViewSystemConfig::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "System Configuration" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-void CMemSpyViewSystemConfig::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewSystemConfig::ViewType() const
-    {
-    return EMemSpyViewTypeSystemConfig;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    return child;
-    }
-
-
-void CMemSpyViewSystemConfig::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
-    delete iModel;
-    iModel = model;
-
-    TBuf<128> valueBuf;
-    TInt value = 0;
-    TInt value2 = 0;
-    TMemSpySizeText sizeBuf;
-
-    //
-    _LIT(KItem1Format, "Manufacturer");
-    GetManufacturer( valueBuf );
-    AddItemL( KItem1Format, valueBuf );
-
-    //
-    _LIT(KItem2Format, "Machine Uid");
-    GetMachineUid( valueBuf );
-    AddItemL( KItem2Format, valueBuf );
-
-    //
-    _LIT(KItem1aFormat, "Model Uid");
-    GetHALValueAsHexL( HALData::EModel, KItem1aFormat );
-
-    //
-    _LIT(KItem2aFormat, "Device Family");
-    GetDeviceFamily( valueBuf );
-    AddItemL( KItem2aFormat, valueBuf );
-
-    //
-    _LIT(KItem2bFormat, "Device Family Rev.");
-    GetHALValueAsNumericL( HALData::EDeviceFamilyRev, KItem2bFormat );
-
-    //
-    _LIT(KItem3Format, "Hardware Rev.");
-    GetHALValueAsNumericL( HALData::EManufacturerHardwareRev, KItem3Format );
-
-    //
-    _LIT(KItem4Format, "Software Rev.");
-    GetHALValueAsNumericL( HALData::EManufacturerSoftwareRev, KItem4Format );
-
-    //
-    _LIT(KItem5Format, "Software Build");
-    GetHALValueAsNumericL( HALData::EManufacturerSoftwareBuild, KItem5Format );
-
-    //
-    _LIT(KItem6Format, "CPU");
-    GetCPU( valueBuf );
-    AddItemL( KItem6Format, valueBuf );
-
-    //
-    _LIT(KItem7Format, "CPU ABI");
-    GetCPUABI( valueBuf );
-    AddItemL( KItem7Format, valueBuf );
-
-    //
-    _LIT(KItem8Format, "CPU Speed");
-    _LIT(KItem8Suffix, "KHz");
-    GetHALValueAsNumericL( HALData::ECPUSpeed, KItem8Format, &KItem8Suffix );
-
-    //
-    _LIT(KItem8aFormat, "Floating Point Support");
-    GetHALValueAsYesNoL( HALData::EHardwareFloatingPoint, KItem8aFormat );
-
-    //
-    _LIT(KItem8bFormat, "System Tick Period");
-    _LIT(KItem8bSuffix, "ms");
-    GetHALValueAsNumericL( HALData::ESystemTickPeriod, KItem8bFormat, &KItem8bSuffix );
-
-    //
-    _LIT(KItem8cFormat, "Nano Tick Period");
-    _LIT(KItem8cSuffix, "us");
-    GetHALValueAsNumericL( HALData::ENanoTickPeriod, KItem8cFormat, &KItem8cSuffix );
-
-    //
-    _LIT(KItem9Format, "Startup Reason");
-    GetStartupReason( valueBuf );
-    AddItemL( KItem9Format, valueBuf );
-
-    //
-    _LIT(KItem10Format, "Language");
-    GetHALValueAsNumericL( HALData::ELanguageIndex, KItem10Format, NULL, 4 );
-
-    //
-    _LIT(KItem10aFormat, "Locale");
-    GetHALValueAsNumericL( HALData::ELocaleLoaded, KItem10aFormat, NULL, 4 );
-
-    //
-    _LIT(KItem11aFormat, "Clipboard Drive");
-    GetHALValueAsDriveLetterL( HALData::EClipboardDrive, KItem11aFormat );
-
-    //
-    _LIT(KItem11bFormat, "System Drive (Hal)");
-    GetHALValueAsDriveLetterL( HALData::ESystemDrive, KItem11bFormat );
-
-    //
-    _LIT(KItem11cFormat, "System Drive (F32)");
-    TDriveNumber systemDrive = CMemSpyEngineHelperFileSystem::GetSystemDrive();
-    AddItemL( systemDrive, KItem11cFormat );
-
-    //
-    _LIT(KItem11dFormat, "System Drive (Bafl)");
-    value = BaflUtils::GetSystemDrive( systemDrive );
-    if ( value == KErrNone )
-        {
-        AddItemL( systemDrive, KItem11dFormat );
-        }
-    else
-        {
-        MemSpyUiUtils::GetErrorText( valueBuf, value );
-        AddItemL( KItem11dFormat, valueBuf );
-        }
-
-    //
-    _LIT(KItem12Format, "Display Type");
-    GetDisplayType( valueBuf );
-    AddItemL( KItem12Format, valueBuf );
-    //
-    _LIT(KItem12aCaption, "Display Size");
-    _LIT(KItem12aFormat, "%d x %d");
-    value = value2 = 0;
-    GetHALValue( HALData::EDisplayXPixels, value );
-    GetHALValue( HALData::EDisplayYPixels, value2 );
-    valueBuf.Format( KItem12aFormat, value, value2 );
-    AddItemL( KItem12aCaption, valueBuf );
-
-    //
-    _LIT(KItem13Format, "Display Depth");
-    _LIT(KItem13Suffix, "bpp");
-    GetHALValueAsNumericL( HALData::EDisplayBitsPerPixel, KItem13Format, &KItem13Suffix );
-
-    //
-    _LIT(KItem14Format, "Display Mode Count");
-    GetHALValueAsNumericL( HALData::EDisplayNumModes, KItem14Format );
-
-    //
-    _LIT(KItem14aFormat, "Current Mode");
-    GetHALValueAsNumericL( HALData::EDisplayMode, KItem14aFormat );
-
-    //
-    _LIT(KItem15Format, "Display Address");
-    GetHALValueAsHexL( HALData::EDisplayMemoryAddress, KItem15Format );
-
-    //
-    _LIT(KItem16Format, "Screen Count");
-    GetHALValueAsNumericL( HALData::EDisplayNumberOfScreens, KItem16Format );
-
-    //
-    _LIT(KItem17Format, "Eikon Def. Disp. Mode");
-    GetDisplayMode( valueBuf, static_cast<TMemSpyDisplayMode>( CEikonEnv::Static()->DefaultDisplayMode() ) );
-    AddItemL( KItem17Format, valueBuf );
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    iModel = NULL;
-    }
-
-
-void CMemSpyViewSystemConfig::GetManufacturer( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::EManufacturer, value );
-    //
-    switch( value )
-        {
-    case HALData::EManufacturer_Ericsson:
-        {
-        _LIT( KName, "Ericsson" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Motorola:
-        {
-        _LIT( KName, "Motorola" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Nokia:
-        {
-        _LIT( KName, "Nokia" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Panasonic:
-        {
-        _LIT( KName, "Panasonic" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Psion:
-        {
-        _LIT( KName, "Psion" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Intel:
-        {
-        _LIT( KName, "Intel" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Cogent:
-        {
-        _LIT( KName, "Cogent" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Cirrus:
-        {
-        _LIT( KName, "Cirrus" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_Linkup:
-        {
-        _LIT( KName, "Linkup" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EManufacturer_TexasInstruments:
-        {
-        _LIT( KName, "Texas Instruments" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetDisplayMode( TDes& aBuf, TMemSpyDisplayMode aMode )
-    {
-    switch( aMode )
-        {
-    case ENone:
-        {
-        _LIT( KName, "ENone" );
-        aBuf.Copy( KName );
-        }
-    case EGray2:
-        {
-        _LIT( KName, "EGray2" );
-        aBuf.Copy( KName );
-        }
-    case EGray4:
-        {
-        _LIT( KName, "EGray4" );
-        aBuf.Copy( KName );
-        }
-    case EGray16:
-        {
-        _LIT( KName, "EGray16" );
-        aBuf.Copy( KName );
-        }
-    case EGray256:
-        {
-        _LIT( KName, "EGray256" );
-        aBuf.Copy( KName );
-        }
-    case EColor16:
-        {
-        _LIT( KName, "EColor16" );
-        aBuf.Copy( KName );
-        }
-    case EColor256:
-        {
-        _LIT( KName, "EColor256" );
-        aBuf.Copy( KName );
-        }
-    case EColor64K:
-        {
-        _LIT( KName, "EColor64K" );
-        aBuf.Copy( KName );
-        }
-    case EColor16M:
-        {
-        _LIT( KName, "EColor16M" );
-        aBuf.Copy( KName );
-        }
-    case ERgb:
-        {
-        _LIT( KName, "ERgb" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case EColor4K:
-        {
-        _LIT( KName, "EColor4K" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case EColor16MU:
-        {
-        _LIT( KName, "EColor16MU" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case EColor16MA:
-        {
-        _LIT( KName, "EColor16MA" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case EColor16MAP:
-        {
-        _LIT( KName, "EColor16MAP" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetDeviceFamily( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::EDeviceFamily, value );
-    //
-    switch( value )
-        {
-    case HALData::EDeviceFamily_Crystal:
-        {
-        _LIT( KName, "Crystal" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EDeviceFamily_Pearl:
-        {
-        _LIT( KName, "Pearl" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EDeviceFamily_Quartz:
-        {
-        _LIT( KName, "Quartz" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetCPU( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::ECPU, value );
-    //
-    switch( value )
-        {
-    case HALData::ECPU_ARM:
-        {
-        _LIT( KName, "ARM" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPU_MCORE:
-        {
-        _LIT( KName, "mCORE" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPU_X86:
-        {
-        _LIT( KName, "X86" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetCPUABI( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::ECPUABI, value );
-    //
-    switch( value )
-        {
-    case HALData::ECPUABI_ARM4:
-        {
-        _LIT( KName, "ARM4" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_ARMI:
-        {
-        _LIT( KName, "ARMI" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_THUMB:
-        {
-        _LIT( KName, "ARM4" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_MCORE:
-        {
-        _LIT( KName, "mCORE" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_MSVC:
-        {
-        _LIT( KName, "MSVC" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_ARM5T:
-        {
-        _LIT( KName, "ARM5T" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ECPUABI_X86:
-        {
-        _LIT( KName, "X86" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetStartupReason( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::ESystemStartupReason, value );
-    //
-    switch( value )
-        {
-    case HALData::ESystemStartupReason_Cold:
-        {
-        _LIT( KName, "Cold" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ESystemStartupReason_Warm:
-        {
-        _LIT( KName, "Warm" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::ESystemStartupReason_Fault:
-        {
-        _LIT( KName, "Fault" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetKeyboard( TDes& aBuf )
-    {
-    _LIT(KComma, ", ");
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::EKeyboard, value );
-    //
-    aBuf.Zero();
-    if  ( value & EKeyboard_Keypad )
-        {
-        _LIT( KName, "Keypad" );
-        aBuf.Copy( KName );
-        }
-
-
-    if  ( value & EKeyboard_Full )
-        {
-        if  ( aBuf.Length() )
-            {
-            aBuf.Append( KComma );
-            }
-
-        _LIT( KName, "Full Keyboard" );
-        aBuf.Copy( KName );
-        }
-
-    if  ( !aBuf.Length() )
-        {
-        aBuf.Copy( KMemSpyItemValueNotKnown );
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetMachineUid( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::EMachineUid, value );
-    //
-    switch( value )
-        {
-    case HALData::EMachineUid_Series5mx:
-        {
-        _LIT( KName, "Series 5mx" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Brutus:
-        {
-        _LIT( KName, "Brutus" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Cogent:
-        {
-        _LIT( KName, "Cogent" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Win32Emulator:
-        {
-        _LIT( KName, "Win32 Emulator" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_WinC:
-        {
-        _LIT( KName, "WINC" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_CL7211_Eval:
-        {
-        _LIT( KName, "CL7211" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_LinkUp:
-        {
-        _LIT( KName, "LinkUp" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Assabet:
-        {
-        _LIT( KName, "Assabet" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_IQ80310:
-        {
-        _LIT( KName, "IQ80310" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Lubbock:
-        {
-        _LIT( KName, "Lubbock" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Integrator:
-        {
-        _LIT( KName, "Integrator" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_Helen:
-        {
-        _LIT( KName, "Helen" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_X86PC:
-        {
-        _LIT( KName, "X86PC" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_OmapH2:
-        {
-        _LIT( KName, "OmapH2" );
-        aBuf.Copy( KName );
-        }
-        break;
-    case HALData::EMachineUid_OmapH4:
-        {
-        _LIT( KName, "OmapH4" );
-        aBuf.Copy( KName );
-        }
-        break;
-    default:
-        {
-        _LIT( KName, "0x%08x" );
-        aBuf.Format( KName, value );
-        }
-        break;
-        }
-    }
-
-
-void CMemSpyViewSystemConfig::GetDisplayType( TDes& aBuf )
-    {
-    TInt value = KErrGeneral;
-    GetHALValue( HALData::EDisplayIsMono, value );
-    //
-    if  ( value == 0 )
-        {
-        _LIT( KName, "Colour" );
-        aBuf.Copy( KName );
-        }
-    else if ( value == 1 )
-        {
-        _LIT( KName, "Mono" );
-        aBuf.Copy( KName );
-        }
-    else
-        {
-        MemSpyUiUtils::GetErrorText( aBuf, value );
-        }
-    }
-
-
-TInt CMemSpyViewSystemConfig::GetHALValue( HALData::TAttribute aAttribute, TInt& aValue )
-    {
-    aValue = KErrGeneral;
-    const TInt error = HAL::Get( aAttribute, aValue );
-
-#ifdef _DEBUG
-    if  ( error != KErrNone )
-        {
-        RDebug::Printf("CMemSpyViewSystemConfig::GetHALValue() - aAttribute: %3d, error: %d, value: %d", aAttribute, error, aValue);
-        }
-#endif
-
-    return error;
-    }
-
-
-TInt CMemSpyViewSystemConfig::GetHALValueAsNumericL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix, TInt aWidth )
-    {
-    TBuf<20> valueBuf; 
-    TInt value = 0;
-    //
-    const TInt error = GetHALValue( aAttribute, value );
-    if  ( error == KErrNone )
-        {
-        if  ( aWidth > 0 && aWidth < 12 )
-            {
-            valueBuf.NumFixedWidthUC( (TUint) value, EDecimal, aWidth );
-            }
-        else
-            {
-            valueBuf.Num( value );
-            }
-
-        AddItemL( aCaption, valueBuf, aSuffix );
-        }
-    else
-        {
-        MemSpyUiUtils::GetErrorText( valueBuf, error );
-        AddItemL( aCaption, valueBuf );
-        }
-    //
-    return error;
-    }
-
-
-TInt CMemSpyViewSystemConfig::GetHALValueAsHexL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
-    {
-    TBuf<20> valueBuf; 
-    TInt value = 0;
-    //
-    const TInt error = GetHALValue( aAttribute, value );
-    if  ( error == KErrNone )
-        {
-        MemSpyEngineUtils::FormatHex( valueBuf, value );
-        AddItemL( aCaption, valueBuf, aSuffix );
-        }
-    else
-        {
-        MemSpyUiUtils::GetErrorText( valueBuf, error );
-        AddItemL( aCaption, valueBuf );
-        }
-    //
-    return error;
-    }
-
-
-TInt CMemSpyViewSystemConfig::GetHALValueAsYesNoL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
-    {
-    TBuf<20> valueBuf; 
-    TInt value = 0;
-    //
-    const TInt error = GetHALValue( aAttribute, value );
-    if  ( error == KErrNone || error == KErrNotSupported )
-        {
-        _LIT(KYes, "Yes");
-        _LIT(KNo, "No");
-        _LIT(KError, "Error: %d");
-
-        if ( error < KErrNone )
-            {
-            valueBuf.Format( KError, error );
-            }
-        else if ( value == EFalse )
-            {
-            valueBuf.Copy( KNo );
-            }
-        else if ( error == KErrNone )
-            {
-            valueBuf.Copy( KYes );
-            }
-
-        AddItemL( aCaption, valueBuf, aSuffix );
-        }
-    else
-        {
-        MemSpyUiUtils::GetErrorText( valueBuf, error );
-        AddItemL( aCaption, valueBuf );
-        }
-    //
-    return error;
-    }
-
-
-TInt CMemSpyViewSystemConfig::GetHALValueAsDriveLetterL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
-    {
-    TInt value = 0;
-    const TInt error = GetHALValue( aAttribute, value );
-    //
-    if  ( error == KErrNone && ( value >= EDriveA && value <= EDriveZ ) )
-        {
-        AddItemL( (TDriveNumber) value, aCaption, aSuffix );
-        }
-    else
-        {
-        _LIT( KItemNotSet, "Not Defined");
-        AddItemL( aCaption, KItemNotSet );
-        }
-    //
-    return error;
-    }
-
-
-void CMemSpyViewSystemConfig::AddItemL( const TDesC& aCaption, const TDesC& aValue, const TDesC* aSuffix )
-    {
-    _LIT(KItemFormat, "\t%S\t\t%S");
-    //
-    TBuf<KMaxFullName> item;
-    item.Format( KItemFormat, &aCaption, &aValue );
-    if  ( aSuffix ) 
-        {
-        _LIT(KSpace, " ");
-        item.Append( KSpace );
-        item.Append( *aSuffix );
-        }
-    //
-    iModel->AppendL( item );
-    }
-
-
-void CMemSpyViewSystemConfig::AddItemL( TDriveNumber aDrive, const TDesC& aCaption, const TDesC* aSuffix )
-    {
-    TBuf<20> valueBuf; 
-    //
-    const TDriveUnit drive( aDrive );
-    valueBuf.Copy( drive.Name() );
-    //
-    AddItemL( aCaption, valueBuf, aSuffix );
-    }
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemActiveObject.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemActiveObject.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperactiveobject.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-
-
-
-CMemSpyViewThreadInfoItemActiveObjectBase::CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeActiveObject )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemActiveObjectBase::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdActiveObjectListing:
-        OnCmdWriteAOListingL();
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemActiveObjectBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        aMenuPane->SetItemDimmed( EMemSpyCmdActiveObject, Thread().IsDead() );
-        }
-    }
-
-
-CMemSpyEngineActiveObjectArray& CMemSpyViewThreadInfoItemActiveObjectBase::ActiveObjectArray() const
-    {
-    CMemSpyThreadInfoActiveObjects* activeObjectArray = static_cast< CMemSpyThreadInfoActiveObjects* >( iInfoItem );
-    return activeObjectArray->Array();
-    }
-    
-    
-void CMemSpyViewThreadInfoItemActiveObjectBase::OnCmdWriteAOListingL()
-    {
-    CMemSpyEngineActiveObjectArray& objects = ActiveObjectArray();
-
-    // Begin a new data stream
-    _LIT( KMemSpyContext, "Active Object List - " );
-    _LIT( KMemSpyFolder, "Active Objects" );
-    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
-
-    // Set prefix for overall listing
-    iEngine.Sink().OutputPrefixSetLC( KMemSpyContext );
-
-    // Create header
-    CMemSpyEngineActiveObjectArray::OutputDataColumnsL( iEngine );
-    
-    // List items
-    const TInt count = objects.Count();
-    for(TInt i=0; i<count; i++)
-        {
-        const CMemSpyEngineActiveObject& object = objects.At( i );
-        //
-        object.OutputDataL( iEngine );
-        }
-
-    // Tidy up
-    CleanupStack::PopAndDestroy(); // prefix
-
-    // End data stream
-    iEngine.Sink().DataStreamEndL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemActiveObject::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    // Causes list of server's to be prepared
-    CMemSpyViewThreadInfoItemActiveObjectBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    _LIT( KTitle, "Active Objects" );
-    SetTitleL( KTitle );
-
-    // Try to select the correct server
-    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
-    TInt selectedIndex = 0;
-    if  ( aSelectionRune )
-        {
-        CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
-        const TInt index = activeObjectArray.ObjectIndexByAddress( aSelectionRune );
-        if  ( index >= 0 && index < activeObjectArray.Count() )
-            {
-            selectedIndex = index + 1;
-            }
-        }
-
-    // Select item
-    if  ( infoItem->DetailsCount() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( selectedIndex );
-        HandleListBoxItemSelectedL( selectedIndex );
-        }
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemActiveObject::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemActiveObject;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObject::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-
-    // Get current entry address
-    TInt index = iListBox->CurrentItemIndex();
-    if  ( index > 0 )
-        {
-        --index;
-        CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
-        //
-        if  ( index >= 0 && index < activeObjectArray.MdcaCount() )
-            {
-            CMemSpyEngineActiveObject& object = activeObjectArray.At( index );
-            TAny* aoAddress = object.Address();
-            //
-            child = new(ELeave) CMemSpyViewThreadInfoItemActiveObjectDetails( iEngine, iObserver, iInfoItem->Container(), aoAddress );
-            CleanupStack::PushL( child );
-            child->ConstructL( Rect(), *Parent(), NULL );
-            CleanupStack::Pop( child );
-            }
-        }
-    //
-    return child;
-    }
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemActiveObjectDetails::CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress )
-:   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer ), iObjectAddress( aObjectAddress )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemActiveObjectDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemActiveObjectBase::ConstructL( aRect, aContainer, aSelectionRune );
-
-    _LIT( KTitle, "Active Object Details" );
-    SetTitleL( KTitle );
-    }
-    
-
-TMemSpyViewType CMemSpyViewThreadInfoItemActiveObjectDetails::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemActiveObjectDetails;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObjectDetails::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemActiveObject* parent = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iEngine, iObserver, iInfoItem->Container() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), iObjectAddress );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewThreadInfoItemActiveObjectDetails::SetListBoxModelL()
-    {
-    // Try to find the right entry
-    CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
-    const TInt index = activeObjectArray.ObjectIndexByAddress( iObjectAddress );
-    User::LeaveIfError( index );
-    CMemSpyEngineActiveObject& object = activeObjectArray.At( index );
-    //
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &object );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemChunk.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemChunk.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperchunk.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewChunkList.h"
-
-
-
-CMemSpyViewThreadInfoItemChunk::CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeChunk )
-    {
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemChunk::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    
-    // Get the code segment list
-    CMemSpyThreadInfoChunk* chunkInfoItem = static_cast< CMemSpyThreadInfoChunk* >( iInfoItem );
-    CMemSpyEngineChunkList* list = &chunkInfoItem->List();
-    
-    // Get the current code segment that corresponds to our currently focused list item.
-    const TInt index = iListBox->CurrentItemIndex();
-    if  ( index >= 0 && index < list->Count() )
-        {
-        CMemSpyEngineChunkEntry& entry = list->At( index );
-        child = new(ELeave) CMemSpyViewChunkDetails( iEngine, iObserver, *list, entry );
-        
-        // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-        // This object is about to die in any case.
-        chunkInfoItem->NullifyList();
-
-        CleanupStack::PushL( child );
-        child->ConstructL( Rect(), *Parent() );
-        CleanupStack::Pop( child );
-        }
-        
-    return child;
-    }
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemCodeSeg.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemCodeSeg.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelpercodesegment.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewCodeSegList.h"
-
-
-
-CMemSpyViewThreadInfoItemCodeSeg::CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeCodeSeg )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemCodeSeg::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemCodeSeg::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    
-    // Get the code segment list
-    CMemSpyThreadInfoCodeSeg* codeSegInfoItem = static_cast< CMemSpyThreadInfoCodeSeg* >( iInfoItem );
-    CMemSpyEngineCodeSegList* list = &codeSegInfoItem->List();
-    
-    // Get the current code segment that corresponds to our currently focused list item.
-    const TInt index = iListBox->CurrentItemIndex();
-    if  ( index >= 0 && index < list->Count() )
-        {
-        CMemSpyEngineCodeSegEntry& entry = list->At( index );
-        child = new(ELeave) CMemSpyViewCodeSegDetails( iEngine, iObserver, *list, entry );
-        
-        // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
-        // This object is about to die in any case.
-        codeSegInfoItem->NullifyList();
-
-        CleanupStack::PushL( child );
-        child->ConstructL( Rect(), *Parent() );
-        CleanupStack::Pop( child );
-        }
-        
-    return child;
-    }
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemGeneralInfo.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemGeneralInfo.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-
-
-
-CMemSpyViewThreadInfoItemGeneralInfo::CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeGeneralInfo )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemGeneralInfo::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-
-
-void CMemSpyViewThreadInfoItemGeneralInfo::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
--- a/memspyui/source/MemSpyViewThreadInfoItemGeneric.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-// System includes
-#include <AknWaitDialog.h>
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreadInfoItemList.h"
-
-// Constants
-const TInt KMemSpyConstructionCheckerTimerPeriod = 500000; // 1/2 second
-
-
-
-CMemSpyViewThreadInfoItemGeneric::CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewBase( aEngine, aObserver ), iContainer( aInfoContainer )
-    {
-    iContainer.Thread().Process().Open();
-    iContainer.Thread().Open();
-    iContainer.Open();
-    //
-    iInfoItem = &iContainer.Item( aType );
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
-    iInfoItem->Open();
-    }
-
-
-CMemSpyViewThreadInfoItemGeneric::~CMemSpyViewThreadInfoItemGeneric()
-    {
-    if  ( iInfoItem )
-        {
-        iInfoItem->Close();
-        }
-    //
-    DestroyWaitNote();
-    //
-    iContainer.Close();
-    iContainer.Thread().Close();
-    iContainer.Thread().Process().Close();
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    const TPtrC pTitle( iInfoItem->Name().Mid( 1 ) );
-    SetTitleL( pTitle );
-    //
-    if  ( iInfoItem->IsReady() == EFalse )
-        {
-#ifdef _DEBUG
-        RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::ConstructL() - show wait note - item not ready, iType: %d", iInfoItem->Type() );
-#endif
-
-        // Wait for engine data to be made ready... 
-        ShowWaitNoteL();
-        }
-
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-CMemSpyProcess& CMemSpyViewThreadInfoItemGeneric::Process() const
-    {
-    return iContainer.Thread().Process();
-    }
-
-
-CMemSpyThread& CMemSpyViewThreadInfoItemGeneric::Thread() const
-    {
-    return iContainer.Thread();
-    }
-
-
-CMemSpyThreadInfoContainer& CMemSpyViewThreadInfoItemGeneric::Container() const
-    {
-    return iContainer;
-    }
-
-
-CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemGeneric::InfoItem() const
-    {
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
-    return *iInfoItem;
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::RefreshL()
-    {
-    iInfoItem->RebuildL();    
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemGeneric::ViewType() const
-    {
-    TMemSpyViewType type = EMemSpyViewTypeNone;
-    //
-    switch( iInfoItem->Type() )
-        {
-    case EMemSpyThreadInfoItemTypeHeap:
-        type = EMemSpyViewTypeThreadInfoItemHeap;
-        break;
-    case EMemSpyThreadInfoItemTypeStack:
-        type = EMemSpyViewTypeThreadInfoItemStack;
-        break;
-    case EMemSpyThreadInfoItemTypeChunk:
-        type = EMemSpyViewTypeThreadInfoItemChunk;
-        break;
-    case EMemSpyThreadInfoItemTypeCodeSeg:
-        type = EMemSpyViewTypeThreadInfoItemCodeSeg;
-        break;
-    case EMemSpyThreadInfoItemTypeServer:
-        type = EMemSpyViewTypeThreadInfoItemServer;
-        break;
-    case EMemSpyThreadInfoItemTypeSession:
-        type = EMemSpyViewTypeThreadInfoItemSession;
-        break;
-    case EMemSpyThreadInfoItemTypeSemaphore:
-        type = EMemSpyViewTypeThreadInfoItemSemaphore;
-        break;
-    case EMemSpyThreadInfoItemTypeMutex:
-        type = EMemSpyViewTypeThreadInfoItemMutex;
-        break;
-    case EMemSpyThreadInfoItemTypeTimer:
-        type = EMemSpyViewTypeThreadInfoItemTimer;
-        break;
-    case EMemSpyThreadInfoItemTypeLDD:
-        type = EMemSpyViewTypeThreadInfoItemLDD;
-        break;
-    case EMemSpyThreadInfoItemTypePDD:
-        type = EMemSpyViewTypeThreadInfoItemPDD;
-        break;
-    case EMemSpyThreadInfoItemTypeLogicalChannel:
-        type = EMemSpyViewTypeThreadInfoItemLogicalChannel;
-        break;
-    case EMemSpyThreadInfoItemTypeChangeNotifier:
-        type = EMemSpyViewTypeThreadInfoItemChangeNotifier;
-        break;
-    case EMemSpyThreadInfoItemTypeUndertaker:
-        type = EMemSpyViewTypeThreadInfoItemUndertaker;
-        break;
-    case EMemSpyThreadInfoItemTypeMessageQueue:
-        type = EMemSpyViewTypeThreadInfoItemMessageQueue;
-        break;
-    case EMemSpyThreadInfoItemTypeConditionalVariable:
-        type = EMemSpyViewTypeThreadInfoItemConditionalVariable;
-        break;
-    case EMemSpyThreadInfoItemTypeOpenFiles:
-        type = EMemSpyViewTypeThreadInfoItemOpenFiles;
-        break;
-    case EMemSpyThreadInfoItemTypeActiveObject:
-        type = EMemSpyViewTypeThreadInfoItemActiveObject;
-        break;
-    case EMemSpyThreadInfoItemTypeGeneralInfo:
-        type = EMemSpyViewTypeThreadInfoItemGeneralInfo;
-        break;
-    case EMemSpyThreadInfoItemTypeOtherThreads:
-        type = EMemSpyViewTypeThreadInfoItemOtherThreads;
-        break;
-    case EMemSpyThreadInfoItemTypeOtherProcesses:
-        type = EMemSpyViewTypeThreadInfoItemOtherProcesses;
-        break;
-    case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
-        type = EMemSpyViewTypeThreadInfoItemOwnedThreadHandles;
-        break;
-    case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
-        type = EMemSpyViewTypeThreadInfoItemOwnedProcessHandles;
-        break;
-
-    default:
-        __ASSERT_DEBUG( EFalse, User::Invariant() );
-        break;
-        }
-    //
-    return type;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemList* parent = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, Thread() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), iInfoItem );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareChildViewL()
-    {
-    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
-    CMemSpyViewBase* child = NULL;
-    //
-    return child;
-    }
-
-
-TBool CMemSpyViewThreadInfoItemGeneric::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iInfoItem );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-void CMemSpyViewThreadInfoItemGeneric::ShowWaitNoteL()
-    {
-    // Ugly, but I'm not adding an observer mechanism just for this wait dialog.
-    __ASSERT_ALWAYS( iWaitConstructionChecker == NULL, User::Invariant() );
-    iWaitConstructionChecker = CPeriodic::NewL( CActive::EPriorityLow );
-    iWaitConstructionChecker->Start( KMemSpyConstructionCheckerTimerPeriod, 
-                                     KMemSpyConstructionCheckerTimerPeriod, 
-                                     TCallBack( CheckForItemConstructionComplete, this ) );
-
-    if  ( !iWaitNote )
-        {
-        iWaitNote = new ( ELeave ) CAknWaitDialog( reinterpret_cast<CEikDialog**> ( &iWaitNote ), ETrue );
-        iWaitNote->ExecuteDlgLD( CAknNoteDialog::ENoTone, R_MEMSPY_PREPARING_INFO_ITEM_CONTAINER_WAIT_NOTE );
-        }
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote()
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote() - START" );
-#endif
-	//
-    delete iWaitConstructionChecker;
-    iWaitConstructionChecker = NULL;
-    //
-    if  ( iWaitNote )
-        {
-        TRAP_IGNORE( iWaitNote->ProcessFinishedL() ); // deletes the dialog
-        iWaitNote = NULL;
-        }
-	//
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote() - END" );
-#endif
-    }
-
-
-TInt CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete( TAny* aSelf )
-    {
-    CMemSpyViewThreadInfoItemGeneric& self = *reinterpret_cast< CMemSpyViewThreadInfoItemGeneric* >( aSelf );
-    //
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete() - ready status: %d, iType: %d", self.iInfoItem->IsReady(), self.iInfoItem->Type() );
-#endif
-	//
-    TBool callAgain = ETrue;
-    if  ( self.iInfoItem->IsReady() )
-        {
-        self.DestroyWaitNote();
-        callAgain = EFalse;
-        }
-    //
-    return callAgain;
-    }
-
-
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemHeap.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemHeap.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-
-
-
-CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeHeap )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemHeap::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-#ifndef __WINS__
-	case EMemSpyCmdHeapDataDump:
-        OnCmdHeapDataL();
-        break;
-#endif
-	case EMemSpyCmdHeapCellListing:
-        OnCmdHeapCellListingL();
-        break;
-    case EMemSpyCmdHeapInfoThread:
-        OnCmdHeapInfoL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::OnCmdHeapDataL()
-    {
-    iEngine.HelperHeap().OutputHeapDataUserL( Thread() );
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::OnCmdHeapCellListingL()
-    {
-    iEngine.HelperHeap().OutputCellListingUserL( Thread() );
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::OnCmdHeapInfoL()
-    {
-    iEngine.HelperHeap().OutputHeapInfoUserL( Thread() );
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() );
-        }
-    }
--- a/memspyui/source/MemSpyViewThreadInfoItemList.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,336 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemList.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-#include "MemSpyViewThreadInfoItemStack.h"
-#include "MemSpyViewThreadInfoItemChunk.h"
-#include "MemSpyViewThreadInfoItemCodeSeg.h"
-#include "MemSpyViewThreadInfoItemServer.h"
-#include "MemSpyViewThreadInfoItemActiveObject.h"
-#include "MemSpyViewThreadInfoItemGeneralInfo.h"
-#include "MemSpyViewThreadInfoItemMemoryTracking.h"
-
-// Constants
-const TInt KMemSpyIdleResetListboxTimerPeriod = 250000;
-
-
-CMemSpyViewThreadInfoItemList::CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread )
-:   CMemSpyViewBase( aEngine, aObserver ), iThread( aThread )
-    {
-    iThread.Process().Open();
-    iThread.Open();
-    }
-
-
-CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
-    {
-    delete iIdleResetListboxTimer;
-
-    TRAP_IGNORE( 
-        CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
-        container.ObserverRemove( *this );
-    );
-
-    if  ( iCurrentInfoItem )
-        {
-        iCurrentInfoItem->Close();
-        }
-
-    iThread.Process().Close();
-    iThread.Close();
-    }
-
-
-
-void CMemSpyViewThreadInfoItemList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Thread Objects" );
-    SetTitleL( KTitle );
-    //
-    iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );
-    //
-    CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
-    container.ObserverAddL( *this );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    //
-    if  ( aSelectionRune )
-        {
-        CMemSpyThreadInfoItemBase* selectedItem = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelectionRune );
-        const TInt index = container.InfoItemIndexByType( selectedItem->Type() );
-        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-            {
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }
-        }
-    else if ( container.MdcaCount() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-        }
-    }
-
-
-const CMemSpyProcess& CMemSpyViewThreadInfoItemList::Process() const
-    {
-    return iThread.Process();
-    }
-
-
-const CMemSpyThread& CMemSpyViewThreadInfoItemList::Thread() const
-    {
-    return iThread;
-    }
-
-
-const CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemList::CurrentInfoItem() const
-    {
-    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
-    return *iCurrentInfoItem;
-    }
-
-
-void CMemSpyViewThreadInfoItemList::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemList::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemList;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareParentViewL()
-    {
-    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, iThread.Process() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iThread );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareChildViewL()
-    {
-    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
-    CMemSpyViewBase* child = NULL;
-
-    // Decide what type of child view to create...
-    const TMemSpyThreadInfoItemType type = iCurrentInfoItem->Type();
-    //
-    switch( type )
-        {
-    case EMemSpyThreadInfoItemTypeHeap:
-        child = new(ELeave) CMemSpyViewThreadInfoItemHeap( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeStack:
-        child = new(ELeave) CMemSpyViewThreadInfoItemStack( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeChunk:
-        child = new(ELeave) CMemSpyViewThreadInfoItemChunk( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeCodeSeg:
-        child = new(ELeave) CMemSpyViewThreadInfoItemCodeSeg( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeServer:
-        child = new(ELeave) CMemSpyViewThreadInfoItemServer( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeActiveObject:
-        child = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeGeneralInfo:
-        child = new(ELeave) CMemSpyViewThreadInfoItemGeneralInfo( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeMemoryTracking:
-        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, iThread.InfoContainerL() );
-        break;
-    case EMemSpyThreadInfoItemTypeSession:
-    case EMemSpyThreadInfoItemTypeSemaphore:
-    case EMemSpyThreadInfoItemTypeMutex:
-    case EMemSpyThreadInfoItemTypeTimer:
-    case EMemSpyThreadInfoItemTypeLDD:
-    case EMemSpyThreadInfoItemTypePDD:
-    case EMemSpyThreadInfoItemTypeLogicalChannel:
-    case EMemSpyThreadInfoItemTypeChangeNotifier:
-    case EMemSpyThreadInfoItemTypeUndertaker:
-    case EMemSpyThreadInfoItemTypeMessageQueue:
-    case EMemSpyThreadInfoItemTypeConditionalVariable:
-    case EMemSpyThreadInfoItemTypeOpenFiles:
-    case EMemSpyThreadInfoItemTypeOtherThreads:
-    case EMemSpyThreadInfoItemTypeOtherProcesses:
-    case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
-    case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
-        child = new(ELeave) CMemSpyViewThreadInfoItemGeneric( iEngine, iObserver, iThread.InfoContainerL(), type );
-        break;
-    
-    default:
-        __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0) );
-        break;
-        }
-    //
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-TBool CMemSpyViewThreadInfoItemList::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-	case EMemSpyCmdThreadInfoHandles:
-        OnCmdInfoHandlesL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-    
-void CMemSpyViewThreadInfoItemList::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        aMenuPane->SetItemDimmed( EMemSpyCmdThread, iThread.IsDead() );
-        }
-    else if ( aResourceId == MenuCascadeResourceId() )
-        {
-        // Always remove these items - they are only shown in the master thread view
-        aMenuPane->SetItemDimmed( EMemSpyCmdThreadSetPriority, ETrue );
-        aMenuPane->SetItemDimmed( EMemSpyCmdThreadEnd, ETrue );
-        }
-    }
-
-
-void CMemSpyViewThreadInfoItemList::OnCmdInfoHandlesL()
-    {
-    iThread.InfoContainerForceSyncronousConstructionL().PrintL();
-    }
-
-
-void CMemSpyViewThreadInfoItemList::HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType )
-    {
-    if  ( aEvent == EInfoItemChanged )
-        {
-        }
-    else if ( aEvent == EInfoItemDestroyed )
-        {
-        if  ( iCurrentInfoItem && iCurrentInfoItem->Type() == aType )
-            {
-            iCurrentInfoItem->Close();
-            iCurrentInfoItem = NULL;
-            }
-        }
-
-    iIdleResetListboxTimer->Cancel();
-    iIdleResetListboxTimer->Start( KMemSpyIdleResetListboxTimerPeriod, KMemSpyIdleResetListboxTimerPeriod, TCallBack( IdleUpdateListBoxModel, this ) );
-    }
-
-
-void CMemSpyViewThreadInfoItemList::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iThread.InfoContainerL() );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewThreadInfoItemList::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    if  ( iCurrentInfoItem )
-        {
-        CMemSpyThreadInfoItemBase* item = iCurrentInfoItem;
-        iCurrentInfoItem = NULL;
-        item->Close();
-        }
-
-    // Identify the type of item to display...
-    iCurrentInfoItem = &iThread.InfoContainerL().Item( aIndex );
-    iCurrentInfoItem->Open();
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-TInt CMemSpyViewThreadInfoItemList::IdleUpdateListBoxModel( TAny* aSelf )
-    {
-    CMemSpyViewThreadInfoItemList* self = reinterpret_cast< CMemSpyViewThreadInfoItemList* >( aSelf );
-    TRAP_IGNORE( self->DoIdleUpdateListBoxModelL() );
-    return EFalse;
-    }
-
-
-void CMemSpyViewThreadInfoItemList::DoIdleUpdateListBoxModelL()
-    {
-    CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
-
-    // Try to maintain current item selection if at all possible.
-    TMemSpyThreadInfoItemType type = EMemSpyThreadInfoItemTypeHeap;
-    if  ( iCurrentInfoItem )
-        {
-        type = iCurrentInfoItem->Type();
-        }
-   
-    // Update list box & model
-    SetListBoxModelL();
-    iListBox->HandleItemAdditionL();
-    RefreshL();
-    
-    // Try to select previous item if it is still available
-    const TInt index = container.InfoItemIndexByType( type );
-    if  ( index >= 0 && index < container.MdcaCount() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        }
-
-    iIdleResetListboxTimer->Cancel();
-    }
-
--- a/memspyui/source/MemSpyViewThreadInfoItemMemoryTracking.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,664 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemMemoryTracking.h"
-
-// System includes
-#include <AknQueryDialog.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyengineprocessmemorytracker.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-
-
-CMemSpyViewThreadInfoItemMemoryTracking::CMemSpyViewThreadInfoItemMemoryTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverAddL( *this );
-
-    // Reset the title
-    _LIT( KCustomTitle, "Memory Statistics" );
-    SetTitleL( KCustomTitle );
-    
-    // Select the appropriate view
-    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune );
-    const TInt index = IndexByViewType( viewType );
-    //
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::ConstructL() - aSelectionRune: 0x%08x, viewType: %d, index: %d", aSelectionRune, viewType, index );
-#endif
-    //
-    if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-        {
-        iListBox->SetCurrentItemIndex( index );
-        HandleListBoxItemSelectedL( index );
-        }
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTracking::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatistics;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTracking::PrepareParentViewL()
-    {
-    CMemSpyViewBase* parent = CMemSpyViewThreadInfoItemGeneric::PrepareParentViewL();
-    
-    // Stop observing changes
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverRemove( *this );
-
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTracking::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    //
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    const TInt index = iListBox->CurrentItemIndex();
-    if  ( index == 1 )
-        {
-        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingCurrent( iEngine, iObserver, Container() );
-        }
-    else if ( index == 2 )
-        {
-        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingHWM( iEngine, iObserver, Container() );
-        }
-    else if ( index == 3 )
-        {
-        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingPeak( iEngine, iObserver, Container() );
-        }
-    //        
-    if  ( child )
-        {
-        CleanupStack::PushL( child );
-        child->ConstructL( Rect(), *Parent() );
-        CleanupStack::Pop( child );
-           
-        // Stop observing changes
-        item->TrackingObserverRemove( *this );
-        }
-    //
-    return child;
-    }
-
-
-TBool CMemSpyViewThreadInfoItemMemoryTracking::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdMemoryTrackingStart:
-        OnCmdTrackingStartL();
-        break;
-    case EMemSpyCmdMemoryTrackingStop:
-        OnCmdTrackingStopL();
-        break;
-    case EMemSpyCmdMemoryTrackingHWMReset:
-        OnCmdHWMResetL();
-        break;
-    case EMemSpyCmdMemoryTrackingTotalWithSharedMem:
-        OnCmdTotalWithSharedMemL();
-        break;
-    case EMemSpyCmdMemoryTrackingTotalWithoutSharedMem:
-        OnCmdTotalWithoutSharedMemL();
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-TInt CMemSpyViewThreadInfoItemMemoryTracking::IndexByViewType( TMemSpyViewType aType )
-    {
-    TInt index = 0;
-    //
-    switch( aType )
-        {
-    default:
-    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent:
-        index = 1;
-        break;
-    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM:
-        index = 2;
-        break;
-    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak:
-        index = 3;
-        break;
-        }
-    //
-    return index;
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::HandleListBoxItemActionedL( TInt aIndex )
-    {
-    if  ( aIndex == 0 )
-        {
-        CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-        if  ( item->TrackingActive() )
-            {
-            OnCmdTrackingStopL();
-            }
-        else
-            {
-            OnCmdTrackingStartL();
-            }
-        }
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-
-    // Ensure we refresh the listbox content
-    iListBox->DrawDeferred();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    iListBox->DrawDeferred();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == MenuCascadeResourceId() )
-        {
-        CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-        //
-        if  ( !item->TrackerExists() || item->TrackingActive() )
-            {
-            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingStart, ETrue );
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingStop, ETrue );
-            }
-        //
-        if ( item->TotalIncludesSharedMemory() )
-            {
-            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingTotalWithSharedMem, ETrue );
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingTotalWithoutSharedMem, ETrue );
-            }
-
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingHWMReset, Thread().IsDead() );
-        }
-    else if ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTracking, Thread().IsDead() );
-        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStart, Thread().IsDead() );
-        }
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryTrackingStartedL()
-    {
-    RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryTrackingStoppedL()
-    {
-    RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
-    {
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL() - START - this: 0x%08x", this );
-#endif 
-
-    CMemSpyViewBase::RefreshL();
-    iListBox->DrawDeferred();
-
-#ifdef _DEBUG
-    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL() - END - this: 0x%08x", this );
-#endif 
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTrackingStartL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingStartL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTrackingStopL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingStopL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdHWMResetL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingResetHWML();
-    RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTotalWithSharedMemL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingSetTotalIncludesSharedMemoryL( ETrue );
-    RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTotalWithoutSharedMemL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingSetTotalIncludesSharedMemoryL( EFalse );
-    RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemMemoryTrackingCurrent::CMemSpyViewThreadInfoItemMemoryTrackingCurrent( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverAddL( *this );
-
-    // Reset the title
-    _LIT( KCustomTitle, "Current Statistics" );
-    SetTitleL( KCustomTitle );
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingCurrent::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingCurrent::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    
-    // Stop observing changes
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverRemove( *this );
-
-    return parent;
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::SetListBoxModelL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    MDesCArray* model = &item->InfoCurrent();
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-    
-
-void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
-    {
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemMemoryTrackingHWM::CMemSpyViewThreadInfoItemMemoryTrackingHWM( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingHWM::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverAddL( *this );
-
-    // Reset the title
-    _LIT( KCustomTitle, "HWM Statistics" );
-    SetTitleL( KCustomTitle );
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingHWM::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingHWM::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    
-    // Stop observing changes
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverRemove( *this );
-
-    return parent;
-    }
-
-
-TBool CMemSpyViewThreadInfoItemMemoryTrackingHWM::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdMemoryTrackingHWMReset:
-        OnCmdHWMResetL();
-        break;
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingHWM::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingHWM::SetListBoxModelL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    MDesCArray* model = &item->InfoHWM();
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-    
-
-void CMemSpyViewThreadInfoItemMemoryTrackingHWM::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
-    {
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingHWM::OnCmdHWMResetL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingResetHWML();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemMemoryTrackingPeak::CMemSpyViewThreadInfoItemMemoryTrackingPeak( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingPeak::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverAddL( *this );
-
-    // Reset the title
-    _LIT( KCustomTitle, "Peak Statistics" );
-    SetTitleL( KCustomTitle );
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingPeak::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingPeak::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    
-    // Stop observing changes
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    item->TrackingObserverRemove( *this );
-
-    return parent;
-    }
-
-
-TBool CMemSpyViewThreadInfoItemMemoryTrackingPeak::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingPeak::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-void CMemSpyViewThreadInfoItemMemoryTrackingPeak::SetListBoxModelL()
-    {
-    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
-    MDesCArray* model = &item->InfoPeak();
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-    
-
-void CMemSpyViewThreadInfoItemMemoryTrackingPeak::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
-    {
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemServer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,391 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemServer.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperheap.h>
-#include <memspy/engine/memspyenginehelperserver.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-
-// Constants
-const TInt KMemSpyServerSessionsIndex = 2;
-
-
-
-CMemSpyViewThreadInfoItemServer::CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemServer::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    // Causes list of server's to be prepared
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-
-    _LIT( KTitle, "Server List" );
-    SetTitleL( KTitle );
-
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemServer::ConstructL() - aSelectionRune: 0x%08x", aSelectionRune );
-#endif
-
-    // Try to select the correct server
-    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
-    TInt selectedIndex = 0;
-    if  ( aSelectionRune )
-        {
-        // Treat the rune as a handle, and try to look it up
-        selectedIndex = infoItem->DetailsIndexByHandle( aSelectionRune );
-        }
-
-    // Select item
-    if  ( infoItem->DetailsCount() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( selectedIndex );
-        HandleListBoxItemSelectedL( selectedIndex );
-        }
-    }
-
-
-TBool CMemSpyViewThreadInfoItemServer::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemServer::PrepareChildViewL()
-    {
-    CMemSpyViewThreadInfoItemServerDetails* child = new(ELeave) CMemSpyViewThreadInfoItemServerDetails( iEngine, iObserver, iContainer, iCurrentInfoItemDetails );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    // Identify the type of item to display...
-    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
-    iCurrentInfoItemDetails = infoItem->DetailsAt( aIndex );
-
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL() - iCurrentInfoItemDetails.iHandle: 0x%08x", iCurrentInfoItemDetails.iHandle );
-#endif
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemServerDetails::CMemSpyViewThreadInfoItemServerDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer ), iInfoItemDetails( aInfoItemDetails )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemServerDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    // Causes list of server's to be prepared
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-
-    _LIT( KTitle, "Server Details" );
-    SetTitleL( KTitle );
-
-    // Try to select the correct server
-    TInt selectedIndex = 0;
-    if  ( aSelectionRune )
-        {
-        // Presence of non-null item means that we came from the "Server sessions" list
-        selectedIndex = KMemSpyServerSessionsIndex;
-        }
-
-    // Select item
-    iListBox->SetCurrentItemIndex( selectedIndex );
-    HandleListBoxItemSelectedL( selectedIndex );
-    }
-
-
-TBool CMemSpyViewThreadInfoItemServerDetails::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemServerDetails::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemServerDetails;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemServerDetails::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    const TInt currentIndex = iListBox->CurrentItemIndex();
-    //
-    if  ( currentIndex == KMemSpyServerSessionsIndex )
-        {
-        CMemSpyViewThreadInfoItemServerSessions* serverSessions = new(ELeave) CMemSpyViewThreadInfoItemServerSessions( iEngine, iObserver, iInfoItem->Container(), iInfoItemDetails );
-        CleanupStack::PushL( serverSessions );
-        serverSessions->ConstructL( Rect(), *Parent(), NULL );
-        CleanupStack::Pop( serverSessions );
-        child = serverSessions;
-        }
-    //
-    return child;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemServerDetails::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemServer* parent = new(ELeave) CMemSpyViewThreadInfoItemServer( iEngine, iObserver, iInfoItem->Container() );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), iInfoItemDetails.iHandle );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewThreadInfoItemServerDetails::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(4);
-    CleanupStack::PushL( model );
-
-    TBuf<KMaxFullName + 1> item;
-
-    // 1st item = session type
-    const TPtrC pServerSessionType = CMemSpyThreadInfoServer::SessionType( iInfoItemDetails.iSessionType );
-    _LIT(KItem1Format, "\tServer Type\t\t%S");
-    item.Format( KItem1Format, &pServerSessionType );
-    model->AppendL( item );
-
-    // 2nd item = session count
-    _LIT(KItem2Format, "\tConnected Sessions\t\t%d");
-    item.Format( KItem2Format, iInfoItemDetails.iCount );
-    model->AppendL( item );
-
-    // 3rd item = view sessions
-    if  ( iInfoItem->Container().MdcaCount() > 0 )
-        {
-        _LIT(KItem3Format, "\tView Sessions");
-        model->AppendL( KItem3Format );
-        }
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyViewThreadInfoItemServerSessions::CMemSpyViewThreadInfoItemServerSessions( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer ), iInfoItemDetails( aInfoItemDetails )
-    {
-    }
-
-
-void CMemSpyViewThreadInfoItemServerSessions::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
-    //
-    _LIT( KTitle, "Connected Session List" );
-    SetTitleL( KTitle );
-    }
-
-
-TBool CMemSpyViewThreadInfoItemServerSessions::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemServerSessions::ViewType() const
-    {
-    return EMemSpyViewTypeThreadInfoItemServerSessions;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemServerSessions::PrepareParentViewL()
-    {
-    CMemSpyViewThreadInfoItemServerDetails* parent = new(ELeave) CMemSpyViewThreadInfoItemServerDetails( iEngine, iObserver, iInfoItem->Container(), iInfoItemDetails );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), this );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-void CMemSpyViewThreadInfoItemServerSessions::SetListBoxModelL()
-    {
-    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(4);
-    CleanupStack::PushL( model );
-
-    // Get handles
-    RArray<TMemSpyDriverServerSessionInfo> sessions;
-    CleanupClosePushL( sessions );
-    iEngine.HelperServer().GetServerSessionsL( iInfoItemDetails, sessions );
-
-    // Prepare items
-    TBuf<KMaxFullName + 1> item;
-    const TInt count = sessions.Count();
-    for( TInt i=0; i<count; i++ )
-        {
-        _LIT(KInsertTab, "\t");
-
-        const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
-        item.Zero();
-
-        if  ( session.iOwnerType == TMemSpyDriverServerSessionInfo::EOwnerThread )
-            {
-            // Find the thread object
-            CMemSpyThread* thread = NULL;
-            CMemSpyProcess* process = NULL;
-            //
-            const TInt error = iEngine.Container().ProcessAndThreadByThreadId( session.iOwnerId, process, thread );
-            //
-            if  ( error == KErrNone )
-                {
-                item.Append( process->Name() );
-                item.Append( KInsertTab );
-                item.Append( KInsertTab );
-                item.Append( thread->Name() );
-                }
-            }
-        else if ( session.iOwnerType == TMemSpyDriverServerSessionInfo::EOwnerProcess )
-            {
-            // Find the process object
-            CMemSpyProcess* process = NULL;
-            TRAPD( error, process = &iEngine.Container().ProcessByIdL( session.iOwnerId ) );
-            if  ( error == KErrNone )
-                {
-                item.Append( process->Name() );
-                }
-            }
-
-        if  ( !item.Length() )
-            {
-            // Fall-back case
-            item.Copy( session.iName );
-            }
-
-        // Add item
-        item.Insert( 0, KInsertTab );
-        model->AppendL( item );
-        }
-    CleanupStack::PopAndDestroy( &sessions );
-
-    // Set up list box
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( model );
-    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
-    CleanupStack::Pop( model );
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/memspyui/source/MemSpyViewThreadInfoItemStack.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreadInfoItemStack.h"
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-#include <memspy/engine/memspyenginehelperstack.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-
-
-
-CMemSpyViewThreadInfoItemStack::CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeStack )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemStack::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-#ifndef __WINS__
-	case EMemSpyCmdStackDataUser:
-        OnCmdStackDataUserL();
-		break;
-	case EMemSpyCmdStackDataKernel:
-        OnCmdStackDataKernelL();
-		break;
-#endif
-	case EMemSpyCmdStackInfoThread:
-        OnCmdStackInfoL();
-		break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreadInfoItemStack::OnCmdStackInfoL()
-    {
-    iEngine.HelperStack().OutputStackInfoL( Thread() );
-    }
-
-
-void CMemSpyViewThreadInfoItemStack::OnCmdStackDataUserL()
-    {
-    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainUser );
-    }
-
-
-void CMemSpyViewThreadInfoItemStack::OnCmdStackDataKernelL()
-    {
-    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainKernel );
-    }    
-
-
-void CMemSpyViewThreadInfoItemStack::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        aMenuPane->SetItemDimmed( EMemSpyCmdStack, Thread().IsDead() );
-        }
-    }
--- a/memspyui/source/MemSpyViewThreads.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewThreads.h"
-
-// System includes
-#include <AknQueryDialog.h>
-#include <memspyui.rsg>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectprocess.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
-#include <memspy/engine/memspyenginehelperprocess.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewProcesses.h"
-#include "MemSpyViewThreadInfoItemList.h"
-
-
-
-
-CMemSpyViewThreads::CMemSpyViewThreads( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess )
-:   CMemSpyViewBase( aEngine, aObserver ), iParentProcess( aProcess )
-    {
-    iParentProcess.Open();
-    }
-
-
-CMemSpyViewThreads::~CMemSpyViewThreads()
-    {
-    iParentProcess.Close();
-    if  ( iCurrentThread )
-        {
-        iCurrentThread->Close();
-        }
-    }
-
- 
-void CMemSpyViewThreads::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Threads" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    //
-    if  ( aSelectionRune )
-        {
-        CMemSpyThread* selectedItem = reinterpret_cast< CMemSpyThread* >( aSelectionRune );
-        const TInt index = iParentProcess.ThreadIndexById( selectedItem->Id() );
-        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-            {
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }
-        }
-    else if ( iParentProcess.Count() > 0 )
-        {
-        iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-        }
-    }
-
-
-const CMemSpyProcess& CMemSpyViewThreads::Process() const
-    {
-    return iParentProcess;
-    }
-
-
-CMemSpyThread& CMemSpyViewThreads::CurrentThread()
-    {
-    __ASSERT_ALWAYS( iCurrentThread != NULL, User::Invariant() );
-    return *iCurrentThread;
-    }
-
-
-void CMemSpyViewThreads::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewThreads::ViewType() const
-    {
-    return EMemSpyViewTypeThreads;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreads::PrepareParentViewL()
-    {
-    CMemSpyViewProcesses* parent = new(ELeave) CMemSpyViewProcesses( iEngine, iObserver, iParentProcess );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), &iParentProcess );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreads::PrepareChildViewL()
-    {
-    CMemSpyViewThreadInfoItemList* child = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, *iCurrentThread );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( child );
-    return child;
-    }
-
-
-void CMemSpyViewThreads::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        CMemSpyThread& thread = CurrentThread();
-        aMenuPane->SetItemDimmed( EMemSpyCmdThread, thread.IsDead() );
-        }
-    }
-
-
-TBool CMemSpyViewThreads::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-    case EMemSpyCmdThreadEndKill:
-        OnCmdEndKillL();
-		break;
-    case EMemSpyCmdThreadEndTerminate:
-        OnCmdEndTerminateL();
-		break;
-    case EMemSpyCmdThreadEndPanic:
-        OnCmdEndPanicL();
-		break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteVeryLow:
-	case EMemSpyCmdThreadSetPriorityAbsoluteLowNormal:
-	case EMemSpyCmdThreadSetPriorityAbsoluteLow:
-	case EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal:
-	case EMemSpyCmdThreadSetPriorityAbsoluteBackground:
-	case EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal:
-	case EMemSpyCmdThreadSetPriorityAbsoluteForeground:
-	case EMemSpyCmdThreadSetPriorityAbsoluteHighNormal:
-	case EMemSpyCmdThreadSetPriorityAbsoluteHigh:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime1:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime2:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime3:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime4:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime5:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime6:
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime7: 
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime8:
-        OnCmdSetPriorityL( aCommand );
-        break;
-
-    case EMemSpyCmdThreadInfoHandles:
-        OnCmdInfoHandlesL();
-        break;
-
-    default:
-        handled = CMemSpyViewBase::HandleCommandL( aCommand );
-        break;
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewThreads::OnCmdEndKillL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyThread& thread = CurrentThread();
-    //
-    if  ( thread.IsSystemPermanent() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        thread.KillL();
-        RefreshL();
-        }
-    }
-
-
-void CMemSpyViewThreads::OnCmdEndTerminateL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyThread& thread = CurrentThread();
-    //
-    if  ( thread.IsSystemPermanent() || thread.IsSystemCritical() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        thread.TerminateL();
-        RefreshL();
-        }
-    }
-
-
-void CMemSpyViewThreads::OnCmdEndPanicL()
-    {
-    TBool doTerminate = ETrue;
-    CMemSpyThread& thread = CurrentThread();
-    //
-    if  ( thread.IsSystemPermanent() || thread.IsSystemCritical() )
-        {
-        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-        }
-    //
-    if  ( doTerminate )
-        {
-        thread.PanicL();
-        RefreshL();
-        }
-    }
-
-
-void CMemSpyViewThreads::OnCmdSetPriorityL( TInt aCommand )
-    {
-    TThreadPriority pri = EPriorityAbsoluteBackground;
-    switch( aCommand )
-        {
-	case EMemSpyCmdThreadSetPriorityAbsoluteVeryLow:
-        pri = EPriorityAbsoluteVeryLow;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteLowNormal:
-        pri = EPriorityAbsoluteLowNormal;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteLow:
-        pri = EPriorityAbsoluteLow;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal:
-        pri = EPriorityAbsoluteBackgroundNormal;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteBackground:
-        pri = EPriorityAbsoluteBackground;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal:
-        pri = EPriorityAbsoluteForegroundNormal;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteForeground:
-        pri = EPriorityAbsoluteForeground;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteHighNormal:
-        pri = EPriorityAbsoluteHighNormal;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteHigh:
-        pri = EPriorityAbsoluteHigh;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime1:
-        pri = EPriorityAbsoluteRealTime1;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime2:
-        pri = EPriorityAbsoluteRealTime2;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime3:
-        pri = EPriorityAbsoluteRealTime3;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime4:
-        pri = EPriorityAbsoluteRealTime4;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime5:
-        pri = EPriorityAbsoluteRealTime5;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime6:
-        pri = EPriorityAbsoluteRealTime6;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime7: 
-        pri = EPriorityAbsoluteRealTime7;
-        break;
-	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime8:
-        pri = EPriorityAbsoluteRealTime8;
-        break;
-        }
-
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreads::OnCmdSetPriorityL() - pri: %d", pri );
-#endif
-
-    CMemSpyThread& thread = CurrentThread();
-    thread.SetPriorityL( pri );
-    RefreshL();
-
-#ifdef _DEBUG
-    RDebug::Printf( "CMemSpyViewThreads::OnCmdSetPriorityL() - END" );
-#endif
-    }
-
-
-void CMemSpyViewThreads::OnCmdInfoHandlesL()
-    {
-    CMemSpyThread& thread = CurrentThread();
-    thread.InfoContainerForceSyncronousConstructionL().PrintL();
-    }
-
-
-void CMemSpyViewThreads::SetListBoxModelL()
-    {
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( &iParentProcess );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewThreads::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewThreads::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-    if  ( iCurrentThread )
-        {
-        iCurrentThread->Close();
-        }
-
-    // Obtain the thread that corresponds to the selected item
-    CMemSpyThread& thread = iParentProcess.At( aIndex );
-    iCurrentThread = &thread;
-    iCurrentThread->Open();
-
-    // Notify observer about item selection
-    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
-    }
-
-
-
--- a/memspyui/source/MemSpyViewType.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewType.h"
-
-
-
-
-TBool MemSpyViewTypeUtils::IsOpenableItem( TMemSpyViewType aType )
-    {
-    TBool openable = EFalse;
-    //
-    switch( aType )
-        {
-    case EMemSpyViewTypeMainMenu:
-    case EMemSpyViewTypeProcesses:
-    case EMemSpyViewTypeServerList:
-    case EMemSpyViewTypeThreads:
-    case EMemSpyViewTypeThreadInfoItemList:
-    case EMemSpyViewTypeThreadInfoItemServer:
-    case EMemSpyViewTypeThreadInfoItemSession:
-        openable = ETrue;
-        break;
-    default:
-        break;
-        }
-    //
-    return openable;
-    }
-
-
-TBool MemSpyViewTypeUtils::IsThreadInfoItem( TMemSpyViewType aType )
-    {
-    TBool infoItem = ETrue;
-    //
-    switch( aType )
-        {
-    case EMemSpyViewTypeMainMenu:
-    case EMemSpyViewTypeRAMInfo:
-    case EMemSpyViewTypeROMInfo:
-    case EMemSpyViewTypeServerList:
-    case EMemSpyViewTypeOpenFiles:
-    case EMemSpyViewTypeProcesses:
-    case EMemSpyViewTypeThreads:
-    case EMemSpyViewTypeThreadInfoItemList:
-        infoItem = EFalse;
-        break;
-    default:
-        break;
-        }
-    //
-    return infoItem;
-    }
-
-
-TBool MemSpyViewTypeUtils::IsExitableView( TMemSpyViewType aType )
-    {
-    TBool ret = EFalse;
-    //
-    switch( aType )
-        {
-    case EMemSpyViewTypeMainMenu:
-        ret = ETrue;
-        break;
-    default:
-        break;
-        }
-    //
-    return ret;
-    }
-
-
--- a/memspyui/source/MemSpyViewWindowGroups.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "MemSpyViewWindowGroups.h"
-
-// System includes
-#include <eikclbd.h>
-#include <aknmessagequerydialog.h>
-#include <aknnotewrappers.h>
-
-// Engine includes
-#include <memspy/engine/memspyengine.h>
-#include <memspy/engine/memspyengineobjectcontainer.h>
-#include <memspy/engine/memspyengineobjectthread.h>
-
-// User includes
-#include "MemSpyUiUtils.h"
-#include "MemSpyViewMainMenu.h"
-#include "MemSpyContainerObserver.h"
-
-// Literal constants
-const TInt KMaxInfoLength = 128;
-
-
-CMemSpyViewWindowGroups::CMemSpyViewWindowGroups( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aEngine, aObserver )
-    {
-    }
-
-
-CMemSpyViewWindowGroups::~CMemSpyViewWindowGroups()
-    {
-    delete iWindowGroupList;
-    }
-
-
-void CMemSpyViewWindowGroups::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-    _LIT( KTitle, "Window Groups" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    }
-
-
-CEikListBox* CMemSpyViewWindowGroups::ConstructListBoxL()
-    {
-    delete iListBox;
-    iListBox = NULL;
-    CAknSingleNumberStyleListBox* listbox = new (ELeave) CAknSingleNumberStyleListBox();
-    iListBox = listbox;
-    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
-    listbox->SetContainerWindowL( *this );
-    listbox->CreateScrollBarFrameL( ETrue );
-    SetListBoxModelL();
-    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
-    listbox->SetListBoxObserver( this );
-    listbox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-    listbox->SetObserver( this );
-    return listbox;
-    }
-
-void CMemSpyViewWindowGroups::RefreshL()
-    {
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewWindowGroups::ViewType() const
-    {
-    return EMemSpyViewTypeWindowGroups;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewWindowGroups::PrepareParentViewL()
-    {
-    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewWindowGroups::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-    if ( iListBox && 
-         iListBox->Model()->NumberOfItems() && 
-         iListBox->CurrentItemIndex() > KErrNotFound )
-        {
-        DetailsL();
-        }
-    return child;
-    }
-
-
-void CMemSpyViewWindowGroups::SetListBoxModelL()
-    {
-    // Take ownership of new model
-    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
-    MMemSpyEngineWindowGroupList* windowGroupList = windowServerManager.WindowGroupListL();
-    delete iWindowGroupList;
-    iWindowGroupList = windowGroupList;
-    
-    // Set up list box
-    CAknSingleNumberStyleListBox* listbox = static_cast< CAknSingleNumberStyleListBox* >( iListBox );
-    listbox->Model()->SetItemTextArray( iWindowGroupList );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-TBool CMemSpyViewWindowGroups::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = ETrue;
-    //
-    switch ( aCommand )
-        {
-        case EMemSpyCmdWindowGroupTerminate:
-            {
-            TRAPD( err, OnCmdEndL( aCommand ) );
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-            if ( err )
-                {
-                note->ExecuteLD( _L("Cannot terminate task") );
-                }
-            else
-                {
-                note->ExecuteLD( _L("Task terminated") );
-                }
-            break;
-            }
-        case EMemSpyCmdWindowGroupSwitchTo:
-            {
-            TRAPD( err, OnCmdSwitchToL() );
-            if ( err )
-                {
-                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-                note->ExecuteLD( _L("Cannot bring to foreground") );
-                }
-            break;
-            }
-        case EMemSpyCmdWindowGroupEnd:
-            {
-            TRAPD( err, OnCmdEndL( aCommand ) );
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-            if ( err )
-                {
-                note->ExecuteLD( _L("Cannot end task") );
-                }
-            else
-                {
-                note->ExecuteLD( _L("Task exited") );
-                }
-            break;
-            }
-        case EMemSpyCmdWindowGroupPanic:
-            {
-            TRAPD( err, OnCmdEndL( aCommand ) );
-            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
-            if ( err )
-                {
-                note->ExecuteLD( _L("Cannot panic task") );
-                }
-            else
-                {
-                note->ExecuteLD( _L("Task panic'ed") );
-                }
-            break;
-            }
-        default:
-            {
-            handled = CMemSpyViewBase::HandleCommandL( aCommand );
-            break;        
-            }
-        }
-    //
-    return handled;
-    }
-
-
-void CMemSpyViewWindowGroups::OnCmdSwitchToL()
-    {
-    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
-    TInt id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iId;
-    windowServerManager.SwitchToL( id );
-    }
-
-
-void CMemSpyViewWindowGroups::OnCmdEndL( TInt aCommand )
-    {
-    TBool doTerminate = ETrue;
-    
-    CMemSpyEngineObjectContainer& container = iEngine.Container();
-    TThreadId id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iThreadId;
-    
-    // Try to find the thread in question...
-    CMemSpyProcess* process = NULL;
-    CMemSpyThread* thread = NULL; 
-    User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
-
-    if ( thread )
-        {
-        thread->Open();
-        //
-        if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
-            {
-            CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-            doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-            }
-        //
-        if  ( doTerminate )
-            {
-            switch ( aCommand )
-                {
-                case EMemSpyCmdWindowGroupTerminate:
-                    {
-                    thread->TerminateL();
-                    break;
-                    }
-                case EMemSpyCmdWindowGroupEnd:
-                    {
-                    thread->KillL();
-                    break;
-                    }
-                case EMemSpyCmdWindowGroupPanic:
-                    {
-                    thread->PanicL();
-                    break;
-                    }
-                default:
-                    {
-                    // Programming error
-                    __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-                    }                
-                }
-            }                
-        }
-    RefreshL();
-    }
-
-
-void CMemSpyViewWindowGroups::DetailsL()
-    {
-    HBufC* messageBuf = HBufC::NewLC( 4096 );
-    TPtr messagePtr = messageBuf->Des();
-
-    // Fetch data from helper
-    TMemSpyEngineWindowGroupDetails selectedObject;
-    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
-    TInt id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iId;
-    windowServerManager.GetWindowGroupDetailsL( id, selectedObject );
-    
-    // Append info to string buffer
-    AppendFormatString( messagePtr, _L("WG ID: %d\n"), selectedObject.iId );
-    AppendFormatString( messagePtr, _L("Client ThreadId: %Lu\n"), selectedObject.iThreadId.Id() );
-    TFullName name;
-    name.Copy( selectedObject.iFullName );
-    AppendFormatString( messagePtr, _L("Thr: %S\n"), &name );
-    name.Zero();
-    AppendFormatString( messagePtr, _L("Priority: %d\n"), selectedObject.iPriority );
-    AppendFormatString( messagePtr, _L("Handle: 0x%08X\n"), selectedObject.iWindowGroupHandle );
-    name.Copy( selectedObject.iName );
-    AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
-    name.Zero();
-    AppendFormatString( messagePtr, _L("UID: 0x%08X\n"), selectedObject.iUID );
-    AppendFormatString( messagePtr, _L("IsBusy: %d\n"), selectedObject.iIsBusy );
-    AppendFormatString( messagePtr, _L("IsSystem: %d\n"), selectedObject.iIsSystem );
-    AppendFormatString( messagePtr, _L("IsHidden: %d\n"), selectedObject.iIsHidden );
-    name.Copy( selectedObject.iCaption );
-    AppendFormatString( messagePtr, _L("Caption: %S\n"), &name );
-    name.Zero();
-    name.Copy( selectedObject.iDocName );
-    AppendFormatString( messagePtr, _L("Docname: %S"), &name );
-    name.Zero();
-
-    // Display the buffer on a dialog
-    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
-    dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
-    TFileName headerText;
-    headerText.Copy( selectedObject.iFullName );
-    dialog->SetHeaderTextL( headerText );
-    dialog->SetMessageTextL( messagePtr );
-    dialog->RunLD();
-   
-    CleanupStack::PopAndDestroy( messageBuf );
-    }
-
-
-void CMemSpyViewWindowGroups::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
-    {
-    TBuf<KMaxInfoLength> infoString;
-    VA_LIST list;
-    VA_START ( list, aFmt );
-    infoString.FormatList( aFmt, list );
-    aPtr.Append( infoString );
-    }
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/group/MemSpyCapabilities.mmh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,19 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+CAPABILITY      ReadUserData WriteUserData ReadDeviceData WriteDeviceData SwEvent PowerMgmt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_MMPFILES
+memspyui.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/group/memspyui.mmp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,110 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET          memspyui.exe
+TARGETTYPE      exe
+UID             0x100039CE 0x2002129F
+VENDORID		VID_DEFAULT
+SMPSAFE
+
+EPOCSTACKSIZE	0x4000
+EPOCHEAPSIZE	0x100000 0x4000000
+
+#include		"MemSpyCapabilities.mmh"
+
+SOURCEPATH      ../src
+source          MemSpyApp.cpp 
+source          MemSpyAppUi.cpp
+source          MemSpyDocument.cpp
+source          MemSpyContainer.cpp
+source          MemSpyDeviceWideOperationDialog.cpp
+source          MemSpyExportBitmapsToMemoryCardDialog.cpp
+source          MemSpyUiUtils.cpp
+source          MemSpySettings.cpp
+//
+source          MemSpyViewBase.cpp
+source          MemSpyViewMainMenu.cpp
+source          MemSpyViewType.cpp
+source          MemSpyViewProcesses.cpp
+/*
+source          MemSpyViewServerList.cpp
+source          MemSpyViewOpenFiles.cpp
+source          MemSpyViewRAMInfo.cpp
+source          MemSpyViewROMInfo.cpp
+source          MemSpyViewFBServBitmaps.cpp
+source          MemSpyViewSystemConfig.cpp
+source          MemSpyViewCodeSegList.cpp
+source          MemSpyViewChunkList.cpp
+*/
+source          MemSpyViewKernel.cpp
+source          MemSpyViewKernelContainers.cpp
+source          MemSpyViewKernelHeap.cpp
+source          MemSpyViewKernelObjects.cpp
+/*
+source			MemSpyViewDriveInfo.cpp
+source			MemSpyViewECom.cpp
+*/
+source          MemSpyViewThreads.cpp
+/*
+source          MemSpyViewThreadInfoItemList.cpp
+source          MemSpyViewThreadInfoItemGeneric.cpp
+source          MemSpyViewThreadInfoItemHeap.cpp
+source          MemSpyViewThreadInfoItemStack.cpp
+source          MemSpyViewThreadInfoItemCodeSeg.cpp
+source          MemSpyViewThreadInfoItemChunk.cpp
+source          MemSpyViewThreadInfoItemServer.cpp
+source          MemSpyViewThreadInfoItemActiveObject.cpp
+source          MemSpyViewThreadInfoItemGeneralInfo.cpp
+source          MemSpyViewHeapTracking.cpp
+source          MemSpyViewHeapTrackingResults.cpp
+source          MemSpyViewHeapTrackingSettings.cpp
+source			MemSpyViewThreadInfoItemMemoryTracking.cpp
+source			MemSpyViewMemoryTrackingAutoStartConfig.cpp
+source			MemSpyViewWindowGroups.cpp
+source          MemSpyViewKernelObjects.cpp
+*/
+
+USERINCLUDE		../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+
+START RESOURCE    ../../../data/memspyui.rss
+HEADER
+TARGETPATH        APP_RESOURCE_DIR
+END
+
+START RESOURCE    ../../../data/memspyui_reg.rss
+DEPENDS           memspyui.rsg
+TARGETPATH        /private/10003a3f/apps
+END
+
+LIBRARY			fbscli.lib				imageconversion.lib		estor.lib		apgrfx.lib
+LIBRARY			euser.lib				apparc.lib				cone.lib		eikcore.lib 
+LIBRARY			eikcoctl.lib			avkon.lib				etext.lib		eikctl.lib		
+LIBRARY			efsrv.lib				bafl.lib				egul.lib		hal.lib
+LIBRARY			cdlengine.lib			xmlframework.lib		charconv.lib	viewcli.lib
+LIBRARY			eikdlg.lib				ws32.lib				bitgdi.lib
+
+LIBRARY         MemSpyClient.lib
+LIBRARY			memspydriverclient.lib
+LIBRARY			memspyengine.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpy.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,246 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPY_HRH
+#define MEMSPY_HRH
+
+#define KMemSpyMenuCommandBase 50000
+#define KMemSpyMenuCommandViewSpecific (KMemSpyMenuCommandBase + 10000)
+
+enum TMemSpyCommandIds
+    {
+	////////////////////////////////
+	// GENERIC MENU COMMANDS
+	////////////////////////////////
+	EMemSpyCmdOpen = KMemSpyMenuCommandBase,
+    //
+    EMemSpyCmdView,
+	EMemSpyCmdViewRefresh,
+	EMemSpyCmdViewOutputToSink,
+    //
+    EMemSpyCmdTools,
+    EMemSpyCmdToolsListOpenFiles,
+	EMemSpyCmdToolsAbout,
+    //
+    EMemSpyCmdPhoneInfo,
+	EMemSpyCmdPhoneInfoGeneral,
+    EMemSpyCmdPhoneInfoGeneralSummary,
+	EMemSpyCmdPhoneInfoGeneralDetailed,
+	EMemSpyCmdPhoneInfoGeneralHandles,
+	EMemSpyCmdPhoneInfoGeneralKernelContainers,
+	EMemSpyCmdPhoneInfoHeap,
+	EMemSpyCmdPhoneInfoHeapInfoSummary,
+    EMemSpyCmdPhoneInfoHeapInfoCompact,
+	EMemSpyCmdPhoneInfoHeapCellListing,
+	EMemSpyCmdPhoneInfoHeapDump,
+    EMemSpyCmdPhoneInfoStack,
+	EMemSpyCmdPhoneInfoStackInfo,
+    EMemSpyCmdPhoneInfoStackInfoCompact,
+	EMemSpyCmdPhoneInfoStackDumpUser,
+	EMemSpyCmdPhoneInfoStackDumpKernel,
+    //
+    EMemSpyCmdAutoCapture,
+    EMemSpyCmdAutoCaptureToggle,
+    EMemSpyCmdAutoCaptureRetryTime,
+    EMemSpyCmdAutoCaptureOperationType,
+	
+	////////////////////////////////
+	// VIEW SPECIFIC MENU COMMANDS
+	////////////////////////////////
+    EMemSpyCmdProcess = KMemSpyMenuCommandViewSpecific,
+	EMemSpyCmdProcessInfo,
+	EMemSpyCmdProcessInfoSummary,
+	EMemSpyCmdProcessInfoHandles,
+    EMemSpyCmdProcessSort,
+    EMemSpyCmdProcessSortById,
+    EMemSpyCmdProcessSortByName,
+    EMemSpyCmdProcessSortByThreadCount,
+    EMemSpyCmdProcessSortByCodeSegs,
+    EMemSpyCmdProcessSortByHeapUsage,
+    EMemSpyCmdProcessSortByStackUsage,
+    EMemSpyCmdProcessEnd,
+    EMemSpyCmdProcessEndKill,
+    EMemSpyCmdProcessEndPanic,
+    EMemSpyCmdProcessEndTerminate,
+    //
+    EMemSpyCmdThread,
+    EMemSpyCmdThreadEnd,
+    EMemSpyCmdThreadEndKill,
+    EMemSpyCmdThreadEndPanic,
+    EMemSpyCmdThreadEndTerminate,
+    EMemSpyCmdThreadSetPriority,
+	EMemSpyCmdThreadSetPriorityAbsoluteVeryLow,
+	EMemSpyCmdThreadSetPriorityAbsoluteLowNormal,
+	EMemSpyCmdThreadSetPriorityAbsoluteLow,
+	EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal,
+	EMemSpyCmdThreadSetPriorityAbsoluteBackground,
+	EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal,
+	EMemSpyCmdThreadSetPriorityAbsoluteForeground,
+	EMemSpyCmdThreadSetPriorityAbsoluteHighNormal,
+	EMemSpyCmdThreadSetPriorityAbsoluteHigh,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime1,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime2,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime3,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime4,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime5,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime6,
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime7, 
+	EMemSpyCmdThreadSetPriorityAbsoluteRealTime8,
+	EMemSpyCmdThreadInfo,
+	EMemSpyCmdThreadInfoHandles,
+    //
+    EMemSpyCmdOutput,
+    EMemSpyCmdOutputToDebug,
+    EMemSpyCmdOutputToFile,
+    //
+    EMemSpyCmdHeap,
+    EMemSpyCmdHeapInfoThread,
+    EMemSpyCmdHeapData,
+    EMemSpyCmdHeapCellListing,
+    EMemSpyCmdHeapDataDump,
+    //
+    EMemSpyCmdStack,
+    EMemSpyCmdStackInfoThread,
+    EMemSpyCmdStackData,
+    EMemSpyCmdStackDataUser,
+    EMemSpyCmdStackDataKernel,
+    //
+    EMemSpyCmdChunk,
+    EMemSpyCmdChunkSort,
+    EMemSpyCmdChunkSortByName,
+    EMemSpyCmdChunkSortBySize,
+    EMemSpyCmdChunkListing,
+    //
+    EMemSpyCmdCodeSeg,
+    EMemSpyCmdCodeSegShow,
+    EMemSpyCmdCodeSegShowItemsAll,
+    EMemSpyCmdCodeSegShowItemsGlobalData,
+    EMemSpyCmdCodeSegShowCaps,
+    EMemSpyCmdCodeSegShowCapsWithTCBProcess,              
+    EMemSpyCmdCodeSegShowCapsWithTCBAll,                  
+    EMemSpyCmdCodeSegShowCapsWithCommDDProcess,           
+    EMemSpyCmdCodeSegShowCapsWithCommDDAll,               
+    EMemSpyCmdCodeSegShowCapsWithPowerMgmtProcess,        
+    EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll,            
+    EMemSpyCmdCodeSegShowCapsWithMultimediaDDProcess,     
+    EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll,         
+    EMemSpyCmdCodeSegShowCapsWithReadDeviceDataProcess,   
+    EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll,       
+    EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataProcess,  
+    EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll,      
+    EMemSpyCmdCodeSegShowCapsWithDRMProcess,              
+    EMemSpyCmdCodeSegShowCapsWithDRMAll,                  
+    EMemSpyCmdCodeSegShowCapsWithTrustedUIProcess,        
+    EMemSpyCmdCodeSegShowCapsWithTrustedUIAll,            
+    EMemSpyCmdCodeSegShowCapsWithProtServProcess,         
+    EMemSpyCmdCodeSegShowCapsWithProtServAll,             
+    EMemSpyCmdCodeSegShowCapsWithDiskAdminProcess,        
+    EMemSpyCmdCodeSegShowCapsWithDiskAdminAll,            
+    EMemSpyCmdCodeSegShowCapsWithNetworkControlProcess,   
+    EMemSpyCmdCodeSegShowCapsWithNetworkControlAll,       
+    EMemSpyCmdCodeSegShowCapsWithAllFilesProcess,         
+    EMemSpyCmdCodeSegShowCapsWithAllFilesAll,             
+    EMemSpyCmdCodeSegShowCapsWithSwEventProcess,          
+    EMemSpyCmdCodeSegShowCapsWithSwEventAll,              
+    EMemSpyCmdCodeSegShowCapsWithNetworkServicesProcess,  
+    EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll,      
+    EMemSpyCmdCodeSegShowCapsWithLocalServicesProcess,    
+    EMemSpyCmdCodeSegShowCapsWithLocalServicesAll,        
+    EMemSpyCmdCodeSegShowCapsWithReadUserDataProcess,     
+    EMemSpyCmdCodeSegShowCapsWithReadUserDataAll,         
+    EMemSpyCmdCodeSegShowCapsWithWriteUserDataProcess,    
+    EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll,        
+    EMemSpyCmdCodeSegShowCapsWithLocationProcess,         
+    EMemSpyCmdCodeSegShowCapsWithLocationAll,             
+    EMemSpyCmdCodeSegShowCapsWithSurroundingsDDProcess,   
+    EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll,       
+    EMemSpyCmdCodeSegShowCapsWithUserEnvProcess,          
+    EMemSpyCmdCodeSegShowCapsWithUserEnvAll,              
+    EMemSpyCmdCodeSegSort,
+    EMemSpyCmdCodeSegSortByName,
+    EMemSpyCmdCodeSegSortByCodeSize,
+    EMemSpyCmdCodeSegSortByDataSize,
+    EMemSpyCmdCodeSegSortByUid,
+    EMemSpyCmdCodeSegListing,
+    //
+    EMemSpyCmdImages,
+    EMemSpyCmdImagesSlideshow,
+    EMemSpyCmdImagesSaveAllToMemoryCard,
+    EMemSpyCmdImagesListing,
+    //
+    EMemSpyCmdActiveObject,
+    EMemSpyCmdActiveObjectListing,
+    //
+    EMemSpyCmdServerList,
+    EMemSpyCmdServerListOutput,
+    EMemSpyCmdServerListOutputListCSV,
+    EMemSpyCmdServerListOutputListDetailed,
+    EMemSpyCmdServerListSort,
+    EMemSpyCmdServerListSortByName,
+    EMemSpyCmdServerListSortBySessionCount,
+    //
+    EMemSpyCmdKernelContainers,
+    EMemSpyCmdKernelContainersOutput,
+    EMemSpyCmdKernelObjects,
+    EMemSpyCmdKernelObjectTerminate,
+    EMemSpyCmdKernelObjectSwitchTo,
+    EMemSpyCmdKernelObjectEnd,
+    EMemSpyCmdKernelObjectPanic,
+    
+    //
+    EMemSpyCmdKernelHeap,
+    EMemSpyCmdKernelHeapDump,
+    //
+    EMemSpyCmdRAM,
+    EMemSpyCmdRAMAvkonIconCacheDisabled,
+    EMemSpyCmdRAMAvkonIconCacheEnabled,
+    //
+    EMemSpyCmdBTrace,
+    EMemSpyCmdBTraceCaptureToggle,
+    //
+    EMemSpyCmdMemoryTracking,
+    EMemSpyCmdMemoryTrackingStart,
+    EMemSpyCmdMemoryTrackingStop,
+    EMemSpyCmdMemoryTrackingAutoStart,
+    EMemSpyCmdMemoryTrackingAutoStartItemAdd,
+    EMemSpyCmdMemoryTrackingAutoStartItemEdit,
+    EMemSpyCmdMemoryTrackingAutoStartItemDelete,
+    EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll,
+    EMemSpyCmdMemoryTrackingAutoStartItemImport,
+    EMemSpyCmdMemoryTrackingHWM,
+    EMemSpyCmdMemoryTrackingHWMReset,
+    EMemSpyCmdMemoryTrackingTotalWithSharedMem,
+    EMemSpyCmdMemoryTrackingTotalWithoutSharedMem,
+
+    //
+    EMemSpyCmdWindowGroups,
+    EMemSpyCmdWindowGroupTerminate,
+    EMemSpyCmdWindowGroupSwitchTo,
+    EMemSpyCmdWindowGroupEnd,
+    EMemSpyCmdWindowGroupPanic
+    };
+
+enum TMemSpyControlIds
+    {
+    EMemSpyCtrlIdProgressNote = 1000,
+    EMemSpyCtrlIdSlideShowImage,
+    EMemSpyCtrlIdWaitNote
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyApp.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYAPP_H
+#define MEMSPYAPP_H
+
+// System includes
+#include <aknapp.h>
+
+// Constants
+const TUid KUidMemSpy = { 0x2002129F };
+
+
+class CMemSpyApp : public CAknApplication
+    {
+private: // From CApaApplication
+    CApaDocument* CreateDocumentL();
+    TUid AppDllUid() const;
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyAppUi.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYAPPUI_H
+#define MEMSPYAPPUI_H
+
+// System includes
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknappui.h>
+#include <coecobs.h>
+
+// User includes
+#include "MemSpyDeviceWideOperationDialog.h"
+#include "MemSpyContainerObserver.h"
+#include <memspy/engine/memspyengineobserver.h>
+
+// Classes referenced
+class CEikMenuBar;
+class CMemSpyEngine;
+class CMemSpyContainer;
+class CMemSpyDocument;
+
+//cigasto
+class RMemSpySession;
+
+
+class CMemSpyAppUi : public CAknAppUi, public MMemSpyContainerObserver, public MCoeControlObserver, public MMemSpyEngineObserver, public MMemSpyDeviceWideOperationDialogObserver
+    {
+public:
+    //CMemSpyAppUi( CMemSpyEngine& aEngine );
+	CMemSpyAppUi( RMemSpySession& aMemSpySession );
+    ~CMemSpyAppUi();
+    void ConstructL();
+
+public: // API
+    CMemSpyDocument& MemSpyDocument();
+    const CMemSpyDocument& MemSpyDocument() const;
+    inline CMemSpyContainer& Container() { return *iAppContainer; }
+
+private: // From Avkon
+    void HandleStatusPaneSizeChange();
+
+private: // From MCoeControlObserver
+    void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
+
+private: // From MEikMenuObserver
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // From CEikAppUi
+	void HandleForegroundEventL(TBool aForeground);
+    void HandleCommandL(TInt aCommand);
+    TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+private: // From MMemSpyContainerObserver
+    void HandleThreadSelectedL( const CMemSpyThread& aThread );
+
+private: // From MMemSpyEngineObserver
+    void HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext );
+
+private: // From MMemSpyDeviceWideOperationDialogObserver
+    void DWOperationStarted();
+    void DWOperationCancelled();
+    void DWOperationCompleted();
+
+private: // Internal methods
+    void UpdateCBAL();
+    void InitiateMemSpyClientServerOperationL( TInt aOpCode );
+    void SetViewServerTimeOutStatus( TBool aEnabled );
+    
+private: // Command handlers
+    void OnCmdBackL();
+    void OnCmdExitL();
+    void OnCmdOpenL();
+    void OnCmdAboutL();
+
+    // Output
+    void OnCmdOutputToDebugL();
+    void OnCmdOutputToFileL();
+ 
+    // Phone-information
+    void OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::TOperation aOp );
+    void OnCmdPhoneInformationOperationKernelContainersL();
+    
+    // Automatic capture
+    void OnCmdAutoCaptureToggleL();
+    void OnCmdAutoCaptureRetryTimeL();
+    void OnCmdAutoCaptureOperationTypeL();
+
+    // Misc
+    void OnCmdToolsBitmapsSaveToMemoryCardL();
+    void OnCmdToolsSendToBackgroundL();
+    void OnCmdToolsBringToForegroundL();
+
+private: // Auto capture related
+    static TInt AutoCaptureCallBack( TAny* aSelf );
+    void AutoCaptureCallBackL();
+
+private: // Member data
+    //CMemSpyEngine& iEngine;
+    RMemSpySession& iMemSpySession;
+    CMemSpyContainer* iAppContainer;
+    
+    // For phone information dialog
+    TBool iRunningDeviceWideOperation;
+    
+    // For auto-capture
+    TInt iAutoCaptureTimerPeriod;
+    CMemSpyDeviceWideOperations::TOperation iAutoCaptureOperationType;
+    CPeriodic* iAutoCaptureTimer;
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYCONTAINER_H
+#define MEMSPYCONTAINER_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+#include "MemSpyViewObserver.h"
+
+// Classes referenced
+class CMemSpyEngine;
+class CMemSpyProcess;
+class CMemSpyThread;
+class CMemSpyThreadInfoItemBase;
+class CMemSpyEngineObjectContainer;
+class MMemSpyContainerObserver;
+//cigasto
+class RMemSpySession;
+
+class CMemSpyContainer : public CCoeControl, public MMemSpyViewObserver
+    {
+public:
+    //CMemSpyContainer( CMemSpyEngine& aEngine, MMemSpyContainerObserver& aObserver );
+	CMemSpyContainer( RMemSpySession& aSession, MMemSpyContainerObserver& aObserver );
+    ~CMemSpyContainer();
+    void ConstructL( const TRect& aRect );
+
+public: // API
+    inline TMemSpyViewType ActiveViewType() const { return iActiveView->ViewType(); }
+    inline CMemSpyViewBase& ActiveView() const { return *iActiveView; }
+
+public: // API
+    void NavigateToParentViewL();
+    void NavigateToChildViewL();
+    void HandleCommandL( TInt aCommand );
+    void SetNewActiveViewL( CMemSpyViewBase* aNewView );
+
+public: // Command handlers
+    void OnCmdViewRefreshL();
+
+private: // From CCoeControl
+    void SizeChanged();
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl(TInt aIndex) const;
+    void Draw(const TRect& aRect) const;
+	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+private: // From MMemSpyViewObserver
+    void HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType aViewType, CMemSpyViewBase& aReportingView, TAny* aContext );
+
+private: // Internal methods
+    CMemSpyViewBase* PrepareTopLevelViewL();
+
+private: // Member data
+    //CMemSpyEngine& iEngine;
+    RMemSpySession& iMemSpySession;
+    MMemSpyContainerObserver& iObserver;
+    CMemSpyViewBase* iActiveView;
+    CMemSpyViewBase* iPreviousView;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyContainerObserver.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYCONTAINEROBSERVER_H
+#define MEMSPYCONTAINEROBSERVER_H
+
+// Classes referenced
+class CMemSpyThread;
+
+
+class MMemSpyContainerObserver
+    {
+public:
+    virtual void HandleThreadSelectedL( const CMemSpyThread& aThread ) = 0;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyDeviceWideOperationDialog.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYDEVICEWIDEOPERATIONDIALOG_H
+#define MEMSPYDEVICEWIDEOPERATIONDIALOG_H
+
+// System includes
+#include <AknProgressDialog.h>
+#include <AknWaitDialog.h>
+
+// Engine includes
+#include <memspy/engine/memspydevicewideoperations.h>
+
+// Classes referenced
+class CMemSpyEngine;
+
+class MMemSpyDeviceWideOperationDialogObserver
+    {
+public:
+    virtual void DWOperationStarted() = 0;
+    virtual void DWOperationCancelled() = 0;
+    virtual void DWOperationCompleted() = 0;
+    };
+
+
+class CMemSpyDeviceWideOperationDialog : public CBase, public MProgressDialogCallback, public MMemSpyDeviceWideOperationsObserver
+    {
+public:
+    static void ExecuteLD( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation );
+    ~CMemSpyDeviceWideOperationDialog();
+
+private:
+    CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver );
+    void ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation );
+
+public: // API
+    void Cancel();
+
+private: // From MProgressDialogCallback
+    void DialogDismissedL( TInt aButtonId );
+
+private: // From MMemSpyDeviceWideOperationsObserver
+    void HandleDeviceWideOperationEvent( TEvent aEvent, TInt aParam1, const TDesC& aParam2 );
+
+private: // Internal methods
+    void SetDialogCaptionL( const TDesC& aText );
+
+private: // Member data
+    CMemSpyEngine& iEngine;
+    MMemSpyDeviceWideOperationDialogObserver& iObserver;
+    TBool iForcedCancel;
+    CEikProgressInfo* iProgressInfo;
+    CAknProgressDialog* iProgressDialog;
+    CMemSpyDeviceWideOperations* iOperation;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyDocument.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYDOCUMENT_H
+#define MEMSPYDOCUMENT_H
+
+// System includes
+#include <AknDoc.h>
+   
+// Classes referenced
+class CMemSpyEngine;
+class CEikAppUi;
+class CMemSpySettings;
+//cigasto
+class RMemSpySession;
+
+
+class CMemSpyDocument : public CAknDocument
+    {
+public: // Constructors and destructor
+    static CMemSpyDocument* NewL(CEikApplication& aApp);
+    ~CMemSpyDocument();
+
+private:
+    CMemSpyDocument(CEikApplication& aApp);
+    void ConstructL();
+
+public:
+//    CMemSpyEngine& Engine();
+//    const CMemSpyEngine& Engine() const;
+    CMemSpySettings& Settings();
+    const CMemSpySettings& Settings() const;
+
+private: // Framework
+    CEikAppUi* CreateAppUiL();
+
+private: // Data members
+//    CMemSpyEngine* iEngine;
+    CMemSpySettings* iSettings;
+    //cigasto
+    RMemSpySession* iMemSpySession;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyExportBitmapsToMemoryCardDialog.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYEXPORTBITMAPSTOMEMORYCARDDIALOG_H
+#define MEMSPYEXPORTBITMAPSTOMEMORYCARDDIALOG_H
+
+// System includes
+#include <AknProgressDialog.h>
+#include <AknWaitDialog.h>
+#include <imageconversion.h>
+
+// Classes referenced
+class CMemSpyEngineFbServBitmap;
+class CMemSpyEngineFbServBitmapArray;
+
+
+
+class CMemSpyExportBitmapsToMemoryCardDialog : public CActive, public MProgressDialogCallback
+    {
+public:
+    static CMemSpyExportBitmapsToMemoryCardDialog* NewL( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps );
+    ~CMemSpyExportBitmapsToMemoryCardDialog();
+
+private:
+    CMemSpyExportBitmapsToMemoryCardDialog( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps );
+    void ConstructL();
+
+public: // API
+    void Cancel();
+    static TBool CheckMemoryCardAvailableL( RFs& aFsSession );
+
+private: // From CActive
+    void RunL();
+    void DoCancel();
+    TInt RunError(TInt aError);
+
+private: // From MProgressDialogCallback
+    void DialogDismissedL( TInt aButtonId );
+
+private: // Internal methods
+    void CompleteSelf( TInt aError );
+    void ExportBitmapL( const CMemSpyEngineFbServBitmap& aBitmap );
+    void IdentifyBmpMimeTypeL();
+    void PruneExistingBitmapFilesL();
+    void PrepareFolderNameSpecL();
+    TBool TryToExportSingleBitmapL();
+
+private: // Member data
+    RFs& iFsSession;
+    const CMemSpyEngineFbServBitmapArray& iBitmaps;
+    TInt iBitmapIndex;
+    TBool iDialogDismissed;
+    CEikProgressInfo* iProgressInfo;
+    CAknProgressDialog* iProgressDialog;
+    CImageEncoder* iEncoder;
+    HBufC8* iBmpMimeType;
+    HBufC* iFolderName;
+    RFileExtensionMIMETypeArray iMimeTypeArray;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpySettings.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYSETTINGS_H
+#define MEMSPYSETTINGS_H
+
+// System includes
+#include <e32base.h>
+#include <badesca.h>
+#include <f32file.h>
+
+// Engine includes
+#include <memspy/engine/memspyengineoutputsink.h>
+
+// Classes referenced
+class CMemSpyEngine;
+
+//cigasto
+class RMemSpySession;
+
+
+class CMemSpySettings : public CBase
+    {
+public:
+    //static CMemSpySettings* NewL( RFs& aFsSession, CMemSpyEngine& aEngine );
+	static CMemSpySettings* NewL( RFs& aFsSession, RMemSpySession& aSession );
+    ~CMemSpySettings();
+
+private:
+    //CMemSpySettings( RFs& aFsSession, CMemSpyEngine& aEngine );
+    CMemSpySettings( RFs& aFsSession, RMemSpySession& aSession );
+    void ConstructL();
+
+public: // API
+    inline RFs& FsSession() { return iFsSession; }
+    void StoreSettingsL();
+
+private: // Settings methods
+    void RestoreSettingsL();
+    void GetSettingsFileNameL( TDes& aFileName );
+    void GetSettingsPathL( TDes& aPath );
+    RFile SettingsFileLC( TBool aReplace = EFalse );
+
+private: // Data members
+    RFs& iFsSession;
+    //CMemSpyEngine& iEngine;
+    //RMemSpySession& iMemSpySession;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYUIUTILS_H
+#define MEMSPYUIUTILS_H
+
+// System includes
+#include <e32std.h>
+
+// Engine includes
+#include <memspy/engine/memspyengineutils.h>
+
+
+class MemSpyUiUtils : public MemSpyEngineUtils
+    {
+public:
+    static void Format( TDes& aBuf, TInt aResourceId, ...);
+    static void GetErrorText( TDes& aBuf, TInt aError );
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewBase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,109 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWBASE_H
+#define MEMSPYVIEWBASE_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <memspyui.rsg>
+
+// User includes
+#include "MemSpy.hrh"
+#include "MemSpyViewType.h"
+#include "MemSpyViewObserver.h"
+#include "MemSpySettings.h"
+
+// Classes referenced
+class CMemSpyEngine;
+class CMemSpyContainer;
+class MMemSpyViewObserver;
+//cigasto
+class RMemSpySession;
+
+class CMemSpyViewBase : public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver
+    {
+public:
+    //CMemSpyViewBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+	CMemSpyViewBase( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewBase();
+    virtual void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // API
+    virtual TMemSpyViewType ViewType() const = 0;
+    virtual CMemSpyViewBase* PrepareParentViewL();
+    virtual CMemSpyViewBase* PrepareChildViewL();
+    virtual void RefreshL();
+    virtual TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    virtual TUint MenuCascadeResourceId() const;
+    virtual TInt MenuCascadeCommandId() const;
+
+private: // Command handlers
+    virtual void OnCmdViewOutputToSinkL();
+
+protected: // Construction support
+    void SetTitleL( const TDesC& aText );
+    TPtrC TitleL() const;
+    virtual CEikListBox* ConstructListBoxL();
+    virtual void SetListBoxModelL() = 0;
+
+protected: // Internal framework
+    virtual void HandleListBoxItemActionedL( TInt aIndex );
+    virtual void HandleListBoxItemSelectedL( TInt aIndex );
+ 
+protected: // Event reporting
+    void ReportEventL( MMemSpyViewObserver::TViewEventType aEvent, TAny* aContext = NULL );
+    void SetListBoxCurrentItemIndexL( TInt aIndex );
+
+protected: // Utility methods
+    CMemSpyContainer& Container();
+    CMemSpySettings& Settings();
+    const CMemSpySettings& Settings() const;
+
+public: // From CCoeControl
+	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+protected: // From CCoeControl
+    void Draw( const TRect& aRect ) const;
+    void SizeChanged();
+    void FocusChanged( TDrawNow aDrawNow );
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+
+protected: // From MCoeControlObserver
+    void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
+
+protected: // From MEikListBoxObserver
+    void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType);
+
+protected: // Member data
+    //CMemSpyEngine& iEngine;
+    RMemSpySession& iMemSpySession;
+    MMemSpyViewObserver& iObserver;
+    //
+    CEikListBox* iListBox;
+
+private:
+    CMemSpySettings* iSettings;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewChunkList.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWCHUNKLIST_H
+#define MEMSPYVIEWCHUNKLIST_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CMemSpyEngineChunkList;
+class CMemSpyEngineChunkEntry;
+
+
+
+
+class CMemSpyViewChunkBase : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewChunkBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList* aList );
+    ~CMemSpyViewChunkBase();
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_CHUNK_LIST; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdChunk; }
+
+protected: // Command handlers
+    void OnCmdListingL();
+
+protected: // Data members
+    CMemSpyEngineChunkList* iList;
+    };
+
+
+
+
+class CMemSpyViewChunkList : public CMemSpyViewChunkBase
+    {
+public:
+    CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineChunkEntry* iCurrentChunk;
+    };
+
+
+
+class CMemSpyViewChunkDetails : public CMemSpyViewChunkBase
+    {
+public:
+    CMemSpyViewChunkDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList, CMemSpyEngineChunkEntry& aSelectedChunk );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Data members
+    CMemSpyEngineChunkEntry& iChunk;
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewCodeSegList.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWCODESEGLIST_H
+#define MEMSPYVIEWCODESEGLIST_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CMemSpyEngineCodeSegList;
+class CMemSpyEngineCodeSegEntry;
+
+
+class CMemSpyViewCodeSegBase : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewCodeSegBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList* aList );
+    ~CMemSpyViewCodeSegBase();
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    void RefreshL();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_CODESEG_LIST; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdCodeSeg; }
+
+protected: // Command handlers
+    void OnCmdCodeSegmentListingL();
+    void OnCmdShowItemsAllL();
+    void OnCmdShowItemsGlobalDataL();
+    void OnCmdFilterByCapabilityL( TCapability aCapability, TBool aAllBinaries );
+
+protected: // Data members
+    CMemSpyEngineCodeSegList* iList;
+    };
+
+
+
+
+class CMemSpyViewCodeSegList : public CMemSpyViewCodeSegBase
+    {
+public:
+    CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineCodeSegEntry* iCurrentCodeSegment;
+    };
+
+
+
+class CMemSpyViewCodeSegDetails : public CMemSpyViewCodeSegBase
+    {
+public:
+    CMemSpyViewCodeSegDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList, CMemSpyEngineCodeSegEntry& aSelectedCodeSegment );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Data members
+    CMemSpyEngineCodeSegEntry& iCodeSegment;
+    };
+
+
+
+
+
+
+class TMemSpyViewCodeSegFilter
+    {
+public:
+    inline TMemSpyViewCodeSegFilter( TCapability aCapability, TBool aAllBinaries = ETrue )
+    :   iCapability( aCapability ), iAllBinaries( aAllBinaries )
+        {
+        }
+
+public:
+    static TBool FilterItem( const CMemSpyEngineCodeSegEntry*& aItem, TAny* aRune );
+
+private:
+    TCapability iCapability;
+    TBool iAllBinaries;
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewDriveInfo.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWDRIVEINFO_H
+#define MEMSPYVIEWDRIVEINFO_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyenginehelperfilesystem.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+
+
+class CMemSpyViewDriveInfoBase : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewDriveInfoBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewDriveInfoBase();
+    void BaseConstructL();
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+protected: // Data members
+    CMemSpyEngineDriveList* iList;
+    };
+
+
+
+
+class CMemSpyViewDriveList : public CMemSpyViewDriveInfoBase, public MMemSpyEngineDriveListObserver
+    {
+public:
+    CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void RefreshL();
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // From MMemSpyEngineDriveListObserver
+    void HandleDriveListChangedL( const CMemSpyEngineDriveList& aList );
+
+private: // Data members
+    TBool iUseDriveNumber;
+    TDriveNumber iDriveNumber;
+    CMemSpyEngineDriveEntry* iCurrentDrive;
+    };
+
+
+
+class CMemSpyViewDriveInfo : public CMemSpyViewDriveInfoBase, public MMemSpyEngineDriveEntryObserver
+    {
+public:
+    CMemSpyViewDriveInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineDriveEntryObserver
+    void HandleDriveEntryChangedL( const CMemSpyEngineDriveEntry& aEntry );
+
+private: // Data members
+    const TDriveNumber iDriveNumber;
+    CMemSpyEngineDriveEntry* iDriveInfo;
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewECom.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWECOM_H
+#define MEMSPYVIEWECOM_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <eikimage.h>
+#include <AknDialog.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Engine includes
+#include <memspy/engine/memspyenginehelperecom.h>
+
+
+class CMemSpyViewECom : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewECom( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineEComCategory* iCurrent;
+    };
+
+
+
+class CMemSpyViewEComCategory : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewEComCategory( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComCategory& aCategory );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineEComCategory& iCategory;
+    CMemSpyEngineEComInterface* iCurrent;
+    };
+
+
+
+
+class CMemSpyViewEComInterface : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewEComInterface( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComInterface& aInterface );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineEComInterface& iInterface;
+    CMemSpyEngineEComImplementation* iCurrent;
+    };
+
+
+
+
+
+
+class CMemSpyViewEComImplementation : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewEComImplementation( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComImplementation& aImplementation );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Data members
+    CMemSpyEngineEComImplementation& iImplementation;
+    };
+
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewFBServBitmaps.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,177 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWFBSERVBITMAPS_H
+#define MEMSPYVIEWFBSERVBITMAPS_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <eikimage.h>
+#include <AknDialog.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Engine includes
+#include <memspy/engine/memspyenginehelperfbserv.h>
+
+
+
+class CMemSpyViewFBServBase : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewFBServBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps );
+    ~CMemSpyViewFBServBase();
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_IMAGES; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdImages; }
+
+protected: // Command handlers
+    void OnCmdSlideShowL();
+    void OnCmdExportToMemoryCardL();
+    void OnCmdImageListingL();
+
+protected: // Data members
+    CMemSpyEngineFbServBitmapArray* iBitmaps;
+    };
+
+
+
+
+
+class CMemSpyViewFBServBitmaps : public CMemSpyViewFBServBase, public MMemSpyEngineFbSerbBitmapArrayObserver
+    {
+public:
+    CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps );
+    ~CMemSpyViewFBServBitmaps();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From MMemSpyEngineFbSerbBitmapArrayObserver
+    void HandleFbServBitmapArrayEventL( TEvent aEvent );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+
+private: // Idle timer update
+    static TInt IdleUpdateListBoxModel( TAny* aSelf );
+    void DoIdleUpdateListBoxModelL();
+
+private: // Data members
+    RArray<TInt> iBitmapHandles;
+    CMemSpyEngineFbServBitmap* iCurrentBitmap;
+    CPeriodic* iIdleResetListboxTimer;
+    };
+
+
+
+class CMemSpyViewFBServBitmapInfo : public CMemSpyViewFBServBase
+    {
+public:
+    CMemSpyViewFBServBitmapInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+
+private: // Data members
+    CMemSpyEngineFbServBitmap& iBitmapObject;
+    };
+
+
+
+
+class CMemSpyViewFBServBitmapViewer : public CMemSpyViewFBServBase
+    {
+public:
+    CMemSpyViewFBServBitmapViewer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap );
+    ~CMemSpyViewFBServBitmapViewer();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    CEikListBox* ConstructListBoxL();
+
+private: // From CCoeControl
+    void Draw(const TRect& aRect) const;
+    void SizeChanged();
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+
+private: // Data members
+    CMemSpyEngineFbServBitmap& iBitmapObject;
+    CEikImage* iImage;
+    TRect iBorderRect;
+    };
+
+
+
+
+
+class CMemSpyViewFBServSlideshow : public CAknDialog
+    {
+public:
+    static void NewLD( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex );
+    ~CMemSpyViewFBServSlideshow();
+
+private:
+    CMemSpyViewFBServSlideshow( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex );
+    void ConstructL();
+
+private:
+    void PreLayoutDynInitL();
+	TBool OkToExitL(TInt aButtonId);
+
+private: // Idle timer update
+    static TInt IdleUpdate( TAny* aSelf );
+    void ShowNextImageL();
+
+private: // Data members
+    CMemSpyEngineFbServBitmapArray& iBitmaps;
+    TInt& iIndex;
+    CPeriodic* iTimer;
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewHeapTracking.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWHEAPTRACKING_H
+#define MEMSPYVIEWHEAPTRACKING_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackerobserver.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewHeapTracking : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
+    {
+public:
+    CMemSpyViewHeapTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewHeapTracking();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+public:
+    static TInt AsyncStopTimerCallback( TAny* aParam );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineHelperSysMemTrackerObserver
+    void HandleCyclesResetL();
+    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    
+private: // Internal methods
+    TInt IndexByViewType( TMemSpyViewType aType );
+    void SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode aMode, TMemSpyEngineHelperSysMemTrackerConfig& aConfig );
+    TInt AsyncStopTimerCallback();
+
+private: // Enum
+    enum TMemSpyViewHeapTrackingState
+        {
+        EMemSpyViewHeapTrackingStateIdle = 0,
+        EMemSpyViewHeapTrackingStateTimerOn,
+        EMemSpyViewHeapTrackingStateSingleOn        
+        };
+
+private: // Data
+    TMemSpyEngineHelperSysMemTrackerConfig iOriginalConfig;
+    TMemSpyViewHeapTrackingState iState;
+    CAsyncCallBack* iStopTimerCallBack;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewHeapTrackingResults.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,127 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWHEAPTRACKINGRESULTS_H
+#define MEMSPYVIEWHEAPTRACKINGRESULTS_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyenginehelpersysmemtrackerobserver.h>
+
+// Driver includes
+#include <memspy/driver/memspydriverobjectsshared.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CMemSpyEngineHelperSysMemTrackerCycle;
+class CMemSpyEngineHelperSysMemTrackerCycleChange;
+
+
+class CMemSpyViewHeapTrackingResults : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
+    {
+public:
+    CMemSpyViewHeapTrackingResults( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewHeapTrackingResults();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineHelperSysMemTrackerObserver
+    void HandleCyclesResetL();
+    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    };
+
+
+
+
+
+
+
+class CMemSpyViewHeapTrackingResultsCycleInfo : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
+    {
+public:
+    CMemSpyViewHeapTrackingResultsCycleInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    ~CMemSpyViewHeapTrackingResultsCycleInfo();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineHelperSysMemTrackerObserver
+    void HandleCyclesResetL();
+    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+
+private: // Data members
+    const CMemSpyEngineHelperSysMemTrackerCycle& iCycle;
+    };
+
+
+
+
+
+/*
+class CMemSpyViewHeapTrackingResultsChangeDescriptor : public CMemSpyViewBase, public MMemSpyEngineHelperSysMemTrackerObserver
+    {
+public:
+    CMemSpyViewHeapTrackingResultsChangeDescriptor( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle, const CMemSpyEngineHelperSysMemTrackerCycleChange& aChangeDescriptor, TInt aIndex );
+    ~CMemSpyViewHeapTrackingResultsChangeDescriptor();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineHelperSysMemTrackerObserver
+    void HandleCyclesResetL();
+    void HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+    void HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle );
+
+private: // Data members
+    const CMemSpyEngineHelperSysMemTrackerCycle& iCycle;
+    const CMemSpyEngineHelperSysMemTrackerCycleChange& iChangeDescriptor;
+    TInt iIndex; // For selection rune when moving to parent view
+    };
+*/
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewHeapTrackingSettings.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,109 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWHEAPTRACKINGSETTINGS_H
+#define MEMSPYVIEWHEAPTRACKINGSETTINGS_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <aknsettingitemlist.h> 
+#include <akncheckboxsettingpage.h>
+#include <AknQueryDialog.h> 
+
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewHeapTrackingSettings : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewHeapTrackingSettings( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewHeapTrackingSettings();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Internal methods
+    static void PrepareItemBufL( TDes& aBuf, const TDesC& aCaption, TBool aStatus, TBool aHeapCategorySelected );
+    };
+
+
+
+
+class CSWMTCategorySelectionCheckBoxSettingItem : public CAknSettingItem
+    {
+public:
+    CSWMTCategorySelectionCheckBoxSettingItem( TInt aIdentifier, TInt& aCategories );
+    virtual ~CSWMTCategorySelectionCheckBoxSettingItem();
+
+public:
+    CSelectionItemList* ItemArray() const;
+    
+protected:
+    void CompleteConstructionL();
+    void StoreL();
+    void LoadL();
+    void HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType );
+
+private:
+    void AddNewItemToArrayL(const TDesC& aLabel); 
+    
+private:
+    CSelectionItemList*     iItemArray;
+    HBufC*                  iSettingText;
+    TInt&                   iExtCategories;
+    };
+
+
+
+
+
+
+class CMemSpySWMTCategorySelectionCheckBoxSettingPage : public CAknCheckBoxSettingPage
+    {
+    public:
+        CMemSpySWMTCategorySelectionCheckBoxSettingPage( TInt aResourceID, CSelectionItemList* aItemArray );
+    public:     // New functions
+        void UpdateCba();
+    };
+    
+
+
+
+
+
+class CMemSpyAllowEmptyDataDialog : public CAknTextQueryDialog
+    {
+    public:
+        CMemSpyAllowEmptyDataDialog( TDes& aText, const TTone& aTone = ENoTone );
+    protected: // from CAknTextQueryDialog
+        void UpdateLeftSoftKeyL();
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewKernel.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWKERNEL_H
+#define MEMSPYVIEWKERNEL_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class RMemSpySession;
+
+class CMemSpyViewKernel : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewKernel( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewKernel();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Internal methods
+    static TInt IndexByViewType( TMemSpyViewType aType );
+
+private: // Data members
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWKERNELCONTAINERS_H
+#define MEMSPYVIEWKERNELCONTAINERS_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <BADESCA.H>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+#include <memspy/driver/memspydriverenumerationsshared.h>
+#include <memspy/api/memspyapikernelobject.h>
+
+// Classes referenced
+class CMemSpyEngineGenericKernelObjectContainer;
+
+class RMemSpySession;
+
+class CMemSpyViewKernelContainers : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewKernelContainers( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewKernelContainers();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();    
+    TPtrC TypeAsString( TMemSpyDriverContainerType aType );
+    
+    
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_CONTAINERS; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelContainers; }
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    TBool HandleCommandL( TInt aCommand );
+
+private: // Command handlers
+    void OnCmdOutputAllContainerContentsL();
+
+private: // Internal methods
+
+private: // Data members
+    //CMemSpyEngineGenericKernelObjectContainer* iModel;
+    RArray<CMemSpyApiKernelObject*> iKernelObjects; //array of raw items data
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWKERNELHEAP_H
+#define MEMSPYVIEWKERNELHEAP_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+#include <memspy/api/memspyapiheap.h>
+
+// Classes referenced
+class CMemSpyEngineGenericKernelObjectContainer;
+
+class RMemSpySession;
+
+class CMemSpyViewKernelHeap : public CMemSpyViewBase
+    {
+public:    
+	CMemSpyViewKernelHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );	
+    ~CMemSpyViewKernelHeap();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_HEAP; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelHeap; }
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    TBool HandleCommandL( TInt aCommand );    
+
+private: // Command handlers
+    void OnCmdDumpKernelHeapL();
+
+private: // Internal methods
+    //CDesCArrayFlat* FormatModel( RArray<CMemSpyApiHeap*> &aHeap );
+    CDesCArrayFlat* FormatModel( CMemSpyApiHeap* aHeap );
+    HBufC* FormatItem( const TDesC& aCaption, const TDesC& aValue );
+    HBufC* FormatItem( const TDesC& aCaption, TInt aValue );
+    HBufC* FormatItem( const TDesC& aCaption, TUint aValue );
+    HBufC* FormatItem( const TDesC& aCaption, const TInt64& aValue );
+    HBufC* FormatItem( const TDesC& aCaption, TAny* aValue );
+    HBufC* FormatItem( const TDesC& aCaption, TUint* aValue );
+    HBufC* FormatItem( const TDesC& aCaption, TUint8* aValue );
+    HBufC* FormatPercentageItem( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue );
+
+private: // Data members
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWKERNELOBJECTS_H
+#define MEMSPYVIEWKERNELOBJECTS_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <AknTabObserver.h> 
+
+// User includes
+#include "MemSpyViewBase.h"
+#include <memspy/driver/memspydriverenumerationsshared.h>
+#include <memspy/api/memspyapikernelobjectitem.h>
+
+// Classes referenced
+class CMemSpyEngineGenericKernelObjectContainer;
+class CMemSpyEngineGenericKernelObjectList;
+class CAknNavigationDecorator;
+class CAknNavigationControlContainer;
+class CAknTabGroup;
+
+class RMemSpySession;
+
+class CMemSpyViewKernelObjects : public CMemSpyViewBase, public MAknTabObserver
+    {
+public:
+    //CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType );
+	CMemSpyViewKernelObjects( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType );
+    ~CMemSpyViewKernelObjects();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    CEikListBox* ConstructListBoxL();
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_KERNEL_OBJECTS; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdKernelObjects; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    TBool HandleCommandL( TInt aCommand );
+
+private: // From CCoeControl
+    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+
+private: // From MAknTabObserver
+    void TabChangedL( TInt aIndex ); 
+    
+private: // Command handlers
+    void OnCmdTerminateL();
+    void OnCmdSwitchToL();
+    void OnCmdEndL();
+    void OnCmdPanicL();
+
+private: // Internal methods
+    void CreateTabsL();
+    void DetailsL();
+    void AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... );
+
+private: // Data members
+    //CMemSpyEngineGenericKernelObjectContainer* iModel;
+    CDesCArrayFlat* iItems;
+    TMemSpyDriverContainerType iObjectType;
+    CMemSpyEngineGenericKernelObjectList* iObjectList;
+    CAknNavigationDecorator* iNavDecorator;
+    CAknNavigationControlContainer* iNaviPane;
+    CAknNavigationControlContainer* iNavContainer;
+    CAknTabGroup* iTabs;
+    TInt iCurrItemIndex;
+    CDesCArrayFlat* iModel;
+    RArray<CMemSpyApiKernelObjectItem*> iKernelObjectItems;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewMainMenu.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWMAINMENU_H
+#define MEMSPYVIEWMAINMENU_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CMemSpyProcess;
+
+//cigasto
+class RMemSpySession;
+
+class CMemSpyViewMainMenu : public CMemSpyViewBase
+    {
+public:
+    //CMemSpyViewMainMenu( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+	CMemSpyViewMainMenu( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Internal methods
+    static TInt IndexByViewType( TMemSpyViewType aType );
+
+private: // Data members
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewMemoryTrackingAutoStartConfig.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,110 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
+#define MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <ecom/ecom.h>
+#include <xml/contenthandler.h> // MContentHandler mix in class
+#include <xml/parser.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Literal constants
+_LIT( KMemSpyProcessMemoryTrackingAutoStartConfigSearchPath, "E:\\MemSpy\\" );
+_LIT( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, "MemSpyProcessMemoryTrackingAutoStartConfig.xml" );
+
+// Classes referenced
+class CCnvCharacterSetConverter;
+
+// Namespaces referenced
+using namespace Xml;
+
+
+class CMemSpyViewMemoryTrackingAutoStartConfig : public CMemSpyViewBase, public MContentHandler
+    {
+public:
+    CMemSpyViewMemoryTrackingAutoStartConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewMemoryTrackingAutoStartConfig();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    TBool HandleCommandL( TInt aCommand );
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void SetListBoxModelL();
+    void RefreshL();
+
+public: // Menu framework
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+    TUint MenuCascadeResourceId() const;
+    TInt MenuCascadeCommandId() const;
+
+private: // Command handlers
+    void OnCmdItemAddL();
+    void OnCmdItemEditL();
+    void OnCmdItemDeleteL();
+    void OnCmdItemDeleteAllL();
+    void OnCmdItemImportL();
+
+private: // Internal methods
+    TUid ShowDialogL( TUid aUid );
+    void SaveChangesL();
+    static TUid ValidateProcessUid( const TDesC& aUid );
+
+private: // Internal XML methods
+    void FindXmlInstallTimeL();
+    void FindXmlUserSuppliedL();
+    HBufC* FindEComXmlFileNameLC();
+    void ConvertL( const TDesC8& aInput, TDes16& aOutput );
+    void ParseL( const TDesC& aFileName );
+
+private: // XML helper functions
+    void OnSectionProcessL( const RAttributeArray& aAttributes );
+
+private: // From MContentHandler
+	void OnStartDocumentL( const RDocumentParameters& aDocParam, TInt aErrorCode );
+	void OnEndDocumentL( TInt aErrorCode );
+	void OnStartElementL( const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode );
+	void OnEndElementL( const RTagInfo& aElement, TInt aErrorCode );
+	void OnContentL( const TDesC8& aBytes, TInt aErrorCode );
+	void OnStartPrefixMappingL( const RString& aPrefix, const RString& aUri, TInt aErrorCode );
+	void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode );
+	void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode );
+	void OnSkippedEntityL( const RString& aName, TInt aErrorCode );
+	void OnProcessingInstructionL( const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode );
+	void OnError( TInt aErrorCode );
+	TAny* GetExtendedInterface( const TInt32 aUid );
+
+private: // Data members
+    RArray< TUid > iProcessUids;
+    TInt iParserErrorCode;
+    TInt iCharconvConverterState;
+    TBool iSeenMasterSection;
+    CParser* iParser;
+    CCnvCharacterSetConverter* iConverter;
+    HBufC* iXMLFileNameInstallTime;
+    HBufC* iXMLFileNameUserSupplied;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewObserver.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWOBSERVER_H
+#define MEMSPYVIEWOBSERVER_H
+
+// User includes
+#include "MemSpyViewType.h"
+
+// Classes referenced
+class CMemSpyViewBase;
+
+class MMemSpyViewObserver
+    {
+public: // Enumerations
+    enum TViewEventType
+        {
+        EEventItemActioned = 0,
+        EEventItemSelected
+        };
+
+public: // From MMemSpyViewObserver
+    virtual void HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType aViewType, CMemSpyViewBase& aReportingView, TAny* aContext ) = 0;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewOpenFiles.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWOPENFILES_H
+#define MEMSPYVIEWOPENFILES_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewOpenFiles : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewOpenFiles( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewOpenFiles();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    CEikListBox* ConstructListBoxL();
+    void RefreshL();
+    TBool HandleCommandL( TInt aCommand );
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // Command handlers
+    void OnCmdListOpenFilesL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+
+private: // Internal
+    static TBool CompareTEntryObjects( const TEntry& aLeft, const TEntry& aRight );
+
+private: // Data members
+    RArray<TThreadId> iThreadIds;
+    const TThreadId* iActionedThreadId;
+    RArray<TEntry> iFileNames;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewProcesses.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWPROCESSES_H
+#define MEMSPYVIEWPROCESSES_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+#include <memspy/api/memspyapiprocess.h>
+
+// Classes referenced
+class CMemSpyProcess;
+class CAknSearchField;
+class RMemSpySession;
+
+class CMemSpyViewProcesses : public CMemSpyViewBase
+    {
+public:
+    //CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    //CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
+	CMemSpyViewProcesses( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
+//	CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
+	CMemSpyViewProcesses( RMemSpySession& aEngine, MMemSpyViewObserver& aObserver, TProcessId aId );
+    ~CMemSpyViewProcesses();
+    //void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );    
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TProcessId aSelectionRune = NULL );
+
+public: // API
+    CMemSpyProcess& CurrentProcess() const;
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_PROCESS; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdProcess; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // Command handlers
+
+    // Sorting
+    void OnCmdSortByIdL();
+    void OnCmdSortByNameL();
+    void OnCmdSortByThreadCountL();
+    void OnCmdSortByCodeSegsL();
+    void OnCmdSortByHeapUsageL();
+    void OnCmdSortByStackUsageL();
+
+    // Info
+    void OnCmdInfoSummaryL();
+    void OnCmdInfoHandlesL();
+
+    // Ending
+    void OnCmdEndTerminateL();
+    void OnCmdEndPanicL();
+    void OnCmdEndKillL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void HandleListBoxItemSelectedL( TInt aIndex );
+    
+private: // From CCoeControl
+    void SizeChanged();
+    TInt CountComponentControls() const;
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
+    void FocusChanged( TDrawNow /*aDrawNow*/ );
+
+private: // From MCoeControlObserver
+    void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
+
+private: // Internal methods
+    void SelectListBoxItemByFindTextL();
+    
+    CDesCArrayFlat* FormatModel( RArray<CMemSpyApiProcess*> aProcesses );
+    void AppendPriority( TDes& aDes, TProcessPriority aPriority );
+    void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
+    void AppendExitType( TDes& aDes, TExitType aType );
+
+private: // Data members
+    CMemSpyProcess* iCurrentProcess;
+    TProcessId iCurrentProcessId;
+    CAknSearchField* iSearchField;
+    HBufC* iMatcherBuffer;
+    RArray<CMemSpyApiProcess*> iProcesses;  //cigasto
+    CDesCArrayFlat* iModel;
+    CDesCArrayFlat* model;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewRAMInfo.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWRAMINFO_H
+#define MEMSPYVIEWRAMINFO_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewRAMInfo : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewRAMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_RAM; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdRAM; }
+
+private: // Command handlers
+    void OnCmdSetIconCacheStatusL( TBool aEnabled );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Data members
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewROMInfo.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWROMINFO_H
+#define MEMSPYVIEWROMINFO_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewROMInfo : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewROMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Data members
+    };
+
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewServerList.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWSERVERLIST_H
+#define MEMSPYVIEWSERVERLIST_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CMemSpyEngineServerList;
+class CMemSpyEngineServerEntry;
+
+
+class CMemSpyViewServerList : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewServerList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewServerList();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_SERVER_LIST; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdServerList; }
+
+private: // Command handlers
+    void OnCmdServerListSortByNameL();
+    void OnCmdServerListSortBySessionCountL();
+    void OnCmdServerListOutputSummaryL();
+    void OnCmdServerListOutputDetailedL();
+    void OnCmdServerListOutputGenericL( TBool aDetailed );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+
+private: // Data members
+    CMemSpyEngineServerList* iList;
+    const CMemSpyEngineServerEntry* iActionedItem;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewSystemConfig.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWSYSTEMCONFIG_H
+#define MEMSPYVIEWSYSTEMCONFIG_H
+
+// System includes
+#include <hal.h>
+#include <f32file.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewSystemConfig : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewSystemConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewSystemConfig();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Internal enumerations 
+
+    enum TMemSpyDisplayMode
+	    {
+	    ENone,
+	    EGray2,
+	    EGray4,
+	    EGray16,
+	    EGray256,
+	    EColor16,
+	    EColor256,
+	    EColor64K,
+	    EColor16M,
+	    ERgb,
+	    EColor4K,
+	    EColor16MU,
+	    EColor16MA,
+	    EColor16MAP,
+	    EColorLast
+	    };
+
+private: // Internal methods
+    static void GetManufacturer( TDes& aBuf );
+    static void GetDeviceFamily( TDes& aBuf );
+    static void GetCPU( TDes& aBuf );
+    static void GetCPUABI( TDes& aBuf );
+    static void GetStartupReason( TDes& aBuf );
+    static void GetKeyboard( TDes& aBuf );
+    static void GetMachineUid( TDes& aBuf );
+    static void GetDisplayType( TDes& aBuf );
+    static void GetDisplayMode( TDes& aBuf, TMemSpyDisplayMode aMode );
+    //
+    static TInt GetHALValue( HALData::TAttribute aAttribute, TInt& aValue );
+    TInt GetHALValueAsStringL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
+    TInt GetHALValueAsNumericL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL, TInt aWidth = -1 );
+    TInt GetHALValueAsHexL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
+    TInt GetHALValueAsYesNoL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
+    TInt GetHALValueAsDriveLetterL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix = NULL );
+
+private:
+    void AddItemL( const TDesC& aCaption, const TDesC& aValue, const TDesC* aSuffix = NULL );
+    void AddItemL( TDriveNumber aDrive, const TDesC& aCaption, const TDesC* aSuffix = NULL );
+
+private: // Data members
+    CDesCArrayFlat* iModel;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMACTIVEOBJECT_H
+#define MEMSPYVIEWTHREADINFOITEMACTIVEOBJECT_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+// Classes referenced
+class CMemSpyEngineActiveObjectArray;
+
+
+
+class CMemSpyViewThreadInfoItemActiveObjectBase : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_ACTIVE_OBJECTS; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdActiveObject; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+protected:
+    CMemSpyEngineActiveObjectArray& ActiveObjectArray() const;
+
+private: // Command handlers
+    void OnCmdWriteAOListingL();
+    };
+
+
+
+class CMemSpyViewThreadInfoItemActiveObject : public CMemSpyViewThreadInfoItemActiveObjectBase
+    {
+public:
+    CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareChildViewL();
+    };
+
+
+
+
+class CMemSpyViewThreadInfoItemActiveObjectDetails : public CMemSpyViewThreadInfoItemActiveObjectBase
+    {
+public:
+    CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress );
+
+public: // From CMemSpyViewBase
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    
+private: // Data members
+    TAny* iObjectAddress;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMCHUNK_H
+#define MEMSPYVIEWTHREADINFOITEMCHUNK_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+
+class CMemSpyViewThreadInfoItemChunk : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+private: // From CMemSpyViewBase
+    CMemSpyViewBase* PrepareChildViewL();
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMCODESEG_H
+#define MEMSPYVIEWTHREADINFOITEMCODESEG_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+
+class CMemSpyViewThreadInfoItemCodeSeg : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+private: // From CMemSpyViewBase
+    CMemSpyViewBase* PrepareChildViewL();
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
+#define MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+
+class CMemSpyViewThreadInfoItemGeneralInfo : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+
+private: // Command handlers
+    void OnCmdToggleKernelEventHooksL();
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMGENERIC_H
+#define MEMSPYVIEWTHREADINFOITEMGENERIC_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+class CAknWaitDialog;
+class CMemSpyProcess;
+class CMemSpyThread;
+class CMemSpyThreadInfoContainer;
+class CMemSpyThreadInfoItemBase;
+
+
+class CMemSpyViewThreadInfoItemGeneric : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType );
+    ~CMemSpyViewThreadInfoItemGeneric();
+
+public: // From CMemSpyViewBase
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // API
+    CMemSpyProcess& Process() const;
+    CMemSpyThread& Thread() const;
+    CMemSpyThreadInfoContainer& Container() const;
+    CMemSpyThreadInfoItemBase& InfoItem() const;
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+
+protected: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
+
+private: // Internal methods
+    void ShowWaitNoteL();
+    void DestroyWaitNote();
+    static TInt CheckForItemConstructionComplete( TAny* aSelf );
+
+protected: // Member data
+    CMemSpyThreadInfoContainer& iContainer;
+    CMemSpyThreadInfoItemBase* iInfoItem;
+
+private: // Member data
+    CAknWaitDialog* iWaitNote;
+    CPeriodic* iWaitConstructionChecker;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMHEAP_H
+#define MEMSPYVIEWTHREADINFOITEMHEAP_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+
+class CMemSpyViewThreadInfoItemHeap : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_HEAP; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdHeap; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // Command handlers
+    void OnCmdHeapDataL();
+    void OnCmdHeapCellListingL();
+    void OnCmdHeapInfoL();
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemList.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMLIST_H
+#define MEMSPYVIEWTHREADINFOITEMLIST_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+
+// Classes referenced
+class CMemSpyProcess;
+class CMemSpyThread;
+class CMemSpyThreadInfoItemBase;
+
+
+class CMemSpyViewThreadInfoItemList : public CMemSpyViewBase, public MMemSpyThreadInfoContainerObserver
+    {
+public:
+    CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread );
+    ~CMemSpyViewThreadInfoItemList();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // API
+    const CMemSpyProcess& Process() const;
+    const CMemSpyThread& Thread() const;
+    const CMemSpyThreadInfoItemBase& CurrentInfoItem() const;
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_THREAD; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdThread; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // Command handlers
+    void OnCmdInfoHandlesL();
+
+private: // From MMemSpyThreadInfoContainerObserver
+    void HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType );
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
+    static TInt IdleUpdateListBoxModel( TAny* aSelf );
+    void DoIdleUpdateListBoxModelL();
+
+private: // Member data
+    CMemSpyThread& iThread;
+    CMemSpyThreadInfoItemBase* iCurrentInfoItem;
+    CPeriodic* iIdleResetListboxTimer;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemMemoryTracking.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,137 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMMEMORYTRACKING_H
+#define MEMSPYVIEWTHREADINFOITEMMEMORYTRACKING_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyengineprocessmemorytracker.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+// Classes referenced
+class CMemSpyEngineProcessMemoryTracker;
+
+
+class CMemSpyViewThreadInfoItemMemoryTracking : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
+    {
+public:
+    CMemSpyViewThreadInfoItemMemoryTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+    TInt IndexByViewType( TMemSpyViewType aType );
+    void HandleListBoxItemActionedL( TInt aIndex );
+    void RefreshL();
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_MEMORY_TRACKING; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdMemoryTracking; }
+
+private: // From MMemSpyEngineProcessMemoryTrackerObserver
+    void HandleMemoryTrackingStartedL();
+    void HandleMemoryTrackingStoppedL();
+    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
+
+private: // Command handlers
+    void OnCmdTrackingStartL();
+    void OnCmdTrackingStopL();
+    void OnCmdHWMResetL();
+    void OnCmdTotalWithSharedMemL();
+    void OnCmdTotalWithoutSharedMemL();
+    };
+
+
+class CMemSpyViewThreadInfoItemMemoryTrackingCurrent : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
+    {
+public:
+    CMemSpyViewThreadInfoItemMemoryTrackingCurrent( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    void RefreshL();
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineProcessMemoryTrackerObserver
+    void HandleMemoryTrackingStartedL() { }
+    void HandleMemoryTrackingStoppedL() { }
+    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
+    };
+
+
+
+class CMemSpyViewThreadInfoItemMemoryTrackingHWM : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
+    {
+public:
+    CMemSpyViewThreadInfoItemMemoryTrackingHWM( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    TBool HandleCommandL( TInt aCommand );
+    void RefreshL();
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineProcessMemoryTrackerObserver
+    void HandleMemoryTrackingStartedL() { }
+    void HandleMemoryTrackingStoppedL() { }
+    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_MEMORY_TRACKING_HWM; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdMemoryTrackingHWM; }
+
+private: // Command handlers
+    void OnCmdHWMResetL();
+    };
+    
+
+
+
+class CMemSpyViewThreadInfoItemMemoryTrackingPeak : public CMemSpyViewThreadInfoItemGeneric, public MMemSpyEngineProcessMemoryTrackerObserver
+    {
+public:
+    CMemSpyViewThreadInfoItemMemoryTrackingPeak( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    TBool HandleCommandL( TInt aCommand );
+    void RefreshL();
+    void SetListBoxModelL();
+
+private: // From MMemSpyEngineProcessMemoryTrackerObserver
+    void HandleMemoryTrackingStartedL() { }
+    void HandleMemoryTrackingStoppedL() { }
+    void HandleMemoryChangedL( const TProcessId& aPid, const TMemSpyDriverProcessInspectionInfo& aCurrentInfo, const TMemSpyDriverProcessInspectionInfo& aHWMInfoIncShared, const TMemSpyDriverProcessInspectionInfo& aHWMInfoExcShared );
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMSERVER_H
+#define MEMSPYVIEWTHREADINFOITEMSERVER_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+#include <badesca.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+// Classes referenced
+class TMemSpyDriverHandleInfoGeneric;
+
+
+
+class CMemSpyViewThreadInfoItemServer : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
+
+public: // From CMemSpyViewBase
+    CMemSpyViewBase* PrepareChildViewL();
+
+private: // Data members
+    TMemSpyDriverHandleInfoGeneric iCurrentInfoItemDetails;
+    };
+
+
+
+class CMemSpyViewThreadInfoItemServerDetails : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemServerDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails );
+
+public: // From CMemSpyViewBase
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareChildViewL();
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
+
+private: // Internal methods
+
+private: // Member data
+    const TMemSpyDriverHandleInfoGeneric iInfoItemDetails;
+    };
+
+
+
+class CMemSpyViewThreadInfoItemServerSessions : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemServerSessions( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails );
+
+public: // From CMemSpyViewBase
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+
+private: // Member data
+    const TMemSpyDriverHandleInfoGeneric iInfoItemDetails;
+    };
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADINFOITEMSTACK_H
+#define MEMSPYVIEWTHREADINFOITEMSTACK_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+
+class CMemSpyViewThreadInfoItemStack : public CMemSpyViewThreadInfoItemGeneric
+    {
+public:
+    CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer );
+
+public: // From CMemSpyViewBase
+    TBool HandleCommandL( TInt aCommand );
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_STACK; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdStack; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+private: // Command handlers
+    void OnCmdDeviceStackSummaryL();
+    void OnCmdStackInfoL();
+    void OnCmdStackDataUserL();
+    void OnCmdStackDataKernelL();
+    void OnCmdStackDataUserAllThreadsL();
+    void OnCmdStackDataKernelAllThreadsL();
+    void OnCmdStackWatchForHighWatermarkL();
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewThreads.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTHREADS_H
+#define MEMSPYVIEWTHREADS_H
+
+// System includes
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+#include <memspy/api/memspyapithread.h>
+
+// Classes referenced
+class CMemSpyProcess;
+class CMemSpyThread;
+class RMemSpySession;
+
+class CMemSpyViewThreads : public CMemSpyViewBase
+    {
+public:
+    //CMemSpyViewThreads( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
+	CMemSpyViewThreads( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aId );
+    ~CMemSpyViewThreads();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // API
+    //const CMemSpyProcess& Process() const;
+    //CMemSpyThread& CurrentThread();
+    TProcessId Process() const;
+    TThreadId CurrentThread();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_THREAD; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdThread; }
+    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
+
+public: // From CMemSpyViewBase
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+    TBool HandleCommandL( TInt aCommand );
+
+private: // Command handlers
+    void OnCmdEndKillL();
+    void OnCmdEndTerminateL();
+    void OnCmdEndPanicL();
+    void OnCmdSetPriorityL( TInt aCommand );
+    void OnCmdInfoHandlesL();
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    void HandleListBoxItemActionedL( TInt aCurrentIndex );
+    void HandleListBoxItemSelectedL( TInt aCurrentIndex );
+
+private: // Member data
+    //CMemSpyProcess& iParentProcess;
+    //CMemSpyThread* iCurrentThread;
+    TThreadId iCurrentThreadId;
+    TProcessId iParentProcessId;
+    
+    RArray<CMemSpyApiThread*> iThreads;
+    CDesCArrayFlat* iModel;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewType.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWTYPE_H
+#define MEMSPYVIEWTYPE_H
+
+// System includes
+#include <e32std.h>
+
+// Enumerations
+enum TMemSpyViewType
+    {
+    EMemSpyViewTypeNone = -1,
+    EMemSpyViewTypeMainMenu = 0,
+    EMemSpyViewTypeProcesses,
+    EMemSpyViewTypeRAMInfo,
+    EMemSpyViewTypeROMInfo,
+    EMemSpyViewTypeServerList,
+    EMemSpyViewTypeOpenFiles,
+    EMemSpyViewTypeFBServBitmaps,
+    EMemSpyViewTypeFBServBitmapInfo,
+    EMemSpyViewTypeFBServBitmapViewer,
+    EMemSpyViewTypeCodeSegmentList,
+    EMemSpyViewTypeCodeSegmentDetails,
+    EMemSpyViewTypeChunkList,
+    EMemSpyViewTypeChunkDetails,
+    EMemSpyViewTypeSystemConfig,
+    EMemSpyViewTypeKernel,
+    EMemSpyViewTypeKernelContainers,
+    EMemSpyViewTypeKernelObjects,
+    EMemSpyViewTypeKernelHeap,
+    EMemSpyViewTypeDriveSummary,
+    EMemSpyViewTypeDriveInfo,
+    EMemSpyViewTypeECom,
+    EMemSpyViewTypeEComCategory,
+    EMemSpyViewTypeEComInterface,
+    EMemSpyViewTypeEComImplementation,
+    EMemSpyViewTypeThreads,
+    EMemSpyViewTypeThreadInfoItemList,
+    EMemSpyViewTypeThreadInfoItemHeap,
+    EMemSpyViewTypeThreadInfoItemStack,
+    EMemSpyViewTypeThreadInfoItemChunk,
+    EMemSpyViewTypeThreadInfoItemCodeSeg,
+    EMemSpyViewTypeThreadInfoItemServer,
+    EMemSpyViewTypeThreadInfoItemServerDetails,
+    EMemSpyViewTypeThreadInfoItemServerSessions,
+    EMemSpyViewTypeThreadInfoItemSession,
+    EMemSpyViewTypeThreadInfoItemSemaphore,
+    EMemSpyViewTypeThreadInfoItemMutex,
+    EMemSpyViewTypeThreadInfoItemTimer,
+    EMemSpyViewTypeThreadInfoItemLDD,
+    EMemSpyViewTypeThreadInfoItemPDD,
+    EMemSpyViewTypeThreadInfoItemLogicalChannel,
+    EMemSpyViewTypeThreadInfoItemChangeNotifier,
+    EMemSpyViewTypeThreadInfoItemUndertaker,
+    EMemSpyViewTypeThreadInfoItemMessageQueue,
+    EMemSpyViewTypeThreadInfoItemConditionalVariable,
+    EMemSpyViewTypeThreadInfoItemOpenFiles,
+    EMemSpyViewTypeThreadInfoItemActiveObject,
+    EMemSpyViewTypeThreadInfoItemActiveObjectDetails,
+    EMemSpyViewTypeThreadInfoItemGeneralInfo,
+    EMemSpyViewTypeThreadInfoItemOtherThreads,
+    EMemSpyViewTypeThreadInfoItemOtherProcesses,
+    EMemSpyViewTypeThreadInfoItemOwnedThreadHandles,
+    EMemSpyViewTypeThreadInfoItemOwnedProcessHandles,
+    EMemSpyViewTypeHeapTracking,
+    EMemSpyViewTypeHeapTrackingSettings,
+    EMemSpyViewTypeHeapTrackingResults,
+    EMemSpyViewTypeHeapTrackingResultsCycleInfo,
+    EMemSpyViewTypeHeapTrackingResultsCycleChangeDescriptor,
+    EMemSpyViewTypeThreadInfoItemMemoryTracking,
+    EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig,
+    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatistics,
+    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent,
+    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM,
+    EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak,
+    EMemSpyViewTypeWindowGroups
+    };
+
+
+class MemSpyViewTypeUtils
+    {
+public:
+    static TBool IsOpenableItem( TMemSpyViewType aType );
+    static TBool IsThreadInfoItem( TMemSpyViewType aType );
+    static TBool IsExitableView( TMemSpyViewType aType );
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/MemSpyViewWindowGroups.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef MEMSPYVIEWWINDOWGROUPS_H
+#define MEMSPYVIEWWINDOWGROUPS_H
+
+// System includes
+#include <hal.h>
+#include <coecntrl.h>
+#include <aknlists.h>
+
+// Engine includes
+#include <memspy/engine/memspyenginehelperwindowserver.h>
+
+// User includes
+#include "MemSpyViewBase.h"
+
+// Classes referenced
+
+
+class CMemSpyViewWindowGroups : public CMemSpyViewBase
+    {
+public:
+    CMemSpyViewWindowGroups( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
+    ~CMemSpyViewWindowGroups();
+    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
+
+public: // From CMemSpyViewBase
+    CEikListBox* ConstructListBoxL();
+    void RefreshL();
+    TMemSpyViewType ViewType() const;
+    CMemSpyViewBase* PrepareParentViewL();
+    CMemSpyViewBase* PrepareChildViewL();
+
+public: // Menu framework
+    TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_WINDOW_GROUPS; }
+    TInt MenuCascadeCommandId() const { return EMemSpyCmdWindowGroups; }
+
+private: // From CMemSpyViewBase
+    void SetListBoxModelL();
+    TBool HandleCommandL( TInt aCommand );
+
+private: // Command handlers
+    void OnCmdSwitchToL();
+    void OnCmdEndL( TInt aCommand );
+
+private: // Internal methods
+    void DetailsL();
+    void AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... );
+
+private: // Data members
+    MMemSpyEngineWindowGroupList* iWindowGroupList;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/inc/viewcli.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,166 @@
+// 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 "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:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef __VIEWCLI_H__
+#define __VIEWCLI_H__
+
+#include <e32base.h>
+#include <gdi.h>
+#include <vwsdef.h>
+
+//
+// Forward declarations.
+//
+
+class RVwsSession;
+class CVwsSessionEventHandler;
+class MVwsAppStarter;
+
+class MVwsSessionWrapperObserver
+/**
+The MVwsSessionObserver specifies an interface through which server events to be handled by the owner of
+a client session are notified
+
+@publishedAll 
+@deprecated
+*/
+//@internalTechnology @released
+
+	{
+public:	
+
+	/**
+	 * Handles the view event aEvent for a view added through the client session being observed.
+	 * Handles events for all the views added by the client.
+	 */
+	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
+	};
+
+
+class CVwsSessionWrapper : public CBase
+/**
+The CVwsSessionWrapper class mediates access to the view server client session which it creates, and wraps in
+support for notification of server events. A session observer will be called back with server events if
+it maintains an outstanding request for asynchronous event notification.
+
+@publishedPartner 
+@released 
+*/
+//@internalTechnology @released
+
+	{
+public:	
+	IMPORT_C static CVwsSessionWrapper* NewL();
+	IMPORT_C static CVwsSessionWrapper* NewLC();
+	IMPORT_C static CVwsSessionWrapper* NewL(MVwsSessionWrapperObserver& aObserver);
+	IMPORT_C static CVwsSessionWrapper* NewLC(MVwsSessionWrapperObserver& aObserver);
+	IMPORT_C ~CVwsSessionWrapper();
+	IMPORT_C static TInt StartViewServer(MVwsAppStarter& aAppStarter);
+	IMPORT_C TInt ShutdownViewServer();
+	IMPORT_C TInt AddView(const TVwsViewId& aViewId);
+	IMPORT_C TInt RemoveView(const TVwsViewId& aViewId) const;
+	IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId,TInt aMode);
+	IMPORT_C TInt SetSystemDefaultView(const TVwsViewId& aViewId);
+	IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
+	IMPORT_C TInt ActivateViewViaViewEvent(const TVwsViewIdAndMessage& aViewIdAndMessage);
+	IMPORT_C TInt RequestCustomMessage(TDes8& aMessageBufPtr) const;
+	IMPORT_C void QueueAsyncRequest();
+	IMPORT_C TInt StartApp(TUid aAppToStart);
+	IMPORT_C TInt DeactivateActiveView();
+	IMPORT_C TInt DeactivateActiveViewIfOwnerMatch();
+	IMPORT_C TInt NotifyNextDeactivation(const TVwsViewId& aViewId);
+	IMPORT_C TInt NotifyNextDeactivation();
+	IMPORT_C TInt NotifyNextActivation(const TVwsViewId& aViewId);
+	IMPORT_C TInt NotifyNextActivation();
+	IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId,TInt aMode) const;
+	IMPORT_C TInt SetDefaultView(const TVwsViewId& aViewId) const;
+	IMPORT_C TInt GetSystemDefaultView(TVwsViewId& aViewId);
+	IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
+	IMPORT_C TInt SetClientRequestTimeOut(TTimeIntervalMicroSeconds32 aDuration);
+	IMPORT_C TInt SetServerEventTimeOut(TTimeIntervalMicroSeconds32 aDuration);
+	IMPORT_C TInt EnableServerEventTimeOut(TBool aEnable);
+	IMPORT_C TInt CheckSourceOfViewSwitch(TBool& aResult,const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic);
+	IMPORT_C TInt EnableServerBlankScreen(TBool aEnable);
+	IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
+	IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus);
+	IMPORT_C TInt SetCrossCheckUid(const TUid& aCrossCheckUid);
+	IMPORT_C TInt SetWindowBackgroundColor(const TRgb& aBgColor);
+public:	
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C TInt ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C void ActivateView(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TRequestStatus& aStatus, TInt aCustomControl);
+	/**
+	@internalComponent
+	@released
+	*/IMPORT_C TInt CreateActivateViewEvent(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage, TInt aCustomControl);
+	/**
+	@internalComponent
+	@released
+	*/
+	IMPORT_C TInt GetCurrentActiveViewInSystem(TVwsViewId& aActiveViewId);
+private:
+	CVwsSessionWrapper();
+	CVwsSessionWrapper(MVwsSessionWrapperObserver& aObserver);
+	void ConstructL();
+	TInt CheckCreateViewServerSession();
+	TBool IsSchedulerRunning();
+private:
+	RVwsSession* iVwsSession;
+	CVwsSessionEventHandler* iViewEventHandler;
+	MVwsSessionWrapperObserver* iObserver;
+	};
+
+
+//
+// Panic.
+//
+/**
+@internalComponent
+*/
+enum TVwsPanic
+	{
+	EVwsCreateScheduler=1,
+	EVwsThreadRename
+	};
+
+/**
+@internalComponent
+*/
+GLREF_C void Panic(TVwsPanic aPanic);
+
+/**
+Server thread start.
+
+@internalComponent
+*/
+GLDEF_C TInt ViewServerThreadStart(TAny* aPtr);
+
+/**
+@internalComponent
+*/
+struct SVwsCommandLine
+	{
+	MVwsAppStarter* iAppStarter;
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyApp.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyApp.h"
+
+// System includes
+#include <eikstart.h>
+
+// User includes
+#include "MemSpyDocument.h"
+
+
+
+TUid CMemSpyApp::AppDllUid() const
+    {
+    return KUidMemSpy;
+    }
+
+
+CApaDocument* CMemSpyApp::CreateDocumentL()
+    {
+    return CMemSpyDocument::NewL( *this );
+    }
+
+
+EXPORT_C CApaApplication* NewApplication()
+    {
+    return new CMemSpyApp;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyAppUi.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,755 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyAppUi.h"
+
+// System includes
+#include <AknQueryDialog.h>
+#include <aknmessagequerydialog.h> 
+#include <aknradiobuttonsettingpage.h>
+#include <eikaufty.h>
+#include <eikmenub.h>
+#include <avkon.hrh>
+#include <barsread.h>
+#include <f32file.h>
+#include <apgtask.h>
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineoutputsink.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyenginehelperchunk.h>
+#include <memspy/engine/memspyenginehelperthread.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperkernelcontainers.h>
+#include <memspy/engine/memspyenginehelperfbserv.h>
+#include <memspyengineclientinterface.h>
+#include <memspy/driver/memspydriverenumerationsshared.h>
+#include <memspy/engine/memspyenginehelperkernelcontainers.h>
+//cigasto
+#include <memspysession.h>
+
+// User includes
+#include "MemSpyContainer.h"
+#include "MemSpyDocument.h"
+#include "MemSpySettings.h"
+#include "MemSpyDeviceWideOperationDialog.h"
+#include "MemSpyViewRAMInfo.h" // for aknicon config check
+#include "MemSpyExportBitmapsToMemoryCardDialog.h"
+#include "MemSpy.hrh"
+#include "viewcli.h"
+
+// Constants
+const TInt KMemSpyDefaultAutoCaptureTimerPeriod = 60;
+const TUint32 KMemSpyEikSrvSID = 0x10003a4a;
+
+/*
+CMemSpyAppUi::CMemSpyAppUi( CMemSpyEngine& aEngine )
+:   iEngine( aEngine ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo )
+    {
+    iEngine.SetObserver( this );
+    }
+*/
+CMemSpyAppUi::CMemSpyAppUi( RMemSpySession &aSession )
+:   iMemSpySession( aSession ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo )
+    {
+    //iEngine.SetObserver( this );
+    }
+
+CMemSpyAppUi::~CMemSpyAppUi()
+    {
+    RDebug::Printf( "[MemSpy] MemSpy is now closing." );
+    //
+    delete iAutoCaptureTimer;
+    //
+    if (iAppContainer)
+        {
+        RemoveFromStack( iAppContainer );
+        delete iAppContainer;
+        }
+    //
+    //iEngine.SetObserver( NULL );
+    SetViewServerTimeOutStatus( ETrue );
+    }
+
+
+void CMemSpyAppUi::ConstructL()
+    {
+    BaseConstructL( EAknEnableSkin );
+    //
+    //iAppContainer = new (ELeave) CMemSpyContainer( iEngine, *this );
+    iAppContainer = new (ELeave) CMemSpyContainer( iMemSpySession, *this );
+    iAppContainer->SetMopParent(this);
+    iAppContainer->ConstructL( ClientRect() );
+    iAppContainer->SetObserver( this );
+    iAppContainer->SetFocus( ETrue );
+    AddToStackL( iAppContainer );
+    //
+    iAutoCaptureTimer = CPeriodic::NewL( CActive::EPriorityIdle );
+	//
+	iEikonEnv->SetSystem( ETrue );
+    //
+    SetViewServerTimeOutStatus( EFalse );
+    }
+
+
+CMemSpyDocument& CMemSpyAppUi::MemSpyDocument()
+    {
+	CMemSpyDocument* doc = static_cast< CMemSpyDocument* >( Document() );
+    return *doc;
+    }
+
+
+const CMemSpyDocument& CMemSpyAppUi::MemSpyDocument() const
+    {
+	const CMemSpyDocument* doc = static_cast< const CMemSpyDocument* >( Document() );
+    return *doc;
+    }
+
+
+void CMemSpyAppUi::HandleStatusPaneSizeChange()
+	{
+	iAppContainer->SetRect( ClientRect() );
+	} 
+
+
+void CMemSpyAppUi::HandleControlEventL( CCoeControl* aControl, TCoeEvent /*aEventType*/ )
+    {
+    if  ( aControl == iAppContainer )
+        {
+        UpdateCBAL();
+        }
+    }
+
+
+void CMemSpyAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    CMemSpyViewBase& view = iAppContainer->ActiveView();
+    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
+    //
+    const TBool openableView = MemSpyViewTypeUtils::IsOpenableItem( viewType );
+    const TBool exitable = MemSpyViewTypeUtils::IsExitableView( viewType );
+    //
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - START - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
+#endif
+    //
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        const TInt count = aMenuPane->NumberOfItemsInPane();
+        for( TInt i=0; i<count; i++ )
+            {
+            TBool dimItem = EFalse;
+            CEikMenuPaneItem::SData& menuPaneMetaData = aMenuPane->ItemDataByIndexL( i );
+
+            // If the command is inside the view-specific range then we'll hide it
+            // unless the view and command id matches.
+            const TBool isViewSpecific = ( menuPaneMetaData.iCommandId >= KMemSpyMenuCommandViewSpecific );
+            if  ( isViewSpecific )
+                {
+                // Check whether this view requires this command item.
+                dimItem = ( view.MenuCascadeCommandId() != menuPaneMetaData.iCommandId );
+                }
+
+            aMenuPane->SetItemDimmed( menuPaneMetaData.iCommandId, dimItem );
+            }
+
+        aMenuPane->SetItemDimmed( EMemSpyCmdOpen, !openableView );
+        aMenuPane->SetItemDimmed( EAknSoftkeyBack, exitable );
+        aMenuPane->SetItemDimmed( EAknCmdExit, !exitable );
+        }
+    else if ( aResourceId == R_MEMSPY_MENUPANE_TOOLS )
+        {
+        const TBool inOpenFilesView = ( viewType == EMemSpyViewTypeOpenFiles );
+        aMenuPane->SetItemDimmed( EMemSpyCmdToolsListOpenFiles, !inOpenFilesView );
+        }
+    else if ( aResourceId == R_MEMSPY_MENUPANE_VIEW )
+        {
+        // Hide the refresh item when in the thread info container view
+        aMenuPane->SetItemDimmed( EMemSpyCmdViewRefresh, viewType == EMemSpyViewTypeThreadInfoItemList );
+        aMenuPane->SetItemDimmed( EMemSpyCmdViewOutputToSink, viewType == EMemSpyViewTypeThreadInfoItemList );
+        }
+    else if ( aResourceId == R_MEMSPY_MENUPANE_OUTPUT )
+        {
+		/* TODO
+        //const TMemSpySinkType currentSink = iEngine.SinkType();		
+		const TMemSpySinkType currentSink = iMemSpySession.GetSinkType();
+        aMenuPane->SetItemDimmed( EMemSpyCmdOutputToDebug, currentSink == ESinkTypeDebug );
+        aMenuPane->SetItemDimmed( EMemSpyCmdOutputToFile, currentSink == ESinkTypeFile );
+        */        
+        }
+    else if ( aResourceId == R_MEMSPY_MENUPANE_AUTO_CAPTURE )
+        {
+        // Change the auto-capture toggle caption appropriately...
+        TInt resId = R_MEMSPY_AUTO_CAPTURE_ENABLE;
+        if  ( iAutoCaptureTimer->IsActive() )
+            {
+            resId = R_MEMSPY_AUTO_CAPTURE_DISABLE;
+            }
+        aMenuPane->SetItemTextL( EMemSpyCmdAutoCaptureToggle, resId );
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - sending to view..." );
+#endif
+
+    view.DynInitMenuPaneL( aResourceId, aMenuPane );
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - END - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable );
+#endif
+    }
+
+
+TKeyResponse CMemSpyAppUi::HandleKeyEventL( const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
+    {
+    return EKeyWasNotConsumed;
+    }
+
+
+void CMemSpyAppUi::HandleCommandL( TInt aCommand )
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - START - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+
+    switch ( aCommand )
+        {
+    case EAknSoftkeyBack:
+        OnCmdBackL();
+        break;
+
+    case EEikCmdExit:
+    case EAknCmdExit:
+    case EAknSoftkeyExit:
+        OnCmdExitL();
+        break;
+
+    case EMemSpyCmdOpen:
+        OnCmdOpenL();
+        break;
+
+    case EMemSpyCmdOutputToDebug:
+        OnCmdOutputToDebugL();
+		break;
+    case EMemSpyCmdOutputToFile:
+        OnCmdOutputToFileL();
+		break;
+
+    case EMemSpyCmdToolsAbout:
+        OnCmdAboutL();
+        break;
+    //
+    case EMemSpyCmdPhoneInfoGeneralSummary:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralSummary );
+        break;
+    case EMemSpyCmdPhoneInfoGeneralDetailed:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralDetailed );
+        break;
+    case EMemSpyCmdPhoneInfoGeneralHandles:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralHandles );
+        break;
+    case EMemSpyCmdPhoneInfoGeneralKernelContainers:
+        OnCmdPhoneInformationOperationKernelContainersL();
+        break;
+    //
+    case EMemSpyCmdPhoneInfoHeapInfoSummary:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapInfo );
+        break;
+    case EMemSpyCmdPhoneInfoHeapInfoCompact:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceHeapInfoCompact );
+        break;
+    case EMemSpyCmdPhoneInfoHeapCellListing:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapCellListing );
+        break;
+    case EMemSpyCmdPhoneInfoHeapDump:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapData );
+        break;
+    //
+    case EMemSpyCmdPhoneInfoStackInfo:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackInfo );
+        break;
+    case EMemSpyCmdPhoneInfoStackInfoCompact:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceStackInfoCompact );
+        break;
+    case EMemSpyCmdPhoneInfoStackDumpUser:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataUser );
+        break;
+    case EMemSpyCmdPhoneInfoStackDumpKernel:
+        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataKernel );
+        break;
+
+    case EMemSpyCmdAutoCaptureToggle:
+        OnCmdAutoCaptureToggleL();
+        break;
+    case EMemSpyCmdAutoCaptureRetryTime:
+        OnCmdAutoCaptureRetryTimeL();
+        break;
+    case EMemSpyCmdAutoCaptureOperationType:
+        OnCmdAutoCaptureOperationTypeL();
+        break;
+
+    default:
+        iAppContainer->HandleCommandL( aCommand );
+        break;
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - END - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+void CMemSpyAppUi::HandleForegroundEventL( TBool aForeground)
+    {
+    // Refresh the container when coming to the foreground
+    if  ( aForeground )
+        {
+        iAppContainer->OnCmdViewRefreshL();
+        }
+    }
+
+
+void CMemSpyAppUi::HandleThreadSelectedL( const CMemSpyThread& /*aThread*/ )
+    {
+	MEikAppUiFactory* appUiFactory = (iEikonEnv)->AppUiFactory();
+    appUiFactory->MenuBar()->TryDisplayMenuBarL();
+    }
+
+
+void CMemSpyAppUi::HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext )
+    {
+    if  ( aEvent == MMemSpyEngineObserver::EHandleThreadsOrProcessesChanged )
+        {
+        // Get the original container
+        const CMemSpyEngineObjectContainer& oldContainer = *reinterpret_cast< CMemSpyEngineObjectContainer* >( aContext );
+        (void) oldContainer;
+
+        // Refresh the container
+        iAppContainer->OnCmdViewRefreshL();
+        }
+    else if ( aEvent == MMemSpyEngineObserver::EHandleClientServerOperationRequest )
+        {
+        const TInt function = reinterpret_cast<TInt>( aContext );
+        InitiateMemSpyClientServerOperationL( function );
+        }
+    }
+
+
+void CMemSpyAppUi::DWOperationStarted()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+
+    iRunningDeviceWideOperation = ETrue;
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+void CMemSpyAppUi::DWOperationCancelled()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+
+    iAutoCaptureTimer->Cancel();
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+void CMemSpyAppUi::DWOperationCompleted()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+
+    iRunningDeviceWideOperation = EFalse;
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - END - iAutoCaptureTimer is active: %d", iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+void CMemSpyAppUi::UpdateCBAL()
+    {
+    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
+    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
+    //
+    if  ( MemSpyViewTypeUtils::IsExitableView( viewType ) )
+        {
+        cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
+        }
+    else
+        {
+        cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+        }
+
+    cba->MakeVisible( ETrue );
+    cba->DrawNow();
+    }
+
+
+void CMemSpyAppUi::InitiateMemSpyClientServerOperationL( TInt aOpCode )
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - START - aOpCode: %d", aOpCode );
+#endif
+
+    switch( aOpCode )
+        {
+    case EMemSpyClientServerOpSummaryInfo:
+        HandleCommandL( EMemSpyCmdPhoneInfoGeneralSummary );
+        break;
+    case EMemSpyClientServerOpSummaryInfoDetailed:
+        HandleCommandL( EMemSpyCmdPhoneInfoGeneralDetailed );
+        break;
+    //
+    case EMemSpyClientServerOpHeapInfo:
+        HandleCommandL( EMemSpyCmdPhoneInfoHeapInfoSummary );
+        break;
+    case EMemSpyClientServerOpHeapCellListing:
+        HandleCommandL( EMemSpyCmdPhoneInfoHeapCellListing );
+        break;
+    case EMemSpyClientServerOpHeapData:
+        HandleCommandL( EMemSpyCmdPhoneInfoHeapDump );
+        break;
+    //
+    case EMemSpyClientServerOpStackInfo:
+        HandleCommandL( EMemSpyCmdPhoneInfoStackInfo );
+        break;
+    case EMemSpyClientServerOpStackDataUser:
+        HandleCommandL( EMemSpyCmdPhoneInfoStackDumpUser );
+        break;
+    case EMemSpyClientServerOpStackDataKernel:
+        HandleCommandL( EMemSpyCmdPhoneInfoStackDumpKernel );
+        break;
+    //
+    case EMemSpyClientServerOpBitmapsSave:
+        OnCmdToolsBitmapsSaveToMemoryCardL();
+        break;
+    case EMemSpyClientServerOpSendToBackground:
+        OnCmdToolsSendToBackgroundL();
+        break;
+    case EMemSpyClientServerOpBringToForeground:
+        OnCmdToolsBringToForegroundL();
+        break;
+    case EMemSpyClientServerOpExit:
+        OnCmdExitL();
+        break;
+    //
+    default:
+        User::Leave( KErrNotSupported );
+        break;
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - END - aOpCode: %d", aOpCode );
+#endif
+    }
+
+
+void CMemSpyAppUi::SetViewServerTimeOutStatus( TBool aEnabled )
+    {
+	/* TODO
+	iMemSpySession.SetServerTimeOutStatus( KMemSpyEikSrvSID, aEnabled );
+	*/
+	/*
+    TRAP_IGNORE(
+        iEngine.HelperProcess().ImpersonateL( KMemSpyEikSrvSID );
+        //
+        CVwsSessionWrapper* ses = CVwsSessionWrapper::NewLC();
+        ses->EnableServerEventTimeOut( aEnabled );
+        CleanupStack::PopAndDestroy( ses );
+        //
+        iEngine.HelperProcess().ImpersonateL( 0 );
+        );
+    */	
+    }
+
+
+void CMemSpyAppUi::OnCmdBackL()
+    {
+    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
+    //
+    if  ( !MemSpyViewTypeUtils::IsExitableView( viewType ) )
+        {
+        // Should go back one view
+        iAppContainer->NavigateToParentViewL();
+        }
+    }
+
+
+void CMemSpyAppUi::OnCmdExitL()
+    {
+    Exit();
+    }
+
+
+void CMemSpyAppUi::OnCmdOpenL()
+    {
+    const TMemSpyViewType viewType = iAppContainer->ActiveViewType();
+    //
+    if  ( !MemSpyViewTypeUtils::IsOpenableItem( viewType ) )
+        {
+        // Should go back one view
+        iAppContainer->NavigateToChildViewL();
+        }
+    }
+
+
+void CMemSpyAppUi::OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::TOperation aOp )
+    {	/* TODO
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - START - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif
+
+    if  ( !iRunningDeviceWideOperation )
+        {
+        //CMemSpyDeviceWideOperationDialog::ExecuteLD( iEngine, *this, aOp );
+		CMemSpyDeviceWideOperationDialog::ExecuteLD( iMemSpySession, *this, aOp );
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - END - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() );
+#endif*/
+    }
+
+
+void CMemSpyAppUi::OnCmdPhoneInformationOperationKernelContainersL()
+    {
+	/* TODO
+	iMemSpySession.OutputKernelObjects();
+	*/
+	/*
+    CMemSpyEngineGenericKernelObjectContainer* list = iEngine.HelperKernelContainers().ObjectsAllL();
+    CleanupStack::PushL( list );
+    iEngine.HelperKernelContainers().OutputL( *list );
+    CleanupStack::PopAndDestroy( list );
+    */	
+    }
+
+
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+
+
+void CMemSpyAppUi::OnCmdAutoCaptureToggleL()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+
+    if  ( iAutoCaptureTimer->IsActive() )
+        {
+        iAutoCaptureTimer->Cancel();
+        }
+    else
+        {
+        iAutoCaptureTimer->Cancel();
+        //
+        const TTimeIntervalMicroSeconds32 interval( iAutoCaptureTimerPeriod * 1000000 );
+        iAutoCaptureTimer->Start( 0, interval, TCallBack(AutoCaptureCallBack, this) );
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+void CMemSpyAppUi::OnCmdAutoCaptureRetryTimeL()
+    {
+    CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( iAutoCaptureTimerPeriod );
+    dialog->ExecuteLD( R_MEMSPY_DEVICE_WIDE_SETTINGS );
+    }
+
+
+void CMemSpyAppUi::OnCmdAutoCaptureOperationTypeL()
+    {
+    CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES );
+    CleanupStack::PushL(items);
+    //
+    TInt currentItem = iAutoCaptureOperationType;
+    //
+    CAknRadioButtonSettingPage* dialog = new(ELeave) CAknRadioButtonSettingPage( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES_SETTINGS_PAGE, currentItem, items );
+    if  ( dialog->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
+        {
+        iAutoCaptureOperationType = static_cast< CMemSpyDeviceWideOperations::TOperation >( currentItem );
+        }
+    //
+    CleanupStack::PopAndDestroy( items ); 
+    }
+
+
+TInt CMemSpyAppUi::AutoCaptureCallBack( TAny* aSelf )
+    {
+    CMemSpyAppUi* self = reinterpret_cast< CMemSpyAppUi* >( aSelf );
+    TRAPD( err, self->AutoCaptureCallBackL() );
+    //
+    const TBool callMeBackAgain = ( err == KErrNone );
+    return callMeBackAgain;
+    }
+
+
+void CMemSpyAppUi::AutoCaptureCallBackL()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+
+    OnCmdPhoneInformationOperationL( iAutoCaptureOperationType );
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - END - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() );
+#endif
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+void CMemSpyAppUi::OnCmdOutputToDebugL()
+    {
+	/* TODO
+	iMemSpyAPI.OutputToDebug();
+	*/
+	/*
+    iEngine.InstallSinkL( ESinkTypeDebug );
+    MemSpyDocument().Settings().StoreSettingsL();
+    */
+    }
+
+
+void CMemSpyAppUi::OnCmdOutputToFileL()
+    {
+	/* TODO
+	iMemSpyAPI.OutputToFile();
+	*/
+	/*
+    iEngine.InstallSinkL( ESinkTypeFile );
+    MemSpyDocument().Settings().StoreSettingsL();
+    */
+    }
+
+
+
+
+
+
+
+
+
+
+
+void CMemSpyAppUi::OnCmdAboutL()
+    {
+    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+    dialog->ExecuteLD( R_MEMSPYUI_ABOUT_DIALOG );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+void CMemSpyAppUi::OnCmdToolsBitmapsSaveToMemoryCardL()
+    {
+	/* TODO
+    // Get bitmap handles
+    RArray<TInt> handles;
+    CleanupClosePushL( handles );
+    iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( handles );
+
+    // Build bitmap list
+    CMemSpyEngineFbServBitmapArray* array = CMemSpyEngineFbServBitmapArray::NewL( handles );
+    CleanupStack::PopAndDestroy( &handles );
+    CleanupStack::PushL( array );
+
+    // Export...
+    CMemSpyExportBitmapsToMemoryCardDialog* dialog = CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *array );
+    
+    // All done
+    CleanupStack::PopAndDestroy( array );
+    */
+    }
+
+
+void CMemSpyAppUi::OnCmdToolsSendToBackgroundL()
+    {
+    TApaTask task( iCoeEnv->WsSession() );
+    task.SendToBackground();
+    }
+
+
+void CMemSpyAppUi::OnCmdToolsBringToForegroundL()
+    {
+    iCoeEnv->BringOwnerToFront();
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,227 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyContainer.h"
+
+// System includes
+#include <eikrted.h>  // for example label control
+#include <txtrich.h>
+#include <apgtask.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+
+// User includes
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+/*
+CMemSpyContainer::CMemSpyContainer( CMemSpyEngine& aEngine, MMemSpyContainerObserver& aObserver  )
+:   iEngine( aEngine ), iObserver( aObserver )
+    {
+    }
+*/
+CMemSpyContainer::CMemSpyContainer( RMemSpySession& aSession, MMemSpyContainerObserver& aObserver  )
+:   iMemSpySession( aSession ), iObserver( aObserver )
+    {
+    }
+
+CMemSpyContainer::~CMemSpyContainer()
+    {
+    delete iPreviousView;
+    delete iActiveView;
+    }
+
+
+void CMemSpyContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+    SetRect(aRect);
+    PrepareTopLevelViewL();
+    ActivateL();
+    }
+
+
+void CMemSpyContainer::NavigateToParentViewL()
+    {
+    CMemSpyViewBase* parentView = iActiveView->PrepareParentViewL();
+    //
+    if  ( parentView == NULL )
+        {
+        // Parent can be null, in which case, revert to top-level view
+        PrepareTopLevelViewL();
+        }
+    else
+        {
+        SetNewActiveViewL( parentView );
+        }
+    }
+
+
+void CMemSpyContainer::NavigateToChildViewL()
+    {
+    CMemSpyViewBase* childView = iActiveView->PrepareChildViewL();
+    //
+    if  ( childView != NULL )
+        {
+        SetNewActiveViewL( childView );
+        }
+    }
+
+
+void CMemSpyContainer::HandleCommandL( TInt aCommand )
+    {
+    switch( aCommand )
+        {
+	case EMemSpyCmdViewRefresh:
+        OnCmdViewRefreshL();
+        break;
+    default:
+        if  ( iActiveView )
+            {
+            iActiveView->HandleCommandL( aCommand );
+            }
+        break;
+        }
+    }
+
+
+void CMemSpyContainer::OnCmdViewRefreshL()
+    {
+    if  ( iActiveView )
+        {
+        TRAPD(err, iActiveView->RefreshL());
+        if  ( err != KErrNone )
+            {
+            // Error during view refreshing (perhaps the thread doesn't exist anymore).
+            // Try to replace the active view with its parent...
+            NavigateToParentViewL();
+            }
+        }
+    }
+
+
+void CMemSpyContainer::SizeChanged()
+    {
+    if  ( iActiveView )
+        {
+        iActiveView->SetRect( Rect() );
+        }
+    }
+
+
+TInt CMemSpyContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+
+CCoeControl* CMemSpyContainer::ComponentControl(TInt /*aIndex*/) const
+    {
+    return iActiveView;
+    }
+
+
+void CMemSpyContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    //
+    gc.SetPenStyle(CGraphicsContext::ENullPen);
+    gc.SetBrushColor(KRgbGray);
+    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+    gc.DrawRect(aRect);
+    }
+
+
+TKeyResponse CMemSpyContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    TKeyResponse response = EKeyWasNotConsumed;
+    //
+    if  ( iActiveView )
+        {
+        response = iActiveView->OfferKeyEventL( aKeyEvent, aType );
+        }
+    //
+    return response;
+    }
+
+
+void CMemSpyContainer::HandleMemSpyViewEventL( TViewEventType aEvent, TMemSpyViewType /*aViewType*/, CMemSpyViewBase& aReportingView, TAny* /*aContext*/ )
+    {
+    if  ( aEvent == EEventItemActioned )
+        {
+        // Get the view to generate a child
+        CMemSpyViewBase* child = aReportingView.PrepareChildViewL();
+        if  ( child == NULL )
+            {
+            // View doesn't have a child - treat it as item activation and
+            // report event to observer.
+
+            }
+        else
+            {
+            // Child view becomes the active one
+            SetNewActiveViewL( child );
+            }
+        }
+    }
+
+
+CMemSpyViewBase* CMemSpyContainer::PrepareTopLevelViewL()
+    {
+    //CMemSpyViewMainMenu* view = new(ELeave) CMemSpyViewMainMenu( iEngine, *this );
+	CMemSpyViewMainMenu* view = new(ELeave) CMemSpyViewMainMenu( iMemSpySession, *this );
+    CleanupStack::PushL( view );
+    view->ConstructL( Rect(), *this );
+    SetNewActiveViewL( view );
+    CleanupStack::Pop( view );
+    return view;
+    }
+
+
+void CMemSpyContainer::SetNewActiveViewL( CMemSpyViewBase* aNewView )
+    {
+    delete iPreviousView;
+    //
+    iPreviousView = iActiveView;
+    if  ( iPreviousView )
+        {
+        iPreviousView->MakeVisible( EFalse );
+        iPreviousView->SetFocus( EFalse );
+        }
+    //
+    iActiveView = aNewView;
+    iActiveView->RefreshL();
+    iActiveView->SetFocus( ETrue );
+    //
+    ReportEventL( MCoeControlObserver::EEventStateChanged );
+    }
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,197 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyDeviceWideOperationDialog.h"
+
+// System includes
+#include <eikprogi.h>
+#include <AknWaitDialog.h>
+#include <AknQueryDialog.h>
+#include <coemain.h>
+#include <eikenv.h>
+#include <avkon.hrh>
+#include <memspyui.rsg>
+
+
+CMemSpyDeviceWideOperationDialog::CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver )
+:   iEngine( aEngine ), iObserver( aObserver )
+    {
+    }
+
+
+CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog()
+    {
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - START - iForcedCancel: %d", iForcedCancel );
+#endif
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - deleting operation...: 0x%08x", iOperation );
+#endif
+    delete iOperation;
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - deleting dialog...: 0x%08x", iProgressDialog );
+#endif
+    iProgressInfo = NULL;
+    delete iProgressDialog;
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - sending EDialogDismissed to observer..." );
+#endif
+
+    iObserver.DWOperationCompleted();
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - END" );
+#endif
+    }
+
+
+void CMemSpyDeviceWideOperationDialog::ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - START" );
+#endif
+
+    iOperation = CMemSpyDeviceWideOperations::NewL( iEngine, *this, aOperation );
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - constructed operation..." );
+#endif
+
+    ASSERT( iProgressDialog == NULL );
+    iProgressDialog = new( ELeave ) CAknProgressDialog( reinterpret_cast< CEikDialog** >( &iProgressDialog ), ETrue );
+    iProgressDialog->PrepareLC( R_MEMSPY_DEVICE_WIDE_OPERATION_PROGRESS_DIALOG );
+    iProgressDialog->SetCallback( this );
+    iProgressDialog->SetGloballyCapturing( ETrue );
+    //
+    iProgressInfo = iProgressDialog->GetProgressInfoL();
+    iProgressInfo->SetFinalValue( iOperation->TotalOperationSize() );
+    //
+    iProgressDialog->RunLD();
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::ExecuteL() - END" );
+#endif
+    }
+
+void CMemSpyDeviceWideOperationDialog::ExecuteLD( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation )
+    {
+    CMemSpyDeviceWideOperationDialog* self = new(ELeave) CMemSpyDeviceWideOperationDialog( aEngine, aObserver );
+    CleanupStack::PushL( self );
+    self->ExecuteL( aOperation );
+    CleanupStack::PopAndDestroy( self );
+    }
+
+
+void CMemSpyDeviceWideOperationDialog::Cancel()
+    {
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::Cancel() - START - iOperation: 0x%08x, iForcedCancel: %d", iOperation, iForcedCancel );
+#endif
+
+    iForcedCancel = ETrue;
+    //
+    if  ( iOperation )
+        {
+        iOperation->Cancel();
+        }
+    //
+    iObserver.DWOperationCancelled();
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::Cancel() - END" );
+#endif
+    }
+
+
+void CMemSpyDeviceWideOperationDialog::DialogDismissedL( TInt aButtonId )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::DialogDismissedL() - START - aButtonId: %d, iForcedCancel: %d", aButtonId, iForcedCancel );
+#else
+    (void) aButtonId;
+#endif
+
+    Cancel();
+
+#ifdef _DEBUG
+    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::DialogDismissedL() - END - aButtonId: %d, iForcedCancel: %d", aButtonId, iForcedCancel );
+#endif
+    }
+
+
+void CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent( TEvent aEvent, TInt aParam1, const TDesC& aParam2 )
+    {
+#ifdef _DEBUG
+    RDebug::Print( _L("[MemSpy] CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent() - START - aEvent: %d, iProgressDialog: 0x%08x, aParam1: %d, aParam2: %S"), aEvent, iProgressDialog, aParam1, &aParam2 );
+#endif
+
+    switch( aEvent )
+        {
+    case MMemSpyDeviceWideOperationsObserver::EOperationSized:
+        break;
+    case MMemSpyDeviceWideOperationsObserver::EOperationStarting:
+        iObserver.DWOperationStarted();
+        break;
+    case MMemSpyDeviceWideOperationsObserver::EOperationProgressStart:
+        ASSERT( iProgressDialog != NULL );
+        SetDialogCaptionL( aParam2 );
+        break;
+    case MMemSpyDeviceWideOperationsObserver::EOperationProgressEnd:
+        ASSERT( iProgressDialog != NULL );
+        iProgressInfo->IncrementAndDraw( aParam1 );
+        break;
+    case MMemSpyDeviceWideOperationsObserver::EOperationCancelled:
+        break;
+    case MMemSpyDeviceWideOperationsObserver::EOperationCompleting:
+        {
+        ASSERT( iProgressDialog != NULL );
+        const TInt finalValue = iProgressInfo->Info().iFinalValue;
+        iProgressInfo->SetAndDraw( finalValue );
+        break;
+        }
+    case MMemSpyDeviceWideOperationsObserver::EOperationCompleted:
+        if  ( iProgressDialog )
+            {
+            iProgressDialog->ProcessFinishedL();
+            }
+        break;
+    default:
+        break;
+        }
+
+#ifdef _DEBUG
+    RDebug::Print( _L("[MemSpy] CMemSpyDeviceWideOperationDialog::HandleDeviceWideOperationEvent() - END - aEvent: %d, aParam1: %d, aParam2: %S"), aEvent, aParam1, &aParam2 );
+#endif
+    }
+
+
+void CMemSpyDeviceWideOperationDialog::SetDialogCaptionL( const TDesC& aText )
+    {
+    if  ( aText.Length() )
+        {
+        iProgressDialog->SetTextL( aText );
+        iProgressDialog->DrawNow();
+        }
+    }
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyDocument.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyDocument.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+
+// User includes
+#include "MemSpyAppUi.h"
+#include "MemSpySettings.h"
+
+//cigasto
+#include <memspysession.h>
+
+
+CMemSpyDocument::CMemSpyDocument(CEikApplication& aApp)
+:   CAknDocument(aApp)    
+    {
+    }
+
+
+CMemSpyDocument::~CMemSpyDocument()
+    {
+    delete iSettings;
+    //delete iEngine;
+    if( iMemSpySession )
+    	{
+    	iMemSpySession->Close();
+    	}
+    
+    }
+
+
+void CMemSpyDocument::ConstructL()
+    {
+    RFs& fsSession = CCoeEnv::Static()->FsSession();
+    //cigasto
+    //iEngine = CMemSpyEngine::NewL( fsSession );
+    
+    iMemSpySession = new (ELeave) RMemSpySession();
+    //RMemSpySession iMemSpySession;
+	TInt error = iMemSpySession->Connect();	
+	if(error != KErrNotFound)
+		{
+		User::LeaveIfError( error );
+		}		
+    
+    //iSettings = CMemSpySettings::NewL( fsSession, *iEngine );
+	iSettings = CMemSpySettings::NewL( fsSession, *iMemSpySession );
+    }
+
+
+CMemSpyDocument* CMemSpyDocument::NewL(CEikApplication& aApp)
+    {
+    CMemSpyDocument* self = new (ELeave) CMemSpyDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+/*
+CMemSpyEngine& CMemSpyDocument::Engine()
+    {
+    return *iEngine;
+    }
+
+
+const CMemSpyEngine& CMemSpyDocument::Engine() const
+    {
+    return *iEngine;
+    }
+*/
+
+CMemSpySettings& CMemSpyDocument::Settings()
+    {
+    return *iSettings;
+    }
+
+
+const CMemSpySettings& CMemSpyDocument::Settings() const
+    {
+    return *iSettings;
+    }
+
+
+CEikAppUi* CMemSpyDocument::CreateAppUiL()
+    {
+    //return new (ELeave) CMemSpyAppUi( *iEngine );
+	return new (ELeave) CMemSpyAppUi( *iMemSpySession );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyExportBitmapsToMemoryCardDialog.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyExportBitmapsToMemoryCardDialog.h"
+
+// System includes
+#include <eikprogi.h>
+#include <AknWaitDialog.h>
+#include <AknQueryDialog.h>
+#include <coemain.h>
+#include <eikenv.h>
+#include <avkon.hrh>
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyenginehelperchunk.h>
+#include <memspy/engine/memspyenginehelpercodesegment.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+#include <memspy/engine/memspyenginehelperstack.h>
+#include <memspy/engine/memspyenginehelperthread.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperfbserv.h>
+
+// Driver includes
+#include <memspy/driver/memspydriverenumerationsshared.h>
+
+// Literal constants
+_LIT( KMemSpyBitmapExportFolderAndFileName, "e:\\MemSpy\\Images\\%04d%02d%02d_%02d.%02d.%02d\\");
+
+
+CMemSpyExportBitmapsToMemoryCardDialog::CMemSpyExportBitmapsToMemoryCardDialog( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps )
+:   CActive(EPriorityIdle), iFsSession(aFsSession), iBitmaps(aBitmaps)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+
+CMemSpyExportBitmapsToMemoryCardDialog::~CMemSpyExportBitmapsToMemoryCardDialog()
+    {
+    Cancel();
+    //
+    delete iProgressDialog;
+    //
+    iMimeTypeArray.ResetAndDestroy();
+    iMimeTypeArray.Close();
+    //
+    if ( iEncoder )
+        {
+        iEncoder->Cancel();
+        }
+    delete iEncoder;
+    delete iFolderName;
+    delete iBmpMimeType;
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::ConstructL()
+    {
+    // Check card is ready
+    if  ( CheckMemoryCardAvailableL( iFsSession ) == EFalse )
+        {
+        User::Leave( KErrNotReady );
+        }
+
+    // Get mime type for BMP file
+    IdentifyBmpMimeTypeL();
+
+    // Prepare unique empty folder
+    PrepareFolderNameSpecL();
+
+    // Prepare UI stuff
+    iProgressDialog = new( ELeave ) CAknProgressDialog( reinterpret_cast< CEikDialog** >( &iProgressDialog ) );
+    iProgressDialog->SetCallback( this );
+    iProgressDialog->SetGloballyCapturing( ETrue );
+    iProgressDialog->PrepareLC( R_MEMSPY_EXPORT_TO_MEMORYCARD_DIALOG );
+    //
+    iProgressInfo = iProgressDialog->GetProgressInfoL( );
+    iProgressInfo->SetFinalValue( iBitmaps.Count() );
+    //
+    iProgressDialog->MakeVisible( ETrue ); // Visible right away
+    //
+    iDialogDismissed = EFalse;
+    iProgressInfo->SetAndDraw( 0 );
+
+    // Start the process rolling...
+    CompleteSelf(KErrNone);
+
+    //
+    iProgressDialog->RunLD( );
+    }
+
+
+CMemSpyExportBitmapsToMemoryCardDialog* CMemSpyExportBitmapsToMemoryCardDialog::NewL( RFs& aFsSession, const CMemSpyEngineFbServBitmapArray& aBitmaps )
+    {
+    CMemSpyExportBitmapsToMemoryCardDialog* self = new(ELeave) CMemSpyExportBitmapsToMemoryCardDialog( aFsSession, aBitmaps );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::Cancel()
+    {
+    CActive::Cancel();
+    }
+
+
+TBool CMemSpyExportBitmapsToMemoryCardDialog::CheckMemoryCardAvailableL( RFs& aFsSession )
+    {
+    TBool available = EFalse;
+    //
+    TDriveInfo driveInfo;
+    if  ( aFsSession.Drive( driveInfo, EDriveE ) == KErrNone )
+        {
+        // Other checks needed?
+        available = ETrue;
+        }
+    //
+    return available;
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::RunL()
+    {
+    const TInt error = iStatus.Int();
+    User::LeaveIfError( error );
+ 
+    if  ( !iDialogDismissed )
+        {
+        // Do we have more items to process?
+        if  ( TryToExportSingleBitmapL() )
+            {
+            _LIT(KTextFormat, "Saving image\n%d/%d");
+            TBuf<128> buf;
+            buf.Format( KTextFormat, iBitmapIndex, iBitmaps.Count() );
+            //
+            iProgressDialog->SetTextL( buf );
+            iProgressInfo->SetAndDraw( iBitmapIndex );
+            iProgressDialog->DrawDeferred();
+            }
+        else
+            {
+            // We're done - RunL will not be called again
+            if  (iProgressInfo)
+                {
+                const TInt finalValue = iProgressInfo->Info().iFinalValue;
+                iProgressInfo->SetAndDraw( finalValue );
+                //
+                delete iProgressDialog;
+                iProgressDialog = NULL;
+                //
+                delete this;
+                }
+            }
+
+        User::ResetInactivityTime();
+        }
+    else
+        {
+        delete iProgressDialog;
+        iProgressDialog = NULL;
+        //
+        delete this;
+        }
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::DoCancel()
+    {
+    if  ( iEncoder )
+        {
+        iEncoder->Cancel();
+        }
+
+    iDialogDismissed = ETrue;
+    }
+
+
+TInt CMemSpyExportBitmapsToMemoryCardDialog::RunError( TInt /*aError*/ )
+    {
+    TRAP_IGNORE(
+
+        // Try the next image
+        if  ( TryToExportSingleBitmapL() == EFalse )
+            {
+            iDialogDismissed = ETrue;
+            delete this;
+            }
+    );
+    //
+    return KErrNone;
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::DialogDismissedL( TInt /*aButtonId*/ )
+    {
+    iDialogDismissed = ETrue;
+    iProgressDialog = NULL;
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::CompleteSelf( TInt aError )
+    {
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, aError );
+    SetActive();
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::ExportBitmapL( const CMemSpyEngineFbServBitmap& aBitmap )
+    {
+    // Create a filename
+    TFileName fileName( *iFolderName );
+    aBitmap.GetExportableFileNameL( fileName );
+
+    // Create encoder object...
+    CImageEncoder* encoder = CImageEncoder::FileNewL( iFsSession, fileName, *iBmpMimeType );
+    delete iEncoder;
+    iEncoder = encoder;
+
+    // Start operation
+    iEncoder->Convert( &iStatus, aBitmap.Bitmap() );
+    SetActive();
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::IdentifyBmpMimeTypeL()
+    {
+    _LIT(KBmpExtension, ".bmp");
+    CImageEncoder::GetFileTypesL( iMimeTypeArray );
+    //
+    const TInt count = iMimeTypeArray.Count();
+    //
+    for( TInt i=0; i<count; i++ )
+        {
+        CFileExtensionMIMEType* extension = iMimeTypeArray[ i ];
+        if  ( extension->FileExtension().FindF( KBmpExtension ) >= 0 )
+            {
+            // Found it - save mime type info
+            iBmpMimeType = extension->MIMEType().AllocL();
+            iMimeTypeArray.ResetAndDestroy();
+            iMimeTypeArray.Close();
+            return;
+            }
+        }
+    //
+    User::Leave( KErrNotFound );    
+    }
+
+
+void CMemSpyExportBitmapsToMemoryCardDialog::PrepareFolderNameSpecL()
+    {
+    delete iFolderName;
+    iFolderName = NULL;
+    
+    // Make a unique filename format specifier.
+    TTime now;
+    now.HomeTime();
+    const TDateTime dt( now.DateTime() );
+
+    // Build it up...
+    iFolderName = HBufC::NewL( KMaxFileName );
+    TPtr pName( iFolderName->Des() );
+    pName.Format( KMemSpyBitmapExportFolderAndFileName, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second());
+    
+    // Create directory
+    const TInt error = iFsSession.MkDirAll( pName );
+    User::LeaveIfError( error );
+    }
+
+
+TBool CMemSpyExportBitmapsToMemoryCardDialog::TryToExportSingleBitmapL()
+    {
+    TBool startedExport = EFalse;
+    
+    const TInt count = iBitmaps.Count();
+    for( ; ( iBitmapIndex < count ) && ( startedExport == EFalse ); iBitmapIndex++ )
+        {
+        const CMemSpyEngineFbServBitmap& memSpyBitmap = iBitmaps.At( iBitmapIndex );
+        const CFbsBitmap& fbsBitmap = memSpyBitmap.Bitmap();
+        const TSize size( fbsBitmap.SizeInPixels() );
+
+        // We don't want to export bitmaps which have a zero-pixel dimension.
+        if  ( size.iHeight > 0 && size.iWidth > 0 )
+            {
+            // This completes the object's request status and will therefore
+            // result in a further call to RunL() when the export to BMP
+            // is completed.
+            ExportBitmapL( memSpyBitmap );
+
+            // And indicate we managed to start an operation...
+            startedExport = ETrue;
+            }
+        }
+    //
+    return startedExport;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpySettings.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,297 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpySettings.h"
+
+// System includes
+#include <e32svr.h>
+#include <s32file.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyenginelogger.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelpersysmemtracker.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
+
+#include <memspysession.h>
+
+// Constants
+_LIT( KMemSpySettingsFileName, "settings.dat" );
+
+// Version 03 dumped some of the system wide memory tracker settings
+const TInt KMemSpySettingsFileFormatVersion = 6;
+
+/*
+CMemSpySettings::CMemSpySettings( RFs& aFsSession, CMemSpyEngine& aEngine )
+:   iFsSession( aFsSession ), iEngine( aEngine )
+    {
+    }
+*/
+CMemSpySettings::CMemSpySettings( RFs& aFsSession, RMemSpySession& aSession )
+:   iFsSession( aFsSession )
+    {	
+    }
+
+
+CMemSpySettings::~CMemSpySettings()
+    {
+	/*
+    TRACE( RDebug::Printf( "CMemSpySettings::~CMemSpySettings() - START" ) );
+    TRAP_IGNORE( StoreSettingsL() );
+    TRACE( RDebug::Printf( "CMemSpySettings::~CMemSpySettings() - END" ) );
+    */
+	
+	//iMemSpyAPI.StoreSettings();
+    }
+
+
+void CMemSpySettings::ConstructL()
+    {
+	/*
+    TRACE( RDebug::Print( _L("CMemSpySettings::ConstructL() - START") ) );
+
+    TRAP_IGNORE( RestoreSettingsL() );
+
+    TRACE( RDebug::Print( _L("CMemSpySettings::ConstructL() - END") ) );
+    */
+	
+	//iMemSpyAPI.RestoreSettings();
+    }
+
+/*
+CMemSpySettings* CMemSpySettings::NewL( RFs& aFsSession, CMemSpyEngine& aEngine )
+    {
+    CMemSpySettings* self = new(ELeave) CMemSpySettings( aFsSession, aEngine );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+*/
+CMemSpySettings* CMemSpySettings::NewL( RFs& aFsSession, RMemSpySession& aSession )
+    {
+    CMemSpySettings* self = new(ELeave) CMemSpySettings( aFsSession, aSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+/*
+void CMemSpySettings::GetSettingsFileNameL( TDes& aFileName )
+    {
+    GetSettingsPathL( aFileName );
+    aFileName.Append( KMemSpySettingsFileName );
+    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsFileNameL() - aFileName: %S"), &aFileName ) );
+    }
+
+
+void CMemSpySettings::GetSettingsPathL( TDes& aPath )
+    {
+    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - START") ) );
+    aPath.Zero();
+
+    // Get private data cage path
+    TInt err = iFsSession.PrivatePath( aPath );
+    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - priv path err: %d"), err ) );
+    User::LeaveIfError( err );
+
+    // Combine with C: drive
+    const TDriveUnit cDrive( EDriveC );
+    const TDriveName cDriveName( cDrive.Name() );
+    aPath.Insert( 0, cDriveName );
+
+    iFsSession.MkDirAll( aPath );
+    TRACE( RDebug::Print( _L("CMemSpySettings::GetSettingsPathL() - END - %S"), &aPath ) );
+    }
+
+
+RFile CMemSpySettings::SettingsFileLC( TBool aReplace )
+    {
+    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - START - aReplace: %d"), aReplace ) );
+
+    TFileName* fileName = new(ELeave) TFileName();
+    CleanupStack::PushL( fileName );
+    GetSettingsFileNameL( *fileName );
+    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - fileName: %S"), fileName ) );
+
+    RFile file;
+    TInt error = KErrNone;
+    //
+    if  ( aReplace )
+        {
+        error = file.Replace( iFsSession, *fileName, EFileWrite );
+        TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - replace err: %d"), error ) );
+        }
+    else
+        {
+        error = file.Open( iFsSession, *fileName, EFileWrite );
+        TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - open err: %d"), error ) );
+        //
+        if  ( error == KErrNotFound )
+            {
+            error = file.Create( iFsSession, *fileName, EFileWrite );
+            }
+        }
+    //
+    User::LeaveIfError( error );
+    CleanupStack::PopAndDestroy( fileName );
+    CleanupClosePushL( file );
+    //
+    TRACE( RDebug::Print( _L("CMemSpySettings::SettingsFileLC() - END") ) );
+    return file;
+    }
+
+
+void CMemSpySettings::StoreSettingsL()
+    {
+    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - START" ) );
+
+    RFile file = SettingsFileLC( ETrue );
+    RFileWriteStream stream( file );
+    CleanupStack::Pop(); // file
+    CleanupClosePushL( stream );
+    
+    // Verion info
+    stream.WriteInt32L( KMemSpySettingsFileFormatVersion );
+    
+    // Engine settings
+    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - sinkType: %d", iEngine.SinkType() ) );
+    stream.WriteUint8L( iEngine.SinkType() );
+
+    // Get SWMT config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
+    swmt.GetConfig( swmtConfig );
+
+    // Write SWMT settings
+    stream.WriteInt32L( swmtConfig.TimerPeriod().Int() );
+    stream.WriteUint8L( swmtConfig.DumpData() );
+    
+    // Write memory tracking auto-start process list
+    const RArray<TUid>& processUidList = iEngine.HelperProcess().MemoryTrackingAutoStartProcessList();
+    stream.WriteInt32L( processUidList.Count() );
+    for( TInt i=0; i<processUidList.Count(); i++ )
+        {
+        const TUid uid = processUidList[ i ];
+        TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, uid.iUid ) );
+        stream << uid;
+        }
+
+    // Write memory tracking categories
+    stream.WriteInt32L( swmtConfig.iEnabledCategories );
+    
+    // Write heap tracking thread name filter
+    stream.WriteInt32L( swmtConfig.iThreadNameFilter.Length() );
+    if ( swmtConfig.iThreadNameFilter.Length() > 0 )
+        {
+        stream.WriteL( swmtConfig.iThreadNameFilter, swmtConfig.iThreadNameFilter.Length() );
+        }
+    
+    // Write mode
+    stream.WriteInt32L( swmtConfig.iMode );
+    
+    stream.CommitL();
+    CleanupStack::PopAndDestroy( &stream ); // Closes file
+    TRACE( RDebug::Printf( "CMemSpySettings::StoreSettingsL() - END - sinkType: %d", iEngine.SinkType() ) );
+    }
+
+
+void CMemSpySettings::RestoreSettingsL()
+    {
+    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - START - current engine sinkType: %d", iEngine.SinkType() ) );
+
+    RFile file = SettingsFileLC();
+    RFileReadStream stream( file );
+    CleanupStack::Pop(); // file
+    CleanupClosePushL( stream );
+    
+    // Version info
+    const TInt version = stream.ReadInt32L(); // discarded for now
+    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - version: %d", version ) );
+
+    // Engine settings
+    TMemSpySinkType type = static_cast< TMemSpySinkType >( stream.ReadUint8L() );
+    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - read sinkType: %d", type ) );
+    iEngine.InstallSinkL( type );
+    
+    // Set SWMT config
+    TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
+    swmtConfig.iTimerPeriod = TTimeIntervalMicroSeconds32( stream.ReadInt32L() );
+    swmtConfig.iDumpData = static_cast< TBool >( stream.ReadUint8L() );
+
+    if  ( version < 3 )
+        {
+        // Restore but ignore old delta tracker settings which aren't used anymore
+        //
+        static_cast< TBool >( stream.ReadUint8L() );
+        static_cast< TBool >( stream.ReadUint8L() );
+        static_cast< TBool >( stream.ReadUint8L() );
+        }
+    
+    // Restore memory tracking auto-start process uids if file format supports it...
+    if ( version >= 2 )
+        {
+        RArray<TUid> list;
+        CleanupClosePushL( list );
+        //
+        const TInt count = stream.ReadInt32L();
+        for( TInt i=0; i<count; i++ )
+            {
+            TUid processUid;
+            stream >> processUid;
+            //
+            TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - process tracker uid[%02d]: 0x%08x", i, processUid.iUid ) );
+            User::LeaveIfError( list.Append( processUid ) );
+            }
+        //
+        CMemSpyEngineHelperProcess& processHelper = iEngine.HelperProcess();
+        processHelper.SetMemoryTrackingAutoStartProcessListL( list );
+        CleanupStack::PopAndDestroy( &list );
+        }
+    
+    // Restore memory tracking categories 
+    if ( version > 3 )
+        {
+        swmtConfig.iEnabledCategories = stream.ReadInt32L();
+        }
+    
+    // Write heap tracking thread name filter 
+    if ( version > 4 )
+        {
+        TInt len = stream.ReadInt32L();
+        if ( len > 0 )
+            {
+            stream.ReadL( swmtConfig.iThreadNameFilter, len );
+            }
+        }
+
+    // Write mode
+    if ( version > 5 )
+        {
+        swmtConfig.iMode = (TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode)stream.ReadInt32L();
+        }
+    
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    swmt.SetConfigL( swmtConfig );
+
+    CleanupStack::PopAndDestroy( &stream ); // Closes file
+    TRACE( RDebug::Printf( "CMemSpySettings::RestoreSettingsL() - END - engine sink type: %d", iEngine.SinkType() ) );
+    }
+
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyUiUtils.h"
+
+// System includes
+#include <coemain.h>
+#include <memspyui.rsg>
+
+
+
+
+void MemSpyUiUtils::Format( TDes& aBuf, TInt aResourceId, ...)
+    {
+	VA_LIST list;
+    VA_START(list,aResourceId);
+	TBuf<128> format;
+	CCoeEnv::Static()->ReadResource( format, aResourceId );
+	aBuf.FormatList( format, list );
+    }
+
+
+void MemSpyUiUtils::GetErrorText( TDes& aBuf, TInt aError )
+    {
+    if  ( aError == KErrNotSupported )
+        {
+        _LIT( KMemSpyErrorText, "Not Supported" );
+        aBuf = KMemSpyErrorText;
+        }
+    else if ( aError == KErrNotReady )
+        {
+        _LIT( KMemSpyErrorText, "Not Ready" );
+        aBuf = KMemSpyErrorText;
+        }
+    else if ( aError == KErrNotFound )
+        {
+        _LIT( KMemSpyErrorText, "Missing" );
+        aBuf = KMemSpyErrorText;
+        }
+    else if ( aError == KErrGeneral )
+        {
+        _LIT( KMemSpyErrorText, "General Error" );
+        aBuf = KMemSpyErrorText;
+        }
+    else
+        {
+        _LIT( KMemSpyItemValueError, "Error: %d" );
+        aBuf.Format( KMemSpyItemValueError, aError );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewBase.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,422 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewBase.h"
+
+// System includes
+#include <eikrted.h>  // for example label control
+#include <txtrich.h>
+#include <apgtask.h>
+#include <akntitle.h>
+#include <akncontext.h>
+#include <aknnavi.h>
+#include <eiklbx.h>
+#include <eiklbm.h>
+#include <avkon.hrh>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineutils.h>
+#include <memspy/engine/memspyengineoutputsink.h>
+
+// User includes
+#include "MemSpyAppUi.h"
+#include "MemSpyDocument.h"
+#include "MemSpyContainer.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+/*
+CMemSpyViewBase::CMemSpyViewBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   iEngine( aEngine ), iObserver( aObserver )
+    {
+    }
+*/
+CMemSpyViewBase::CMemSpyViewBase( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
+:   iMemSpySession( aSession ), iObserver( aObserver )
+    {
+    }
+
+
+CMemSpyViewBase::~CMemSpyViewBase()
+    {
+    delete iListBox;
+    }
+ 
+
+void CMemSpyViewBase::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* /*aSelectionRune*/ )
+    {
+    iSettings = &static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() )->MemSpyDocument().Settings();
+    //
+    User::LeaveIfError( SetParent( &aContainer ) );
+    SetContainerWindowL( aContainer );
+    
+    SetComponentsToInheritVisibility( ETrue );
+
+    iListBox = ConstructListBoxL();
+    if  ( iListBox )
+        {
+        iListBox->SetFocus( ETrue );
+        }
+
+    SetRect( aRect );
+    ActivateL();
+    }
+
+
+void CMemSpyViewBase::SetTitleL( const TDesC& aText )
+    {
+    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*> ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    title->SetTextL( aText );
+    }
+
+
+TPtrC CMemSpyViewBase::TitleL() const
+    {
+    TPtrC ret( KNullDesC );
+    //
+    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*> ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    if  ( title->Text() )
+        {
+        ret.Set( *title->Text() );
+        }
+    //
+    return ret;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewBase::PrepareParentViewL()
+    {
+    return NULL;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewBase::PrepareChildViewL()
+    {
+    return NULL;
+    }
+    
+    
+void CMemSpyViewBase::RefreshL()
+    {
+    if  ( iListBox )
+        {
+        iListBox->UpdateScrollBarsL();
+        }
+
+    DrawDeferred();
+    }
+
+
+TBool CMemSpyViewBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch( aCommand )
+        {
+	case EMemSpyCmdViewOutputToSink:
+        OnCmdViewOutputToSinkL();
+        break;
+    default:
+        handled = EFalse;
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewBase::DynInitMenuPaneL( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ )
+    {
+    }
+
+
+TUint CMemSpyViewBase::MenuCascadeResourceId() const
+    {
+    return 0;
+    }
+
+
+TInt CMemSpyViewBase::MenuCascadeCommandId() const
+    {
+    return 0;
+    }
+
+
+void CMemSpyViewBase::OnCmdViewOutputToSinkL()
+    {
+	//cigasto so solve - outputs content of the listbox into the sink
+	//to discuss format with Orbit
+	/*
+    if  ( iListBox )
+        {
+        // Prepare sink
+        CMemSpyEngineOutputSink& sink = iEngine.Sink();
+        HBufC* name = MemSpyEngineUtils::CleanupTextLC( TitleL() );
+        sink.OutputSectionHeadingL( *name, TChar('-') );
+        CleanupStack::PopAndDestroy( name );
+        sink.OutputPrefixSetLC( _L("  ") ); // Slight insertion
+        
+        // Get text from underlying listbox model...
+        MTextListBoxModel* model = static_cast< MTextListBoxModel* >( iListBox->Model() );
+        const TInt count = model->NumberOfItems();
+
+        // First pass to get max lengths
+        TInt maxLengthCaption = 0;
+        TInt maxLengthValue = 0;
+
+        for( TInt j=0; j<count; j++ )
+            {
+            const TPtrC pItem( model->ItemText( j ) );
+            const TInt length = pItem.Length();
+    
+            // Check if its split or not?
+            const TInt splitPos = pItem.FindF( _L("\t\t") );
+            if  ( splitPos > 0 )
+                {
+                maxLengthCaption = Max( maxLengthCaption, splitPos );
+                maxLengthValue = Max( maxLengthValue, length - splitPos + 1 );
+                }
+            else
+                {
+                maxLengthCaption = Max( maxLengthCaption, length );
+                }
+            }
+
+        // Second pass - real this time - to print the values
+        HBufC* line = HBufC::NewLC( ( maxLengthCaption + maxLengthValue ) + 20 );
+        TPtr pLine( line->Des() );
+        //
+        for( TInt i=0; i<count; i++ )
+            {
+            const TPtrC pItem( model->ItemText( i ) );
+            const TInt length = pItem.Length();
+            //
+            TPtrC pCaption( KNullDesC );
+            TPtrC pValue( KNullDesC );
+            //
+            const TInt splitPos = pItem.FindF( _L("\t\t") );
+            if  ( splitPos > 0 )
+                {
+                pCaption.Set( pItem.Left( splitPos ) );
+                pValue.Set( pItem.Mid( splitPos + 1 ) );
+                }
+            else
+                {
+                pCaption.Set( pItem );
+                }
+
+            // Remove initial tabs in caption
+            HBufC* caption = MemSpyEngineUtils::CleanupTextLC( pCaption );
+        
+            // Create value item & replace any further tabs
+            HBufC* value = MemSpyEngineUtils::CleanupTextLC( pValue );
+
+            // Now format the final line, with padding.
+            pLine.Justify( *caption, maxLengthCaption + 3, ELeft, TChar(' ') );
+            pLine.Append( *value );
+            CleanupStack::PopAndDestroy( 2, caption );
+
+            // Sink output
+            sink.OutputLineL( pLine );
+            }
+
+        // Remove prefix & tidy up
+        CleanupStack::PopAndDestroy( line );
+        sink.OutputBlankLineL();
+        CleanupStack::PopAndDestroy(); // clear prefix
+		}  
+	*/     
+    }
+
+
+CEikListBox* CMemSpyViewBase::ConstructListBoxL()
+    {
+    delete iListBox;
+    iListBox = NULL;
+    CAknSettingStyleListBox* listbox = new(ELeave) CAknSettingStyleListBox();
+    iListBox = listbox;
+    //
+    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
+    listbox->SetContainerWindowL( *this );
+    listbox->CreateScrollBarFrameL( ETrue );
+    SetListBoxModelL();
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+    listbox->SetListBoxObserver( this );
+    listbox->SetObserver( this );
+    listbox->SetComponentsToInheritVisibility( ETrue );
+    //
+    return listbox;
+    }
+
+
+void CMemSpyViewBase::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewBase::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
+    {
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+void CMemSpyViewBase::ReportEventL( MMemSpyViewObserver::TViewEventType aEvent, TAny* aContext )
+    {
+    iObserver.HandleMemSpyViewEventL( aEvent, ViewType(), *this, aContext );
+    }
+
+
+void CMemSpyViewBase::SetListBoxCurrentItemIndexL( TInt aIndex )
+    {
+    if  ( iListBox )
+        {
+        iListBox->SetCurrentItemIndex( aIndex );
+        HandleListBoxItemSelectedL( aIndex );
+        }
+    }
+
+
+CMemSpyContainer& CMemSpyViewBase::Container()
+    {
+    CMemSpyAppUi* appUi = static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() );
+    return appUi->Container();
+    }
+
+
+CMemSpySettings& CMemSpyViewBase::Settings()
+    {
+    return *iSettings;
+    }
+
+
+const CMemSpySettings& CMemSpyViewBase::Settings() const
+    {
+    return *iSettings;
+    }
+
+    
+void CMemSpyViewBase::Draw( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+    //
+    gc.SetPenStyle( CGraphicsContext::ENullPen );
+    gc.SetBrushColor( KRgbWhite );
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.DrawRect( aRect );
+    }
+
+
+void CMemSpyViewBase::SizeChanged()
+    {
+    if  ( iListBox )
+        {
+        iListBox->SetRect( Rect() );
+        }
+    }
+
+
+void CMemSpyViewBase::FocusChanged(TDrawNow /*aDrawNow*/)
+    {
+    if  ( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+    }
+
+
+TInt CMemSpyViewBase::CountComponentControls() const
+    {
+    TInt count = 0;
+    if  ( iListBox )
+        {
+        ++count;
+        }
+    //
+    return count;
+    }
+
+
+CCoeControl* CMemSpyViewBase::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+    case 0:
+        return iListBox;
+    default:
+        return NULL;
+        }
+    }
+
+
+TKeyResponse CMemSpyViewBase::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+	{
+    TKeyResponse resp = EKeyWasNotConsumed;
+    if  ( iListBox )
+        {
+        resp = iListBox->OfferKeyEventL( aKeyEvent, aType );
+        }
+    //
+    if ( resp == EKeyWasNotConsumed && aType == EEventKeyDown && aKeyEvent.iCode == EKeyBackspace )
+        {
+        // When backspace is pushed, go to the parent view
+        CMemSpyAppUi* appUi = static_cast< CMemSpyAppUi* >( iEikonEnv->EikAppUi() );
+        appUi->Container().NavigateToParentViewL();
+        resp = EKeyWasConsumed;
+        }
+    //
+	return resp;
+	}
+
+
+void CMemSpyViewBase::HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType )
+    {
+    if  ( aControl == iListBox )
+        {
+        if  ( aEventType == MCoeControlObserver::EEventStateChanged )
+            {
+            const TInt index = iListBox->CurrentItemIndex();
+            HandleListBoxItemSelectedL( index );
+            }
+        }
+    }
+
+
+void CMemSpyViewBase::HandleListBoxEventL( CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
+    {
+    const TInt index = iListBox->CurrentItemIndex();
+    //
+    switch (aEventType)
+        {
+    case EEventItemActioned:
+    case EEventEnterKeyPressed:
+    case EEventItemDoubleClicked:
+        HandleListBoxItemActionedL( index );
+        break;
+
+    default:
+        break;
+        }
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewChunkList.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,346 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewChunkList.h"
+
+// System includes
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperchunk.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+
+
+
+CMemSpyViewChunkBase::CMemSpyViewChunkBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList* aList )
+:   CMemSpyViewBase( aEngine, aObserver ), iList( aList )
+    {
+    }
+
+
+CMemSpyViewChunkBase::~CMemSpyViewChunkBase()
+    {
+    delete iList;
+    }
+
+
+TBool CMemSpyViewChunkBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdChunkSortByName:
+        iList->SortByNameL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdChunkSortBySize:
+        iList->SortBySizeL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdChunkListing:
+        OnCmdListingL();
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewChunkBase::OnCmdListingL()
+    {
+    // Begin a new data stream
+    _LIT( KMemSpyContext, "Chunk List" );
+    _LIT( KMemSpyFolder, "Chunks" );
+    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
+
+    // Set prefix for overall listing
+    _LIT( KOverallPrefix, "Chunk List - " );
+    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
+
+    // Create header
+    CMemSpyEngineChunkList::OutputDataColumnsL( iEngine );
+    
+    // List items
+    const TInt count = iList->Count();
+    for(TInt i=0; i<count; i++)
+        {
+        const CMemSpyEngineChunkEntry& entry = iList->At( i );
+        //
+        entry.OutputDataL( iEngine.HelperChunk() );
+        }
+
+    // Tidy up
+    CleanupStack::PopAndDestroy(); // prefix
+
+    // End data stream
+    iEngine.Sink().DataStreamEndL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewChunkList::CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewChunkBase( aEngine, aObserver, NULL )
+    {
+    }
+
+
+CMemSpyViewChunkList::CMemSpyViewChunkList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList )
+:   CMemSpyViewChunkBase( aEngine, aObserver, &aList )
+    {
+    }
+
+
+void CMemSpyViewChunkList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Chunks" );
+    SetTitleL( KTitle );
+
+    if  ( iList == NULL )
+        {
+        // Prepare code segment list
+        iList = iEngine.HelperChunk().ListL();
+        }
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    if  ( aSelectionRune != NULL )
+        {
+        iCurrentChunk = reinterpret_cast< CMemSpyEngineChunkEntry* >( aSelectionRune );
+        const TInt index = iList->ItemIndex( *iCurrentChunk );
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        }
+
+    iListBox->DrawDeferred();
+    }
+
+
+TMemSpyViewType CMemSpyViewChunkList::ViewType() const
+    {
+    return EMemSpyViewTypeChunkList;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewChunkList::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewChunkList::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewChunkDetails( iEngine, iObserver, *iList, *iCurrentChunk );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iList = NULL;
+
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewChunkList::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iList );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewChunkList::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineChunkEntry& chunk = iList->At( aIndex );
+        iCurrentChunk = &chunk;
+        }
+    else
+        {
+        iCurrentChunk = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewChunkList::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineChunkEntry& chunk = iList->At( aIndex );
+        iCurrentChunk = &chunk;
+        }
+    else
+        {
+        iCurrentChunk = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewChunkDetails::CMemSpyViewChunkDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineChunkList& aList, CMemSpyEngineChunkEntry& aSelectedChunk )
+:   CMemSpyViewChunkBase( aEngine, aObserver, &aList ), iChunk( aSelectedChunk )
+    {
+    }
+
+
+void CMemSpyViewChunkDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Chunk Details" );
+    SetTitleL( KTitle );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewChunkDetails::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewChunkDetails::ViewType() const
+    {
+    return EMemSpyViewTypeChunkDetails;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewChunkDetails::PrepareParentViewL()
+    {
+    CMemSpyViewChunkList* parent = new(ELeave) CMemSpyViewChunkList( iEngine, iObserver, *iList );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iList = NULL;
+
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iChunk );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewChunkDetails::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iChunk );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewCodeSegList.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,500 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewCodeSegList.h"
+
+// System includes
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelpercodesegment.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyExportBitmapsToMemoryCardDialog.h"
+
+
+
+CMemSpyViewCodeSegBase::CMemSpyViewCodeSegBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList* aList )
+:   CMemSpyViewBase( aEngine, aObserver ), iList( aList )
+    {
+    }
+
+
+CMemSpyViewCodeSegBase::~CMemSpyViewCodeSegBase()
+    {
+    delete iList;
+    }
+
+
+TBool CMemSpyViewCodeSegBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdCodeSegSortByName:
+        iList->SortByFileNameL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdCodeSegSortByCodeSize:
+        iList->SortByCodeSizeL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdCodeSegSortByDataSize:
+        iList->SortByDataSizeL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdCodeSegSortByUid:
+        iList->SortByUidsL();
+        CMemSpyViewBase::RefreshL();
+        break;
+    case EMemSpyCmdCodeSegListing:
+        OnCmdCodeSegmentListingL();
+        break;
+    case EMemSpyCmdCodeSegShowItemsAll:
+        OnCmdShowItemsAllL();
+        break;
+    case EMemSpyCmdCodeSegShowItemsGlobalData:
+        OnCmdShowItemsGlobalDataL();
+        break;
+
+    case EMemSpyCmdCodeSegShowCapsWithTCBProcess:
+    case EMemSpyCmdCodeSegShowCapsWithTCBAll:              
+        OnCmdFilterByCapabilityL( ECapabilityTCB, aCommand == EMemSpyCmdCodeSegShowCapsWithTCBAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithCommDDProcess:
+    case EMemSpyCmdCodeSegShowCapsWithCommDDAll:
+        OnCmdFilterByCapabilityL( ECapabilityCommDD, aCommand == EMemSpyCmdCodeSegShowCapsWithCommDDAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithPowerMgmtProcess:
+    case EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll:
+        OnCmdFilterByCapabilityL( ECapabilityPowerMgmt, aCommand == EMemSpyCmdCodeSegShowCapsWithPowerMgmtAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithMultimediaDDProcess:
+    case EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll:
+        OnCmdFilterByCapabilityL( ECapabilityMultimediaDD, aCommand == EMemSpyCmdCodeSegShowCapsWithMultimediaDDAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithReadDeviceDataProcess:
+    case EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll:
+        OnCmdFilterByCapabilityL( ECapabilityReadDeviceData, aCommand == EMemSpyCmdCodeSegShowCapsWithReadDeviceDataAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataProcess:
+    case EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll:
+        OnCmdFilterByCapabilityL( ECapabilityWriteDeviceData, aCommand == EMemSpyCmdCodeSegShowCapsWithWriteDeviceDataAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithDRMProcess:
+    case EMemSpyCmdCodeSegShowCapsWithDRMAll:
+        OnCmdFilterByCapabilityL( ECapabilityDRM, aCommand == EMemSpyCmdCodeSegShowCapsWithDRMAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithTrustedUIProcess:
+    case EMemSpyCmdCodeSegShowCapsWithTrustedUIAll:
+        OnCmdFilterByCapabilityL( ECapabilityTrustedUI, aCommand == EMemSpyCmdCodeSegShowCapsWithTrustedUIAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithProtServProcess:
+    case EMemSpyCmdCodeSegShowCapsWithProtServAll:
+        OnCmdFilterByCapabilityL( ECapabilityProtServ, aCommand == EMemSpyCmdCodeSegShowCapsWithProtServAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithDiskAdminProcess:
+    case EMemSpyCmdCodeSegShowCapsWithDiskAdminAll:
+        OnCmdFilterByCapabilityL( ECapabilityDiskAdmin, aCommand == EMemSpyCmdCodeSegShowCapsWithDiskAdminAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithNetworkControlProcess:
+    case EMemSpyCmdCodeSegShowCapsWithNetworkControlAll:
+        OnCmdFilterByCapabilityL( ECapabilityNetworkControl, aCommand == EMemSpyCmdCodeSegShowCapsWithNetworkControlAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithAllFilesProcess:
+    case EMemSpyCmdCodeSegShowCapsWithAllFilesAll:
+        OnCmdFilterByCapabilityL( ECapabilityAllFiles, aCommand == EMemSpyCmdCodeSegShowCapsWithAllFilesAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithSwEventProcess:
+    case EMemSpyCmdCodeSegShowCapsWithSwEventAll:
+        OnCmdFilterByCapabilityL( ECapabilitySwEvent, aCommand == EMemSpyCmdCodeSegShowCapsWithSwEventAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithNetworkServicesProcess:
+    case EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll:
+        OnCmdFilterByCapabilityL( ECapabilityNetworkServices, aCommand == EMemSpyCmdCodeSegShowCapsWithNetworkServicesAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithLocalServicesProcess:
+    case EMemSpyCmdCodeSegShowCapsWithLocalServicesAll:
+        OnCmdFilterByCapabilityL( ECapabilityLocalServices, aCommand == EMemSpyCmdCodeSegShowCapsWithLocalServicesAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithReadUserDataProcess:
+    case EMemSpyCmdCodeSegShowCapsWithReadUserDataAll:
+        OnCmdFilterByCapabilityL( ECapabilityReadUserData, aCommand == EMemSpyCmdCodeSegShowCapsWithReadUserDataAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithWriteUserDataProcess:
+    case EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll:
+        OnCmdFilterByCapabilityL( ECapabilityWriteUserData, aCommand == EMemSpyCmdCodeSegShowCapsWithWriteUserDataAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithLocationProcess:
+    case EMemSpyCmdCodeSegShowCapsWithLocationAll:
+        OnCmdFilterByCapabilityL( ECapabilityLocation, aCommand == EMemSpyCmdCodeSegShowCapsWithLocationAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithSurroundingsDDProcess:
+    case EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll:
+        OnCmdFilterByCapabilityL( ECapabilitySurroundingsDD, aCommand == EMemSpyCmdCodeSegShowCapsWithSurroundingsDDAll );
+        break;
+    case EMemSpyCmdCodeSegShowCapsWithUserEnvProcess:
+    case EMemSpyCmdCodeSegShowCapsWithUserEnvAll:
+        OnCmdFilterByCapabilityL( ECapabilityUserEnvironment, aCommand == EMemSpyCmdCodeSegShowCapsWithUserEnvAll );
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewCodeSegBase::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewCodeSegBase::OnCmdCodeSegmentListingL()
+    {
+    // Begin a new data stream
+    _LIT( KMemSpyContext, "CodeSeg List - " );
+    _LIT( KMemSpyFolder, "CodeSegs" );
+    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
+
+    // Set prefix for overall listing
+    _LIT(KOverallPrefix, "CodeSeg List - ");
+    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
+
+    // Create header
+    CMemSpyEngineCodeSegList::OutputDataColumnsL( iEngine );
+    
+    // List items
+    const TInt count = iList->Count();
+    for(TInt i=0; i<count; i++)
+        {
+        const CMemSpyEngineCodeSegEntry& entry = iList->At( i );
+        //
+        entry.OutputDataL( iEngine.HelperCodeSegment() );
+        }
+
+    // Tidy up
+    CleanupStack::PopAndDestroy(); // prefix
+
+    // End data stream
+    iEngine.Sink().DataStreamEndL();
+    }
+
+
+void CMemSpyViewCodeSegBase::OnCmdShowItemsAllL()
+    {
+    iList->ShowAllL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewCodeSegBase::OnCmdShowItemsGlobalDataL()
+    {
+    iList->ShowOnlyEntriesWithGlobalDataL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewCodeSegBase::OnCmdFilterByCapabilityL( TCapability aCapability, TBool aAllBinaries )
+    {
+    TMemSpyViewCodeSegFilter filterLogic( aCapability, aAllBinaries );
+    TMemSpyEngineVisibiltyFunction<CMemSpyEngineCodeSegEntry> filterFunction( TMemSpyViewCodeSegFilter::FilterItem, &filterLogic );
+    iList->ShowL( filterFunction );
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewCodeSegList::CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewCodeSegBase( aEngine, aObserver, NULL )
+    {
+    }
+
+
+CMemSpyViewCodeSegList::CMemSpyViewCodeSegList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList )
+:   CMemSpyViewCodeSegBase( aEngine, aObserver, &aList )
+    {
+    }
+
+
+void CMemSpyViewCodeSegList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Code Segments" );
+    SetTitleL( KTitle );
+
+    if  ( iList == NULL )
+        {
+        // Prepare code segment list
+        iList = iEngine.HelperCodeSegment().CodeSegmentListL();
+        iList->SortByCodeSizeL();
+        }
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    if  ( aSelectionRune != NULL )
+        {
+        iCurrentCodeSegment = reinterpret_cast< CMemSpyEngineCodeSegEntry* >( aSelectionRune );
+        const TInt index = iList->ItemIndex( *iCurrentCodeSegment );
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        }
+
+    iListBox->DrawDeferred();
+    }
+
+
+TMemSpyViewType CMemSpyViewCodeSegList::ViewType() const
+    {
+    return EMemSpyViewTypeCodeSegmentList;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewCodeSegList::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewCodeSegList::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewCodeSegDetails( iEngine, iObserver, *iList, *iCurrentCodeSegment );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iList = NULL;
+
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewCodeSegList::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iList );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewCodeSegList::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineCodeSegEntry& codeSeg = iList->At( aIndex );
+        iCurrentCodeSegment = &codeSeg;
+        }
+    else
+        {
+        iCurrentCodeSegment = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewCodeSegList::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineCodeSegEntry& codeSeg = iList->At( aIndex );
+        iCurrentCodeSegment = &codeSeg;
+        }
+    else
+        {
+        iCurrentCodeSegment = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewCodeSegDetails::CMemSpyViewCodeSegDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineCodeSegList& aList, CMemSpyEngineCodeSegEntry& aSelectedCodeSegment )
+:   CMemSpyViewCodeSegBase( aEngine, aObserver, &aList ), iCodeSegment( aSelectedCodeSegment )
+    {
+    }
+
+
+void CMemSpyViewCodeSegDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Code Segment Details" );
+    SetTitleL( KTitle );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewCodeSegDetails::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewCodeSegDetails::ViewType() const
+    {
+    return EMemSpyViewTypeCodeSegmentDetails;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewCodeSegDetails::PrepareParentViewL()
+    {
+    CMemSpyViewCodeSegList* parent = new(ELeave) CMemSpyViewCodeSegList( iEngine, iObserver, *iList );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iList = NULL;
+
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iCodeSegment );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewCodeSegDetails::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iCodeSegment );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+TBool TMemSpyViewCodeSegFilter::FilterItem( const CMemSpyEngineCodeSegEntry*& aItem, TAny* aRune )
+    {
+    TMemSpyViewCodeSegFilter* self = reinterpret_cast< TMemSpyViewCodeSegFilter* >( aRune );
+
+    TBool match = aItem->HasCapability( self->iCapability );
+    if  ( match && self->iAllBinaries == EFalse )
+        {
+        // We're only looking for EXE's...
+        TParsePtrC parser( aItem->FileName() );
+        const TPtrC pExtension( parser.Ext() );
+        _LIT(KProcessExtension, ".exe");
+        //
+        match = ( pExtension.CompareF( KProcessExtension ) == 0 );
+        }
+    //
+    return match;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewDriveInfo.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,381 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewDriveInfo.h"
+
+// System includes
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperfilesystem.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+
+
+
+CMemSpyViewDriveInfoBase::CMemSpyViewDriveInfoBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewDriveInfoBase::~CMemSpyViewDriveInfoBase()
+    {
+    if  ( iList )
+        {
+        iList->SetObserver( NULL );
+        }
+    //
+    delete iList;
+    }
+
+
+void CMemSpyViewDriveInfoBase::BaseConstructL()
+    {
+    iList = iEngine.HelperFileSystem().DriveListL();
+    }
+
+
+TBool CMemSpyViewDriveInfoBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewDriveList::CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iUseDriveNumber( EFalse ), iDriveNumber( EDriveA )
+    {
+    }
+
+
+CMemSpyViewDriveList::CMemSpyViewDriveList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber )
+:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iUseDriveNumber( ETrue ), iDriveNumber( aDriveNumber )
+    {
+    }
+
+
+void CMemSpyViewDriveList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    BaseConstructL();
+
+    _LIT( KTitle, "Drive Summary" );
+    SetTitleL( KTitle );
+
+    // Start watching list
+    iList->SetObserver( this );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    if  ( iUseDriveNumber )
+        {
+#ifdef _DEBUG
+        RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - iDriveNumber: %c:", iDriveNumber + 'A' );
+#endif
+        iCurrentDrive = iList->EntryByDriveNumber( iDriveNumber );
+
+#ifdef _DEBUG
+        RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - iCurrentDrive: 0x%08x", iCurrentDrive );
+#endif
+        if  ( iCurrentDrive )
+            {
+            const TInt index = iList->ItemIndex( *iCurrentDrive );
+#ifdef _DEBUG
+            RDebug::Printf( "CMemSpyViewDriveList::ConstructL() - index: %d", index );
+#endif
+            iListBox->SetCurrentItemIndex( index );
+            HandleListBoxItemSelectedL( index );
+            }
+        }
+    
+    iListBox->DrawDeferred();
+    }
+
+
+TMemSpyViewType CMemSpyViewDriveList::ViewType() const
+    {
+    return EMemSpyViewTypeDriveSummary;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewDriveList::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    //
+    if  ( parent )
+        {
+        iList->SetObserver( NULL );
+        }
+    //
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewDriveList::PrepareChildViewL()
+    {
+    ASSERT( iCurrentDrive );
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewDriveInfo( iEngine, iObserver, iCurrentDrive->DriveNumber() );
+
+    // Stop watching list
+    if  ( child )
+        {
+        iList->SetObserver( NULL );
+        }
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iList = NULL;
+
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewDriveList::RefreshL()
+    {
+    if  ( iList )
+        {
+        iList->SetObserver( NULL );
+        }
+    //
+    CMemSpyEngineDriveList* list = iEngine.HelperFileSystem().DriveListL();
+    delete iList;
+    iList = list;
+    iList->SetObserver( this );
+    //
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewDriveList::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iList );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewDriveList::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineDriveEntry& entry = iList->At( aIndex );
+        iCurrentDrive = &entry;
+        }
+    else
+        {
+        iCurrentDrive = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewDriveList::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iList->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineDriveEntry& entry = iList->At( aIndex );
+        iCurrentDrive = &entry;
+        }
+    else
+        {
+        iCurrentDrive = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+void CMemSpyViewDriveList::HandleDriveListChangedL( const CMemSpyEngineDriveList& /*aList*/ )
+    {
+    RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewDriveInfo::CMemSpyViewDriveInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TDriveNumber aDriveNumber )
+:   CMemSpyViewDriveInfoBase( aEngine, aObserver ), iDriveNumber( aDriveNumber )
+    {
+    }
+
+
+void CMemSpyViewDriveInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    BaseConstructL();
+    //
+    iDriveInfo = iList->EntryByDriveNumber( iDriveNumber );
+    if  ( !iDriveInfo )
+        {
+        User::Leave( KErrNotFound );
+        }
+    iDriveInfo->SetObserver( this );
+
+    _LIT( KTitleFormat, "Drive %S Info" );
+    const TDriveName name( iDriveInfo->DriveUnit().Name() );
+    TName title;
+    title.Format( KTitleFormat, &name );
+    SetTitleL( title );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewDriveInfo::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewDriveInfo::ViewType() const
+    {
+    return EMemSpyViewTypeDriveInfo;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewDriveInfo::PrepareParentViewL()
+    {
+    ASSERT( iDriveInfo );
+    CMemSpyViewDriveList* parent = new(ELeave) CMemSpyViewDriveList( iEngine, iObserver, iDriveInfo->DriveNumber() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( parent );
+    //
+    if  ( parent )
+        {
+        iDriveInfo->SetObserver( NULL );
+        }
+    //
+    return parent;
+    }
+
+
+void CMemSpyViewDriveInfo::SetListBoxModelL()
+    {
+    if  ( iDriveInfo )
+        {
+        CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+        listbox->Model()->SetItemTextArray( iDriveInfo );
+        listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+        }
+    }
+
+
+void CMemSpyViewDriveInfo::HandleDriveEntryChangedL( const CMemSpyEngineDriveEntry& /*aEntry*/ )
+    {
+    RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewECom.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,475 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewECom.h"
+
+// System includes
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyenginehelperecom.h>
+
+// User includes
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+CMemSpyViewECom::CMemSpyViewECom( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+void CMemSpyViewECom::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "ECom" );
+    SetTitleL( KTitle );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Select first item
+    TInt index = KErrNotFound;
+    if  ( aSelectionRune != NULL )
+        {
+        iCurrent = reinterpret_cast< CMemSpyEngineEComCategory* >( aSelectionRune );
+        index = iEngine.HelperECom().IndexOf( *iCurrent );
+        }
+
+    if  ( index >= 0 && index < iEngine.HelperECom().Count() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewECom::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewECom::ViewType() const
+    {
+    return EMemSpyViewTypeECom;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewECom::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewECom::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComCategory( iEngine, iObserver, *iCurrent );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewECom::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iEngine.HelperECom() );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewECom::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iEngine.HelperECom().Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComCategory& category = iEngine.HelperECom().At( aIndex );
+        iCurrent = &category;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewECom::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iEngine.HelperECom().Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComCategory& category = iEngine.HelperECom().At( aIndex );
+        iCurrent = &category;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewEComCategory::CMemSpyViewEComCategory( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComCategory& aCategory )
+:   CMemSpyViewBase( aEngine, aObserver ), iCategory( aCategory )
+    {
+    }
+
+
+void CMemSpyViewEComCategory::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    SetTitleL( iCategory.Name() );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Select first item
+    TInt index = KErrNotFound;
+    if  ( aSelectionRune != NULL )
+        {
+        iCurrent = reinterpret_cast< CMemSpyEngineEComInterface* >( aSelectionRune );
+        index = iCategory.IndexOf( *iCurrent );
+        }
+
+    if  ( index >= 0 && index < iCategory.Count() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewEComCategory::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewEComCategory::ViewType() const
+    {
+    return EMemSpyViewTypeEComCategory;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewEComCategory::PrepareParentViewL()
+    {
+    CMemSpyViewECom* parent = new(ELeave) CMemSpyViewECom( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iCategory );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewEComCategory::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComInterface( iEngine, iObserver, *iCurrent );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewEComCategory::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iCategory );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewEComCategory::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iCategory.Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComInterface& entry = iCategory.At( aIndex );
+        iCurrent = &entry;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewEComCategory::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iCategory.Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComInterface& entry = iCategory.At( aIndex );
+        iCurrent = &entry;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewEComInterface::CMemSpyViewEComInterface( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComInterface& aInterface )
+:   CMemSpyViewBase( aEngine, aObserver ), iInterface( aInterface )
+    {
+    }
+
+
+void CMemSpyViewEComInterface::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    SetTitleL( iInterface.Name() );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Select first item
+    TInt index = KErrNotFound;
+    if  ( aSelectionRune != NULL )
+        {
+        iCurrent = reinterpret_cast< CMemSpyEngineEComImplementation* >( aSelectionRune );
+        index = iInterface.IndexOf( *iCurrent );
+        }
+
+    if  ( index >= 0 && index < iInterface.Count() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewEComInterface::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewEComInterface::ViewType() const
+    {
+    return EMemSpyViewTypeEComInterface;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewEComInterface::PrepareParentViewL()
+    {
+    CMemSpyViewEComCategory* parent = new(ELeave) CMemSpyViewEComCategory( iEngine, iObserver, iInterface.Category() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iInterface );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewEComInterface::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewEComImplementation( iEngine, iObserver, *iCurrent );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewEComInterface::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iInterface );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewEComInterface::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iInterface.Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComImplementation& entry = iInterface.At( aIndex );
+        iCurrent = &entry;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewEComInterface::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iInterface.Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineEComImplementation& entry = iInterface.At( aIndex );
+        iCurrent = &entry;
+        }
+    else
+        {
+        iCurrent = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewEComImplementation::CMemSpyViewEComImplementation( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineEComImplementation& aImplementation )
+:   CMemSpyViewBase( aEngine, aObserver ), iImplementation( aImplementation )
+    {
+    }
+
+
+void CMemSpyViewEComImplementation::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    SetTitleL( iImplementation.Name() );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Select first item
+    if  ( iImplementation.MdcaCount() )
+        {
+        iListBox->SetCurrentItemIndex( 0 );
+        HandleListBoxItemSelectedL( 0 );
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewEComImplementation::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewEComImplementation::ViewType() const
+    {
+    return EMemSpyViewTypeEComImplementation;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewEComImplementation::PrepareParentViewL()
+    {
+    CMemSpyViewEComInterface* parent = new(ELeave) CMemSpyViewEComInterface( iEngine, iObserver, iImplementation.Interface() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iImplementation );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewEComImplementation::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iImplementation );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewFBServBitmaps.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,746 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewFBServBitmaps.h"
+
+// System includes
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyExportBitmapsToMemoryCardDialog.h"
+
+// Constants
+const TInt KMemSpyIdleResetListboxTimerPeriod = 500000;
+const TInt KMemSpyImageSlideshowPeriod = 1000000;
+
+
+
+CMemSpyViewFBServBase::CMemSpyViewFBServBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps )
+:   CMemSpyViewBase( aEngine, aObserver ), iBitmaps( aBitmaps )
+    {
+    }
+
+
+CMemSpyViewFBServBase::~CMemSpyViewFBServBase()
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBase::~CMemSpyViewFBServBase() - deleting bitmaps: 0x%08x", iBitmaps );
+#endif
+    delete iBitmaps;
+    }
+
+
+TBool CMemSpyViewFBServBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+	case EMemSpyCmdImagesSlideshow:
+    	OnCmdSlideShowL();
+        break;
+#ifndef __WINS__
+	case EMemSpyCmdImagesSaveAllToMemoryCard:
+        OnCmdExportToMemoryCardL();
+        break;
+#endif
+	case EMemSpyCmdImagesListing:
+        OnCmdImageListingL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewFBServBase::OnCmdSlideShowL()
+    {
+    TInt index = 0;
+    CMemSpyViewFBServSlideshow::NewLD( *iBitmaps, index );
+    
+    // Select the item that was last displayed
+    const TInt count = iBitmaps->Count();
+    if  ( iListBox && index >= 0 && index < count )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewFBServBase::OnCmdExportToMemoryCardL()
+    {
+    // Deletes itself
+    CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *iBitmaps );
+    }
+
+
+void CMemSpyViewFBServBase::OnCmdImageListingL()
+    {
+    // Begin a new data stream
+    _LIT( KMemSpyContext, "Bitmap List - " );
+    _LIT( KMemSpyFolder, "Bitmaps" );
+    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
+
+    // Set prefix for overall listing
+    _LIT(KOverallPrefix, "Bitmap List - ");
+    iEngine.Sink().OutputPrefixSetLC( KOverallPrefix );
+
+    // Create header
+    CMemSpyEngineFbServBitmap::OutputDataColumnsL( iEngine );
+    
+    // List items
+    const TInt count = iBitmaps->Count();
+    for(TInt i=0; i<count; i++)
+        {
+        const CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( i );
+        //
+        bitmap.OutputDataL( iEngine );
+        }
+
+    // Tidy up
+    CleanupStack::PopAndDestroy(); // prefix
+
+    // End data stream
+    iEngine.Sink().DataStreamEndL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewFBServBase( aEngine, aObserver, NULL )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps(1) - iBitmaps is: 0x%08x", iBitmaps );
+#endif
+    }
+
+
+CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps )
+:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBitmaps::CMemSpyViewFBServBitmaps(2) - iBitmaps is: 0x%08x", iBitmaps );
+#endif
+    }
+
+
+CMemSpyViewFBServBitmaps::~CMemSpyViewFBServBitmaps()
+    {
+    delete iIdleResetListboxTimer;
+    iBitmapHandles.Close();
+    }
+
+
+void CMemSpyViewFBServBitmaps::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Font & Bitmap Server" );
+    SetTitleL( KTitle );
+
+    if  ( iBitmaps == NULL )
+        {
+        // Prepare bitmap handles
+        iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( iBitmapHandles );
+
+        // Create bitmap array - construction occurs asynchronously
+        iBitmaps = CMemSpyEngineFbServBitmapArray::NewL( CActive::EPriorityIdle, iBitmapHandles, *this );
+        }
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Create idle listbox refresh timer
+    if  ( iBitmaps->Count() == 0 )
+        {
+        iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityLow );
+        }
+    else
+        {
+        if  ( aSelectionRune != NULL )
+            {
+            iCurrentBitmap = reinterpret_cast< CMemSpyEngineFbServBitmap* >( aSelectionRune );
+            const TInt index = iBitmaps->BitmapIndexByHandle( iCurrentBitmap->Handle() );
+            iListBox->SetCurrentItemIndex( index );
+            HandleListBoxItemSelectedL( index );
+            }
+
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewFBServBitmaps::RefreshL()
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBitmaps::RefreshL() - iBitmaps->Count(): %d", iBitmaps->Count());
+#endif
+
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewFBServBitmaps::ViewType() const
+    {
+    return EMemSpyViewTypeFBServBitmaps;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewFBServBitmaps::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewFBServBitmaps::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = new(ELeave) CMemSpyViewFBServBitmapInfo( iEngine, iObserver, iBitmaps, *iCurrentBitmap );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iBitmaps = NULL;
+
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewFBServBitmaps::HandleFbServBitmapArrayEventL( TEvent aEvent )
+    {
+    if  ( aEvent == EBitmapItemsCreated )
+        {
+        }
+    else if ( aEvent == EBitmapArrayConstructionComplete )
+        {
+        }
+    //
+    iIdleResetListboxTimer->Cancel();
+    iIdleResetListboxTimer->Start( KMemSpyIdleResetListboxTimerPeriod/2, KMemSpyIdleResetListboxTimerPeriod, TCallBack( IdleUpdateListBoxModel, this ) );
+    }
+
+
+void CMemSpyViewFBServBitmaps::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iBitmaps );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewFBServBitmaps::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    const TInt count = iBitmaps->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( aIndex );
+        iCurrentBitmap = &bitmap;
+        }
+    else
+        {
+        iCurrentBitmap = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewFBServBitmaps::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    const TInt count = iBitmaps->Count();
+    if  ( aIndex >= 0 && aIndex < count )
+        {
+        CMemSpyEngineFbServBitmap& bitmap = iBitmaps->At( aIndex );
+        iCurrentBitmap = &bitmap;
+        }
+    else
+        {
+        iCurrentBitmap = NULL;
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+TInt CMemSpyViewFBServBitmaps::IdleUpdateListBoxModel( TAny* aSelf )
+    {
+    CMemSpyViewFBServBitmaps* self = reinterpret_cast< CMemSpyViewFBServBitmaps* >( aSelf );
+    TRAP_IGNORE( self->DoIdleUpdateListBoxModelL() );
+    return EFalse;
+    }
+
+
+void CMemSpyViewFBServBitmaps::DoIdleUpdateListBoxModelL()
+    {
+    // Try to maintain current item selection if at all possible.
+    TInt handle = 0;
+    if  ( iCurrentBitmap )
+        {
+        handle = iCurrentBitmap->Handle();
+        iCurrentBitmap = NULL;
+        }
+   
+    // Update list box & model
+    iListBox->HandleItemAdditionL();
+    iListBox->DrawDeferred();
+    
+    // Try to select previous item if it is still available
+    const TInt index = iBitmaps->BitmapIndexByHandle( handle );
+    if  ( index >= 0 && index < iBitmaps->Count() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        }
+
+    iIdleResetListboxTimer->Cancel();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewFBServBitmapInfo::CMemSpyViewFBServBitmapInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap )
+:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps ), iBitmapObject( aSelectedBitmap )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBitmapInfo::CMemSpyViewFBServBitmapInfo() - iBitmaps is: 0x%08x", iBitmaps );
+#endif
+    }
+
+
+void CMemSpyViewFBServBitmapInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Bitmap Details" );
+    SetTitleL( KTitle );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    
+    if  ( iBitmaps->Count() )
+        {
+        iListBox->SetCurrentItemIndex( 0 );
+        HandleListBoxItemSelectedL( 0 );
+        }
+    }
+
+
+void CMemSpyViewFBServBitmapInfo::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewFBServBitmapInfo::ViewType() const
+    {
+    return EMemSpyViewTypeFBServBitmapInfo;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewFBServBitmapInfo::PrepareParentViewL()
+    {
+    CMemSpyViewFBServBitmaps* parent = new(ELeave) CMemSpyViewFBServBitmaps( iEngine, iObserver, iBitmaps );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iBitmaps = NULL;
+
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iBitmapObject );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewFBServBitmapInfo::PrepareChildViewL()
+    {
+    CMemSpyViewFBServBitmapViewer* child = new(ELeave) CMemSpyViewFBServBitmapViewer( iEngine, iObserver, iBitmaps, iBitmapObject );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iBitmaps = NULL;
+
+    CleanupStack::PushL( child );
+    CEikAppUi* appUi = static_cast< CEikAppUi* >( iEikonEnv->AppUi() );
+    const TRect rect( TPoint( 0, 0 ), appUi->ClientRect().Size() );
+    child->ConstructL( rect, *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewFBServBitmapInfo::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iBitmapObject );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewFBServBitmapInfo::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    // Only report the event if its the first item that was actioned
+    if  ( aIndex == 0 )
+        {
+        ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+        }
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewFBServBitmapViewer::CMemSpyViewFBServBitmapViewer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyEngineFbServBitmapArray* aBitmaps, CMemSpyEngineFbServBitmap& aSelectedBitmap )
+:   CMemSpyViewFBServBase( aEngine, aObserver, aBitmaps ), iBitmapObject( aSelectedBitmap )
+    {
+#ifdef _DEBUG
+    RDebug::Printf("CMemSpyViewFBServBitmapViewer::CMemSpyViewFBServBitmapViewer() - iBitmaps is: 0x%08x", iBitmaps );
+#endif
+    }
+
+
+CMemSpyViewFBServBitmapViewer::~CMemSpyViewFBServBitmapViewer()
+    {
+    delete iImage;
+    }
+
+
+void CMemSpyViewFBServBitmapViewer::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Bitmap Preview" );
+    SetTitleL( KTitle );
+
+    // Finish construction
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Prepare image
+    iImage = new(ELeave) CEikImage();
+    iImage->SetContainerWindowL( *this );
+    iImage->SetPicture( &iBitmapObject.Bitmap(), NULL );
+    iImage->SetPictureOwnedExternally( ETrue );
+    SizeChanged();
+    }
+
+
+void CMemSpyViewFBServBitmapViewer::RefreshL()
+    {
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewFBServBitmapViewer::ViewType() const
+    {
+    return EMemSpyViewTypeFBServBitmapViewer;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewFBServBitmapViewer::PrepareParentViewL()
+    {
+    CMemSpyViewFBServBitmapInfo* parent = new(ELeave) CMemSpyViewFBServBitmapInfo( iEngine, iObserver, iBitmaps, iBitmapObject );
+
+    // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+    // This object is about to die in any case.
+    iBitmaps = NULL;
+
+    CleanupStack::PushL( parent );
+    CEikAppUi* appUi = static_cast< CEikAppUi* >( iEikonEnv->AppUi() );
+    const TRect rect( TPoint( 0, 0 ), appUi->ClientRect().Size() );
+    parent->ConstructL( rect, *Parent() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewFBServBitmapViewer::SetListBoxModelL()
+    {
+    }
+
+
+CEikListBox* CMemSpyViewFBServBitmapViewer::ConstructListBoxL()
+    {
+    return NULL;
+    }
+
+
+void CMemSpyViewFBServBitmapViewer::Draw( const TRect& /*aRect*/ ) const
+    {
+    CWindowGc& gc = SystemGc();
+    //
+    gc.SetPenStyle( CGraphicsContext::ENullPen );
+    gc.SetBrushColor( KRgbWhite );
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.DrawRect( Rect() );
+    //
+    gc.SetBrushColor( KRgbBlack );
+    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    gc.DrawRect( iBorderRect );
+    }
+    
+
+void CMemSpyViewFBServBitmapViewer::SizeChanged()
+    {
+    TRect rect( Rect() );
+    TSize size( rect.Size() );
+    //
+    TSize bitmapSize( iBitmapObject.Bitmap().SizeInPixels() );
+
+    // Try to center image, if possible.
+    if  ( bitmapSize.iWidth < size.iWidth )
+        {
+        const TInt offset = ( size.iWidth - bitmapSize.iWidth) / 2;
+        rect.Move( offset, 0 );
+        size.iWidth = bitmapSize.iWidth;
+        }
+    if  ( bitmapSize.iHeight < size.iHeight )
+        {
+        const TInt offset = ( size.iHeight - bitmapSize.iHeight) / 2;
+        rect.Move( 0, offset );
+        size.iHeight = bitmapSize.iHeight;
+        }
+    //
+    rect.SetSize( size );
+    if  ( iImage )
+        {
+        iImage->SetRect( rect );
+        }
+    iBorderRect = rect;
+    iBorderRect.Grow( 2, 2 );
+    }
+
+
+TInt CMemSpyViewFBServBitmapViewer::CountComponentControls() const
+    {
+    TInt count = 0;
+    //
+    if  ( iImage )
+        {
+        ++count;
+        }
+    //
+    return count;
+    }
+
+
+CCoeControl* CMemSpyViewFBServBitmapViewer::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return iImage;
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewFBServSlideshow::CMemSpyViewFBServSlideshow( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex )
+:   iBitmaps( aBitmaps ), iIndex( aIndex )
+    {
+    }
+
+
+CMemSpyViewFBServSlideshow::~CMemSpyViewFBServSlideshow()
+    {
+    delete iTimer;
+    }
+
+
+void CMemSpyViewFBServSlideshow::ConstructL()
+    {
+    iTimer = CPeriodic::NewL( CActive::EPriorityLow );
+    iTimer->Start( KMemSpyImageSlideshowPeriod, KMemSpyImageSlideshowPeriod, TCallBack( IdleUpdate, this ) );
+    }
+
+
+void CMemSpyViewFBServSlideshow::NewLD( CMemSpyEngineFbServBitmapArray& aBitmaps, TInt& aIndex )
+    {
+    CMemSpyViewFBServSlideshow* self = new(ELeave) CMemSpyViewFBServSlideshow( aBitmaps, aIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    //
+    self->ExecuteLD( R_MEMSPY_IMAGE_SLIDESHOW );
+    }
+
+
+void CMemSpyViewFBServSlideshow::PreLayoutDynInitL()
+    {
+    ShowNextImageL();
+    }
+
+
+TBool CMemSpyViewFBServSlideshow::OkToExitL( TInt /*aButtonId*/ )
+    {
+    return ETrue;
+    }
+
+
+TInt CMemSpyViewFBServSlideshow::IdleUpdate( TAny* aSelf )
+    {
+    CMemSpyViewFBServSlideshow* self = reinterpret_cast< CMemSpyViewFBServSlideshow* >( aSelf );
+    TRAP_IGNORE( self->ShowNextImageL() );
+    return EFalse;
+    }
+
+
+void CMemSpyViewFBServSlideshow::ShowNextImageL()
+    {
+	CEikImage* imageControl = static_cast< CEikImage* >( Control(EMemSpyCtrlIdSlideShowImage) );
+
+    // Get the right image
+    const TInt imageCount = iBitmaps.Count();
+    if  ( iIndex < imageCount )
+        {
+        CMemSpyEngineFbServBitmap& bitmap = iBitmaps.At( iIndex );
+        imageControl->SetPicture( &bitmap.Bitmap(), NULL );
+        imageControl->SetPictureOwnedExternally( ETrue );
+        
+        // Prepare title
+        const TSize size( bitmap.Bitmap().SizeInPixels() );
+        _LIT(KTitleFormat, "%3d x %3d");
+        TBuf<128> title;
+        title.Format( KTitleFormat, size.iWidth, size.iHeight );
+        SetTitleL( title );
+        //
+        User::ResetInactivityTime();
+        //
+        Layout();
+        //
+        ++iIndex;
+        }
+    else
+        {
+        // Dismiss myself.
+        delete this;
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewHeapTracking.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,435 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewHeapTracking.h"
+
+// System includes
+#include <hal.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelpersysmemtracker.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewHeapTrackingSettings.h"
+#include "MemSpyViewHeapTrackingResults.h"
+
+
+CMemSpyViewHeapTracking::CMemSpyViewHeapTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver ),
+    iState( EMemSpyViewHeapTrackingStateIdle )
+    {
+    if ( iEngine.HelperSysMemTracker().IsActive() )
+        {
+        iState = EMemSpyViewHeapTrackingStateTimerOn;
+        }
+    }
+
+
+CMemSpyViewHeapTracking::~CMemSpyViewHeapTracking()
+    {
+    delete iStopTimerCallBack;
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    }
+
+
+void CMemSpyViewHeapTracking::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "System-Wide Memory Tracking" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    
+    // Backup current config because it may be overwritten with Basic/Full mode settings.
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+    iOriginalConfig = config;
+    
+    if ( config.iMode != TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
+        {
+        // Set config. Needed for updating config for Basic or Full mode.
+        SetConfigByModeL( config.iMode, config );        
+        }
+        
+    // Make sure the correct item is selected
+    TInt index = 0;
+    if  ( aSelectionRune != NULL )
+        {
+        const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
+        index = IndexByViewType( viewType );
+        }
+    iListBox->SetCurrentItemIndex( index );
+    HandleListBoxItemSelectedL( index );
+    }
+
+
+void CMemSpyViewHeapTracking::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewHeapTracking::ViewType() const
+    {
+    return EMemSpyViewTypeHeapTracking;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTracking::PrepareParentViewL()
+    {
+    
+    // Save custom settings even if mode is Basic or Full
+    TRAP_IGNORE(
+        CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+        TMemSpyEngineHelperSysMemTrackerConfig config;
+        swmt.GetConfig( config );
+        config.iEnabledCategories = iOriginalConfig.iEnabledCategories;
+        config.iThreadNameFilter = iOriginalConfig.iThreadNameFilter;
+        config.iDumpData = iOriginalConfig.iDumpData;
+        swmt.SetConfigL( config );
+        Settings().StoreSettingsL();
+        );
+    
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTracking::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    
+    // Get current config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+    
+    //
+    if  ( index == 0 )
+        {
+        // This is the start/stop toggle so we don't make a child view
+        child = NULL; 
+
+        // ... instead we either start or stop the tracker
+        if  ( !iEngine.HelperSysMemTracker().IsActive() )
+            {
+            iState = EMemSpyViewHeapTrackingStateSingleOn;
+            // Setting observer to be able to stop SWMT after first cycle is completed
+            iEngine.HelperSysMemTracker().SetObserver( this );
+            iEngine.HelperSysMemTracker().StartL();
+            }
+
+        // Redraw listbox 
+        RefreshL();
+        }
+    else if  ( index == 1 )
+        {
+        // This is the start/stop toggle so we don't make a child view
+        child = NULL; 
+
+        // ... instead we either start or stop the tracker
+        if  ( iEngine.HelperSysMemTracker().IsActive() && iState == EMemSpyViewHeapTrackingStateTimerOn )
+            {
+            iState = EMemSpyViewHeapTrackingStateIdle;
+            iEngine.HelperSysMemTracker().StopL();
+            }
+        else if ( iState == EMemSpyViewHeapTrackingStateIdle )
+            {
+            iState = EMemSpyViewHeapTrackingStateTimerOn;
+            iEngine.HelperSysMemTracker().StartL();
+            }
+
+        // Redraw listbox 
+        RefreshL();
+        }
+    else if ( index == 2 )
+        {
+        switch ( config.iMode )
+            {
+            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
+                {
+                // Set Full mode
+                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull, config );
+                break;
+                }
+            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
+                {
+                // Set Custom mode
+                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom, config );
+                break;
+                }
+            case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
+                {
+                // Set Basic mode
+                SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic, config );
+                break;
+                }
+            default: break;
+            }
+                
+        // Redraw listbox 
+        RefreshL();
+        }
+    else if ( index == 3 )
+        {        
+        if ( config.iMode == TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
+            {
+            child = new(ELeave) CMemSpyViewHeapTrackingSettings( iEngine, iObserver );
+            }
+        else
+            {
+            child = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
+            }
+        }
+    else if ( index == 4 )
+        {
+        child = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
+        }
+    if  ( child )
+        {
+        CleanupStack::PushL( child );
+        child->ConstructL( Rect(), *Parent() );
+        CleanupStack::Pop( child );
+        }
+    
+    //
+    return child;
+    }
+
+
+void CMemSpyViewHeapTracking::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+    
+    // Get current config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+
+    // 1st item
+    _LIT( KItem1FormatEnable, "\tGet dump now" );
+    model->AppendL( KItem1FormatEnable );
+
+    
+    // 1st item
+    if  ( iEngine.HelperSysMemTracker().IsActive() && iState == EMemSpyViewHeapTrackingStateTimerOn )
+        {
+        _LIT( KItem1FormatEnable, "\tStop timer\t\t%d (sec)" );
+        TName item;
+        item.Format( KItem1FormatEnable, config.iTimerPeriod.Int() / 1000000 );
+        model->AppendL( item );
+        }
+    else
+        {
+        _LIT( KItem1FormatEnable, "\tStart timer\t\t%d (sec)" );
+        TName item;
+        item.Format( KItem1FormatEnable, config.iTimerPeriod.Int() / 1000000 );
+        model->AppendL( item );
+        }
+    
+    // 2nd item
+    switch ( config.iMode )
+        {
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
+            {
+            _LIT( KItem2Format, "\tTracking mode\t\tBasic" );
+            model->AppendL( KItem2Format );        
+            break;
+            }
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
+            {
+            _LIT( KItem2Format, "\tTracking mode\t\tFull" );
+            model->AppendL( KItem2Format );        
+            break;
+            }
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
+            {
+            _LIT( KItem2Format, "\tTracking mode\t\tCustom" );
+            model->AppendL( KItem2Format );
+            
+            // 3rd item
+            TFullName item;
+            if ( config.DumpData() && 
+                config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap )
+                {
+                _LIT( KItem3Format, "\tSettings\t\t%d categ., dump" );
+                item.Format( KItem3Format, config.EnabledCategoryCount() );
+                }
+            else
+                {
+                _LIT( KItem3Format, "\tSettings\t\t%d categories" );
+                item.Format( KItem3Format, config.EnabledCategoryCount() );
+                }
+            model->AppendL( item );            
+            break;
+            }
+        default: break;
+        }
+    
+    // 4th item    
+    const TInt cycleCount = iEngine.HelperSysMemTracker().MdcaCount();
+    if ( cycleCount )
+        {
+        _LIT( KItem2Format, "\tResults\t\t%d cycles" );
+        TFullName item;
+        item.Format( KItem2Format, cycleCount );
+        model->AppendL( item );
+        }
+    else
+        {
+        _LIT( KItem2Format, "\tResults\t\tNo results" );
+        model->AppendL( KItem2Format );
+        }
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+void CMemSpyViewHeapTracking::HandleCyclesResetL()
+    {
+    }
+
+
+void CMemSpyViewHeapTracking::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    }
+
+
+void CMemSpyViewHeapTracking::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    // Stopping SWMT does not work directly from this function.
+    // It has to be made asynchronously.
+    iStopTimerCallBack = new (ELeave) CAsyncCallBack( TCallBack( CMemSpyViewHeapTracking::AsyncStopTimerCallback, this ), CActive::EPriorityStandard );
+    iStopTimerCallBack->CallBack();
+    }
+
+
+TInt CMemSpyViewHeapTracking::IndexByViewType( TMemSpyViewType aType )
+    {
+    // Get current config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+    
+    TInt index = 0;
+    //
+    switch( aType )
+        {
+    default:
+    case EMemSpyViewTypeHeapTrackingResults:
+        {
+        if ( config.iMode == TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom )
+            {
+            index = 4;
+            }
+        else
+            {
+            index = 3;
+            }
+        break;
+        }
+    case EMemSpyViewTypeHeapTrackingSettings:
+        index = 3;
+        break;
+        }
+    //
+    return index;
+    }
+
+
+void CMemSpyViewHeapTracking::SetConfigByModeL( TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode aMode, TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
+    {
+    switch ( aMode )
+        {
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeBasic:
+            {
+            aConfig.iMode = aMode;
+            aConfig.iEnabledCategories = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap |
+                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks |
+                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData |
+                                         TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory;
+            aConfig.iDumpData = EFalse;
+            break;
+            }
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeFull:
+            {
+            aConfig.iMode = aMode;
+            aConfig.iEnabledCategories = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryAll;
+            aConfig.iDumpData = ETrue;
+            aConfig.iThreadNameFilter = KNullDesC;
+            break;
+            }
+        case TMemSpyEngineHelperSysMemTrackerConfig::MemSpyEngineSysMemTrackerModeCustom:
+            {
+            aConfig.iMode = aMode;
+            aConfig.iEnabledCategories = iOriginalConfig.iEnabledCategories;
+            aConfig.iDumpData = iOriginalConfig.iDumpData;
+            aConfig.iThreadNameFilter = iOriginalConfig.iThreadNameFilter;
+            break;
+            }
+        default: User::Leave( KErrArgument );
+        }
+    // Push changes to SWMT
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    swmt.SetConfigL( aConfig );
+    Settings().StoreSettingsL();
+    }
+
+
+TInt CMemSpyViewHeapTracking::AsyncStopTimerCallback( TAny* aParam )
+    {
+    CMemSpyViewHeapTracking* view = static_cast<CMemSpyViewHeapTracking*>( aParam );
+    return view->AsyncStopTimerCallback();
+    }
+
+
+TInt CMemSpyViewHeapTracking::AsyncStopTimerCallback()
+    {
+    iState = EMemSpyViewHeapTrackingStateIdle;
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    TRAP_IGNORE(
+        iEngine.HelperSysMemTracker().StopL();
+        RefreshL();
+        );
+    delete iStopTimerCallBack;
+    iStopTimerCallBack = NULL;
+    return KErrNone;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewHeapTrackingResults.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,434 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewHeapTrackingResults.h"
+
+// System includes
+#include <hal.h>
+#ifdef __EPOC32__
+#include <e32rom.h>
+#endif
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackercycle.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackercyclechange.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackerenums.h>
+#include <memspy/engine/memspyenginehelpersysmemtracker.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
+#include <memspyui.rsg>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyContainer.h"
+#include "MemSpyViewHeapTracking.h"
+#include "MemSpyContainerObserver.h"
+
+
+CMemSpyViewHeapTrackingResults::CMemSpyViewHeapTrackingResults( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    iEngine.HelperSysMemTracker().SetObserver( this );
+    }
+
+
+CMemSpyViewHeapTrackingResults::~CMemSpyViewHeapTrackingResults()
+    {
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    }
+
+
+void CMemSpyViewHeapTrackingResults::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Results Summary" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Make sure the correct item is selected
+    const TInt cycleNumber = ((TInt) aSelectionRune);
+    const TInt maxCycle = iEngine.HelperSysMemTracker().MdcaCount();
+    if  ( cycleNumber > 0 && cycleNumber <= maxCycle )
+        {
+        iListBox->SetCurrentItemIndex( cycleNumber - 1 );
+        HandleListBoxItemSelectedL( cycleNumber );
+        }
+    }
+
+
+void CMemSpyViewHeapTrackingResults::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewHeapTrackingResults::ViewType() const
+    {
+    return EMemSpyViewTypeHeapTrackingResults;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingResults::PrepareParentViewL()
+    {
+    CMemSpyViewHeapTracking* parent = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    //
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    //
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingResults::PrepareChildViewL()
+    {
+    const TInt index = iListBox->CurrentItemIndex();
+    //
+    CMemSpyViewBase* child = NULL;
+    if  ( index >= 0 )
+        {
+        const CMemSpyEngineHelperSysMemTrackerCycle* cycle = iEngine.HelperSysMemTracker().CompletedCycles()[ index ];
+        //
+        child = new(ELeave) CMemSpyViewHeapTrackingResultsCycleInfo( iEngine, iObserver, *cycle );
+        CleanupStack::PushL( child );
+        child->ConstructL( Rect(), *Parent() );
+        CleanupStack::Pop( child );
+        //
+        iEngine.HelperSysMemTracker().RemoveObserver( this );
+        }
+    //
+    return child;
+    }
+
+
+void CMemSpyViewHeapTrackingResults::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    MDesCArray* contents = &iEngine.HelperSysMemTracker();
+    listbox->Model()->SetItemTextArray( contents );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewHeapTrackingResults::HandleCyclesResetL()
+    {
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewHeapTrackingResults::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    }
+
+
+void CMemSpyViewHeapTrackingResults::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    SetListBoxCurrentItemIndexL( iEngine.HelperSysMemTracker().MdcaCount() - 1 );
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewHeapTrackingResultsCycleInfo::CMemSpyViewHeapTrackingResultsCycleInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
+:   CMemSpyViewBase( aEngine, aObserver ), iCycle( aCycle )
+    {
+    iEngine.HelperSysMemTracker().SetObserver( this );
+    }
+
+
+CMemSpyViewHeapTrackingResultsCycleInfo::~CMemSpyViewHeapTrackingResultsCycleInfo()
+    {
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitleFormat, "Cycle Summary [%04d]" );
+    TBuf<30> buf;
+    buf.Format( KTitleFormat, iCycle.CycleNumber() );
+    SetTitleL( buf );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // Make sure the correct item is selected
+    const TInt index = ((TInt) aSelectionRune);
+    iListBox->SetCurrentItemIndex( index );
+    HandleListBoxItemSelectedL( index );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewHeapTrackingResultsCycleInfo::ViewType() const
+    {
+    return EMemSpyViewTypeHeapTrackingResultsCycleInfo;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingResultsCycleInfo::PrepareParentViewL()
+    {
+    CMemSpyViewHeapTrackingResults* parent = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) iCycle.CycleNumber() );
+    CleanupStack::Pop( parent );
+    //
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    //
+    return parent;
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::SetListBoxModelL()
+    {
+    MDesCArray& model = const_cast< MDesCArray& >( static_cast< const MDesCArray&>( iCycle ) );
+    //
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCyclesResetL()
+    {
+    Container().NavigateToParentViewL();
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    }
+
+
+void CMemSpyViewHeapTrackingResultsCycleInfo::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ )
+    {
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+
+
+
+CMemSpyViewHeapTrackingResultsChangeDescriptor::CMemSpyViewHeapTrackingResultsChangeDescriptor( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, const CMemSpyEngineHelperSysMemTrackerCycle& aCycle, const CMemSpyEngineHelperSysMemTrackerCycleChange& aChangeDescriptor, TInt aIndex )
+:   CMemSpyViewBase( aEngine, aObserver ), iCycle( aCycle ), iChangeDescriptor( aChangeDescriptor ), iIndex( aIndex )
+    {
+    iEngine.HelperSysMemTracker().SetObserver( this );
+    }
+
+
+CMemSpyViewHeapTrackingResultsChangeDescriptor::~CMemSpyViewHeapTrackingResultsChangeDescriptor()
+    {
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    TBuf<30> buf;
+    if  ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHeapUser )
+        {
+        _LIT( KTitleFormat, "User Heap Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHeapKernel )
+        {
+        _LIT( KTitleFormat, "Kernel Heap Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeChunk )
+        {
+        _LIT( KTitleFormat, "Chunk Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeRamDrive )
+        {
+        _LIT( KTitleFormat, "RAM Drive Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeStack )
+        {
+        _LIT( KTitleFormat, "Stack Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeGlobalData )
+        {
+        _LIT( KTitleFormat, "Global Data Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeCode )
+        {
+        _LIT( KTitleFormat, "RAM-Loaded Code Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeHandle )
+        {
+        _LIT( KTitleFormat, "Handle Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeOpenFile )
+        {
+        _LIT( KTitleFormat, "Open File Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeDiskSpace )
+        {
+        _LIT( KTitleFormat, "Disk Space Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    else if ( iChangeDescriptor.Type() == EMemSpyEngineSysMemTrackerTypeBitmap )
+        {
+        _LIT( KTitleFormat, "Bitmap Change [%04d]" );
+        buf.Format( KTitleFormat, iCycle.CycleNumber() );
+        }
+    //
+    SetTitleL( buf );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewHeapTrackingResultsChangeDescriptor::ViewType() const
+    {
+    return EMemSpyViewTypeHeapTrackingResultsCycleChangeDescriptor;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingResultsChangeDescriptor::PrepareParentViewL()
+    {
+    CMemSpyViewHeapTrackingResultsCycleInfo* parent = new(ELeave) CMemSpyViewHeapTrackingResultsCycleInfo( iEngine, iObserver, iCycle );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) iIndex );
+    CleanupStack::Pop( parent );
+    //
+    iEngine.HelperSysMemTracker().RemoveObserver( this );
+    //
+    return parent;
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::SetListBoxModelL()
+    {
+    MDesCArray& model = const_cast< MDesCArray& >( static_cast< const MDesCArray&>( iChangeDescriptor ) );
+    //
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCyclesResetL()
+    {
+    CMemSpyViewHeapTrackingResults* mainResultsMenu = new(ELeave) CMemSpyViewHeapTrackingResults( iEngine, iObserver );
+    CleanupStack::PushL( mainResultsMenu );
+    mainResultsMenu->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( mainResultsMenu );
+    //
+    Container().SetNewActiveViewL( mainResultsMenu );
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCycleStartedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
+    {
+    }
+
+
+void CMemSpyViewHeapTrackingResultsChangeDescriptor::HandleCycleFinishedL( const CMemSpyEngineHelperSysMemTrackerCycle& aCycle )
+    {
+    }
+*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewHeapTrackingSettings.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,422 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewHeapTrackingSettings.h"
+
+// System includes
+#include <hal.h>
+#ifdef __EPOC32__
+#include <e32rom.h>
+#endif
+#include <AknQueryDialog.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelpersysmemtracker.h>
+#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
+#include <memspyui.rsg>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpySettings.h"
+#include "MemSpyViewHeapTracking.h"
+#include "MemSpyContainerObserver.h"
+
+
+CMemSpyViewHeapTrackingSettings::CMemSpyViewHeapTrackingSettings( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewHeapTrackingSettings::~CMemSpyViewHeapTrackingSettings()
+    {
+    }
+
+
+void CMemSpyViewHeapTrackingSettings::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Settings" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewHeapTrackingSettings::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewHeapTrackingSettings::ViewType() const
+    {
+    return EMemSpyViewTypeHeapTrackingSettings;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareParentViewL()
+    {
+    CMemSpyViewHeapTracking* parent = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareChildViewL()
+    {
+    const TInt index = iListBox->CurrentItemIndex();
+
+    // Get current config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+
+    // This view abuses the child view callback to toggle field values and/or
+    // display settings dialogs.
+    if  ( index == 0 )
+        {
+        TInt period = config.iTimerPeriod.Int() / 1000000;
+        CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( period );
+        if  ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_TIMER_PERIOD ) )
+            {
+            config.iTimerPeriod = period * 1000000;
+            }
+        }
+    else if ( index == 1 )
+        {
+        TInt categories( config.iEnabledCategories );
+        CSWMTCategorySelectionCheckBoxSettingItem* settingItem = new (ELeave) CSWMTCategorySelectionCheckBoxSettingItem( 0, categories );
+        CleanupStack::PushL( settingItem );
+        settingItem->ConstructL( EFalse,
+                                 0,
+                                 _L("SWMT Categories"),
+                                 NULL,
+                                 R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE,
+                                 EAknCtPopupSettingList,
+                                 NULL,
+                                 NULL );
+        
+        CMemSpySWMTCategorySelectionCheckBoxSettingPage* dlg = new(ELeave) CMemSpySWMTCategorySelectionCheckBoxSettingPage( R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE, settingItem->ItemArray() );
+        dlg->SetSettingPageObserver( settingItem );
+        if  ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
+            {
+            config.iEnabledCategories = categories;
+            }
+        CleanupStack::PopAndDestroy( settingItem );
+        }
+    else if ( index == 2 )
+        {
+        config.iDumpData = !config.iDumpData;
+        }
+    else if  ( index == 3 )
+        {
+        TName nameFilter;
+        nameFilter.Copy( config.iThreadNameFilter );
+        CMemSpyAllowEmptyDataDialog* dialog = new (ELeave) CMemSpyAllowEmptyDataDialog( nameFilter );
+        if  ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_NAME_FILTER ) )
+            {
+            config.iThreadNameFilter = nameFilter;
+            }
+        }
+    
+    // Push changes to SWMT
+    swmt.SetConfigL( config );
+    Settings().StoreSettingsL();
+
+    RefreshL();
+    return NULL;
+    }
+
+
+void CMemSpyViewHeapTrackingSettings::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    // Get current config
+    CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
+    TMemSpyEngineHelperSysMemTrackerConfig config;
+    swmt.GetConfig( config );
+
+    // 1st item
+    _LIT( KItem1Format, "\tTracking timer period\t\t%d (sec)" );
+    item.Format( KItem1Format, config.iTimerPeriod.Int() / 1000000 );
+    model->AppendL( item );
+    
+    // 2nd item
+    _LIT( KItem3Format, "\tCategories\t\t%d selected" );
+    item.Format( KItem3Format, config.EnabledCategoryCount() );
+    model->AppendL( item );
+
+    // following items are related only to User Heap category, 
+    // so hide them if User Heap is not selected
+    if ( config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap )
+        {
+        // 3th item
+        _LIT( KItem2Format, "\tDump data" );
+        PrepareItemBufL( item, KItem2Format, config.iDumpData, config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap && config.iThreadNameFilter.Length() > 0 );
+        model->AppendL( item );
+        
+        // 4th item
+        if ( config.iDumpData )
+            {
+            _LIT( KItem4Format, "\tHeap data thread filter\t\t%S" );
+            if ( config.iThreadNameFilter.Length() > 0 )
+                {
+                item.Format( KItem4Format, &config.iThreadNameFilter );
+                }
+            else
+                {
+                item.Format( KItem4Format, &_L("No filtering") );
+                }
+            model->AppendL( item );        
+            }        
+        }
+    
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+void CMemSpyViewHeapTrackingSettings::PrepareItemBufL( TDes& aBuf, const TDesC& aCaption, TBool aStatus, TBool aHeapCategorySelected )
+    {
+    aBuf.Copy( aCaption ); 
+    //
+    if  ( aStatus )
+        {
+        if ( aHeapCategorySelected )
+            {
+            _LIT( KItemEnabled, "\t\tCustom" );
+            aBuf.Append( KItemEnabled );            
+            }
+        else
+            {
+            _LIT( KItemEnabled, "\t\tAll user heaps" );
+            aBuf.Append( KItemEnabled );   
+            }
+        }
+    else
+        {
+        _LIT( KItemDisabled, "\t\tDisabled" );
+        aBuf.Append( KItemDisabled );
+        }
+    }
+
+
+
+
+
+
+
+
+
+// --------------------------------------------------------------------------------------------
+
+CSWMTCategorySelectionCheckBoxSettingItem::CSWMTCategorySelectionCheckBoxSettingItem( TInt aIdentifier, TInt& aCategories ): 
+    CAknSettingItem(aIdentifier), iExtCategories( aCategories ) 
+    {
+    }   
+
+
+CSWMTCategorySelectionCheckBoxSettingItem::~CSWMTCategorySelectionCheckBoxSettingItem()
+    {
+    delete iSettingText;
+    if( iItemArray )
+        {
+        iItemArray->ResetAndDestroy();
+        delete iItemArray;
+        }
+    }
+
+
+CSelectionItemList* CSWMTCategorySelectionCheckBoxSettingItem::ItemArray() const
+    {
+    return iItemArray;
+    }
+
+
+void CSWMTCategorySelectionCheckBoxSettingItem::AddNewItemToArrayL(const TDesC& aLabel)
+    {
+    TBuf<64> buf;
+    buf.Copy( aLabel );    
+    CSelectableItem* item = new (ELeave) CSelectableItem( buf, EFalse );
+    CleanupStack::PushL( item );
+    item->ConstructL();
+    iItemArray->AppendL( item ); // Ownership is transferred
+    CleanupStack::Pop(); // item    
+    }
+    
+
+void CSWMTCategorySelectionCheckBoxSettingItem::CompleteConstructionL()
+    {
+    SetEmptyItemTextL(_L("Nothing selected"));
+    iItemArray = new(ELeave) CSelectionItemList(16);
+    AddNewItemToArrayL( _L("User Heap") );       // 0
+    AddNewItemToArrayL( _L("Kernel Heap") );     // 1
+    AddNewItemToArrayL( _L("User Stacks") );     // 2
+    AddNewItemToArrayL( _L("Global Data") );     // 3
+    AddNewItemToArrayL( _L("Disk Usage") );      // 4
+    AddNewItemToArrayL( _L("Open Files") );      // 5
+    AddNewItemToArrayL( _L("RAM-loaded Code") ); // 6
+    AddNewItemToArrayL( _L("System Memory") );   // 7
+    AddNewItemToArrayL( _L("Local Chunks") );    // 8
+    AddNewItemToArrayL( _L("Global Chunks") );   // 9
+    AddNewItemToArrayL( _L("RAM Drive") );       // 10
+    AddNewItemToArrayL( _L("FileServer Cache") );// 11
+    AddNewItemToArrayL( _L("Kernel Handles") );  // 12
+    AddNewItemToArrayL( _L("Bitmap Handles") );  // 13
+    AddNewItemToArrayL( _L("Window Groups") );   // 14
+    }
+
+
+void CSWMTCategorySelectionCheckBoxSettingItem::StoreL()
+    {
+    iExtCategories = 0;
+    if ( iItemArray->At( 11 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache; 
+    if ( iItemArray->At( 13 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles; 
+    if ( iItemArray->At( 0 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap; 
+    if ( iItemArray->At( 1 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap; 
+    if ( iItemArray->At( 8 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks; 
+    if ( iItemArray->At( 9 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks; 
+    if ( iItemArray->At( 10 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive; 
+    if ( iItemArray->At( 2 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks; 
+    if ( iItemArray->At( 3 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData; 
+    if ( iItemArray->At( 6 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode; 
+    if ( iItemArray->At( 12 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles; 
+    if ( iItemArray->At( 5 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles; 
+    if ( iItemArray->At( 4 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage; 
+    if ( iItemArray->At( 7 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory; 
+    if ( iItemArray->At( 14 )->SelectionStatus() )
+        iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups; 
+    }
+
+
+void CSWMTCategorySelectionCheckBoxSettingItem::LoadL()
+    {
+    iItemArray->At( 11 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache );
+    iItemArray->At( 13 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles );
+    iItemArray->At( 0 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap );
+    iItemArray->At( 1 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap );
+    iItemArray->At( 8 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks );
+    iItemArray->At( 9 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks );
+    iItemArray->At( 10 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive );
+    iItemArray->At( 2 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks );
+    iItemArray->At( 3 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData );
+    iItemArray->At( 6 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode );
+    iItemArray->At( 12 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles );
+    iItemArray->At( 5 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles );
+    iItemArray->At( 4 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage );
+    iItemArray->At( 7 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory );
+    iItemArray->At( 14 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups );
+    }
+
+
+void CSWMTCategorySelectionCheckBoxSettingItem::HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
+    {
+    switch( aEventType )
+        {
+        case EEventSettingOked:
+            {
+            // If settings oked, save new values
+            StoreL();
+            break;
+            }
+        case EEventSettingCancelled:
+            {
+            // If setting is cancelled, load old values
+            LoadL();
+            break;
+            }
+        case EEventSettingChanged:
+            {
+            // If setting has changed, update CBA visibility
+            static_cast<CMemSpySWMTCategorySelectionCheckBoxSettingPage*>( aSettingPage )->UpdateCba();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
+    }
+
+
+CMemSpySWMTCategorySelectionCheckBoxSettingPage::CMemSpySWMTCategorySelectionCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray )
+    : CAknCheckBoxSettingPage( aResourceID, aItemArray )
+    {
+    }
+
+
+void CMemSpySWMTCategorySelectionCheckBoxSettingPage::UpdateCba()
+    {
+    // Cache the pointer to button group container
+    CEikButtonGroupContainer* cba = Cba();
+    // Left softkey should be visible if there are items selected,
+    // i.e. the selection index array has items.
+    TBool visible( ListBoxControl()->View()->SelectionIndexes()->Count() > 0 );
+    // Resolve left softkey command id
+    TInt leftId( cba->ButtonGroup()->CommandId( 0 ) );
+    // Check if left softkey visibility has changed
+    if( visible != cba->IsCommandVisible( leftId ) )
+        {
+        // Left softkey visibility has changed, update it
+        cba->MakeCommandVisible( leftId, visible );
+        }
+    }
+
+
+
+
+CMemSpyAllowEmptyDataDialog::CMemSpyAllowEmptyDataDialog( TDes& aText, const TTone& aTone )
+    : CAknTextQueryDialog( aText, aTone )
+    {
+    }
+ 
+
+void CMemSpyAllowEmptyDataDialog::UpdateLeftSoftKeyL()
+    {
+    MakeLeftSoftkeyVisible( ETrue );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewKernel.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewKernel.h"
+
+// System includes
+#include <hal.h>
+#ifdef __EPOC32__
+#include <e32rom.h>
+#endif
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspysession.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewKernelHeap.h"
+#include "MemSpyViewKernelContainers.h"
+
+/*
+CMemSpyViewKernel::CMemSpyViewKernel( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+*/
+
+CMemSpyViewKernel::CMemSpyViewKernel( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aSession, aObserver )
+    {
+    }
+
+
+CMemSpyViewKernel::~CMemSpyViewKernel()
+    {
+    }
+
+
+void CMemSpyViewKernel::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Kernel" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    
+    // Make sure the correct item is selected
+    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
+    const TInt index = IndexByViewType( viewType );
+    iListBox->SetCurrentItemIndex( index );
+    HandleListBoxItemSelectedL( index );
+    }
+
+
+void CMemSpyViewKernel::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewKernel::ViewType() const
+    {
+    return EMemSpyViewTypeKernel;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernel::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iMemSpySession, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernel::PrepareChildViewL()
+    {
+	
+    CMemSpyViewBase* child = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    //
+    if  ( index == 0 )
+        {
+        //child = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
+		child = new(ELeave) CMemSpyViewKernelContainers( iMemSpySession, iObserver );
+        }
+    else if ( index == 1 )
+        {
+        //child = new(ELeave) CMemSpyViewKernelHeap( iEngine, iObserver );
+		child = new(ELeave) CMemSpyViewKernelHeap( iMemSpySession, iObserver );
+        }
+	
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;    
+    }
+
+
+void CMemSpyViewKernel::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    // 1st item = Processes
+    _LIT( KItem1Format, "\tObjects" );
+    item.Format( KItem1Format );
+    model->AppendL( item );
+    
+    // 2nd item = System Config
+    _LIT( KItem2Format, "\tHeap" );
+    model->AppendL( KItem2Format );
+	
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+TInt CMemSpyViewKernel::IndexByViewType( TMemSpyViewType aType )
+    {
+    TInt index = 0;
+    //
+    switch( aType )
+        {
+    default:
+    case EMemSpyViewTypeKernelContainers:
+        index = 0;
+        break;
+        
+    case EMemSpyViewTypeKernelHeap:
+        index = 1;
+        break;
+        }
+        
+    //
+    return index;
+    }
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,266 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewKernelContainers.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperkernelcontainers.h>
+
+#include <memspysession.h>
+#include <memspy/api/memspyapiprocess.h>
+#include <memspy/engine/memspyengineutils.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewKernel.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewKernelObjects.h"
+
+// Literal constants
+
+
+
+CMemSpyViewKernelContainers::CMemSpyViewKernelContainers( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aSession, aObserver )
+    {
+    }
+
+
+CMemSpyViewKernelContainers::~CMemSpyViewKernelContainers()
+    {
+    //delete iModel;
+    }
+
+
+void CMemSpyViewKernelContainers::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Kernel Objects" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewKernelContainers::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewKernelContainers::ViewType() const
+    {
+    return EMemSpyViewTypeKernelContainers;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelContainers::PrepareParentViewL()
+    {
+    CMemSpyViewKernel* parent = new(ELeave) CMemSpyViewKernel( iMemSpySession, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelContainers::PrepareChildViewL()
+    {	
+    CMemSpyViewBase* child = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    //child = new(ELeave) CMemSpyViewKernelObjects( iEngine, iObserver, iModel->At( index ).Type() );
+    child = new(ELeave) CMemSpyViewKernelObjects( iMemSpySession, iObserver, iKernelObjects[index]->Type() );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;   
+    }
+
+
+void CMemSpyViewKernelContainers::SetListBoxModelL()
+    {	
+	iMemSpySession.GetKernelObjects( iKernelObjects );
+		
+	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( iKernelObjects.Count() ); //array for formated items
+	
+	for( TInt i=0 ; i<iKernelObjects.Count() ; i++ )
+		{
+		TInt count = iKernelObjects[i]->Count();
+		TInt size = iKernelObjects[i]->Size();
+		const TMemSpySizeText sizeText( MemSpyEngineUtils::FormatSizeText( size, 0 ) ); //TODO: is this OK to call Engine Utils?
+								
+		HBufC* tempName = HBufC::NewL( iKernelObjects[i]->Name().Length() + 32 ); //TODO: to removed this bulharic constant
+		CleanupStack::PushL( tempName );
+		TPtr tempNamePtr( tempName->Des() );
+		tempNamePtr.Copy( iKernelObjects[i]->Name() );									
+		
+		_LIT(KNameFormat, "\t%S\t\t%d item");
+		TPtr pName( tempName->Des() );
+		//
+		const TPtrC pType( TypeAsString( iKernelObjects[i]->Type() ) );
+		//
+		pName.Format( KNameFormat, &pType, count );
+		//
+		if  ( count == 0 || count > 1 )
+			{
+			pName.Append( _L("s") );
+			}
+
+		pName.AppendFormat( _L(", %S"), &sizeText ); // TODO: to create some ServerUtils class with formating methods for size and type!
+		
+		model->AppendL( pName );
+		
+		CleanupStack::PopAndDestroy( tempName); //---
+		}
+	
+	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );	
+	listbox->Model()->SetItemTextArray( model );
+	listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+
+	/*
+    // Take ownership of new model
+    CMemSpyEngineHelperKernelContainers& kernelContainerManager = iEngine.HelperKernelContainers();
+    CMemSpyEngineGenericKernelObjectContainer* model = kernelContainerManager.ObjectsAllL();
+    delete iModel;
+    iModel = model;
+    
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    */
+    }
+
+
+TBool CMemSpyViewKernelContainers::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdKernelContainersOutput:
+        OnCmdOutputAllContainerContentsL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewKernelContainers::OnCmdOutputAllContainerContentsL()
+    {
+	/* TODO
+    CMemSpyEngineOutputSink& sink = iEngine.Sink();
+    iModel->OutputL( sink );
+    */
+    }
+
+//formating methods
+TPtrC CMemSpyViewKernelContainers::TypeAsString( TMemSpyDriverContainerType aType )
+    {
+    _LIT( KTypeUnknown, "Unknown Type" );
+    _LIT( KTypeThread, "Thread" );
+    _LIT( KTypeProcess, "Process" );
+    _LIT( KTypeChunk, "Chunk" );
+    _LIT( KTypeLibrary, "Library" );
+    _LIT( KTypeSemaphore, "Semaphore" );
+    _LIT( KTypeMutex, "Mutex" );
+    _LIT( KTypeTimer, "Timer" );
+    _LIT( KTypeServer, "Server" );
+    _LIT( KTypeSession, "Session" );
+    _LIT( KTypeLogicalDevice, "Logical Device" );
+    _LIT( KTypePhysicalDevice, "Physical Device" );
+    _LIT( KTypeLogicalChannel, "Logical Channel" );
+    _LIT( KTypeChangeNotifier, "Change Notifier" );
+    _LIT( KTypeUndertaker, "Undertaker" );
+    _LIT( KTypeMsgQueue, "Msg. Queue" );
+    _LIT( KTypePropertyRef, "Property Ref." );
+    _LIT( KTypeCondVar, "Conditional Var." );
+     //
+    TPtrC pType( KTypeUnknown );
+    //
+    switch( aType )
+        {
+    case EMemSpyDriverContainerTypeThread:
+        pType.Set( KTypeThread );
+        break;
+    case EMemSpyDriverContainerTypeProcess:
+        pType.Set( KTypeProcess );
+        break;
+    case EMemSpyDriverContainerTypeChunk:
+        pType.Set( KTypeChunk );
+        break;
+    case EMemSpyDriverContainerTypeLibrary:
+        pType.Set( KTypeLibrary );
+        break;
+    case EMemSpyDriverContainerTypeSemaphore:
+        pType.Set( KTypeSemaphore );
+        break;
+    case EMemSpyDriverContainerTypeMutex:
+        pType.Set( KTypeMutex );
+        break;
+    case EMemSpyDriverContainerTypeTimer:
+        pType.Set( KTypeTimer );
+        break;
+    case EMemSpyDriverContainerTypeServer:
+        pType.Set( KTypeServer );
+        break;
+    case EMemSpyDriverContainerTypeSession:
+        pType.Set( KTypeSession );
+        break;
+    case EMemSpyDriverContainerTypeLogicalDevice:
+        pType.Set( KTypeLogicalDevice );
+        break;
+    case EMemSpyDriverContainerTypePhysicalDevice:
+        pType.Set( KTypePhysicalDevice );
+        break;
+    case EMemSpyDriverContainerTypeLogicalChannel:
+        pType.Set( KTypeLogicalChannel );
+        break;
+    case EMemSpyDriverContainerTypeChangeNotifier:
+        pType.Set( KTypeChangeNotifier );
+        break;
+    case EMemSpyDriverContainerTypeUndertaker:
+        pType.Set( KTypeUndertaker );
+        break;
+    case EMemSpyDriverContainerTypeMsgQueue:
+        pType.Set( KTypeMsgQueue );
+        break;
+    case EMemSpyDriverContainerTypePropertyRef:
+        pType.Set( KTypePropertyRef );
+        break;
+    case EMemSpyDriverContainerTypeCondVar:
+        pType.Set( KTypeCondVar );
+        break;
+        
+    default:
+        break;
+        }
+    //
+    return pType;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,438 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewKernelHeap.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+#include <memspy/engine/memspyengineoutputlist.h>
+
+#include <memspysession.h>
+#include <memspy/api/memspyapiheap.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewKernel.h"
+#include "MemSpyContainerObserver.h"
+
+// Constants
+const TInt KMemSpyBufferSize = 20;
+
+// Literal constants
+_LIT(KMemSpyHexFormat, "0x%08x");
+_LIT(KMemSpyUnsignedFormat, "%u");
+_LIT(KMemSpyDecFormat, "%d");
+_LIT(KMemSpyLongFormat, "%Ld");
+_LIT(KMemSpyCaptionYes, "Yes");
+_LIT(KMemSpyCaptionNo, "No");
+
+
+CMemSpyViewKernelHeap::CMemSpyViewKernelHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver ) //cigasto: remember to uncomment from MMP!
+:   CMemSpyViewBase( aSession, aObserver )
+    {
+    }
+
+CMemSpyViewKernelHeap::~CMemSpyViewKernelHeap()
+    {
+    }
+
+
+void CMemSpyViewKernelHeap::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Kernel Heap" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewKernelHeap::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewKernelHeap::ViewType() const
+    {
+    return EMemSpyViewTypeKernelHeap;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelHeap::PrepareParentViewL()
+    {
+    CMemSpyViewKernel* parent = new(ELeave) CMemSpyViewKernel( iMemSpySession, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelHeap::PrepareChildViewL()
+    {	
+    CMemSpyViewBase* child = NULL;
+    return child;    
+    }
+
+
+void CMemSpyViewKernelHeap::SetListBoxModelL()
+    {	
+	CMemSpyApiHeap* iHeap;
+	iHeap = iMemSpySession.GetHeap( );
+		
+	CDesCArrayFlat* model = new (ELeave) CDesC16ArrayFlat( 22 ); //array for formated items TODO: to remove constant
+		
+	model = FormatModel( iHeap );	
+				
+	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+	listbox->Model()->SetItemTextArray( model );
+	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );	
+	
+	/*
+	// Get list contents
+	TMemSpyHeapInfo heapInfo;
+	iEngine.HelperHeap().GetHeapInfoKernelL( heapInfo );
+	CMemSpyEngineOutputList* list = iEngine.HelperHeap().NewHeapSummaryShortLC( heapInfo );
+
+	// Set up list box
+	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+	listbox->Model()->SetItemTextArray( list );
+	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+	CleanupStack::Pop( list );
+	*/
+	}
+
+
+TBool CMemSpyViewKernelHeap::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdKernelHeapDump:
+        OnCmdDumpKernelHeapL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewKernelHeap::OnCmdDumpKernelHeapL()
+    {
+	// TODO
+    //iEngine.HelperHeap().OutputHeapDataKernelL();
+    }
+
+
+//CDesCArrayFlat* CMemSpyViewKernelHeap::FormatModel( RArray<CMemSpyApiHeap*> &aHeap )
+CDesCArrayFlat* CMemSpyViewKernelHeap::FormatModel( CMemSpyApiHeap* aHeap )
+	{
+	CDesCArrayFlat* ret = new (ELeave) CDesC16ArrayFlat( 2 );
+	
+	 _LIT( KItem0, "Heap type" );		   	  
+	 _LIT( KItem1, "Heap size" );	  
+	 _LIT( KItem8b, "Heap base address" );	        	       
+	 _LIT( KItem1b, "Shared" );	        
+	 _LIT( KItem2, "Chunk size" );
+	 _LIT( KItem3, "Alloc. count" );
+	 _LIT( KItem4, "Free. count" );
+	 _LIT( KItem5, "Biggest alloc." );
+	 _LIT( KItem6, "Biggest free" );
+	 _LIT( KItem6a, "Total alloc." );
+	 _LIT( KItem6b, "Total free" );
+	 _LIT( KItem7, "Slack free space" );
+	 _LIT( KItem8a, "Fragmentation" );
+	 _LIT( KItem13, "Header size (A)" );
+	 _LIT( KItem14, "Header size (F)" );
+	 _LIT( KItem9a, "Overhead (alloc)" );
+	 _LIT( KItem9b, "Overhead (free)" );
+	 _LIT( KItem9c, "Overhead (total)" );
+	 _LIT( KItem9d, "Overhead" );
+	 _LIT( KItem10, "Min. length" );
+	 _LIT( KItem11, "Max. length" );
+	 _LIT( KItem12, "Debug Allocator Library" );
+	 
+	HBufC* iItem = HBufC::NewL( 64 );	
+	
+	iItem = FormatItem( KItem0, aHeap->Type() );
+	TPtr pItem( iItem->Des() );
+	ret->AppendL( pItem );
+	pItem.Zero();	
+	
+	iItem = FormatItem( KItem1, aHeap->Size() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();	
+	
+	TUint address( aHeap->BaseAddress() );	
+	iItem = FormatItem( KItem8b, address );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	if(aHeap->Shared()) //Yes / No value formatting		
+		iItem = FormatItem( KItem1b, KMemSpyCaptionYes );		
+	else		
+		iItem = FormatItem( KItem1b, KMemSpyCaptionNo );	
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem2, aHeap->ChunkSize() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem3, aHeap->AllocationsCount() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem4, aHeap->FreeCount() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem5, aHeap->BiggestAllocation() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem6, aHeap->BiggestFree() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem6a, aHeap->TotalAllocations() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem6b, aHeap->TotalFree() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem7, aHeap->SlackFreeSpace() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	TReal iOneHundred( aHeap->Size() );
+	TReal iValue( aHeap->Fragmentation() );	
+	iItem = FormatPercentageItem( KItem8a, iOneHundred, iValue );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem13, aHeap->HeaderSizeA() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem14, aHeap->HeaderSizeF() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem9a, aHeap->AllocationOverhead() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem9b, aHeap->FreeOverhead() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem9c, aHeap->TotalOverhead() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	TReal iOverhead( aHeap->Overhead() );	
+	iItem = FormatPercentageItem( KItem9d, iOneHundred, iOverhead );	
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	iItem = FormatItem( KItem10, aHeap->MinLength() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+		
+	iItem = FormatItem( KItem11, aHeap->MaxLength() );
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	if( aHeap->DebugAllocatorLibrary() )		
+		iItem = FormatItem( KItem12, KMemSpyCaptionYes );		
+	else
+		iItem = FormatItem( KItem12, KMemSpyCaptionNo );	
+	pItem = iItem->Des();
+	ret->AppendL( pItem );
+	pItem.Zero();
+	
+	return ret;
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TDesC& aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( aValue );
+	return retBuf;
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TInt aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+    
+	TBuf<KMemSpyBufferSize> val;
+    val.Format( KMemSpyDecFormat, aValue );
+    
+    pRetBuf.Append( _L("\t") );
+    pRetBuf.Append( aCaption );
+    pRetBuf.Append( _L("\t\t") );
+    pRetBuf.Append( val );    
+	
+	return retBuf;
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+    
+	TBuf<KMemSpyBufferSize> val;
+    //val.Format( KMemSpyDecFormat, aValue );
+	val.Format( KMemSpyHexFormat, aValue );
+    
+    pRetBuf.Append( _L("\t") );
+    pRetBuf.Append( aCaption );
+    pRetBuf.Append( _L("\t\t") );
+    pRetBuf.Append( val );    
+	
+	return retBuf;	
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, const TInt64& aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+	    
+	TBuf<KMemSpyBufferSize> val;
+	val.Format( KMemSpyLongFormat, aValue );
+	    
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( val );    
+		
+	return retBuf;	
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TAny* aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+		    
+	TBuf<KMemSpyBufferSize> val;
+	val.Format( KMemSpyHexFormat, aValue );
+		    
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( val );    
+			
+	return retBuf;	
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint* aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+		    
+	TBuf<KMemSpyBufferSize> val;
+	val.Format( KMemSpyHexFormat, aValue );
+		    
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( val );    
+			
+	return retBuf;	
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatItem( const TDesC& aCaption, TUint8* aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+		    
+	TBuf<KMemSpyBufferSize> val;
+	val.Format( KMemSpyHexFormat, aValue );
+		    
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( val );    
+			
+	return retBuf;	
+	}
+
+HBufC* CMemSpyViewKernelHeap::FormatPercentageItem( const TDesC& aCaption, TReal aOneHundredPercentValue, TReal aValue )
+	{
+	HBufC* retBuf = HBufC::NewL( 64 );	//buffer for formatted item
+	TPtr pRetBuf( retBuf->Des() );
+	pRetBuf.Zero();
+	
+    const TReal value = (TInt) (( aValue / aOneHundredPercentValue) * 100.0); // percentage value calculation    
+    _LIT(KPercentFormat, "%3.2f %%");
+    TMemSpyPercentText val;
+    val.Format( KPercentFormat, value );
+    
+	pRetBuf.Append( _L("\t") );
+	pRetBuf.Append( aCaption );
+	pRetBuf.Append( _L("\t\t") );
+	pRetBuf.Append( val );    
+			
+	return retBuf;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,894 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewKernelObjects.h"
+
+// System includes
+#include <eikspane.h>
+#include <aknnavide.h> 
+#include <akntabgrp.h>
+#include <eikclbd.h>
+#include <AknQueryDialog.h>
+#include <aknnotewrappers.h>
+#include <apgwgnam.h>
+#include <aknmessagequerydialog.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperkernelcontainers.h>
+#include <memspy/engine/memspyenginehelperserver.h>
+#include <memspy/engine/memspyenginehelpercondvar.h>
+
+#include <memspysession.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewKernel.h"
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewKernelContainers.h"
+
+const TInt KMaxInfoLength = 128;
+
+/*
+CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
+:   CMemSpyViewBase( aEngine, aObserver ),
+    iObjectType( aObjectType ),
+    iCurrItemIndex( KErrNotFound )
+    {
+    }
+*/
+CMemSpyViewKernelObjects::CMemSpyViewKernelObjects( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TMemSpyDriverContainerType aObjectType )
+:   CMemSpyViewBase( aSession, aObserver ),
+    iObjectType( aObjectType ),
+    iCurrItemIndex( KErrNotFound )
+    {
+    }
+
+
+CMemSpyViewKernelObjects::~CMemSpyViewKernelObjects()
+    {
+    if ( iNavContainer && iNavDecorator )
+        {
+        iNavContainer->Pop( iNavDecorator );
+        delete iNavDecorator;
+        }
+    delete iModel;
+    delete iItems;
+    delete iObjectList;
+    }
+
+
+void CMemSpyViewKernelObjects::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Kernel Objects" );
+    SetTitleL( KTitle );
+    iItems = new(ELeave) CDesCArrayFlat(5);
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    CreateTabsL();
+    }
+
+
+CEikListBox* CMemSpyViewKernelObjects::ConstructListBoxL()
+    {
+    delete iListBox;
+    iListBox = NULL;
+    CAknSingleStyleListBox* listbox = new (ELeave) CAknSingleStyleListBox();
+    iListBox = listbox;
+    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
+    listbox->SetContainerWindowL( *this );
+    listbox->CreateScrollBarFrameL( ETrue );
+    SetListBoxModelL();
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+    listbox->SetListBoxObserver( this );
+    listbox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
+    listbox->SetObserver( this );
+    return listbox;
+    }
+
+
+void CMemSpyViewKernelObjects::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewKernelObjects::ViewType() const
+    {
+    return EMemSpyViewTypeKernelObjects;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareParentViewL()
+    {	
+	if ( iNaviPane && iNavDecorator )
+	   {
+		iNaviPane->Pop( iNavDecorator );
+		delete iNavDecorator;
+		iNavDecorator = NULL;
+	   }	
+    //CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iEngine, iObserver );
+    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewKernelContainers( iMemSpySession, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewKernelObjects::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    if ( iListBox && 
+         iListBox->Model()->NumberOfItems() && 
+         iListBox->CurrentItemIndex() > KErrNotFound )
+        {
+        DetailsL();
+        }
+    return child;
+    }
+
+
+void CMemSpyViewKernelObjects::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+       {
+       if ( iObjectType > EMemSpyDriverContainerTypeProcess )
+           {
+           // Display Terminate, Switch to, End and Panic
+           // commands only for Threads and processes
+           aMenuPane->SetItemDimmed( EMemSpyCmdKernelObjects, ETrue );
+           }
+        }
+    }
+
+
+void CMemSpyViewKernelObjects::SetListBoxModelL()
+    {
+    _LIT( KLineFormatSpec, "\t%S" );
+    _LIT( KTab, "\t" );
+       
+    iMemSpySession.GetKernelObjectItems( iKernelObjectItems, iObjectType );
+
+    iModel = new (ELeave) CDesC16ArrayFlat( iKernelObjectItems.Count() ); //array for formated items
+        
+    for ( TInt i = 0; i < iKernelObjectItems.Count(); i++ )
+    	{
+		HBufC* tempName = HBufC::NewL( iKernelObjectItems[i]->Name().Length() + 16 );
+    	CleanupStack::PushL( tempName );
+    	TPtr tempNamePtr( tempName->Des() );
+    	tempNamePtr.Copy( KTab );
+    	tempNamePtr.Append( iKernelObjectItems[i]->Name() );
+    	iModel->AppendL( tempNamePtr );
+    	
+    	CleanupStack::PopAndDestroy( tempName ); 
+    	}
+    
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iModel );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );       
+    }
+
+
+TBool CMemSpyViewKernelObjects::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+        case EMemSpyCmdKernelObjectTerminate:
+            {
+            TRAPD( err, OnCmdTerminateL() );
+            if ( err )
+                {
+                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+                note->ExecuteLD( _L("Cannot terminate task") );
+                }
+            break;
+            }
+        case EMemSpyCmdKernelObjectSwitchTo:
+            {
+            TRAPD( err, OnCmdSwitchToL() );
+            if ( err )
+                {
+                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+                note->ExecuteLD( _L("Cannot bring to foreground") );
+                }
+            break;
+            }
+        case EMemSpyCmdKernelObjectEnd:
+            {
+            TRAPD( err, OnCmdEndL() );
+            if ( err )
+                {
+                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+                note->ExecuteLD( _L("Cannot end task") );
+                }
+            break;
+            }
+        case EMemSpyCmdKernelObjectPanic:
+            {
+            TRAPD( err, OnCmdPanicL() );
+            if ( err )
+                {
+                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+                note->ExecuteLD( _L("Cannot panic task") );
+                }
+            break;
+            }
+        default:
+            {
+            handled = CMemSpyViewBase::HandleCommandL( aCommand );
+            break;        
+            }
+        }
+    //
+    return handled;
+    }
+
+
+TKeyResponse CMemSpyViewKernelObjects::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+	// TODO: to remove support of tabs
+    TKeyResponse resp = EKeyWasNotConsumed;
+    if  ( iTabs && ( aKeyEvent.iScanCode == EStdKeyRightArrow || aKeyEvent.iScanCode == EStdKeyLeftArrow ) )
+        {
+        resp = iTabs->OfferKeyEventL( aKeyEvent, aType );
+        }
+    else
+        {
+        resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
+        }
+    return resp;
+    }
+
+
+void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
+    {
+	/* TODO: tabs removed
+    iObjectType = (TMemSpyDriverContainerType)iTabs->ActiveTabId();
+    RefreshL();
+    */
+    }
+
+
+void CMemSpyViewKernelObjects::OnCmdTerminateL()
+    {
+    switch ( iObjectType )
+        {
+        case EMemSpyDriverContainerTypeThread:
+            {
+            TBool doTerminate = ETrue;
+            
+            //CMemSpyEngineObjectContainer& container = iEngine.Container();
+            //TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread
+            
+            TBool err;
+            iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
+            
+            // Try to find the thread in question...
+            //CMemSpyProcess* process = NULL;
+            //CMemSpyThread* thread = NULL; 
+            //User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) ); //
+                        
+            if( err )
+            	{
+				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+				
+				if ( doTerminate )
+					{
+					iMemSpySession.TerminateThread( id );
+					}
+            	}            
+            
+            /*
+            if ( thread )
+                {
+                thread->Open();
+                //
+                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
+                    {
+                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                    }
+                //
+                if  ( doTerminate )
+                    {
+                    thread->TerminateL();
+                    }                
+                }
+            */
+            RefreshL();
+            break;
+            }        
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            TBool doTerminate = ETrue;
+            // Obtain the process that corresponds to the selected item
+            //CMemSpyEngineObjectContainer& container = iEngine.Container();
+            //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
+            
+            CMemSpyProcess& process = container.ProcessByIdL( id );
+            process.Open();
+
+            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+                {
+                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                }
+            //
+            if  ( doTerminate )
+                {
+                process.TerminateL();
+                RefreshL();
+                }
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }
+    }
+
+
+void CMemSpyViewKernelObjects::OnCmdSwitchToL()
+    {/*
+    TInt wgCount;
+    RWsSession wsSession;
+    User::LeaveIfError( wsSession.Connect() );
+    CleanupClosePushL( wsSession );
+    User::LeaveIfError( wgCount = wsSession.NumWindowGroups() );
+    RArray<RWsSession::TWindowGroupChainInfo> wgArray;
+    CleanupClosePushL( wgArray );
+    User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) );
+    TApaTask task( wsSession );
+    TBool brought( EFalse );
+    TInt wgId( KErrNotFound );
+    TThreadId threadId;
+    switch ( iObjectType )
+        {
+        case EMemSpyDriverContainerTypeThread:
+            {
+            TThreadId currentThreadId( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            
+            // loop trough all window groups and see if a thread id matches
+            while( !brought && wgCount-- )
+                {
+                wgId = wgArray[wgCount].iId;
+                User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
+                if ( threadId == currentThreadId )
+                    {
+                    CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
+                    task.SetWgId( wgId );
+                    if ( !wgName->Hidden() && task.Exists() )
+                        {
+                        task.BringToForeground();
+                        brought = ETrue;                        
+                        }
+                    CleanupStack::PopAndDestroy( wgName );
+                    }
+                }                
+            break;
+            }
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            CMemSpyProcess& process = container.ProcessByIdL( id );
+            
+            // loop trough threads in a process
+            for ( TInt i = 0; i < process.MdcaCount(); i++ )
+                {
+                TInt wgCountLocal = wgCount;
+                
+                // loop trough all window groups and see if a thread id matches
+                while( !brought && wgCountLocal-- )
+                    {
+                    wgId = wgArray[wgCountLocal].iId;
+                    User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) );
+                    if ( threadId == process.At( i ).Id() )
+                        {
+                        CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId );
+                        task.SetWgId( wgId );
+                        if ( !wgName->Hidden() && task.Exists() )
+                            {
+                            task.BringToForeground();
+                            brought = ETrue;                        
+                            }
+                        CleanupStack::PopAndDestroy( wgName );
+                        }
+                    }
+                }
+
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }
+    if ( !brought )
+        {
+        // Error handling in HandleCommandL
+        User::Leave( KErrGeneral );
+        }
+    CleanupStack::PopAndDestroy( 2 ); //wgArray,wsSession*/
+    }
+
+
+void CMemSpyViewKernelObjects::OnCmdEndL()
+    {/*
+    switch ( iObjectType )
+        {
+        case EMemSpyDriverContainerTypeThread:
+            {
+            TBool doTerminate = ETrue;
+            
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            
+            // Try to find the thread in question...
+            CMemSpyProcess* process = NULL;
+            CMemSpyThread* thread = NULL; 
+            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
+
+            if ( thread )
+                {
+                thread->Open();
+                //
+                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
+                    {
+                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                    }
+                //
+                if  ( doTerminate )
+                    {
+                    thread->KillL();
+                    }                
+                }
+            RefreshL();
+            break;
+            }
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            TBool doTerminate = ETrue;
+            // Obtain the process that corresponds to the selected item
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            CMemSpyProcess& process = container.ProcessByIdL( id );
+            process.Open();
+
+            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+                {
+                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                }
+            if  ( doTerminate )
+                {
+                process.KillL();
+                RefreshL();
+                }
+
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }    */
+    }
+
+
+void CMemSpyViewKernelObjects::OnCmdPanicL()
+    {/*
+    switch ( iObjectType )
+        {
+        case EMemSpyDriverContainerTypeThread:
+            {
+            TBool doTerminate = ETrue;
+            
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TThreadId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            
+            // Try to find the thread in question...
+            CMemSpyProcess* process = NULL;
+            CMemSpyThread* thread = NULL; 
+            User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
+
+            if ( thread )
+                {
+                thread->Open();
+                //
+                if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
+                    {
+                    CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                    doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                    }
+                //
+                if  ( doTerminate )
+                    {
+                    thread->PanicL();
+                    }                
+                }
+            RefreshL();
+            break;
+            }
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            TBool doTerminate = ETrue;
+            // Obtain the process that corresponds to the selected item
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
+            CMemSpyProcess& process = container.ProcessByIdL( id );
+            process.Open();
+
+            if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+                {
+                CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+                }
+            if  ( doTerminate )
+                {
+                process.PanicL();
+                RefreshL();
+                }
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }*/
+    }
+
+
+void CMemSpyViewKernelObjects::CreateTabsL()
+    {
+	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
+	TUid uid;
+	uid.iUid = EEikStatusPaneUidNavi;
+	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
+	iNavDecorator=iNaviPane->CreateMessageLabelL(_L("Kernel Object Type")); //TODO: To print there kernel object type
+	iNaviPane->PushL(*iNavDecorator); 
+	/*
+    CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
+    TUid uid;
+    uid.iUid = EEikStatusPaneUidNavi;
+    iNavDecorator = ((CAknNavigationControlContainer*)(statusPane->ControlL(uid)))->Top();
+
+    if ( !iNavDecorator )
+        {
+        iNavContainer = (CAknNavigationControlContainer*)statusPane->ControlL(uid);
+        iNavDecorator = iNavContainer->CreateTabGroupL();
+
+        iTabs = ( CAknTabGroup* )iNavDecorator->DecoratedControl();
+        iTabs->SetTabFixedWidthL( KTabWidthWithThreeLongTabs );
+    
+        for ( TInt i = 0; i < iModel->Count(); i++ )
+            {
+            const CMemSpyEngineGenericKernelObjectList& item = iModel->At( i );
+            iTabs->AddTabL( item.Type(), item.TypeAsString( item.Type() ) );
+            }
+        iTabs->SetActiveTabById( iObjectType );
+        iTabs->SetObserver( this );
+        iNavContainer->PushL( *iNavDecorator );
+       }
+       */
+    }
+
+
+void CMemSpyViewKernelObjects::DetailsL()
+    {
+    HBufC* messageBuf = HBufC::NewLC( 40960 );
+    TPtr messagePtr = messageBuf->Des();
+
+    //const TMemSpyDriverHandleInfoGeneric& selectedObject = iObjectList->At( iListBox->CurrentItemIndex() );
+    //iKernelObjectItems[iListBox->CurrentItemIndex];
+
+    // General attributes:
+    TFullName name;
+    name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameDetail() );
+    AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
+    name.Zero();
+    name.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
+    AppendFormatString( messagePtr, _L("FullName: %S\n"), &name );
+    name.Zero();
+    AppendFormatString( messagePtr, _L("AccessCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AccessCount() );
+    AppendFormatString( messagePtr, _L("UniqueID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UniqueID() );
+    AppendFormatString( messagePtr, _L("Protection: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Protection() );
+    AppendFormatString( messagePtr, _L("OwnrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfKernelOwner() );
+    AppendFormatString( messagePtr, _L("KernelAddr: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Handle() );
+    
+    // Object type specific attributes:
+    switch ( iKernelObjectItems[iListBox->CurrentItemIndex()]->Type() )
+        {
+        case EMemSpyDriverContainerTypeUnknown:
+            {
+            break;
+            }
+        case EMemSpyDriverContainerTypeThread:
+            {
+            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
+            AppendFormatString( messagePtr, _L("ThreadID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
+            AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
+            TFullName procName;
+            procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
+            procName.Zero();
+            break;
+            }
+        case EMemSpyDriverContainerTypeProcess:
+            {
+            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
+            AppendFormatString( messagePtr, _L("CreatorId: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->CreatorId() );
+            AppendFormatString( messagePtr, _L("Attributes: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
+            AppendFormatString( messagePtr, _L("StckChnk: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfDataBssStackChunk() );
+            AppendFormatString( messagePtr, _L("ProcessID: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Id() );
+            AppendFormatString( messagePtr, _L("Priority: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Priority() );
+            AppendFormatString( messagePtr, _L("SecurityZone: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SecurityZone() );
+            /* TODO: to solve process details
+            CMemSpyEngineObjectContainer& container = iEngine.Container();
+            TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex().iId );
+            TRAP_IGNORE(
+                CMemSpyProcess& process = container.ProcessByIdL( id );
+                AppendFormatString( messagePtr, _L("\nSID: 0x%08X\n"), process.SID() );
+                AppendFormatString( messagePtr, _L("VID: 0x%08X\n"), process.VID() );
+                AppendFormatString( messagePtr, _L("UID1: 0x%08X\n"), process.UIDs()[0].iUid  );
+                AppendFormatString( messagePtr, _L("UID2: 0x%08X\n"), process.UIDs()[1].iUid  );
+                AppendFormatString( messagePtr, _L("UID3: 0x%08X\n"), process.UIDs()[2].iUid );
+                AppendFormatString( messagePtr, _L("Caps: 0x%08X%08X"), process.Capabilities().iCaps[0], process.Capabilities().iCaps[1]);
+                );
+            */
+            break;
+            }
+        case EMemSpyDriverContainerTypeChunk:
+            {
+            AppendFormatString( messagePtr, _L("\nOwnrPrAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningProcess() );
+            AppendFormatString( messagePtr, _L("Size: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Size() );
+            AppendFormatString( messagePtr, _L("MaxSize: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MaxSize() );
+            AppendFormatString( messagePtr, _L("Bottom: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Bottom() );
+            AppendFormatString( messagePtr, _L("Top: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Top() );
+            AppendFormatString( messagePtr, _L("Attr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Attributes() );
+            AppendFormatString( messagePtr, _L("Start: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->StartPos() );
+            AppendFormatString( messagePtr, _L("CntrlID: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ControllingOwner() );
+            AppendFormatString( messagePtr, _L("Restrictions: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Restrictions() );
+            AppendFormatString( messagePtr, _L("MapAttr: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapAttr() );
+            AppendFormatString( messagePtr, _L("Type: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ChunkType() );
+            TFullName procName;
+            procName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Proc: %S"), &procName );
+            procName.Zero();
+            // OwnerAddr iAddressOfKernelOwner already listed
+            // ProcAddr iAddressOfOwningProcess already listed
+            break;
+            }
+        case EMemSpyDriverContainerTypeLibrary:
+            {
+            AppendFormatString( messagePtr, _L("\nMapCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MapCount() );
+            AppendFormatString( messagePtr, _L("State: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->State() );
+            AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeSemaphore:
+            {
+            AppendFormatString( messagePtr, _L("\nCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
+            AppendFormatString( messagePtr, _L("Resetting: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeMutex:
+            {
+            AppendFormatString( messagePtr, _L("\nHoldCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Count() );
+            AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
+            AppendFormatString( messagePtr, _L("Resetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
+            AppendFormatString( messagePtr, _L("Order: %u"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Order() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeTimer:
+            {
+            AppendFormatString( messagePtr, _L("\nState: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerState() );
+            AppendFormatString( messagePtr, _L("Type: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TimerType() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeServer:
+            {
+            // Owner == ThrdAddr
+            AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
+            TFullName thrName;
+            thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
+            thrName.Zero();
+            AppendFormatString( messagePtr, _L("Type: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
+            TBuf8<55>buf;
+            RArray<TMemSpyDriverServerSessionInfo> sessions;
+            CleanupClosePushL( sessions );
+            /* TODO: to solve server sessions
+            iEngine.HelperServer().GetServerSessionsL( iKernelObjectItems[iListBox->CurrentItemIndex(), sessions );
+            const TInt count = sessions.Count();
+            for ( TInt i = 0; i < count; i++ )
+                {
+                const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
+                AppendFormatString( messagePtr, _L("SessAddr: 0x%08X\n"), session.iAddress );
+                TFullName sessName;
+                sessName.Copy( session.iName );
+                AppendFormatString( messagePtr, _L("Sess: %S\n"), &sessName );
+                }
+            CleanupStack::PopAndDestroy( &sessions );
+            */
+            break;
+            }
+        case EMemSpyDriverContainerTypeSession:
+            {
+            // Server == SvrAddr
+            AppendFormatString( messagePtr, _L("\nServer: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfServer() );
+            TFullName srvName;
+            srvName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
+            AppendFormatString( messagePtr, _L("Srv: %S\n"), &srvName );
+            srvName.Zero();
+            // Session: not supported
+            AppendFormatString( messagePtr, _L("AccCount: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->TotalAccessCount() );
+            AppendFormatString( messagePtr, _L("SesType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SessionType() );
+            AppendFormatString( messagePtr, _L("SvrType: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->SvrSessionType() );
+            AppendFormatString( messagePtr, _L("MsgCount: %d\n"),  iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgCount() );
+            AppendFormatString( messagePtr, _L("MsgLimit: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->MsgLimit() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeLogicalDevice:
+            {
+            AppendFormatString( messagePtr, 
+                                _L("\nVersion: %d.%d.%d\n"), 
+                                /*
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMajor, TODO: To solve this
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iMinor,
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version.iBuild );
+                                */
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
+            AppendFormatString( messagePtr, _L("ParseMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->ParseMask() );
+            AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
+            AppendFormatString( messagePtr, _L("Open channels: %d"), iKernelObjectItems[iListBox->CurrentItemIndex()]->OpenChannels() );
+            break;
+            }
+        case EMemSpyDriverContainerTypePhysicalDevice:
+            {
+            AppendFormatString( messagePtr, 
+                                _L("\nVersion: %d.%d.%d\n"), 
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version(),
+                                iKernelObjectItems[iListBox->CurrentItemIndex()]->Version() );
+            AppendFormatString( messagePtr, _L("UnitsMask: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->UnitsMask() );
+            AppendFormatString( messagePtr, _L("CodeSeg: 0x%08X"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfCodeSeg() );
+            break;
+            }
+        case EMemSpyDriverContainerTypeLogicalChannel:
+            {
+            // No other details
+            break;
+            }
+        case EMemSpyDriverContainerTypeChangeNotifier:
+            {
+            AppendFormatString( messagePtr, _L("\nChanges: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Changes() );
+            // Thread == ThrdAddr
+            AppendFormatString( messagePtr, _L("ThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
+            TFullName thrName;
+            thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
+            thrName.Zero();
+            break;
+            }
+        case EMemSpyDriverContainerTypeUndertaker:
+            {
+            // Thread == ThrdAddr
+            AppendFormatString( messagePtr, _L("\nThrdAddr: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
+            TFullName thrName;
+            thrName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Thr: %S"), &thrName );
+            thrName.Zero();
+            break;
+            }
+        case EMemSpyDriverContainerTypeMsgQueue:
+            {
+            // No other details
+            break;
+            }
+        case EMemSpyDriverContainerTypePropertyRef:
+            {
+            /*
+            Not listing details here, as propertyRef is not listed in TaskMgr.
+            Following propertyRef attributes are available at engine side. 
+            
+            IsReady
+            Type
+            Category
+            Key
+            RefCount
+            ThreadId
+            CreatorSID
+            */
+            break;
+            }
+        case EMemSpyDriverContainerTypeCondVar:
+            {
+            AppendFormatString( messagePtr, _L("\nResetting: %u\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->Resetting() );
+            // Using iAddressOfOwningThread for mutex
+            AppendFormatString( messagePtr, _L("Mutex: 0x%08X\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->AddressOfOwningThread() );
+            // Using iNameOfOwner for mutex
+            TFullName mtxName;
+            mtxName.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->NameOfOwner() );
+            AppendFormatString( messagePtr, _L("Mtx: %S\n"), &mtxName );
+            mtxName.Zero();
+            AppendFormatString( messagePtr, _L("WaitCount: %d\n"), iKernelObjectItems[iListBox->CurrentItemIndex()]->WaitCount() );
+            
+            RArray<TMemSpyDriverCondVarSuspendedThreadInfo> threads;
+            CleanupClosePushL( threads );
+            /* TODO: to solve thread cond. vars.
+            iEngine.HelperCondVar().GetCondVarSuspendedThreadsL( iKernelObjectItems[iListBox->CurrentItemIndex(), threads );
+            const TInt count = threads.Count();
+            for ( TInt i = 0; i < count; i++ )
+                {
+                const TMemSpyDriverCondVarSuspendedThreadInfo& thr = threads[ i ];
+                AppendFormatString( messagePtr, _L("SuspThrdAddr: 0x%08X\n"), thr.iAddress );
+                TFullName thrName;
+                thrName.Copy( thr.iName );
+                AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
+                }
+            CleanupStack::PopAndDestroy( &threads );
+            */
+            break;
+            }
+        default:
+            {
+            // Programming error
+            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+            }
+        }
+    
+    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
+    dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
+    TFileName headerText;
+    headerText.Copy( iKernelObjectItems[iListBox->CurrentItemIndex()]->Name() );
+    dialog->SetHeaderTextL( headerText );
+    dialog->SetMessageTextL(messagePtr);
+    dialog->RunLD();
+    CleanupStack::PopAndDestroy( messageBuf );
+    }
+
+
+void CMemSpyViewKernelObjects::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
+    {
+    TBuf<KMaxInfoLength> infoString;
+    VA_LIST list;
+    VA_START ( list, aFmt );
+    infoString.FormatList( aFmt, list );
+    aPtr.Append( infoString );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewMainMenu.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,317 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewMainMenu.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewProcesses.h"
+#include "MemSpyViewRAMInfo.h"
+#include "MemSpyViewROMInfo.h"
+#include "MemSpyViewServerList.h"
+#include "MemSpyViewOpenFiles.h"
+#include "MemSpyViewFBServBitmaps.h"
+#include "MemSpyViewSystemConfig.h"
+#include "MemSpyViewCodeSegList.h"
+#include "MemSpyViewChunkList.h"
+#include "MemSpyViewKernel.h"
+#include "MemSpyViewHeapTracking.h"
+#include "MemSpyViewDriveInfo.h"
+#include "MemSpyViewECom.h"
+#include "MemSpyViewMemoryTrackingAutoStartConfig.h"
+#include "MemSpyViewWindowGroups.h"
+
+// System includes
+#include <aknnotewrappers.h>
+
+/*
+CMemSpyViewMainMenu::CMemSpyViewMainMenu( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+*/
+CMemSpyViewMainMenu::CMemSpyViewMainMenu( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aSession, aObserver )
+    {
+    }
+
+void CMemSpyViewMainMenu::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "MemSpy" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    
+    // Make sure the correct item is selected
+    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune);
+    const TInt index = IndexByViewType( viewType );
+    iListBox->SetCurrentItemIndex( index );
+    HandleListBoxItemSelectedL( index );
+    }
+
+
+void CMemSpyViewMainMenu::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewMainMenu::ViewType() const
+    {
+    return EMemSpyViewTypeMainMenu;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewMainMenu::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    const TInt index = iListBox->CurrentItemIndex();
+    
+#ifdef __WINS__
+    // threads & process view is not supported in the emulator environment    
+    if  ( index == 0 )
+        {
+        CAknInformationNote* note = new (ELeave) CAknInformationNote;
+        note->ExecuteLD(_L("Not supported in the emulator, try Kernel -> Objects view"));
+        return NULL;
+        }
+#endif
+
+    if  ( index == 0 )
+        {
+        child = new(ELeave) CMemSpyViewProcesses( iMemSpySession, iObserver );		
+        }
+    else if ( index == 1 )
+        {
+        //child = new(ELeave) CMemSpyViewRAMInfo( iEngine, iObserver );
+		child = new(ELeave) CMemSpyViewKernel( iMemSpySession, iObserver );
+        }
+    /*
+    else if ( index == 2 )
+        {
+        child = new(ELeave) CMemSpyViewROMInfo( iEngine, iObserver );
+        }
+    else if ( index == 3 )
+        {
+        child = new(ELeave) CMemSpyViewFBServBitmaps( iEngine, iObserver );
+        }
+    else if ( index == 4 )
+        {
+        child = new(ELeave) CMemSpyViewServerList( iEngine, iObserver );
+        }
+    else if ( index == 5 )
+        {
+        child = new(ELeave) CMemSpyViewChunkList( iEngine, iObserver );
+        }
+    else if ( index == 6 )
+        {
+        child = new(ELeave) CMemSpyViewCodeSegList( iEngine, iObserver );
+        }
+    else if ( index == 7 )
+        {
+        child = new(ELeave) CMemSpyViewOpenFiles( iEngine, iObserver );
+        }
+    else if ( index == 8 )
+        {
+        child = new(ELeave) CMemSpyViewSystemConfig( iEngine, iObserver );
+        }    
+    else if ( index == 9 )
+        {
+        child = new(ELeave) CMemSpyViewKernel( iEngine, iObserver );		       
+        }    
+    else if ( index == 10 )
+        {
+        child = new(ELeave) CMemSpyViewHeapTracking( iEngine, iObserver );
+        }
+    */
+    /*else if ( index == 11 )
+        {
+        child = new(ELeave) CMemSpyViewMemoryTrackingAutoStartConfig( iEngine, iObserver );
+        }
+    else if ( index == 12 )
+        {
+        child = new(ELeave) CMemSpyViewDriveList( iEngine, iObserver );
+        }
+    else if ( index == 13 )
+        {
+        child = new(ELeave) CMemSpyViewECom( iEngine, iObserver );
+        }
+    else if ( index == 14 )
+        {
+        child = new(ELeave) CMemSpyViewWindowGroups( iEngine, iObserver );
+        }
+        */
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewMainMenu::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    
+    // 1st item = Processes
+    _LIT(KItem1Format, "\tProcesses & Threads");
+    item.Format( KItem1Format );
+    model->AppendL( item );
+
+    //some main view items temporary removed
+    /*
+    // 2nd item = RAM info
+    _LIT(KItem2Format, "\tRAM Info");
+    model->AppendL( KItem2Format );
+
+    // 3rd item = ROM info
+    _LIT(KItem3Format, "\tROM Info");
+    model->AppendL( KItem3Format );
+
+    // 4th item = FBServ Bitmaps
+    _LIT(KItem4Format, "\tFont & Bitmap\nServer");
+    model->AppendL( KItem4Format );
+
+    // 5th item = Servers
+    _LIT(KItem5Format, "\tServers");
+    item.Format( KItem5Format);
+    model->AppendL( item );
+
+    // 6th item = Chunks
+    _LIT(KItem6Format, "\tChunks");
+    model->AppendL( KItem6Format );
+
+    // 7th item = Code Segments
+    _LIT(KItem7Format, "\tCode Segments");
+    model->AppendL( KItem7Format );
+
+    // 8th item = Open Files
+    _LIT(KItem8Format, "\tOpen Files");
+    model->AppendL( KItem8Format );
+
+    // 9th item = System Config
+    _LIT(KItem9Format, "\tSystem\nConfiguration");
+    model->AppendL( KItem9Format );
+	*/
+    
+    // 10th item = Kernel
+    _LIT(KItem2Format, "\tKernel");
+    model->AppendL( KItem2Format );
+    /*
+    // 11th item = Heap Tracking
+    _LIT(KItem11Format, "\tSystem-Wide Memory Tracking");
+    model->AppendL( KItem11Format );
+    */
+    /*
+    // 12th item = Process-specific Tracking
+    _LIT(KItem12Format, "\tProcess-Specific Memory Tracking");
+    model->AppendL( KItem12Format );
+
+    // 13th item = Drive Info
+    _LIT(KItem13Format, "\tDrive Summary");
+    model->AppendL( KItem13Format );
+
+    // 14th item = ECOM
+    _LIT(KItem14Format, "\tECom");
+    model->AppendL( KItem14Format );
+
+    // 15th item = Window Groups
+    _LIT(KItem15Format, "\tWindow Groups");
+    model->AppendL( KItem15Format );
+    */
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+TInt CMemSpyViewMainMenu::IndexByViewType( TMemSpyViewType aType )
+    {
+    TInt index = 0;
+    //
+    switch( aType )
+        {
+    default:
+    	
+    case EMemSpyViewTypeProcesses:
+        index = 0;
+        break;
+/*  case EMemSpyViewTypeRAMInfo:
+        index = 1;
+        break;
+    case EMemSpyViewTypeROMInfo:
+        index = 2;
+        break;
+    case EMemSpyViewTypeFBServBitmaps:
+        index = 3;
+        break;
+    case EMemSpyViewTypeServerList:
+        index = 4;
+        break;
+    case EMemSpyViewTypeChunkList:
+        index = 5;
+        break;
+    case EMemSpyViewTypeCodeSegmentList:
+        index = 6;
+        break;
+    case EMemSpyViewTypeOpenFiles:
+        index = 7;
+        break;
+    case EMemSpyViewTypeSystemConfig:
+        index = 8;
+        break;*/  
+        
+    case EMemSpyViewTypeKernel:
+        index = 1 ;
+        break;
+    /*
+    case EMemSpyViewTypeHeapTracking:
+        index = 10;
+        break;
+        */
+    /*case EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig:
+        index = 11;
+        break;
+    case EMemSpyViewTypeDriveSummary:
+        index = 12;
+        break;
+    case EMemSpyViewTypeECom:
+        index = 13;
+        break;
+    case EMemSpyViewTypeWindowGroups:
+        index = 14;
+        break;*/        
+        }
+    //
+    return index;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewMemoryTrackingAutoStartConfig.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewMemoryTrackingAutoStartConfig.h"
+
+// System includes
+#include <AknQueryDialog.h>
+#include <charconv.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyengineprocessmemorytracker.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+// Literal constants
+_LIT8( KMemSpyProcessMemoryTrackerXmlFileMimeType, "text/xml" );
+_LIT8( KMemSpyXmlSpec_MasterSection, "memspy_process_memory_tracking" );
+_LIT8( KMemSpyXmlSpec_EntryProcess, "process" );
+_LIT8( KMemSpyXmlSpec_EntryProcess_SID, "sid" );
+_LIT8( KMemSpyXmlSpec_HexPrefix, "0x" );
+
+
+
+CMemSpyViewMemoryTrackingAutoStartConfig::CMemSpyViewMemoryTrackingAutoStartConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewMemoryTrackingAutoStartConfig::~CMemSpyViewMemoryTrackingAutoStartConfig()
+    {
+    iProcessUids.Close();
+    //
+    delete iParser;
+    delete iConverter;
+    //
+    delete iXMLFileNameInstallTime;
+    delete iXMLFileNameUserSupplied;
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    // We only convert from UTF-8 to UTF-16
+	iParser = CParser::NewL( KMemSpyProcessMemoryTrackerXmlFileMimeType, *this );
+    iConverter = CCnvCharacterSetConverter::NewL();
+    if  ( iConverter->PrepareToConvertToOrFromL( KCharacterSetIdentifierUtf8, iEngine.FsSession() ) == CCnvCharacterSetConverter::ENotAvailable )
+	    {
+		User::Leave(KErrNotFound);
+		}
+
+    // Search for standard files
+    FindXmlInstallTimeL();
+    FindXmlUserSuppliedL();
+
+    // Copy items to our own temporary list...
+    const RArray<TUid>& list = iEngine.HelperProcess().MemoryTrackingAutoStartProcessList();
+    for( TInt i=0; i<list.Count(); i++ )
+        {
+        User::LeaveIfError( iProcessUids.Append( list[ i ] ) );
+        }
+
+    // Reset the title
+    _LIT( KCustomTitle, "Process-Specific Memory Tracking" );
+    SetTitleL( KCustomTitle );
+    }
+
+
+TMemSpyViewType CMemSpyViewMemoryTrackingAutoStartConfig::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemMemoryTrackingAutoStartConfig;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewMemoryTrackingAutoStartConfig::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+
+    return parent;
+    }
+
+
+TBool CMemSpyViewMemoryTrackingAutoStartConfig::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdMemoryTrackingAutoStartItemAdd:
+        OnCmdItemAddL();
+        break;
+    case EMemSpyCmdMemoryTrackingAutoStartItemEdit:
+        OnCmdItemEditL();
+        break;
+    case EMemSpyCmdMemoryTrackingAutoStartItemDelete:
+        OnCmdItemDeleteL();
+        break;
+    case EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll:
+        OnCmdItemDeleteAllL();
+        break;
+    case EMemSpyCmdMemoryTrackingAutoStartItemImport:
+        OnCmdItemImportL();
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    OnCmdItemEditL();
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<128> buf;
+    _LIT( KProcUidFormatSpec, "\t0x%08x" );
+
+    const TInt count = iProcessUids.Count();
+    for( TInt i=0; i<count; i++ )
+        {
+        const TUid procUid = iProcessUids[ i ];
+        //
+        buf.Format( KProcUidFormatSpec, procUid.iUid );
+        model->AppendL( buf );
+        }
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    iListBox->HandleItemAdditionL();
+    iListBox->DrawDeferred();
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == MenuCascadeResourceId() )
+        {
+        const TInt count = iProcessUids.Count();
+        const TInt index = iListBox->CurrentItemIndex();
+
+        // We cannot edit an item if none exists
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemEdit, ( count == 0 || index < 0 || index > count - 1 ) );
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemDelete, ( count == 0 || index < 0 || index > count - 1 ) );
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemDeleteAll, ( count <= 1 || index > count - 1 ) );
+
+        // We can only import items if an XML file is available
+        const TBool xmlAvailable = ( iXMLFileNameInstallTime->Length() || iXMLFileNameUserSupplied->Length() );
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStartItemImport, !xmlAvailable );
+        }
+    }
+
+
+TUint CMemSpyViewMemoryTrackingAutoStartConfig::MenuCascadeResourceId() const
+    {
+    return R_MEMSPY_MENUPANE_MEMORY_TRACKING_AUTOSTART;
+    }
+
+
+TInt CMemSpyViewMemoryTrackingAutoStartConfig::MenuCascadeCommandId() const
+    {
+    return EMemSpyCmdMemoryTrackingAutoStart;
+    }
+   
+    
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemAddL()
+    {
+    const TUid uid = ShowDialogL( KNullUid );
+    if ( uid != KNullUid )
+        {
+        User::LeaveIfError( iProcessUids.Append( uid ) );
+        SaveChangesL();
+        RefreshL();
+        iListBox->HandleItemAdditionL();
+        iListBox->DrawDeferred();
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemEditL()
+    {
+    const TInt index = iListBox->CurrentItemIndex();
+    if ( index >= 0 && index < iProcessUids.Count() )
+        {
+        TUid processUid = iProcessUids[ index ];
+        processUid = ShowDialogL( processUid );
+        //
+        if ( processUid != KNullUid )
+            {
+            iProcessUids[ index ] = processUid;
+            SaveChangesL();
+            RefreshL();
+            iListBox->HandleItemAdditionL();
+            iListBox->DrawDeferred();
+            }
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemDeleteL()
+    {
+    const TInt index = iListBox->CurrentItemIndex();
+    if ( index >= 0 && index < iProcessUids.Count() )
+        {
+        iProcessUids.Remove( index );
+        SaveChangesL();
+        RefreshL();
+        iListBox->HandleItemRemovalL();
+        iListBox->DrawDeferred();
+        
+        const TInt newIndex = index - 1;
+        const TInt count = iProcessUids.Count();
+        if ( newIndex >=0 && newIndex < count )
+            {
+            iListBox->SetCurrentItemIndex( index );
+            }
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemDeleteAllL()
+    {
+    iProcessUids.Reset();
+    SaveChangesL();
+    RefreshL();
+    iListBox->HandleItemRemovalL();
+    iListBox->DrawDeferred();
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnCmdItemImportL()
+    {
+    if  ( iXMLFileNameInstallTime->Length() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        if  ( importDialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_IMPORT_FROM_INSTALLED_XML_DIALOG ) )
+            {
+            TRAP_IGNORE( ParseL( *iXMLFileNameInstallTime ) );
+            }
+        }
+    if  ( iXMLFileNameUserSupplied->Length() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        if  ( importDialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_IMPORT_FROM_USERDEFINED_XML_DIALOG ) )
+            {
+            TRAP_IGNORE( ParseL( *iXMLFileNameUserSupplied ) );
+            }
+        }
+
+    SaveChangesL();
+    RefreshL();
+    iListBox->HandleItemRemovalL();
+    iListBox->DrawDeferred();
+    }
+
+
+TUid CMemSpyViewMemoryTrackingAutoStartConfig::ShowDialogL( TUid aUid )
+    {
+    TUid uid = KNullUid;
+    //
+    _LIT( KProcessUidFormat, "%x" );
+    TBuf<128> buf;
+    buf.Format( KProcessUidFormat, aUid );
+    //
+    CAknTextQueryDialog* dialog = new(ELeave) CAknTextQueryDialog( buf );
+    const TBool dialogActioned = ( dialog->ExecuteLD( R_MEMSPY_MEMORY_TRACKING_PROCESS_UID_DIALOG ) );
+    //
+    if ( dialogActioned )
+        {
+        // Validate the text
+        uid = ValidateProcessUid( buf );
+        }
+    //
+    return uid;
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::SaveChangesL()
+    {
+    iEngine.HelperProcess().SetMemoryTrackingAutoStartProcessListL( iProcessUids );
+    Settings().StoreSettingsL();
+    }
+
+
+TUid CMemSpyViewMemoryTrackingAutoStartConfig::ValidateProcessUid( const TDesC& aUid )
+    {
+    TUid ret = KNullUid;
+    TBool isValid = ETrue;
+    //
+    const TInt length = aUid.Length();
+    for( TInt i=0; i<length && isValid; i++ )
+        {
+        const TChar charValue = aUid[ i ];
+        //
+        switch( charValue )
+            {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        case 'a':
+        case 'A':
+        case 'b':
+        case 'B':
+        case 'c':
+        case 'C':
+        case 'd':
+        case 'D':
+        case 'e':
+        case 'E':
+        case 'f':
+        case 'F':
+            break;
+        default:
+            isValid = EFalse;
+            break;
+            }
+        }
+    //
+    if ( isValid )
+        {
+        TUint32 val = 0;
+        TLex lexer( aUid );
+        if ( lexer.Val( val, EHex ) == KErrNone )
+            {
+            ret.iUid = val;
+            }
+        }
+    //
+    return ret;
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlInstallTimeL()
+    {
+    RFs& fsSession = iEngine.FsSession();
+    //
+    TFileName* fileName = new(ELeave) TFileName();
+    CleanupStack::PushL( fileName );
+    //
+    fsSession.PrivatePath( *fileName );
+    //
+    TFindFile findFile( fsSession );
+    if  ( findFile.FindByPath( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, fileName ) == KErrNone )
+        {
+        iXMLFileNameInstallTime = findFile.File().AllocL();
+        }
+    else
+        {
+        iXMLFileNameInstallTime = KNullDesC().AllocL();
+        RDebug::Print( _L("CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlInstallTimeL() - NO FILE FOUND") );
+        }
+    //
+    CleanupStack::PopAndDestroy( fileName );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlUserSuppliedL()
+    {
+    TFindFile findFile( iEngine.FsSession() );
+    if  ( findFile.FindByPath( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, &KMemSpyProcessMemoryTrackingAutoStartConfigSearchPath ) == KErrNone )
+        {
+        iXMLFileNameUserSupplied = findFile.File().AllocL();
+        }
+    else
+        {
+        iXMLFileNameUserSupplied = KNullDesC().AllocL();
+        RDebug::Print( _L("CMemSpyViewMemoryTrackingAutoStartConfig::FindXmlUserSuppliedL() - NO FILE FOUND") );
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::ParseL( const TDesC& aFileName )
+    {
+	Xml::ParseL( *iParser, iEngine.FsSession(), aFileName );
+    //
+    const TInt error = iParserErrorCode;
+    iParserErrorCode = KErrNone;
+    //
+	User::LeaveIfError( error );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnSectionProcessL( const RAttributeArray& aAttributes )
+    {
+    TUid uid = KNullUid;
+    TBool gotSID = EFalse;
+    //
+    const TInt count = aAttributes.Count();
+	for( TInt i=0; i<count; i++ )
+		{
+		const TPtrC8 attrib( aAttributes[ i ].Attribute().LocalName().DesC() );
+		const TPtrC8 value( aAttributes[ i ].Value().DesC() );
+        //
+		if  ( attrib.CompareF( KMemSpyXmlSpec_EntryProcess_SID ) == 0 )
+			{
+            if  ( gotSID )
+                {
+                User::LeaveIfError( KErrCorrupt );
+                }
+            else
+                {
+                if  ( value.Length() >= 8 )
+                    {
+                    TRadix radix = EDecimal;
+                    TPtrC8 pValue( value );
+                    //
+                    if  ( value.Length() == 10 && value.Left( 2 ) == KMemSpyXmlSpec_HexPrefix )
+                        {
+                        pValue.Set( value.Mid( 2 ) );
+                        radix = EHex;
+                        }
+                    //
+                    TUint32 uidVal = 0;
+                    TLex8 lexer( pValue );
+                    const TInt err = lexer.Val( uidVal, radix );
+                    User::LeaveIfError( err );
+                    uid.iUid = uidVal;
+                    gotSID = ETrue;
+                    }
+                }
+			}
+        }
+    //
+    if  ( gotSID )
+        {
+        User::LeaveIfError( iProcessUids.Append( uid ) );
+        }
+    else
+        {
+        User::Leave( KErrCorrupt );
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartDocumentL( const RDocumentParameters& /*aDocParam*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndDocumentL( TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartElementL( const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    //
+	const TPtrC8 name( aElement.LocalName().DesC() );
+    //
+    if  ( name.CompareF( KMemSpyXmlSpec_MasterSection ) == 0 )
+		{
+		iSeenMasterSection = ETrue;
+		}
+    else if ( iSeenMasterSection && name.CompareF( KMemSpyXmlSpec_EntryProcess ) == 0 )
+        {
+        OnSectionProcessL( aAttributes );
+        }
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndElementL( const RTagInfo& /*aElement*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnContentL( const TDesC8& /*aBytes*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnStartPrefixMappingL( const RString& /*aPrefix*/, const RString& /*aUri*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnEndPrefixMappingL( const RString& /*aPrefix*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnIgnorableWhiteSpaceL( const TDesC8& /*aBytes*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnSkippedEntityL( const RString& /*aName*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnProcessingInstructionL( const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, TInt aErrorCode )
+    {
+    User::LeaveIfError( aErrorCode );
+    }
+
+
+void CMemSpyViewMemoryTrackingAutoStartConfig::OnError( TInt aErrorCode )
+    {
+    iParserErrorCode = aErrorCode;
+    }
+
+
+TAny* CMemSpyViewMemoryTrackingAutoStartConfig::GetExtendedInterface( const TInt32 /*aUid*/ )
+    {
+    return NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewOpenFiles.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,274 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewOpenFiles.h"
+
+// System includes
+#include <AknIconArray.h>
+#include <eikdef.h>
+#include <eikclbd.h>
+#include <aknconsts.h>
+#include <gulicon.h>
+#include <avkon.mbg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+
+CMemSpyViewOpenFiles::CMemSpyViewOpenFiles( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewOpenFiles::~CMemSpyViewOpenFiles()
+    {
+    iThreadIds.Close();
+    iFileNames.Close();
+    }
+
+
+void CMemSpyViewOpenFiles::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Open Files" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+CEikListBox* CMemSpyViewOpenFiles::ConstructListBoxL()
+    {
+    delete iListBox;
+    iListBox = NULL;
+    CAknDoubleGraphicStyleListBox* listbox = new (ELeave) CAknDoubleGraphicStyleListBox();
+    iListBox = listbox;
+    //
+    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
+    listbox->SetContainerWindowL( *this );
+    listbox->CreateScrollBarFrameL( ETrue );
+    SetListBoxModelL();
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+    listbox->SetListBoxObserver( this );
+    listbox->SetObserver( this );
+
+    // Create icon array
+    CAknIconArray* iconArray = new (ELeave) CAknIconArray(1);
+    CleanupStack::PushL( iconArray );
+
+    // Create bitmap
+    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
+    CleanupStack::PushL( bitmap );
+    const TInt error1 = bitmap->Create( TSize(10,10), EColor16M );
+    User::LeaveIfError( error1 );
+
+    // Create mask
+    CFbsBitmap* mask = new(ELeave) CFbsBitmap();
+    CleanupStack::PushL( mask );
+    const TInt error2 = mask->Create( TSize(10,10), EColor16M );
+    User::LeaveIfError( error2 );
+
+    // Create icon & transfer bitmap
+    CGulIcon* icon = CGulIcon::NewL( bitmap, mask );
+    CleanupStack::Pop( 2, bitmap );
+    CleanupStack::PushL( icon );
+
+    // Transfer icon to array
+    iconArray->AppendL( icon );
+    CleanupStack::Pop( icon );
+    
+    // Give icon array to listbox
+    static_cast<CEikFormattedCellListBox*>(iListBox)->ItemDrawer()->FormattedCellData()->SetIconArrayL(iconArray);
+    CleanupStack::Pop( iconArray );
+    //
+    return listbox;
+    }
+
+
+void CMemSpyViewOpenFiles::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewOpenFiles::ViewType() const
+    {
+    return EMemSpyViewTypeOpenFiles;
+    }
+
+
+TBool CMemSpyViewOpenFiles::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+	case EMemSpyCmdToolsListOpenFiles:
+        OnCmdListOpenFilesL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewOpenFiles::OnCmdListOpenFilesL()
+    {
+    iEngine.ListOpenFilesL();
+    }
+
+
+CMemSpyViewBase* CMemSpyViewOpenFiles::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewOpenFiles::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+
+    // First, try to find the selected thread
+    if  ( iActionedThreadId )
+        {
+        // Try to create a view of the thread in question
+        CMemSpyProcess* process = NULL;
+        CMemSpyThread* thread = NULL;
+        const TInt error = iEngine.Container().ProcessAndThreadByThreadId( *iActionedThreadId, process, thread );
+        if  ( error == KErrNone && thread != NULL )
+            {
+            child = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, thread->Process() );
+            CleanupStack::PushL( child );
+            child->ConstructL( Rect(), *Parent(), thread );
+            CleanupStack::Pop( child );
+            }
+        }
+    //
+    return child;
+    }
+
+
+void CMemSpyViewOpenFiles::SetListBoxModelL()
+    {
+    _LIT(KLineFormatSpec, "%d\t%S\t%S %S");
+
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 50> item;
+    TMemSpySizeText valueBuf;
+    TBuf<64> timeBuf;
+
+    iFileNames.Reset();
+    iThreadIds.Reset();
+    iActionedThreadId = NULL;
+
+    RFs& fsSession = iCoeEnv->FsSession();
+    TOpenFileScan scanner( fsSession );
+
+    CFileList* list = NULL;
+    scanner.NextL( list );
+
+    TIdentityRelation<TEntry> comparer( CompareTEntryObjects );
+
+    while( list != NULL )
+        {
+        CleanupStack::PushL( list );
+    
+        const TInt entryCount = list->Count();
+        for(TInt i=0; i<entryCount; i++)
+            {
+            const TEntry& entry = (*list)[ i ];
+
+            // Check for duplicates
+            const TInt foundIndex = iFileNames.Find( entry, comparer );
+            if  ( foundIndex == KErrNotFound )
+                {
+                // Get time and size format strings
+                valueBuf = MemSpyUiUtils::FormatSizeText( entry.iSize );
+                MemSpyUiUtils::FormatTimeL( timeBuf, entry.iModified );
+
+                // Get just file name
+                TParsePtrC parser( entry.iName );
+                const TPtrC pJustName( parser.NameAndExt() );
+
+                // Create item 
+                item.Format( KLineFormatSpec, 0, &pJustName, &valueBuf, &timeBuf );
+                model->AppendL( item );
+                iThreadIds.AppendL( scanner.ThreadId() );
+                iFileNames.AppendL( entry );
+                }
+            }
+
+        CleanupStack::PopAndDestroy( list );
+        list = NULL;
+        scanner.NextL( list );
+        }
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+void CMemSpyViewOpenFiles::HandleListBoxItemActionedL( TInt aCurrentIndex )
+    {
+    if  ( aCurrentIndex >= 0 && aCurrentIndex < iThreadIds.Count() )
+        {
+        iActionedThreadId = &iThreadIds[ aCurrentIndex ];
+        }
+    else
+        {
+        iActionedThreadId = NULL;
+        }
+
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+TBool CMemSpyViewOpenFiles::CompareTEntryObjects( const TEntry& aLeft, const TEntry& aRight )
+    {
+    return ( aLeft.iName.CompareF( aRight.iName ) == 0 );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewProcesses.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,704 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewProcesses.h"
+
+// System includes
+#include <aknsfld.h>
+#include <AknQueryDialog.h>
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspysession.h>
+#include <memspy/engine/memspyengineutils.h>
+
+// User includes
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+// Constants
+const TInt KMemSpyMaxSearchTextLength = 30;
+const TInt KMemSpyMaxSearchTextLengthWithWildcards = KMemSpyMaxSearchTextLength + 4;
+
+
+/*
+CMemSpyViewProcesses::CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewProcesses::CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess )
+:   CMemSpyViewBase( aEngine, aObserver ), iCurrentProcess( &aProcess )
+    {
+    iCurrentProcess->Open();
+    }
+*/
+
+CMemSpyViewProcesses::CMemSpyViewProcesses( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aSession, aObserver )
+    {
+    }
+
+/*
+CMemSpyViewProcesses::CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess )
+:   CMemSpyViewBase( aEngine, aObserver ), iCurrentProcess( &aProcess )
+    {
+    iCurrentProcess->Open();
+    }
+*/
+
+CMemSpyViewProcesses::CMemSpyViewProcesses( RMemSpySession& aEngine, MMemSpyViewObserver& aObserver, TProcessId aId )
+:   CMemSpyViewBase( aEngine, aObserver ), iCurrentProcessId( aId )
+    {
+    }
+
+CMemSpyViewProcesses::~CMemSpyViewProcesses()
+    {	
+	iProcesses.Close();
+    delete iSearchField;
+    delete iMatcherBuffer;
+    }
+
+
+//void CMemSpyViewProcesses::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+void CMemSpyViewProcesses::ConstructL( const TRect& aRect, CCoeControl& aContainer, TProcessId aSelectionRune )
+    {
+	iMemSpySession.GetProcessesL(iProcesses); // get processes array;
+	
+    _LIT( KTitle, "Processes\n& Threads" );
+    SetTitleL( KTitle );
+    //
+    //CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    CMemSpyViewBase::ConstructL( aRect, aContainer );
+    //
+    iMatcherBuffer = HBufC::NewL( KMemSpyMaxSearchTextLengthWithWildcards );
+    //
+    iSearchField = CAknSearchField::NewL( *this, CAknSearchField::ESearch, NULL, KMemSpyMaxSearchTextLength );
+    iSearchField->SetObserver( this );
+    iSearchField->SetFocus( ETrue );
+    iSearchField->SetComponentsToInheritVisibility( ETrue );
+    //    
+    if  ( aSelectionRune )
+        {
+		TInt index = 0;
+		TProcessId selectedItem = aSelectionRune; //static_cast< TProcessId >( *aSelectionRune );
+		for( TInt i=0; i<iProcesses.Count();i++)
+			{
+			if( iProcesses[i]->Id() == selectedItem )
+				{
+				index = i;
+				}
+			}					        
+        
+        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
+            {
+            iListBox->SetCurrentItemIndex( index );
+            HandleListBoxItemSelectedL( index );
+            }            
+        }
+    else if ( iProcesses.Count() > 0 ) //TODO: to solve item selection when come back from previous view
+        {
+        iListBox->SetCurrentItemIndex( 0 );
+        HandleListBoxItemSelectedL( 0 );
+        }
+    //
+    SizeChanged();
+    ActivateL();
+    }
+
+
+CMemSpyProcess& CMemSpyViewProcesses::CurrentProcess() const
+    {
+	/*
+    __ASSERT_ALWAYS( iCurrentProcess != NULL, User::Invariant() );
+    return *iCurrentProcess;
+    */	
+    }
+
+
+void CMemSpyViewProcesses::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewProcesses::ViewType() const
+    {
+    return EMemSpyViewTypeProcesses;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewProcesses::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iMemSpySession, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewProcesses::PrepareChildViewL()
+    {	
+    CMemSpyViewThreads* child = new(ELeave) CMemSpyViewThreads( iMemSpySession, iObserver, iProcesses[iListBox->CurrentItemIndex()]->Id() );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    
+	return 0;
+    }
+
+
+void CMemSpyViewProcesses::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == MenuCascadeResourceId() )
+        {
+        CMemSpyProcess& process = CurrentProcess();
+        //const TBool hide = ( iEngine.Container().Count() == 0 ) || process.IsDead(); //TODO
+        //
+        const TBool hide = EFalse; //to replace
+        
+        aMenuPane->SetItemDimmed( EMemSpyCmdProcessInfo, hide );
+        aMenuPane->SetItemDimmed( EMemSpyCmdProcessEnd, hide );
+        }
+    }
+
+
+TBool CMemSpyViewProcesses::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    // Sorting
+    case EMemSpyCmdProcessSortById:
+        OnCmdSortByIdL();
+		break;
+    case EMemSpyCmdProcessSortByName:
+        OnCmdSortByNameL();
+		break;
+    case EMemSpyCmdProcessSortByThreadCount:
+        OnCmdSortByThreadCountL();
+		break;
+    case EMemSpyCmdProcessSortByCodeSegs:
+        OnCmdSortByCodeSegsL();
+		break;
+    case EMemSpyCmdProcessSortByHeapUsage:
+        OnCmdSortByHeapUsageL();
+		break;
+    case EMemSpyCmdProcessSortByStackUsage:
+        OnCmdSortByStackUsageL();
+		break;
+    // End
+    case EMemSpyCmdProcessEndTerminate:
+        OnCmdEndTerminateL();
+		break;
+    case EMemSpyCmdProcessEndKill:
+        OnCmdEndKillL();
+		break;
+    case EMemSpyCmdProcessEndPanic:
+        OnCmdEndPanicL();
+		break;
+    // Info
+    case EMemSpyCmdProcessInfoSummary:
+        OnCmdInfoSummaryL();
+		break;
+    case EMemSpyCmdProcessInfoHandles:
+        OnCmdInfoHandlesL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByIdL()
+    {	
+    //iEngine.Container().SortById();
+    RefreshL();    
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByNameL()
+    {	
+    //iEngine.Container().SortByName();
+    RefreshL();    
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByThreadCountL()
+    {	
+    //iEngine.Container().SortByThreadCount();
+    RefreshL();    
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByCodeSegsL()
+    {	
+    //iEngine.Container().SortByCodeSegs();
+    RefreshL();
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByHeapUsageL()
+    {	
+    //iEngine.Container().SortByHeapUsage();
+    RefreshL();    
+    }
+
+
+void CMemSpyViewProcesses::OnCmdSortByStackUsageL()
+    {
+   // iEngine.Container().SortByStackUsage();
+    RefreshL();
+    }
+
+
+void CMemSpyViewProcesses::OnCmdInfoSummaryL()
+    {
+    //CMemSpyProcess& process = CurrentProcess();
+    //iEngine.HelperProcess().OutputProcessInfoL( process );
+    }
+
+
+void CMemSpyViewProcesses::OnCmdInfoHandlesL()
+    {
+	/*
+    CMemSpyProcess& process = CurrentProcess();
+    //
+    const TInt threadCount = process.Count();
+    for( TInt i=0; i<threadCount; i++ )
+        {
+        CMemSpyThread& thread = process.At( i );
+        thread.InfoContainerForceSyncronousConstructionL().PrintL();
+        }
+        */
+    }
+
+
+void CMemSpyViewProcesses::OnCmdEndTerminateL()
+    {
+	/*
+    TBool doTerminate = ETrue;
+    CMemSpyProcess& process = CurrentProcess();
+    //
+    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        process.TerminateL();
+        RefreshL();
+        }
+        */
+    }
+
+
+void CMemSpyViewProcesses::OnCmdEndPanicL()
+    {/*
+    TBool doTerminate = ETrue;
+    CMemSpyProcess& process = CurrentProcess();
+    //
+    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        process.PanicL();
+        RefreshL();
+        }
+        */
+    }
+
+
+void CMemSpyViewProcesses::OnCmdEndKillL()
+    {/*
+    TBool doTerminate = ETrue;
+    CMemSpyProcess& process = CurrentProcess();
+    //
+    if  ( process.IsSystemPermanent() || process.IsSystemCritical() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        process.KillL();
+        RefreshL();
+        }
+        */
+    }
+
+
+
+
+void CMemSpyViewProcesses::SetListBoxModelL()
+    {	
+	if( iProcesses.Count() > 0 )
+		{
+		iProcesses.Close();
+		}
+	
+	iMemSpySession.GetProcessesL(iProcesses); // get processes array;
+	iModel = new (ELeave) CDesC16ArrayFlat( iProcesses.Count() + 1); //array for formated items
+	
+	_LIT( KTab, "\t" );
+	//iModel = FormatModel( iProcesses ); //TODO Format model method with advanced formatting
+	
+	
+	for( TInt i=0; i < iProcesses.Count(); i++ )
+		{
+		HBufC* tempName = HBufC::NewL( iProcesses[i]->Name().Length() + 16 );
+    	CleanupStack::PushL( tempName );
+    	TPtr tempNamePtr( tempName->Des() );
+    	tempNamePtr.Copy( KTab );
+    	tempNamePtr.Append( iProcesses[i]->Name() );
+    	iModel->AppendL( tempNamePtr );
+    	
+    	CleanupStack::PopAndDestroy( tempName ); 
+		}			
+	
+	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    //listbox->Model()->SetItemTextArray( &iEngine.Container() );
+    listbox->Model()->SetItemTextArray( iModel );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewProcesses::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewProcesses::HandleListBoxItemSelectedL( TInt aIndex )
+    {/*
+    if  ( iCurrentProcess )
+        {
+        iCurrentProcess->Close();
+        }
+
+    // Obtain the process that corresponds to the selected item
+    CMemSpyEngineObjectContainer& container = iEngine.Container();
+    CMemSpyProcess& process = container.At( aIndex );
+    iCurrentProcess = &process;
+    iCurrentProcess->Open();
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );*/
+    }
+
+
+void CMemSpyViewProcesses::SizeChanged()
+    {
+    const TRect rect( Rect() );
+    
+    if  ( iListBox && iSearchField )
+        {
+        const TInt lafIndex_H = 1;
+        AknLayoutUtils::LayoutControl( iListBox, rect, AknLayout::list_gen_pane( lafIndex_H ) );
+        AknLayoutUtils::LayoutControl( iSearchField, rect, AknLayout::find_pane() );
+        }
+    else
+        {
+        CMemSpyViewBase::SizeChanged();
+        }
+
+/*
+    // Search field
+    TSize searchFieldSize( iSearchField->MinimumSize() ); // BALLS: search field doesn't implement minimum size correctly?!?!?
+    searchFieldSize.SetWidth( rect.Width() );
+    const TRect searchFieldRect( TPoint( rect.iTl.iX, rect.iBr.iY ), searchFieldSize );
+    iSearchField->SetRect( searchFieldRect );
+
+    // Listbox
+    TSize listBoxSize( rect.Size() - TSize( 0, searchFieldSize.iHeight ) );
+    iListBox->SetRect( rect.iTl, listBoxSize );
+*/
+    }
+
+
+TInt CMemSpyViewProcesses::CountComponentControls() const
+    {
+    TInt count = 0;
+    //
+    if  ( iListBox != NULL )
+        {
+        ++count;
+        }
+    if  ( iSearchField != NULL )
+        {
+        ++count;
+        }
+    //
+    return count;
+    }
+
+
+CCoeControl* CMemSpyViewProcesses::ComponentControl( TInt aIndex ) const
+    {
+    CCoeControl* ret = iListBox;
+    //
+    if  ( aIndex == 1 )
+        {
+        ret = iSearchField;
+        }
+    //
+    return ret;
+    }
+
+
+TKeyResponse CMemSpyViewProcesses::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+    TKeyResponse resp = EKeyWasNotConsumed;
+    //
+    if  ( aType == EEventKey )
+        {
+        switch( aKeyEvent.iCode )
+            {
+        case EKeyUpArrow:
+        case EKeyDownArrow:
+        case EKeyEnter:
+        case EKeyOK:
+            if  ( iListBox )
+                {
+                resp = iListBox->OfferKeyEventL( aKeyEvent, aType );
+                }
+            break;
+        default:
+            break;
+            }
+        //
+        if  ( resp == EKeyWasNotConsumed )
+            {
+            // Do we need to show the find field?
+            resp = iSearchField->OfferKeyEventL( aKeyEvent, aType );
+            }
+        }
+    //
+    return resp;
+    }
+
+
+void CMemSpyViewProcesses::HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType )
+    {
+    CMemSpyViewBase::HandleControlEventL( aControl, aEventType );
+    //
+    if  ( aEventType == MCoeControlObserver::EEventStateChanged )
+        {
+        if  ( aControl == iSearchField )
+            {
+            SelectListBoxItemByFindTextL();
+            }
+        }
+    }
+
+
+void CMemSpyViewProcesses::FocusChanged( TDrawNow /*aDrawNow*/ )
+    {
+    if  ( iListBox )
+        {
+        iListBox->SetFocus( IsFocused() );
+        }
+    if  ( iSearchField )
+        {
+        iSearchField->SetFocus( IsFocused() );
+        }
+    }
+
+
+void CMemSpyViewProcesses::SelectListBoxItemByFindTextL()
+    {
+	/*
+    _LIT( KMemSpyWildcardCharacter, "*" );
+    
+    TPtr pBuffer( iMatcherBuffer->Des() );
+    iSearchField->GetSearchText( pBuffer );
+    //pBuffer.Insert( 0, KMemSpyWildcardCharacter );
+    pBuffer.Append( KMemSpyWildcardCharacter );
+    
+    CMemSpyEngineObjectContainer& container = iEngine.Container();
+    const TInt count = container.Count();
+    //
+    TInt index = 0;
+    while( index < count )
+        {
+        CMemSpyProcess& process = container.At( index );
+        const TPtrC processName( process.Name() );
+        //
+        if  ( processName.MatchF( pBuffer ) >= 0 )
+            {
+            HandleListBoxItemSelectedL( index );
+            iListBox->ScrollToMakeItemVisible( index );
+            iListBox->SetCurrentItemIndexAndDraw( index );
+            return;
+            }
+            
+        ++index;
+        }
+        */
+    }
+
+//Model formating methods
+//TODO: to be debbuged
+/*
+CDesCArrayFlat* CMemSpyViewProcesses::FormatModel( RArray<CMemSpyApiProcess*> aProcesses )
+	{		
+	model = new (ELeave) CDesC16ArrayFlat( iProcesses.Count() + 16 ); //array for formated items
+	_LIT( KMemSpyProcessNameFormatSpecBasicName, " \t%S\t\t%8x, " );
+	
+	for( TInt i=0; i < aProcesses.Count(); i++ )
+		{
+		HBufC* tempName = HBufC::NewL( KMaxFullName ); //aProcesses[i]->Name().Length() + 16
+	    CleanupStack::PushL( tempName );
+	    TPtr tempNamePtr( tempName->Des() );	    
+	    tempNamePtr.Copy( aProcesses[i]->Name() );
+		
+		TBuf<10> priority;
+		AppendPriority( priority, aProcesses[i]->Priority() );
+		
+	    // Convert the full name to the format we want in the UI
+	    TBuf<KMaxFullName + 60> name;
+	    TMemSpyTruncateOverflow overflow; //included from EngineUtils TODO: to consider if this is needed to be removed or left there
+	    	    
+	    name.AppendFormat( KMemSpyProcessNameFormatSpecBasicName, &overflow, tempNamePtr, aProcesses[i]->SID() );
+	    
+	    if( aProcesses[i]->ExitType() != EExitPending ) // instead of IsDead() method
+	    	{
+			AppendExitInfo( name, aProcesses[i]->ExitType(), aProcesses[i]->ExitReason(), aProcesses[i]->ExitCategory() );
+	    	}
+	    else
+	        {
+			_LIT( KMemSpyProcessNameFormatSpecAlive, "%2d thr, %S" );
+			name.AppendFormat( KMemSpyProcessNameFormatSpecAlive, &overflow, aProcesses[i]->ThreadCount(), &priority );
+	        }
+							
+    	model->AppendL( name );
+    	
+    	CleanupStack::PopAndDestroy( tempName ); 
+		}	
+	
+	return model;
+	}
+
+void CMemSpyViewProcesses::AppendPriority( TDes& aDes, TProcessPriority aPriority )
+	{
+	switch( aPriority )
+		{
+	    case EPriorityLow:
+	        aDes += _L("[L]");
+	        break;
+	    case EPriorityBackground:
+	        aDes += _L("[B]");
+	        break;
+	    case EPriorityForeground:
+	        aDes += _L("[F]");
+	        break;
+	    case EPriorityHigh:
+	        aDes += _L("[H]");
+	        break;
+	    case EPriorityWindowServer:
+	        aDes += _L("[WS]");
+	        break;
+	    case EPriorityFileServer:
+	        aDes += _L("[FS]");
+	        break;
+	    case EPriorityRealTimeServer:
+	        aDes += _L("[RTS]");
+	        break;
+	    case EPrioritySupervisor:
+	        aDes += _L("[SUP]");
+	        break;
+	    default:
+	        aDes += _L("[?]");
+	        break;
+		}
+	}
+
+void CMemSpyViewProcesses::AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  )
+	{
+    aDes.Append( '[' );
+    const TInt length = aDes.Length();
+    AppendExitType( aDes, aType );
+    aDes.SetLength( length + 1 ); // Remove all but the first letter
+    aDes.Append( ']' );
+    
+    if  ( aType == EExitKill || aType == EExitPending )
+        {
+        // Kill implies "clean" exit. Pending implies not yet dead.
+        }
+    else
+        {
+        TMemSpyTruncateOverflow overflow;
+
+        // Terminate or Panic implies abnormal exit condition, so
+        // show full exit info.
+        _LIT( KAbnormalFormatSpec, " %S-%d" );
+        aDes.AppendFormat( KAbnormalFormatSpec, &overflow, &aExitCategory, aExitReason );
+        }
+	}
+
+void CMemSpyViewProcesses::AppendExitType( TDes& aDes, TExitType aType )
+    {
+    _LIT( KExitTypeKilled, "Killed" );
+    _LIT( KExitTypeTerminated, "Terminated" );
+    _LIT( KExitTypePanicked, "Panicked" );
+    _LIT( KExitTypePending, "Pending" );
+    
+    // Panic and Terminate are exceptional exit conditions.
+    // Kill, is ironically, not an exceptional condition.
+    switch( aType )
+        {
+    case EExitKill:
+        aDes += KExitTypeKilled;
+        break;
+    case EExitTerminate:
+        aDes += KExitTypeTerminated;
+        break;
+    case EExitPanic:
+        aDes += KExitTypePanicked;
+        break;
+    default:
+    case EExitPending:
+        aDes += KExitTypePending;
+        break;
+        }
+    }
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewRAMInfo.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewRAMInfo.h"
+
+// System includes
+#include <hal.h>
+#include <aknnotedialog.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperram.h>
+#include <memspy/engine/memspyengineutils.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+
+
+
+CMemSpyViewRAMInfo::CMemSpyViewRAMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+void CMemSpyViewRAMInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "RAM Info" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewRAMInfo::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewRAMInfo::ViewType() const
+    {
+    return EMemSpyViewTypeRAMInfo;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewRAMInfo::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewRAMInfo::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    return child;
+    }
+
+
+void CMemSpyViewRAMInfo::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    TInt value;
+    TMemSpySizeText size;
+    TMemoryInfoV1Buf memInfoBuf;
+    UserHal::MemoryInfo( memInfoBuf );
+    const TMemoryInfoV1 memInfo( memInfoBuf() );
+
+    // 1st item = Total RAM
+    _LIT(KItem1Format, "\tTotal RAM\t\t%S");
+    size = MemSpyUiUtils::FormatSizeText( memInfo.iTotalRamInBytes );
+    item.Format( KItem1Format, &size );
+    model->AppendL( item );
+
+    // 2nd item = Max free RAM
+    _LIT(KItem2Format, "\tMax Free RAM\t\t%S");
+    size = MemSpyUiUtils::FormatSizeText( memInfo.iMaxFreeRamInBytes );
+    item.Format( KItem2Format, &size );
+    model->AppendL( item );
+
+    // 3rd item = Free RAM
+    _LIT(KItem3Format, "\tFree RAM\t\t%S (%S)");
+    const TMemSpyPercentText freeRamPercentage( MemSpyEngineUtils::FormatPercentage( TReal( memInfo.iTotalRamInBytes ), TReal( memInfo.iFreeRamInBytes ) ) );
+    size = MemSpyUiUtils::FormatSizeText( memInfo.iFreeRamInBytes );
+    item.Format( KItem3Format, &size, &freeRamPercentage );
+    model->AppendL( item );
+
+    // 4th item = RAM disk info
+    _LIT(KItem4Format, "\tRAM Disk Size\t\t%S");
+    size = MemSpyUiUtils::FormatSizeText( memInfo.iInternalDiskRamInBytes );
+    item.Format( KItem4Format, &size );
+    model->AppendL( item );
+
+    // 5th item = Max RAM disk size
+    _LIT(KItem5Format, "\tMax RAM Disk Size\t\t%S");
+    HAL::Get( HALData::EMaxRAMDriveSize, value );
+    size = MemSpyUiUtils::FormatSizeText( value );
+    item.Format( KItem5Format, &size );
+    model->AppendL( item );
+
+    // 6th item = RAM page size
+    _LIT(KItem6Format, "\tMemory Page Size\t\t%S");
+    HAL::Get( HALData::EMemoryPageSize, value );
+    size = MemSpyUiUtils::FormatSizeText( value );
+    item.Format( KItem6Format, &size );
+    model->AppendL( item );
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+TBool CMemSpyViewRAMInfo::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    if  ( iEngine.HelperRAM().IsAknIconCacheConfigurable() )
+        {
+        switch ( aCommand )
+            {
+        case EMemSpyCmdRAMAvkonIconCacheDisabled:
+            OnCmdSetIconCacheStatusL( EFalse );
+		    break;
+        case EMemSpyCmdRAMAvkonIconCacheEnabled:
+            OnCmdSetIconCacheStatusL( ETrue );
+		    break;
+
+        default:
+            handled = CMemSpyViewBase::HandleCommandL( aCommand );
+            break;
+            }
+        }
+    else
+        {
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewRAMInfo::OnCmdSetIconCacheStatusL( TBool aEnabled )
+    {
+    ASSERT( iEngine.HelperRAM().IsAknIconCacheConfigurable() );
+    //
+    const TInt64 savedAmount = iEngine.HelperRAM().SetAknIconCacheStatusL( aEnabled );
+    if ( !aEnabled )
+        {
+        TBuf<128> buf;
+        //
+        if  ( savedAmount != 0 ) 
+            {
+            _LIT(KSavedAmountFormatBuffer, "Saved %S of RAM");
+            const TMemSpySizeText savedAmountString( MemSpyEngineUtils::FormatSizeText( savedAmount, 0, EFalse ) );
+            buf.Format( KSavedAmountFormatBuffer, &savedAmountString );
+            }
+        else
+            {
+            _LIT(KDidNotSaveAnyRAM, "Operation did not save any RAM");
+            buf.Copy( KDidNotSaveAnyRAM );
+            }
+
+        // Show dialog
+	    CAknNoteDialog* note = new( ELeave ) CAknNoteDialog( CAknNoteDialog::ENoTone );
+	    CleanupStack::PushL( note );
+	    note->SetTextWrapping( ETrue );
+	    note->PrepareLC( R_MEMSPY_RAM_MEMORY_DELTA_DIALOG );
+	    note->SetTextL( buf );
+	    CleanupStack::Pop( note );
+	    note->RunLD();
+        }
+    //
+    RefreshL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewROMInfo.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,270 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewROMInfo.h"
+
+// System includes
+#include <hal.h>
+#ifdef __EPOC32__
+#include <e32rom.h>
+#endif
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+// Remap of E32 DP constants, needed so MemSpy can still build on v9.1
+enum TMemSpyDemandPagingKernelConfigFlags
+    {
+    EMemSpyKernelConfigPagingPolicyMask = 3<<5,
+    EMemSpyKernelConfigPagingPolicyNoPaging = 0<<5,
+    EMemSpyKernelConfigPagingPolicyAlwaysPage = 1<<5,
+    EMemSpyKernelConfigPagingPolicyDefaultUnpaged = 2<<5,
+    EMemSpyKernelConfigPagingPolicyDefaultPaged = 3<<5,
+    };
+
+
+
+CMemSpyViewROMInfo::CMemSpyViewROMInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+void CMemSpyViewROMInfo::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "ROM Info" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewROMInfo::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewROMInfo::ViewType() const
+    {
+    return EMemSpyViewTypeROMInfo;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewROMInfo::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewROMInfo::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    return child;
+    }
+
+
+void CMemSpyViewROMInfo::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    TInt value = 0;
+    TMemSpySizeText valueBuf;
+    TMemSpySizeText valueBuf2;
+    
+    // 1st item = Total RAM
+    _LIT(KItem1Format, "\tROM Size (HAL)\t\t%S");
+    HAL::Get( HALData::EMemoryROM, value );
+    valueBuf = MemSpyUiUtils::FormatSizeText( value );
+    item.Format( KItem1Format, &valueBuf );
+    model->AppendL( item );
+
+#ifdef __EPOC32__
+    TBuf<128> buf2;
+    _LIT( KTimeFormatSpecLocal, "%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B" );
+	const TUint main_start = UserSvr::RomHeaderAddress();
+    TRomHeader* romHeader = (TRomHeader*) main_start;
+
+    _LIT(KItem2Format, "\tROM Size (Header)\t\t%S");
+    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iRomSize ) );
+    item.Format( KItem2Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem2aFormat, "\tROM Page Size\t\t%S");
+    HAL::Get( HALData::EMemoryPageSize, value );
+    valueBuf = MemSpyUiUtils::FormatSizeText( value );
+    item.Format( KItem2aFormat, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem10Format, "\tVersion\t\tv%2d.%02d.%06d");
+    item.Format( KItem10Format, romHeader->iVersion.iMajor, romHeader->iVersion.iMinor, romHeader->iVersion.iBuild );
+    model->AppendL( item );
+
+    _LIT(KItem3Format, "\tTimestamp\t\t%S");
+    TTime time( romHeader->iTime );
+    time.FormatL( buf2, KTimeFormatSpecLocal );
+    item.Format( KItem3Format, &buf2 );
+    model->AppendL( item );
+
+    _LIT(KItem4Format, "\tAddress Range\t\t%S - %S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iRomBase );
+    MemSpyUiUtils::FormatHex( valueBuf2, (romHeader->iRomBase + romHeader->iRomSize ));
+    item.Format( KItem4Format, &valueBuf, &valueBuf2 );
+    model->AppendL( item );
+
+    _LIT(KItem5Format, "\tPrimary File Address\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iPrimaryFile );
+    item.Format( KItem5Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem6Format, "\tSecondary File Address\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iSecondaryFile );
+    item.Format( KItem6Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem7Format, "\tChecksum\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iCheckSum );
+    item.Format( KItem7Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem8Format, "\tKernel Config Flags\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iKernelConfigFlags );
+    item.Format( KItem8Format, &valueBuf );
+    model->AppendL( item );
+
+    if  ( romHeader->iKernelConfigFlags & EKernelConfigIpcV1Available )
+        {
+        _LIT(KItem8aFormat, "\tIPC v1 Available\t\tYes");
+        item.Copy( KItem8aFormat );
+        model->AppendL( item );
+        }
+    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecEnforcement )
+        {
+        _LIT(KItem8bFormat, "\tPlatSec Enforcement\t\tYes");
+        item.Copy( KItem8bFormat );
+        model->AppendL( item );
+        }
+    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecDiagnostics )
+        {
+        _LIT(KItem8cFormat, "\tPlatSec Diagnostics\t\tYes");
+        item.Copy( KItem8cFormat );
+        model->AppendL( item );
+        }
+    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecProcessIsolation )
+        {
+        _LIT(KItem8dFormat, "\tPlatSec Process Isolation\t\tYes");
+        item.Copy( KItem8dFormat );
+        model->AppendL( item );
+        }
+    if  ( romHeader->iKernelConfigFlags & EKernelConfigPlatSecEnforceSysBin )
+        {
+        _LIT(KItem8eFormat, "\tEnforce \\Sys\\Bin\\\t\tYes");
+        item.Copy( KItem8eFormat );
+        model->AppendL( item );
+        }
+
+    const TUint32 pagingPolicy = ( romHeader->iKernelConfigFlags & EMemSpyKernelConfigPagingPolicyMask );
+#ifdef _DEBUG
+    RDebug::Printf( "pagingPolicy: %u (0x%08x)", pagingPolicy, pagingPolicy );
+#endif
+    _LIT(KItem8eFormat, "\tDemand Paging\t\t%S");
+    //
+    if  ( pagingPolicy & EMemSpyKernelConfigPagingPolicyNoPaging )
+        {
+        _LIT( KDemandPagingPolicyNoPaging, "No Paging" );
+        item.Format( KItem8eFormat, &KDemandPagingPolicyNoPaging );
+        }
+    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyAlwaysPage )
+        {
+        _LIT( KDemandPagingPolicyAlwaysPage, "Always Paging" );
+        item.Format( KItem8eFormat, &KDemandPagingPolicyAlwaysPage);
+        }
+    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyDefaultUnpaged )
+        {
+        _LIT( KDemandPagingPolicyDefaultUnpaged, "Default Unpaged" );
+        item.Format( KItem8eFormat, &KDemandPagingPolicyDefaultUnpaged);
+        }
+    else if ( pagingPolicy & EMemSpyKernelConfigPagingPolicyDefaultPaged )
+        {
+        _LIT( KDemandPagingPolicyDefaultPaged, "Default Paged" );
+        item.Format( KItem8eFormat, &KDemandPagingPolicyDefaultPaged );
+        }
+    //
+    model->AppendL( item );
+
+    _LIT(KItem9Format, "\tSection Header Address\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iRomSectionHeader );
+    item.Format( KItem9Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem11Format, "\tCompressed Size\t\t%S");
+    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iCompressedSize ) );
+    item.Format( KItem11Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem12Format, "\tUncompressed Size\t\t%S");
+    valueBuf = MemSpyUiUtils::FormatSizeText( TInt64( romHeader->iUncompressedSize ) );
+    item.Format( KItem12Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem13Format, "\tDisabled Caps. #1\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iDisabledCapabilities[0] );
+    item.Format( KItem13Format, &valueBuf );
+    model->AppendL( item );
+
+    _LIT(KItem14Format, "\tDisabled Caps. #2\t\t%S");
+    MemSpyUiUtils::FormatHex( valueBuf, romHeader->iDisabledCapabilities[1] );
+    item.Format( KItem14Format, &valueBuf );
+    model->AppendL( item );
+
+    for(TInt i=0; i<TRomHeader::KNumTraceMask; i++)
+        {
+        _LIT(KItem15Format, "\tTrace Mask #%d\t\t%S");
+        MemSpyUiUtils::FormatHex( valueBuf, romHeader->iTraceMask[i] );
+        item.Format( KItem15Format, i+1, &valueBuf );
+        model->AppendL( item );
+        }
+
+#endif
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewServerList.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,227 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewServerList.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+#include <memspy/engine/memspyenginehelperserver.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyContainerObserver.h"
+
+
+
+
+CMemSpyViewServerList::CMemSpyViewServerList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewServerList::~CMemSpyViewServerList()
+    {
+    delete iList;
+    }
+
+
+void CMemSpyViewServerList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Running Servers" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+TBool CMemSpyViewServerList::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdServerListSortByName:
+        OnCmdServerListSortByNameL();
+        break;
+    case EMemSpyCmdServerListSortBySessionCount:
+        OnCmdServerListSortBySessionCountL();
+        break;
+    case EMemSpyCmdServerListOutputListCSV:
+        OnCmdServerListOutputSummaryL();
+        break;
+    case EMemSpyCmdServerListOutputListDetailed:
+        OnCmdServerListOutputDetailedL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewServerList::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewServerList::ViewType() const
+    {
+    return EMemSpyViewTypeServerList;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewServerList::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewServerList::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+
+    // First, try to find the selected thread
+    if  ( iActionedItem )
+        {
+        // Try to create a view of the thread in question
+        CMemSpyProcess* process = NULL;
+        CMemSpyThread* thread = NULL;
+        //
+        const TInt error = iEngine.Container().ProcessAndThreadByThreadId( iActionedItem->Id(), process, thread );
+        //
+        if  ( error == KErrNone && thread != NULL )
+            {
+            child = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, thread->Process() );
+            CleanupStack::PushL( child );
+            child->ConstructL( Rect(), *Parent(), thread );
+            CleanupStack::Pop( child );
+            }
+        }
+    //
+    return child;
+    }
+
+
+void CMemSpyViewServerList::SetListBoxModelL()
+    {
+    delete iList;
+    iList = NULL;
+    iList = iEngine.HelperServer().ServerListL();
+    //
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iList );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewServerList::HandleListBoxItemActionedL( TInt aCurrentIndex )
+    {
+    if  ( aCurrentIndex >= 0 && aCurrentIndex < iList->Count() )
+        {
+        const CMemSpyEngineServerEntry& serverInfo = iList->At( aCurrentIndex );
+        iActionedItem = &serverInfo;
+        }
+    else
+        {
+        iActionedItem = NULL;
+        }
+
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewServerList::OnCmdServerListSortByNameL()
+    {
+    iList->SortByNameL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewServerList::OnCmdServerListSortBySessionCountL()
+    {
+    iList->SortBySessionCountL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewServerList::OnCmdServerListOutputSummaryL()
+    {
+    OnCmdServerListOutputGenericL( EFalse );
+    }
+
+
+void CMemSpyViewServerList::OnCmdServerListOutputDetailedL()
+    {
+    OnCmdServerListOutputGenericL( ETrue );
+    }
+
+
+void CMemSpyViewServerList::OnCmdServerListOutputGenericL( TBool aDetailed )
+    {
+    // Begin a new data stream
+    _LIT( KMemSpyContext, "Server List - " );
+    _LIT( KMemSpyFolder, "Servers" );
+    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
+
+    // Set prefix for overall listing
+    iEngine.Sink().OutputPrefixSetLC( KMemSpyContext );
+
+    // Create header
+    CMemSpyEngineServerList::OutputDataColumnsL( iEngine, aDetailed );
+    
+    // List items
+    const TInt count = iList->Count();
+    for(TInt i=0; i<count; i++)
+        {
+        const CMemSpyEngineServerEntry& server = iList->At( i );
+        //
+        server.OutputDataL( iEngine.HelperServer(), aDetailed );
+        }
+
+    // Tidy up
+    CleanupStack::PopAndDestroy(); // prefix
+ 
+    // End data stream
+    iEngine.Sink().DataStreamEndL();
+    }
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewSystemConfig.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,883 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewSystemConfig.h"
+
+// System includes
+#include <hal.h>
+#include <bautils.h>
+#include <eikenv.h>
+#ifdef __EPOC32__
+#include <e32rom.h>
+#endif
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperfilesystem.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+// Literal constants
+_LIT( KMemSpyItemValueNotKnown, "Unknown" );
+
+
+
+CMemSpyViewSystemConfig::CMemSpyViewSystemConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewSystemConfig::~CMemSpyViewSystemConfig()
+    {
+    delete iModel;
+    }
+
+
+void CMemSpyViewSystemConfig::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "System Configuration" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+void CMemSpyViewSystemConfig::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewSystemConfig::ViewType() const
+    {
+    return EMemSpyViewTypeSystemConfig;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewSystemConfig::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    return child;
+    }
+
+
+void CMemSpyViewSystemConfig::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
+    delete iModel;
+    iModel = model;
+
+    TBuf<128> valueBuf;
+    TInt value = 0;
+    TInt value2 = 0;
+    TMemSpySizeText sizeBuf;
+
+    //
+    _LIT(KItem1Format, "Manufacturer");
+    GetManufacturer( valueBuf );
+    AddItemL( KItem1Format, valueBuf );
+
+    //
+    _LIT(KItem2Format, "Machine Uid");
+    GetMachineUid( valueBuf );
+    AddItemL( KItem2Format, valueBuf );
+
+    //
+    _LIT(KItem1aFormat, "Model Uid");
+    GetHALValueAsHexL( HALData::EModel, KItem1aFormat );
+
+    //
+    _LIT(KItem2aFormat, "Device Family");
+    GetDeviceFamily( valueBuf );
+    AddItemL( KItem2aFormat, valueBuf );
+
+    //
+    _LIT(KItem2bFormat, "Device Family Rev.");
+    GetHALValueAsNumericL( HALData::EDeviceFamilyRev, KItem2bFormat );
+
+    //
+    _LIT(KItem3Format, "Hardware Rev.");
+    GetHALValueAsNumericL( HALData::EManufacturerHardwareRev, KItem3Format );
+
+    //
+    _LIT(KItem4Format, "Software Rev.");
+    GetHALValueAsNumericL( HALData::EManufacturerSoftwareRev, KItem4Format );
+
+    //
+    _LIT(KItem5Format, "Software Build");
+    GetHALValueAsNumericL( HALData::EManufacturerSoftwareBuild, KItem5Format );
+
+    //
+    _LIT(KItem6Format, "CPU");
+    GetCPU( valueBuf );
+    AddItemL( KItem6Format, valueBuf );
+
+    //
+    _LIT(KItem7Format, "CPU ABI");
+    GetCPUABI( valueBuf );
+    AddItemL( KItem7Format, valueBuf );
+
+    //
+    _LIT(KItem8Format, "CPU Speed");
+    _LIT(KItem8Suffix, "KHz");
+    GetHALValueAsNumericL( HALData::ECPUSpeed, KItem8Format, &KItem8Suffix );
+
+    //
+    _LIT(KItem8aFormat, "Floating Point Support");
+    GetHALValueAsYesNoL( HALData::EHardwareFloatingPoint, KItem8aFormat );
+
+    //
+    _LIT(KItem8bFormat, "System Tick Period");
+    _LIT(KItem8bSuffix, "ms");
+    GetHALValueAsNumericL( HALData::ESystemTickPeriod, KItem8bFormat, &KItem8bSuffix );
+
+    //
+    _LIT(KItem8cFormat, "Nano Tick Period");
+    _LIT(KItem8cSuffix, "us");
+    GetHALValueAsNumericL( HALData::ENanoTickPeriod, KItem8cFormat, &KItem8cSuffix );
+
+    //
+    _LIT(KItem9Format, "Startup Reason");
+    GetStartupReason( valueBuf );
+    AddItemL( KItem9Format, valueBuf );
+
+    //
+    _LIT(KItem10Format, "Language");
+    GetHALValueAsNumericL( HALData::ELanguageIndex, KItem10Format, NULL, 4 );
+
+    //
+    _LIT(KItem10aFormat, "Locale");
+    GetHALValueAsNumericL( HALData::ELocaleLoaded, KItem10aFormat, NULL, 4 );
+
+    //
+    _LIT(KItem11aFormat, "Clipboard Drive");
+    GetHALValueAsDriveLetterL( HALData::EClipboardDrive, KItem11aFormat );
+
+    //
+    _LIT(KItem11bFormat, "System Drive (Hal)");
+    GetHALValueAsDriveLetterL( HALData::ESystemDrive, KItem11bFormat );
+
+    //
+    _LIT(KItem11cFormat, "System Drive (F32)");
+    TDriveNumber systemDrive = CMemSpyEngineHelperFileSystem::GetSystemDrive();
+    AddItemL( systemDrive, KItem11cFormat );
+
+    //
+    _LIT(KItem11dFormat, "System Drive (Bafl)");
+    value = BaflUtils::GetSystemDrive( systemDrive );
+    if ( value == KErrNone )
+        {
+        AddItemL( systemDrive, KItem11dFormat );
+        }
+    else
+        {
+        MemSpyUiUtils::GetErrorText( valueBuf, value );
+        AddItemL( KItem11dFormat, valueBuf );
+        }
+
+    //
+    _LIT(KItem12Format, "Display Type");
+    GetDisplayType( valueBuf );
+    AddItemL( KItem12Format, valueBuf );
+    //
+    _LIT(KItem12aCaption, "Display Size");
+    _LIT(KItem12aFormat, "%d x %d");
+    value = value2 = 0;
+    GetHALValue( HALData::EDisplayXPixels, value );
+    GetHALValue( HALData::EDisplayYPixels, value2 );
+    valueBuf.Format( KItem12aFormat, value, value2 );
+    AddItemL( KItem12aCaption, valueBuf );
+
+    //
+    _LIT(KItem13Format, "Display Depth");
+    _LIT(KItem13Suffix, "bpp");
+    GetHALValueAsNumericL( HALData::EDisplayBitsPerPixel, KItem13Format, &KItem13Suffix );
+
+    //
+    _LIT(KItem14Format, "Display Mode Count");
+    GetHALValueAsNumericL( HALData::EDisplayNumModes, KItem14Format );
+
+    //
+    _LIT(KItem14aFormat, "Current Mode");
+    GetHALValueAsNumericL( HALData::EDisplayMode, KItem14aFormat );
+
+    //
+    _LIT(KItem15Format, "Display Address");
+    GetHALValueAsHexL( HALData::EDisplayMemoryAddress, KItem15Format );
+
+    //
+    _LIT(KItem16Format, "Screen Count");
+    GetHALValueAsNumericL( HALData::EDisplayNumberOfScreens, KItem16Format );
+
+    //
+    _LIT(KItem17Format, "Eikon Def. Disp. Mode");
+    GetDisplayMode( valueBuf, static_cast<TMemSpyDisplayMode>( CEikonEnv::Static()->DefaultDisplayMode() ) );
+    AddItemL( KItem17Format, valueBuf );
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    iModel = NULL;
+    }
+
+
+void CMemSpyViewSystemConfig::GetManufacturer( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::EManufacturer, value );
+    //
+    switch( value )
+        {
+    case HALData::EManufacturer_Ericsson:
+        {
+        _LIT( KName, "Ericsson" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Motorola:
+        {
+        _LIT( KName, "Motorola" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Nokia:
+        {
+        _LIT( KName, "Nokia" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Panasonic:
+        {
+        _LIT( KName, "Panasonic" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Psion:
+        {
+        _LIT( KName, "Psion" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Intel:
+        {
+        _LIT( KName, "Intel" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Cogent:
+        {
+        _LIT( KName, "Cogent" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Cirrus:
+        {
+        _LIT( KName, "Cirrus" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_Linkup:
+        {
+        _LIT( KName, "Linkup" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EManufacturer_TexasInstruments:
+        {
+        _LIT( KName, "Texas Instruments" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetDisplayMode( TDes& aBuf, TMemSpyDisplayMode aMode )
+    {
+    switch( aMode )
+        {
+    case ENone:
+        {
+        _LIT( KName, "ENone" );
+        aBuf.Copy( KName );
+        }
+    case EGray2:
+        {
+        _LIT( KName, "EGray2" );
+        aBuf.Copy( KName );
+        }
+    case EGray4:
+        {
+        _LIT( KName, "EGray4" );
+        aBuf.Copy( KName );
+        }
+    case EGray16:
+        {
+        _LIT( KName, "EGray16" );
+        aBuf.Copy( KName );
+        }
+    case EGray256:
+        {
+        _LIT( KName, "EGray256" );
+        aBuf.Copy( KName );
+        }
+    case EColor16:
+        {
+        _LIT( KName, "EColor16" );
+        aBuf.Copy( KName );
+        }
+    case EColor256:
+        {
+        _LIT( KName, "EColor256" );
+        aBuf.Copy( KName );
+        }
+    case EColor64K:
+        {
+        _LIT( KName, "EColor64K" );
+        aBuf.Copy( KName );
+        }
+    case EColor16M:
+        {
+        _LIT( KName, "EColor16M" );
+        aBuf.Copy( KName );
+        }
+    case ERgb:
+        {
+        _LIT( KName, "ERgb" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case EColor4K:
+        {
+        _LIT( KName, "EColor4K" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case EColor16MU:
+        {
+        _LIT( KName, "EColor16MU" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case EColor16MA:
+        {
+        _LIT( KName, "EColor16MA" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case EColor16MAP:
+        {
+        _LIT( KName, "EColor16MAP" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetDeviceFamily( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::EDeviceFamily, value );
+    //
+    switch( value )
+        {
+    case HALData::EDeviceFamily_Crystal:
+        {
+        _LIT( KName, "Crystal" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EDeviceFamily_Pearl:
+        {
+        _LIT( KName, "Pearl" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EDeviceFamily_Quartz:
+        {
+        _LIT( KName, "Quartz" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetCPU( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::ECPU, value );
+    //
+    switch( value )
+        {
+    case HALData::ECPU_ARM:
+        {
+        _LIT( KName, "ARM" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPU_MCORE:
+        {
+        _LIT( KName, "mCORE" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPU_X86:
+        {
+        _LIT( KName, "X86" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetCPUABI( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::ECPUABI, value );
+    //
+    switch( value )
+        {
+    case HALData::ECPUABI_ARM4:
+        {
+        _LIT( KName, "ARM4" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_ARMI:
+        {
+        _LIT( KName, "ARMI" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_THUMB:
+        {
+        _LIT( KName, "ARM4" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_MCORE:
+        {
+        _LIT( KName, "mCORE" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_MSVC:
+        {
+        _LIT( KName, "MSVC" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_ARM5T:
+        {
+        _LIT( KName, "ARM5T" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ECPUABI_X86:
+        {
+        _LIT( KName, "X86" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetStartupReason( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::ESystemStartupReason, value );
+    //
+    switch( value )
+        {
+    case HALData::ESystemStartupReason_Cold:
+        {
+        _LIT( KName, "Cold" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ESystemStartupReason_Warm:
+        {
+        _LIT( KName, "Warm" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::ESystemStartupReason_Fault:
+        {
+        _LIT( KName, "Fault" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetKeyboard( TDes& aBuf )
+    {
+    _LIT(KComma, ", ");
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::EKeyboard, value );
+    //
+    aBuf.Zero();
+    if  ( value & EKeyboard_Keypad )
+        {
+        _LIT( KName, "Keypad" );
+        aBuf.Copy( KName );
+        }
+
+
+    if  ( value & EKeyboard_Full )
+        {
+        if  ( aBuf.Length() )
+            {
+            aBuf.Append( KComma );
+            }
+
+        _LIT( KName, "Full Keyboard" );
+        aBuf.Copy( KName );
+        }
+
+    if  ( !aBuf.Length() )
+        {
+        aBuf.Copy( KMemSpyItemValueNotKnown );
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetMachineUid( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::EMachineUid, value );
+    //
+    switch( value )
+        {
+    case HALData::EMachineUid_Series5mx:
+        {
+        _LIT( KName, "Series 5mx" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Brutus:
+        {
+        _LIT( KName, "Brutus" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Cogent:
+        {
+        _LIT( KName, "Cogent" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Win32Emulator:
+        {
+        _LIT( KName, "Win32 Emulator" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_WinC:
+        {
+        _LIT( KName, "WINC" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_CL7211_Eval:
+        {
+        _LIT( KName, "CL7211" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_LinkUp:
+        {
+        _LIT( KName, "LinkUp" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Assabet:
+        {
+        _LIT( KName, "Assabet" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_IQ80310:
+        {
+        _LIT( KName, "IQ80310" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Lubbock:
+        {
+        _LIT( KName, "Lubbock" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Integrator:
+        {
+        _LIT( KName, "Integrator" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_Helen:
+        {
+        _LIT( KName, "Helen" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_X86PC:
+        {
+        _LIT( KName, "X86PC" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_OmapH2:
+        {
+        _LIT( KName, "OmapH2" );
+        aBuf.Copy( KName );
+        }
+        break;
+    case HALData::EMachineUid_OmapH4:
+        {
+        _LIT( KName, "OmapH4" );
+        aBuf.Copy( KName );
+        }
+        break;
+    default:
+        {
+        _LIT( KName, "0x%08x" );
+        aBuf.Format( KName, value );
+        }
+        break;
+        }
+    }
+
+
+void CMemSpyViewSystemConfig::GetDisplayType( TDes& aBuf )
+    {
+    TInt value = KErrGeneral;
+    GetHALValue( HALData::EDisplayIsMono, value );
+    //
+    if  ( value == 0 )
+        {
+        _LIT( KName, "Colour" );
+        aBuf.Copy( KName );
+        }
+    else if ( value == 1 )
+        {
+        _LIT( KName, "Mono" );
+        aBuf.Copy( KName );
+        }
+    else
+        {
+        MemSpyUiUtils::GetErrorText( aBuf, value );
+        }
+    }
+
+
+TInt CMemSpyViewSystemConfig::GetHALValue( HALData::TAttribute aAttribute, TInt& aValue )
+    {
+    aValue = KErrGeneral;
+    const TInt error = HAL::Get( aAttribute, aValue );
+
+#ifdef _DEBUG
+    if  ( error != KErrNone )
+        {
+        RDebug::Printf("CMemSpyViewSystemConfig::GetHALValue() - aAttribute: %3d, error: %d, value: %d", aAttribute, error, aValue);
+        }
+#endif
+
+    return error;
+    }
+
+
+TInt CMemSpyViewSystemConfig::GetHALValueAsNumericL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix, TInt aWidth )
+    {
+    TBuf<20> valueBuf; 
+    TInt value = 0;
+    //
+    const TInt error = GetHALValue( aAttribute, value );
+    if  ( error == KErrNone )
+        {
+        if  ( aWidth > 0 && aWidth < 12 )
+            {
+            valueBuf.NumFixedWidthUC( (TUint) value, EDecimal, aWidth );
+            }
+        else
+            {
+            valueBuf.Num( value );
+            }
+
+        AddItemL( aCaption, valueBuf, aSuffix );
+        }
+    else
+        {
+        MemSpyUiUtils::GetErrorText( valueBuf, error );
+        AddItemL( aCaption, valueBuf );
+        }
+    //
+    return error;
+    }
+
+
+TInt CMemSpyViewSystemConfig::GetHALValueAsHexL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
+    {
+    TBuf<20> valueBuf; 
+    TInt value = 0;
+    //
+    const TInt error = GetHALValue( aAttribute, value );
+    if  ( error == KErrNone )
+        {
+        MemSpyEngineUtils::FormatHex( valueBuf, value );
+        AddItemL( aCaption, valueBuf, aSuffix );
+        }
+    else
+        {
+        MemSpyUiUtils::GetErrorText( valueBuf, error );
+        AddItemL( aCaption, valueBuf );
+        }
+    //
+    return error;
+    }
+
+
+TInt CMemSpyViewSystemConfig::GetHALValueAsYesNoL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
+    {
+    TBuf<20> valueBuf; 
+    TInt value = 0;
+    //
+    const TInt error = GetHALValue( aAttribute, value );
+    if  ( error == KErrNone || error == KErrNotSupported )
+        {
+        _LIT(KYes, "Yes");
+        _LIT(KNo, "No");
+        _LIT(KError, "Error: %d");
+
+        if ( error < KErrNone )
+            {
+            valueBuf.Format( KError, error );
+            }
+        else if ( value == EFalse )
+            {
+            valueBuf.Copy( KNo );
+            }
+        else if ( error == KErrNone )
+            {
+            valueBuf.Copy( KYes );
+            }
+
+        AddItemL( aCaption, valueBuf, aSuffix );
+        }
+    else
+        {
+        MemSpyUiUtils::GetErrorText( valueBuf, error );
+        AddItemL( aCaption, valueBuf );
+        }
+    //
+    return error;
+    }
+
+
+TInt CMemSpyViewSystemConfig::GetHALValueAsDriveLetterL( HALData::TAttribute aAttribute, const TDesC& aCaption, const TDesC* aSuffix )
+    {
+    TInt value = 0;
+    const TInt error = GetHALValue( aAttribute, value );
+    //
+    if  ( error == KErrNone && ( value >= EDriveA && value <= EDriveZ ) )
+        {
+        AddItemL( (TDriveNumber) value, aCaption, aSuffix );
+        }
+    else
+        {
+        _LIT( KItemNotSet, "Not Defined");
+        AddItemL( aCaption, KItemNotSet );
+        }
+    //
+    return error;
+    }
+
+
+void CMemSpyViewSystemConfig::AddItemL( const TDesC& aCaption, const TDesC& aValue, const TDesC* aSuffix )
+    {
+    _LIT(KItemFormat, "\t%S\t\t%S");
+    //
+    TBuf<KMaxFullName> item;
+    item.Format( KItemFormat, &aCaption, &aValue );
+    if  ( aSuffix ) 
+        {
+        _LIT(KSpace, " ");
+        item.Append( KSpace );
+        item.Append( *aSuffix );
+        }
+    //
+    iModel->AppendL( item );
+    }
+
+
+void CMemSpyViewSystemConfig::AddItemL( TDriveNumber aDrive, const TDesC& aCaption, const TDesC* aSuffix )
+    {
+    TBuf<20> valueBuf; 
+    //
+    const TDriveUnit drive( aDrive );
+    valueBuf.Copy( drive.Name() );
+    //
+    AddItemL( aCaption, valueBuf, aSuffix );
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,241 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemActiveObject.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperactiveobject.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+
+
+
+CMemSpyViewThreadInfoItemActiveObjectBase::CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeActiveObject )
+    {
+    }
+
+
+TBool CMemSpyViewThreadInfoItemActiveObjectBase::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdActiveObjectListing:
+        OnCmdWriteAOListingL();
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemActiveObjectBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        aMenuPane->SetItemDimmed( EMemSpyCmdActiveObject, Thread().IsDead() );
+        }
+    }
+
+
+CMemSpyEngineActiveObjectArray& CMemSpyViewThreadInfoItemActiveObjectBase::ActiveObjectArray() const
+    {
+    CMemSpyThreadInfoActiveObjects* activeObjectArray = static_cast< CMemSpyThreadInfoActiveObjects* >( iInfoItem );
+    return activeObjectArray->Array();
+    }
+    
+    
+void CMemSpyViewThreadInfoItemActiveObjectBase::OnCmdWriteAOListingL()
+    {
+    CMemSpyEngineActiveObjectArray& objects = ActiveObjectArray();
+
+    // Begin a new data stream
+    _LIT( KMemSpyContext, "Active Object List - " );
+    _LIT( KMemSpyFolder, "Active Objects" );
+    iEngine.Sink().DataStreamBeginL( KMemSpyContext, KMemSpyFolder );
+
+    // Set prefix for overall listing
+    iEngine.Sink().OutputPrefixSetLC( KMemSpyContext );
+
+    // Create header
+    CMemSpyEngineActiveObjectArray::OutputDataColumnsL( iEngine );
+    
+    // List items
+    const TInt count = objects.Count();
+    for(TInt i=0; i<count; i++)
+        {
+        const CMemSpyEngineActiveObject& object = objects.At( i );
+        //
+        object.OutputDataL( iEngine );
+        }
+
+    // Tidy up
+    CleanupStack::PopAndDestroy(); // prefix
+
+    // End data stream
+    iEngine.Sink().DataStreamEndL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemActiveObject::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    // Causes list of server's to be prepared
+    CMemSpyViewThreadInfoItemActiveObjectBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    _LIT( KTitle, "Active Objects" );
+    SetTitleL( KTitle );
+
+    // Try to select the correct server
+    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
+    TInt selectedIndex = 0;
+    if  ( aSelectionRune )
+        {
+        CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
+        const TInt index = activeObjectArray.ObjectIndexByAddress( aSelectionRune );
+        if  ( index >= 0 && index < activeObjectArray.Count() )
+            {
+            selectedIndex = index + 1;
+            }
+        }
+
+    // Select item
+    if  ( infoItem->DetailsCount() > 0 )
+        {
+        iListBox->SetCurrentItemIndex( selectedIndex );
+        HandleListBoxItemSelectedL( selectedIndex );
+        }
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemActiveObject::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemActiveObject;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObject::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+
+    // Get current entry address
+    TInt index = iListBox->CurrentItemIndex();
+    if  ( index > 0 )
+        {
+        --index;
+        CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
+        //
+        if  ( index >= 0 && index < activeObjectArray.MdcaCount() )
+            {
+            CMemSpyEngineActiveObject& object = activeObjectArray.At( index );
+            TAny* aoAddress = object.Address();
+            //
+            child = new(ELeave) CMemSpyViewThreadInfoItemActiveObjectDetails( iEngine, iObserver, iInfoItem->Container(), aoAddress );
+            CleanupStack::PushL( child );
+            child->ConstructL( Rect(), *Parent(), NULL );
+            CleanupStack::Pop( child );
+            }
+        }
+    //
+    return child;
+    }
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemActiveObjectDetails::CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress )
+:   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer ), iObjectAddress( aObjectAddress )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemActiveObjectDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemActiveObjectBase::ConstructL( aRect, aContainer, aSelectionRune );
+
+    _LIT( KTitle, "Active Object Details" );
+    SetTitleL( KTitle );
+    }
+    
+
+TMemSpyViewType CMemSpyViewThreadInfoItemActiveObjectDetails::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemActiveObjectDetails;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObjectDetails::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemActiveObject* parent = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iEngine, iObserver, iInfoItem->Container() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), iObjectAddress );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewThreadInfoItemActiveObjectDetails::SetListBoxModelL()
+    {
+    // Try to find the right entry
+    CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
+    const TInt index = activeObjectArray.ObjectIndexByAddress( iObjectAddress );
+    User::LeaveIfError( index );
+    CMemSpyEngineActiveObject& object = activeObjectArray.At( index );
+    //
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &object );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemChunk.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperchunk.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewChunkList.h"
+
+
+
+CMemSpyViewThreadInfoItemChunk::CMemSpyViewThreadInfoItemChunk( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeChunk )
+    {
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemChunk::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    
+    // Get the code segment list
+    CMemSpyThreadInfoChunk* chunkInfoItem = static_cast< CMemSpyThreadInfoChunk* >( iInfoItem );
+    CMemSpyEngineChunkList* list = &chunkInfoItem->List();
+    
+    // Get the current code segment that corresponds to our currently focused list item.
+    const TInt index = iListBox->CurrentItemIndex();
+    if  ( index >= 0 && index < list->Count() )
+        {
+        CMemSpyEngineChunkEntry& entry = list->At( index );
+        child = new(ELeave) CMemSpyViewChunkDetails( iEngine, iObserver, *list, entry );
+        
+        // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+        // This object is about to die in any case.
+        chunkInfoItem->NullifyList();
+
+        CleanupStack::PushL( child );
+        child->ConstructL( Rect(), *Parent() );
+        CleanupStack::Pop( child );
+        }
+        
+    return child;
+    }
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemCodeSeg.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelpercodesegment.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewCodeSegList.h"
+
+
+
+CMemSpyViewThreadInfoItemCodeSeg::CMemSpyViewThreadInfoItemCodeSeg( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeCodeSeg )
+    {
+    }
+
+
+TBool CMemSpyViewThreadInfoItemCodeSeg::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
+    return handled;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemCodeSeg::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    
+    // Get the code segment list
+    CMemSpyThreadInfoCodeSeg* codeSegInfoItem = static_cast< CMemSpyThreadInfoCodeSeg* >( iInfoItem );
+    CMemSpyEngineCodeSegList* list = &codeSegInfoItem->List();
+    
+    // Get the current code segment that corresponds to our currently focused list item.
+    const TInt index = iListBox->CurrentItemIndex();
+    if  ( index >= 0 && index < list->Count() )
+        {
+        CMemSpyEngineCodeSegEntry& entry = list->At( index );
+        child = new(ELeave) CMemSpyViewCodeSegDetails( iEngine, iObserver, *list, entry );
+        
+        // Ownership is transferred to child. Cleanupstack guarantees it will be destroyed now.
+        // This object is about to die in any case.
+        codeSegInfoItem->NullifyList();
+
+        CleanupStack::PushL( child );
+        child->ConstructL( Rect(), *Parent() );
+        CleanupStack::Pop( child );
+        }
+        
+    return child;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemGeneralInfo.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewThreadInfoItemHeap.h"
+
+
+
+CMemSpyViewThreadInfoItemGeneralInfo::CMemSpyViewThreadInfoItemGeneralInfo( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeGeneralInfo )
+    {
+    }
+
+
+TBool CMemSpyViewThreadInfoItemGeneralInfo::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+
+
+void CMemSpyViewThreadInfoItemGeneralInfo::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,315 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemGeneric.h"
+
+// System includes
+#include <AknWaitDialog.h>
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewThreadInfoItemList.h"
+
+// Constants
+const TInt KMemSpyConstructionCheckerTimerPeriod = 500000; // 1/2 second
+
+
+
+CMemSpyViewThreadInfoItemGeneric::CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType )
+:   CMemSpyViewBase( aEngine, aObserver ), iContainer( aInfoContainer )
+    {
+    iContainer.Thread().Process().Open();
+    iContainer.Thread().Open();
+    iContainer.Open();
+    //
+    iInfoItem = &iContainer.Item( aType );
+    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
+    iInfoItem->Open();
+    }
+
+
+CMemSpyViewThreadInfoItemGeneric::~CMemSpyViewThreadInfoItemGeneric()
+    {
+    if  ( iInfoItem )
+        {
+        iInfoItem->Close();
+        }
+    //
+    DestroyWaitNote();
+    //
+    iContainer.Close();
+    iContainer.Thread().Close();
+    iContainer.Thread().Process().Close();
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    const TPtrC pTitle( iInfoItem->Name().Mid( 1 ) );
+    SetTitleL( pTitle );
+    //
+    if  ( iInfoItem->IsReady() == EFalse )
+        {
+#ifdef _DEBUG
+        RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::ConstructL() - show wait note - item not ready, iType: %d", iInfoItem->Type() );
+#endif
+
+        // Wait for engine data to be made ready... 
+        ShowWaitNoteL();
+        }
+
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+CMemSpyProcess& CMemSpyViewThreadInfoItemGeneric::Process() const
+    {
+    return iContainer.Thread().Process();
+    }
+
+
+CMemSpyThread& CMemSpyViewThreadInfoItemGeneric::Thread() const
+    {
+    return iContainer.Thread();
+    }
+
+
+CMemSpyThreadInfoContainer& CMemSpyViewThreadInfoItemGeneric::Container() const
+    {
+    return iContainer;
+    }
+
+
+CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemGeneric::InfoItem() const
+    {
+    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
+    return *iInfoItem;
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::RefreshL()
+    {
+    iInfoItem->RebuildL();    
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemGeneric::ViewType() const
+    {
+    TMemSpyViewType type = EMemSpyViewTypeNone;
+    //
+    switch( iInfoItem->Type() )
+        {
+    case EMemSpyThreadInfoItemTypeHeap:
+        type = EMemSpyViewTypeThreadInfoItemHeap;
+        break;
+    case EMemSpyThreadInfoItemTypeStack:
+        type = EMemSpyViewTypeThreadInfoItemStack;
+        break;
+    case EMemSpyThreadInfoItemTypeChunk:
+        type = EMemSpyViewTypeThreadInfoItemChunk;
+        break;
+    case EMemSpyThreadInfoItemTypeCodeSeg:
+        type = EMemSpyViewTypeThreadInfoItemCodeSeg;
+        break;
+    case EMemSpyThreadInfoItemTypeServer:
+        type = EMemSpyViewTypeThreadInfoItemServer;
+        break;
+    case EMemSpyThreadInfoItemTypeSession:
+        type = EMemSpyViewTypeThreadInfoItemSession;
+        break;
+    case EMemSpyThreadInfoItemTypeSemaphore:
+        type = EMemSpyViewTypeThreadInfoItemSemaphore;
+        break;
+    case EMemSpyThreadInfoItemTypeMutex:
+        type = EMemSpyViewTypeThreadInfoItemMutex;
+        break;
+    case EMemSpyThreadInfoItemTypeTimer:
+        type = EMemSpyViewTypeThreadInfoItemTimer;
+        break;
+    case EMemSpyThreadInfoItemTypeLDD:
+        type = EMemSpyViewTypeThreadInfoItemLDD;
+        break;
+    case EMemSpyThreadInfoItemTypePDD:
+        type = EMemSpyViewTypeThreadInfoItemPDD;
+        break;
+    case EMemSpyThreadInfoItemTypeLogicalChannel:
+        type = EMemSpyViewTypeThreadInfoItemLogicalChannel;
+        break;
+    case EMemSpyThreadInfoItemTypeChangeNotifier:
+        type = EMemSpyViewTypeThreadInfoItemChangeNotifier;
+        break;
+    case EMemSpyThreadInfoItemTypeUndertaker:
+        type = EMemSpyViewTypeThreadInfoItemUndertaker;
+        break;
+    case EMemSpyThreadInfoItemTypeMessageQueue:
+        type = EMemSpyViewTypeThreadInfoItemMessageQueue;
+        break;
+    case EMemSpyThreadInfoItemTypeConditionalVariable:
+        type = EMemSpyViewTypeThreadInfoItemConditionalVariable;
+        break;
+    case EMemSpyThreadInfoItemTypeOpenFiles:
+        type = EMemSpyViewTypeThreadInfoItemOpenFiles;
+        break;
+    case EMemSpyThreadInfoItemTypeActiveObject:
+        type = EMemSpyViewTypeThreadInfoItemActiveObject;
+        break;
+    case EMemSpyThreadInfoItemTypeGeneralInfo:
+        type = EMemSpyViewTypeThreadInfoItemGeneralInfo;
+        break;
+    case EMemSpyThreadInfoItemTypeOtherThreads:
+        type = EMemSpyViewTypeThreadInfoItemOtherThreads;
+        break;
+    case EMemSpyThreadInfoItemTypeOtherProcesses:
+        type = EMemSpyViewTypeThreadInfoItemOtherProcesses;
+        break;
+    case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
+        type = EMemSpyViewTypeThreadInfoItemOwnedThreadHandles;
+        break;
+    case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
+        type = EMemSpyViewTypeThreadInfoItemOwnedProcessHandles;
+        break;
+
+    default:
+        __ASSERT_DEBUG( EFalse, User::Invariant() );
+        break;
+        }
+    //
+    return type;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemList* parent = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, Thread() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), iInfoItem );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemGeneric::PrepareChildViewL()
+    {
+    __ASSERT_ALWAYS( iInfoItem != NULL, User::Invariant() );
+    CMemSpyViewBase* child = NULL;
+    //
+    return child;
+    }
+
+
+TBool CMemSpyViewThreadInfoItemGeneric::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iInfoItem );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+void CMemSpyViewThreadInfoItemGeneric::ShowWaitNoteL()
+    {
+    // Ugly, but I'm not adding an observer mechanism just for this wait dialog.
+    __ASSERT_ALWAYS( iWaitConstructionChecker == NULL, User::Invariant() );
+    iWaitConstructionChecker = CPeriodic::NewL( CActive::EPriorityLow );
+    iWaitConstructionChecker->Start( KMemSpyConstructionCheckerTimerPeriod, 
+                                     KMemSpyConstructionCheckerTimerPeriod, 
+                                     TCallBack( CheckForItemConstructionComplete, this ) );
+
+    if  ( !iWaitNote )
+        {
+        iWaitNote = new ( ELeave ) CAknWaitDialog( reinterpret_cast<CEikDialog**> ( &iWaitNote ), ETrue );
+        iWaitNote->ExecuteDlgLD( CAknNoteDialog::ENoTone, R_MEMSPY_PREPARING_INFO_ITEM_CONTAINER_WAIT_NOTE );
+        }
+    }
+
+
+void CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote()
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote() - START" );
+#endif
+	//
+    delete iWaitConstructionChecker;
+    iWaitConstructionChecker = NULL;
+    //
+    if  ( iWaitNote )
+        {
+        TRAP_IGNORE( iWaitNote->ProcessFinishedL() ); // deletes the dialog
+        iWaitNote = NULL;
+        }
+	//
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::DestroyWaitNote() - END" );
+#endif
+    }
+
+
+TInt CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete( TAny* aSelf )
+    {
+    CMemSpyViewThreadInfoItemGeneric& self = *reinterpret_cast< CMemSpyViewThreadInfoItemGeneric* >( aSelf );
+    //
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreadInfoItemGeneric::CheckForItemConstructionComplete() - ready status: %d, iType: %d", self.iInfoItem->IsReady(), self.iInfoItem->Type() );
+#endif
+	//
+    TBool callAgain = ETrue;
+    if  ( self.iInfoItem->IsReady() )
+        {
+        self.DestroyWaitNote();
+        callAgain = EFalse;
+        }
+    //
+    return callAgain;
+    }
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemHeap.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewThreadInfoItemHeap.h"
+
+
+
+CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeHeap )
+    {
+    }
+
+
+TBool CMemSpyViewThreadInfoItemHeap::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+#ifndef __WINS__
+	case EMemSpyCmdHeapDataDump:
+        OnCmdHeapDataL();
+        break;
+#endif
+	case EMemSpyCmdHeapCellListing:
+        OnCmdHeapCellListingL();
+        break;
+    case EMemSpyCmdHeapInfoThread:
+        OnCmdHeapInfoL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemHeap::OnCmdHeapDataL()
+    {
+    iEngine.HelperHeap().OutputHeapDataUserL( Thread() );
+    }
+
+
+void CMemSpyViewThreadInfoItemHeap::OnCmdHeapCellListingL()
+    {
+    iEngine.HelperHeap().OutputCellListingUserL( Thread() );
+    }
+
+
+void CMemSpyViewThreadInfoItemHeap::OnCmdHeapInfoL()
+    {
+    iEngine.HelperHeap().OutputHeapInfoUserL( Thread() );
+    }
+
+
+void CMemSpyViewThreadInfoItemHeap::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,336 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemList.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewThreadInfoItemHeap.h"
+#include "MemSpyViewThreadInfoItemStack.h"
+#include "MemSpyViewThreadInfoItemChunk.h"
+#include "MemSpyViewThreadInfoItemCodeSeg.h"
+#include "MemSpyViewThreadInfoItemServer.h"
+#include "MemSpyViewThreadInfoItemActiveObject.h"
+#include "MemSpyViewThreadInfoItemGeneralInfo.h"
+#include "MemSpyViewThreadInfoItemMemoryTracking.h"
+
+// Constants
+const TInt KMemSpyIdleResetListboxTimerPeriod = 250000;
+
+
+CMemSpyViewThreadInfoItemList::CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread )
+:   CMemSpyViewBase( aEngine, aObserver ), iThread( aThread )
+    {
+    iThread.Process().Open();
+    iThread.Open();
+    }
+
+
+CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
+    {
+    delete iIdleResetListboxTimer;
+
+    TRAP_IGNORE( 
+        CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
+        container.ObserverRemove( *this );
+    );
+
+    if  ( iCurrentInfoItem )
+        {
+        iCurrentInfoItem->Close();
+        }
+
+    iThread.Process().Close();
+    iThread.Close();
+    }
+
+
+
+void CMemSpyViewThreadInfoItemList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Thread Objects" );
+    SetTitleL( KTitle );
+    //
+    iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );
+    //
+    CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
+    container.ObserverAddL( *this );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    //
+    if  ( aSelectionRune )
+        {
+        CMemSpyThreadInfoItemBase* selectedItem = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelectionRune );
+        const TInt index = container.InfoItemIndexByType( selectedItem->Type() );
+        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
+            {
+            iListBox->SetCurrentItemIndex( index );
+            HandleListBoxItemSelectedL( index );
+            }
+        }
+    else if ( container.MdcaCount() > 0 )
+        {
+        iListBox->SetCurrentItemIndex( 0 );
+        HandleListBoxItemSelectedL( 0 );
+        }
+    }
+
+
+const CMemSpyProcess& CMemSpyViewThreadInfoItemList::Process() const
+    {
+    return iThread.Process();
+    }
+
+
+const CMemSpyThread& CMemSpyViewThreadInfoItemList::Thread() const
+    {
+    return iThread;
+    }
+
+
+const CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemList::CurrentInfoItem() const
+    {
+    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
+    return *iCurrentInfoItem;
+    }
+
+
+void CMemSpyViewThreadInfoItemList::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemList::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemList;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareParentViewL()
+    {
+    CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iEngine, iObserver, iThread.Process() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), &iThread );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareChildViewL()
+    {
+    __ASSERT_ALWAYS( iCurrentInfoItem != NULL, User::Invariant() );
+    CMemSpyViewBase* child = NULL;
+
+    // Decide what type of child view to create...
+    const TMemSpyThreadInfoItemType type = iCurrentInfoItem->Type();
+    //
+    switch( type )
+        {
+    case EMemSpyThreadInfoItemTypeHeap:
+        child = new(ELeave) CMemSpyViewThreadInfoItemHeap( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeStack:
+        child = new(ELeave) CMemSpyViewThreadInfoItemStack( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeChunk:
+        child = new(ELeave) CMemSpyViewThreadInfoItemChunk( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeCodeSeg:
+        child = new(ELeave) CMemSpyViewThreadInfoItemCodeSeg( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeServer:
+        child = new(ELeave) CMemSpyViewThreadInfoItemServer( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeActiveObject:
+        child = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeGeneralInfo:
+        child = new(ELeave) CMemSpyViewThreadInfoItemGeneralInfo( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeMemoryTracking:
+        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, iThread.InfoContainerL() );
+        break;
+    case EMemSpyThreadInfoItemTypeSession:
+    case EMemSpyThreadInfoItemTypeSemaphore:
+    case EMemSpyThreadInfoItemTypeMutex:
+    case EMemSpyThreadInfoItemTypeTimer:
+    case EMemSpyThreadInfoItemTypeLDD:
+    case EMemSpyThreadInfoItemTypePDD:
+    case EMemSpyThreadInfoItemTypeLogicalChannel:
+    case EMemSpyThreadInfoItemTypeChangeNotifier:
+    case EMemSpyThreadInfoItemTypeUndertaker:
+    case EMemSpyThreadInfoItemTypeMessageQueue:
+    case EMemSpyThreadInfoItemTypeConditionalVariable:
+    case EMemSpyThreadInfoItemTypeOpenFiles:
+    case EMemSpyThreadInfoItemTypeOtherThreads:
+    case EMemSpyThreadInfoItemTypeOtherProcesses:
+    case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
+    case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
+        child = new(ELeave) CMemSpyViewThreadInfoItemGeneric( iEngine, iObserver, iThread.InfoContainerL(), type );
+        break;
+    
+    default:
+        __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0) );
+        break;
+        }
+    //
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+TBool CMemSpyViewThreadInfoItemList::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+	case EMemSpyCmdThreadInfoHandles:
+        OnCmdInfoHandlesL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+    
+void CMemSpyViewThreadInfoItemList::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        aMenuPane->SetItemDimmed( EMemSpyCmdThread, iThread.IsDead() );
+        }
+    else if ( aResourceId == MenuCascadeResourceId() )
+        {
+        // Always remove these items - they are only shown in the master thread view
+        aMenuPane->SetItemDimmed( EMemSpyCmdThreadSetPriority, ETrue );
+        aMenuPane->SetItemDimmed( EMemSpyCmdThreadEnd, ETrue );
+        }
+    }
+
+
+void CMemSpyViewThreadInfoItemList::OnCmdInfoHandlesL()
+    {
+    iThread.InfoContainerForceSyncronousConstructionL().PrintL();
+    }
+
+
+void CMemSpyViewThreadInfoItemList::HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType )
+    {
+    if  ( aEvent == EInfoItemChanged )
+        {
+        }
+    else if ( aEvent == EInfoItemDestroyed )
+        {
+        if  ( iCurrentInfoItem && iCurrentInfoItem->Type() == aType )
+            {
+            iCurrentInfoItem->Close();
+            iCurrentInfoItem = NULL;
+            }
+        }
+
+    iIdleResetListboxTimer->Cancel();
+    iIdleResetListboxTimer->Start( KMemSpyIdleResetListboxTimerPeriod, KMemSpyIdleResetListboxTimerPeriod, TCallBack( IdleUpdateListBoxModel, this ) );
+    }
+
+
+void CMemSpyViewThreadInfoItemList::SetListBoxModelL()
+    {
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( &iThread.InfoContainerL() );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewThreadInfoItemList::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    if  ( iCurrentInfoItem )
+        {
+        CMemSpyThreadInfoItemBase* item = iCurrentInfoItem;
+        iCurrentInfoItem = NULL;
+        item->Close();
+        }
+
+    // Identify the type of item to display...
+    iCurrentInfoItem = &iThread.InfoContainerL().Item( aIndex );
+    iCurrentInfoItem->Open();
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+TInt CMemSpyViewThreadInfoItemList::IdleUpdateListBoxModel( TAny* aSelf )
+    {
+    CMemSpyViewThreadInfoItemList* self = reinterpret_cast< CMemSpyViewThreadInfoItemList* >( aSelf );
+    TRAP_IGNORE( self->DoIdleUpdateListBoxModelL() );
+    return EFalse;
+    }
+
+
+void CMemSpyViewThreadInfoItemList::DoIdleUpdateListBoxModelL()
+    {
+    CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
+
+    // Try to maintain current item selection if at all possible.
+    TMemSpyThreadInfoItemType type = EMemSpyThreadInfoItemTypeHeap;
+    if  ( iCurrentInfoItem )
+        {
+        type = iCurrentInfoItem->Type();
+        }
+   
+    // Update list box & model
+    SetListBoxModelL();
+    iListBox->HandleItemAdditionL();
+    RefreshL();
+    
+    // Try to select previous item if it is still available
+    const TInt index = container.InfoItemIndexByType( type );
+    if  ( index >= 0 && index < container.MdcaCount() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        }
+
+    iIdleResetListboxTimer->Cancel();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemMemoryTracking.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,664 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemMemoryTracking.h"
+
+// System includes
+#include <AknQueryDialog.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyengineprocessmemorytracker.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+
+
+CMemSpyViewThreadInfoItemMemoryTracking::CMemSpyViewThreadInfoItemMemoryTracking( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverAddL( *this );
+
+    // Reset the title
+    _LIT( KCustomTitle, "Memory Statistics" );
+    SetTitleL( KCustomTitle );
+    
+    // Select the appropriate view
+    const TMemSpyViewType viewType = (TMemSpyViewType) ((TInt) aSelectionRune );
+    const TInt index = IndexByViewType( viewType );
+    //
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::ConstructL() - aSelectionRune: 0x%08x, viewType: %d, index: %d", aSelectionRune, viewType, index );
+#endif
+    //
+    if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
+        {
+        iListBox->SetCurrentItemIndex( index );
+        HandleListBoxItemSelectedL( index );
+        }
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTracking::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatistics;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTracking::PrepareParentViewL()
+    {
+    CMemSpyViewBase* parent = CMemSpyViewThreadInfoItemGeneric::PrepareParentViewL();
+    
+    // Stop observing changes
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverRemove( *this );
+
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTracking::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    //
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    const TInt index = iListBox->CurrentItemIndex();
+    if  ( index == 1 )
+        {
+        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingCurrent( iEngine, iObserver, Container() );
+        }
+    else if ( index == 2 )
+        {
+        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingHWM( iEngine, iObserver, Container() );
+        }
+    else if ( index == 3 )
+        {
+        child = new(ELeave) CMemSpyViewThreadInfoItemMemoryTrackingPeak( iEngine, iObserver, Container() );
+        }
+    //        
+    if  ( child )
+        {
+        CleanupStack::PushL( child );
+        child->ConstructL( Rect(), *Parent() );
+        CleanupStack::Pop( child );
+           
+        // Stop observing changes
+        item->TrackingObserverRemove( *this );
+        }
+    //
+    return child;
+    }
+
+
+TBool CMemSpyViewThreadInfoItemMemoryTracking::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdMemoryTrackingStart:
+        OnCmdTrackingStartL();
+        break;
+    case EMemSpyCmdMemoryTrackingStop:
+        OnCmdTrackingStopL();
+        break;
+    case EMemSpyCmdMemoryTrackingHWMReset:
+        OnCmdHWMResetL();
+        break;
+    case EMemSpyCmdMemoryTrackingTotalWithSharedMem:
+        OnCmdTotalWithSharedMemL();
+        break;
+    case EMemSpyCmdMemoryTrackingTotalWithoutSharedMem:
+        OnCmdTotalWithoutSharedMemL();
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+TInt CMemSpyViewThreadInfoItemMemoryTracking::IndexByViewType( TMemSpyViewType aType )
+    {
+    TInt index = 0;
+    //
+    switch( aType )
+        {
+    default:
+    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent:
+        index = 1;
+        break;
+    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM:
+        index = 2;
+        break;
+    case EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak:
+        index = 3;
+        break;
+        }
+    //
+    return index;
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::HandleListBoxItemActionedL( TInt aIndex )
+    {
+    if  ( aIndex == 0 )
+        {
+        CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+        if  ( item->TrackingActive() )
+            {
+            OnCmdTrackingStopL();
+            }
+        else
+            {
+            OnCmdTrackingStartL();
+            }
+        }
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+
+    // Ensure we refresh the listbox content
+    iListBox->DrawDeferred();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    iListBox->DrawDeferred();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == MenuCascadeResourceId() )
+        {
+        CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+        //
+        if  ( !item->TrackerExists() || item->TrackingActive() )
+            {
+            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingStart, ETrue );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingStop, ETrue );
+            }
+        //
+        if ( item->TotalIncludesSharedMemory() )
+            {
+            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingTotalWithSharedMem, ETrue );
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingTotalWithoutSharedMem, ETrue );
+            }
+
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingHWMReset, Thread().IsDead() );
+        }
+    else if ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTracking, Thread().IsDead() );
+        aMenuPane->SetItemDimmed( EMemSpyCmdMemoryTrackingAutoStart, Thread().IsDead() );
+        }
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryTrackingStartedL()
+    {
+    RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryTrackingStoppedL()
+    {
+    RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
+    {
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL() - START - this: 0x%08x", this );
+#endif 
+
+    CMemSpyViewBase::RefreshL();
+    iListBox->DrawDeferred();
+
+#ifdef _DEBUG
+    RDebug::Printf( "[MemSpy] CMemSpyViewThreadInfoItemMemoryTracking::HandleMemoryChangedL() - END - this: 0x%08x", this );
+#endif 
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTrackingStartL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingStartL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTrackingStopL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingStopL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdHWMResetL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingResetHWML();
+    RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTotalWithSharedMemL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingSetTotalIncludesSharedMemoryL( ETrue );
+    RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTracking::OnCmdTotalWithoutSharedMemL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingSetTotalIncludesSharedMemoryL( EFalse );
+    RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemMemoryTrackingCurrent::CMemSpyViewThreadInfoItemMemoryTrackingCurrent( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverAddL( *this );
+
+    // Reset the title
+    _LIT( KCustomTitle, "Current Statistics" );
+    SetTitleL( KCustomTitle );
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingCurrent::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsCurrent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingCurrent::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    
+    // Stop observing changes
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverRemove( *this );
+
+    return parent;
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::SetListBoxModelL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    MDesCArray* model = &item->InfoCurrent();
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+    
+
+void CMemSpyViewThreadInfoItemMemoryTrackingCurrent::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
+    {
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemMemoryTrackingHWM::CMemSpyViewThreadInfoItemMemoryTrackingHWM( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingHWM::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverAddL( *this );
+
+    // Reset the title
+    _LIT( KCustomTitle, "HWM Statistics" );
+    SetTitleL( KCustomTitle );
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingHWM::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsHWM;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingHWM::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    
+    // Stop observing changes
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverRemove( *this );
+
+    return parent;
+    }
+
+
+TBool CMemSpyViewThreadInfoItemMemoryTrackingHWM::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdMemoryTrackingHWMReset:
+        OnCmdHWMResetL();
+        break;
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingHWM::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingHWM::SetListBoxModelL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    MDesCArray* model = &item->InfoHWM();
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+    
+
+void CMemSpyViewThreadInfoItemMemoryTrackingHWM::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
+    {
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingHWM::OnCmdHWMResetL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingResetHWML();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemMemoryTrackingPeak::CMemSpyViewThreadInfoItemMemoryTrackingPeak( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeMemoryTracking )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingPeak::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverAddL( *this );
+
+    // Reset the title
+    _LIT( KCustomTitle, "Peak Statistics" );
+    SetTitleL( KCustomTitle );
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemMemoryTrackingPeak::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemMemoryTrackingStatisticsPeak;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemMemoryTrackingPeak::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemMemoryTracking* parent = new(ELeave) CMemSpyViewThreadInfoItemMemoryTracking( iEngine, iObserver, Container() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    
+    // Stop observing changes
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    item->TrackingObserverRemove( *this );
+
+    return parent;
+    }
+
+
+TBool CMemSpyViewThreadInfoItemMemoryTrackingPeak::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingPeak::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+void CMemSpyViewThreadInfoItemMemoryTrackingPeak::SetListBoxModelL()
+    {
+    CMemSpyThreadInfoMemoryTracking* item = static_cast< CMemSpyThreadInfoMemoryTracking* >( iInfoItem );
+    MDesCArray* model = &item->InfoPeak();
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+    
+
+void CMemSpyViewThreadInfoItemMemoryTrackingPeak::HandleMemoryChangedL( const TProcessId& /*aPid*/, const TMemSpyDriverProcessInspectionInfo& /*aCurrentInfo*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoIncShared*/, const TMemSpyDriverProcessInspectionInfo& /*aHWMInfoExcShared*/ )
+    {
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,391 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemServer.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperheap.h>
+#include <memspy/engine/memspyenginehelperserver.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+
+// Constants
+const TInt KMemSpyServerSessionsIndex = 2;
+
+
+
+CMemSpyViewThreadInfoItemServer::CMemSpyViewThreadInfoItemServer( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemServer::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    // Causes list of server's to be prepared
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+
+    _LIT( KTitle, "Server List" );
+    SetTitleL( KTitle );
+
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreadInfoItemServer::ConstructL() - aSelectionRune: 0x%08x", aSelectionRune );
+#endif
+
+    // Try to select the correct server
+    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
+    TInt selectedIndex = 0;
+    if  ( aSelectionRune )
+        {
+        // Treat the rune as a handle, and try to look it up
+        selectedIndex = infoItem->DetailsIndexByHandle( aSelectionRune );
+        }
+
+    // Select item
+    if  ( infoItem->DetailsCount() > 0 )
+        {
+        iListBox->SetCurrentItemIndex( selectedIndex );
+        HandleListBoxItemSelectedL( selectedIndex );
+        }
+    }
+
+
+TBool CMemSpyViewThreadInfoItemServer::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
+    return handled;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemServer::PrepareChildViewL()
+    {
+    CMemSpyViewThreadInfoItemServerDetails* child = new(ELeave) CMemSpyViewThreadInfoItemServerDetails( iEngine, iObserver, iContainer, iCurrentInfoItemDetails );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    }
+
+
+void CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL( TInt aIndex )
+    {
+    // Identify the type of item to display...
+    CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
+    iCurrentInfoItemDetails = infoItem->DetailsAt( aIndex );
+
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreadInfoItemServer::HandleListBoxItemSelectedL() - iCurrentInfoItemDetails.iHandle: 0x%08x", iCurrentInfoItemDetails.iHandle );
+#endif
+
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemServerDetails::CMemSpyViewThreadInfoItemServerDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer ), iInfoItemDetails( aInfoItemDetails )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemServerDetails::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    // Causes list of server's to be prepared
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+
+    _LIT( KTitle, "Server Details" );
+    SetTitleL( KTitle );
+
+    // Try to select the correct server
+    TInt selectedIndex = 0;
+    if  ( aSelectionRune )
+        {
+        // Presence of non-null item means that we came from the "Server sessions" list
+        selectedIndex = KMemSpyServerSessionsIndex;
+        }
+
+    // Select item
+    iListBox->SetCurrentItemIndex( selectedIndex );
+    HandleListBoxItemSelectedL( selectedIndex );
+    }
+
+
+TBool CMemSpyViewThreadInfoItemServerDetails::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
+    return handled;
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemServerDetails::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemServerDetails;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemServerDetails::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    const TInt currentIndex = iListBox->CurrentItemIndex();
+    //
+    if  ( currentIndex == KMemSpyServerSessionsIndex )
+        {
+        CMemSpyViewThreadInfoItemServerSessions* serverSessions = new(ELeave) CMemSpyViewThreadInfoItemServerSessions( iEngine, iObserver, iInfoItem->Container(), iInfoItemDetails );
+        CleanupStack::PushL( serverSessions );
+        serverSessions->ConstructL( Rect(), *Parent(), NULL );
+        CleanupStack::Pop( serverSessions );
+        child = serverSessions;
+        }
+    //
+    return child;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemServerDetails::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemServer* parent = new(ELeave) CMemSpyViewThreadInfoItemServer( iEngine, iObserver, iInfoItem->Container() );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), iInfoItemDetails.iHandle );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewThreadInfoItemServerDetails::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(4);
+    CleanupStack::PushL( model );
+
+    TBuf<KMaxFullName + 1> item;
+
+    // 1st item = session type
+    const TPtrC pServerSessionType = CMemSpyThreadInfoServer::SessionType( iInfoItemDetails.iSessionType );
+    _LIT(KItem1Format, "\tServer Type\t\t%S");
+    item.Format( KItem1Format, &pServerSessionType );
+    model->AppendL( item );
+
+    // 2nd item = session count
+    _LIT(KItem2Format, "\tConnected Sessions\t\t%d");
+    item.Format( KItem2Format, iInfoItemDetails.iCount );
+    model->AppendL( item );
+
+    // 3rd item = view sessions
+    if  ( iInfoItem->Container().MdcaCount() > 0 )
+        {
+        _LIT(KItem3Format, "\tView Sessions");
+        model->AppendL( KItem3Format );
+        }
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewThreadInfoItemServerDetails::HandleListBoxItemSelectedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CMemSpyViewThreadInfoItemServerSessions::CMemSpyViewThreadInfoItemServerSessions( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, const TMemSpyDriverHandleInfoGeneric& aInfoItemDetails )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeServer ), iInfoItemDetails( aInfoItemDetails )
+    {
+    }
+
+
+void CMemSpyViewThreadInfoItemServerSessions::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    CMemSpyViewThreadInfoItemGeneric::ConstructL( aRect, aContainer, aSelectionRune );
+    //
+    _LIT( KTitle, "Connected Session List" );
+    SetTitleL( KTitle );
+    }
+
+
+TBool CMemSpyViewThreadInfoItemServerSessions::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
+    return handled;
+    }
+
+
+TMemSpyViewType CMemSpyViewThreadInfoItemServerSessions::ViewType() const
+    {
+    return EMemSpyViewTypeThreadInfoItemServerSessions;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreadInfoItemServerSessions::PrepareParentViewL()
+    {
+    CMemSpyViewThreadInfoItemServerDetails* parent = new(ELeave) CMemSpyViewThreadInfoItemServerDetails( iEngine, iObserver, iInfoItem->Container(), iInfoItemDetails );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), this );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+void CMemSpyViewThreadInfoItemServerSessions::SetListBoxModelL()
+    {
+    CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(4);
+    CleanupStack::PushL( model );
+
+    // Get handles
+    RArray<TMemSpyDriverServerSessionInfo> sessions;
+    CleanupClosePushL( sessions );
+    iEngine.HelperServer().GetServerSessionsL( iInfoItemDetails, sessions );
+
+    // Prepare items
+    TBuf<KMaxFullName + 1> item;
+    const TInt count = sessions.Count();
+    for( TInt i=0; i<count; i++ )
+        {
+        _LIT(KInsertTab, "\t");
+
+        const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
+        item.Zero();
+
+        if  ( session.iOwnerType == TMemSpyDriverServerSessionInfo::EOwnerThread )
+            {
+            // Find the thread object
+            CMemSpyThread* thread = NULL;
+            CMemSpyProcess* process = NULL;
+            //
+            const TInt error = iEngine.Container().ProcessAndThreadByThreadId( session.iOwnerId, process, thread );
+            //
+            if  ( error == KErrNone )
+                {
+                item.Append( process->Name() );
+                item.Append( KInsertTab );
+                item.Append( KInsertTab );
+                item.Append( thread->Name() );
+                }
+            }
+        else if ( session.iOwnerType == TMemSpyDriverServerSessionInfo::EOwnerProcess )
+            {
+            // Find the process object
+            CMemSpyProcess* process = NULL;
+            TRAPD( error, process = &iEngine.Container().ProcessByIdL( session.iOwnerId ) );
+            if  ( error == KErrNone )
+                {
+                item.Append( process->Name() );
+                }
+            }
+
+        if  ( !item.Length() )
+            {
+            // Fall-back case
+            item.Copy( session.iName );
+            }
+
+        // Add item
+        item.Insert( 0, KInsertTab );
+        model->AppendL( item );
+        }
+    CleanupStack::PopAndDestroy( &sessions );
+
+    // Set up list box
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( model );
+    listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
+    CleanupStack::Pop( model );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreadInfoItemStack.h"
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspy/engine/memspyenginehelperstack.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewThreads.h"
+#include "MemSpyViewThreadInfoItemHeap.h"
+
+
+
+CMemSpyViewThreadInfoItemStack::CMemSpyViewThreadInfoItemStack( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
+:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeStack )
+    {
+    }
+
+
+TBool CMemSpyViewThreadInfoItemStack::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+#ifndef __WINS__
+	case EMemSpyCmdStackDataUser:
+        OnCmdStackDataUserL();
+		break;
+	case EMemSpyCmdStackDataKernel:
+        OnCmdStackDataKernelL();
+		break;
+#endif
+	case EMemSpyCmdStackInfoThread:
+        OnCmdStackInfoL();
+		break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreadInfoItemStack::OnCmdStackInfoL()
+    {
+    iEngine.HelperStack().OutputStackInfoL( Thread() );
+    }
+
+
+void CMemSpyViewThreadInfoItemStack::OnCmdStackDataUserL()
+    {
+    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainUser );
+    }
+
+
+void CMemSpyViewThreadInfoItemStack::OnCmdStackDataKernelL()
+    {
+    iEngine.HelperStack().OutputStackDataL( Thread(), EMemSpyDriverDomainKernel );
+    }    
+
+
+void CMemSpyViewThreadInfoItemStack::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+        aMenuPane->SetItemDimmed( EMemSpyCmdStack, Thread().IsDead() );
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,387 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewThreads.h"
+
+// System includes
+#include <AknQueryDialog.h>
+#include <memspyui.rsg>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectprocess.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
+#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
+#include <memspy/engine/memspyenginehelperprocess.h>
+#include <memspysession.h>
+
+// User includes
+#include "MemSpyContainerObserver.h"
+#include "MemSpyViewProcesses.h"
+#include "MemSpyViewThreadInfoItemList.h"
+
+
+
+/*
+CMemSpyViewThreads::CMemSpyViewThreads( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess )
+:   CMemSpyViewBase( aEngine, aObserver ), iParentProcess( aProcess )
+    {
+    iParentProcess.Open();
+    }
+*/
+CMemSpyViewThreads::CMemSpyViewThreads( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aId )
+:   CMemSpyViewBase( aSession, aObserver ), iParentProcessId( aId )
+    {    
+    }
+
+
+CMemSpyViewThreads::~CMemSpyViewThreads()
+    {
+    }
+
+ 
+void CMemSpyViewThreads::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Threads" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    //
+    if  ( aSelectionRune )
+        {
+		iListBox->SetCurrentItemIndex( 0 ); //for now
+		HandleListBoxItemSelectedL( 0 );
+		/* TODO: 
+        CMemSpyThread* selectedItem = reinterpret_cast< CMemSpyThread* >( aSelectionRune );
+        const TInt index = iParentProcess.ThreadIndexById( selectedItem->Id() );
+        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
+            {
+            iListBox->SetCurrentItemIndex( index );
+            HandleListBoxItemSelectedL( index );
+            }
+        */		
+        }
+    //else if ( iParentProcess.Count() > 0 )
+    //    {
+        iListBox->SetCurrentItemIndex( 0 );
+        HandleListBoxItemSelectedL( 0 );
+    //    }
+    }
+
+
+TProcessId CMemSpyViewThreads::Process() const
+    {
+	return iParentProcessId;
+    }
+
+
+TThreadId CMemSpyViewThreads::CurrentThread()
+    { 
+	return iCurrentThreadId;
+    }
+
+
+void CMemSpyViewThreads::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewThreads::ViewType() const
+    {
+    return EMemSpyViewTypeThreads;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreads::PrepareParentViewL()
+    {
+    CMemSpyViewProcesses* parent = new(ELeave) CMemSpyViewProcesses( iMemSpySession, iObserver, iParentProcessId );
+    CleanupStack::PushL( parent );
+    //parent->ConstructL( Rect(), *Parent(), &iParentProcessId );
+    parent->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewThreads::PrepareChildViewL()
+    {
+	/*
+    CMemSpyViewThreadInfoItemList* child = new(ELeave) CMemSpyViewThreadInfoItemList( iEngine, iObserver, *iCurrentThread );
+    CleanupStack::PushL( child );
+    child->ConstructL( Rect(), *Parent() );
+    CleanupStack::Pop( child );
+    return child;
+    */
+    }
+
+
+void CMemSpyViewThreads::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
+    {
+    if  ( aResourceId == R_MEMSPY_MENUPANE )
+        {
+		/*
+        CMemSpyThread& thread = CurrentThread();
+        aMenuPane->SetItemDimmed( EMemSpyCmdThread, thread.IsDead() );
+        */
+		aMenuPane->SetItemDimmed( EMemSpyCmdThread, (iThreads[iListBox->CurrentItemIndex()]->ExitType() !=  EExitPending ));
+        }
+    }
+
+
+TBool CMemSpyViewThreads::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+    case EMemSpyCmdThreadEndKill:
+        OnCmdEndKillL();
+		break;
+    case EMemSpyCmdThreadEndTerminate:
+        OnCmdEndTerminateL();
+		break;
+    case EMemSpyCmdThreadEndPanic:
+        OnCmdEndPanicL();
+		break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteVeryLow:
+	case EMemSpyCmdThreadSetPriorityAbsoluteLowNormal:
+	case EMemSpyCmdThreadSetPriorityAbsoluteLow:
+	case EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal:
+	case EMemSpyCmdThreadSetPriorityAbsoluteBackground:
+	case EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal:
+	case EMemSpyCmdThreadSetPriorityAbsoluteForeground:
+	case EMemSpyCmdThreadSetPriorityAbsoluteHighNormal:
+	case EMemSpyCmdThreadSetPriorityAbsoluteHigh:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime1:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime2:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime3:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime4:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime5:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime6:
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime7: 
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime8:
+        OnCmdSetPriorityL( aCommand );
+        break;
+
+    case EMemSpyCmdThreadInfoHandles:
+        OnCmdInfoHandlesL();
+        break;
+
+    default:
+        handled = CMemSpyViewBase::HandleCommandL( aCommand );
+        break;
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewThreads::OnCmdEndKillL()
+    {
+	/*
+    TBool doTerminate = ETrue;
+    CMemSpyThread& thread = CurrentThread();
+    //
+    if  ( thread.IsSystemPermanent() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        thread.KillL();
+        RefreshL();
+        }
+    */
+    }
+
+
+void CMemSpyViewThreads::OnCmdEndTerminateL()
+    {
+	/*
+    TBool doTerminate = ETrue;
+    CMemSpyThread& thread = CurrentThread();
+    //
+    if  ( thread.IsSystemPermanent() || thread.IsSystemCritical() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        thread.TerminateL();
+        RefreshL();
+        }
+    */
+    }
+
+
+void CMemSpyViewThreads::OnCmdEndPanicL()
+    {
+	/*
+    TBool doTerminate = ETrue;
+    CMemSpyThread& thread = CurrentThread();
+    //
+    if  ( thread.IsSystemPermanent() || thread.IsSystemCritical() )
+        {
+        CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+        doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+        }
+    //
+    if  ( doTerminate )
+        {
+        thread.PanicL();
+        RefreshL();
+        }
+        */
+    }
+
+
+void CMemSpyViewThreads::OnCmdSetPriorityL( TInt aCommand )
+    {
+	/*
+    TThreadPriority pri = EPriorityAbsoluteBackground;
+    switch( aCommand )
+        {
+	case EMemSpyCmdThreadSetPriorityAbsoluteVeryLow:
+        pri = EPriorityAbsoluteVeryLow;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteLowNormal:
+        pri = EPriorityAbsoluteLowNormal;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteLow:
+        pri = EPriorityAbsoluteLow;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteBackgroundNormal:
+        pri = EPriorityAbsoluteBackgroundNormal;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteBackground:
+        pri = EPriorityAbsoluteBackground;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteForegroundNormal:
+        pri = EPriorityAbsoluteForegroundNormal;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteForeground:
+        pri = EPriorityAbsoluteForeground;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteHighNormal:
+        pri = EPriorityAbsoluteHighNormal;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteHigh:
+        pri = EPriorityAbsoluteHigh;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime1:
+        pri = EPriorityAbsoluteRealTime1;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime2:
+        pri = EPriorityAbsoluteRealTime2;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime3:
+        pri = EPriorityAbsoluteRealTime3;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime4:
+        pri = EPriorityAbsoluteRealTime4;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime5:
+        pri = EPriorityAbsoluteRealTime5;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime6:
+        pri = EPriorityAbsoluteRealTime6;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime7: 
+        pri = EPriorityAbsoluteRealTime7;
+        break;
+	case EMemSpyCmdThreadSetPriorityAbsoluteRealTime8:
+        pri = EPriorityAbsoluteRealTime8;
+        break;
+        }
+
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreads::OnCmdSetPriorityL() - pri: %d", pri );
+#endif
+
+    CMemSpyThread& thread = CurrentThread();
+    thread.SetPriorityL( pri );
+    RefreshL();
+
+#ifdef _DEBUG
+    RDebug::Printf( "CMemSpyViewThreads::OnCmdSetPriorityL() - END" );
+#endif
+	*/
+    }
+
+
+void CMemSpyViewThreads::OnCmdInfoHandlesL()
+    {
+	/*
+    CMemSpyThread& thread = CurrentThread();
+    thread.InfoContainerForceSyncronousConstructionL().PrintL();
+    */
+    }
+
+
+void CMemSpyViewThreads::SetListBoxModelL()
+    {
+	iMemSpySession.GetThreadsL( iParentProcessId, iThreads );
+	
+	iModel = new (ELeave) CDesC16ArrayFlat( iThreads.Count() ); //array for formated items
+		
+	_LIT( KTab, "\t" );	
+		
+		
+		for( TInt i=0; i < iThreads.Count(); i++ )
+			{
+			HBufC* tempName = HBufC::NewL( iThreads[i]->Name().Length() + 16 );
+	    	CleanupStack::PushL( tempName );
+	    	TPtr tempNamePtr( tempName->Des() );
+	    	tempNamePtr.Copy( KTab );
+	    	tempNamePtr.Append( iThreads[i]->Name() );
+	    	iModel->AppendL( tempNamePtr );
+	    	
+	    	CleanupStack::PopAndDestroy( tempName ); 
+			}			
+	
+    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
+    //listbox->Model()->SetItemTextArray( &iParentProcess );
+    listbox->Model()->SetItemTextArray( iModel );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+void CMemSpyViewThreads::HandleListBoxItemActionedL( TInt /*aIndex*/ )
+    {
+    // Notify observer about an item being 'fired'
+    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
+    }
+
+
+void CMemSpyViewThreads::HandleListBoxItemSelectedL( TInt aIndex )
+	{	
+	iCurrentThreadId = iThreads[ aIndex ]->Id();
+	
+    // Notify observer about item selection
+    ReportEventL( MMemSpyViewObserver::EEventItemSelected );
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewType.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewType.h"
+
+
+
+
+TBool MemSpyViewTypeUtils::IsOpenableItem( TMemSpyViewType aType )
+    {
+    TBool openable = EFalse;
+    //
+    switch( aType )
+        {
+    case EMemSpyViewTypeMainMenu:
+    case EMemSpyViewTypeProcesses:
+    case EMemSpyViewTypeServerList:
+    case EMemSpyViewTypeThreads:
+    case EMemSpyViewTypeThreadInfoItemList:
+    case EMemSpyViewTypeThreadInfoItemServer:
+    case EMemSpyViewTypeThreadInfoItemSession:
+        openable = ETrue;
+        break;
+    default:
+        break;
+        }
+    //
+    return openable;
+    }
+
+
+TBool MemSpyViewTypeUtils::IsThreadInfoItem( TMemSpyViewType aType )
+    {
+    TBool infoItem = ETrue;
+    //
+    switch( aType )
+        {
+    case EMemSpyViewTypeMainMenu:
+    case EMemSpyViewTypeRAMInfo:
+    case EMemSpyViewTypeROMInfo:
+    case EMemSpyViewTypeServerList:
+    case EMemSpyViewTypeOpenFiles:
+    case EMemSpyViewTypeProcesses:
+    case EMemSpyViewTypeThreads:
+    case EMemSpyViewTypeThreadInfoItemList:
+        infoItem = EFalse;
+        break;
+    default:
+        break;
+        }
+    //
+    return infoItem;
+    }
+
+
+TBool MemSpyViewTypeUtils::IsExitableView( TMemSpyViewType aType )
+    {
+    TBool ret = EFalse;
+    //
+    switch( aType )
+        {
+    case EMemSpyViewTypeMainMenu:
+        ret = ETrue;
+        break;
+    default:
+        break;
+        }
+    //
+    return ret;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/avkon/src/MemSpyViewWindowGroups.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,314 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "MemSpyViewWindowGroups.h"
+
+// System includes
+#include <eikclbd.h>
+#include <aknmessagequerydialog.h>
+#include <aknnotewrappers.h>
+
+// Engine includes
+#include <memspy/engine/memspyengine.h>
+#include <memspy/engine/memspyengineobjectcontainer.h>
+#include <memspy/engine/memspyengineobjectthread.h>
+
+// User includes
+#include "MemSpyUiUtils.h"
+#include "MemSpyViewMainMenu.h"
+#include "MemSpyContainerObserver.h"
+
+// Literal constants
+const TInt KMaxInfoLength = 128;
+
+
+CMemSpyViewWindowGroups::CMemSpyViewWindowGroups( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
+:   CMemSpyViewBase( aEngine, aObserver )
+    {
+    }
+
+
+CMemSpyViewWindowGroups::~CMemSpyViewWindowGroups()
+    {
+    delete iWindowGroupList;
+    }
+
+
+void CMemSpyViewWindowGroups::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
+    {
+    _LIT( KTitle, "Window Groups" );
+    SetTitleL( KTitle );
+    //
+    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
+    }
+
+
+CEikListBox* CMemSpyViewWindowGroups::ConstructListBoxL()
+    {
+    delete iListBox;
+    iListBox = NULL;
+    CAknSingleNumberStyleListBox* listbox = new (ELeave) CAknSingleNumberStyleListBox();
+    iListBox = listbox;
+    listbox->ConstructL( this, EAknListBoxSelectionList | EAknListBoxLoopScrolling );
+    listbox->SetContainerWindowL( *this );
+    listbox->CreateScrollBarFrameL( ETrue );
+    SetListBoxModelL();
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
+    listbox->SetListBoxObserver( this );
+    listbox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+    listbox->SetObserver( this );
+    return listbox;
+    }
+
+void CMemSpyViewWindowGroups::RefreshL()
+    {
+    SetListBoxModelL();
+    CMemSpyViewBase::RefreshL();
+    }
+
+
+TMemSpyViewType CMemSpyViewWindowGroups::ViewType() const
+    {
+    return EMemSpyViewTypeWindowGroups;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewWindowGroups::PrepareParentViewL()
+    {
+    CMemSpyViewMainMenu* parent = new(ELeave) CMemSpyViewMainMenu( iEngine, iObserver );
+    CleanupStack::PushL( parent );
+    parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
+    CleanupStack::Pop( parent );
+    return parent;
+    }
+
+
+CMemSpyViewBase* CMemSpyViewWindowGroups::PrepareChildViewL()
+    {
+    CMemSpyViewBase* child = NULL;
+    if ( iListBox && 
+         iListBox->Model()->NumberOfItems() && 
+         iListBox->CurrentItemIndex() > KErrNotFound )
+        {
+        DetailsL();
+        }
+    return child;
+    }
+
+
+void CMemSpyViewWindowGroups::SetListBoxModelL()
+    {
+    // Take ownership of new model
+    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
+    MMemSpyEngineWindowGroupList* windowGroupList = windowServerManager.WindowGroupListL();
+    delete iWindowGroupList;
+    iWindowGroupList = windowGroupList;
+    
+    // Set up list box
+    CAknSingleNumberStyleListBox* listbox = static_cast< CAknSingleNumberStyleListBox* >( iListBox );
+    listbox->Model()->SetItemTextArray( iWindowGroupList );
+    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
+    }
+
+
+TBool CMemSpyViewWindowGroups::HandleCommandL( TInt aCommand )
+    {
+    TBool handled = ETrue;
+    //
+    switch ( aCommand )
+        {
+        case EMemSpyCmdWindowGroupTerminate:
+            {
+            TRAPD( err, OnCmdEndL( aCommand ) );
+            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+            if ( err )
+                {
+                note->ExecuteLD( _L("Cannot terminate task") );
+                }
+            else
+                {
+                note->ExecuteLD( _L("Task terminated") );
+                }
+            break;
+            }
+        case EMemSpyCmdWindowGroupSwitchTo:
+            {
+            TRAPD( err, OnCmdSwitchToL() );
+            if ( err )
+                {
+                CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+                note->ExecuteLD( _L("Cannot bring to foreground") );
+                }
+            break;
+            }
+        case EMemSpyCmdWindowGroupEnd:
+            {
+            TRAPD( err, OnCmdEndL( aCommand ) );
+            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+            if ( err )
+                {
+                note->ExecuteLD( _L("Cannot end task") );
+                }
+            else
+                {
+                note->ExecuteLD( _L("Task exited") );
+                }
+            break;
+            }
+        case EMemSpyCmdWindowGroupPanic:
+            {
+            TRAPD( err, OnCmdEndL( aCommand ) );
+            CAknConfirmationNote* note = new(ELeave) CAknConfirmationNote( ETrue );
+            if ( err )
+                {
+                note->ExecuteLD( _L("Cannot panic task") );
+                }
+            else
+                {
+                note->ExecuteLD( _L("Task panic'ed") );
+                }
+            break;
+            }
+        default:
+            {
+            handled = CMemSpyViewBase::HandleCommandL( aCommand );
+            break;        
+            }
+        }
+    //
+    return handled;
+    }
+
+
+void CMemSpyViewWindowGroups::OnCmdSwitchToL()
+    {
+    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
+    TInt id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iId;
+    windowServerManager.SwitchToL( id );
+    }
+
+
+void CMemSpyViewWindowGroups::OnCmdEndL( TInt aCommand )
+    {
+    TBool doTerminate = ETrue;
+    
+    CMemSpyEngineObjectContainer& container = iEngine.Container();
+    TThreadId id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iThreadId;
+    
+    // Try to find the thread in question...
+    CMemSpyProcess* process = NULL;
+    CMemSpyThread* thread = NULL; 
+    User::LeaveIfError( container.ProcessAndThreadByThreadId( id, process, thread ) );
+
+    if ( thread )
+        {
+        thread->Open();
+        //
+        if  ( thread->IsSystemPermanent() || thread->IsSystemCritical() )
+            {
+            CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
+            doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
+            }
+        //
+        if  ( doTerminate )
+            {
+            switch ( aCommand )
+                {
+                case EMemSpyCmdWindowGroupTerminate:
+                    {
+                    thread->TerminateL();
+                    break;
+                    }
+                case EMemSpyCmdWindowGroupEnd:
+                    {
+                    thread->KillL();
+                    break;
+                    }
+                case EMemSpyCmdWindowGroupPanic:
+                    {
+                    thread->PanicL();
+                    break;
+                    }
+                default:
+                    {
+                    // Programming error
+                    __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+                    }                
+                }
+            }                
+        }
+    RefreshL();
+    }
+
+
+void CMemSpyViewWindowGroups::DetailsL()
+    {
+    HBufC* messageBuf = HBufC::NewLC( 4096 );
+    TPtr messagePtr = messageBuf->Des();
+
+    // Fetch data from helper
+    TMemSpyEngineWindowGroupDetails selectedObject;
+    MMemSpyEngineHelperWindowServer& windowServerManager = iEngine.HelperWindowServer();
+    TInt id = iWindowGroupList->At( iListBox->CurrentItemIndex() ).iId;
+    windowServerManager.GetWindowGroupDetailsL( id, selectedObject );
+    
+    // Append info to string buffer
+    AppendFormatString( messagePtr, _L("WG ID: %d\n"), selectedObject.iId );
+    AppendFormatString( messagePtr, _L("Client ThreadId: %Lu\n"), selectedObject.iThreadId.Id() );
+    TFullName name;
+    name.Copy( selectedObject.iFullName );
+    AppendFormatString( messagePtr, _L("Thr: %S\n"), &name );
+    name.Zero();
+    AppendFormatString( messagePtr, _L("Priority: %d\n"), selectedObject.iPriority );
+    AppendFormatString( messagePtr, _L("Handle: 0x%08X\n"), selectedObject.iWindowGroupHandle );
+    name.Copy( selectedObject.iName );
+    AppendFormatString( messagePtr, _L("Name: %S\n"), &name );
+    name.Zero();
+    AppendFormatString( messagePtr, _L("UID: 0x%08X\n"), selectedObject.iUID );
+    AppendFormatString( messagePtr, _L("IsBusy: %d\n"), selectedObject.iIsBusy );
+    AppendFormatString( messagePtr, _L("IsSystem: %d\n"), selectedObject.iIsSystem );
+    AppendFormatString( messagePtr, _L("IsHidden: %d\n"), selectedObject.iIsHidden );
+    name.Copy( selectedObject.iCaption );
+    AppendFormatString( messagePtr, _L("Caption: %S\n"), &name );
+    name.Zero();
+    name.Copy( selectedObject.iDocName );
+    AppendFormatString( messagePtr, _L("Docname: %S"), &name );
+    name.Zero();
+
+    // Display the buffer on a dialog
+    CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog( CAknQueryDialog::ENoTone );
+    dialog->PrepareLC( R_MEMSPY_KERNEL_OBJECT_DETAILS_DIALOG );
+    TFileName headerText;
+    headerText.Copy( selectedObject.iFullName );
+    dialog->SetHeaderTextL( headerText );
+    dialog->SetMessageTextL( messagePtr );
+    dialog->RunLD();
+   
+    CleanupStack::PopAndDestroy( messageBuf );
+    }
+
+
+void CMemSpyViewWindowGroups::AppendFormatString( TPtr& aPtr, TRefByValue<const TDesC> aFmt, ... )
+    {
+    TBuf<KMaxInfoLength> infoString;
+    VA_LIST list;
+    VA_START ( list, aFmt );
+    infoString.FormatList( aFmt, list );
+    aPtr.Append( infoString );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/hb.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,71 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+#
+
+TEMPLATE = app
+TARGET = MemSpyUI
+DEPENDPATH += . 
+INCLUDEPATH += /epoc32/include/platform/memspy/api
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE 
+
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
+
+HEADERS += inc/enginewrapper.h \
+	inc/viewmanager.h \
+	inc/memspyview.h \
+	inc/memspymainview.h \
+	inc/memspyprocessview.h \
+	inc/memspythreadview.h \
+	inc/memspythreaddetailview.h \
+	inc/memspykernelobjecttypeview.h \
+	inc/memspykernelobjectview.h \
+	inc/memspykernelobjectdetailview.h  
+
+SOURCES += src/main.cpp \
+	src/enginewrapper.cpp \
+	src/viewmanager.cpp \
+	src/memspyview.cpp \
+	src/memspymainview.cpp \
+	src/memspyprocessview.cpp \
+	src/memspythreadview.cpp \
+	src/memspythreaddetailview.cpp \
+	src/memspykernelobjecttypeview.cpp \
+	src/memspykernelobjectview.cpp \
+	src/memspykernelobjectdetailview.cpp 
+
+RESOURCES +=
+
+symbian: {
+    LIBS += -lestor \
+        -lbafl \
+        -lMemSpyClient
+
+    TARGET.CAPABILITY = ReadUserData WriteUserData ReadDeviceData WriteDeviceData SwEvent PowerMgmt
+
+    TARGET.UID2 = 0x100039CE
+    TARGET.UID3 = 0x2002129F
+    TARGET.SID = 0x2002129F
+    TARGET.VID = 0x101FB657 // Nokia
+
+    TARGET.EPOCHEAPSIZE = 0x10000 0x2000000  // Min 64Kb, Max 32Mb
+
+    ICON = ../../icons/qgn_menu_memspyui.svg
+
+    RSS_RULES += "group_name = \"RnD Tools\"";
+} else {
+    error("Only Symbian supported")
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/enginewrapper.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,260 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#ifndef ENGINEWRAPPER_H_
+#define ENGINEWRAPPER_H_
+
+#include <QObject>
+
+#include <memspysession.h>
+#include <memspyapiprocess.h>
+
+typedef quint64 ProcessId;
+typedef quint64 ThreadId;
+
+class MemSpyProcess
+{
+public:
+	MemSpyProcess(CMemSpyApiProcess* process)
+		: mProcess(process)
+	{}
+	
+	virtual  ~MemSpyProcess() { delete mProcess;	}
+	
+	ProcessId id() const { return mProcess->Id(); }
+	
+	QString name() const { return QString((QChar*) mProcess->Name().Ptr(), mProcess->Name().Length()); }
+	
+	
+private:
+	CMemSpyApiProcess *mProcess;
+};
+
+enum ThreadPriority
+{
+	ThreadPriorityNull=(-30),
+	ThreadPriorityMuchLess=(-20),
+	ThreadPriorityLess=(-10),
+	ThreadPriorityNormal=0,
+	ThreadPriorityMore=10,
+	ThreadPriorityMuchMore=20,
+	ThreadPriorityRealTime=30,
+	ThreadPriorityAbsoluteVeryLow=100,
+	ThreadPriorityAbsoluteLowNormal=150,
+	ThreadPriorityAbsoluteLow=200,
+	ThreadPriorityAbsoluteBackgroundNormal=250,
+	ThreadPriorityAbsoluteBackground=300,
+	ThreadPriorityAbsoluteForegroundNormal=350,
+	ThreadPriorityAbsoluteForeground=400,
+	ThreadPriorityAbsoluteHighNormal=450,
+	ThreadPriorityAbsoluteHigh=500,
+	ThreadPriorityAbsoluteRealTime1=810,
+	ThreadPriorityAbsoluteRealTime2=820,
+	ThreadPriorityAbsoluteRealTime3=830,
+	ThreadPriorityAbsoluteRealTime4=840,
+	ThreadPriorityAbsoluteRealTime5=850,
+	ThreadPriorityAbsoluteRealTime6=860,
+	ThreadPriorityAbsoluteRealTime7=870, 
+	ThreadPriorityAbsoluteRealTime8=880
+};
+
+enum KernelObjectType
+{
+	KernelObjectTypeUnknown = -1,
+	KernelObjectTypeThread = 0,
+	KernelObjectTypeProcess,
+	KernelObjectTypeChunk,
+	KernelObjectTypeLibrary,
+	KernelObjectTypeSemaphore,
+	KernelObjectTypeMutex,
+	KernelObjectTypeTimer,
+	KernelObjectTypeServer,
+	KernelObjectTypeSession,
+	KernelObjectTypeLogicalDevice,
+	KernelObjectTypePhysicalDevice,
+	KernelObjectTypeLogicalChannel,
+	KernelObjectTypeChangeNotifier,
+	KernelObjectTypeUndertaker,
+	KernelObjectTypeMsgQueue,
+	KernelObjectTypePropertyRef,
+	KernelObjectTypeCondVar
+};
+
+class MemSpyThread
+{
+public:
+	MemSpyThread(CMemSpyApiThread* thread)
+		: mThread(thread)
+	{}
+	
+	virtual ~MemSpyThread() { delete mThread;	}
+	
+	ThreadId id() const { return mThread->Id(); }
+	
+	QString name() const { return QString((QChar*) mThread->Name().Ptr(), mThread->Name().Length()); }
+	
+	int priority() const { return mThread->ThreadPriority(); }
+	
+	
+private:
+	CMemSpyApiThread *mThread;
+};
+
+class MemSpyKernelObjectType
+{
+public:
+	MemSpyKernelObjectType(CMemSpyApiKernelObject* type)
+		: mType(type)
+	{}
+	
+	virtual ~MemSpyKernelObjectType() { delete mType; }
+	
+	int id() const { return mType->Type(); }
+	
+	QString name() const { return QString((QChar*) mType->Name().Ptr(), mType->Name().Length()); }
+	
+private:
+	CMemSpyApiKernelObject *mType;
+};
+
+class MemSpyKernelObject
+{
+public:
+	MemSpyKernelObject(CMemSpyApiKernelObjectItem* object)
+		: mObject(object)
+	{}
+	
+	virtual ~MemSpyKernelObject() { delete mObject; }
+	
+	int type() const { return mObject->Type(); }
+	
+	QString name() const { return QString::fromLatin1((char*)mObject->Name().Ptr(), mObject->Name().Length()); }
+	
+	QString nameDetail() const { return QString::fromLatin1((char*)mObject->NameDetail().Ptr(), mObject->NameDetail().Length()); }
+	
+	int accessCount() const { return mObject->AccessCount(); }
+	
+	int uniqueId() const { return mObject->UniqueID(); }
+	
+	unsigned int protection() const { return mObject->Protection(); }
+	
+	unsigned int addressOfKernelOwner() const { return reinterpret_cast<unsigned int>(mObject->AddressOfKernelOwner()); }
+	
+	unsigned int kernelAddress() const { return reinterpret_cast<unsigned int>(mObject->Handle()); }
+	
+	unsigned int addressOfOwningProcess() const { return reinterpret_cast<unsigned int>(mObject->AddressOfOwningProcess()); }
+	
+	int id() const { return mObject->Id(); }
+	
+	int priority() const { return mObject->Priority(); }
+	
+	QString nameOfOwner() const { return QString::fromLatin1((char*)mObject->NameOfOwner().Ptr(), mObject->NameOfOwner().Length()); }
+	
+	unsigned int creatorId() const { return mObject->CreatorId(); }
+	
+	int attributes() const { return mObject->Attributes(); }
+	
+	unsigned int addressOfDataBssStackChunk() const { return reinterpret_cast<unsigned int>(mObject->AddressOfDataBssStackChunk()); }
+	
+	unsigned int securityZone() const { return mObject->SecurityZone(); }
+	
+	unsigned int size() const { return mObject->Size(); }
+	
+	unsigned int maxSize() const { return mObject->MaxSize(); }
+	
+	unsigned int bottom() const { return mObject->Bottom(); }
+	
+	unsigned int top() const { return mObject->Top(); }
+	
+	unsigned int startPos() const { return mObject->StartPos(); }
+	
+	unsigned int controllingOwner() const { return mObject->ControllingOwner(); }
+	
+	unsigned int restrictions() const { return mObject->Restrictions(); }
+	
+	unsigned int mapAttr() const { return mObject->Restrictions(); }
+	
+	unsigned int chunkType() const { return mObject->ChunkType(); }
+	
+	int mapCount() const { return mObject->MapCount(); }
+	
+	unsigned int state() const { return mObject->State(); }
+	
+	unsigned int addressOfCodeSeg() const { return reinterpret_cast<unsigned int>(mObject->AddressOfCodeSeg()); }
+	
+	unsigned int resetting() const { return mObject->Resetting(); }
+	
+	unsigned int order() const { return mObject->Order(); }
+	
+	QString version() const { return QString((QChar*) mObject->Version().Name().Ptr(), mObject->Version().Name().Length()); }
+	
+	unsigned int parseMask() const { return mObject->ParseMask(); }
+	
+	unsigned int unitsMask() const { return mObject->UnitsMask(); }
+	
+	unsigned int changes() const { return mObject->Changes(); }
+	
+	int count() const { return mObject->Count(); }
+	
+	int waitCount() const { return mObject->WaitCount(); }
+
+	int sessionType() const { return mObject->SessionType(); }
+
+	int timerType() const { return mObject->TimerType(); }
+	
+	int timerState() const { return mObject->TimerState(); }
+	
+	unsigned int addressOfOwningThread() const { return reinterpret_cast<unsigned int>(mObject->AddressOfOwningThread()); }
+	
+	unsigned int addressOfServer() const { return reinterpret_cast<unsigned int>(mObject->AddressOfServer()); }
+	
+	unsigned int svrSessionType() const { return mObject->SvrSessionType(); }
+	
+	int msgCount() const { return mObject->MsgCount(); }
+	
+	int msgLimit() const { return mObject->MsgLimit(); }
+	
+	unsigned int totalAccessCount() const { return mObject->TotalAccessCount(); }
+	
+	int openChannels() const { return mObject->OpenChannels(); }
+	
+private:
+	CMemSpyApiKernelObjectItem *mObject;
+};
+
+class EngineWrapper : public QObject
+{
+public:
+	virtual ~EngineWrapper();
+	bool initialize();
+	
+	QList<MemSpyProcess*> getProcesses();
+	
+	QList<MemSpyThread*> getThreads(ProcessId processId);
+	
+	void setThreadPriority(ThreadId threadId, ThreadPriority priority);
+	
+	QList<MemSpyKernelObjectType*> getKernelObjectTypes();
+	
+	QList<MemSpyKernelObject*> getKernelObjects(int type);
+	
+private:
+	RMemSpySession mSession;
+	
+};
+
+#endif /* ENGINEWRAPPER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspykernelobjectdetailview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,35 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYKERNELOBJECTDETAILVIEW_H_
+#define MEMSPYKERNELOBJECTDETAILVIEW_H_
+
+#include "memspyview.h"
+
+class MemSpyKernelObjectDetailView : public MemSpyView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyKernelObjectDetailView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+	
+protected:
+	virtual void initialize(const QVariantMap& params);
+};
+
+#endif /* MEMSPYKERNELOBJECTDETAILVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspykernelobjecttypeview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,54 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYKERNELOBJECTTYPESVIEW_H_
+#define MEMSPYKERNELOBJECTTYPESVIEW_H_
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+class MemSpyKernelObjectTypeModel : public QAbstractListModel
+{
+public:
+	MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent = 0);
+	
+	~MemSpyKernelObjectTypeModel();
+	
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	
+private:
+	QList<MemSpyKernelObjectType*> mObjectTypes;
+};
+
+class MemSpyKernelObjectTypeView : public MemSpyView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyKernelObjectTypeView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+
+protected:
+	virtual void initialize(const QVariantMap& params);
+
+private slots:
+	void itemClicked(const QModelIndex& index);
+};
+
+#endif /* MEMSPYKERNELOBJECTTYPESVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspykernelobjectview.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYKERNELOBJECTVIEW_H_
+#define MEMSPYKERNELOBJECTVIEW_H_
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+class MemSpyKernelObjectModel : public QAbstractListModel
+{
+public:
+	MemSpyKernelObjectModel(EngineWrapper &engine, int objectType, QObject *parent = 0);
+	
+	~MemSpyKernelObjectModel();
+	
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	
+private:
+	QList<MemSpyKernelObject*> mObjects;
+};
+
+
+class MemSpyKernelObjectView : public MemSpyView
+{
+	Q_OBJECT
+
+public:
+	MemSpyKernelObjectView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+
+protected:
+	virtual void initialize(const QVariantMap& params);
+
+private slots:
+	void itemClicked(const QModelIndex& index);
+	
+private:
+	QStringList getDetails(MemSpyKernelObject *object);
+};
+
+#endif /* MEMSPYKERNELOBJECTVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspymainview.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYMAINVIEW_H_
+#define MEMSPYMAINVIEW_H_
+
+#include "memspyview.h"
+
+class MemSpyMainView : public MemSpyView
+{
+    Q_OBJECT
+    
+public:
+	MemSpyMainView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+protected:
+	virtual void initialize(const QVariantMap& params);
+	
+public slots:
+	void itemClicked(const QModelIndex& index);
+};
+
+#endif /* MEMSPYMAINVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspyprocessview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#ifndef MEMSPYPROCESSVIEW_H_
+#define MEMSPYPROCESSVIEW_H_
+
+#include <QAbstractListModel>
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+
+class MemSpyProcessModel : public QAbstractListModel
+{
+public:
+	MemSpyProcessModel(EngineWrapper &engine, QObject *parent = 0);
+	
+	~MemSpyProcessModel();
+	
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	
+private:
+	QList<MemSpyProcess*> mProcesses;
+};
+
+class MemSpyProcessView : public MemSpyView
+{
+    Q_OBJECT
+    
+public:
+	MemSpyProcessView(EngineWrapper &engine, ViewManager &viewManager) 
+			: MemSpyView(engine, viewManager) {}
+	
+protected:
+	void initialize(const QVariantMap& params);
+	
+protected:
+	virtual bool isRefreshable() const { return true; }
+	
+private slots:
+	void itemClicked(const QModelIndex& index);
+};
+
+#endif /* MEMSPYPROCESSVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspythreaddetailview.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYTHREADDETAILVIEW_H_
+#define MEMSPYTHREADDETAILVIEW_H_
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+class HbMenu;
+
+class MemSpyThreadDetailView : public MemSpyView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyThreadDetailView(EngineWrapper &engine, ViewManager &viewManager) 
+		: MemSpyView(engine, viewManager) {}
+protected:
+	virtual void initialize(const QVariantMap& params);
+	virtual HbMenu* createToolMenu();
+
+private slots:
+	void changePriority();
+	
+private:
+	ThreadId mThreadId;
+	HbMenu *mPriorityMenu;
+};
+
+#endif /* MEMSPYTHREADDETAILVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspythreadview.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,67 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef MEMSPYTHREADVIEW_H_
+#define MEMSPYTHREADVIEW_H_
+
+#include "memspyview.h"
+#include "enginewrapper.h"
+
+class MemSpyThreadModel : public QAbstractListModel
+{
+public:
+	MemSpyThreadModel(EngineWrapper &engine, ProcessId threadId, QObject *parent = 0);
+	
+	~MemSpyThreadModel();
+	
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	
+private:
+	QList<MemSpyThread*> mThreads;
+	
+	QMap<int, QString> mPriorityMap;
+};
+
+
+class MemSpyThreadView : public MemSpyView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyThreadView(EngineWrapper &engine, ViewManager &viewManager);
+	~MemSpyThreadView();
+
+protected:
+	void initialize(const QVariantMap& params);
+	
+protected:
+	virtual bool isRefreshable() const { return true; }
+	
+private slots:
+	void itemClicked(const QModelIndex& index);
+	void catchLongPress(HbAbstractViewItem *item, const QPointF &coords);
+	void changePriority();
+	
+private:
+	HbMenu* mContextMenu;
+	HbMenu* mPriorityMenu;
+	ThreadId mThreadId;
+};
+
+#endif /* MEMSPYTHREADVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/memspyview.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#ifndef MEMSPYVIEW_H_
+#define MEMSPYVIEW_H_
+
+#include <HbView>
+#include <HbListView>
+#include <QVariantMap>
+
+class EngineWrapper;
+class ViewManager;
+
+class MemSpyView : public HbView
+{
+	Q_OBJECT
+	
+public:
+	MemSpyView(EngineWrapper &engine, ViewManager &viewManager);
+	
+	virtual ~MemSpyView();
+	
+protected:
+	
+	virtual QList<QAction*> createOutputActions();
+	
+	virtual HbMenu* createToolMenu();
+	
+	virtual HbToolBar* createToolBar();
+	
+	virtual bool isRefreshable() const;
+	
+public slots:
+
+	virtual void initialize(const QVariantMap& params);
+
+	virtual void refresh();
+	
+	void showAbout();
+	
+protected:
+	
+	HbListView mListView;
+	
+	EngineWrapper &mEngine;
+	
+	ViewManager &mViewManager;
+	
+private:
+	HbMenu* mOutputMenu;
+	HbMenu* mOutputGenInfoMenu;
+	HbMenu* mOutputHeapInfoMenu;
+	HbMenu* mOutputStackInfoMenu;
+	HbToolBar* mToolBar;
+	
+};
+
+#endif /* MEMSPYVIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/inc/viewmanager.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#ifndef VIEWMANAGER_H_
+#define VIEWMANAGER_H_
+
+
+#include <QObject>
+#include <QVariantMap>
+
+enum ViewIndex {
+	MainView,
+	ProcessView,
+	ThreadView,
+	ThreadDetailView,
+	KernelObjectTypeView,
+	KernelObjectView,
+	KernelObjectDetailView
+};
+
+class HbMainWindow;
+class HbView;
+class EngineWrapper;
+
+
+class ViewManager : public QObject
+{
+	Q_OBJECT
+	
+public:
+	ViewManager(HbMainWindow &window, EngineWrapper &engine, QObject *parent = 0);
+	
+public slots:
+	void showView(ViewIndex index, const QVariantMap &params);
+	
+	void showView(ViewIndex index);
+	
+	void goBack();
+	
+private slots:
+	void viewChanged(HbView *view);
+	
+private:
+	HbMainWindow &mWindow;
+	EngineWrapper &mEngine;
+};
+
+#endif /* VIEWMANAGER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#include "enginewrapper.h"
+#include <QMessageBox>
+
+EngineWrapper::~EngineWrapper()
+{
+	mSession.Close();
+}
+
+bool EngineWrapper::initialize()
+{
+	return mSession.Connect() == KErrNone;
+}
+
+QList<MemSpyProcess*> EngineWrapper::getProcesses()
+{
+	QList<MemSpyProcess*> result;
+	
+	RArray<CMemSpyApiProcess*> proc;
+	TRAPD(error, mSession.GetProcessesL(proc));
+	if (error == KErrNone)
+		for(TInt i=0; i<proc.Count(); i++)
+			result.append(new MemSpyProcess(proc[i]));
+	
+	return result;
+}
+
+QList<MemSpyThread*> EngineWrapper::getThreads(ProcessId processId)
+{
+	QList<MemSpyThread*> result;
+	
+	RArray<CMemSpyApiThread*> proc;
+	TRAPD(error, mSession.GetThreadsL(processId, proc));
+	if (error == KErrNone)
+		for(TInt i=0; i<proc.Count(); i++)
+			result.append(new MemSpyThread(proc[i]));
+	
+	return result;
+}
+
+void EngineWrapper::setThreadPriority(ThreadId threadId, ThreadPriority priority)
+{
+	TRAPD(error, mSession.SetThreadPriorityL(threadId, priority));
+}
+
+QList<MemSpyKernelObjectType*> EngineWrapper::getKernelObjectTypes()
+{
+	QList<MemSpyKernelObjectType*> result;
+		
+	RArray<CMemSpyApiKernelObject*> types;
+	TInt error = mSession.GetKernelObjects(types);
+	if (error == KErrNone)
+		for(TInt i=0; i<types.Count(); i++)
+			result.append(new MemSpyKernelObjectType(types[i]));
+	
+	return result;
+}
+
+QList<MemSpyKernelObject*> EngineWrapper::getKernelObjects(int type)
+{
+	QList<MemSpyKernelObject*> result;
+		
+	RArray<CMemSpyApiKernelObjectItem*> objects;
+	TInt error = mSession.GetKernelObjectItems(objects, 
+			static_cast<TMemSpyDriverContainerType>(type));
+	if (error == KErrNone)
+		for(TInt i=0; i<objects.Count(); i++)
+			result.append(new MemSpyKernelObject(objects[i]));
+	
+	return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*  
+*/
+
+#include <HbApplication>
+#include <QMessageBox>
+#include <HbMainWindow>
+
+#include "enginewrapper.h"
+#include "memspyview.h"
+#include "memspyprocessview.h"
+#include "viewmanager.h"
+
+int main(int argc, char *argv[])
+{
+    HbApplication app(argc, argv);
+	
+    EngineWrapper engine;
+    if (!engine.initialize()) {
+		QMessageBox::critical(0, "Error", "Engine failed to initialize. Closing.");
+		return 1;
+    }
+        
+    HbMainWindow window;
+    ViewManager viewManager(window, engine);
+    viewManager.showView(MainView);
+	
+    window.show();
+	return app.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspykernelobjectdetailview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <QStringListModel>
+
+#include "memspykernelobjectdetailview.h"
+
+void MemSpyKernelObjectDetailView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle("Details");
+	QStringList items = params.value("details").toStringList();
+	mListView.setModel(new QStringListModel(items, this));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspykernelobjecttypeview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,78 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <QStringListModel>
+
+#include "memspykernelobjecttypeview.h"
+#include "viewmanager.h"
+
+MemSpyKernelObjectTypeModel::MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent) :
+	QAbstractListModel(parent),
+	mObjectTypes(engine.getKernelObjectTypes())
+{
+}
+
+MemSpyKernelObjectTypeModel::~MemSpyKernelObjectTypeModel()
+{
+	qDeleteAll(mObjectTypes);
+}
+	
+int MemSpyKernelObjectTypeModel::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return mObjectTypes.count();
+}
+	
+QVariant MemSpyKernelObjectTypeModel::data(const QModelIndex &index, int role) const
+{
+	if (role == Qt::DisplayRole) {
+		QStringList lines;
+		lines << mObjectTypes.at(index.row())->name();
+		
+		return lines;
+	}
+	
+	if (role == Qt::UserRole)
+		return mObjectTypes.at(index.row())->id();
+	
+	return QVariant();
+}
+
+void MemSpyKernelObjectTypeView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle(tr("Kernel Objects"));
+	
+	QStringList list = QStringList() << "Thread" << "Process" << "Chunk" << "Library" <<
+			"Semaphore" << "Mutex" << "Timer" << "Server" << "Session" << "Logical Device" <<
+			"Physical Device" << "Logical Channel" << "Change Notifier" << "Undertaker" <<
+			"Message Queue" << "Property Ref." << "Conditional Var.";
+			
+	//mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this));
+	mListView.setModel(new QStringListModel(list, this));
+	
+	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+}
+
+void MemSpyKernelObjectTypeView::itemClicked(const QModelIndex& index)
+{
+	QVariantMap map;
+	map.insert("type", index.row());
+    mViewManager.showView(KernelObjectView, map);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspykernelobjectview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,297 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <QStringListModel>
+
+#include "memspykernelobjectview.h"
+#include "viewmanager.h"
+
+MemSpyKernelObjectModel::MemSpyKernelObjectModel(EngineWrapper &engine, int objectType, QObject *parent) :
+	QAbstractListModel(parent),
+	mObjects(engine.getKernelObjects(objectType))
+{
+}
+
+MemSpyKernelObjectModel::~MemSpyKernelObjectModel()
+{
+	qDeleteAll(mObjects);
+}
+	
+int MemSpyKernelObjectModel::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return mObjects.count();
+}
+	
+QVariant MemSpyKernelObjectModel::data(const QModelIndex &index, int role) const
+{
+	if (role == Qt::DisplayRole) {
+		QStringList lines;
+		lines << mObjects.at(index.row())->name();
+		
+		return lines;
+	}
+	
+	if (role == Qt::UserRole) {
+		return qVariantFromValue<void*>(mObjects.at(index.row()));
+	}
+	
+	return QVariant();
+}
+
+void MemSpyKernelObjectView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	QStringList list = QStringList() << "Threads" << "Processes" << "Chunks" << "Libraries" <<
+			"Semaphores" << "Mutexes" << "Timers" << "Servers" << "Sessions" << "Logical Devices" <<
+			"Physical Devices" << "Logical Channels" << "Change Notifiers" << "Undertakers" <<
+			"Message Queues" << "Property Refs." << "Conditional Vars.";
+	
+	int type = params.value("type").toInt();
+	
+	setTitle(list.at(type));
+	
+	//mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this));
+	mListView.setModel(new MemSpyKernelObjectModel(mEngine, type, this));
+	
+	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+}
+
+void MemSpyKernelObjectView::itemClicked(const QModelIndex& index)
+{
+	QVariantMap map;
+	map.insert("details", getDetails(static_cast<MemSpyKernelObject*>(qVariantValue<void*>(index.data(Qt::UserRole)))));
+    mViewManager.showView(KernelObjectDetailView, map);
+}
+
+QStringList MemSpyKernelObjectView::getDetails(MemSpyKernelObject *object)
+{
+	QStringList result;
+	
+	result << QString("%1: %2").arg(tr("Name")).arg(object->nameDetail());
+	result << QString("%1: %2").arg(tr("Full Name")).arg(object->name());
+	result << QString("%1: %2").arg(tr("AccessCount")).arg(object->accessCount());
+	result << QString("%1: %2").arg(tr("UniqueID")).arg(object->uniqueId());
+	result << QString("%1: %2").arg(tr("Protection")).arg(object->protection());
+	result << QString("%1: %2").arg(tr("OwnrAddr")).arg(object->addressOfKernelOwner());
+	result << QString("%1: %2").arg(tr("KernelAddr")).arg(object->kernelAddress());
+		    
+	    // Object type specific attributes:
+	    switch (object->type())
+	        {
+	        case KernelObjectTypeUnknown:
+	            {
+	            break;
+	            }
+	        case KernelObjectTypeThread:
+	            {
+	            result << QString("%1: %2").arg(tr("OwnrPrAddr")).arg(object->addressOfOwningProcess());
+	            result << QString("%1: %2").arg(tr("ThreadID")).arg(object->id());
+	            result << QString("%1: %2").arg(tr("Priority")).arg(object->priority());
+	            result << QString("%1: %2").arg(tr("Proc")).arg(object->nameOfOwner());
+	            break;
+	            }
+	        case KernelObjectTypeProcess:
+	            {
+	            result << QString("%1: %2").arg(tr("OwnrPrAddr")).arg(object->addressOfOwningProcess());
+	            result << QString("%1: %2").arg(tr("CreatorId")).arg(object->creatorId());
+	            result << QString("%1: %2").arg(tr("Attributes")).arg(object->attributes());
+	            result << QString("%1: %2").arg(tr("StckChnk")).arg(object->addressOfDataBssStackChunk());
+	            result << QString("%1: %2").arg(tr("ProcessID")).arg(object->id());
+	            result << QString("%1: %2").arg(tr("Priority")).arg(object->priority());
+	            result << QString("%1: %2").arg(tr("SecurityZone")).arg(object->securityZone());
+	            
+	            /* TODO: to solve process details
+	            CMemSpyEngineObjectContainer& container = iEngine.Container();
+	            TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex().iId );
+	            TRAP_IGNORE(
+	                CMemSpyProcess& process = container.ProcessByIdL( id );
+	                AppendFormatString( messagePtr, _L("\nSID: 0x%08X\n"), process.SID() );
+	                AppendFormatString( messagePtr, _L("VID: 0x%08X\n"), process.VID() );
+	                AppendFormatString( messagePtr, _L("UID1: 0x%08X\n"), process.UIDs()[0].iUid  );
+	                AppendFormatString( messagePtr, _L("UID2: 0x%08X\n"), process.UIDs()[1].iUid  );
+	                AppendFormatString( messagePtr, _L("UID3: 0x%08X\n"), process.UIDs()[2].iUid );
+	                AppendFormatString( messagePtr, _L("Caps: 0x%08X%08X"), process.Capabilities().iCaps[0], process.Capabilities().iCaps[1]);
+	                );
+	            */
+	            break;
+	            }
+	        case KernelObjectTypeChunk:
+	            {
+	            result << QString("%1: %2").arg(tr("OwnrPrAddr")).arg(object->addressOfOwningProcess());
+	            result << QString("%1: %2").arg(tr("Size")).arg(object->size());
+	            result << QString("%1: %2").arg(tr("MaxSize")).arg(object->maxSize());
+	            result << QString("%1: %2").arg(tr("Bottom")).arg(object->bottom());
+	            result << QString("%1: %2").arg(tr("Top")).arg(object->top());
+	            result << QString("%1: %2").arg(tr("Attr")).arg(object->attributes());
+	            result << QString("%1: %2").arg(tr("Start")).arg(object->startPos());
+	            result << QString("%1: %2").arg(tr("CntrlID")).arg(object->controllingOwner());
+	            result << QString("%1: %2").arg(tr("Restrictions")).arg(object->restrictions());
+	            result << QString("%1: %2").arg(tr("MapAttr")).arg(object->mapAttr());
+	            result << QString("%1: %2").arg(tr("Type")).arg(object->chunkType());
+	            result << QString("%1: %2").arg(tr("Proc")).arg(object->nameOfOwner());
+	            break;
+	            }
+	        case KernelObjectTypeLibrary:
+	            {
+	            result << QString("%1: %2").arg(tr("MapCount")).arg(object->mapCount());
+	            result << QString("%1: %2").arg(tr("State")).arg(object->state());
+	            result << QString("%1: %2").arg(tr("CodeSeg")).arg(object->addressOfCodeSeg());
+	            break;
+	            }
+	        case KernelObjectTypeSemaphore:
+	            {
+	            result << QString("%1: %2").arg(tr("Count")).arg(object->count());
+	            result << QString("%1: %2").arg(tr("Resetting")).arg(object->resetting());
+	            break;
+	            }
+	        case KernelObjectTypeMutex:
+	            {
+	            result << QString("%1: %2").arg(tr("HoldCount")).arg(object->count());
+	            result << QString("%1: %2").arg(tr("WaitCount")).arg(object->waitCount());
+	            result << QString("%1: %2").arg(tr("Resetting")).arg(object->resetting());
+	            result << QString("%1: %2").arg(tr("Order")).arg(object->order());
+	            break;
+	            }
+	        case KernelObjectTypeTimer:
+	            {
+	            result << QString("%1: %2").arg(tr("State")).arg(object->timerState());
+	            result << QString("%1: %2").arg(tr("Type")).arg(object->timerType());
+	            break;
+	            }
+	        case KernelObjectTypeServer:
+	            {
+	            result << QString("%1: %2").arg(tr("ThrdAddr")).arg(object->addressOfOwningThread());
+	            result << QString("%1: %2").arg(tr("Thr")).arg(object->nameOfOwner());
+	            result << QString("%1: %2").arg(tr("Type")).arg(object->sessionType());
+//	            RArray<TMemSpyDriverServerSessionInfo> sessions;
+//	            CleanupClosePushL( sessions );
+	            /* TODO: to solve server sessions
+	            iEngine.HelperServer().GetServerSessionsL( iKernelObjectItems[iListBox->CurrentItemIndex(), sessions );
+	            const TInt count = sessions.Count();
+	            for ( TInt i = 0; i < count; i++ )
+	                {
+	                const TMemSpyDriverServerSessionInfo& session = sessions[ i ];
+	                AppendFormatString( messagePtr, _L("SessAddr: 0x%08X\n"), session.iAddress );
+	                TFullName sessName;
+	                sessName.Copy( session.iName );
+	                AppendFormatString( messagePtr, _L("Sess: %S\n"), &sessName );
+	                }
+	            CleanupStack::PopAndDestroy( &sessions );
+	            */
+	            break;
+	            }
+	        case KernelObjectTypeSession:
+	            {
+	            result << QString("%1: %2").arg(tr("Server")).arg(object->addressOfServer());
+				result << QString("%1: %2").arg(tr("Srv")).arg(object->name());
+				result << QString("%1: %2").arg(tr("AccCount")).arg(object->totalAccessCount());
+				result << QString("%1: %2").arg(tr("SesType")).arg(object->sessionType());
+				result << QString("%1: %2").arg(tr("SvrType")).arg(object->svrSessionType());
+				result << QString("%1: %2").arg(tr("MsgCount")).arg(object->msgCount());
+				result << QString("%1: %2").arg(tr("MsgLimit")).arg(object->msgLimit());
+
+	            break;
+	            }
+	        case KernelObjectTypeLogicalDevice:
+	            {
+	            result << QString("%1: %2").arg(tr("Version")).arg(object->version());
+				result << QString("%1: %2").arg(tr("ParseMask")).arg(object->parseMask());
+				result << QString("%1: %2").arg(tr("UnitsMask")).arg(object->unitsMask());
+				result << QString("%1: %2").arg(tr("Open channels")).arg(object->openChannels());
+	            break;
+	            }
+	        case KernelObjectTypePhysicalDevice:
+	            {
+	            result << QString("%1: %2").arg(tr("Version")).arg(object->version());
+				result << QString("%1: %2").arg(tr("UnitsMask")).arg(object->unitsMask());
+				result << QString("%1: %2").arg(tr("CodeSeg")).arg(object->addressOfCodeSeg());
+	            break;
+	            }
+	        case KernelObjectTypeLogicalChannel:
+	            {
+	            // No other details
+	            break;
+	            }
+	        case KernelObjectTypeChangeNotifier:
+	            {
+	            result << QString("%1: %2").arg(tr("Changes")).arg(object->changes());
+				result << QString("%1: %2").arg(tr("ThrdAddr")).arg(object->addressOfOwningThread());
+				result << QString("%1: %2").arg(tr("Thr")).arg(object->nameOfOwner());
+	            break;
+	            }
+	        case KernelObjectTypeUndertaker:
+	            {
+	            result << QString("%1: %2").arg(tr("ThrdAddr")).arg(object->addressOfOwningThread());
+	            result << QString("%1: %2").arg(tr("Thr")).arg(object->nameOfOwner());
+				break;
+	            }
+	        case KernelObjectTypeMsgQueue:
+	            {
+	            // No other details
+	            break;
+	            }
+	        case KernelObjectTypePropertyRef:
+	            {
+	            /*
+	            Not listing details here, as propertyRef is not listed in TaskMgr.
+	            Following propertyRef attributes are available at engine side. 
+	            
+	            IsReady
+	            Type
+	            Category
+	            Key
+	            RefCount
+	            ThreadId
+	            CreatorSID
+	            */
+	            break;
+	            }
+	        case KernelObjectTypeCondVar:
+	            {
+	            result << QString("%1: %2").arg(tr("Resetting")).arg(object->resetting());
+				result << QString("%1: %2").arg(tr("Mutex")).arg(object->addressOfOwningThread());
+				result << QString("%1: %2").arg(tr("Mtx")).arg(object->nameOfOwner());
+				result << QString("%1: %2").arg(tr("WaitCount")).arg(object->waitCount());
+	            
+//	            RArray<TMemSpyDriverCondVarSuspendedThreadInfo> threads;
+//	            CleanupClosePushL( threads );
+	            /* TODO: to solve thread cond. vars.
+	            iEngine.HelperCondVar().GetCondVarSuspendedThreadsL( iKernelObjectItems[iListBox->CurrentItemIndex(), threads );
+	            const TInt count = threads.Count();
+	            for ( TInt i = 0; i < count; i++ )
+	                {
+	                const TMemSpyDriverCondVarSuspendedThreadInfo& thr = threads[ i ];
+	                AppendFormatString( messagePtr, _L("SuspThrdAddr: 0x%08X\n"), thr.iAddress );
+	                TFullName thrName;
+	                thrName.Copy( thr.iName );
+	                AppendFormatString( messagePtr, _L("Thr: %S\n"), &thrName );
+	                }
+	            CleanupStack::PopAndDestroy( &threads );
+	            */
+	            break;
+	            }
+//	        default:
+//	            {
+//	            // Programming error
+//	            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
+//	            }
+	        }
+	
+	return result;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspymainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,44 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include "memspymainview.h"
+#include "viewManager.h"
+
+#include <QStringListModel>
+#include <QDebug>
+
+void MemSpyMainView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle("MemSpy");
+	QStringList items = QStringList() 
+			<< tr("Processes & Threads") 
+			<< tr("Kernel Objects"); 
+			//<< tr("Kernel Heap");
+	mListView.setModel(new QStringListModel(items, this));
+    
+	QObject::connect(&mListView, SIGNAL(released(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+}
+
+void MemSpyMainView::itemClicked(const QModelIndex& index)
+{
+	Q_UNUSED(index);
+	ViewIndex indexes[] = { ProcessView, KernelObjectTypeView, KernelObjectTypeView };
+    mViewManager.showView(indexes[index.row()]);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspyprocessview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#include "memspyprocessview.h"
+
+#include <QVariantMap>
+
+#include "viewmanager.h"
+
+MemSpyProcessModel::MemSpyProcessModel(EngineWrapper &engine, QObject *parent) :
+	QAbstractListModel(parent),
+	mProcesses(engine.getProcesses())
+{
+}
+
+MemSpyProcessModel::~MemSpyProcessModel()
+{
+	qDeleteAll(mProcesses);
+}
+	
+int MemSpyProcessModel::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return mProcesses.count();
+}
+	
+QVariant MemSpyProcessModel::data(const QModelIndex &index, int role) const
+{
+	if (role == Qt::DisplayRole) {
+		QStringList lines;
+		lines << mProcesses.at(index.row())->name();
+		
+		return lines;
+	}
+	
+	if (role == Qt::UserRole)
+		return mProcesses.at(index.row())->id();
+	
+	return QVariant();
+}
+	
+
+void MemSpyProcessView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle(tr("Processes"));
+	mListView.setModel(new MemSpyProcessModel(mEngine, this));
+	
+	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+}
+
+void MemSpyProcessView::itemClicked(const QModelIndex& index)
+{
+	QVariantMap map;
+	map.insert("pid", index.data(Qt::UserRole));
+    mViewManager.showView(ThreadView, map);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspythreaddetailview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <QAction>
+#include <QStringListModel>
+#include <HbMenu>
+
+#include "memspythreaddetailview.h"
+
+void MemSpyThreadDetailView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	setTitle(tr("Thread Details"));
+	
+	mThreadId = qVariantValue<ThreadId>(params["tid"]);
+	
+	QStringList lines = QStringList() << tr("General") << tr("Heap") << tr("Stack") 
+			<< tr("Chunks") << tr("Code Segments") << tr("Open Files") << tr("Active Objects")
+			<< tr("Handles to other Threads") << tr("Handles to other Processes") 
+			<< tr("Servers Running in Thread") << tr("Client <-> Server connections")
+			<< tr("Semaphores") << tr("References this Thread") << tr("References this Process")
+			<< tr("Mutexes") << tr("Timers") << tr("Logical DD Channels") 
+			<< tr("Change Notifiers") << tr("Undertakers") << tr("Logical Device Drivers")
+			<< tr("Physical Device Drivers") << tr("Memory Tracking");
+	
+	mListView.setModel(new QStringListModel(lines, this));
+}
+
+HbMenu* MemSpyThreadDetailView::createToolMenu()
+{
+	HbMenu* menu = new HbMenu(tr("Thread"));
+	mPriorityMenu = menu->addMenu("Change Priority");
+	
+	mPriorityMenu->addAction(tr("Abs. Very Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 1"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 2"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 3"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 4"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 5"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 6"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 7"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 8"), this, SLOT(changePriority()));
+	
+	return menu;
+}
+	
+void MemSpyThreadDetailView::changePriority()
+{
+	QAction *s = qobject_cast<QAction*>(sender());
+	int index = mPriorityMenu->actions().indexOf(s);
+	
+	ThreadPriority priorities[] = {
+		ThreadPriorityAbsoluteVeryLow,
+		ThreadPriorityAbsoluteLowNormal,
+		ThreadPriorityAbsoluteLow,
+		ThreadPriorityAbsoluteBackgroundNormal,
+		ThreadPriorityAbsoluteBackground,
+		ThreadPriorityAbsoluteForegroundNormal,
+		ThreadPriorityAbsoluteForeground,
+		ThreadPriorityAbsoluteHighNormal,
+		ThreadPriorityAbsoluteHigh,
+		ThreadPriorityAbsoluteRealTime1,
+		ThreadPriorityAbsoluteRealTime2,
+		ThreadPriorityAbsoluteRealTime3,
+		ThreadPriorityAbsoluteRealTime4,
+		ThreadPriorityAbsoluteRealTime5,
+		ThreadPriorityAbsoluteRealTime6,
+		ThreadPriorityAbsoluteRealTime7, 
+		ThreadPriorityAbsoluteRealTime8 };
+	
+	mEngine.setThreadPriority(mThreadId, priorities[index]);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspythreadview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,170 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <HbAbstractViewItem>
+#include <HbMenu>
+#include <QAction>
+
+#include "memspythreadview.h"
+#include "viewmanager.h"
+
+MemSpyThreadModel::MemSpyThreadModel(EngineWrapper &engine, ProcessId threadId, QObject *parent) :
+	QAbstractListModel(parent),
+	mThreads(engine.getThreads(threadId))
+{
+	mPriorityMap.insert(ThreadPriorityNull, tr("[Null]"));
+	mPriorityMap.insert(ThreadPriorityMuchLess, tr("[Much Less]"));
+	mPriorityMap.insert(ThreadPriorityLess, tr("[Less]"));
+	mPriorityMap.insert(ThreadPriorityNormal, tr("[Normal]"));
+	mPriorityMap.insert(ThreadPriorityMore, tr("[More]"));
+	mPriorityMap.insert(ThreadPriorityMuchMore, tr("[Much More]"));
+	mPriorityMap.insert(ThreadPriorityRealTime, tr("[Real Time]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteVeryLow, tr("[Abs. Very Low]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteLowNormal, tr("[Abs. Low Normal]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteLow, tr("[Abs. Low]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteBackgroundNormal, tr("[Abs. Background Normal]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteBackground, tr("[Abs. Background]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteForegroundNormal, tr("[Abs. Foreground Normal]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteForeground, tr("[Abs. Foreground]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteHighNormal, tr("[Abs. Hight Normal]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteHigh, tr("[Abs. High]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime1, tr("[Abs. RT 1]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime2, tr("[Abs. RT 2]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime3, tr("[Abs. RT 3]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime4, tr("[Abs. RT 4]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime5, tr("[Abs. RT 5]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime6, tr("[Abs. RT 6]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime7, tr("[Abs. RT 7]"));
+	mPriorityMap.insert(ThreadPriorityAbsoluteRealTime8, tr("[Abs. RT 8]"));
+}
+
+MemSpyThreadModel::~MemSpyThreadModel()
+{
+	qDeleteAll(mThreads);
+}
+	
+int MemSpyThreadModel::rowCount(const QModelIndex &parent) const
+{
+	Q_UNUSED(parent);
+	return mThreads.count();
+}
+	
+QVariant MemSpyThreadModel::data(const QModelIndex &index, int role) const
+{
+	if (role == Qt::DisplayRole) {
+		QStringList lines;
+		lines << mThreads.at(index.row())->name();
+		lines << mPriorityMap.value(mThreads.at(index.row())->priority(), tr("[Unknown]"));
+		return lines;
+	}
+	
+	if (role == Qt::UserRole)
+		return mThreads.at(index.row())->id();
+	
+	return QVariant();
+}
+
+MemSpyThreadView::MemSpyThreadView(EngineWrapper &engine, ViewManager &viewManager) : 
+	MemSpyView(engine, viewManager), 
+	mContextMenu(0), 
+	mPriorityMenu(0),
+	mThreadId(0)
+{
+}
+
+MemSpyThreadView::~MemSpyThreadView()
+{
+	delete mContextMenu;
+	delete mPriorityMenu;
+}
+
+void MemSpyThreadView::initialize(const QVariantMap& params)
+{
+	MemSpyView::initialize(params);
+	
+	ProcessId pid = qVariantValue<ProcessId>(params["pid"]);
+	setTitle(tr("Threads").arg(pid));
+	
+	mListView.setModel(new MemSpyThreadModel(mEngine, pid, this));
+	mListView.setLongPressEnabled(true);
+	
+	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
+	connect(&mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
+	        this, SLOT(catchLongPress(HbAbstractViewItem*,QPointF)));
+	
+	mContextMenu = new HbMenu;
+	mPriorityMenu = mContextMenu->addMenu("Change Priority");
+	
+	mPriorityMenu->addAction(tr("Abs. Very Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Low"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Background"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Foreground"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High Normal"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. High"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 1"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 2"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 3"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 4"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 5"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 6"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 7"), this, SLOT(changePriority()));
+	mPriorityMenu->addAction(tr("Abs. Real Time 8"), this, SLOT(changePriority()));
+}
+
+void MemSpyThreadView::itemClicked(const QModelIndex& index)
+{
+	QVariantMap map;
+	map["tid"] = index.data(Qt::UserRole);
+	mViewManager.showView(ThreadDetailView, map);
+}
+
+void MemSpyThreadView::catchLongPress(HbAbstractViewItem *item, const QPointF &coords)
+{
+	mThreadId = qVariantValue<ThreadId>(item->data(Qt::UserRole));
+	mContextMenu->setPreferredPos(coords);
+	mContextMenu->open();
+}
+
+void MemSpyThreadView::changePriority()
+{
+	QAction *s = qobject_cast<QAction*>(sender());
+	int index = mPriorityMenu->actions().indexOf(s);
+	
+	ThreadPriority priorities[] = {
+		ThreadPriorityAbsoluteVeryLow,
+		ThreadPriorityAbsoluteLowNormal,
+		ThreadPriorityAbsoluteLow,
+		ThreadPriorityAbsoluteBackgroundNormal,
+		ThreadPriorityAbsoluteBackground,
+		ThreadPriorityAbsoluteForegroundNormal,
+		ThreadPriorityAbsoluteForeground,
+		ThreadPriorityAbsoluteHighNormal,
+		ThreadPriorityAbsoluteHigh,
+		ThreadPriorityAbsoluteRealTime1,
+		ThreadPriorityAbsoluteRealTime2,
+		ThreadPriorityAbsoluteRealTime3,
+		ThreadPriorityAbsoluteRealTime4,
+		ThreadPriorityAbsoluteRealTime5,
+		ThreadPriorityAbsoluteRealTime6,
+		ThreadPriorityAbsoluteRealTime7, 
+		ThreadPriorityAbsoluteRealTime8 };
+	
+	mEngine.setThreadPriority(mThreadId, priorities[index]);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/memspyview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* 
+*/
+
+#include <HbMenu>
+#include <HbToolBar>
+#include <HbApplication>
+#include <HbMessageBox>
+#include <HbLabel>
+
+#include "memspyview.h"
+
+
+MemSpyView::MemSpyView(EngineWrapper &engine, ViewManager &viewManager) : 
+	HbView(),
+	mEngine(engine),
+	mViewManager(viewManager),
+	mOutputMenu(0), 
+	mOutputGenInfoMenu(0), 
+	mOutputHeapInfoMenu(0),
+	mOutputStackInfoMenu(0),
+	mToolBar(0)
+{
+	setWidget(&mListView);
+}
+
+MemSpyView::~MemSpyView()
+{
+	delete mToolBar;
+	delete mOutputStackInfoMenu;
+	delete mOutputHeapInfoMenu;
+	delete mOutputGenInfoMenu; 
+	delete mOutputMenu;
+}
+
+void MemSpyView::initialize(const QVariantMap& params)
+{
+	if (isRefreshable())
+		menu()->addAction(tr("Refresh"));
+	
+	HbMenu* toolMenu = createToolMenu();
+	if (toolMenu)
+		menu()->addMenu(toolMenu);
+	
+	mOutputMenu = menu()->addMenu(tr("Output"));
+	mOutputMenu->addActions(createOutputActions());
+	mOutputGenInfoMenu = mOutputMenu->addMenu(tr("General Info"));
+	mOutputHeapInfoMenu = mOutputMenu->addMenu(tr("Heap Info"));
+	mOutputStackInfoMenu = mOutputMenu->addMenu(tr("Stack Info"));
+	mOutputGenInfoMenu->addAction(tr("Summary"));
+	mOutputGenInfoMenu->addAction(tr("Detailed Info"));
+	mOutputGenInfoMenu->addAction(tr("Handle Info"));
+	mOutputGenInfoMenu->addAction(tr("Kernel Containters"));
+	mOutputHeapInfoMenu->addAction(tr("Detailed Summary"));
+	mOutputHeapInfoMenu->addAction(tr("Compact Summary"));
+	mOutputHeapInfoMenu->addAction(tr("Cell Listing"));
+	mOutputHeapInfoMenu->addAction(tr("Data (Binary)"));
+	mOutputStackInfoMenu->addAction(tr("Detailed Summary"));
+	mOutputStackInfoMenu->addAction(tr("Compact Summary"));
+	mOutputStackInfoMenu->addAction(tr("User Stacks (Binary)"));
+	mOutputStackInfoMenu->addAction(tr("Kernel Stacks (Binary)"));
+	menu()->addAction(tr("Start Auto Capture"));
+	menu()->addAction(tr("Settings ..."));
+	menu()->addAction(tr("About ..."), this, SLOT(showAbout()));
+	menu()->addAction(tr("Exit"), qApp, SLOT(quit()));
+	
+	mToolBar = createToolBar();
+	if (mToolBar)
+		setToolBar(mToolBar);
+}
+
+QList<QAction*> MemSpyView::createOutputActions()
+{
+	return QList<QAction*>();
+}
+
+HbMenu* MemSpyView::createToolMenu()
+{
+	return 0;
+}
+
+HbToolBar* MemSpyView::createToolBar()
+{
+	return 0;
+}
+
+bool MemSpyView::isRefreshable() const
+{
+	return false;
+}
+
+void MemSpyView::refresh()
+{
+	// Empty default implementation
+}
+
+void MemSpyView::showAbout()
+{
+	HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+	messageBox->setText("Version 2.0.0 - 23th April 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+	HbLabel *header = new HbLabel("About MemSpy", messageBox);
+	messageBox->setHeadingWidget(header);
+	messageBox->setAttribute(Qt::WA_DeleteOnClose);
+	messageBox->setTimeout(HbPopup::NoTimeout);
+	messageBox->open();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/ui/hb/src/viewmanager.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *  
+ */
+
+#include <HbMainWindow>
+#include <HbAction>
+
+#include "viewmanager.h"
+
+#include "enginewrapper.h"
+#include "memspyview.h"
+#include "memspymainview.h"
+#include "memspyprocessview.h"
+#include "memspythreadview.h"
+#include "memspythreaddetailview.h"
+#include "memspykernelobjecttypeview.h"
+#include "memspykernelobjectview.h"
+#include "memspykernelobjectdetailview.h"
+
+template <typename T>
+static MemSpyView* factory(EngineWrapper &engine, ViewManager &viewManager)
+{
+	return new T(engine, viewManager);
+}
+// This array needs to be in sync with view enum
+MemSpyView* (*sFactories[])(EngineWrapper&, ViewManager&) = { 
+	&factory<MemSpyMainView>,
+	&factory<MemSpyProcessView>,
+	&factory<MemSpyThreadView>,
+	&factory<MemSpyThreadDetailView>,
+	&factory<MemSpyKernelObjectTypeView>,
+	&factory<MemSpyKernelObjectView>,
+	&factory<MemSpyKernelObjectDetailView>
+};
+
+
+ViewManager::ViewManager(HbMainWindow &window, EngineWrapper &engine, QObject *parent) :
+	QObject(parent),
+	mWindow(window),
+	mEngine(engine)
+{
+	connect(&mWindow, SIGNAL(currentViewChanged(HbView *)), this, SLOT(viewChanged(HbView *)));
+}
+
+void ViewManager::showView(ViewIndex viewIndex, const QVariantMap &params)
+{
+	MemSpyView* view = sFactories[viewIndex](mEngine, *this);
+	view->initialize(params);
+	if (viewIndex != MainView) {
+		HbAction* action = new HbAction(Hb::BackNaviAction, this);
+		connect(action, SIGNAL(triggered()), this, SLOT(goBack()));
+		view->setNavigationAction(action);
+	}
+		
+	mWindow.addView(view);
+	mWindow.setCurrentView(view);
+}
+
+void ViewManager::showView(ViewIndex viewIndex)
+{
+	showView(viewIndex, QVariantMap());
+}
+
+void ViewManager::goBack()
+{
+	const QList<HbView*> views = mWindow.views();
+	int index = views.indexOf(mWindow.currentView());
+	mWindow.setCurrentView(views.at(index-1), true, Hb::ViewSwitchUseBackAnim);
+}
+
+void ViewManager::viewChanged(HbView *view)
+{
+	const QList<HbView*> views = mWindow.views();
+	int index = views.indexOf(view);
+	for (int i=views.count()-1; i>index; i--)
+		mWindow.removeView(views.at(i));
+}
--- a/perfmon/engine/src/perfmon_engine.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/engine/src/perfmon_engine.cpp	Fri May 14 15:53:02 2010 +0300
@@ -49,7 +49,7 @@
     CActiveScheduler* pS = new CActiveScheduler;
     CActiveScheduler::Install(pS);
 
-    CIdle* idle = CIdle::NewL(CActive::EPriorityStandard);
+    CIdle* idle = CIdle::NewL(CActive::EPriorityLow);
     TCallBack cb(CPULoadCount, aParam);
     idle->Start(cb);
 
@@ -296,7 +296,7 @@
     // create a thread for CPU load monitoring
     User::LeaveIfError(iCPULoadThread.Create(_L("PerfMonCPULoad"),
             CPULoadNOPThread, 0x1000, 0x1000, 0x100000, &iCPULoadCounter));
-    iCPULoadThread.SetPriority(EPriorityLess);
+    iCPULoadThread.SetPriority(EPriorityAbsoluteVeryLow);
     iCPULoadThread.Resume();
 
     iCurrentCPUMode = ECPUModeNOPs; // NOPs taken succesfully in use
@@ -747,8 +747,7 @@
                 iSettings.iMaxSamples);
         LoadDFSValueL(settingsStore, KPMSettingPriority, iSettings.iPriority);
         
-        // TODO: enable next line when NOPs will be working
-        //LoadDFSValueL(settingsStore, KPMSettingCPUMode, iSettings.iCPUMode);
+        LoadDFSValueL(settingsStore, KPMSettingCPUMode, iSettings.iCPUMode);
         
         LoadDFSValueL(settingsStore, KPMSettingKeepBackLightOn,
                 iSettings.iKeepBacklightOn);
--- a/perfmon/ui/hb/app/app.pro	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/app/app.pro	Fri May 14 15:53:02 2010 +0300
@@ -20,7 +20,8 @@
 DEPENDPATH += .
 INCLUDEPATH += inc
 
-CONFIG += hb
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
 
 HEADERS += inc/application.h \
     inc/mainwindow.h \
--- a/perfmon/ui/hb/app/src/enginewrapper.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/app/src/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
--- a/perfmon/ui/hb/app/src/mainview.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/app/src/mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -127,10 +127,11 @@
 
 void MainView::showAbout()
 {
-    HbMessageBox dlg;
-    dlg.setText("Version 1.1.0 - 15th March 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
-    HbLabel header("About PerfMon");
-    dlg.setHeadingWidget(&header);
-    dlg.setTimeout(HbPopup::NoTimeout);
-    dlg.exec();
+    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+    messageBox->setText("Version 1.1.0 - 15th March 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    HbLabel *header = new HbLabel("About PerfMon", messageBox);
+    messageBox->setHeadingWidget(header);
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(HbPopup::NoTimeout);
+    messageBox->open();
 }
--- a/perfmon/ui/hb/app/src/settingsview.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/app/src/settingsview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -23,10 +23,8 @@
 #include <HbDataFormModel>
 #include <HbDataFormModelItem>
 #include <HbDataFormViewItem>
-#include <HbValidator>
 #include <HbLineEdit>
 #include <HbPushButton>
-#include <HbListDialog>
 
 #include "enginewrapper.h"
 
@@ -115,9 +113,6 @@
             HbDataFormModelItem::RadioButtonListItem, tr("CPU sampling mode"), generalPage);
     mCpuSamplingItem->setContentWidgetData("items", CPU_SAMPLING);
     
-    // TODO: remove next line when NOPs will be working
-    mCpuSamplingItem->setContentWidgetData("enabled", false);
-            
     mKeepBacklightItem = model.appendDataFormItem(
             HbDataFormModelItem::CheckBoxItem, tr("Backlight"), generalPage);
     mKeepBacklightItem->setContentWidgetData("text", tr("Keep backlight on"));
@@ -218,9 +213,8 @@
 void SettingsView::dataItemDisplayed(const QModelIndex &index)
 {
     HbDataFormModelItem* modelItem = mModel->itemFromIndex(index);
-    HbDataFormViewItem *viewItem = mSettingsForm->dataFormViewItem(index);
+    HbDataFormViewItem *viewItem = static_cast<HbDataFormViewItem*>(mSettingsForm->itemByIndex(index));
     HbWidget *dataContentWidget = viewItem->dataItemContentWidget();
-    HbWidget *contentWidget = viewItem->contentWidget();
 
     // set input method hint for edits
     // TODO: remove once setContentWidgetData works with inputMethodHints
--- a/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp	Fri May 14 15:53:02 2010 +0300
@@ -35,7 +35,7 @@
     setTimeout(0);
     setModal(false);
     setDismissPolicy(HbPopup::NoDismiss);
-    setBackgroundItem(HbStyle::P_None);
+    setBackgroundItem(0);
     setContentWidget(mWidget);
 
     setDeviceDialogParameters(parameters);
--- a/perfmon/ui/hb/win/enginewrapper.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/perfmon/ui/hb/win/enginewrapper.cpp	Fri May 14 15:53:02 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
--- a/screengrabber/inc/mainview.h	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/inc/mainview.h	Fri May 14 15:53:02 2010 +0300
@@ -94,6 +94,8 @@
 
     void my_quit();
     
+    void quitYesNoQuestionClosed(HbAction*);
+    
 
 public:
     
--- a/screengrabber/inc/notifications.h	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/inc/notifications.h	Fri May 14 15:53:02 2010 +0300
@@ -56,13 +56,6 @@
      * to shows progressbar
      */
     static HbDeviceProgressDialog* showProgressBar(int max);
- 
-private:
-    
-    /**
-     * shows global HbGlobalCommonNote type note
-     */
-    static void showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type);
     
     };
 
--- a/screengrabber/inc/settingsview.h	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/inc/settingsview.h	Fri May 14 15:53:02 2010 +0300
@@ -184,6 +184,4 @@
     
 };
 
-
-
-#endif; 
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/rom/backup_registration.xml	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="yes"?>
+<backup_registration>
+  <passive_backup>
+    <include_directory name="\"/>
+  </passive_backup>
+  <system_backup/>
+  <restore requires_reboot = "no"/>
+</backup_registration>
--- a/screengrabber/rom/screengrabber.iby	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/rom/screengrabber.iby	Fri May 14 15:53:02 2010 +0300
@@ -20,9 +20,7 @@
 #define __SCREENGRABBER_IBY__
 
 S60_APP_EXE(ScreenGrabber)
-S60_APP_AIF_ICONS(ScreenGrabber)
 S60_APP_RESOURCE(ScreenGrabber)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,ScreenGrabber_ExtraIcons)
 SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,ScreenGrabber)
 //#ifdef S60_UPGRADABLE_APP_REG_RSC
 //  S60_UPGRADABLE_APP_REG_RSC(ScreenGrabber)
--- a/screengrabber/screengrabber.pro	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/screengrabber.pro	Fri May 14 15:53:02 2010 +0300
@@ -21,7 +21,8 @@
 DEPENDPATH += src
 INCLUDEPATH += inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-CONFIG += hb
+load(hb.prf)
+symbian:CONFIG -= symbian_i18n
 
 HEADERS += inc/mainview.h \
 					 inc/settingsview.h \
@@ -35,7 +36,19 @@
 					 notifications.cpp 
 
 symbian: {
-
+    BLD_INF_RULES.prj_exports += "./rom/screengrabber.iby CORE_IBY_EXPORT_PATH(tools,screengrabber.iby)
+    BLD_INF_RULES.prj_exports += "./rom/backup_registration.xml     Z:/private/101FB751/backup_registration.xml"
+    
+    screengrabber_buildstubsis_extension = \
+        "$${LITERAL_HASH}ifdef MARM" \
+        "    START EXTENSION app-services/buildstubsis" \
+        "    OPTION SRCDIR sis" \
+        "    OPTION SISNAME screengrabber_stub" \
+        "    END" \
+        "$${LITERAL_HASH}endif" 
+        
+    BLD_INF_RULES.prj_extensions += screengrabber_buildstubsis_extension
+        
 		LIBS += -lestor -lws32 -lPlatformEnv -limageconversion  -lapgrfx -lcommonengine  -lfbscli -lgdi -leikcore -lbafl
 
 		HEADERS += inc/sgengine.h \
@@ -59,10 +72,6 @@
     TARGET.EPOCHEAPSIZE = 0x20000 0x1000000  // Min 128Kb, Max 16Mb
 
     ICON = ./icons/qgn_menu_screengrabber.svg 
-	
-		BLD_INF_RULES.prj_exports += \
-    "./rom/screengrabber.iby CORE_IBY_EXPORT_PATH(tools,screengrabber.iby)
-
 
 } else {
     error("Only Symbian supported!")
--- a/screengrabber/sis/ScreenGrabber_S60-30.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"ScreenGrabber"},(0x101FB751),4,2,0,TYPE=SA
-
-; Supports S60 v 3.0
-[0x101F7961], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\ScreenGrabber.exe"-"!:\sys\bin\ScreenGrabber.exe"
-"\epoc32\data\z\Resource\apps\ScreenGrabber_aif.mif"-"!:\Resource\Apps\ScreenGrabber_aif.mif"
-"\epoc32\data\z\Resource\apps\ScreenGrabber.rsc"-"!:\Resource\Apps\ScreenGrabber.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\ScreenGrabber_reg.rsc"-"!:\private\10003a3f\import\apps\ScreenGrabber_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\101FB751\backup_registration.xml"
Binary file screengrabber/sis/ScreenGrabber_S60-30.sis has changed
--- a/screengrabber/sis/ScreenGrabber_S60-32.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-; Language - standard language definitions
-&EN
-
-; Standard SIS file header
-#{"ScreenGrabber"},(0x101FB751),4,2,0,TYPE=SA
-
-; Supports S60 v 3.2
-[0x102752AE], 0, 0, 0, {"S60ProductID"}
-
-; Non-localised vendor name
-:"Nokia Corporation"
-
-; Localised vendor names
-%{"Nokia Corporation"}
-
-; normal stuff:
-"\epoc32\RELEASE\armv5\UREL\ScreenGrabber.exe"-"!:\sys\bin\ScreenGrabber.exe"
-"\epoc32\data\z\Resource\apps\ScreenGrabber_aif.mif"-"!:\Resource\Apps\ScreenGrabber_aif.mif"
-"\epoc32\data\z\Resource\apps\ScreenGrabber.rsc"-"!:\Resource\Apps\ScreenGrabber.rsc"
-"\epoc32\data\z\PRIVATE\10003A3F\APPS\ScreenGrabber_reg.rsc"-"!:\private\10003a3f\import\apps\ScreenGrabber_reg.rsc"
-"..\group\backup_registration.xml"-"!:\private\101FB751\backup_registration.xml"
Binary file screengrabber/sis/ScreenGrabber_S60-32.sis has changed
--- a/screengrabber/sis/ScreenGrabber_stub.pkg	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/sis/ScreenGrabber_stub.pkg	Fri May 14 15:53:02 2010 +0300
@@ -28,7 +28,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\ScreenGrabber.exe"
-""-"z:\Resource\Apps\ScreenGrabber_aif.mif"
+""-"z:\Resource\Apps\ScreenGrabber.mif"
 ""-"z:\Resource\Apps\ScreenGrabber.rsc"
 ""-"z:\private\10003a3f\import\apps\ScreenGrabber_reg.rsc"
 ""-"z:\private\101FB751\backup_registration.xml"
--- a/screengrabber/src/mainview.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/src/mainview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -84,13 +84,25 @@
 }
 
 
+void MainView::quitYesNoQuestionClosed(HbAction* action)
+    {
+    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+    if(action == dlg->primaryAction())
+        {
+        qApp->quit(); 
+        }
+    }
 
 void MainView::my_quit()
     {
-	HbLabel label(" Exit Screen grabber confirm");
-	if (HbMessageBox::question("Do you really want to exit the Screen Grabber application?","yes","no",&label))
-		qApp->quit();   
-    }
+	HbMessageBox::question("Do you really want to exit the Screen Grabber application?", 
+	    this, //receiver
+	    SLOT(quitYesNoQuestionClosed(HbAction *)), //member
+	    tr("Yes"), //primaryButtonText
+	    tr("No"), //secondaryButtonText
+	    new HbLabel("Exit Screen grabber confirm", this)
+        );
+	}
 
 // ---------------------------------------------------------------------------
 
--- a/screengrabber/src/notifications.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/src/notifications.cpp	Fri May 14 15:53:02 2010 +0300
@@ -27,28 +27,27 @@
 
 void Notifications::imageCaptured()
 {
-    showGlobalNote("Screen shot saved to Media Gallery", HbMessageBox::MessageTypeInformation);
+    HbDeviceMessageBox::information("Screen shot saved to Media Gallery");
 }
 
 // ---------------------------------------------------------------------------
 
 void Notifications::about()
 {
-
-  HbMessageBox dlg;
-    
-	dlg.setText("Version 5.0.0 - March 10th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
-    HbLabel header("About Screen Grabber");
-    dlg.setHeadingWidget(&header);
-	dlg.setTimeout(HbPopup::NoTimeout);
-    dlg.exec();
+    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
+    messageBox->setText("Version 5.0.0 - March 10th 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    HbLabel *header = new HbLabel("About Screen Grabber", messageBox);
+    messageBox->setHeadingWidget(header);
+    messageBox->setAttribute(Qt::WA_DeleteOnClose);
+    messageBox->setTimeout(HbPopup::NoTimeout);
+    messageBox->open();
 }
 
 // ---------------------------------------------------------------------------
 
 void Notifications::error(const QString& errorMessage)
 {
-    showGlobalNote(errorMessage, HbMessageBox::MessageTypeWarning);
+    HbDeviceMessageBox::warning(errorMessage);
 
 }
 
@@ -60,7 +59,7 @@
     text.setNum(amount, 10);
     text.append(" screen shots saved to Media Gallery");
     
-    showGlobalNote(text, HbMessageBox::MessageTypeInformation);
+    HbDeviceMessageBox::information(text);
  
 }
 
@@ -68,7 +67,7 @@
 
 void Notifications::videoCaptured()
 {
-    showGlobalNote("Video saved to Media Gallery", HbMessageBox::MessageTypeInformation);
+    HbDeviceMessageBox::information("Video saved to Media Gallery");
 
 }
 
@@ -84,14 +83,3 @@
 }
 
 // ---------------------------------------------------------------------------
-
-void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type)
-{
-    // Code below launches a global note
-
-	HbDeviceMessageBox note(text, type);
-	note.information(text);
-
-}
-
-// ---------------------------------------------------------------------------
--- a/screengrabber/src/settingsview.cpp	Mon May 03 12:32:02 2010 +0300
+++ b/screengrabber/src/settingsview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -60,8 +60,6 @@
     // DataFormItem for mode selection
     mModeItem = mModel->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Capture mode"), 0);
-    //setting the text property of check box.
-    mModeItem->setData(HbDataFormModelItem::KeyRole, QString("mode"));
     mModeItem->setContentWidgetData(QString("items"), CAPTUREMODES);
     
     // Create setting model
@@ -74,13 +72,11 @@
     setWidget(mSettingForm);//takes ownership
     
     // Get view item of mode selection item
-    HbDataFormViewItem *viewItemVideoPage = mSettingForm->dataFormViewItem(mModel->indexFromItem(mModeItem));
+    HbDataFormViewItem *viewItemVideoPage = static_cast<HbDataFormViewItem*>(mSettingForm->itemByIndex(mModel->indexFromItem(mModeItem)));
 
     loadSettings();
     
     // Connect signals from item modifications and close with this form's slots
-   
-//    connect(viewItemVideoPage, SIGNAL(itemModified(QPersistentModelIndex, QVariant)), this, SLOT(updateShownItems()));
     connect(actionSaveSettings, SIGNAL(triggered()), this, SLOT(saveAndClose()));
     connect(actionCancel, SIGNAL(triggered()), this, SLOT(close()));
 	
@@ -144,29 +140,21 @@
     // DataFormItem for hotkey selection
     mImageHotKeyItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Capture hotkey"), mGroupImageCapture);
-    //setting the text property of check box.
-    mImageHotKeyItem->setData(HbDataFormModelItem::KeyRole, QString("image_hotkey"));
     mImageHotKeyItem->setContentWidgetData(QString("items"), KEYS);
 
     // DataFormItem for image format selection
     mImageFormatItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Image format"), mGroupImageCapture);
-    //setting the text property of check box.
-    mImageFormatItem->setData(HbDataFormModelItem::KeyRole, QString("image_format"));
     mImageFormatItem->setContentWidgetData(QString("items"), IMAGEFORMATS);
     
     // DataFormItem for memory in use selection
     mImageMemoryInUseItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupImageCapture);
-    //setting the text property of check box.
-    mImageMemoryInUseItem->setData(HbDataFormModelItem::KeyRole, QString("image_memory"));
     mImageMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
     
     // DataFormItem for file name
     mImageFileNameItem = model->appendDataFormItem(
             HbDataFormModelItem::TextItem, QString("File name"), mGroupImageCapture);
-    //setting the text property of check box.
-    mImageFileNameItem->setData(HbDataFormModelItem::KeyRole, QString("image_name"));
     mImageFileNameItem->setContentWidgetData(QString("text"), QString("Shot"));
     
 }
@@ -183,36 +171,26 @@
     // DataFormItem for hotkey selection
     mSequantialHotKeyItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Capture hotkey"), mGroupSeguantialCapture);
-    //setting the text property of check box.
-    mSequantialHotKeyItem->setData(HbDataFormModelItem::KeyRole, QString("seguential_hotkey"));
     mSequantialHotKeyItem->setContentWidgetData(QString("items"), KEYS);
     
     // DataFormItem for image format selection
     mSequantialFormatItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Image format"), mGroupSeguantialCapture);
-    //setting the text property of check box.
-    mSequantialFormatItem->setData(HbDataFormModelItem::KeyRole, QString("seguential_format"));
     mSequantialFormatItem->setContentWidgetData(QString("items"), IMAGEFORMATS);
     
     // DataFormItem for delay between images selection
     mSequantialDelayItem = model->appendDataFormItem(
             HbDataFormModelItem::TextItem, QString("Delay between two images(ms)"), mGroupSeguantialCapture);
-    //setting the text property of check box.
-    mSequantialDelayItem->setData(HbDataFormModelItem::KeyRole, QString("seguential_name"));
     mSequantialDelayItem->setContentWidgetData(QString("text"), QString("Shot"));
     
     // DataFormItem for memory selection
     mSequantialMemoryInUseItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupSeguantialCapture);
-    //setting the text property of check box.
-    mSequantialMemoryInUseItem->setData(HbDataFormModelItem::KeyRole, QString("seguential_memory"));
     mSequantialMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
     
     // DataFormItem for file name
     mSequantialFileNameItem = model->appendDataFormItem(
             HbDataFormModelItem::TextItem, QString("File name"), mGroupSeguantialCapture);
-    //setting the text property of check box.
-    mSequantialFileNameItem->setData(HbDataFormModelItem::KeyRole, QString("seguential_name"));
     mSequantialFileNameItem->setContentWidgetData(QString("text"), QString("Shot"));
     
 }
@@ -228,29 +206,21 @@
     // DataFormItem for hotkey selection
     mVideoHotKeyItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Start/Stop hotkey"), mGroupVideoCapture);
-    //setting the text property of check box.
-    mVideoHotKeyItem->setData(HbDataFormModelItem::KeyRole, QString("video_hotkey"));
     mVideoHotKeyItem->setContentWidgetData(QString("items"), KEYS);
     
     // DataFormItem for video format selection
     mVideoFormatItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Video format"), mGroupVideoCapture);
-    //setting the text property of check box.
-    mVideoFormatItem->setData(HbDataFormModelItem::KeyRole, QString("video_format"));
     mVideoFormatItem->setContentWidgetData(QString("items"), VIDEOFORMATS);
     
     // DataFormItem for memory selection
     mVideoMemoryInUseItem = model->appendDataFormItem(
             HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupVideoCapture);
-    //setting the text property of check box.mGroupVideoCapture
-    mVideoMemoryInUseItem->setData(HbDataFormModelItem::KeyRole, QString("video_memory"));
     mVideoMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
     
     // DataFormItem for file name
     mVideoFileNameItem = model->appendDataFormItem(
             HbDataFormModelItem::TextItem, QString("File name"), mGroupVideoCapture);
-    //setting the text property of check box.
-    mVideoFileNameItem->setData(HbDataFormModelItem::KeyRole, QString("video_name"));
     mVideoFileNameItem->setContentWidgetData(QString("text"), QString("Video"));
     
 }
@@ -270,8 +240,6 @@
 	
 }
 
-
-
 // ---------------------------------------------------------------------------
 
 void SettingsView::readFormItems()
@@ -301,47 +269,6 @@
    
 }
 
-
-// ---------------------------------------------------------------------------
-/*
-void SettingsView::updateShownItems()
-{ 
-
-    if (mMainWindow.currentView() == this) {
-        // Get view items of each group
-        HbDataFormViewItem *viewItemImageGroup = mSettingForm->dataFormViewItem(mModel->indexFromItem(mGroupImageCapture));
-        HbDataFormViewItem *viewItemSequantialGroup = mSettingForm->dataFormViewItem(mModel->indexFromItem(mGroupSeguantialCapture));
-        HbDataFormViewItem *viewItemVideoGroup = mSettingForm->dataFormViewItem(mModel->indexFromItem(mGroupVideoCapture));
-
-    
-        // Set certain group expanded according to selected mode. 
-        // TODO this does not work correctly with WK38(selectedItem is for some reason always 1)
-    
-        int selectedItem = mModeItem->contentWidgetData("selected").toInt();
-        
-        if (selectedItem == SINGLE){
-            viewItemImageGroup->setExpanded(true);
-            viewItemSequantialGroup->setExpanded(false);
-            viewItemVideoGroup->setExpanded(false);
-    
-        }
-        else if (selectedItem == SEQUENTIAL){
-            viewItemImageGroup->setExpanded(false);
-            viewItemSequantialGroup->setExpanded(true);
-            viewItemVideoGroup->setExpanded(false);    
-        }
-        
-        else if (selectedItem == VIDEO){
-            viewItemImageGroup->setExpanded(false);
-            viewItemSequantialGroup->setExpanded(false);
-            viewItemVideoGroup->setExpanded(true);
-        }
-        
-        
-    }
-    
-}
-*/
 // ---------------------------------------------------------------------------
 
 void SettingsView::close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/group/ReleaseNote.txt	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,47 @@
+========================================================================
+RELEASE NOTE FOR STIF UI - STIF_201016 (7.3.31)
+SUPPORTING SERIES 60 3.0 ->
+========================================================================
+
+Product Description:
+====================
+STIF UI is Series 60 UI application for STIF project.
+STIF is a test harness for testing Symbian & S60 non-UI components.
+This widely used test framework can be used for both test case implementation and test cases execution.
+
+Features :
+=========
+- Easy to use
+- Multiple test cases can be executed concurrently.
+
+
+Enhancements:
+=============
+N/A
+
+
+New Features:
+=============
+N/A
+
+
+System Requirements:
+====================
+Basic Requirements:
+- S60/Symbian OS development environment installed 
+
+- stif project needs to be compiled/installed before stifui can be used
+
+
+Compatibility Issues:
+=====================
+N/A 
+
+Known Issues:
+===========
+If problems with compilation appears (missing platform_paths.hrh file error message), 
+please use EnvPatcher.pl script from stif/envpatcher folder to fix environment. 
+
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: bld.inf Toplevel build information for STIF UI
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+// Specify the platforms your component needs to be built for here.
+// If not specified all platforms can be built.
+
+// Note that if you want to build STIF to GCCE platform, GCCE must be
+// specified separately - it is not part of default platforms.
+// DEFAULT GCCE
+
+	DEFAULT
+
+
+PRJ_EXPORTS
+// This is added in order to export iby files automaticly in 5.0 env
+	../rom/Stifui.iby     CORE_IBY_EXPORT_PATH(tools,Stifui.iby)
+
+PRJ_TESTEXPORTS
+
+PRJ_MMPFILES
+	// StifUI
+	#include "../stifui/group/bld.inf"
+
+	// UiTestServerStarter
+	#include "../uitestserverstarter/group/bld.inf"
+
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/rom/Stifui.iby	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: Stifui.iby file specifies needed STIF and STIF UI 
+* and UITetsServerstarter components for ROM image
+*
+*/
+
+#ifndef __STIF_UI_IBY__
+#define __STIF_UI_IBY__
+
+S60_APP_EXE(Stifui)
+
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(Stifui)
+#else
+  S60_APP_AIF_RSC(Stifui)
+#endif
+
+S60_APP_RESOURCE(Stifui)
+
+S60_APP_EXE(UITestServerStarter)
+
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(UITestServerStarter)
+#else
+  S60_APP_AIF_RSC(UITestServerStarter)
+#endif
+
+
+S60_APP_RESOURCE(UITestServerStarter)
+
+// Note: before creating image, copy Stifui_31_Stub.sis from \stifui\sis\ to \epoc32\data\Z\system\install\
+data=ZSYSTEM\install\Stifui_31_Stub.sis    System\Install\Stifui_31_Stub.sis
+
+#endif
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/sis/Stifui.pkg	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,67 @@
+;
+; 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 "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:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+; 
+; Description: Installation file for STIF UI
+;
+
+; Languages
+&EN
+
+; Package header, uid is the Stifui's uid
+#{"STIF UI"},(0x1028311D),0,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+
+   ;// Note: STIF needs to be installed before STIF UI can be used
+
+  "\epoc32\release\armv5\udeb\Stifui.exe"-"!:\Sys\Bin\Stifui.exe"
+  "\epoc32\data\z\private\10003a3f\apps\Stifui_reg.rsc"-"!:\Private\10003a3f\import\apps\Stifui_reg.rsc"
+  "\epoc32\data\z\Resource\apps\Stifui.rsc"-"!:\Resource\apps\Stifui.rsc"
+
+  "\epoc32\release\armv5\udeb\UITestServerStarter.exe"-"!:\Sys\Bin\UITestServerStarter.exe"
+  "\epoc32\data\z\private\10003a3f\apps\UITestServerStarter_reg.rsc"-"!:\Private\10003a3f\import\apps\UITestServerStarter_reg.rsc"
+  "\epoc32\data\z\Resource\apps\UITestServerStarter.rsc"-"!:\Resource\apps\UITestServerStarter.rsc"  
+
+; Embedded SIS 
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
\ No newline at end of file
Binary file stifui/avkon/sis/Stifui_31.sis has changed
Binary file stifui/avkon/sis/Stifui_31_Stub.SIS has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/data/Stifui.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,2057 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file defines StifUI resources.
+*
+*/
+
+//	RESOURCE IDENTIFIER
+NAME	STIF // 4 letter ID
+
+//	INCLUDES
+
+#include <eikon.rh>
+#include "Stifui.hrh"
+#include "Stifui_loc.hrh"
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.mbg>
+#include <avkon.hrh>
+#include <CommonDialogs.hrh> // Enumerations of memory selection, file selection, save etc dialogs
+#include <CommonDialogs.rh> // Resource structures of memory selection, file selection, save etc dialogs
+#if defined (__S60_)
+    #include <data_caging_paths_strings.hrh>
+#endif
+#include <appinfo.rh>
+
+//	CONSTANTS  
+
+
+//	MACROS	
+
+
+//	RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf="STIF UI"; }
+
+RESOURCE EIK_APP_INFO
+	{
+	status_pane = r_appui_status_pane;
+	}
+
+STRUCT STRING 
+    { 
+	BUF text;
+    }
+
+
+//  RESOURCE DEFINITIONS 
+//-----------------------------------------------------------------------------
+//	 
+// r_appui_hotkeys
+// ?description
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE HOTKEYS r_appui_hotkeys
+	{
+	control=
+		{
+		HOTKEY { command=EAknCmdExit; key='e'; }
+		};
+	}
+
+
+// APPUI
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_status_pane
+//	  Applications status panel.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_appui_status_pane
+	{
+	panes=
+		{
+		//SPANE_PANE
+		//	{
+		//	id = EEikStatusPaneUidNavi;
+		//	//type = EEikCtLabel;
+		//	//type = EAknCtTitlePane;
+		//	type = EAknCtNaviPane;
+		//	//resource = r_appui_statuspane_text;
+		//	resource = r_appui_navi_decorator;
+		//	},
+		SPANE_PANE
+			{
+			id = EEikStatusPaneUidTitle;
+			type = EAknCtTitlePane;
+			resource = r_appui_overriden_app_name;
+			}
+		//SPANE_PANE
+		//	{
+		//	id = EEikStatusPaneUidContext;
+		//	type = EAknCtContextPane;
+		//	resource = ;
+		//	}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_status_pane
+//	  Status panel text.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LABEL r_appui_statuspane_text
+    {
+    txt = "STIF UI";
+    }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_overriden_app_name
+//	  Application name.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_appui_overriden_app_name
+	{
+	txt = qtn_app_caption_string;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_navi_decorator
+//	  ?description
+//
+//-----------------------------------------------------------------------------
+//
+/*
+RESOURCE NAVI_DECORATOR r_appui_navi_decorator
+	{
+	type = ENaviDecoratorControlTabGroup;
+	control = TAB_GROUP
+		{
+		tab_width = EAknTabWidthWithTwoTabs;  // two tabs
+		active = 0;
+		tabs = {
+			TAB
+				{
+				id = ETestCaseMenuTab; // from application hrh
+				txt = qtn_testcase_menu_tab;
+				},
+			TAB
+				{
+				id = ETestModulesMenuTab; // from application hrh
+				txt = qtn_testmodules_menu_tab;
+				},
+			TAB
+				{
+				id = ETestSetsMenuTab; // from application hrh
+				txt = qtn_testsets_menu_tab;
+				}
+			};
+		};
+	}
+*/
+
+// MAIN MENU
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_mainmenuview
+//	  Mainmenu view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_mainmenuview
+	{
+	menubar=r_appui_menubar_mainmenuview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_mainmenuview
+//	  Main menu menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_mainmenuview
+	{
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_mainmenuview_menu;
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_mainmenuview_menu
+//	  Main menu options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_mainmenuview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command= EAknCmdOpen; 
+				txt = "Open"; 
+				},
+			MENU_ITEM
+				{
+				command = ECmdShowAbout;
+				txt = "About";
+				},
+        	MENU_ITEM 
+				{
+				command = EAknSoftkeyExit;   
+				txt = "Exit";
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_main_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_main_menu_listbox
+	{
+	array_id = r_main_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_main_menu_items
+//	  Items array for Main Menu
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_main_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = qtn_mainmenulist_test_cases;
+			},
+		LBUF
+			{
+			txt = qtn_mainmenulist_modules;
+			},
+		LBUF
+			{
+			txt = qtn_mainmenulist_test_sets;
+			}
+		};
+	}
+
+
+
+// TEST CASES MENU
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testcasemenuview
+//	  Test case menu view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_testcasemenuview
+	{
+	menubar=r_appui_menubar_testcasemenuview;
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_testcasemenuview
+//	  Test case view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_testcasemenuview
+	  {
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_testcasemenuview_menu;
+				}
+		};
+
+	  }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testcasemenuview_menu
+//	  Testcase view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_testcasemenuview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command= EAknCmdOpen; 
+				txt = "Open"; 
+				},
+        	MENU_ITEM 
+				{
+				command = EAknSoftkeyExit;   
+				txt = "Exit";
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testcase_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_testcase_menu_listbox
+	{
+	array_id = r_testcase_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testcase_menu_items
+//	  Items array for Test Case Menu
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_testcase_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = qtn_testcasemenu_startcase; // "\tStart Case(s)";
+			},
+		LBUF
+			{
+			txt = qtn_testcasemenu_startedcases; // "\tStarted Cases";
+			}
+		};
+	}
+
+
+
+// START CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_startcasesview
+//	  Startcases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_startcasesview
+	{
+	hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_startcasesview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_startcasesview
+//	  Startcases view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_startcasesview
+	{
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_startcasesview_menu;
+				//menu_pane=R_AVKON_MENUPANE_MARKABLE_LIST;
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_loadtestsetview_menu
+//	  loadtestset view options menu.
+//
+//-----------------------------------------------------------------------------
+RESOURCE MENU_PANE r_appui_loadtestsetview_menu
+	{
+	items= 
+		{
+		MENU_ITEM 
+			{ 
+			command=EAknCmdOpen; 
+			txt = qtn_start; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_loadtestsetview
+//	  Started cases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_loadtestsetview
+	{
+	//hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_startedcasesmenuview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_startedcasesmenuview
+//	  Started cases menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_loadtestsetview
+	  {
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_loadtestsetview_menu;
+				}
+		};
+
+	  }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_startcasesview_menu
+//	  Startcases view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_startcasesview_menu
+	{
+	items=
+		{
+		MENU_ITEM
+		    {
+		    command = ECmdFilterMenu;
+		    txt = qtn_filter_menu;
+		    cascade = r_appui_filtermenu;
+		    },
+		/*
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByModule; 
+			txt = qtn_filter_by_modules; 
+			cascade = r_appui_filterbymodules_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByTestCaseFile; 
+			txt = qtn_filter_by_test_case_file;
+			cascade = r_appui_filter_by_testcasefile_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdNOFiltering; 
+			txt = qtn_no_filtering; 
+			},
+		*/
+		MENU_ITEM 
+			{ 
+			command=ECmdMarkMenu;
+		    txt = qtn_markmenu_title; 
+		    cascade = r_appui_markunmark_menu;
+		    },
+		MENU_ITEM 
+			{ 
+			command=ECmdStartCases; 
+			txt = qtn_start_test_cases; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+
+
+
+// STARTED CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_startedcasesmenuview
+//	  Started cases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_startedcasesmenuview
+	{
+	//hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_startedcasesmenuview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_startedcasesmenuview
+//	  Started cases menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_startedcasesmenuview
+	  {
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_startedcasesmenuview_menu;
+				}
+		};
+
+	  }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_startedcasesmenuview_menu
+//	  Started cases view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_startedcasesmenuview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command= EAknCmdOpen; 
+				txt = "Open"; 
+				},
+        	MENU_ITEM 
+				{
+				command = EAknSoftkeyExit;   
+				txt = "Exit";
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_started_cases_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_started_cases_menu_listbox
+	{
+	array_id = r_startedcases_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+
+
+
+//-----------------------------------------------------------------------------
+//
+//	  r_startedcases_menu_items
+//	  Items array for Test Case Menu
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_startedcases_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = qtn_startedcases_allcases;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_ongoing;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_paused;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_passed;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_failed;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_crashed_aborted;
+			},
+		LBUF
+			{
+			txt = qtn_startedcases_statistics;
+			}
+		};
+	}
+
+
+
+// SHOW STARTED CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_showstartedcasesview
+//	  Show started cases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_showstartedcasesview
+	{
+	hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_showstartedcasesview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_showstartedcasesview
+//	  Show started cases view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_showstartedcasesview
+	{
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_showstartedcasesview_menu;
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_showstartedcasesview_menu
+//	  Show started cases view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_showstartedcasesview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=ECmdViewOutput; 
+			txt = qtn_view_output; 
+			},
+		MENU_ITEM
+		    {
+		    command = ECmdFilterMenu;
+		    txt = qtn_filter_menu;
+		    cascade = r_appui_filtermenu;
+		    },
+		MENU_ITEM
+		    { 
+			command=ECmdShowSetMenu;
+			txt = qtn_testcase_control_menu;
+			cascade = r_testcase_control_submenu;
+			},
+		MENU_ITEM 
+		    { 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+			
+        /*
+		MENU_ITEM 
+				{ 
+				command=ECmdPauseTestCase; 
+				txt = qtn_pause_testcase; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdResumeTestCase; 
+				txt = qtn_resume_testcase; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdAbortTestCase; 
+				txt = qtn_abort_testcase; 
+				},
+        */
+        
+        /*
+		MENU_ITEM 
+				{ 
+				command=ECmdFilterByModule; 
+				txt = qtn_filter_by_modules; 
+				cascade = r_appui_filterbymodules_menu; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdFilterByTestCaseFile; 
+				txt = qtn_filter_by_test_case_file;
+				cascade = r_appui_filter_by_testcasefile_menu; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdNOFiltering; 
+				txt = qtn_no_filtering; 
+				},
+		*/
+		
+		/*
+		MENU_ITEM 
+				{ 
+				command=ECmdRemoveExecution; 
+				txt = qtn_remove_execution; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdRemoveAllExecutions; 
+				txt = qtn_remove_all_executions; 
+				},
+	    */
+
+		};
+	}
+
+
+// STATISTICS VIEW
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_statisticsview
+//	  Statistics view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_statisticsview
+	{
+	menubar= r_appui_menubar_statisticsview;
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_statisticsview
+//	  Statistics view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_statisticsview
+	{
+	titles=
+		{
+		MENU_TITLE 
+			{ 
+			menu_pane=r_appui_statisticsview_menu; 
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_statisticsview_menu
+//	  Statistics view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_statisticsview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByModule; 
+			txt = qtn_filter_by_modules; 
+			cascade = r_appui_filterbymodules_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByTestCaseFile; 
+			txt = qtn_filter_by_test_case_file;
+			cascade = r_appui_filter_by_testcasefile_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdNOFiltering; 
+			txt = qtn_no_filtering; 
+			},
+
+		MENU_ITEM 
+			{ 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+
+
+// TESTCASE OUTPUT VIEW
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testcaseoutputview
+//	  Testcase output view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_testcaseoutputview
+	{
+	hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_testcaseoutputview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_testcaseoutputview
+//	  Testcase output view menub bar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_testcaseoutputview
+	{
+	titles=
+		{
+		MENU_TITLE 
+			{ 
+			menu_pane=r_appui_testcaseoutputview_menu; 
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testcaseoutputview_menu
+//	  Testcase output view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_testcaseoutputview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=ECmdPauseTestCase; 
+			txt = qtn_pause_testcase; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdResumeTestCase; 
+			txt = qtn_resume_testcase; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdAbortTestCase; 
+			txt = qtn_abort_testcase; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+
+
+
+// MODULES MENU
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testmodulesmenuview
+//	  Test modules menu view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_testmodulesmenuview
+	{
+	hotkeys=r_appui_hotkeys;
+	menubar=r_appui_menubar_testmodulesmenuview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_testmodulesmenuview
+//	  Test modules view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_testmodulesmenuview
+	{
+	titles=
+		{
+		MENU_TITLE 
+			{ 
+			menu_pane=r_appui_testmodulesmenuview_menu; 
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testmodulesmenuview_menu
+//	  Testmodules view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_testmodulesmenuview_menu
+	{
+	items=
+		{
+		// MENU_ITEM 
+		//	{ 
+		//	command=ECmdOpenModule; 
+		//	txt = qtn_open_module; 
+		//	},
+		MENU_ITEM 
+			{ 
+			command=ECmdAddModule; 
+			txt = qtn_add_module; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdRemoveModule; 
+			txt = qtn_remove_module; 
+			},
+	        MENU_ITEM 
+			{ 
+			command=EAknCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	  r_testmodules_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+/*
+RESOURCE LISTBOX r_testmodules_menu_listbox
+	{
+	array_id = r_testmodules_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+*/
+
+//-----------------------------------------------------------------------------
+//	  r_testmodules_menu_items
+//	  Items array for Test Case Menu
+//
+//-----------------------------------------------------------------------------
+//
+/*
+RESOURCE ARRAY r_testmodules_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = "\tModule1";
+			},
+		LBUF
+			{
+			txt = "\tModule2";
+			}
+		};
+	}
+*/
+
+
+// TEST SET BASE
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testsetbasemenuview
+//	  Testset base menu view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_testsetbasemenuview
+	{
+	menubar=r_appui_menubar_testsetbasemenuview;
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_testsetbasemenuview
+//	  Testset base menu view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_testsetbasemenuview
+	  {
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_testsetbasemenuview_menu;
+				}
+		};
+
+	  }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testsetbasemenuview_menu
+//	  Testset base menu view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_testsetbasemenuview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command= ECmdCreateTestSet; 
+				txt = "Create test set";
+				},
+		MENU_ITEM 
+				{ 
+				command= ECmdLoadTestSet; 
+				txt = "Load test set";
+				},
+        	MENU_ITEM 
+				{
+				command = EAknSoftkeyExit;   
+				txt = "Exit";
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testsetbase_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_testsetbase_menu_listbox
+	{
+	array_id = r_testsetbase_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+
+
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testsetbase_menu_items
+//	  Items array for Test Sets Base Menu
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_testsetbase_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = qtn_testsetbasemenu_createtestset;
+			},
+		LBUF
+			{
+			txt = qtn_testsetbasemenu_loadtestset;
+			}
+		};
+	}
+
+
+// TESTSET MENU
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testsetmenuview
+//	  Test set menu view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_appui_testsetmenuview
+	{
+	menubar=r_appui_menubar_testsetmenuview;
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_menubar_testsetmenuview
+//	  Test set menu view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_appui_menubar_testsetmenuview
+	  {
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_appui_testsetmenuview_menu;
+				}
+		};
+
+	  }
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_testsetmenuview_menu
+//	  Test set menu view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_testsetmenuview_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command= ECmdStartTestSet; 
+				txt = "Start testing";
+				},
+		MENU_ITEM 
+				{ 
+				command= ECmdShowStartedTestSet; 
+				txt = "View started cases";
+				},				
+		MENU_ITEM 
+				{ 
+				command= ECmdSaveTestSet; 
+				txt = "Save test set"; 
+				},
+		MENU_ITEM 
+				{ 
+				command= ECmdInsertTestCases; 
+				txt = "Insert test case(s)";
+				},
+		MENU_ITEM 
+				{ 
+				command= ECmdRemoveTestCases; 
+				txt = "Remove test case"; 
+				},
+        MENU_ITEM 
+				{
+				command = EAknSoftkeyExit;   
+				txt = "Exit";
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testset_menu_listbox
+//	  ListBox( Single )
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE LISTBOX r_testset_menu_listbox
+	{
+	array_id = r_testset_menu_items;
+	flags = EAknListBoxSelectionList;
+	}
+
+
+
+//-----------------------------------------------------------------------------
+//
+//	  r_testset_menu_items
+//	  Items array for Test Sets Menu
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_testset_menu_items
+	{
+	items =
+		{
+		LBUF
+			{
+			txt = "";
+			}			
+		};
+	}
+
+
+// TESTSET STARTED CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_test_set_startedcasesview
+//	  Test set started cases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_testset_startedcasesview
+	{
+	//hotkeys=r_appui_hotkeys;
+	menubar=r_testset_menubar_startedcasesview;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_test_set_menubar_startedcasesview
+//	  Test set started cases view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_testset_menubar_startedcasesview
+	{
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_testset_startedcasesview_menu;
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_testset_startedcasesview_menu
+//	  Test set started cases view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_testset_startedcasesview_menu
+	{
+	items=
+		{
+		MENU_ITEM
+				{
+				txt = qtn_testset_started_menu;
+				cascade = r_testset_startedcases_submenu;
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdViewOutput; 
+				txt = qtn_view_output; 
+				},
+        MENU_ITEM 
+				{ 
+				command=ECmdShowSetMenu;
+				txt = qtn_testcase_control_menu;
+				cascade = r_testcase_control_submenu;
+				},
+		MENU_ITEM 
+				{ 
+				command=EEikCmdExit; 
+				txt = qtn_exit; 
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_testset_startedcases_submenu
+//	  Test set started cases view sub menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_testset_startedcases_submenu
+	{
+	items=
+		{
+		MENU_ITEM
+				{
+				command = ECmdShowAllStartedCases;
+				txt = qtn_testset_started_allcases;
+				},
+		MENU_ITEM
+				{
+				command = ECmdShowOngoingCases;
+				txt = qtn_testset_started_ongoing;
+				},
+		MENU_ITEM
+				{
+				command = ECmdShowPausedCases;
+				txt = qtn_testset_started_paused;
+				},
+		MENU_ITEM
+				{
+				command = ECmdShowPassedCases;
+				txt = qtn_testset_started_passed;
+				},
+		MENU_ITEM
+				{
+				command = ECmdShowFailedCases;
+				txt = qtn_testset_started_failed;
+				},
+		MENU_ITEM
+				{
+				command = ECmdShowCrashedAbortedCases;
+				txt = qtn_testset_started_crashed_aborted;
+				}
+		};
+	}
+
+
+// TESTSET INSERT CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_testcases_view
+//	  Insert test cases view.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_insert_testcases_view
+	{
+	//hotkeys=r_appui_hotkeys;
+	menubar=r_insert_testcases_menubar;  
+	cba=R_AVKON_SOFTKEYS_OPTIONS_CANCEL;	  
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_testcases_menubar
+//	  Insert test cases view menubar.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_insert_testcases_menubar
+	{
+	titles=
+		{
+		MENU_TITLE 
+				{ 
+				menu_pane=r_insert_testcases_menu;
+				}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_testcases_menu
+//	  Insert test cases view options menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_insert_testcases_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=ECmdInsertSelectedCases;
+			txt = qtn_testsetinsert_add_selected; 
+			},
+        MENU_ITEM
+		    {
+		    command = ECmdFilterMenu;
+		    txt = qtn_filter_menu;
+		    cascade = r_appui_filtermenu;
+		    },
+		MENU_ITEM 
+			{ 
+			command=ECmdMarkMenu;
+		    txt = qtn_markmenu_title; 
+		    cascade = r_appui_markunmark_menu;
+		    },
+		MENU_ITEM 
+			{ 
+			command=EEikCmdExit; 
+			txt = qtn_exit; 
+			}
+		};
+	}
+
+
+
+// GENERAL
+// MARKMENU
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_markunmark_menu
+//	  Submenu for marking items.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_markunmark_menu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=EAknCmdMark; 
+			txt = qtn_markmenu_mark; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EAknCmdUnmark; 
+			txt = qtn_markmenu_unmark; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EAknMarkAll; 
+			txt = qtn_markmenu_markall; 
+			},
+		MENU_ITEM 
+			{ 
+			command=EAknUnmarkAll; 
+			txt = qtn_markmenu_unmarkall; 
+			}
+		};
+	}
+
+// TEST CASE CONTROL
+//-----------------------------------------------------------------------------
+//	 
+//	  r_testset_stertedcases_setmenu
+//	  Test set started cases view set menu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_testcase_control_submenu
+	{
+	items=
+		{
+		MENU_ITEM 
+				{ 
+				command=ECmdPauseTestCase; 
+				txt = qtn_pause_testcase; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdResumeTestCase; 
+				txt = qtn_resume_testcase; 
+				},
+		MENU_ITEM 
+				{ 
+				command=ECmdAbortTestCase; 
+				txt = qtn_abort_testcase; 
+				}
+		};
+	}
+
+// FILTERING			
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_filtermenu
+//	  MenuPane for Filter submenu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_filtermenu
+	{
+	items=
+		{
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByModule; 
+			txt = qtn_filter_by_modules; 
+			cascade = r_appui_filterbymodules_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdFilterByTestCaseFile; 
+			txt = qtn_filter_by_test_case_file;
+			cascade = r_appui_filter_by_testcasefile_menu; 
+			},
+		MENU_ITEM 
+			{ 
+			command=ECmdNOFiltering; 
+			txt = qtn_no_filtering; 
+			}
+	    };
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_filterbymodules_menu
+//	  MenuPane for Filter submenu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_filterbymodules_menu
+	{
+	items=
+		{
+		// items (modules) are added dynamically when
+		// Filter by module submenu is opened
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_appui_filter_by_testcasefile_menu
+//	  MenuPane for Filter submenu.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_appui_filter_by_testcasefile_menu
+	{
+	items=
+		{
+		// Items (testcase files are added dynamically when
+		// Filter by testcase file menu is opened
+		};
+	}
+
+
+// DIALOGS
+// START TEST CASES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_start_testcase_list_query
+//	  Query dialog for starting single test case.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_LIST_QUERY r_start_testcase_list_query
+	{
+	flags = EGeneralQueryFlags;
+	softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
+	items = 
+		{
+		DLG_LINE   //AVKON_LIST_QUERY_DLG_LINE
+			{
+			type = EAknCtListQueryControl;
+			id = EListQueryControl;
+			control = AVKON_LIST_QUERY_CONTROL
+				{
+				listtype = EAknCtSinglePopupMenuListBox;
+				listbox = LISTBOX		//AVKON_LIST_QUERY_LIST
+					{
+					flags = EAknListBoxMenuList;
+					height = 3;
+					width = 3;
+					array_id = r_start_testcase_listbox_item_array;
+					};
+				heading = qtn_starting_test_case;
+				};
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_start_testcase_listbox_item_array
+//	  Listbox items in query dialog for starting single test case.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_start_testcase_listbox_item_array
+	{
+	items =
+		{
+		LBUF { txt = qtn_start_test; },
+		LBUF { txt = qtn_start_test_output; }
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_start_multiple_testcases_list_query
+//	  Query dialog for starting multiple test cases.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE AVKON_LIST_QUERY r_start_multiple_testcases_list_query
+	{
+	flags = EGeneralQueryFlags;
+	softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
+	items = 
+		{
+		DLG_LINE   //AVKON_LIST_QUERY_DLG_LINE
+			{
+			type = EAknCtListQueryControl;
+			id = EListQueryControl;
+			control = AVKON_LIST_QUERY_CONTROL
+				{
+				listtype = EAknCtSinglePopupMenuListBox;
+				listbox = LISTBOX		//AVKON_LIST_QUERY_LIST
+					{
+					flags = EAknListBoxMenuList;
+					height = 3;
+					width = 3;
+					array_id = r_start_multiple_testcases_listbox_item_array;
+					};
+				heading = qtn_starting_test_cases;
+				};
+			}
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_start_multiple_testcases_listbox_item_array
+//	  Listbox items in query dialog for starting single test case.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE ARRAY r_start_multiple_testcases_listbox_item_array
+	{
+	items =
+		{
+		LBUF { txt = qtn_start_tests_parallel; },
+		LBUF { txt = qtn_start_tests_serial; }
+		};
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_general_confirmation_dialog
+//	  General confirmation dialog with empty label.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_general_confirmation_dialog
+	{
+	flags = EGeneralQueryFlags;
+	buttons = R_AVKON_SOFTKEYS_YES_NO;
+	items = 
+		{
+		DLG_LINE
+			{
+			type = EAknCtQuery;
+			id = EGeneralQuery;
+			control = AVKON_CONFIRMATION_QUERY
+				{
+				layout = EConfirmationQueryLayout;
+        		label = "";
+				};
+			}
+		};
+
+	} 
+
+//-----------------------------------------------------------------------------
+//	 
+//    r_stifui_about_dialog
+//	  "About" dialog
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE DIALOG r_stifui_about_dialog
+{
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items=
+    {
+        DLG_LINE
+        {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+            {
+                label = "About STIF";
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+            };
+        },
+        DLG_LINE
+        {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+            {
+                
+            };
+        }
+    };
+}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_memory_selection_dialog
+//	  Selection dialog for selectiong either C or E drive.
+//        Not yet used.
+//
+//-----------------------------------------------------------------------------
+//
+/*
+RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog
+	{
+	title = "Choose memory:";
+	softkey_1 = "Ok";
+	softkey_2 = "Cancel";
+	locations = 
+		{
+		LOCATION { root_path = "C:\\"; },
+		LOCATION { root_path = "E:\\";  //default_folder = "TestFramework\\";
+                 }
+		};
+	}
+*/
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_file_selection_dialog
+//	  Fileselection dialog.
+//        Not yet used.
+//
+//-----------------------------------------------------------------------------
+//
+/*
+RESOURCE FILESELECTIONDIALOG r_file_selection_dialog
+	{
+	title = "Select-a-file:";
+	root_path = "C:\\";
+	filters =
+		{
+		FILTER
+			{
+			filter_type = EAttributeFilter; //EAttributeFilter;
+			filter_style = EExclusiveFilter; //EExclusiveFilter;
+			filter_data = 
+				{
+				"SH",
+				"R"
+				}; // Excludes system, hidden and read-only attributes
+			}
+		};
+	}
+*/
+    
+
+// APPLICATION NAVIPANEL TITLES
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_main
+//	  Main menu title.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE NAVI_LABEL r_navititle_main
+	{
+	txt = qtn_navi_main;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_testcases
+//	  Test cases menu title.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE NAVI_LABEL r_navititle_testcases
+	{
+	txt = qtn_navi_testcases;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_startcases
+//	  Startcases menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_startcases
+	{
+	txt = qtn_navi_startcases;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_loadtestset
+//	  Startcases menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_loadtestset
+	{
+	txt = qtn_navi_load_test_set;
+	}
+
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_startedcases
+//	  Started cases menu title.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE NAVI_LABEL r_navititle_startedcases
+	{
+	txt = qtn_navi_startedcases;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_testcase_output
+//	  Test case output view title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_testcase_output
+	{
+	txt = qtn_navi_testcase_output;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_modules
+//	  Modules menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_modules
+	{
+	txt = qtn_navi_modules;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_testset_base
+//	  Testset base menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_testset_base
+	{
+	txt = qtn_navi_testset_base;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_testset
+//	  Testset menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_testset
+	{
+	txt = qtn_navi_testset;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_testset_insert
+//	  Testset insert menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_testset_insert
+	{
+	txt = qtn_navi_testset_insert;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started
+//	  Started cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE NAVI_LABEL r_navititle_started
+	{
+	txt = qtn_navi_started;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_all
+//	  All started cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_all
+	{
+	txt = qtn_navi_started_all;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_ongoing
+//	  Ongoing cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_ongoing
+	{
+	txt = qtn_navi_started_ongoing;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_paused
+//	  Paused cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_paused
+	{
+	txt = qtn_navi_started_paused;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_passed
+//	  Passed cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_passed
+	{
+	txt = qtn_navi_started_passed;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_failed
+//	  Failed cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_failed
+	{
+	txt = qtn_navi_started_failed;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_crashed_aborted
+//	  Crashed cases view menu title.
+//
+//-----------------------------------------------------------------------------
+//	
+RESOURCE NAVI_LABEL r_navititle_started_crashed_aborted
+	{
+	txt = qtn_navi_started_crashed_aborted;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_navititle_started_stats
+//	  Statistics view menu title.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE NAVI_LABEL r_navititle_started_stats
+	{
+	txt = qtn_navi_started_stats;
+	}
+
+
+// RESOURCE TEXTS
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_confirmation_question
+//	  Insert test cases confirmation query text.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STRING r_insert_confirmation_question
+	{
+	text = qtn_insert_confirmation;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_nocases_text
+//	  Infomsg text to inform user that there´s no test cases selected when 
+//    trying to insert test cases.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STRING r_insert_nocases_text
+	{
+	text = qtn_insert_none_selected;
+	}
+	
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_confirmation_question
+//	  Overwrite existing test set confirmation query text.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STRING r_overwrite_testset_question
+	{
+	text = qtn_owerwrite_testset_confirmation;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_confirmation_question
+//	  Save test set confirmation query text.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STRING r_save_testset_question
+	{
+	text = qtn_save_testset_confirmation;
+	}
+
+//-----------------------------------------------------------------------------
+//	 
+//	  r_insert_confirmation_question
+//	  Loading test set failed text.
+//
+//-----------------------------------------------------------------------------
+//
+RESOURCE STRING r_load_testset_failed
+	{
+	text = qtn_load_testset_errornote;
+	}
+
+	
+// TEST CASE STATES
+RESOURCE STRING r_testcase_state_running
+	{
+	text = qtn_testcase_state_running;
+	}
+
+RESOURCE STRING r_testcase_state_passed
+	{
+	text = qtn_testcase_state_passed;
+	}
+
+RESOURCE STRING r_testcase_state_failed
+	{
+	text = qtn_testcase_state_failed;
+	}
+
+RESOURCE STRING r_testcase_state_crashed_aborted
+	{
+	text = qtn_testcase_state_crashed_aborted;
+	}
+	
+RESOURCE STRING r_testcase_state_unknown
+	{
+	text = qtn_testcase_state_unknown;
+	}
+
+RESOURCE LOCALISABLE_APP_INFO r_stifui_localisable_app_info
+    {
+    short_caption = qtn_app_short_caption_string;
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = qtn_app_caption_string;
+        };
+    }	
+			
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/data/Stifui_reg.rss	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file defines StifUI resources.
+*
+*/
+
+#include <Stifui.rsg>
+#include <appinfo.rh>
+#if defined (__S60_)
+  #include <data_caging_paths_strings.hrh>
+#endif
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x1028311D
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "Stifui";
+    localisable_resource_file = APP_RESOURCE_DIR"\\Stifui";
+    localisable_resource_id = R_STIFUI_LOCALISABLE_APP_INFO;
+    group_name = "RnD Tools";
+    }
+
+// End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/group/Stifui.mmp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIFUI MMP file.
+*
+*/
+
+#include <platform_paths.hrh>
+
+SMPSAFE
+
+TARGET 			Stifui.exe
+TARGETTYPE 		exe
+UID             0x100039ce 0x1028311D 
+VENDORID	    0x101FB657
+SECUREID        0x102073DC
+CAPABILITY      AllFiles SwEvent CommDD
+
+START RESOURCE  ../data/Stifui.rss
+	HEADER
+	TARGETPATH  resource/apps
+END 
+
+SOURCEPATH      ../data
+START RESOURCE  ./Stifui_reg.rss
+	DEPENDS stifui.rsg
+	TARGETPATH  /private/10003a3f/apps
+END
+
+SOURCEPATH ../src
+
+
+SOURCE  AppUIApp.cpp 
+SOURCE  AppUIAppUi.cpp
+SOURCE  AppUIDocument.cpp
+SOURCE  View.cpp
+SOURCE  Container.cpp
+SOURCE  UIStoreHandler.cpp
+
+SOURCE  MainMenuView.cpp
+SOURCE  MainMenuContainer.cpp
+
+SOURCE  TestCaseMenuView.cpp
+SOURCE  TestCaseMenuContainer.cpp
+
+SOURCE  StartCasesView.cpp
+SOURCE  StartCasesContainer.cpp
+
+SOURCE  StartedCasesMenuView.cpp
+SOURCE  StartedCasesMenuContainer.cpp
+
+SOURCE  ShowStartedCasesView.cpp
+SOURCE  ShowStartedCasesContainer.cpp
+
+SOURCE  TestCaseOutputView.cpp
+SOURCE  TestCaseOutputContainer.cpp
+
+SOURCE  Testmodulesmenuview.cpp
+SOURCE  TestModulesMenuContainer.cpp
+
+SOURCE	StatisticsView.cpp
+SOURCE	StatisticsContainer.cpp
+
+SOURCE  TestSetBaseMenuView.cpp
+SOURCE  TestSetBaseMenuContainer.cpp
+
+SOURCE  TestSetMenuView.cpp
+SOURCE  TestSetMenuContainer.cpp
+
+SOURCE  TestSetInsertMenuView.cpp
+SOURCE  TestSetInsertMenuContainer.cpp
+
+SOURCE  TestSetStartedCasesView.cpp
+SOURCE  TestSetStartedCasesContainer.cpp
+
+//SOURCE  MenuListBox.cpp
+
+SOURCE  MenuListBox.cpp CreatedTestSetMenuContainer.cpp CreatedTestSetMenuView.cpp
+
+USERINCLUDE ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib
+LIBRARY apparc.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib 
+
+LIBRARY eikcoctl.lib
+LIBRARY avkon.lib
+
+LIBRARY stiftestengine.lib
+LIBRARY stiftestinterface.lib
+LIBRARY bafl.lib
+LIBRARY eikctl.lib 		// For adding icons
+LIBRARY StifTFwIf.lib 
+LIBRARY efsrv.lib
+
+LIBRARY egul.lib
+LIBRARY aknskins.lib
+LIBRARY aknicon.lib
+
+START WINS      
+// ?wins_specific_information
+END
+
+START MARM
+// ?marm_specific_information
+END
+ 
+EPOCHEAPSIZE    0x10000 0x500000
+EPOCSTACKSIZE   32768
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: bld.inf build information for STIF UI.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+// Specify the platforms your component needs to be built for here.
+// ARM4 not supported in SDK
+	
+	DEFAULT
+
+
+PRJ_EXPORTS
+// None
+
+PRJ_TESTEXPORTS
+// None
+
+PRJ_MMPFILES
+	
+	Stifui.mmp
+
+PRJ_TESTMMPFILES
+// None
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/AppUIApp.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CAppUIApp class declaration.
+*
+*/
+
+#ifndef APPUIAPP_H
+#define APPUIAPP_H
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidAppUI = { 0x1028311D };
+
+// CLASS DECLARATION
+
+/**
+* CAppUIApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CAppUIApp : public CAknApplication
+    {
+    
+    public: // Functions from base classes
+    private:
+
+        /**
+        * From CApaApplication, creates CAppUIDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidAppUI).
+        * @return The value of KUidAppUI.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/AppUIAppUi.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,222 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CAppUIAppUi class declaration.
+*
+*/
+
+#ifndef APPUIAPPUI_H
+#define APPUIAPPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <e32std.h>
+#include <aknViewAppUi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include <StifLogger.h>
+#include "Stifui.hrh"
+
+//#include "UIStoreIf.h"             
+//#include "UIStore.h"               
+//#include "UIEngine.h"              
+//#include "SettingServerClient.h"   
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <SettingServerClient.h>
+
+#include "UIStoreHandler.h"
+
+
+// FORWARD DECLARATIONS
+class CAppUIContainer;
+class CUIStoreHandler;
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+_LIT( KDefaultPathAndIni, "C:\\TestFramework\\TestFramework.ini" );
+
+// CLASS DECLARATION
+
+
+/**
+ * Class contains static methods for calling different
+ * types of message dialog boxes.
+ */
+class TMessageBoxUtil 
+	{
+	public:
+	
+	    /**
+	     * Display message that executed funtion is not implemented yet.
+	     */      
+		static void ShowNotImplementedYetL();
+
+	    /**
+	     * Display error note.
+	     * @param aMessage Error message to display.
+	     */      
+		static void ShowErrorNoteL( const TDesC& aMessage );
+	};
+
+
+/**
+* Application UI class.
+* Provides support for the following features:
+* - EIKON control architecture
+* - view architecture
+* - status pane
+* 
+*/
+class CAppUIAppUi : public CAknViewAppUi
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CAppUIAppUi();
+
+    public: // New functions
+
+        /**
+        * Returns pointer to UIStoreHandler object, 
+        * which handles test cases and test modules.
+        * @return UIStoreHandler to CData object
+        */
+        CUIStore* UIStoreHandler();
+
+        /**
+        * Shows outputs of the test case.
+        * @param aTestCase Pointer to started test case.
+        */
+        void ShowTestCaseOutput(CStartedTestCase* aTestCase);
+
+        /**
+        * Receives output update notification from CData.
+        * @param aTestCase Pointer to started test case.
+        * @param aStatus Status.
+        */
+        void OutputUpdateL( CStartedTestCase* aTestCase, TInt aStatus );
+        
+		/**
+        * Sets pointer to selected test case for viewing output.
+        * @param aStartedCase Pointer to started test case.
+        */
+        void SetStartedTestCase( CStartedTestCase* aStartedCase );   
+         
+        /**
+        * Returns pointer to started test case for viewing output.
+        * @return Poiner to started test case.
+        */
+		CStartedTestCase* GetStartedTestCase( ); 
+		
+		/**
+		 * Saves position of focus of any specific view
+		 * @param aViewId ID of view under which the position will be stored
+		 * @param aPosition is a number to be stored
+		 */
+		void SaveFocusPosition(TAppUIViewNumber aViewId, TInt aPosition);
+		
+		/**
+		 * Used to retrieve previous focus position in a specific view
+		 * @param aViewId - ID of view that the position should be retrieved for
+		 * @return the previous focus position
+		 */
+		TInt GetFocusPosition(TAppUIViewNumber aViewId);
+		
+
+    public: // Functions from base classes
+
+    private:
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+    private:
+        /**
+        * From CEikAppUi, takes care of command handling.
+        * @param aCommand command to be handled
+        */
+        void HandleCommandL(TInt aCommand);
+
+        /**
+        * From CEikAppUi, handles key events.
+        * @param aKeyEvent Event to handled.
+        * @param aType Type of the key event. 
+        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
+        */
+        virtual TKeyResponse HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,TEventCode aType);
+
+    private: //Data
+        CUIStoreHandler*                iUIStoreHandler;
+        CStartedTestCase*               iStartedTestCase;
+        TInt                            iPreviousView; // For Back function
+        
+        RArray<TInt>					iPreviousFocusPosition;	
+        // used to store positions in different views
+        
+        TBool							iPreviousPositionListValid; 
+        // used to mark validity of iPreviousFocusPosition array
+		
+    public: //Data
+        
+        /**
+        * Pointer to logger.
+        */
+        CStifLogger*                        iLogger;
+        
+        /**
+        * Mode of view started cases.
+        */
+        TInt /*enum TShowStartedCasesMode*/ iShowStartedCasesMode;
+        
+        /**
+        * Index of started test set.
+        */
+		TInt								iStartedTestSet;
+		
+	    /**
+        * Handle to Setting server.
+        */	
+		RSettingServer                      iSettingServer;
+		
+    public:     // Friend classes
+
+    protected:  // Friend classes
+
+    private:    // Friend classes
+                
+        // For iExecutedTestCaseCount moving
+        friend class CStartCasesView;
+        friend class CStatisticsView;
+        friend class CTestCaseOutputView;
+        friend class CTestSetInsertMenuView;
+        friend class CTestSetMenuView;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/AppUIDocument.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CAppUIDocument class declaration.
+*
+*/
+
+#ifndef APPUIDOCUMENT_H
+#define APPUIDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class  CEikAppUi;
+
+// CLASS DECLARATION
+
+/**
+*  CAppUIDocument application class.
+*/
+class CAppUIDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CAppUIDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CAppUIDocument();
+
+    public: // New functions
+
+    protected:  // New functions
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * Symbian OS default constructor.
+        */
+        CAppUIDocument(CEikApplication& aApp);
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CAppUIAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+    };
+
+#endif
+
+// End of File
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/Container.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,275 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseListBoxModel class
+* declaration
+*
+*/
+
+#ifndef CCONTAINER_H
+#define CCONTAINER_H
+
+#include <e32std.h>
+// Define *.mbm file name.
+_LIT(KListMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
+
+// INCLUDES
+#include "View.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h>     //  MEikListBoxObserver
+#include <bamdesca.h>   //  MDesCArray
+#include <aknsfld.h>
+
+//#include "RRefArray.h"        
+//#include "UIEngine.h"         
+//#include "UIStoreIf.h"        
+//#include "UIStoreContainer.h" 
+
+#include <stifinternal/RRefArray.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+//class CTestSetInsertMenuView;
+class CEikColumnListBox;
+class CStartedTestCase;
+
+class CUIStoreHandler;
+class CUIStore;
+class CUIStoreIf;
+class CUIEngineContainer;
+class CUIEngine;
+
+// CLASS DECLARATION
+
+class CTestCaseListBoxModel : public CBase, public MDesCArray
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CTestCaseListBoxModel();
+        
+        /**
+        * Two-phased constructor.
+        * @param aTestCasesInView Array of test cases in view.
+        * @return Pointer to created list box model.
+        */
+        static CTestCaseListBoxModel* NewL(
+            RPointerArray<CTestInfo>* aTestCasesInView);
+
+    public: // Functions from base classes
+    
+        /**
+        * Returns the number of descriptor elements in the array.
+        * @return The number of descriptor elements.
+        */
+        virtual TInt MdcaCount() const;
+        
+        /**
+        * Indexes into a descriptor array.
+        * @param aIndex The position of the descriptor element within the
+        *               array. The position is relative to zero; i.e. zero
+        *               implies the first descriptor element in the array. 
+        *               This value must be non-negative and less than the 
+        *               number of descriptors currently within the array 
+        *               otherwise the operator panics with 
+        *               EArrayIndexOutOfRange. 
+        * @return A non-modifiable pointer descriptor representing the 
+        *         descriptor element located at position aIndex within 
+        *         the array.
+        */
+        virtual TPtrC MdcaPoint( TInt aIndex ) const;
+    protected:
+        /**
+        * Symbian OS two phased constructor.
+        * Completes the construction of the object.
+        */
+        void ConstructL();
+    
+    protected: //data
+        RPointerArray<CTestInfo>*   iTestCasesInView;
+        HBufC*                      iBuffer;
+        
+    private: //data
+        
+    };
+    
+/**
+*  CContainer  container control class.
+*  
+*/
+class CContainer : public CCoeControl
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CContainer();
+
+    public: // New functions
+    
+        /**
+        * Show only testcases which are defined is specified module.
+        * @param aModuleName Module which test cases are shown.
+        */
+        virtual void FilterCasesByModuleL(TName aModuleName);
+        
+        /**
+        * Show only testcases which are defined in specified test case file.
+        * @param aTestCaseFileName Test cases file name.
+        */
+        virtual void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
+        
+        /**
+        * Remove possible filtering of test cases -> show all test cases.
+        */
+        virtual void NoFilteringL();
+        
+        /**
+        * Returns pointers to selected test cases.
+        * @param aSelectedTestCases Currently selected test case.
+        */
+        virtual void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases);
+
+        /**
+        * Returns pointers to currently (in list box) selected test cases info.
+        * @return Currently selected test case info.
+        */
+        virtual CTestInfo* SelectedTestCaseInfo();
+        
+        /**
+        * Returns pointers to selected test cases info.
+        * @param aIndex test case index
+        * @return Currently selected test case info.
+        */
+        virtual CTestInfo* TestCaseInfo( TInt aIndex );
+        
+        /**
+        * Sets graphic icon using listbox as CEikColumnListBox.
+        * @param aListBox Pointer to list box.
+        */
+        virtual void SetGraphicIconL( CEikColumnListBox* aListBox );
+
+        /**
+        * Appends graphics data.
+        * @param aIcons Pointer array of icons.
+        */
+        virtual void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );
+        
+        /**
+        * Gets the index number of the current item in the view.
+        * @return Index number of the current item.
+        */
+        virtual TInt CurrentItemIndex();
+        
+        /**
+        * Sets the current item.
+        * @param aIndex Index of the item to make current.
+        */
+        virtual void SetCurrentItemIndex(TInt aCurrentTestCase);
+		
+		/**
+		* Inline function for getting pointer to list box.
+		* @return Pointer to list box.
+		*/
+		virtual inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; };
+		
+		
+		
+		/**
+		* Processes user commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		virtual void ProcessCommandL( TInt  aCommand );
+		
+		/**
+		* Processes user commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		virtual void SelectionListProcessCommandL( TInt  aCommand );
+		
+		/**
+		* Handles mark commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		virtual void HandleMarkCommandL( TInt aCommand );
+		
+		
+		
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        virtual void SizeChanged();
+
+
+
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        virtual TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        virtual CCoeControl* ComponentControl(TInt aIndex) const;
+
+
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        virtual void Draw(const TRect& aRect) const;
+        
+    protected: //data
+        
+        CView*                          iParentView;
+        CEikColumnListBox*              iListBox;
+        //CEikTextListBox*                iListBox;
+        CTestCaseListBoxModel*          iListBoxModel;
+        RPointerArray<CTestInfo>        iTestCasesInView;
+        CUIStore*                       iUIStore;
+                        
+    private: //data
+        
+    };
+
+#endif // CTestSetInsertMenuContainer_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/CreatedTestSetMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CCreatedTestSetMenuContainer
+* class declaration.
+*
+*/
+
+#ifndef CREATETESTSETMENUCONTAINER_H
+#define CREATETESTSETMENUCONTAINER_H
+
+// INCLUDES
+#include "Container.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h> // MEikListBoxObserver
+#include <bamdesca.h> // MDesCArray
+#include <aknsfld.h>
+
+#include <stifinternal/RRefArray.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+class CCreatedTestSetMenuView;
+class CEikColumnListBox;
+class CStartedTestCase;
+
+class CUIStoreHandler;
+class CUIStore;
+class CUIStoreIf;
+class CUIEngineContainer;
+class CUIEngine;
+
+// CLASS DECLARATION
+/**
+*  CCreatedTestSetMenuContainer  container control class.
+*  
+*/
+class CCreatedTestSetMenuContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CCreatedTestSetMenuContainer();
+
+    public: // New functions
+        
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+        
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+        
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		        
+    private: //data
+        
+        CCreatedTestSetMenuView*            iParentView;
+    };
+
+#endif // CREATETESTSETMENUCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/CreatedTestSetMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CCreatedTestSetMenuView class
+* declaration.
+*
+*/
+
+#ifndef CREATEDTESTSETSETMENUVIEW_H
+#define CREATEDTESTSETSETMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CCreatedTestSetMenuContainer;
+
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuView view class.
+* 
+*/
+class CCreatedTestSetMenuView : public CView, public MEikListBoxObserver //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CCreatedTestSetMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box.
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+    public: // New functions
+        
+     
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    
+    private: // New functions
+        
+        /**
+        * Checks listbox selections and launches 
+        * query dialog to start test cases.
+        * @param aListBox Pointer to listbox.
+        */
+        void CheckListBoxSelectionsL(CEikListBox* aListBox);
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CCreatedTestSetMenuContainer*       iContainer;
+        TInt                        iCurrentTestCase;
+        TBufC<50>                   iCurrentTestSet;
+        TBool                       iSaveNeeded;
+    };
+
+#endif //CREATEDTESTSETSETMENUVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/MainMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,127 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMainMenuContainer class definition.
+*
+*/
+
+#ifndef CMAINMENUCONTAINER_H
+#define CMAINMENUCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+
+// CLASS DECLARATION
+
+/**
+*  CMainMenuContainer  container control class.
+*  
+*/
+class CMainMenuContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CMainMenuContainer();
+
+    public: // New functions
+    
+        /**
+        * Get currently selected items index.
+        * @return Current item index.
+        */		
+		TInt GetActiveLine();   
+		
+		/**
+		 * Makes the iListBox store its focus position to CAppUiAppUi object
+		 */
+		void SaveActiveLine();
+
+    public: // Functions from base classes
+   
+        /**
+        * Method HandleSelectedListItemL handles valix index.
+        * @param aIndex Current item index.
+        */
+        void HandleSelectedListItemL( TInt aIndex );    
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * @return Number of controls indside this container.
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets the specified component of a compound control.
+        * @param aIndex The index of the control to get.
+        * @return The component control with an index of aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates 
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * Handles list box events.
+        * @param aListBox The originating list box. 
+        * @param aEventType A code for the event. Further information may be
+        *                   obtained by accessing the list box itself.
+        */
+		void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		
+        
+    private: //data
+        
+		CEikTextListBox*    iListBox;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/MainMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMainMenuView class declaration.
+*
+*/
+
+#ifndef MAINMENUVIEW_H
+#define MAINMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <aknnavide.h> 
+
+// CONSTANTS
+// UID of view
+const TUid KMainMenuViewId = {1};
+
+// FORWARD DECLARATIONS
+class CMainMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CMainMenuView view class.
+* 
+*/
+class CMainMenuView : public CView //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CMainMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+    private:
+        
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CMainMenuContainer*         iContainer;
+        CAknNavigationDecorator*    iNaviDecorator;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/MenuListBox.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMenuListBox class declaration.
+*
+*/
+
+#ifndef MENULISTBOX_H_
+#define MENULISTBOX_H_
+
+// INCLUDES
+#include <eiktxlbx.h>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+#include <aknview.h>
+#include <aknlists.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  CMenuListBox class. Has ability to store and retrieve previous focus position
+*/
+class CMenuListBox : public CAknSingleStyleListBox
+    {
+    public: // Constructors and destructor
+
+        static CMenuListBox* NewL(TAppUIViewNumber aViewId);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMenuListBox();
+        
+        /**
+         * Sets focus on last chosen position
+         */
+        void SetPreviousFocus();
+        
+        /**
+         * Saves position of focus to CAppUiAppUi object
+         */
+        void SaveFocusPosition();
+        
+    private: // Constructors and destructor
+    
+    	CMenuListBox(TAppUIViewNumber aViewId);
+    	
+    	/**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+    public: // Functions from base classes
+
+    private:
+
+    private: // Data
+    	const TAppUIViewNumber	iViewId;
+    };
+
+#endif /*MENULISTBOX_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/ShowStartedCasesContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,252 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedTestsListBoxModel class
+* declaration.
+*
+*/
+
+#ifndef CSHOWSTARTEDCASESCONTAINER_H
+#define CSHOWSTARTEDCASESCONTAINER_H
+
+// INCLUDES
+#include "Container.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h>
+#include <bamdesca.h> // MDesCArray
+
+//#include "RRefArray.h" 
+#include <stifinternal/RRefArray.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CAknSingleGraphicStyleListBox;
+class CDesC16ArrayFlat;
+class CStartedTestCase;
+class CUIStore;
+
+// CLASS DECLARATION
+
+class CStartedTestsListBoxModel : public CTestCaseListBoxModel //public CBase, public MDesCArray
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CStartedTestsListBoxModel();
+        
+        /**
+        * Two-phased constructor.
+        * @param aTestsInView Array of test cases in view.
+        * @return Pointer to created list box model.
+        */
+        static CStartedTestsListBoxModel* NewL(
+                            RRefArray<CStartedTestCase>* aTestsInView);
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns the number of descriptor elements in the array.
+        * @return The number of descriptor elements.
+        */
+        TInt MdcaCount() const;
+        
+        /**
+        * Indexes into a descriptor array.
+        * @param aIndex The position of the descriptor element within the
+        *               array. The position is relative to zero; i.e. zero
+        *               implies the first descriptor element in the array. 
+        *               This value must be non-negative and less than the 
+        *               number of descriptors currently within the array 
+        *               otherwise the operator panics with 
+        *               EArrayIndexOutOfRange. 
+        * @return A non-modifiable pointer descriptor representing the 
+        *         descriptor element located at position aIndex within 
+        *         the array.
+        */
+        TPtrC MdcaPoint(TInt aIndex) const;
+
+    private:
+
+        /**
+        * Symbian OS two phased constructor.
+        * Completes the construction of the object.
+        */
+        void ConstructL();
+
+    private: //data
+        RRefArray<CStartedTestCase>*        iTestCasesInView;
+    };
+
+/**
+*  CShowStartedCasesContainer  container control class.
+*  
+*/
+class CShowStartedCasesContainer : public CContainer //public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        * @return Observer for list box.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CShowStartedCasesContainer();
+
+    public: // New functions
+        
+        /**
+        * Show only testcases which are defined is specified module.
+        * @param aModuleName Module which test cases are shown.
+        */
+        void FilterCasesByModuleL(TName aModuleName);
+        
+        /**
+        * Show only testcases which are defined in specified test case file.
+        * @param aTestCaseFileName Test cases file name.
+        */
+        void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
+        
+        /**
+        * Remove possible filtering of test cases -> show all test cases.
+        */
+        void NoFilteringL();
+        
+        /**
+        * Returns reference to currently selected test case in view (listbox).
+        * @return Currently selected test case.
+        */
+        CStartedTestCase* SelectedTestCase();
+        
+        /**
+        * Constructs list box model without any filtering.
+        */
+        void ConstructListBoxModelL();
+        
+        /**
+        * Draws the list box.
+        */
+        void DrawListBox();
+        
+        /**
+        * Returns count of test cases in view.
+        * @return Count of test cases in view.
+        */
+        TInt TestsInViewCount();
+        
+        /**
+        * Handles the addition of an item to the model.
+        */
+        void HandleItemAdditionL();
+        
+        /**
+        * Handles the removal of an item from the model.
+        */
+        void HandleItemRemovalL();
+        
+        /**
+        * Returns pointer to currently selected test case.
+        * @param Current test case.
+        */
+        CStartedTestCase* CurrentTestCase();
+        
+        /**
+        * Sets the current item.
+        * @param aIndex Index of the item to make current.
+        */
+        void SetCurrentItemIndex(TInt aIndex);
+        
+        /**
+        * Resets the selection indices, top and current item indices,
+        * the selection, and the horizontal scroll offset of this list box.
+        * This function does not redraw the list box.
+        */
+        void ResetListBox();
+        
+        /**
+        * Removes items from list box.
+        */
+        void RemoveSelectedExecutionsL();
+        
+        /**
+        * Removes all started test cases from list box.
+        */
+        void RemoveAllExecutionsInViewL();
+        
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+
+    private: // New functions
+
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	
+    private: //data
+        
+        CStartedTestsListBoxModel*  iListBoxModel;    
+        RRefArray<CStartedTestCase> iStartedTestsPtrs;
+    };
+
+#endif // CSHOWSTARTEDCASESCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/ShowStartedCasesView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CShowStartedCasesView class 
+* declaration.
+*
+*/
+
+#ifndef SHOWSTARTEDCASESVIEW_H
+#define SHOWSTARTEDCASESVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h>     // MEikListBoxObserver
+#include <aknnavide.h>  //CAknNavigationDecorator
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CShowStartedCasesContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CShowStartedCasesView view class.
+* 
+*/
+class CShowStartedCasesView : public CView, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CShowStartedCasesView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box (not used).
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
+
+    public: // New functions
+        
+        /**
+        * Handles status changes of test cases in view.
+        */
+        void TestCaseStateChangedL();
+        
+        /**
+        * Handles call to view test case´s output data.
+        */
+        void ViewTestCaseOutputL();
+
+    private:
+    
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /** From MEikMenuObserver
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+        
+        /**
+        * Refreshes view name shown in the navi pane.
+        */
+        void RefreshNaviTitleL();
+
+    private: // Data
+        CShowStartedCasesContainer* iContainer;
+        CAknNavigationDecorator*    iNaviDecorator;
+        TName                       iFilterModule;
+        TFileName                   iFilterTestCaseFile;
+        TInt                        iSelectedTestCase; // Which testcase was 
+                                                       // selected when view 
+                                                       // was active earlier.
+    };
+
+#endif //SHOWSTARTEDCASESVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StartCasesContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartCasesContainer class 
+* declaration.
+*
+*/
+
+#ifndef CSTARTCASESCONTAINER_H
+#define CSTARTCASESCONTAINER_H
+
+// INCLUDES
+#include "Container.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h> // MEikListBoxObserver
+#include <bamdesca.h> // MDesCArray
+#include <aknsfld.h>
+
+//#include "RRefArray.h"        
+//#include "UIEngine.h"         
+//#include "UIStoreIf.h"        
+//#include "UIStoreContainer.h" 
+
+#include <stifinternal/RRefArray.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+class CStartCasesView;
+class CEikColumnListBox;
+class CStartedTestCase;
+
+class CUIStoreHandler;
+class CUIStore;
+class CUIStoreIf;
+class CUIEngineContainer;
+class CUIEngine;
+
+// CLASS DECLARATION
+/**
+*  CStartCasesContainer  container control class.
+*  
+*/
+class CStartCasesContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CStartCasesContainer();
+
+    public: // New functions
+        
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+        
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+        
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		        
+    private: //data
+        
+        CStartCasesView*            iParentView;
+    };
+
+#endif // CSTARTCASESCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StartCasesView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartCasesView class declaration.
+*
+*/
+
+#ifndef STARTCASESVIEW_H
+#define STARTCASESVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CStartCasesContainer;
+
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuView view class.
+* 
+*/
+class CStartCasesView : public CView, public MEikListBoxObserver //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CStartCasesView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box.
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+    public: // New functions
+        
+        /** 
+        * Starts test case.
+        */
+        void StartTestCaseL();
+        
+        /**
+        * Starts multiple test cases.
+        * @param aSelectedÍndexes Indexes of selected test cases.
+        */
+        void StartTestCasesL( RArray<TInt> aSelectedIndexes );
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+    
+    private: // New functions
+        
+        /**
+        * Checks listbox selections and launches 
+        * query dialog to start test cases.
+        * @param aListBox Pointer to listbox.
+        */
+        void CheckListBoxSelectionsL(CEikListBox* aListBox);
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CStartCasesContainer*       iContainer;
+        TInt                        iCurrentTestCase;
+    };
+
+#endif //STARTCASESVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StartedCasesMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedCasesMenuContainer class
+* declaration.
+*
+*/
+
+#ifndef CSTARTEDCASESMENUCONTAINER_H
+#define CSTARTEDCASESMENUCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+
+// CLASS DECLARATION
+
+/**
+*  CStartedCasesMenuContainer  container control class.
+*  
+*/
+class CStartedCasesMenuContainer : public CCoeControl , public MEikListBoxObserver  /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect );
+
+        /**
+        * Destructor.
+        */
+        ~CStartedCasesMenuContainer();
+
+    public: // New functions
+    
+        /**
+        * Get currently selected items index.
+        * @return Current item index.
+        */			
+		TInt GetActiveLine();   
+
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+		void SaveActiveLine();
+		
+    public: // Functions from base classes
+    
+        /**
+        * Method HandleSelectedListItemL handles valix index.
+        * @param        TInt aIndex
+        * @return       nothing
+        */
+        void HandleSelectedListItemL( TInt aIndex );        
+
+    private: // Functions from base classes
+        
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+       
+        /**
+        * Handles list box events.
+        * @param aListBox The originating list box. 
+        * @param aEventType A code for the event. Further information may be
+        *                   obtained by accessing the list box itself.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		
+        
+    private: //data
+        
+		CEikTextListBox*    iListBox;
+    };
+
+#endif // CSTARTEDCASESMENUCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StartedCasesMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedCasesMenuView class
+* declaration.
+*
+*/
+
+#ifndef STARTEDCASESMENUVIEW_H
+#define STARTEDCASESMENUVIEW_H
+
+// INCLUDES
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+#include "View.h"
+
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CStartedCasesMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CStartedCasesMenuView view class.
+* 
+*/
+class CStartedCasesMenuView : public CView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CStartedCasesMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CStartedCasesMenuContainer* iContainer;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StatisticsContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStatisticsContainer class
+* declaration.
+*
+*/
+
+#ifndef CSTATISTICSCONTAINER_H
+#define CSTATISTICSCONTAINER_H
+
+// INCLUDES
+#include "Container.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h>     // MEikListBoxObserver
+#include <bamdesca.h>   // MDesCArray
+#include <aknsfld.h>
+
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+class CStartCasesView;
+class CEikColumnListBox;
+
+// CLASS DECLARATION
+/**
+*  StatisticsContainer container control class.
+*  
+*/
+class CStatisticsContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CStatisticsContainer();
+
+    public: // New functions
+
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		        
+    private: //data
+        
+        CStartCasesView*            iParentView;
+        CDesC16ArrayFlat*           iTestCaseArray;
+    };
+
+#endif // CSTATISTICSCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/StatisticsView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStatisticsView class declaration.
+*
+*/
+
+#ifndef STATISTICSVIEW_H
+#define STATISTICSVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CStatisticsContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuView view class.
+* 
+*/
+class CStatisticsView : public CView, public MEikListBoxObserver //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CStatisticsView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box.
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+    public: // New functions
+
+        /** 
+        * Starts test case.
+        */
+        void StartTestCasesL();
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /** From MEikMenuObserver
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CStatisticsContainer*       iContainer;
+        TInt                        iCurrentTestCase;
+    };
+
+#endif //STATISTICSVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/Stifui.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: Const definitions file.
+*
+*/
+
+#ifndef STIF_UI_HRH
+#define STIF_UI_HRH
+
+enum TAppUICommandIds
+    {
+    EAppUIGoBack = 1,
+    EAppUIGoToMainMenu,
+    EAppUIGoToTestCaseMenu,
+    EAppUIGoToModulesMenu,
+    EAppUIGoToTestSetsMenu,
+	ECmdGoToStartCasesView,
+	ECmdGoToStartedCasesView,
+    ECmdShowStartedTestSet,
+    ECmdCreateTestSet,
+    ECmdLoadTestSet,
+    ECmdStartTestSet,
+    ECmdSaveTestSet,
+    ECmdInsertTestCases,
+    ECmdRemoveTestCases,
+	ECmdFilterCases,
+	ECmdMarkMenu,
+    ECmdInsertSelectedCases,
+    ECmdShowSetMenu,
+	ECmdStartCases,
+	ECmdShowAllStartedCases,
+	ECmdShowOngoingCases,
+	ECmdShowPassedCases,
+	ECmdShowFailedCases,
+	ECmdShowPausedCases,
+	ECmdShowCrashedAbortedCases,
+	ECmdShowStatistics,
+    ECmdViewOutput,
+	ECmdPauseTestCase,
+	ECmdResumeTestCase,
+	ECmdAbortTestCase,
+	ECmdRemoveExecution,
+	ECmdRemoveAllExecutions,
+	ECmdOpenModule,
+	ECmdAddModule,
+	ECmdRemoveModule,
+    ECmdFilterMenu,
+    ECmdShowAbout,
+	ECmdFilterByModule = 0x1000,
+	ECmdFilterByTestCaseFile = 0x2000,
+	ECmdNOFiltering = 0x3000,
+	ECmdGoToTestSetView
+    };
+
+
+enum TAppUITabViewId
+    {
+	ETestCaseMenuTab = 1,
+    ETestModulesMenuTab,
+    ETestSetsMenuTab
+    };
+ 
+// Application view ids.
+enum TAppUIViewNumber
+	{
+    EMainMenuViewId = 1,
+    ETestCaseMenuViewId,
+    EStartCaseMenuViewId,
+    EStartedCasesMenuViewId,
+    ETestModulesMenuViewId,
+    ETestSetBaseMenuViewId,
+    ETestSetMenuViewId,
+    ETestSetInsertMenuViewId,
+    ETestSetStartedCasesViewId,
+    ETestSetsMenuViewId, /*???*/
+    EShowStartedCasesViewId,
+    EShowStatisticsViewId,
+	ETestCaseOutputViewId,
+	EStatisticsViewId,
+	ECreatedTestSetMenuViewId
+	};
+
+enum TPanic
+    {
+    EModuleIndexOutOfBound,
+    EShowCasesOutOfSync
+    };
+
+enum TShowStartedCasesMode
+    {
+    EShowAllStartedCases,
+    EShowOngoingCases,
+    EShowPausedCases,
+    EShowPassedCases,
+    EShowFailedCases,
+    EShowCrashedAbortedCases,
+    EShowStatistics
+    };
+
+#endif      // STIF_UI_HRH
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/Stifui_loc.hrh	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains localized strings.
+*
+*/
+
+// LOCALISATION STRINGS
+
+//#define qtn_testcase_menu_tab           "Cases"
+//#define qtn_testmodules_menu_tab        "Modules"
+//#define qtn_testsets_menu_tab           "Sets"
+
+// Main menu
+#define qtn_mainmenulist_test_cases     "\tTest Cases"
+#define qtn_mainmenulist_modules        "\tModules"
+#define qtn_mainmenulist_test_sets      "\tTest Sets"
+
+// Test cases menu
+#define qtn_testcasemenu_startcase      "\tStart Case(s)"
+#define qtn_testcasemenu_startedcases   "\tStarted Cases"
+
+// Started cases menu
+#define qtn_startedcases_allcases       "\tAll Started Cases"
+#define qtn_startedcases_ongoing        "\tOngoing Cases"
+#define qtn_startedcases_paused         "\tPaused Cases"
+#define qtn_startedcases_passed         "\tPassed Cases"
+#define qtn_startedcases_failed         "\tFailed Cases"
+#define qtn_startedcases_crashed_aborted        "\tCrashed/Aborted Cases"
+#define qtn_startedcases_statistics     "\tStatistics"
+
+// Modules menu
+#define qtn_open_module                 "Open module"
+#define qtn_add_module                  "Load all module(s)"
+#define qtn_remove_module               "Remove module"
+
+// Test set menu.
+#define qtn_testsetbasemenu_createtestset	"\tCreate test set"
+#define qtn_testsetbasemenu_loadtestset		"\tLoad test set"
+#define qtn_owerwrite_testset_confirmation	"Test set already created. Do you want to overwrite it?"
+#define qtn_save_testset_confirmation       "Save current test?"//changes for STIF-451
+#define qtn_load_testset_errornote          "Error loading test set."
+
+#define qtn_testsetinsert_add_selected  "Add selected"
+#define qtn_insert_confirmation			"Add selected test case(s) to test set?"
+#define qtn_insert_none_selected        "No test cases selected."
+
+#define qtn_testset_started_menu        "Show"
+#define qtn_testset_set_menu            "Set"
+
+#define qtn_testset_started_allcases    "Started Cases"
+#define qtn_testset_started_ongoing     "Ongoing Cases"
+#define qtn_testset_started_paused      "Paused Cases"
+#define qtn_testset_started_passed      "Passed Cases"
+#define qtn_testset_started_failed      "Failed Cases"
+#define qtn_testset_started_crashed_aborted     "Crashed/Aborted Cases"
+
+#define qtn_filter_test_cases           "Filter"
+#define qtn_by_module                   "By module"
+#define qtn_by_testcasefile             "By test case file"
+
+// Test case operations and menu texts
+#define qtn_markmenu_title				"Mark/Unmark"
+#define qtn_markmenu_mark				"Mark"
+#define qtn_markmenu_unmark				"Unmark"
+#define qtn_markmenu_markall			"Mark All"
+#define qtn_markmenu_unmarkall			"Unmark All"
+#define qtn_mark_test_case              "Mark"
+#define qtn_unmark_test_case            "Unmark"
+
+#define qtn_filter_menu                 "Filtering"
+#define qtn_filter_by_modules 		    "Filter by module"
+#define qtn_filter_by_test_case_file 	"Filter by test case file"
+#define qtn_no_filtering 		        "No filtering"
+
+
+//#define qtn_remove_execution            "Remove execution"
+//#define qtn_remove_all_executions       "Remove all executions"
+#define qtn_testcase_control_menu       "Test case control"
+#define qtn_view_output                 "View ouput of case"
+#define qtn_pause_testcase              "Pause"
+#define qtn_resume_testcase             "Resume"
+#define qtn_abort_testcase              "Abort"
+
+#define qtn_exit                        "Exit"
+
+// Start test cases queries.
+#define qtn_start_test_cases            "Start Case(s)"
+#define qtn_starting_test_case          "Start test?"
+#define qtn_starting_test_cases         "Start tests?"
+
+#define qtn_start                       "Start"
+#define qtn_start_and_view_output       "Start and view output"
+
+#define qtn_start_test					"Start"
+#define qtn_start_test_output			"Start&view output"
+#define qtn_start_tests_parallel		"Parallel"
+#define qtn_start_tests_serial			"Sequential"
+
+// example caption strings for app
+#define qtn_app_caption_string          "STIF UI"
+#define qtn_appui_demo              	"Demo"
+
+#define qtn_app_short_caption_string    "STIF UI"
+
+// Navipanel titles
+#define qtn_navi_load_test_set			"Load Test Set"
+#define qtn_navi_main					"Main menu"
+#define qtn_navi_testcases				"Test cases menu"
+#define qtn_navi_startcases				"Start cases"
+#define qtn_navi_startedcases			"Started cases"
+#define qtn_navi_testcase_output		"Test case output"
+#define qtn_navi_modules				"Modules menu"
+#define qtn_navi_testset_base			"Test set menu"
+#define qtn_navi_testset				"Test set"
+#define qtn_navi_testset_insert			"Insert test case"
+
+#define qtn_navi_started    			"Started cases"
+#define qtn_navi_started_all			"All started cases"
+#define qtn_navi_started_ongoing		"Ongoing cases"
+#define qtn_navi_started_paused			"Paused cases"
+#define qtn_navi_started_passed			"Passed cases"
+#define qtn_navi_started_failed			"Failed cases"
+#define qtn_navi_started_crashed_aborted		"Crashed/Aborted cases"
+#define qtn_navi_started_stats			"Statistics"
+
+// Test case states
+#define qtn_testcase_state_running      "Running"
+#define qtn_testcase_state_passed       "Passed"
+#define qtn_testcase_state_failed       "Failed"
+#define qtn_testcase_state_crashed_aborted      "Crashed/Aborted"
+#define qtn_testcase_state_unknown      "Undefined state!"
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestCaseMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseMenuContainer class 
+* declaration.
+*
+*/
+
+#ifndef CTESTCASEMENUCONTAINER_H
+#define CTESTCASEMENUCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuContainer  container control class.
+*  
+*/
+class CTestCaseMenuContainer : public CCoeControl, public MEikListBoxObserver  /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CTestCaseMenuContainer();
+
+    public: // New functions
+
+        /**
+        * Get currently selected items index.
+        * @return Current item index.
+        */	
+		TInt GetActiveLine();
+		
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+		void SaveActiveLine();
+    
+    public: // Functions from base classes
+     
+        /**
+        * Method HandleSelectedListItemL handles valix index.
+        * @param        TInt aIndex
+        * @return       nothing
+        */
+        void HandleSelectedListItemL( TInt aIndex );      
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+       
+        /**
+        * Handles list box events.
+        * @param aListBox The originating list box. 
+        * @param aEventType A code for the event. Further information may be
+        *                   obtained by accessing the list box itself.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		        
+    private: //data
+        
+		CEikTextListBox*    iListBox;
+    };
+
+#endif // CTESTCASEMENUCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestCaseMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,96 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseMenuView class 
+* declaration.
+*
+*/
+
+#ifndef TESTCASEMENUVIEW_H
+#define TESTCASEMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <aknnavide.h> 
+
+
+// CONSTANTS
+// UID of view
+const TUid KTestCaseMenuViewId = {2};
+
+// FORWARD DECLARATIONS
+class CTestCaseMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuView view class.
+* 
+*/
+class CTestCaseMenuView : public CView //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestCaseMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+        
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestCaseMenuContainer*     iContainer;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestCaseOutputContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestOutputListBoxModel class
+* declaration.
+*
+*/
+
+#ifndef TESTCASEOUTPUTCONTAINER_H
+#define TESTCASEOUTPUTCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+#include <bamdesca.h>   // MDesCArray
+
+// #include "RRefArray.h"  
+#include <stifinternal/RRefArray.h>
+
+
+// Define *.mbm file name.
+_LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
+
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CAknSingleGraphicStyleListBox;
+class CDesC16ArrayFlat;
+class CStartedTestCase;
+
+class CUIStore;
+
+// CLASS DECLARATION
+
+class CTestOutputListBoxModel : public CBase, public MDesCArray
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CTestOutputListBoxModel();
+        
+        /**
+        * Two-phased constructor.
+        * @param aStartedTestCase Pointer to started test case.
+        * @return Pointer to created list box model.
+        */
+        static CTestOutputListBoxModel* NewL(CStartedTestCase* aStartedTestCase);
+
+    public: // Functions from base classes
+    
+        /**
+        * Returns the number of descriptor elements in the array.
+        * @return The number of descriptor elements.
+        */
+        TInt MdcaCount() const;
+        
+        /**
+        * Indexes into a descriptor array.
+        * @param aIndex The position of the descriptor element within the
+        *               array. The position is relative to zero; i.e. zero
+        *               implies the first descriptor element in the array. 
+        *               This value must be non-negative and less than the 
+        *               number of descriptors currently within the array 
+        *               otherwise the operator panics with 
+        *               EArrayIndexOutOfRange. 
+        * @return A non-modifiable pointer descriptor representing the 
+        *         descriptor element located at position aIndex within 
+        *         the array.
+        */
+        TPtrC MdcaPoint(TInt aIndex) const;
+
+    private:
+        /**
+        * Symbian OS two phased constructor.
+        * Completes the construction of the object.
+        */
+        void ConstructL();
+
+    private: //data
+        CStartedTestCase* iStartedTestCase;
+        HBufC*            iBuffer;
+
+    };
+
+/**
+*  CTestCaseOutputContainer  container control class.
+*  
+*/
+class CTestCaseOutputContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        //void ConstructL(const TRect& aRect, TInt aExecutedTestCaseCount );
+        void ConstructL(const TRect& aRect, CStartedTestCase* aStartedTestCase );
+
+        /**
+        * Destructor.
+        */
+        ~CTestCaseOutputContainer();
+
+    public: // New functions
+        /**
+        * Handles addition of item to list box.
+        */
+        void OutputUpdateL();
+
+    private:
+
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+    
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+       
+        /**
+        * Handles list box events.
+        * @param aListBox The originating list box. 
+        * @param aEventType A code for the event. Further information may be
+        *                   obtained by accessing the list box itself.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+        
+    private: //data
+        
+        CEikTextListBox*            iListBox;
+        CTestOutputListBoxModel*    iListBoxModel;
+        CUIStore*                   iUIStore;
+
+    };
+
+#endif // TESTCASEOUTPUTCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestCaseOutputView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseOutputView class 
+* declaration.
+*
+*/
+
+#ifndef TESTCASEOUTPUTVIEW_H
+#define TESTCASEOUTPUTVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <aknnavide.h> 
+
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestCaseOutputContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseOutputView view class.
+* 
+*/
+class CTestCaseOutputView : public CView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestCaseOutputView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+    public: // New functions
+        
+        /**
+        * Receives output update notification from AppUI
+        * @param aTestCase A pointer to started test case.
+        */
+        void OutputUpdateL( CStartedTestCase* aTestCase );
+
+        /**
+        * Prints test case state to title pane
+        */
+        void PrintTestCaseStateL();
+
+        /**
+        * Handles test case state changed notification
+        */
+        void TestCaseStateChangedL();
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /** From MEikMenuObserver
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID
+        * @param aMenuPane Menu pane pointer
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestCaseOutputContainer*   iContainer;
+        CStartedTestCase* 			iCurrentTestCase;
+
+    };
+
+#endif //SHOWSTARTEDCASESVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestModulesMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,169 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestModulesListBoxModel class 
+* declaration.
+*
+*/
+
+#ifndef CTESTMODULESMENUCONTAINER_H
+#define CTESTMODULESMENUCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+// #include "RRefArray.h" 
+#include <stifinternal/RRefArray.h>
+
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CUIStore;
+
+// CLASS DECLARATION
+class CTestModulesListBoxModel : public CBase, public MDesCArray
+    {
+    public:
+        /**
+        * Destructor.
+        */
+        ~CTestModulesListBoxModel();
+
+        /**
+        * Two-phased constructor.
+        * @param aTestModules Array of test modules names.
+        * @return Pointer to created list box model.
+        */
+        static CTestModulesListBoxModel* NewL(RRefArray<TDesC> aTestModules);
+
+    public: // Functions from base classes
+    
+        /**
+        * Returns the number of descriptor elements in the array.
+        * @return The number of descriptor elements.
+        */
+        TInt MdcaCount() const;
+        
+        /**
+        * Indexes into a descriptor array.
+        * @param aIndex The position of the descriptor element within the
+        *               array. The position is relative to zero; i.e. zero
+        *               implies the first descriptor element in the array. 
+        *               This value must be non-negative and less than the 
+        *               number of descriptors currently within the array 
+        *               otherwise the operator panics with 
+        *               EArrayIndexOutOfRange. 
+        * @return A non-modifiable pointer descriptor representing the 
+        *         descriptor element located at position aIndex within 
+        *         the array.
+        */
+        TPtrC MdcaPoint(TInt aIndex) const;
+
+    private:
+        /**
+        * Symbian OS two phased constructor.
+        * Completes the construction of the object.
+        */
+        void ConstructL();
+
+    private: //data
+        RRefArray<TDesC>            iTestModules;
+        HBufC*                      iBuffer;
+    };
+
+/**
+*  CTestModulesMenuContainer  container control class.
+*  
+*/
+class CTestModulesMenuContainer : public CCoeControl
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CTestModulesMenuContainer();
+
+    public: // New functions
+
+        /**
+        * Gets the index number of the current item in the view.
+        * @return Index number of the current item.
+        */
+        TInt CurrentItemIndex();
+
+    public: // New functions
+    	
+	    /**
+	     * Stores current position of focus of iListBox to the CAppUiAppUi object
+	     */
+    	void SaveActiveLine();
+
+    private: // Functions from base classes
+
+       /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+        
+    private: //data
+        
+		CEikTextListBox*            iListBox;
+        CTestModulesListBoxModel*   iListBoxModel;
+        CUIStore*                   iUIStore;
+        RRefArray<TDesC>            iModules;
+    };
+
+#endif // CTESTMODULESMENUCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestModulesMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestModulesMenuView class
+* declaration.
+*
+*/
+
+#ifndef TESTMODULEMENUVIEW_H
+#define TESTMODULEMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestModulesMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestModulesMenuView view class.
+* 
+*/
+class CTestModulesMenuView : public CView, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestModulesMenuView();
+
+    public: // Functions from base classes
+        
+         /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box (not used).
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
+        
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestModulesMenuContainer*  iContainer;
+    };
+
+#endif // TESTMODULEMENUVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetBaseMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetBaseMenuContainer 
+* class declaration.
+*
+*/
+
+#ifndef CTestSetBaseMenuContainer_H
+#define CTestSetBaseMenuContainer_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+
+   
+// FORWARD DECLARATIONS
+//class CEikLabel;        // for example labels
+class CEikTextListBox;
+
+// CLASS DECLARATION
+
+/**
+*  CTestSetBaseMenuContainer  container control class.
+*  
+*/
+class CTestSetBaseMenuContainer : public CCoeControl
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        * @return Observer for list box.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetBaseMenuContainer();
+
+    public: // New functions
+
+        /**
+        * Get currently selected items index.
+        * @return Current item index.
+        */		
+		TInt GetActiveLine();    
+		
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+		void SaveActiveLine();
+    
+    public: // Functions from base classes
+     
+        /**
+        * Method HandleSelectedListItemL handles valix index.
+        * @param        TInt aIndex
+        * @return       nothing
+        */
+        void HandleSelectedListItemL( TInt aIndex );      
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+		
+        
+    private: //data
+        
+		CEikTextListBox*    iListBox;
+    };
+
+#endif // CTestSetBaseMenuContainer_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetBaseMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetBaseMenuView class declaration.
+*
+*/
+
+#ifndef TESTSETBASEMENUVIEW_H
+#define TESTSETBASEMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestSetBaseMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestSetBaseMenuView view class.
+* 
+*/
+class CTestSetBaseMenuView : public CView, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetBaseMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box.
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestSetBaseMenuContainer*  iContainer;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetInsertMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetInsertMenuContainer 
+* class definition.
+*
+*/
+
+#ifndef TESTSETINSERTMENUCONTAINER_H
+#define TESTSETINSERTMENUCONTAINER_H
+
+// INCLUDES
+#include "Container.h"
+
+#include <coecntrl.h>
+#include <eiklbo.h>     // MEikListBoxObserver
+#include <bamdesca.h>   // MDesCArray
+#include <aknsfld.h>
+
+//#include "RRefArray.h"        
+//#include "UIEngine.h"         
+//#include "UIStoreIf.h"        
+//#include "UIStoreContainer.h" 
+
+#include <stifinternal/RRefArray.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+
+
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+class CTestSetInsertMenuView;
+class CEikColumnListBox;
+class CStartedTestCase;
+
+class CUIStoreHandler;
+class CUIStore;
+class CUIStoreIf;
+class CUIEngineContainer;
+class CUIEngine;
+
+// CLASS DECLARATION
+/**
+*  CTestSetInsertMenuContainer  container control class.
+*  
+*/
+class CTestSetInsertMenuContainer : public CContainer //public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetInsertMenuContainer();
+
+    public: // New functions
+        
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+        
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+        
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+         
+    private: //data
+        
+        CTestSetInsertMenuView*         iParentView;
+    };
+
+#endif // CTestSetInsertMenuContainer_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetInsertMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This  file contains CTestSetInsertMenuView class 
+* declaration.
+*
+*/
+
+#ifndef TESTSETINSERTMENUVIEW_H
+#define TESTSETINSERTMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestSetInsertMenuContainer;
+
+
+// CLASS DECLARATION
+
+/**
+*  CTestCaseMenuView view class.
+* 
+*/
+class CTestSetInsertMenuView : public CView, public MEikListBoxObserver //CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetInsertMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box.
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
+
+    public: // New functions
+        
+        /**
+        * Adds selected test cases to the current test set.
+        * @param aSelectedIndexes Indexes of selected test cases.
+        */
+        void AddCasesToTestSet( RArray<TInt> aSelectedIndexes );
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+               
+        /**
+        * Show confirmation dialog for inserting test cases.
+        */
+        void ShowInsertCasesDialogL();
+
+    private: // Data
+        CAknNavigationDecorator*        iNaviDecorator;
+        CTestSetInsertMenuContainer*    iContainer;
+        TInt                            iCurrentTestCase;
+    };
+
+#endif //TestSetInsertMenuView_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetMenuContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,209 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetMenuContainer class 
+* declaration.
+*
+*/
+
+#ifndef TestSetMenuContainer_H
+#define TestSetMenuContainer_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>     // MEikListBoxObserver
+#include <bamdesca.h>   // MDesCArray
+#include <aknsfld.h>
+
+//#include "RRefArray.h"        
+//#include "UIEngine.h"         
+//#include "UIStoreIf.h"        
+//#include "UIStoreContainer.h" 
+
+#include <stifinternal/RRefArray.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+   
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CDesC16Array;
+
+class CTestSetMenuView;
+class CEikColumnListBox;
+class CTestCaseListBoxModel;
+
+class CUIStoreHandler;
+class CUIStore;
+class CUIStoreIf;
+class CUIEngineContainer;
+class CUIEngine;
+
+// CLASS DECLARATION
+/**
+*  CTestSetMenuContainer  container control class.
+*  
+*/
+class CTestSetMenuContainer : public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetMenuContainer();
+
+    public: // New functions
+        /**
+        * Show only testcases which are defined is specified module.
+        * @param aModuleName Module which test cases are shown.
+        */
+        void FilterCasesByModuleL(TName aModuleName);
+        
+        /**
+        * Show only testcases which are defined in specified test case file.
+        * @param aTestCaseFileName Test cases file name.
+        */
+        void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
+        
+        /**
+        * Remove possible filtering of test cases -> show all test cases.
+        */
+        void NoFilteringL();
+        
+        /**
+        * Returns pointers to selected test cases.
+        * @param aSelectedTestCases Currently selected test case.
+        */
+        void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases);
+
+        /**
+        * Sets graphic icon using listbox as CEikColumnListBox.
+        * @param aListBox Pointer to list box.
+        */
+        void SetGraphicIconL( CEikColumnListBox* aListBox );
+
+        /**
+        * Appends graphics data.
+        * @param aIcons Pointer array of icons.
+        */
+        void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );
+        
+        /**
+        * Gets the index number of the current item in the view.
+        * @return Index number of the current item.
+        */
+        TInt CurrentItemIndex();
+        
+        /**
+        * Sets the current item.
+        * @param aIndex Index of the item to make current.
+        */
+        void SetCurrentItemIndex(TInt aCurrentTestCase);
+		
+		/**
+		* Inline function for getting pointer to list box.
+		* @return Pointer to list box.
+		*/
+		inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; };
+		
+		/**
+		* Processes user commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		void ProcessCommandL( TInt  aCommand );
+		
+		/**
+		* Processes user commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		void SelectionListProcessCommandL( TInt  aCommand );
+		
+		/**
+		* Handles mark commands.
+		* @param aCommand ID of the command to respond to.
+		*/
+		void HandleMarkCommandL( TInt aCommand );
+        
+        /**
+		* Removes items from list box.
+		* @param aSelected Indexes of removed items.
+		*/
+		void RemoveListBoxItemL( TInt aSelected );
+		
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+		void SaveActiveLine();
+		
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+        
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+        
+    private: //data
+        
+        CTestSetMenuView*           iParentView;
+        CEikColumnListBox*          iListBox;
+        CTestCaseListBoxModel*      iListBoxModel;
+        RPointerArray<CTestInfo>    iTestCasesInView;
+        CUIStore*                   iUIStore;
+    };
+
+#endif // CTestSetMenuContainer_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetMenuView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,167 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetMenuView class declaration.
+*
+*/
+
+#ifndef TESTSETMENUVIEW_H
+#define TESTSETMENUVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> 
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestSetMenuContainer;
+
+// CLASS DECLARATION
+/**
+*  CTestCaseMenuView view class.
+*/
+class CTestSetMenuView : public CView, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetMenuView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+    
+    public: // From MEikListBoxObserver
+        
+        /**
+        * Handles list box event.
+        * @param aListBox Pointer to list box.
+        * @param aEventType List box event.
+        */
+        void HandleListBoxEventL(CEikListBox* aListBox, 
+            TListBoxEvent aEventType);
+                
+    public: // New functions
+        
+        /**
+        * Starts all cases in active test set.
+        */
+        void StartTestSetL();
+        
+        /**
+        * Removes selected test cases from active test set.
+        */
+        void RemoveSelectedTestCasesL();
+        
+        /**
+        * Creates new test set.
+        * @param aTestSetName Name of the test set.
+        * @return Symbian OS error code.
+.       */
+        TInt CreateTestSetL( const TDesC& aTestSetName );
+        
+        /**
+        * Loads saved test set.
+        * @param aTestSetName Name of the test set.
+        * @return Symbian OS error code.
+        */
+        TInt LoadTestSetL( const TDesC& aTestSetName );
+        
+        /**
+        * Saves current test set.
+        * @return Symbian OS error code.
+        */
+        TInt SaveCurrentTestSetL();
+        
+        /**
+        * Removes current test set.
+        * @return Symbian OS error code.
+        */
+        TInt RemoveActiveTestSet();
+        
+        /**
+        * Get name of the current test set.
+        * @return Name of the current test set.
+        */
+        inline const TDesC& CurrentTestSet()
+            { return iCurrentTestSet; }
+        
+        /**
+        * Set save needed flag.
+        */
+        inline void SetSaveNeeded( TBool aSave )
+            { iSaveNeeded = aSave; }
+                
+    private: // From AknView
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+    private: // From MEikMenuObserver
+        
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestSetMenuContainer*      iContainer;
+        CUIStore*                   iUIStore;
+        TInt                        iCurrentTestCase;
+        TInt                        iTestSetIndex;
+        TBuf<50>                    iCurrentTestSet;
+        TBool                       iSaveNeeded;
+        
+    };
+
+#endif // TESTSETMENUVIEW_H
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetStartedCasesContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetStartedCasesContainer
+* class declaration.
+*
+*/
+
+#ifndef TESTSETSTARTEDCASESCONTAINER_H
+#define TESTSETSTARTEDCASESCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiklbo.h>
+#include <bamdesca.h> // MDesCArray
+
+//#include "RRefArray.h" 
+#include <stifinternal/RRefArray.h>
+
+
+// Define *.mbm file name.
+_LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
+
+// FORWARD DECLARATIONS
+class CEikTextListBox;
+class CAknSingleGraphicStyleListBox;
+class CDesC16ArrayFlat;
+class CStartedTestCase;
+
+class CUIStore;
+class CStartedTestsListBoxModel;
+
+// CLASS DECLARATION
+
+/**
+*  CTestSetStartedCasesContainer  container control class.
+*  
+*/
+class CTestSetStartedCasesContainer : public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * Symbian OS default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetStartedCasesContainer();
+
+    public: // New functions
+    
+        /**
+        * Returns reference to currently selected test case in view (listbox).
+        * @return Currently selected test case.
+        */
+        CStartedTestCase* SelectedTestCase();
+        
+        /**
+        * Constructs list box model.
+        */
+        void ConstructListBoxModelL();
+        
+        /**
+        * Draws the list box.
+        */
+        void DrawListBox();
+        
+        /**
+        * Returns count of test cases in view.
+        * @return Count of test cases in view.
+        */
+        TInt TestsInViewCount();
+        
+        /**
+        * Handles the addition of an item to the model.
+        */
+        void HandleItemAdditionL();
+        
+        /**
+        * Handles the removal of an item from the model.
+        */
+        void HandleItemRemovalL();
+        
+        /**
+        * Returns pointer to currently selected test case.
+        * @param Current test case.
+        */
+        CStartedTestCase* CurrentTestCase();
+        
+        /**
+        * Gets the index number of the current item in the view.
+        * @return Index number of the current item.
+        */
+        TInt CurrentItemIndex();
+        
+        /**
+        * Sets the current item.
+        * @param aIndex Index of the item to make current.
+        */
+        void SetCurrentItemIndex(TInt aIndex);
+        
+        /**
+        * Resets the selection indices, top and current item indices,
+        * the selection, and the horizontal scroll offset of this list box.
+        * This function does not redraw the list box.
+        */
+        void ResetListBox();
+        
+        /**
+        * Removes items from list box.
+        */
+        void RemoveSelectedExecutionsL();
+        
+        /**
+        * Removes all started test cases from list box.
+        */
+        void RemoveAllExecutionsInViewL();
+        
+        /**
+         * Stores current position of focus of iListBox to the CAppUiAppUi object
+         */
+        void SaveActiveLine();
+
+    private: // New functions
+
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+    
+        /**
+        * From CoeControl,SizeChanged.
+        * Called by framework when the view size is changed.
+        */
+        void SizeChanged();
+
+        /**
+        * From CoeControl,CountComponentControls.
+        * Gets a count of the component controls of this list box control.
+        * This information is used for DrawNow().
+        */
+        TInt CountComponentControls() const;
+
+        /**
+        * From CCoeControl,ComponentControl.
+        * Gets a pointer to the specified component control.
+        * @param aIndex Index of the component control to look up.
+        * @return The control at aIndex.
+        */
+        CCoeControl* ComponentControl(TInt aIndex) const;
+
+        /**
+        * From CCoeControl,Draw.
+        * Draw a control, called by window server.
+        * @param aRect The region of the control to be redrawn. Co-ordinates
+        *              are relative to the control's origin (top left corner).
+        */
+        void Draw(const TRect& aRect) const;
+
+        /**
+        * From CCoeControl,OfferKeyEventL
+        * Handles key events.
+        * @param aKeyEvent The key event.
+        * @param aType The type of key event.
+        * @return Indicates whether or not the key event was used 
+        *         by this control.
+        */
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+	    
+    private: //data
+        
+        CEikTextListBox*            iListBox;
+        CStartedTestsListBoxModel*  iListBoxModel;    
+        RRefArray<CStartedTestCase> iStartedTestsPtrs;
+        CUIStore*                   iUIStore;
+    };
+
+#endif // CTestSetStartedCasesCONTAINER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/TestSetStartedCasesView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetStartedCasesView class
+* declaration.
+*
+*/
+
+#ifndef TESTSETSTARTEDCASESVIEW_H
+#define TESTSETSTARTEDCASESVIEW_H
+
+// INCLUDES
+#include "View.h"
+#include <eiklbo.h> // MEikListBoxObserver
+#include <aknnavide.h> //CAknNavigationDecorator
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CTestSetStartedCasesContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CTestSetStartedCasesView view class.
+* 
+*/
+class CTestSetStartedCasesView : public CView, public MEikListBoxObserver
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CTestSetStartedCasesView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        void HandleClientRectChange();
+
+        /**
+        * Handles a list box event.
+        * @param aListBox A pointer to list box (not used).
+        * @param aEventType Type of list box event.
+        */
+        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
+
+    public: // New functions
+        
+        /**
+        * Handles status changes of test cases in view.
+        */
+        void TestCaseStateChangedL();
+        
+        /**
+        * Handles call to view test case´s output data.
+        */
+        void ViewTestCaseOutputL();
+
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        void DoDeactivate();
+
+        /**
+        * Initializes menu pane.
+        * @param aResourceId Menu pane resource ID.
+        * @param aMenuPane Menu pane pointer.
+        */
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+        
+        /**
+        * Refreshes view name shown in the navi pane.
+        */
+        void RefreshNaviTitleL();
+
+    private: // Data
+        CAknNavigationDecorator*    iNaviDecorator;
+        CTestSetStartedCasesContainer* iContainer;
+        TName                       iFilterModule;
+        TFileName                   iFilterTestCaseFile;
+        TInt                        iSelectedTestCase;  // Which testcase was 
+                                                        // selected when view 
+                                                        // was active earlier.
+    };
+
+#endif //TestSetStartedCasesVIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/UIStoreHandler.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CUIStoreHandler class declaration.
+*
+*/
+
+#ifndef UISTOREHANDLER_H
+#define UISTOREHANDLER_H
+
+//  INCLUDES
+//#include "UIStoreIf.h"  
+//#include "UIStore.h"   
+//#include "UIEngine.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+
+#include "AppUIAppUi.h"
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// CLASS DECLARATION
+// None
+class CAppUIAppUi;
+
+// DESCRIPTION
+// CUIStoreHandler is a STIF Test Framework Series60 UI class.
+// CUIStoreHandler's methods purpose is to offer handle to UI Engine.
+// Because multible inheritance in not allowed in SOS we cannot 
+// inheritance CUIStore class direct so we use this class.
+
+class CUIStoreHandler 
+            :public CUIStoreIf
+    {
+    public:     // Enumerations
+
+    private:    // Enumerations
+
+    public:     // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aAppUIAppUI Pointer to application ui.
+        * @return Pointer to UIStoreHandler.
+        */
+        static CUIStoreHandler* NewL( CAppUIAppUi* aAppUIAppUI );
+
+        /**
+        * Destructor.
+        */
+        ~CUIStoreHandler();
+
+    public:     // New functions
+
+        /**
+        * C++ default constructor.
+        * @param aAppUIAppUI Pointer to application ui.
+        */
+        CUIStoreHandler( CAppUIAppUi* aAppUIAppUI );
+
+        /**
+        * Receives output update notify from started test case.
+        * Checks if that test case is currently in output view then
+        * sends notification to AppUI which handles notification onward.
+        * @param aTestCase
+        * @param aStatus
+        */
+        void Update( CStartedTestCase* aTestCase, TInt aStatus );
+
+    public:     // Functions from base classes
+
+    protected:  // New functions
+
+    protected:  // Functions from base classes
+
+    private:
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+    public:     // Data
+
+        /**
+        * Returns the AppUI of the application
+        * @return Pointer to the Application UI.
+        */
+        CAppUIAppUi* iAppUIAppUI;
+        
+        /**
+        * Counter for executed test cases
+        */
+        TInt iExecutedTestCaseCount;
+
+    protected:  // Data
+
+    private:    // Data
+
+    public:     // Friend classes
+
+    protected:  // Friend classes
+
+    private:    // Friend classes
+
+    };
+
+#endif      // UISTOREHANDLER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/View.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,101 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CView class declaration.
+*
+*/
+
+#ifndef VIEW_H
+#define VIEW_H
+
+// INCLUDES
+#include <aknview.h>
+
+//#include "UIStoreIf.h" 
+#include <stifinternal/UIStoreIf.h>
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+//class CMainMenuContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CMainMenuView view class.
+* 
+*/
+class CView : public CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * Symbian OS default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CView();
+
+    public: // Functions from base classes
+        
+        /**
+        * Returns view´s id.
+        * @return View id.
+        */
+        virtual TUid Id() const;
+
+        /**
+        * Handles a command.
+        * @param aCommand A command ID.
+        */
+        virtual void HandleCommandL( TInt aCommand );
+
+        /**
+        * Handles client rect changes.
+        */
+        virtual void HandleClientRectChange();
+        
+    private:
+
+        /**
+        * Initializes view when activated.
+        * @param aPrevViewId Id of the previous view (not used).
+        * @param aCustomMessageId Custom message id (not used).
+        * @param aCustomMessage Custom message (not used).
+        */
+        virtual void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * Deactivates view.
+        */
+        virtual void DoDeactivate();
+
+    protected: // Data
+        
+        /**
+        * Pointer to UI Store.
+        */
+        CUIStore*     iUIStore;
+		
+		
+    private: // Data
+
+    };
+
+#endif // VIEW_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/inc/version.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains STIF UI version declaration.
+*
+*/
+
+#ifndef VERSION_H_
+#define VERSION_H_
+
+#define STIFUI_MAJOR_VERSION 7
+#define STIFUI_MINOR_VERSION 3
+#define STIFUI_BUILD_VERSION 31
+
+#define STIFUI_REL_DATE "20th Apr 2010"
+
+#define TO_UNICODE(text) _L(text) 
+
+#endif /*VERSION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/AppUIApp.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CAppUIApp class definition.
+*
+*/
+
+// INCLUDE FILES
+#include    "AppUIApp.h"
+#include    "AppUIDocument.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CSTIFAppUIApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CAppUIApp::AppDllUid() const
+    {
+    return KUidAppUI;
+    }
+
+   
+// ---------------------------------------------------------
+// CSTIFAppUIApp::CreateDocumentL()
+// Creates CSTIFAppUIDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CAppUIApp::CreateDocumentL()
+    {
+    return CAppUIDocument::NewL( *this );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+//
+
+	#include <eikstart.h>
+	// ---------------------------------------------------------
+	// NewApplication() 
+	// Exported function
+	// Returns: CApaApplication: 
+	// ---------------------------------------------------------
+	//
+	LOCAL_C CApaApplication* NewApplication()
+		{
+		return new CAppUIApp;
+		}
+	// ---------------------------------------------------------
+	// E32Main() 
+	// EXE Entry point
+	// Returns: KErrNone: No error
+	// ---------------------------------------------------------
+	//
+	GLDEF_C TInt E32Main()
+		{
+		return EikStart::RunApplication(NewApplication);
+		}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/AppUIAppUi.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,698 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains TMessageBoxUtil class definition.
+*
+*/
+
+// INCLUDE FILES
+#include "AppUIAppUi.h"
+
+#include "MainMenuView.h"
+#include "TestCaseMenuView.h"
+#include "StartCasesView.h"
+#include "TestModulesMenuView.h"
+#include "StartedCasesMenuView.h"
+#include "ShowStartedCasesView.h"
+#include "TestCaseOutputView.h"
+#include "StatisticsView.h"
+#include "TestSetBaseMenuView.h"
+#include "TestSetMenuView.h"
+#include "TestSetInsertMenuView.h"
+#include "TestSetStartedCasesView.h"
+#include <aknmessagequerydialog.h> 
+#include "version.h"
+
+#include "CreatedTestSetMenuView.h"
+
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+
+
+#include <StifTestInterface.h>
+
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+
+_LIT( KTestSet, "DefaultSet" );
+
+static const TInt KCopyrightChar = 169;
+
+// ----------------------------------------------------------
+// CMessageBoxUtil::ShowNotImplementedYetL
+// Displays message that executed funtion is not implemented yet.
+// ----------------------------------------------------------
+//
+void TMessageBoxUtil::ShowNotImplementedYetL()
+    {
+    _LIT(message, "Not implemented yet");
+    CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
+    informationNote->ExecuteLD(message);
+    }
+
+// ----------------------------------------------------------
+// Display error note.
+// @param aMessage Error message to display.
+// ----------------------------------------------------------
+//
+void TMessageBoxUtil::ShowErrorNoteL( const TDesC& aMessage )
+	{
+	CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue);
+	// set timeout to 5 sec	
+	errorNote->SetTimeout( (CAknNoteDialog::TTimeout)5000000 );
+	errorNote->ExecuteLD( aMessage );
+	}
+
+// ================= MEMBER FUNCTIONS =======================
+//
+// ----------------------------------------------------------
+// CAppUIAppUi::ConstructL()
+// ?implementation_description
+// ----------------------------------------------------------
+//
+void CAppUIAppUi::ConstructL()
+    {
+    TInt error(0);
+
+    BaseConstructL( EAknEnableSkin );
+
+    // connection to setting server needs to be open as long as STIF Series 60 UI APP is alive
+    TInt ret = iSettingServer.Connect();
+    if ( ret != KErrNone )
+        {
+        User::Leave( ret );
+        }
+    
+    iLogger = CStifLogger::NewL( _L("E\x3a\\"), _L("stif_tfw_ui"),
+                                CStifLogger::ETxt, CStifLogger::EFile,
+                                ETrue, EFalse, ETrue, EFalse, EFalse );
+
+    iLogger->Log( _L("--- UI log starts ---") );
+    iLogger->Log( _L(" ") );
+    iLogger->Log( _L("appui: ConstructL") );
+
+	// Create CData object which handles all test cases data and running of them
+    iUIStoreHandler = CUIStoreHandler::NewL( this );
+    
+    // CUIStore open 
+    error = UIStoreHandler()->Open( KDefaultPathAndIni );
+    if ( KErrNone != error )
+    	{
+    	User::Leave( error );
+    	}
+
+    CMainMenuView* mainMenuView = new (ELeave) CMainMenuView;
+    CleanupStack::PushL( mainMenuView );
+    mainMenuView->ConstructL();
+    AddViewL( mainMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // MainMenuView
+
+    iLogger->Log(_L("appui:mainview "));
+
+    CCreatedTestSetMenuView* testCreatedTestSetMenuView = new (ELeave) CCreatedTestSetMenuView;
+        CleanupStack::PushL( testCreatedTestSetMenuView );
+       testCreatedTestSetMenuView->ConstructL();
+        AddViewL( testCreatedTestSetMenuView );      // transfer ownership to CAknViewAppUi
+        CleanupStack::Pop();    // testCaseMenuView
+    CTestCaseMenuView* testCaseMenuView = new (ELeave) CTestCaseMenuView;
+    CleanupStack::PushL( testCaseMenuView );
+    testCaseMenuView->ConstructL();
+    AddViewL( testCaseMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testCaseMenuView
+
+    iLogger->Log(_L("appui:caseview "));
+
+    CStartCasesView* startCasesView = new (ELeave) CStartCasesView;
+    CleanupStack::PushL( startCasesView );
+    startCasesView->ConstructL();
+    AddViewL( startCasesView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // startCasesView
+
+    iLogger->Log(_L("appui:startcaseview "));
+
+    CStartedCasesMenuView* startedCasesMenuView = new (ELeave) CStartedCasesMenuView;
+    CleanupStack::PushL( startedCasesMenuView );
+    startedCasesMenuView->ConstructL();
+    AddViewL( startedCasesMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // startedCasesMenuView
+
+    iLogger->Log(_L("appui:started cases view created"));
+
+    CShowStartedCasesView* showStartedCasesView = new (ELeave) CShowStartedCasesView;
+    CleanupStack::PushL( showStartedCasesView );
+    showStartedCasesView->ConstructL();
+    AddViewL( showStartedCasesView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // showStartedCasesView
+
+    iLogger->Log(_L("appui: show started cases view created"));
+
+    CTestCaseOutputView* testCaseOutputView = new (ELeave) CTestCaseOutputView;
+    CleanupStack::PushL( testCaseOutputView );
+    testCaseOutputView->ConstructL();
+    AddViewL( testCaseOutputView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testCaseOutputView
+
+    iLogger->Log(_L("appui: test case output view created"));
+
+    CTestModulesMenuView* testModulesMenuView = new (ELeave) CTestModulesMenuView;
+    CleanupStack::PushL( testModulesMenuView );
+    testModulesMenuView->ConstructL();
+    AddViewL( testModulesMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testModulesMenuView
+
+    iLogger->Log(_L("appui:modulesview "));
+
+    CStatisticsView* statisticsMenuView = new (ELeave) CStatisticsView;
+    CleanupStack::PushL( statisticsMenuView );
+    statisticsMenuView->ConstructL();
+    AddViewL( statisticsMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // statisticsMenuView
+
+    iLogger->Log(_L("appui:modulesview "));
+
+	//
+	CTestSetBaseMenuView* testSetBaseMenuView = new (ELeave) CTestSetBaseMenuView;
+    CleanupStack::PushL( testSetBaseMenuView );
+    testSetBaseMenuView->ConstructL();
+    AddViewL( testSetBaseMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testSetBaseMenuView
+
+    iLogger->Log(_L("appui:testsetsbaseview "));
+    
+    CTestSetMenuView* testSetMenuView = new (ELeave) CTestSetMenuView;
+    CleanupStack::PushL( testSetMenuView );
+    testSetMenuView->ConstructL();
+    AddViewL( testSetMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testSetMenuView
+
+    iLogger->Log(_L("appui:testsetsview "));
+	
+	CTestSetInsertMenuView* testSetInsertMenuView = new (ELeave) CTestSetInsertMenuView;
+    CleanupStack::PushL( testSetInsertMenuView );
+    testSetInsertMenuView->ConstructL();
+    AddViewL( testSetInsertMenuView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testSetInsertMenuView
+   	
+   	iLogger->Log(_L("appui:testsetinsertview "));
+   	
+   	CTestSetStartedCasesView* testSetStartedCasesView = new (ELeave) CTestSetStartedCasesView;
+    CleanupStack::PushL( testSetStartedCasesView );
+    testSetStartedCasesView->ConstructL();
+    AddViewL( testSetStartedCasesView );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // testSetStartedCasesView
+
+    iLogger->Log(_L("appui:testsetStartedCasesView "));
+    
+
+    SetDefaultViewL( *mainMenuView );
+
+    iLogger->Log(_L("appui:setdefview "));
+    
+    iStartedTestCase = NULL;
+    iStartedTestSet = -1;
+    
+    iPreviousPositionListValid = ETrue;
+    }
+
+// ----------------------------------------------------
+// CAppUIAppUi::~CAppUIAppUi()
+// Destructor
+// Frees reserved resources
+// ----------------------------------------------------
+//
+CAppUIAppUi::~CAppUIAppUi()
+    {
+    
+    if ( iLogger )
+    {
+    iLogger->Log( _L(" ") );
+    iLogger->Log( _L("--- UI log ends ---") );    	
+    }
+
+    delete iLogger;
+    iSettingServer.Close();
+    UIStoreHandler()->Close();
+    delete iUIStoreHandler;
+    
+    // Closing of array of positions of focus in various menus
+    iPreviousFocusPosition.Close();
+    // iPreviousFocusPosition is no longer valid and cannot be used any more
+    iPreviousPositionListValid = EFalse;
+    //RemoveView(EMainMenuViewId);
+    }
+
+// ------------------------------------------------------------------------------
+// CAppUIAppUi::Data( )
+// Just returns pointer to CUIStore object, which is created by CAppUIAppUi
+// ------------------------------------------------------------------------------
+//
+CUIStore* CAppUIAppUi::UIStoreHandler()
+    {
+    return &iUIStoreHandler->UIStore();
+
+    }
+
+// ------------------------------------------------------------------------------
+// CAppUIAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
+//  This function is called by the EIKON framework just before it displays
+//  a menu pane. Its default implementation is empty, and by overriding it,
+//  the application can set the state of menu items dynamically according
+//  to the state of application data.
+// ------------------------------------------------------------------------------
+//
+void CAppUIAppUi::DynInitMenuPaneL(
+    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
+    {
+
+    }
+
+// ----------------------------------------------------
+// CAppUIAppUi::HandleKeyEventL(
+//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
+// ?implementation_description
+// ----------------------------------------------------
+//
+TKeyResponse CAppUIAppUi::HandleKeyEventL(
+    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
+    {
+	TInt currentView;
+
+	if ( iView )
+	{
+    currentView = (iView->Id()).iUid;
+ 			
+    
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+			{
+			switch ( currentView )
+				{
+				case ETestModulesMenuViewId:
+					{
+                    HandleCommandL( EAppUIGoToTestCaseMenu );
+					break;
+					}
+				case ETestSetBaseMenuViewId:
+					{
+                    HandleCommandL( EAppUIGoToModulesMenu );
+					ActivateLocalViewL(TUid::Uid(ETestModulesMenuViewId));
+					break;
+					}
+                }
+            break;
+			}
+        case EKeyRightArrow:
+			{
+			switch ( currentView )
+				{
+				case ETestCaseMenuViewId:
+					{
+                    HandleCommandL( EAppUIGoToModulesMenu ); // TestCaseMenu --> TestModuleMenu
+					ActivateLocalViewL(TUid::Uid(ETestModulesMenuViewId));
+					break;
+					}
+				case ETestModulesMenuViewId:
+					{
+					HandleCommandL( EAppUIGoToTestSetsMenu );
+					ActivateLocalViewL(TUid::Uid(ETestSetBaseMenuViewId));
+					break;
+					}
+				case ETestSetsMenuViewId:
+					{
+					break;
+					}
+
+				}
+            break;
+			}
+
+        default:
+			{
+            return EKeyWasNotConsumed;
+            //break; 
+			}
+        }
+	}
+
+    return EKeyWasConsumed;
+
+    }
+
+// ----------------------------------------------------
+// CAppUIAppUi::HandleCommandL(TInt aCommand)
+// ?implementation_description
+// ----------------------------------------------------
+//
+void CAppUIAppUi::HandleCommandL(TInt aCommand)
+    {
+	TInt currentView, newView;
+    TInt error(0);
+    
+    currentView = (iView->Id()).iUid;
+
+    switch ( aCommand )
+        {
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+            {
+            PrepareToExit();
+            Exit();
+			newView = currentView;
+            break;
+            }
+        case EAppUIGoBack:
+            {
+			switch ( currentView )
+				{
+				case ETestCaseMenuViewId:
+					{
+					newView = EMainMenuViewId;  // Test Cases Menu --> Main Menu
+					break;
+					}
+				case EStartCaseMenuViewId:
+					{
+					newView = ETestCaseMenuViewId; // Start Cases Menu --> Test Cases Menu
+                    //iTabGroup->SetActiveTabByIndex(0);
+					break;
+					}
+				case ETestModulesMenuViewId:
+					{
+					newView = EMainMenuViewId; // Test Modules Menu --> Main Menu
+					break;
+					}
+				case EStartedCasesMenuViewId:
+					{
+					newView = ETestCaseMenuViewId; // Started Cases Menu --> Test Case Menu
+					break;
+					}
+				case EShowStartedCasesViewId:
+					{
+					newView = EStartedCasesMenuViewId; // Show started cases --> Started Cases Menu
+					break;
+					}
+				case ETestCaseOutputViewId:
+					{
+                    newView = iPreviousView; // Test case output view --> previous view
+					break;
+					}
+				case EStatisticsViewId:
+					{
+                    newView = EStartedCasesMenuViewId; // Statistic view --> Started Cases Menu
+					break;
+					}
+				case ETestSetBaseMenuViewId:
+					{
+					newView = EMainMenuViewId;  // Test Sets Base Menu --> Main Menu
+					break;
+					}
+				case ETestSetMenuViewId:
+					{
+					newView = ETestSetBaseMenuViewId;  // Test Sets Menu --> Test Sets Base Menu
+					break;
+					}
+				case ETestSetInsertMenuViewId:
+					{
+					newView = ETestSetMenuViewId;  // Test Set Insert Menu --> Test Sets Menu
+					break;
+					}
+				case ETestSetStartedCasesViewId:
+					{
+					newView = ETestSetMenuViewId;  // Test Set Started Cases Menu --> Test Sets Menu
+					break;
+					}
+				default:
+					{
+					newView = currentView; // Back does not work. This should not happen ever
+					break;
+					}
+				}
+            break;
+			}
+		case EAppUIGoToMainMenu:
+			{
+			newView = EMainMenuViewId;
+			break;
+			}
+		case EAppUIGoToTestCaseMenu:
+			{
+			newView = ETestCaseMenuViewId;
+			break;
+			}
+		case ECmdGoToStartCasesView:
+			{
+			newView = EStartCaseMenuViewId;
+			break;
+			}
+		case ECmdGoToStartedCasesView:
+			{
+			newView = EStartedCasesMenuViewId;
+			break;
+			}
+		case EAppUIGoToModulesMenu:
+			{
+			newView = ETestModulesMenuViewId;
+            //iTabGroup->SetActiveTabByIndex(1);
+			break;
+			}
+		case EAppUIGoToTestSetsMenu:
+			{
+            newView = ETestSetBaseMenuViewId;
+            
+            //ShowNotImplementedYet();
+            //newView = currentView;
+			break;
+			}
+        case ECmdCreateTestSet:
+	        {
+	        CTestSetMenuView* testSetMenu = (CTestSetMenuView*)View( TUid::Uid(ETestSetMenuViewId) );
+	        error = testSetMenu->CreateTestSetL( KTestSet );
+	        if ( KErrNone == error ||  KErrAlreadyExists == error)
+	            {
+	            newView = ETestSetInsertMenuViewId;
+	            currentView = ETestSetMenuViewId; // Store previous view for Back function
+	            }
+	        else
+	            {
+	            newView = ETestSetMenuViewId;
+	            }
+            break;
+    	    }
+    	case ECmdLoadTestSet:
+	        {
+	        newView = ECreatedTestSetMenuViewId; /*ETestSetBaseMenuViewId;*/
+	        break;
+			}
+    	case ECmdGoToTestSetView:
+    		{
+
+    		newView = ETestSetMenuViewId; 
+    		break;
+    		}
+        case ECmdInsertTestCases:
+	        {
+    		newView = ETestSetInsertMenuViewId;
+    		break;
+        	}
+        case ECmdShowStartedTestSet:
+	        {
+    		newView = ETestSetStartedCasesViewId;
+    		iShowStartedCasesMode = EShowAllStartedCases;
+    		break;
+        	}
+        case ECmdShowAllStartedCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowAllStartedCases;
+			break;
+        case ECmdShowOngoingCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowOngoingCases;
+        	break;
+        case ECmdShowPassedCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowPassedCases;
+			break;
+        case ECmdShowPausedCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowPausedCases;
+			break;
+        case ECmdShowFailedCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowFailedCases;
+			break;
+        case ECmdShowCrashedAbortedCases:
+            newView = EShowStartedCasesViewId;
+            iShowStartedCasesMode = EShowCrashedAbortedCases;
+			break;
+        case ECmdShowStatistics:
+            newView = EStatisticsViewId;
+			break;
+        case ECmdViewOutput:
+            newView = ETestCaseOutputViewId;
+            break;
+        case ECmdShowAbout:
+        	{
+        	CAknMessageQueryDialog* dlg = new (ELeave) CAknMessageQueryDialog;
+        	TBuf<200> version;
+        	version.Format(_L("STIF UI - Version %d.%d.%d - "), STIFUI_MAJOR_VERSION, STIFUI_MINOR_VERSION, STIFUI_BUILD_VERSION);
+        	version.Append(TO_UNICODE(STIFUI_REL_DATE));
+        	version.Append(_L("\n"));
+        	
+        	TInt stifMajorV;
+        	TInt stifMinorV;
+        	TInt stifBuildV;
+        	TBuf<30> relDate;
+        	TStifUtil::STIFVersion(stifMajorV, stifMinorV, stifBuildV, relDate);
+        	
+        	TBuf<40> stifVersion;
+        	stifVersion.Format(_L("STIF - Version %d.%d.%d - "), stifMajorV, stifMinorV, stifBuildV);
+        	stifVersion.Append(relDate);
+        	stifVersion.Append(_L("\n"));
+        	
+        	version.Append(stifVersion);
+        	
+        	version.Append(_L("Copyright "));
+			version.Append( KCopyrightChar );
+			version.Append(_L(" 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved."));
+        	
+        	dlg->SetMessageText(version);
+        	dlg->ExecuteLD(R_STIFUI_ABOUT_DIALOG);
+        	newView = currentView;
+        	break;
+        	}
+        default:
+			{
+            TMessageBoxUtil::ShowNotImplementedYetL();
+			newView = currentView;
+            break;
+			}
+        }
+
+	if( newView != currentView )
+		{
+        iPreviousView = currentView; // Store previous view for Back function
+		ActivateLocalViewL( TUid::Uid(newView) );
+
+		/*switch ( newView )
+			{
+			case EMainMenuViewId:
+            case EStartedCasesMenuViewId:
+            case EStartCaseMenuViewId:
+            case ETestCaseOutputViewId:
+				{
+		        //StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
+                //iTabGroup->DimTab (ETestCaseMenuTab, ETrue);
+                //iTabGroup->DimTab (ETestModulesMenuTab, ETrue);
+                //iTabGroup->DimTab (ETestSetsMenuTab, ETrue);
+
+                //StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_EMPTY);
+				//StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_IDLE);
+				break;
+				}
+			case ETestCaseMenuViewId:
+			case ETestModulesMenuViewId:
+			case ETestSetsMenuViewId:
+				{
+				//StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
+                //iTabGroup->DimTab (ETestCaseMenuTab, EFalse);
+                //iTabGroup->DimTab (ETestModulesMenuTab, EFalse);
+                //iTabGroup->DimTab (ETestSetsMenuTab, EFalse);
+                break;
+				}
+			default:
+				{
+                break;
+				}
+			}*/
+		}
+
+    }
+
+/**
+* Receives output update notification from UI Storehandler
+* @param
+* @return
+*/
+void CAppUIAppUi::OutputUpdateL( CStartedTestCase* aTestCase, TInt /* aStatus */ )
+    {
+    if( iView->Id().iUid == ETestCaseOutputViewId )
+        {
+        ( ( CTestCaseOutputView* )iView )->OutputUpdateL( aTestCase );
+        }
+    else if( iView->Id().iUid == EShowStartedCasesViewId )
+        {
+        ( ( CShowStartedCasesView* )iView )->TestCaseStateChangedL();
+        }
+    else if( iView->Id().iUid == ETestCaseOutputViewId )
+        {
+        ( ( CTestCaseOutputView* )iView )->TestCaseStateChangedL();
+        }
+    }
+  
+/**
+* Sets index of selected test case for viewing test case output
+* @param
+* @return
+*/    
+void CAppUIAppUi::SetStartedTestCase( CStartedTestCase* aStartedTestCase )
+    {
+    iStartedTestCase = aStartedTestCase;
+    }    
+  
+/**
+* Returns index of selected test case for viewing test case output
+* @param
+* @return
+*/    
+CStartedTestCase* CAppUIAppUi::GetStartedTestCase( )
+    {
+    return iStartedTestCase;
+    }        
+
+/**
+ * Stores focus position of focus from a specyfic view to iPreviousFocusPosition object.
+ * Value is than used to retrieve previous position of focus in the menu
+ * @param aViewId - identification of view
+ * @param aPosition - value to store for a specyfic view
+ */
+void CAppUIAppUi::SaveFocusPosition(TAppUIViewNumber aViewId, TInt aPosition)
+	{
+	if(!iPreviousPositionListValid)
+		{
+		return;
+		}
+	for(TInt counter = iPreviousFocusPosition.Count(); counter <= aViewId; counter++)
+		{
+		iPreviousFocusPosition.Append(0);
+		}
+	iPreviousFocusPosition[aViewId] = aPosition;
+	}
+
+/**
+ * Restores focus position of focus for a specyfic view from iPreviousFocusPosition object.
+ * @param aViewId - identification of view
+ * @return - previous position of focus in the requested view
+ */
+TInt CAppUIAppUi::GetFocusPosition(TAppUIViewNumber aViewId)
+	{
+	if(iPreviousFocusPosition.Count() > aViewId)
+		{
+		return iPreviousFocusPosition[aViewId];
+		}
+	else
+		{
+		return KErrNotFound;
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/AppUIDocument.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CAppUIDocument class definition.
+*
+*/
+
+// INCLUDE FILES
+#include "AppUIDocument.h"
+#include "AppUIAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CAppUIDocument::CAppUIDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+// destructor
+CAppUIDocument::~CAppUIDocument()
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CAppUIDocument::ConstructL()
+    {
+    }
+
+// Two-phased constructor.
+CAppUIDocument* CAppUIDocument::NewL(
+        CEikApplication& aApp)     // CAppUIApp reference
+    {
+    CAppUIDocument* self = new (ELeave) CAppUIDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CAppUIDocument::CreateAppUiL()
+// constructs CAppUIAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CAppUIDocument::CreateAppUiL()
+    {
+    return new (ELeave) CAppUIAppUi;
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/Container.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,444 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseListBoxModel class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> //  CColumnListBoxData
+
+#include "Container.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestCaseListBoxModel::NewL
+// 
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+
+CTestCaseListBoxModel* CTestCaseListBoxModel::NewL(RPointerArray<CTestInfo>* aTestCasesInView)
+    {
+    CTestCaseListBoxModel* self = new ( ELeave ) CTestCaseListBoxModel();
+    CleanupStack::PushL( self );
+    self->iBuffer = HBufC::NewL( 130 );
+    self->iTestCasesInView = aTestCasesInView;
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseListBoxModel::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+
+void CTestCaseListBoxModel::ConstructL()
+    {
+    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseListBoxModel::~CTestCaseListBoxModel
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestCaseListBoxModel::~CTestCaseListBoxModel()
+    {
+    delete iBuffer;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseListBoxModel::MdcaCount
+// 
+// Returns the number of descriptor elements in the array.
+// ----------------------------------------------------------------------------
+//
+
+TInt CTestCaseListBoxModel::MdcaCount() const
+    {
+    return iTestCasesInView->Count();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseListBoxModel::MdcaPoint
+// 
+// Indexes into a descriptor array.
+// ----------------------------------------------------------------------------
+//
+TPtrC CTestCaseListBoxModel::MdcaPoint(TInt aIndex) const
+    {
+    CTestInfo* testCasePtr = (*iTestCasesInView)[aIndex];
+    TPtr buffer( iBuffer->Des() );
+    buffer.Zero();
+    buffer.Append(_L("\t"));
+    buffer.Append(testCasePtr->TestCaseTitle() );
+    return *iBuffer;
+    }
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CContainer::ConstructL()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::~CContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CContainer::~CContainer()
+    {
+    iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
+    delete iListBox;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CContainer::SetGraphicIconL
+// 
+// Sets graphic icon using listbox as CEikColumnListBox.
+// ----------------------------------------------------------------------------
+//
+void CContainer::SetGraphicIconL( CEikColumnListBox* aListBox )
+	{
+	    if ( aListBox )
+	        {
+	        // Creates gul icon.
+	        CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
+	        CleanupStack::PushL( iconArray );
+	        
+	        GraphicIconL( iconArray ); // Appends graphic data.
+	        
+	        // Sets graphics as ListBox icon.
+	        aListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
+	        
+	        CleanupStack::Pop();
+	        }
+	    }
+
+// ----------------------------------------------------------------------------
+// CContainer::CurrentItemIndex
+// 
+// Returns current item index in list box.
+// ----------------------------------------------------------------------------
+//
+TInt CContainer::CurrentItemIndex()
+    {
+    return iListBox->CurrentItemIndex();
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::SetCurrentItemIndex
+// 
+// Sets current item index in list box.
+// ----------------------------------------------------------------------------
+//
+void CContainer::SetCurrentItemIndex(TInt aCurrentTestCase)
+    {
+    iListBox->SetCurrentItemIndexAndDraw(aCurrentTestCase);
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::GraphicIconL
+// 
+// Appends graphics data.
+// ----------------------------------------------------------------------------
+//
+void CContainer::GraphicIconL( CArrayPtr<CGulIcon>* aIcons )
+    {
+    if ( aIcons )
+            {
+            CFbsBitmap* markBitmap = NULL;
+            CFbsBitmap* markBitmapMask = NULL;
+    	
+            TRgb defaultColor;
+            defaultColor = CEikonEnv::Static()->Color(EColorControlText);
+    	
+            AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
+            		KAknsIIDQgnIndiMarkedAdd,
+            		KAknsIIDQsnIconColors,
+            		EAknsCIQsnIconColorsCG13,
+            		markBitmap,
+            		markBitmapMask,
+            		AknIconUtils::AvkonIconFileName(),
+            		EMbmAvkonQgn_indi_marked_add,
+            		EMbmAvkonQgn_indi_marked_add_mask,
+            		defaultColor );
+            
+            CGulIcon* markIcon = CGulIcon::NewL(markBitmap,markBitmapMask);
+            aIcons->AppendL(markIcon); 
+            }
+        }
+
+
+// ----------------------------------------------------------------------------
+// CContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::SelectedTestCases
+// 
+// Returns pointers to selected test cases.
+// ----------------------------------------------------------------------------
+//
+void CContainer::SelectedTestCases
+                            (RPointerArray<CTestInfo>& aSelectedTestCases)
+    {
+    TInt selectedItemIdx = iListBox->CurrentItemIndex();
+    if ( ( selectedItemIdx >= 0 ) && ( iTestCasesInView.Count() > selectedItemIdx ) )
+        {
+        aSelectedTestCases.Append( iTestCasesInView[ selectedItemIdx ] );    
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::SelectedTestCaseInfo
+// 
+// Returns pointers to currently selected (in list box) test cases info.
+// ----------------------------------------------------------------------------
+//
+CTestInfo* CContainer::SelectedTestCaseInfo()
+    {
+    TInt selectedItemIdx = iListBox->CurrentItemIndex();
+    if ( ( selectedItemIdx >= 0 ) && ( iTestCasesInView.Count() > selectedItemIdx ) )
+        {
+        return iTestCasesInView[ selectedItemIdx ];
+        }
+    return NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::TestCaseInfo
+// 
+// Returns pointers to selected test cases info.
+// ----------------------------------------------------------------------------
+//
+CTestInfo* CContainer::TestCaseInfo( TInt aIndex )
+    {
+    if ( ( aIndex >=0 ) && ( iTestCasesInView.Count() > aIndex ) )
+        {
+        return iTestCasesInView[ aIndex ];
+        }
+    return NULL;
+    }
+    
+// ----------------------------------------------------------------------------
+// CContainer::HandleMarkCommandL
+// 
+// Handles mark commands.
+// ----------------------------------------------------------------------------
+//
+void CContainer::HandleMarkCommandL( TInt aCommand )
+	{
+	if (iListBox)
+		{
+		AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );		
+		}
+	}
+
+// ----------------------------------------------------------------------------
+// CContainer::ProcessCommandL
+// 
+// Processes user commands.
+// ----------------------------------------------------------------------------
+//
+void CContainer::ProcessCommandL( TInt  aCommand )
+	{
+	AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );
+    }
+    
+// ----------------------------------------------------------------------------
+// CContainer::SelectionListProcessCommandL
+// 
+// Processes user commands.
+// ----------------------------------------------------------------------------
+//     
+void CContainer::SelectionListProcessCommandL( TInt  aCommand )
+	{
+	AknSelectionService::HandleSelectionListProcessCommandL( aCommand, iListBox );
+    }
+    
+// ----------------------------------------------------------------------------
+// CContainer::FilterCasesByModuleL
+// 
+// Show only testcases which are defined is specified module.
+// ----------------------------------------------------------------------------
+//
+void CContainer::FilterCasesByModuleL( TName aModuleName )
+    {
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+   
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        if ( allCases[i].ModuleName() == aModuleName )
+            {
+            iTestCasesInView.Append( &( allCases[i] ) );
+            }
+        }
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::FilterCasesByTCFileNameL
+// 
+// Show only testcases which are defined is specified test case file.
+// ----------------------------------------------------------------------------
+//
+void CContainer::FilterCasesByTCFileNameL( 
+                                                TFileName aTestCaseFileName )
+    {
+
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+  
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        if ( allCases[i].TestCaseFile() == aTestCaseFileName )
+            {
+            iTestCasesInView.Append( &( allCases[i] ) );
+            }
+        }
+
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::NoFilteringL
+// 
+// Remove possible filtering of test cases -> show all test cases.
+// ----------------------------------------------------------------------------
+//
+void CContainer::NoFilteringL()
+    {
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+
+    // Add all cases to iTestCasesInView pointer array
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        iTestCasesInView.Append( &( allCases[i] ) );
+        }
+
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/CreatedTestSetMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,210 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This fiole contains CreatedTestSetMenuContainer class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>   // ListBox
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> // CColumnListBoxData
+
+#include "CreatedTestSetMenuContainer.h"
+#include "StartCasesView.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "Container.h"
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ConstructL"));
+
+	iParentView = (CCreatedTestSetMenuView*)aListBoxObserver;
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    iTestCasesInView.Reset();
+    
+	iListBox = CMenuListBox::NewL(ECreatedTestSetMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // 
+    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+    if ( iUIStore )
+        {
+        CDesCArray* items = static_cast<CDesCArray*> (iListBox->Model()->ItemTextArray());
+        
+        //Create list of available Test Set
+        RRefArray<TDesC>    allSet;      
+        RRefArray<CTestInfo> allCases;
+        TInt ret = iUIStore->GetTestSetsList( allSet );
+        if( KErrNone != ret )
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->GetTestSetsList() fails"));
+            allSet.Reset();
+            allSet.Close();
+            User::Leave( ret );
+            }
+
+        const TInt KTestCaseCount = allSet.Count();
+        for (TInt i=0; i <KTestCaseCount; i++)
+            {
+            _LIT(KItemFromat, "0\t%S\t\t");
+     
+           RBuf tmp;
+           tmp.Create(allSet[i].Length() + 6);
+           tmp.Format( KItemFromat, &allSet[i] );
+           items->AppendL( tmp );
+           tmp.Close();
+           }
+       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ListBox model"));         
+       iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
+       iListBox->HandleItemAdditionL();
+ 
+        allSet.Reset();
+        allSet.Close();
+        }
+    else
+        {
+        User::Leave( KErrGeneral );
+        }
+
+    // Creates graphic.
+    SetGraphicIconL( iListBox );
+       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: icons created"));
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+//CreatedTestSetMenuContainer::~CStartCasesContainer
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CCreatedTestSetMenuContainer::~CCreatedTestSetMenuContainer()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuContainer::SizeChanged()
+    {
+    
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+//CreatedTestSetMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CCreatedTestSetMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CCreatedTestSetMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CCreatedTestSetMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+	if (iListBox)
+		{
+	
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuContainer:::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/CreatedTestSetMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartCasesView class definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <aknlistquerydialog.h> 
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "CreatedTestSetMenuView.h"
+#include  "CreatedTestSetMenuContainer.h"
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+#include "TestSetMenuView.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStartCasesView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::ConstructL()
+    {
+    CView::ConstructL();  
+    BaseConstructL(R_APPUI_LOADTESTSETVIEW);
+    iCurrentTestCase = 0;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::~CStartCasesView
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CCreatedTestSetMenuView::~CCreatedTestSetMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CCreatedTestSetMenuView::Id() const
+    {
+    return TUid::Uid(ECreatedTestSetMenuViewId);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+            {
+            case EAknSoftkeyBack:
+                {
+                AppUi()->HandleCommandL(EAppUIGoToTestSetsMenu);
+                break;
+                }
+    		case EAknCmdOpen:
+    			{
+    		   		HandleListBoxEventL(iContainer->ListBox(), EEventEnterKeyPressed);	
+    			break;
+    			}
+            default:
+                {
+                AppUi()->HandleCommandL( aCommand );
+                break;
+                }
+            }
+
+    }
+
+// ----------------------------------------------------------------------------
+//CreatedTestSetMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("CreatedTestSetMenuView: DoActivateL"));
+        iContainer = new (ELeave) CCreatedTestSetMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("CreatedTestSetMenuView: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+
+    iContainer->SetCurrentItemIndex(iCurrentTestCase);
+    
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_LOADTESTSET);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CreatedTestSetMenuView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CCreatedTestSetMenuView::HandleListBoxEventL( CEikListBox* aListBox, 
+    TListBoxEvent aEventType )
+	{
+	if (  aEventType == MEikListBoxObserver::EEventEnterKeyPressed    )
+		{
+	 	// Checking with item from list was selected	
+		CTextListBoxModel* tmp = (CTextListBoxModel*)aListBox->Model();
+		TPtrC item = tmp->ItemText(aListBox->CurrentItemIndex());
+		// Geting propper format of item from list (ex. 2008_8_10_13_16.set ). 
+		TPtrC substracted(item.Left(item.Length()-2));
+		substracted.Set(substracted.Right(substracted.Length()-2));
+		// Creating new view containing 		
+       	CTestSetMenuView* testSetMenu = (CTestSetMenuView*)AppUi()->View( TUid::Uid(ETestSetMenuViewId) ); 
+       	TInt	error = testSetMenu->LoadTestSetL( substracted );
+		AppUi()->HandleCommandL(ECmdGoToTestSetView);
+		
+        }
+ 
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/MainMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,217 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMainMenuContainer class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>  // ListBox
+
+#include <barsread.h> // for TResourceReader
+
+#include <aknnotewrappers.h>
+
+#include "MainMenuContainer.h"
+#include "Stifui.hrh"
+#include <Stifui.rsg>
+#include "MenuListBox.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMainMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------
+//
+void CMainMenuContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+
+	iListBox = CMenuListBox::NewL(EMainMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC( reader, R_MAIN_MENU_LISTBOX );
+	iListBox->SetListBoxObserver( this );
+	iListBox->ConstructFromResourceL( reader );
+	CleanupStack::PopAndDestroy(); // resource stuffs. 
+	iListBox->ActivateL(); // Sets control as ready to be drawn
+	
+	// retrieve previous position of focus for this view/continer and set focus to this value
+	((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+
+// ---------------------------------------------------------
+// CMainMenuContainer::~CMainMenuContainer
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMainMenuContainer::~CMainMenuContainer()
+    {
+	if( iListBox )
+		{
+		delete iListBox;
+		iListBox = NULL;
+		}
+	}
+
+// ---------------------------------------------------------
+// CMainMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed
+// ---------------------------------------------------------
+//
+void CMainMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ---------------------------------------------------------
+// CMainMenuContainer::CountComponentControls
+//
+// Returns number of controls indside this container.
+// ---------------------------------------------------------
+//
+TInt CMainMenuContainer::CountComponentControls() const
+    {
+    return 1;
+    }
+
+// ---------------------------------------------------------
+// CMainMenuContainer::ComponentControl
+// 
+// Gets the specified component of a compound control.
+// ---------------------------------------------------------
+//
+CCoeControl* CMainMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CMainMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ---------------------------------------------------------
+//
+void CMainMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ---------------------------------------------------------
+// CMainMenuContainer::HandleListBoxEventL
+//
+// Handles list box events.
+// ---------------------------------------------------------
+//
+void CMainMenuContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+	{
+
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{	
+        HandleSelectedListItemL( aListBox->CurrentItemIndex() );
+		}
+
+	}
+	
+// ----------------------------------------------------------------------------
+// CMainMenuContainer::HandleSelectedListItemL
+//
+// Method HandleSelectedListItemL handles valix index.
+// ----------------------------------------------------------------------------
+//
+void CMainMenuContainer::HandleSelectedListItemL( TInt aIndex )
+	{	 
+		TInt selection = aIndex;
+        
+        // Change active view.
+	    switch ( selection )
+        {
+		    case 0:
+				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestCaseMenu);
+				break;
+			case 1:
+				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToModulesMenu);
+				break;
+			case 2: 
+				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
+				break;
+	        default:
+				break;
+		}
+	}
+
+// ---------------------------------------------------------
+// CMainMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ---------------------------------------------------------
+//
+TKeyResponse CMainMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+{
+	if (aType != EEventKey)
+	{
+		return EKeyWasNotConsumed;
+	}
+
+	// Offers key events to list box
+	if (iListBox)
+	{
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+	}
+	else
+	{
+		return EKeyWasNotConsumed;
+	}
+}
+
+// ----------------------------------------------------------------------------
+// CMainMenuContainer:::GetActiveLine
+//
+// Get currently selected items index.
+// ----------------------------------------------------------------------------
+//
+TInt CMainMenuContainer::GetActiveLine()
+	{
+	return iListBox->CurrentItemIndex();
+	}
+
+// ----------------------------------------------------------------------------
+// CMainMenuContainer:::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CMainMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/MainMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,163 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMainMenuView class definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "MainMenuView.h"
+#include  "MainMenuContainer.h" 
+#include  "Stifui.hrh"
+#include  "AppUIAppUi.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMainMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CMainMenuView::ConstructL()
+    {
+    BaseConstructL( R_APPUI_MAINMENUVIEW );
+    }
+
+// ---------------------------------------------------------
+// CMainMenuView::~CMainMenuView
+// 
+// Destructor
+// ---------------------------------------------------------
+//
+CMainMenuView::~CMainMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ---------------------------------------------------------
+// TUid CMainMenuView::Id
+// 
+// Returns view´s id.
+// ---------------------------------------------------------
+//
+TUid CMainMenuView::Id() const
+    {
+    return TUid::Uid(EMainMenuViewId); //KMainMenuViewId;
+    }
+
+// ---------------------------------------------------------
+// CMainMenuView::HandleCommandL
+// 
+// Handles a command.
+// ---------------------------------------------------------
+//
+void CMainMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EEikCmdExit);
+            break;
+            }
+		case EAknCmdOpen:
+			{
+			TInt a = iContainer->GetActiveLine();
+			iContainer->HandleSelectedListItemL( a );
+			}
+			break;              
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMainMenuView::HandleClientRectChange
+//
+// Handles client rect changes.
+// ---------------------------------------------------------
+//
+void CMainMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CMainMenuView::DoActivateL
+//
+// Initializes view when activated.
+// ---------------------------------------------------------
+//
+void CMainMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CMainMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+    CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+		
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_MAIN);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	
+	np->PushL(*iNaviDecorator);
+   }
+
+// ---------------------------------------------------------
+// CAppUIView::DoDeactivate
+// 
+// Deactivates view.
+// ---------------------------------------------------------
+//
+void CMainMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// End of File
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/MenuListBox.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CMenuListBox class definition.
+*
+*/
+
+// INCLUDE FILES
+#include "MenuListBox.h"
+#include <aknview.h>
+
+// ================= MEMBER FUNCTIONS =======================
+// ---------------------------------------------------------
+// CMainMenuView::CMenuListBox
+// 
+// c++ constructor
+// ---------------------------------------------------------
+//
+CMenuListBox::CMenuListBox(TAppUIViewNumber aViewId) 
+	: CAknSingleStyleListBox(), iViewId(aViewId)
+	{
+	}
+
+// ---------------------------------------------------------
+// CMenuListBox::ConstructL
+// 
+// Symbian OS two-phased constructor
+// ---------------------------------------------------------
+//
+void CMenuListBox::ConstructL()
+	{
+	
+	}
+
+// ---------------------------------------------------------
+// CMenuListBox::~CMenuListBox
+// 
+// Destructor
+// ---------------------------------------------------------
+//
+CMenuListBox::~CMenuListBox()
+	{
+
+	}
+
+// ---------------------------------------------------------
+// CMenuListBox::NewL
+// 
+// Symbian OS public constructor
+// @param aViewId - id of view to identify position in array where focus position will be saved to
+// or retrieved from
+//
+// @return - pointer to an instance of CMenuListBOx
+// ---------------------------------------------------------
+//
+CMenuListBox* CMenuListBox::NewL(TAppUIViewNumber aViewId)
+	{
+	CMenuListBox* self = new(ELeave) CMenuListBox(aViewId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------
+// CMenuListBox::SaveFocusPosition
+// 
+// Saves current focus position to CAppUiAppUi object
+// ---------------------------------------------------------
+//
+void CMenuListBox::SaveFocusPosition()
+	{
+	((CAppUIAppUi*)iCoeEnv->AppUi())->SaveFocusPosition(iViewId, this->CurrentItemIndex());
+	}
+
+// ---------------------------------------------------------
+// CMenuListBox::SetPreviousFocus
+// 
+// Retrieves previous focus position from CAppUiAppUi object and sets focus
+// to that position
+// ---------------------------------------------------------
+//
+void CMenuListBox::SetPreviousFocus()
+	{
+	TInt previousPosition = ((CAppUIAppUi*)iCoeEnv->AppUi())->GetFocusPosition(iViewId);
+	if(previousPosition != KErrNotFound)
+		{
+		if(previousPosition < this->Model()->NumberOfItems() && previousPosition != 0)
+			{
+			this->SetCurrentItemIndex(previousPosition);
+			}
+		if(previousPosition >= this->Model()->NumberOfItems()) 
+			{
+			this->SetCurrentItemIndex(0); // setting current item to first element if pervious position is grater then current. 
+			}
+		this->SetTopItemIndex(0);
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/ShowStartedCasesContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,648 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedTestsListBoxModel class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h>  // CAknIconArray
+#include <badesca.h> // CDesCArray
+#include <eikclbd.h> // CColumnListBoxData
+#include <aknnotewrappers.h>
+
+#include <Stifui.rsg>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include "ShowStartedCasesContainer.h"
+
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ---------------------------------------------------------
+// CStartedTestsListBoxModel::NewL
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------
+//
+CStartedTestsListBoxModel* CStartedTestsListBoxModel::NewL 
+            ( RRefArray<CStartedTestCase>* aTestCasesInView )
+    {
+    CStartedTestsListBoxModel* self = new ( ELeave ) CStartedTestsListBoxModel();
+    CleanupStack::PushL( self );
+    self->iBuffer = HBufC::NewL( 130 );
+    self->iTestCasesInView = aTestCasesInView;
+    CleanupStack::Pop();
+    return self;
+
+    }
+
+// ---------------------------------------------------------
+// CStartedTestsListBoxModel::ConstructL
+// 
+// Symbian OS two phased constructor
+// Completes the construction of the object.
+// ---------------------------------------------------------
+//
+
+void CStartedTestsListBoxModel::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------
+// CStartedTestsListBoxModel::~CStartedTestsListBoxModel
+// 
+// Destructor
+// ---------------------------------------------------------
+//
+
+CStartedTestsListBoxModel::~CStartedTestsListBoxModel()
+    {
+    }
+
+// ---------------------------------------------------------
+// CStartedTestsListBoxModel::MdcaCount
+// 
+// Returns the number of descriptor elements in the array.
+// ---------------------------------------------------------
+//
+
+TInt CStartedTestsListBoxModel::MdcaCount() const
+    {
+    return iTestCasesInView->Count();
+
+    }
+
+// ---------------------------------------------------------
+// CStartedTestsListBoxModel::MdcaPoint
+// 
+// Indexes into a descriptor array.
+// ---------------------------------------------------------
+//
+TPtrC CStartedTestsListBoxModel::MdcaPoint(TInt aIndex) const
+    {
+    TPtr buffer( iBuffer->Des() );
+    buffer.Zero();
+    switch ( (*iTestCasesInView)[aIndex].Status() )
+        {
+        case CUIStoreIf::EStatusRunning:
+            {
+            if( (*iTestCasesInView)[aIndex].UIEngineContainer().State() ==
+                CUIEngineContainer::ERunning )
+                {
+                buffer.Append(_L("Running\t"));
+                }
+            else
+                {
+                buffer.Append(_L("Paused\t"));
+                }
+            break;
+            }
+        case CUIStoreIf::EStatusPassed:
+            {
+            buffer.Append(_L("Passed\t"));
+            break;
+            }
+        case CUIStoreIf::EStatusFailed:
+            {
+            buffer.Append(_L("Failed\t"));
+            break;
+            }
+        /*case ECrashed:
+            buffer.Append(_L("Crashed\t"));
+            break;*/
+        case CUIStoreIf::EStatusAborted:
+        	{
+            buffer.Append(_L("Aborted\t"));
+            break;
+        	}
+        default:
+        	{
+            if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusPassed)
+            	{
+            	buffer.Append(_L("Passed\t"));
+            	}
+        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusFailed)
+            	{
+            	buffer.Append(_L("Failed\t"));
+            	}
+        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusAborted)
+            	{
+            	buffer.Append(_L("Aborted\t"));
+            	}
+        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusCrashed)
+	        	{
+	            buffer.Append(_L("Crashed\t"));
+	        	}
+        	else
+        		{
+        		buffer.Append(_L("\t"));
+        		}
+        	break;
+        	}
+        }
+        
+    buffer.Append((*iTestCasesInView)[aIndex].TestInfo().TestCaseTitle() );
+    
+    return *iBuffer;
+    
+    }
+
+
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::ConstructL
+// 
+// Symbian OS two phased constructor
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+    
+    if(KSelectedMode == EShowOngoingCases || KSelectedMode == EShowPausedCases
+    		|| KSelectedMode == EShowCrashedAbortedCases  || KSelectedMode == EShowAllStartedCases)
+    	{
+    	iListBox = new (ELeave) CAknSingleHeadingStyleListBox();
+    	}
+    else
+    	{
+    	iListBox = CMenuListBox::NewL(EShowStartedCasesViewId); //CAknSingleStyleListBox();
+    	}
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver );
+    iListBox->ConstructL(this, EAknListBoxSelectionList);
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+    if ( iUIStore )
+        {
+        ConstructListBoxModelL();
+        iListBoxModel = CStartedTestsListBoxModel::NewL( &iStartedTestsPtrs );
+        iListBox->Model()->SetItemTextArray(iListBoxModel);
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+	iListBox->ActivateL();
+	if(KSelectedMode != EShowOngoingCases && KSelectedMode != EShowPausedCases
+	    	&& KSelectedMode != EShowCrashedAbortedCases  && KSelectedMode != EShowAllStartedCases)
+		{
+		((CMenuListBox*)iListBox)->SetPreviousFocus();
+		}
+
+    SetRect(aRect);
+    ActivateL();
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::ConstructListBoxModelL
+// 
+// Constructs list box model without any filtering.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::ConstructListBoxModelL()
+    {
+    TInt ret( 0 );
+    RRefArray<CStartedTestCase> startedTestCases;
+    ret = iUIStore->StartedTestCases( startedTestCases );
+    if( KErrNone != ret )
+        {
+        startedTestCases.Reset();
+        startedTestCases.Close();
+        User::Leave( ret );
+        }
+    CleanupClosePushL( startedTestCases ); // Closes the handle
+
+    const TInt KStartedCaseCount = startedTestCases.Count();
+
+    iStartedTestsPtrs.Reset(); // Remove all pointers (does not delete objects)
+
+    const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+
+    // Loop through all started cases
+    for( TInt i=0; i < KStartedCaseCount; i++ )
+        {
+        switch ( KSelectedMode )
+            {
+            case EShowAllStartedCases:
+                {
+                iStartedTestsPtrs.Append( startedTestCases[i] );
+                break;
+                }
+            case EShowOngoingCases:
+                {
+                // Note: PAUSE IS ALSO RUNNIN STATUS
+                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusRunning )
+                    {
+                    iStartedTestsPtrs.Append(startedTestCases[i]);
+                    }
+                break;
+                }
+            case EShowPassedCases:
+                {
+                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusPassed )
+                    {
+                    iStartedTestsPtrs.Append( startedTestCases[i] );
+                    }
+                break;
+                }
+            case EShowPausedCases:
+                {
+                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusRunning )
+                    {
+                    if( startedTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused )
+                        {
+                        iStartedTestsPtrs.Append( startedTestCases[i] );
+                        }
+                    }
+                break;
+                }
+            case EShowFailedCases:
+                {
+                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusFailed )
+                    {
+                    iStartedTestsPtrs.Append( startedTestCases[i] );
+                    }
+                break;
+                }
+            case EShowCrashedAbortedCases:
+                {
+                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusAborted 
+                		|| startedTestCases[i].Status() & CUIStoreIf::EStatusCrashed)
+                    {
+                    iStartedTestsPtrs.Append( startedTestCases[i] );
+                    }
+                break;
+                }
+            }
+        }
+    startedTestCases.Reset();
+    startedTestCases.Close();
+
+    CleanupStack::PopAndDestroy(); // startedTestCases
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::~CShowStartedCasesContainer
+// 
+// Destructor
+// ---------------------------------------------------------
+//
+CShowStartedCasesContainer::~CShowStartedCasesContainer()
+    {
+    iStartedTestsPtrs.Close(); // does not delete objects whose pointers are contained in the array
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::SizeChanged
+// 
+// Called by framework when the view size is changed
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::CountComponentControls
+//
+// Gets a count of the component controls of this list box control.
+// ---------------------------------------------------------
+//
+TInt CShowStartedCasesContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::ComponentControl
+//
+// Gets a pointer to the specified component control.
+// ---------------------------------------------------------
+//
+CCoeControl* CShowStartedCasesContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::Draw
+// 
+// Draw a control, called by window server.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ---------------------------------------------------------
+//
+TKeyResponse CShowStartedCasesContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+	if (iListBox)
+		{
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+		
+	}
+	
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::SelectedTestCase
+// 
+// Returns reference to currently selected test case in view (listbox).
+// ---------------------------------------------------------
+//
+CStartedTestCase* CShowStartedCasesContainer::SelectedTestCase()
+    {
+    if ( iStartedTestsPtrs.Count() > 0 )
+        {
+        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::DrawListBox
+// 
+// Refresh ListBox, if aSelectedTestCase is still found from ListBox
+// it is set as selected test case.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::DrawListBox()
+    {
+    if ( iListBox )
+        {
+        iListBox->DrawNow();
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::HandleItemAdditionL
+// 
+// Refresh ListBox after new item was added to listbox model.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::HandleItemAdditionL()
+    {
+    iListBox->HandleItemAdditionL();
+
+    }
+
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::HandleItemRemovalL
+// 
+// Refresh ListBox after item is removed from listbox model.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::HandleItemRemovalL()
+    {
+    iListBox->HandleItemRemovalL();
+
+    // HandleItemRemovalL "loses selection" if current item is removed
+    // -> we have to check it and set one item as current item to make it possible for
+    // user to select one item from items left after remove
+    if ( iListBox->CurrentItemIndex() == -1 ) // No item selected
+        if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount() > 0 ) // there are items
+            SetCurrentItemIndex(0);
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::TestsInViewCount
+// 
+// Returns count of test cases in view.
+// ---------------------------------------------------------
+//
+TInt CShowStartedCasesContainer::TestsInViewCount()
+    {
+    return ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
+
+    }
+    
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::CurrentTestCase
+// 
+// Returns pointer to currently selected test case.
+// ---------------------------------------------------------
+//
+CStartedTestCase* CShowStartedCasesContainer::CurrentTestCase()
+    {
+    return &iStartedTestsPtrs[ iListBox->CurrentItemIndex() ];
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::SetCurrentItemIndex
+// 
+// Sets the current item.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::SetCurrentItemIndex(TInt aIndex)
+    {
+    TInt itemCount = ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
+    if ( aIndex < itemCount )
+        {
+        iListBox->SetCurrentItemIndex(aIndex);
+        }
+    else
+        {
+        iListBox->SetCurrentItemIndex(itemCount);
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::ResetListBox
+// 
+// Resets the selection indices, top and current item indices,
+// the selection, and the horizontal scroll offset of this list box.
+// This function does not redraw the list box.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::ResetListBox()
+    {
+    iListBox->Reset();
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::RemoveSelectedExecutionsL
+// 
+// Removes items from list box.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::RemoveSelectedExecutionsL()
+    {
+    TInt indexOfRemovedExecution = 0;
+    iStartedTestsPtrs.Remove(indexOfRemovedExecution);
+    HandleItemRemovalL();
+
+    }
+
+// ---------------------------------------------------------
+// CShowStartedCasesContainer::RemoveAllExecutionsInViewL
+// 
+// Removes all started test cases from list box.
+// ---------------------------------------------------------
+//
+void CShowStartedCasesContainer::RemoveAllExecutionsInViewL()
+    {
+    TInt exutionsInViewCount = iStartedTestsPtrs.Count();
+    iStartedTestsPtrs.Reset(); //Empties the array, does not delete the objects whose pointers are contained in the array
+    HandleItemRemovalL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::FilterCasesByModuleL
+// 
+// Show only testcases which are defined is specified module.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesContainer::FilterCasesByModuleL(TName aModuleName)
+    {
+    //First the list box model have to be reconstructed to make sure that all
+    //possible earlier filtering does not affect
+    ConstructListBoxModelL();
+    
+    TInt i;
+    const TInt KCurrentShowedCaseCount = iStartedTestsPtrs.Count();
+
+    for ( i = KCurrentShowedCaseCount-1; i >= 0; i-- )
+        {
+        RRefArray<CStartedTestCase> startedTestCases;
+        TInt ret = iUIStore->StartedTestCases( startedTestCases );
+        if( ret != KErrNone )
+            {
+            startedTestCases.Reset();
+            startedTestCases.Close();
+            }
+        if ( startedTestCases[i].TestInfo().ModuleName() != aModuleName )
+            {
+            iStartedTestsPtrs.Remove(i); // delete pointer to CStartedTestCase
+            }
+        startedTestCases.Reset();
+        startedTestCases.Close();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::FilterCasesByTCFileNameL
+// 
+// Show only testcases which are defined is specified test case file.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesContainer::FilterCasesByTCFileNameL(TFileName aTestCaseFileName)
+    {
+
+    //First the list box model have to be reconstructed to make sure that all
+    //possible earlier filtering does not affect
+    ConstructListBoxModelL();
+
+    const TInt KCurrentShowedCaseCount = iStartedTestsPtrs.Count();
+
+    for ( TInt i = KCurrentShowedCaseCount-1; i >= 0; i-- )
+        {
+        RRefArray<CStartedTestCase> startedTestCases;
+        TInt ret = iUIStore->StartedTestCases( startedTestCases );
+        if( ret != KErrNone )
+            {
+            startedTestCases.Reset();
+            startedTestCases.Close();
+            }
+        if ( startedTestCases[i].TestInfo().TestCaseFile() != aTestCaseFileName )
+            {
+            iStartedTestsPtrs.Remove(i); // delete pointer to CStartedTestCase
+            }
+        startedTestCases.Reset();
+        startedTestCases.Close();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CContainer::NoFilteringL
+// 
+// Remove possible filtering of test cases -> show all test cases.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesContainer::NoFilteringL()
+    {
+    ConstructListBoxModelL();
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesContainer:::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/ShowStartedCasesView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,668 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CShowStartedCasesView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+
+//#include  "UIEngineContainer.h"  
+#include <stifinternal/UIEngineContainer.h>
+
+#include  "Stifui.hrh" 
+#include  "ShowStartedCasesView.h"
+#include  "ShowStartedCasesContainer.h"
+#include  "AppUIAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::ConstructL
+// 
+// Symbian OS two-phased constructor
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_SHOWSTARTEDCASESVIEW );
+    iFilterModule.Zero();
+    iFilterTestCaseFile.Zero();
+    iSelectedTestCase=0;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::~CShowStartedCasesView()
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CShowStartedCasesView::~CShowStartedCasesView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// TUid CShowStartedCasesView::Id()
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CShowStartedCasesView::Id() const
+    {
+    return TUid::Uid(EShowStartedCasesViewId);
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::HandleCommandL(TInt aCommand)
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::HandleCommandL(TInt aCommand)
+    {   
+    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile )
+        {
+        TInt moduleNumber = aCommand - ECmdFilterByModule;
+        RRefArray<TDesC> testModules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( testModules );
+        if( KErrNone != ret )
+            {
+            testModules.Reset();
+            testModules.Close();
+            User::Leave( ret );
+            }
+        iFilterModule = testModules[moduleNumber];
+            
+        iFilterTestCaseFile.Zero();
+        
+        iContainer->FilterCasesByModuleL(iFilterModule);
+        //iContainer->ResetListBox();
+        //iContainer->DrawListBox();
+        
+        testModules.Reset();
+        testModules.Close();
+
+        return;
+        }
+
+    else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
+        {
+        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }
+
+        iFilterTestCaseFile = testCaseFiles[ testCaseFileNumber ];
+        iFilterModule.Zero();
+        //iContainer->FilterCasesByTCFileNameL(testCaseFileName);
+        iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
+        iContainer->ResetListBox();
+        iContainer->DrawListBox();
+
+        testCaseFiles.Reset();
+        testCaseFiles.Close();
+
+        return;
+        }
+
+    else if ( aCommand == ECmdNOFiltering )
+        {
+        iFilterModule.Zero();
+        iFilterTestCaseFile.Zero();
+        iContainer->NoFilteringL();
+        iContainer->ResetListBox();
+        iContainer->DrawListBox();
+        return;
+        }
+
+    // Handle rest possible commands
+    switch ( aCommand )
+        {
+        case ECmdViewOutput:
+            {
+            ViewTestCaseOutputL();
+            break;
+            }
+        case ECmdRemoveExecution:
+            {
+            iContainer->RemoveSelectedExecutionsL();
+            break;
+            }
+        case ECmdRemoveAllExecutions:
+            {
+            iContainer->RemoveAllExecutionsInViewL();
+            break;
+            }
+        case ECmdPauseTestCase:
+            {
+            TInt index = iContainer->CurrentItemIndex();
+            RRefArray<CStartedTestCase> runningTestCases;
+            TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+			TInt ret = KErrNone;
+			if(currentMode == EShowAllStartedCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
+			else if(currentMode == EShowOngoingCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
+ 			if( KErrNone != ret )
+ 			    {
+ 			    User::Leave( ret );
+ 			    }
+ 			runningTestCases[index].UIEngineContainer().PauseTest();
+ 			runningTestCases.Close();
+            break;
+            }
+        case ECmdResumeTestCase:
+            {
+            TInt index = iContainer->CurrentItemIndex();
+            RRefArray<CStartedTestCase> runningTestCases;
+            TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+			TInt ret = KErrNone;
+			if(currentMode == EShowAllStartedCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
+			else if(currentMode == EShowOngoingCases || currentMode == EShowPausedCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
+ 			if( KErrNone != ret )
+ 			    {
+ 			    User::Leave( ret );
+ 			    }
+ 			TInt testCaseToControl = 0;
+ 			if(currentMode == EShowAllStartedCases || currentMode == EShowOngoingCases)
+				{
+				testCaseToControl = index;
+				}
+			else if(currentMode == EShowPausedCases)
+				{
+				TInt pausedTestCasesCounter = 0;
+				for(int i = 0; i < runningTestCases.Count(); i++)
+					{
+					if(runningTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused)
+						{
+						if(pausedTestCasesCounter == index)
+							{
+							testCaseToControl = i;
+							break;
+							}
+						pausedTestCasesCounter++;
+						}
+					}
+				}
+ 			
+ 			runningTestCases[testCaseToControl].UIEngineContainer().ResumeTest();
+ 			runningTestCases.Close();
+            break;
+            }
+        case ECmdAbortTestCase:
+            { 
+			TInt index = iContainer->CurrentItemIndex();
+			RRefArray<CStartedTestCase> runningTestCases;
+			TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+			TInt ret = KErrNone;
+			if(currentMode == EShowAllStartedCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
+			else if(currentMode == EShowOngoingCases || currentMode == EShowPausedCases)
+				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
+				
+			if( KErrNone != ret )
+			    {
+			    User::Leave( ret );
+			    }
+			TInt testCaseToControl = 0;
+			
+			if(currentMode == EShowAllStartedCases || currentMode == EShowOngoingCases)
+				{
+				testCaseToControl = index;
+				}
+			else if(currentMode == EShowPausedCases)
+				{
+				TInt pausedTestCasesCounter = 0;
+				for(int i = 0; i < runningTestCases.Count(); i++)
+					{
+					if(runningTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused)
+						{
+						if(pausedTestCasesCounter == index)
+							{
+							testCaseToControl = i;
+							break;
+							}
+						pausedTestCasesCounter++;
+						}
+					}
+				}
+			
+			runningTestCases[testCaseToControl].UIEngineContainer().CancelTest();
+			runningTestCases.Close();
+            break;
+            }
+        case EAknSoftkeyOk:
+            {
+            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
+            break;
+            }
+        case EAknSoftkeyBack:
+            {
+            // Remove possible filterings so that they does not affect when coming again to this view
+            iFilterModule.Zero();
+            iFilterTestCaseFile.Zero();
+            iSelectedTestCase=0; //Reset selected test case information
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        ViewTestCaseOutputL();
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::ViewTestCaseOutputL
+// 
+// Shows outputs of test case which is selected in Container.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::ViewTestCaseOutputL()
+	{
+    iSelectedTestCase = iContainer->CurrentItemIndex();
+    
+    // Sets index  of selected test case to AppUi
+    //( ( CAppUIAppUi* )AppUi() )->SetTestCaseIndex( iSelectedTestCase );
+    ( ( CAppUIAppUi* )AppUi() )->SetStartedTestCase( iContainer->CurrentTestCase() );
+    
+    AppUi()->HandleCommandL(ECmdViewOutput);
+    }
+
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::HandleClientRectChange()
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CShowStartedCasesContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+
+    // Check if filtering by module or by test case file is selected
+    if ( iFilterModule.Length() )
+        {
+        iContainer->FilterCasesByModuleL(iFilterModule);
+        }
+    else if ( iFilterTestCaseFile.Length() )
+        {
+        iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
+        }
+    if ( iSelectedTestCase )
+        iContainer->SetCurrentItemIndex(iSelectedTestCase);
+    
+    RefreshNaviTitleL();
+    
+    iContainer->DrawListBox();
+   }
+
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::RefreshNaviTitle
+// 
+// Refreshes view name shown in the navi pane.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::RefreshNaviTitleL()
+    {
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	TResourceReader reader;
+
+    switch ( ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode )
+        {
+        case EShowAllStartedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ALL);
+            break;
+        case EShowOngoingCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ONGOING);
+            break;
+        case EShowPausedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PAUSED);
+            break;
+        case EShowPassedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PASSED);
+            break;
+        case EShowFailedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_FAILED);
+            break;
+        case EShowCrashedAbortedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_CRASHED_ABORTED);
+            break;
+        default:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET);
+            break;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;        
+    iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+    }
+    
+    
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        TInt mode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+        if(mode != EShowOngoingCases && mode != EShowPausedCases
+		    	&& mode != EShowCrashedAbortedCases  && mode != EShowAllStartedCases)
+        	{
+        	iContainer->SaveActiveLine();
+        	}
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;        
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+
+    }
+
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    // options menu
+    if ( R_APPUI_SHOWSTARTEDCASESVIEW_MENU == aResourceId )
+        {
+        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+        if ( NULL != startedTestCase )
+            {
+            aMenuPane->SetItemDimmed( ECmdFilterMenu, EFalse );
+            switch ( startedTestCase->Status() )
+                {
+                // test case running
+                case CUIStoreIf::EStatusRunning:
+                    {
+                    switch ( startedTestCase->UIEngineContainer().State() )
+                        {
+                        case CUIEngineContainer::ERunning:
+                        case CUIEngineContainer::EPaused:
+                            {
+                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, EFalse );
+                            break;
+                            }
+                        //case CUIEngineContainer::ENotStarted:
+                        //case CUIEngineContainer::EExecuted:
+                        //case CUIEngineContainer::EFinished:
+                        default:
+                            {
+                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+                            }
+                        }
+                    break;
+                    }
+                        
+                // test case not running
+                //case CUIStoreIf::EStatusPassed:
+                //case CUIStoreIf::EStatusFailed:
+                //case CUIStoreIf::EStatusAborted:
+                //case CUIStoreIf::EStatusExecuted
+                default:
+                    {
+                    aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+                    }
+                }
+            }
+        else
+            {
+            //aMenuPane->SetItemDimmed( ECmdFilterMenu, ETrue );
+            aMenuPane->SetItemDimmed( ECmdViewOutput, ETrue );
+            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+            }
+        }
+
+    // test case control menu
+    if ( R_TESTCASE_CONTROL_SUBMENU == aResourceId )
+        {
+        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+        
+        if ( NULL != startedTestCase )
+            {
+            if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
+                {
+                switch ( startedTestCase->UIEngineContainer().State() )
+                    {
+                    case CUIEngineContainer::ERunning:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
+                        break;
+                        }
+                    case CUIEngineContainer::EPaused:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
+                        break;
+                        }
+                    //case CUIEngineContainer::ENotStarted:
+                    //case CUIEngineContainer::EExecuted:
+                    //case CUIEngineContainer::EFinished:
+                    default:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                        break;
+                        }
+                    }
+                }
+            else
+                {
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                }
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+            }
+        }
+
+    // Test modules are added to filter by test module submenu if the submenu is opened
+    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testModules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( testModules );
+        if( KErrNone != ret )
+            {
+            testModules.Reset();
+            testModules.Close();
+            User::Leave( ret );
+            }        
+        TInt moduleCount = testModules.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByModule;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < moduleCount; i++)
+            {
+            item.iText = testModules[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
+            }
+        
+        testModules.Reset();
+        testModules.Close();
+
+        }
+
+    // Test case files are added to filter by test case file submenu if the submenu is opened
+    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }        
+        TInt testCaseFileCount = testCaseFiles.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByTestCaseFile;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < testCaseFileCount; i++)
+            {
+            item.iText = testCaseFiles[i];
+            // If there´s no test case file, don´t add item to menu.
+            if ( testCaseFiles[i].Length() > 0 )
+                {
+                aMenuPane->AddMenuItemL(item);
+                }
+            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
+            }
+        
+        testCaseFiles.Reset();
+        testCaseFiles.Close();
+
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CShowStartedCasesView::TestCaseStateChangedL
+// 
+// Handles status changes of test cases in view.
+// ----------------------------------------------------------------------------
+//
+void CShowStartedCasesView::TestCaseStateChangedL()
+    {
+    if ( iContainer )
+        {
+
+        //CStartedTestCase* currentlySelectedTest = iContainer->SelectedTestCase();
+
+        TInt numOfTestsInViewBeforeStateChange = iContainer->TestsInViewCount();
+
+            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
+
+        iContainer->ConstructListBoxModelL();
+
+        // Check if filtering by module or by test case file is selected
+        if ( iFilterModule.Length() )
+            {
+            iContainer->FilterCasesByModuleL(iFilterModule);
+            }
+        else if ( iFilterTestCaseFile.Length() )
+            {
+            iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
+            }
+
+        TInt numOfTestsInViewAfterStateChange = iContainer->TestsInViewCount();
+            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
+
+        if ( numOfTestsInViewAfterStateChange >= numOfTestsInViewBeforeStateChange )
+            iContainer->HandleItemAdditionL();
+        else
+            iContainer->HandleItemRemovalL();
+        
+        if(iContainer->CurrentItemIndex() < 0)
+        	{
+        	iContainer->SetCurrentItemIndex(0);
+        	}
+        iContainer->DrawListBox();
+
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StartCasesContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,227 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartCasesContainer class 
+* definition
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>   // ListBox
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> // CColumnListBoxData
+
+#include "StartCasesContainer.h"
+#include "StartCasesView.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "Container.h"
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ConstructL"));
+
+	iParentView = (CStartCasesView*)aListBoxObserver;
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    iTestCasesInView.Reset();
+        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: iTCInV Reset"));
+    
+	iListBox = CMenuListBox::NewL(EStartCaseMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
+    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+    if ( iUIStore )
+        {
+        RRefArray<CTestInfo> allCases;
+        TInt ret = iUIStore->TestCases( allCases );
+        if( KErrNone != ret )
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
+            allCases.Reset();
+            allCases.Close();
+            User::Leave( ret );
+            }
+
+        const TInt KTestCaseCount = allCases.Count();
+        for (TInt i=0; i < KTestCaseCount; i++)
+            {
+            ret = iTestCasesInView.Append( &allCases[i] );
+            if( ret != KErrNone )
+            	{
+            	((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("Test case append fails with: %d"), ret );
+    			User::Leave( ret );
+	            }
+            }
+
+        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model"));
+
+        iListBox->Model()->SetItemTextArray(iListBoxModel);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model set"));
+
+        allCases.Reset();
+        allCases.Close();
+        }
+    else
+        {
+        User::Leave( KErrGeneral );
+        }
+
+    // Creates graphic.
+    SetGraphicIconL( iListBox );
+       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: icons created"));
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::~CStartCasesContainer
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CStartCasesContainer::~CStartCasesContainer()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CStartCasesContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CStartCasesContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CStartCasesContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+	if (iListBox)
+		{
+		//if multiple items selected
+		if ( iListBox->SelectionIndexes()->Count() > 0 )
+			{
+			TUint mask = 0x40488;
+			
+			//if event is enter key,
+			//don´t send it to listbox
+			if ( aKeyEvent.iScanCode == 0xa7 
+				&& ( aKeyEvent.iModifiers & mask ) == 0 )
+				{
+				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
+				return EKeyWasConsumed;	
+				}
+			}
+			
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesContainer:::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CStartCasesContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StartCasesView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,457 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartCasesView class definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <aknlistquerydialog.h> 
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "StartCasesView.h"
+#include  "StartCasesContainer.h"
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStartCasesView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_STARTCASESVIEW );
+    iCurrentTestCase = 0;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::~CStartCasesView
+// 
+// Destructor
+// ----------------------------------------------------------------------------
+//
+CStartCasesView::~CStartCasesView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CStartCasesView::Id() const
+    {
+    return TUid::Uid(EStartCaseMenuViewId);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::HandleCommandL(TInt aCommand)
+    {   
+    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
+        {
+        TInt moduleNumber = aCommand - ECmdFilterByModule;
+        RRefArray<TDesC> allModules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
+        if( KErrNone != ret )
+            {
+            allModules.Reset();
+            allModules.Close();
+            User::Leave( ret );
+            }
+        TName moduleName = allModules[ moduleNumber ];
+
+        iContainer->FilterCasesByModuleL( moduleName );
+
+        allModules.Reset();
+        allModules.Close();
+        }
+	else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
+        {
+        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
+        RRefArray<TDesC> allTestCases;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( allTestCases );
+        if( KErrNone != ret )
+            {
+            allTestCases.Reset();
+            allTestCases.Close();
+            User::Leave( ret );
+            }
+        TFileName testCaseFileName = allTestCases[ testCaseFileNumber ];
+
+        iContainer->FilterCasesByTCFileNameL( testCaseFileName );
+
+        allTestCases.Reset();
+        allTestCases.Close();
+        }
+	else if ( aCommand == ECmdNOFiltering )
+        {
+        iContainer->NoFilteringL();
+        }
+    else if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
+    	|| aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
+    	{
+    	iContainer->HandleMarkCommandL( aCommand );
+    	}
+    else
+	    {
+ 	    switch ( aCommand )
+	        {
+	        case ECmdStartCases:
+	            {
+	            CheckListBoxSelectionsL( iContainer->ListBox() );
+	            break;
+	            }
+	        case EAknSoftkeyBack:
+	            {
+	            iCurrentTestCase = 0;
+	            AppUi()->HandleCommandL(EAppUIGoBack);
+	            break;
+	            }
+	        default:
+	            {
+	            AppUi()->HandleCommandL( aCommand );
+	            break;
+	            }
+	        }
+	    }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StartCasesView: DoActivateL"));
+        iContainer = new (ELeave) CStartCasesContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StartCasesView: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+
+    iContainer->SetCurrentItemIndex(iCurrentTestCase);
+    
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTCASES);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+
+    // Test modules are added to filter by test module submenu if the submenu is opened
+    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
+        {
+        RRefArray<TDesC> modules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
+        if( KErrNone != ret )
+            {
+            modules.Reset();
+            modules.Close();
+            User::Leave( ret );
+            }
+
+        TInt moduleCount = modules.Count();
+        
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByModule;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < moduleCount; i++)
+            {
+            //item.iText = modules[i].iModuleName;
+            item.iText.Copy( modules[i].Left( item.iText.MaxLength() ) ) ;
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
+            }
+        
+        modules.Reset();
+        modules.Close();
+
+        }
+
+    // Test case files are added to filter by test case file submenu if the submenu is opened
+    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }
+
+        TInt testCaseFileCount = testCaseFiles.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByTestCaseFile;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < testCaseFileCount; i++)
+            {
+            item.iText.Copy( testCaseFiles[i].Left( item.iText.MaxLength() ) );
+            // If there´s no test case file, don´t add item to menu.
+            if ( testCaseFiles[i].Length() > 0 )
+                {
+                aMenuPane->AddMenuItemL(item);
+                }
+            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
+            }
+        
+        testCaseFiles.Reset();
+        testCaseFiles.Close();
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::HandleListBoxEventL( CEikListBox* aListBox, 
+    TListBoxEvent aEventType )
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+		CheckListBoxSelectionsL( aListBox );
+        }
+        
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::CheckListBoxSelectionsL
+// 
+// Checks listbox selections and launches query dialog to start test cases.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::CheckListBoxSelectionsL( CEikListBox* aListBox )
+    {
+    TInt i(0);
+	TInt count = aListBox->SelectionIndexes()->Count();
+
+	RArray<TInt> selectedIndices;
+	CleanupClosePushL( selectedIndices );
+
+	if ( count > 0 )
+	{
+		for( i = 0; i < count; i++ )
+			{
+			selectedIndices.InsertInOrder( 
+			    (*aListBox->SelectionIndexes())[i] );
+			}
+	}
+	
+	// Check count of selected items.
+	if ( count == 1 )
+		{
+		iCurrentTestCase = selectedIndices[0];
+       	StartTestCaseL();
+		}
+	else if (count > 1)
+		{
+       	StartTestCasesL( selectedIndices );	
+		}
+	else
+		{
+		iCurrentTestCase = iContainer->CurrentItemIndex();
+       	StartTestCaseL();	
+		}
+
+    CleanupStack::PopAndDestroy();
+    
+    }
+    
+// ----------------------------------------------------------------------------
+// CStartCasesView::StartTestCaseL
+// 
+// Starts test case which is selected in containers list box.
+// First shows a list query if user wants just start test case or
+// if he wants to start test case and view test case output.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::StartTestCaseL()
+    {
+    TInt selectedItem(0);
+    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
+    if ( startDialog->ExecuteLD(R_START_TESTCASE_LIST_QUERY) )
+        {
+        CTestInfo* testCaseInfo = iContainer->SelectedTestCaseInfo();
+
+        User::LeaveIfNull( testCaseInfo );
+        
+        TInt testCaseIndex( 0 );
+
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestCase( *testCaseInfo, testCaseIndex );
+      
+        if( KErrNone != ret )
+            {
+            User::Leave( ret );
+            }
+
+        // Increment the counter value
+        ((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
+     
+        if ( selectedItem == 1 ) // if view output was selected
+            {
+            CStartedTestCase* startedCase = 
+                &((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartedTestCaseL( 
+                testCaseIndex );
+            ((CAppUIAppUi*)AppUi())->SetStartedTestCase( startedCase );
+                
+            AppUi()->HandleCommandL( ECmdViewOutput );
+
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStartCasesView::StartTestCasesL
+// 
+// Starts multiple test cases which are selected in containers list box.
+// Shows a list query if user wants to start cases parallel or sequential.
+// ----------------------------------------------------------------------------
+//
+void CStartCasesView::StartTestCasesL( RArray<TInt> aSelectedIndexes )
+    {
+    _LIT( KTempSet, "TempSet");
+    TInt selectedItem(0);
+    TInt i(0);
+    TInt ret(0);
+    
+    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
+    if ( startDialog->ExecuteLD(R_START_MULTIPLE_TESTCASES_LIST_QUERY) )
+    	{
+    	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->CreateTestSet( KTempSet );
+    	
+        User::LeaveIfError( ret );
+        
+        for( i = 0; i < aSelectedIndexes.Count(); i++ )
+        	{
+            CTestInfo* testCaseInfo = iContainer->TestCaseInfo( aSelectedIndexes[i] );
+            User::LeaveIfNull( testCaseInfo );
+        
+    		ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->AddToTestSet( KTempSet, *testCaseInfo );
+    		if( KErrNone != ret )
+    			{
+    			User::Leave( ret );
+    			}
+    		// Increment the counter value
+        	((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
+	        }
+	    
+	    //start cases
+	    if ( selectedItem == 0 )
+	    	{
+			ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestSet( 
+		        ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestSetL( KTempSet ),
+				i, CStartedTestSet::ESetParallel);
+		    }
+	    else if (selectedItem == 1)
+		    {
+	    	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestSet(
+	    	    ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestSetL( KTempSet ),
+	    	    i, CStartedTestSet::ESetSequential);
+	    	}
+
+        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->RemoveTestSet( KTempSet );
+    	}
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StartedCasesMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,234 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedCasesMenuContainer
+* class definition.
+*
+*/
+
+// INCLUDE FILES
+#include "StartedCasesMenuContainer.h"
+#include "Stifui.hrh"
+#include <Stifui.rsg>
+
+#include <aknlists.h>  //ListBox
+#include <barsread.h> // for TResourceReader
+
+#include <aknnotewrappers.h>
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::ConstructL
+// 
+// Symbian OS default constructor.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::ConstructL(
+                    const TRect& aRect )
+    {
+    CreateWindowL();
+
+	iListBox = CMenuListBox::NewL(EStartedCasesMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC( reader, R_STARTED_CASES_MENU_LISTBOX );
+	iListBox->SetListBoxObserver( this ); // jos peritty MEikListBoxObserver:sta
+	//iListBox->SetObserver( this /*iMainMenuObserver*/ ); //jos peritty MCoeControlObserver:sta
+	iListBox->ConstructFromResourceL( reader );
+    CleanupStack::PopAndDestroy(); // resource stuffs. 
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+	iListBox->ActivateL();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// Destructor
+CStartedCasesMenuContainer::~CStartedCasesMenuContainer()
+    {
+    if ( iListBox )
+		{    
+    	iListBox->Reset();
+    	delete iListBox;
+        }	
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CStartedCasesMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CStartedCasesMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::HandleListBoxEventL
+// 
+// Handles list box events.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::HandleListBoxEventL(
+                                CEikListBox* aListBox,
+                                TListBoxEvent aEventType )
+	{
+
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+		    HandleSelectedListItemL( aListBox->CurrentItemIndex() );
+		}
+	}
+
+
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::HandleSelectedListItemL
+// 
+// Method HandleSelectedListItemL handles valid index.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::HandleSelectedListItemL( TInt aIndex )
+	{	 
+		TInt selection = aIndex;
+
+	    switch ( selection )
+			{
+            case 0: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowAllStartedCases);
+				break;
+            case 1:	( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowOngoingCases);
+				break;
+            case 2: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowPausedCases);
+				break;
+            case 3: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowPassedCases);
+				break;
+            case 4: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowFailedCases);
+				break;
+            case 5: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowCrashedAbortedCases);
+				break;
+            case 6: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowStatistics);
+				break;
+	        default:
+				break;
+			}
+	}	
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CStartedCasesMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
+			return EKeyWasNotConsumed;
+            //break;
+            }
+        default:
+			{
+			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
+			if (iListBox)
+				{
+				return iListBox->OfferKeyEventL( aKeyEvent, aType );
+				}
+			}
+        }
+    return EKeyWasNotConsumed;        
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer::GetActiveLine
+// 
+// Get currently selected items index.
+// ----------------------------------------------------------------------------
+//
+TInt CStartedCasesMenuContainer::GetActiveLine()
+	{
+	return iListBox->CurrentItemIndex();
+	}
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuContainer:::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StartedCasesMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStartedCasesMenuView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "StartedCasesMenuView.h"
+#include  "StartedCasesMenuContainer.h"
+#include  "Stifui.hrh" 
+#include  "AppUIAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_STARTEDCASESMENUVIEW );
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::~CStartedCasesMenuView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CStartedCasesMenuView::~CStartedCasesMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CStartedCasesMenuView::Id() const
+    {
+    return TUid::Uid(EStartedCasesMenuViewId); //KTestCaseMenuViewId;
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+		case EAknCmdOpen:
+			{
+			TInt a = iContainer->GetActiveLine();
+			iContainer->HandleSelectedListItemL( a );
+			}
+			break;              
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CStartedCasesMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+        
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTEDCASES);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+   }
+
+// ----------------------------------------------------------------------------
+// CStartedCasesMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CStartedCasesMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StatisticsContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,297 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStatisticsContainer class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>  // ListBox 
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> // CColumnListBoxData
+
+#include <Stifui.rsg>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include "StatisticsContainer.h"
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsContainer::ConstructL( const TRect& aRect, 
+                                        MEikListBoxObserver* aListBoxObserver )
+    {
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(
+                            _L("StatisticsContainer: ConstructL"));
+
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    //iTestCasesInView.Reset();
+        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: iTCInV Reset"));
+    
+	iListBox = CMenuListBox::NewL(EStatisticsViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
+    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+
+    if ( iUIStore )
+        {
+        //RRefArray<CStartedTestCase> allStarted;
+        RRefArray<CStartedTestCase> allStarted;
+        TInt ret = iUIStore->StartedTestCases( allStarted );
+        if( KErrNone != ret )
+            {
+            allStarted.Reset();
+            allStarted.Close();
+            User::Leave( ret );
+            }
+        TInt count = allStarted.Count();
+        // TInt notstarted( 0 );
+        TInt ongoing( 0 );
+        TInt passed( 0 );
+        TInt failed( 0 );
+        TInt other( 0 );
+        //TInt aborted( 0 );
+        // TInt paused( 0 );
+        //TInt crashed( 0 );
+        //TInt executed( 0 );
+        // TInt state( 0 );
+
+        for( TInt a = 0; a < count; a++ )
+            {
+            switch ( allStarted[a].Status() )
+                {
+                case CUIStoreIf::EStatusRunning:
+                    {
+                    ongoing++;
+                    break;
+                    }
+                case CUIStoreIf::EStatusExecuted | CUIStoreIf::EStatusPassed:
+                    {
+                    passed++;
+                    break;
+                    }
+                case CUIStoreIf::EStatusExecuted |CUIStoreIf::EStatusFailed:
+                    {
+                    failed++;
+                    break;
+                    }
+                //case CUIStoreIf::EStatusAborted:
+                //    {
+                //    aborted++;
+                //    break;
+                //    }
+                /*case ECrashed:
+                    {
+                    crashed++;
+                    break;
+                    }
+                */
+                /*case EExecuted:
+                    {
+                    executed++;
+                    break;
+                    }
+                */
+                default:
+                    {
+                    other++;
+                    break;
+                    }
+                }
+            }
+
+        allStarted.Reset();
+        allStarted.Close();
+
+        iTestCaseArray = new (ELeave) CDesC16ArrayFlat(6);
+        iTestCaseArray->Reset();
+
+        HBufC* tmpHBuf = HBufC::NewL( 40 );
+        TPtr buffer( tmpHBuf->Des() );
+
+        buffer = ( _L("\t") );
+        buffer.AppendNum( ongoing );
+        buffer.Append( _L(" Running") );
+        iTestCaseArray->AppendL( buffer );
+
+        buffer = ( _L("\t") );
+        buffer.AppendNum( passed );
+        buffer.Append( _L(" Passed") );
+        iTestCaseArray->AppendL( buffer );
+
+        buffer = ( _L("\t") );
+        buffer.AppendNum( failed );
+        buffer.Append( _L(" Failed") );
+        iTestCaseArray->AppendL( buffer );
+
+        buffer = ( _L("\t") );
+        buffer.AppendNum( other );
+        buffer.Append( _L(" Crashed/Aborted") );
+        iTestCaseArray->AppendL( buffer );
+
+        delete tmpHBuf;
+
+        iListBox->Model()->SetItemTextArray( iTestCaseArray );
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: ListBox model set"));
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+
+    // Creates graphic.
+    //SetGraphicIconL( iListBox );
+    //   ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: icons created"));
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::~CStatisticsContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CStatisticsContainer::~CStatisticsContainer()
+    {
+    //iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
+    //delete iListBox;
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CStatisticsContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+
+CCoeControl* CStatisticsContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CStatisticsContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+	{
+		return EKeyWasNotConsumed;
+	}
+
+	if (iListBox)
+		{
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CStatisticsContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/StatisticsView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,350 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CStatisticsView class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <aknlistquerydialog.h> 
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+#include  "StatisticsView.h"
+#include  "StatisticsContainer.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CStatisticsView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_STATISTICSVIEW );
+    iCurrentTestCase = 0;
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::~CStatisticsView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CStatisticsView::~CStatisticsView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CStatisticsView::Id() const
+    {
+    return TUid::Uid(EStatisticsViewId);
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::HandleCommandL(TInt aCommand)
+    {   
+    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
+        {
+        TInt moduleNumber = aCommand - ECmdFilterByModule;
+
+        RRefArray<TDesC> moduleName;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( moduleName );
+        if( KErrNone != ret )
+            {
+            moduleName.Reset();
+            moduleName.Close();
+            User::Leave( ret );
+            }
+        //iFilterModule = testModules[moduleNumber];
+
+        iContainer->FilterCasesByModuleL( moduleName[moduleNumber] );
+
+        moduleName.Reset();
+        moduleName.Close();
+
+        return;
+        }
+
+    if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
+        {
+        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
+        RRefArray<TDesC> testCaseFileName;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFileName );
+        if( KErrNone != ret )
+            {
+            testCaseFileName.Reset();
+            testCaseFileName.Close();
+            User::Leave( ret );
+            }
+
+        iContainer->FilterCasesByTCFileNameL( testCaseFileName[testCaseFileNumber] );
+
+        testCaseFileName.Reset();
+        testCaseFileName.Close();
+
+        return;
+        }
+
+    if ( aCommand == ECmdNOFiltering )
+        {
+        iContainer->NoFilteringL();
+        return;
+        }
+
+    switch ( aCommand )
+        {
+        case ECmdStartCases:
+            {
+            iCurrentTestCase = iContainer->CurrentItemIndex();
+            StartTestCasesL();
+            break;
+            }
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL( EAppUIGoBack );
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StatisticsView: DoActivateL"));
+        //message = _L("eng.open ret:");
+        //message.AppendNum( ret , EDecimal );
+        //AppUi()->iLogger->Log( message );
+        iContainer = new (ELeave) CStatisticsContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StatisticsView: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+    iContainer->SetCurrentItemIndex(iCurrentTestCase);
+	
+	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_STATS);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+
+    // Test modules are added to filter by test module submenu if the submenu is opened
+    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
+        {
+        RRefArray<TDesC> modules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
+        if( KErrNone != ret )
+            {
+            modules.Reset();
+            modules.Close();
+            User::Leave( ret );
+            }
+
+        TInt moduleCount = modules.Count();
+        
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByModule;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < moduleCount; i++)
+            {
+            item.iText = modules[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
+            }
+        
+        modules.Reset();
+        modules.Close();
+        }
+
+    // Test case files are added to filter by test case file submenu if the submenu is opened
+    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }
+
+        TInt testCaseFileCount = testCaseFiles.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByTestCaseFile;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < testCaseFileCount; i++)
+            {
+            item.iText = testCaseFiles[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
+            }
+
+        testCaseFiles.Reset();
+        testCaseFiles.Close();
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::HandleListBoxEventL
+// 
+// Handles a list box event.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        //iCurrentTestCase = aListBox->CurrentItemIndex();
+        //iCurrentTestCase = iContainer->CurrentItemIndex();
+        //StartTestCases();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CStatisticsView::StartTestCases
+// 
+// Starts test case(s) which is selected in containers list box.
+// First shows a list query if user wants just start test case or
+// if he wants to start test case and view test case output.
+// ----------------------------------------------------------------------------
+//
+void CStatisticsView::StartTestCasesL()
+    {
+    TInt selectedItem(0);
+    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
+    if ( startDialog->ExecuteLD(R_START_TESTCASE_LIST_QUERY) )
+        {
+        RRefArray<CTestInfo> testInfo;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases( testInfo );
+        if( KErrNone != ret )
+            {
+            testInfo.Reset();
+            testInfo.Close();
+            User::Leave( ret );
+            }
+        TInt testCaseNumber = testInfo[0].TestCaseNum();
+        TInt testCaseIndex( 0 );
+
+        //CUIEngineContainer* container = NULL;
+        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestCase( testInfo[testCaseNumber], testCaseIndex );
+        if( KErrNone != ret )
+            {
+            User::Leave( ret );
+            }
+        testInfo.Reset();
+        testInfo.Close();
+
+        // Increment the counter value
+        ((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
+
+        }
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestCaseMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseMenuContainer class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include "TestCaseMenuContainer.h"
+#include "Stifui.hrh"
+#include <Stifui.rsg>
+
+#include <aknlists.h>  //ListBox
+#include <barsread.h> // for TResourceReader
+
+#include <aknnotewrappers.h>
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+     
+	iListBox = CMenuListBox::NewL(ETestCaseMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC( reader, R_TESTCASE_MENU_LISTBOX );
+	iListBox->SetListBoxObserver( this );
+	iListBox->ConstructFromResourceL( reader );
+	CleanupStack::PopAndDestroy(); // resource stuffs. 
+
+    // Create Scroller control for ListBox and set its visibility
+    // !!! Not needed yet because there are only two items in list box.
+    // If items are added later, scroller may be taken to use
+    //iListBox->CreateScrollBarFrameL(ETrue);
+    //iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+    
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// Destructor
+CTestCaseMenuContainer::~CTestCaseMenuContainer()
+    {
+    if ( iListBox )
+		{
+		iListBox->Reset();
+    	delete iListBox;
+    	}	
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestCaseMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestCaseMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::HandleListBoxEventL
+// 
+// Handles list box events.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+		    HandleSelectedListItemL( aListBox->CurrentItemIndex() );
+
+		}	
+
+	}
+	
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::HandleSelectedListItemL
+// 
+// Method HandleSelectedListItemL handles valid index.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::HandleSelectedListItemL( TInt aIndex )
+	{	 
+		TInt selection = aIndex;
+
+	    switch ( selection )
+			{
+		    case 0:
+				//Vaihda StartCasesView aktiiviseksi
+				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdGoToStartCasesView);
+				break;
+			case 1:
+				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdGoToStartedCasesView);
+				break;
+	        default:
+				break;
+			}
+	}	
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestCaseMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+    	{
+		return EKeyWasNotConsumed;
+	    }
+
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
+			return EKeyWasNotConsumed;
+            //break;
+            }
+        default:
+			{
+			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
+			if (iListBox)
+				{
+				return iListBox->OfferKeyEventL( aKeyEvent, aType );
+				}
+			}
+        }     
+    return EKeyWasNotConsumed;        
+}
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::GetActiveLine
+// 
+// Get currently selected items index.
+// ----------------------------------------------------------------------------
+//
+TInt CTestCaseMenuContainer::GetActiveLine()
+	{
+	return iListBox->CurrentItemIndex();
+	}
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestCaseMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,165 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseMenuView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "TestCaseMenuView.h"
+#include  "TestCaseMenuContainer.h"
+#include  "Stifui.hrh" 
+#include  "AppUIAppUi.h" // loggerin kayttoa varten, muuten ei tarvittaisi
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_TESTCASEMENUVIEW );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::~CTestCaseMenuView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestCaseMenuView::~CTestCaseMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestCaseMenuView::Id() const
+    {
+    return TUid::Uid(ETestCaseMenuViewId); //KTestCaseMenuViewId;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+		case EAknCmdOpen:
+			{
+			TInt a = iContainer->GetActiveLine();
+			iContainer->HandleSelectedListItemL( a );
+			}
+			break;             
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestCaseMenu: DoActivateL"));
+        //message = _L("eng.open ret:");
+        //message.AppendNum( ret , EDecimal );
+        //AppUi->iLogger->Log( message );
+        iContainer = new (ELeave) CTestCaseMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestCaseMenu: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+    
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTCASES);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+   }
+
+// ----------------------------------------------------------------------------
+// CTestCaseMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;         
+        }  
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;      
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestCaseOutputContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseOutputContainer class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include "TestCaseOutputContainer.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h>  // CAknIconArray
+#include <badesca.h> // CDesCArray
+#include <eikclbd.h> // CColumnListBoxData
+#include <aknnotewrappers.h>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include "MenuListBox.h"
+
+//#include <gdi.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputContainer::ConstructL(const TRect& aRect, CStartedTestCase* aStartedTestCase ) //TInt aExecutedTestCaseCount )
+    {
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+    
+	iListBox = CMenuListBox::NewL(ETestCaseOutputViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( this );
+    iListBox->ConstructL(this, EAknListBoxSelectionList);
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    
+    if( iUIStore )
+        {
+        iListBoxModel = CTestOutputListBoxModel::NewL( aStartedTestCase );
+        iListBox->Model()->SetItemTextArray( iListBoxModel );
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+	iListBox->ActivateL();
+	((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::~CTestCaseOutputContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestCaseOutputContainer::~CTestCaseOutputContainer()
+    {
+    // Discard and destroy the font
+    //CWindowGc* listBoxGc = iListBox->View()->ItemDrawer()->Gc();
+    //listBoxGc->DiscardFont();
+
+    //CWindowGc& gc = SystemGc();
+    //gc.DiscardFont();
+    
+    //iCoeEnv->ScreenDevice()->ReleaseFont(iListBoxFont);
+
+    delete iListBox;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestCaseOutputContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestCaseOutputContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::HandleListBoxEventL
+// 
+// Handles list box events.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        //TBuf<200> outputLine;
+        //CAknNoteDialog* outputLineNote = new (ELeave) CAknNoteDialog;
+        //outputLineNote->SetTextL( iListBoxModel->MdcaPoint(iListBox->CurrentItemIndex()) );
+        //outputLineNote->RunDlgLD();
+
+
+
+        //CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
+        //informationNote->SetTextL( iListBoxModel->MdcaPoint(iListBox->CurrentItemIndex()) );
+		//informationNote->SetTextPluralityL( ETrue );
+        //informationNote->SetTextL( _L("Number of cases: %d") );
+        //informationNote->SetTextNumberL( count );
+        //informationNote->ExecuteLD();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestCaseOutputContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+{
+	if (aType != EEventKey)
+	{
+		return EKeyWasNotConsumed;
+	}
+
+	if (iListBox)
+		{
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+
+    /*
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+			{ */  /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
+    /*			return EKeyWasNotConsumed;
+            break;
+            }
+        default:
+			{
+			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
+			if (iListBox)
+				{
+				return iListBox->OfferKeyEventL( aKeyEvent, aType );
+				}
+			else
+				{
+				return EKeyWasNotConsumed;
+				}
+            break;
+			}
+        }*/
+}
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputContainer::OutputUpdateL
+// 
+// Handles addition of item to list box.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputContainer::OutputUpdateL()
+    {
+    if ( iListBox )
+        {
+        iListBox->HandleItemAdditionL();
+        iListBox->DrawNow();
+        }
+    }
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CTestOutputListBoxModel::NewL
+// 
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CTestOutputListBoxModel* CTestOutputListBoxModel::NewL(CStartedTestCase* aStartedTestCase /*, HBufC* aBuffer*/)
+    {
+
+    CTestOutputListBoxModel* self = new ( ELeave ) CTestOutputListBoxModel();
+    CleanupStack::PushL( self );
+    //self->ConstructL();
+    //self->iBuffer = aBuffer;
+    self->iBuffer = HBufC::NewL( 150 );
+    self->iStartedTestCase = aStartedTestCase;
+    CleanupStack::Pop();
+    return self;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestOutputListBoxModel::ConstructL
+// 
+// Symbian OS two phased constructor.
+// Completes the construction of the object.
+// ----------------------------------------------------------------------------
+//
+void CTestOutputListBoxModel::ConstructL()
+    {
+    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestOutputListBoxModel::~CTestCaseOutputContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestOutputListBoxModel::~CTestOutputListBoxModel()
+    {
+    delete iBuffer;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestOutputListBoxModel::MdcaCount
+// 
+// Returns the number of descriptor elements in the array.
+// ----------------------------------------------------------------------------
+//
+TInt CTestOutputListBoxModel::MdcaCount() const
+    {
+
+    TInt rows = iStartedTestCase->PrintArray().Count();
+    return rows;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestOutputListBoxModel::MdcaPoint
+// 
+// Indexes into a descriptor array.
+// ----------------------------------------------------------------------------
+//
+TPtrC CTestOutputListBoxModel::MdcaPoint(TInt aIndex) const
+    {
+    const RPointerArray<CTestProgress> printArray = iStartedTestCase->PrintArray();
+
+    TPtr buffer( iBuffer->Des() );
+    buffer.Zero();
+    buffer.Append(_L("\t"));
+    buffer.Append(printArray[aIndex]->iDescription);
+    buffer.Append(_L(" "));
+    buffer.Append(printArray[aIndex]->iText);
+    
+    return *iBuffer;
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestCaseOutputView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,380 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestCaseOutputView class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <akntitle.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include  "TestCaseOutputView.h"
+#include  "TestCaseOutputContainer.h"
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_TESTCASEOUTPUTVIEW );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::~CTestCaseOutputView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestCaseOutputView::~CTestCaseOutputView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    
+    iCurrentTestCase = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestCaseOutputView::Id() const
+    {
+    return TUid::Uid(ETestCaseOutputViewId);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+        case ECmdPauseTestCase:
+            {
+            /*
+            TInt index( 0 );
+			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
+             CStartedTestCase* startedTestCase = NULL;
+             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
+             if( ret != KErrNone )
+                 {
+                 // Leave
+                 }
+            */
+            CStartedTestCase* startedTestCase = 
+                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
+            startedTestCase->UIEngineContainer().PauseTest(); 
+            break;
+            }
+        case ECmdResumeTestCase:
+            {
+            /*
+            TInt index( 0 );
+			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
+             CStartedTestCase* startedTestCase = NULL;
+             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
+             if( ret != KErrNone )
+                 {
+                 // Leave
+                 }
+            */
+            CStartedTestCase* startedTestCase = 
+                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
+            startedTestCase->UIEngineContainer().ResumeTest();            
+            break;
+            }
+        case ECmdAbortTestCase:
+            {
+            /*
+            TInt index( 0 );
+			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
+             CStartedTestCase* startedTestCase = NULL;
+             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
+             if( ret != KErrNone )
+                 {
+                 // Leave
+                 }
+            */
+            CStartedTestCase* startedTestCase = 
+                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
+            startedTestCase->UIEngineContainer().CancelTest();             
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CTestCaseOutputContainer;
+        iContainer->SetMopParent(this);
+
+        iCurrentTestCase = ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
+        iContainer->ConstructL( ClientRect(), iCurrentTestCase );
+        
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+    PrintTestCaseStateL();
+	
+	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTCASE_OUTPUT);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+	
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+    // Because DoDeactivate method can't leave we must 
+    // catch unexpected leaves.
+	TInt ret = KErrNone;
+    TRAP( ret,
+    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
+    if ( tp != NULL )
+    	{
+    	tp->SetTextToDefaultL(); // Set application name.
+    	}
+    ); // TRAPD end
+    
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    
+    iCurrentTestCase = NULL;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    CStartedTestCase* startedTestCase = 
+        ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
+
+    if (R_APPUI_TESTCASEOUTPUTVIEW_MENU == aResourceId)
+        {
+  
+        if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
+            {
+            if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::ENotStarted )
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                }
+            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::ERunning )
+                {
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
+                }
+            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EPaused )
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
+                }
+            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EExecuted )
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                }
+            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EFinished )
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                }
+                                                                                     
+            }
+		else
+            {
+            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+            }
+        }
+        
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::OutputUpdate
+// 
+// Receives output update notification from AppUI.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::OutputUpdateL( CStartedTestCase* /*aTestCase*/ )
+    {
+    PrintTestCaseStateL();
+    iContainer->OutputUpdateL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::TestCaseStateChangedL
+// 
+// Receives test case state changed notification from AppUI.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::TestCaseStateChangedL()
+    {
+    PrintTestCaseStateL();
+    iContainer->OutputUpdateL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestCaseOutputView::PrintTestCaseState
+// 
+// Prints test case state to title pane.
+// ----------------------------------------------------------------------------
+//
+void CTestCaseOutputView::PrintTestCaseStateL()
+    {
+    TBuf<50> statusMessage;
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
+
+    if ( iCurrentTestCase != NULL )
+        {
+        TUint status = iCurrentTestCase->Status();
+
+        if( status & CUIStoreIf::EStatusRunning )
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage,
+                R_TESTCASE_STATE_RUNNING );
+            }
+        else if( status & CUIStoreIf::EStatusExecuted && 
+                            status & CUIStoreIf::EStatusPassed )
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage, 
+                R_TESTCASE_STATE_PASSED );
+            }
+        else if( status & CUIStoreIf::EStatusExecuted && 
+                            status & CUIStoreIf::EStatusFailed )
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage, 
+                R_TESTCASE_STATE_FAILED );
+            }
+        else if( status & CUIStoreIf::EStatusAborted )
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage, 
+                R_TESTCASE_STATE_CRASHED_ABORTED );
+            }
+        else if( status & CUIStoreIf::EStatusCrashed )
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage, 
+                R_TESTCASE_STATE_CRASHED_ABORTED );
+            }
+        else
+            {
+            CEikonEnv::Static()->ReadResource( statusMessage, 
+                R_TESTCASE_STATE_UNKNOWN );
+            }
+        
+        tp->SetTextL( statusMessage );
+        tp->DrawNow();
+
+        }
+
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestModulesMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,310 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestModulesListBoxModel class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>  // ListBox
+#include <barsread.h> // for TResourceReader
+#include <aknnotewrappers.h>
+
+#include "Stifui.hrh"
+#include <Stifui.rsg>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include "TestModulesMenuContainer.h"
+#include "AppUIAppUi.h"
+
+#include "MenuListBox.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestModulesListBoxModel::NewL
+// 
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CTestModulesListBoxModel* CTestModulesListBoxModel::NewL(RRefArray<TDesC> aTestModules)
+    {
+
+    CTestModulesListBoxModel* self = new ( ELeave ) CTestModulesListBoxModel();
+    CleanupStack::PushL( self );
+    self->iBuffer = HBufC::NewL( 130 );
+    self->iTestModules = aTestModules;
+    CleanupStack::Pop();
+    return self;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesListBoxModel::ConstructL
+// 
+// Symbian OS two phased constructor.
+// Completes the construction of the object.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesListBoxModel::ConstructL()
+    {
+    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesListBoxModel::~CTestCaseOutputView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestModulesListBoxModel::~CTestModulesListBoxModel()
+    {
+    delete iBuffer;
+    
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesListBoxModel::MdcaCount
+// 
+// Returns the number of descriptor elements in the array.
+// ----------------------------------------------------------------------------
+//
+TInt CTestModulesListBoxModel::MdcaCount() const
+    {
+    return iTestModules.Count();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesListBoxModel::MdcaPoint
+// 
+// Indexes into a descriptor array.
+// ----------------------------------------------------------------------------
+//
+TPtrC CTestModulesListBoxModel::MdcaPoint(TInt aIndex) const
+    {
+    TPtrC testModule = (iTestModules)[aIndex];
+    TPtr buffer( iBuffer->Des() );
+    buffer.Zero();
+
+    buffer.Append(_L("\t"));
+    buffer.Append( testModule );
+    
+    return *iBuffer;
+    
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    _LIT( KErrMessage, "Error loading modules! Check Test engine log.");
+    CreateWindowL();
+
+  	iListBox = CMenuListBox::NewL(ETestModulesMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
+    iListBox->ConstructL(this, EAknListBoxSelectionList /*EAknListBoxMarkableList*/ );
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    if( iUIStore )
+        {
+        /*const CFixedFlatArray<TTestInfo>& allCases = iData->AllCases();
+        const TInt KTestCaseCount = allCases.Count();
+        for (TInt i=0; i < KTestCaseCount; i++)
+            {
+            iTestCasesInView.Append(&(allCases[i]));
+            } */
+
+        //RRefArray<TDesC> modules;
+        TInt ret = iUIStore->Modules( iModules );
+        if( ret != KErrNone )
+            {
+             //iModules.Reset();
+             //iModules.Close();
+			TMessageBoxUtil::ShowErrorNoteL( KErrMessage );
+            }
+       
+        iListBoxModel = CTestModulesListBoxModel::NewL( iModules );
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model"));
+
+
+         iListBox->Model()->SetItemTextArray(iListBoxModel);
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model set"));
+        
+        }
+    else
+        {
+        // General error becouse UIStore should be opened in AppUI when
+        // program starts.
+        User::Leave( KErrGeneral );
+        }
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::~CTestCaseOutputView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestModulesMenuContainer::~CTestModulesMenuContainer()
+    {
+    
+		iModules.Reset();
+        iModules.Close();
+
+	if( iListBox )
+		{
+		delete iListBox;
+		iListBox = NULL;
+		}
+		
+	}
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestModulesMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestModulesMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestModulesMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
+			return EKeyWasNotConsumed;
+            //break;
+            }
+        default:
+			{
+			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
+			if (iListBox)
+				{
+				return iListBox->OfferKeyEventL( aKeyEvent, aType );
+				}
+			}
+        }
+    return EKeyWasNotConsumed;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::CurrentItemIndex
+// 
+// Returns current item index in list box.
+// ----------------------------------------------------------------------------
+//
+TInt CTestModulesMenuContainer::CurrentItemIndex()
+    {
+    return iListBox->CurrentItemIndex();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetBaseMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,188 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetBaseMenuContainer class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include "TestSetBaseMenuContainer.h"
+#include "Stifui.hrh"
+
+#include <Stifui.rsg>
+
+#include <aknlists.h>  //ListBox
+#include <barsread.h> // for TResourceReader
+
+#include <aknnotewrappers.h>
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    CreateWindowL();
+     
+	iListBox = CMenuListBox::NewL(ETestSetMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC( reader, R_TESTSETBASE_MENU_LISTBOX );
+	iListBox->SetListBoxObserver( aListBoxObserver );
+	iListBox->ConstructFromResourceL( reader );
+	CleanupStack::PopAndDestroy(); // resource stuffs. 
+
+    // Create Scroller control for ListBox and set its visibility
+    // !!! Not needed yet because there are only two items in list box.
+    // If items are added later, scroller may be taken to use
+    //iListBox->CreateScrollBarFrameL(ETrue);
+    //iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+    
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::~CTestSetBaseMenuContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetBaseMenuContainer::~CTestSetBaseMenuContainer()
+    {
+    if ( iListBox )
+		{
+		iListBox->Reset();
+    	delete iListBox;
+    	}	
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetBaseMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestSetBaseMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::OfferKeyEventL
+// 
+// Handles key events..
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestSetBaseMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+	if (aType != EEventKey)
+	{
+		return EKeyWasNotConsumed;
+	}
+	
+    switch ( aKeyEvent.iCode )
+        {
+        case EKeyLeftArrow:
+        case EKeyRightArrow:
+			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
+			return EKeyWasNotConsumed;
+            //break;
+            }
+        default:
+			{
+			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
+			if (iListBox)
+				{
+				return iListBox->OfferKeyEventL( aKeyEvent, aType );
+				}
+	    	}
+        }     
+    return EKeyWasNotConsumed;        
+}
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::GetActiveLine
+// 
+// Get currently selected items index.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetBaseMenuContainer::GetActiveLine()
+	{
+	return iListBox->CurrentItemIndex();
+	}
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetBaseMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,200 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetBaseMenuView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <aknlists.h> 
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "TestSetBaseMenuView.h"
+#include  "TestSetBaseMenuContainer.h"
+#include  "Stifui.hrh" 
+#include  "AppUIAppUi.h" // loggerin kayttoa varten, muuten ei tarvittaisi
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CTestSetBaseMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ---------------------------------------------------------
+//
+void CTestSetBaseMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_TESTSETBASEMENUVIEW );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::~CTestSetBaseMenuView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetBaseMenuView::~CTestSetBaseMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestSetBaseMenuView::Id() const
+    {
+    return TUid::Uid(ETestSetBaseMenuViewId); //KTestSetBaseMenuViewId;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+		case EAknCmdOpen:
+			{
+			break;
+			}
+		case ECmdCreateTestSet:
+            {
+            AppUi()->HandleCommandL(ECmdCreateTestSet);
+            break;
+            }
+		case ECmdLoadTestSet:
+            {
+            AppUi()->HandleCommandL(ECmdLoadTestSet);
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::HandleListBoxEventL
+// 
+// Handles a list box event.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuView::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+	    switch ( aListBox->CurrentItemIndex() )
+			{
+		    case 0:
+		    	HandleCommandL( ECmdCreateTestSet );
+				break;
+			case 1:
+				HandleCommandL( ECmdLoadTestSet );
+				break;
+			}
+		}
+	}
+	
+		
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetBaseMenu: DoActivateL"));
+        //message = _L("eng.open ret:");
+        //message.AppendNum( ret , EDecimal );
+        //AppUi->iLogger->Log( message );
+        iContainer = new (ELeave) CTestSetBaseMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetBaseMenu: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+	
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET_BASE);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+
+   }
+
+// ----------------------------------------------------------------------------
+// CTestSetBaseMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestSetBaseMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;         
+        }    
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;    
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetInsertMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetInsertMenuContainer class
+* definition.
+*
+*/
+
+// INCLUDE FILES 
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> // CColumnListBoxData
+
+#include "TestSetInsertMenuContainer.h"
+#include "TestSetInsertMenuView.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ConstructL"));
+
+	iParentView = (CTestSetInsertMenuView*)aListBoxObserver;
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    iTestCasesInView.Reset();
+        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: iTCInV Reset"));
+    
+	iListBox = CMenuListBox::NewL(ETestSetInsertMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
+    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+
+    if ( iUIStore )
+        {
+        RRefArray<CTestInfo> allCases;
+        TInt ret = iUIStore->TestCases( allCases );
+        if( KErrNone != ret )
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
+            allCases.Reset();
+            allCases.Close();
+            User::Leave( ret );
+            }
+
+        const TInt KTestCaseCount = allCases.Count();
+        for (TInt i=0; i < KTestCaseCount; i++)
+            {
+            iTestCasesInView.Append( &allCases[i] );
+            }
+
+        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox model"));
+
+        iListBox->Model()->SetItemTextArray(iListBoxModel);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox model set"));
+
+        allCases.Reset();
+        allCases.Close();
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+
+    // Creates graphic.
+    SetGraphicIconL( iListBox );
+       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: icons created"));
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::~CTestSetInsertMenuContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetInsertMenuContainer::~CTestSetInsertMenuContainer()
+    {
+    //iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
+    //delete iListBox;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetInsertMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestSetInsertMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestSetInsertMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+	if (iListBox)
+		{
+		//if multiple items selected
+		if ( iListBox->SelectionIndexes()->Count() > 0 )
+			{
+			TUint mask = 0x40488;
+			
+			//if event is enter key,
+			//don´t send it to listbox
+			if ( aKeyEvent.iScanCode == 0xa7 
+				&& ( aKeyEvent.iModifiers & mask ) == 0 )
+				{
+				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
+				return EKeyWasConsumed;	
+				}
+			}
+			
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetInsertMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,399 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetInsertMenuView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <aknlistquerydialog.h> 
+#include  <aknnotewrappers.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+#include  "TestSetInsertMenuView.h"
+#include  "TestSetInsertMenuContainer.h"
+#include  "TestSetMenuView.h"
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL(  R_INSERT_TESTCASES_VIEW );
+    iCurrentTestCase = 0;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::~CTestSetInsertMenuView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetInsertMenuView::~CTestSetInsertMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestSetInsertMenuView::Id() const
+    {
+    return TUid::Uid(ETestSetInsertMenuViewId);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::HandleCommandL(TInt aCommand)
+    {   
+    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
+        {
+        TInt moduleNumber = aCommand - ECmdFilterByModule;
+        RRefArray<TDesC> allModules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
+        if( KErrNone != ret )
+            {
+            allModules.Reset();
+            allModules.Close();
+            User::Leave( ret );
+            }
+        TName moduleName = allModules[ moduleNumber ];
+
+        iContainer->FilterCasesByModuleL( moduleName );
+
+        allModules.Reset();
+        allModules.Close();
+        }
+	else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
+        {
+        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
+        RRefArray<TDesC> allTestCases;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( allTestCases );
+        if( KErrNone != ret )
+            {
+            allTestCases.Reset();
+            allTestCases.Close();
+            User::Leave( ret );
+            }
+        TFileName testCaseFileName = allTestCases[ testCaseFileNumber ];
+
+        iContainer->FilterCasesByTCFileNameL( testCaseFileName );
+
+        allTestCases.Reset();
+        allTestCases.Close();
+        }
+	else if ( aCommand == ECmdNOFiltering )
+        {
+        iContainer->NoFilteringL();
+        }
+    else if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
+    	|| aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
+    	{
+    	iContainer->HandleMarkCommandL( aCommand );
+    	}
+    else
+	    {
+ 	    switch ( aCommand )
+	        {
+	        case ECmdInsertSelectedCases:
+	            {
+                ShowInsertCasesDialogL();
+	            break;
+	            }
+	        case EAknSoftkeyCancel:
+	            {
+	            //iCurrentTestCase = 0;
+	            ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
+	            break;
+	            }
+	        default:
+	            {
+	            AppUi()->HandleCommandL( aCommand );
+	            break;
+	            }
+	        }
+	    }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetInsertMenuView: DoActivateL"));
+        //message = _L("eng.open ret:");
+        //message.AppendNum( ret , EDecimal );
+        //AppUi()->iLogger->Log( message );
+        iContainer = new (ELeave) CTestSetInsertMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetInsertMenuView: container constructed"));
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+   
+   //testing
+    iContainer->SetCurrentItemIndex(iCurrentTestCase);
+	
+	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET_INSERT);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+
+    // Test modules are added to filter by test module submenu if the submenu is opened
+    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
+        {
+        RRefArray<TDesC> modules;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
+        if( KErrNone != ret )
+            {
+            modules.Reset();
+            modules.Close();
+            User::Leave( ret );
+            }
+
+        TInt moduleCount = modules.Count();
+        
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByModule;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < moduleCount; i++)
+            {
+            //item.iText = modules[i].iModuleName;
+            item.iText = modules[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
+            }
+        
+        modules.Reset();
+        modules.Close();
+
+        }
+
+    // Test case files are added to filter by test case file submenu if the submenu is opened
+    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }
+
+        TInt testCaseFileCount = testCaseFiles.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByTestCaseFile;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < testCaseFileCount; i++)
+            {
+            item.iText = testCaseFiles[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        ShowInsertCasesDialogL();
+		}
+		
+	}
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::ShowInsertCasesDialogL
+// 
+// Show confirmation dialog for inserting test cases.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::ShowInsertCasesDialogL()
+    {
+    TInt i(0);
+    TBuf<50> message;
+    CEikListBox* listBox = iContainer->ListBox();
+	TInt count = listBox->SelectionIndexes()->Count();
+	
+	if ( count > 0 )
+	    {
+    	CEikonEnv::Static()->ReadResource( message, R_INSERT_CONFIRMATION_QUESTION );
+    		
+    	CAknQueryDialog * dlg = CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
+    	if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
+    		{
+    		CEikListBox* newListBox = iContainer->ListBox();
+		    TInt newCount = newListBox->SelectionIndexes()->Count();
+    		RArray<TInt> selectedIndices;
+		    CleanupClosePushL( selectedIndices );
+		    if ( newCount > 0 )
+    			{
+    			for( i = 0; i < newCount; i++ )
+	    			{
+    				selectedIndices.InsertInOrder( (*newListBox->SelectionIndexes())[i] );
+		    		}	
+    				
+	    		AddCasesToTestSet( selectedIndices );
+	    		// Test cases added, set save needed flag to true.
+		    	((CTestSetMenuView*)AppUi()->View( 
+		    	    TUid::Uid(ETestSetMenuViewId) ))->SetSaveNeeded(ETrue);
+			    }
+    		CleanupStack::PopAndDestroy();
+	    	
+		    // Test cases added -> go to test set menu
+    		AppUi()->HandleCommandL(EAppUIGoBack);
+	    	}
+	    }
+	else
+	    {
+	    CAknWarningNote* dialog = new(ELeave)CAknWarningNote();
+	    CEikonEnv::Static()->ReadResource( message, R_INSERT_NOCASES_TEXT );
+	    dialog->ExecuteLD(message);
+	    }
+	    
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetInsertMenuView::AddCasesToTestSet
+// 
+// Adds selected test cases to the current test set.
+// ----------------------------------------------------------------------------
+//
+void CTestSetInsertMenuView::AddCasesToTestSet( RArray<TInt> aSelectedIndexes )
+	{
+	TInt ret(0);
+	TInt i(0);
+	RRefArray<CTestInfo> allCases;
+	CTestSetMenuView* testSetMenuView = 
+    	(CTestSetMenuView*)((CAppUIAppUi*)AppUi())->View( TUid::Uid(ETestSetMenuViewId) );
+
+	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases(allCases);
+    
+	for ( i = 0; i < aSelectedIndexes.Count(); i++ )
+		{
+		ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->AddToTestSet( 
+    		testSetMenuView->CurrentTestSet(),
+   			allCases[ aSelectedIndexes[i] ] );
+		}    
+    if( ret != KErrNone )		
+        {
+        RDebug::Print( _L("AddCasesToTestSet failed with value: %d"), ret );
+        }
+    
+	allCases.Reset();
+	allCases.Close();
+
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetMenuContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,486 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetMenuContainer class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h> // CAknIconArray
+#include <aknnotewrappers.h>
+
+#include <eikclbd.h> // CColumnListBoxData
+
+#include "TestSetMenuContainer.h"
+#include "TestSetMenuView.h"
+#include "StartCasesContainer.h"
+#include <Stifui.rsg>
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "MenuListBox.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ConstructL"));
+
+	iParentView = (CTestSetMenuView*)aListBoxObserver;
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+
+    iTestCasesInView.Reset();
+        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: iTCInV Reset"));
+    
+	iListBox = CMenuListBox::NewL(ETestSetMenuViewId);
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
+    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
+
+    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox constructed"));
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
+    iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
+                     iListBox->HandleItemAdditionL();   
+
+    if ( iUIStore )
+        {
+        //RRefArray<const CTestInfo> allCases;
+        //CTestSetInfo* testSetInfo;
+        //IMPORT_C const CTestSetInfo& TestSetL( const TDesC& aSetName  );
+        
+        TPtrC ptr = iParentView->CurrentTestSet();
+        
+        const CTestSetInfo* testSetInfo = 
+        	&iUIStore->TestSetL( ptr );
+        
+        //inline const RRefArray<const CTestInfo>& TestCases() const
+   		const RRefArray<const CTestInfo>* allCases = &testSetInfo->TestCases();
+        
+        /*if( ret != KErrNone )
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
+            // Leave
+            }
+		*/
+
+        const TInt KTestCaseCount = allCases->Count();
+        for (TInt i=0; i < KTestCaseCount; i++)
+            {
+            iTestCasesInView.Append( &allCases->operator[](i) );
+            }
+
+        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox model"));
+
+        iListBox->Model()->SetItemTextArray(iListBoxModel);
+             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox model set"));
+
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+
+    // Creates graphic.
+    SetGraphicIconL( iListBox );
+       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: icons created"));
+
+    iListBox->ActivateL();
+    ((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SetGraphicIconL
+// 
+// Sets graphic icon using listbox as CEikColumnListBox.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::SetGraphicIconL( CEikColumnListBox* aListBox )
+    {
+	if ( aListBox )
+        {
+        // Creates gul icon.
+        CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
+        CleanupStack::PushL( iconArray );
+        
+        GraphicIconL( iconArray ); // Appends graphic data.
+        
+        // Sets graphics as ListBox icon.
+        aListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
+        
+        CleanupStack::Pop();
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::CurrentItemIndex
+// 
+// Returns current item index in list box.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuContainer::CurrentItemIndex()
+    {
+    return iListBox->CurrentItemIndex();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SetCurrentItemIndex
+// 
+// Sets current item index in list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::SetCurrentItemIndex(TInt aCurrentTestCase)
+    {
+    iListBox->SetCurrentItemIndexAndDraw(aCurrentTestCase);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::GraphicIconL
+// 
+// Appends graphics data.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::GraphicIconL( CArrayPtr<CGulIcon>* aIcons )
+    {
+    if ( aIcons )
+        {
+        CFbsBitmap* markBitmap = NULL;
+        CFbsBitmap* markBitmapMask = NULL;
+	
+        TRgb defaultColor;
+        defaultColor = CEikonEnv::Static()->Color(EColorControlText);
+	
+        AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
+        		KAknsIIDQgnIndiMarkedAdd,
+        		KAknsIIDQsnIconColors,
+        		EAknsCIQsnIconColorsCG13,
+        		markBitmap,
+        		markBitmapMask,
+        		AknIconUtils::AvkonIconFileName(),
+        		EMbmAvkonQgn_indi_marked_add,
+        		EMbmAvkonQgn_indi_marked_add_mask,
+        		defaultColor );
+        
+        CGulIcon* markIcon = CGulIcon::NewL(markBitmap,markBitmapMask);
+        aIcons->AppendL(markIcon); 
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::~CTestSetMenuContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetMenuContainer::~CTestSetMenuContainer()
+    {
+    iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
+    delete iListBox;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestSetMenuContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SelectedTestCases
+// 
+// Returns pointers to selected test cases.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::SelectedTestCases
+                            (RPointerArray<CTestInfo>& aSelectedTestCases)
+    {
+    aSelectedTestCases.Append( iTestCasesInView[iListBox->CurrentItemIndex()] );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestSetMenuContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType )
+    {
+	if (aType != EEventKey)
+	    {
+		return EKeyWasNotConsumed;
+	    }
+
+	if (iListBox)
+		{
+		//if multiple items selected
+		if ( iListBox->SelectionIndexes()->Count() > 0 )
+			{
+			TUint mask = 0x40488;
+			
+			//if event is enter key,
+			//don´t send it to listbox
+			if ( aKeyEvent.iScanCode == 0xa7 
+				&& ( aKeyEvent.iModifiers & mask ) == 0 )
+				{
+				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
+				return EKeyWasConsumed;	
+				}
+			}
+			
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+    }
+    
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::HandleMarkCommandL
+// 
+// Handles mark commands.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::HandleMarkCommandL( TInt aCommand )
+	{
+	if (iListBox)
+		{
+		AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );		
+		}
+	}
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::ProcessCommandL
+// 
+// Processes user commands.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::ProcessCommandL( TInt  aCommand )
+	{
+	AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );
+    }
+    
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SelectionListProcessCommandL
+// 
+// Processes user commands.
+// ----------------------------------------------------------------------------
+//    
+void CTestSetMenuContainer::SelectionListProcessCommandL( TInt  aCommand )
+	{
+	AknSelectionService::HandleSelectionListProcessCommandL( aCommand, iListBox );
+    }
+    
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::FilterCasesByModuleL
+// 
+// Show only testcases which are defined is specified module.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::FilterCasesByModuleL( TName aModuleName )
+    {
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+   
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        if ( allCases[i].ModuleName() == aModuleName )
+            {
+            iTestCasesInView.Append( &( allCases[i] ) );
+            }
+        }
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::FilterCasesByTCFileNameL
+// 
+// Show only testcases which are defined is specified test case file.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::FilterCasesByTCFileNameL( 
+                                                TFileName aTestCaseFileName )
+    {
+
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+  
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        if ( allCases[i].TestCaseFile() == aTestCaseFileName )
+            {
+            iTestCasesInView.Append( &( allCases[i] ) );
+            }
+        }
+
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::NoFilteringL
+// 
+// Remove possible filtering of test cases -> show all test cases.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::NoFilteringL()
+    {
+    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
+
+    RRefArray<CTestInfo> allCases;
+    TInt ret = iUIStore->TestCases( allCases );
+    if( KErrNone != ret )
+        {
+        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
+        allCases.Reset();
+        allCases.Close();
+        User::Leave( ret );
+        }
+    const TInt KTestCaseCount = allCases.Count();
+
+    // Add all cases to iTestCasesInView pointer array
+    for( TInt i=0; i < KTestCaseCount; i++ )
+        {
+        iTestCasesInView.Append( &( allCases[i] ) );
+        }
+
+    allCases.Reset();
+    allCases.Close();
+
+    iListBox->Reset();
+    iListBox->DrawNow();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::RemoveListBoxItemsL
+// 
+// Removes items from list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuContainer::RemoveListBoxItemL( TInt aSelected )
+	{
+	TInt currentItem(0);
+    TBool remCurr(EFalse);
+	
+	currentItem = iListBox->CurrentItemIndex();
+	if( aSelected == currentItem )
+	    {
+	    remCurr = ETrue;
+	    }
+	    
+	iTestCasesInView.Remove( aSelected );
+	AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(iListBox, aSelected, remCurr);
+	 iListBox->HandleItemAdditionL();
+	}
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//	
+void CTestSetMenuContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetMenuView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,554 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetMenuView class ddefinition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <aknlistquerydialog.h> 
+#include  <aknnotewrappers.h>
+#include  <barsread.h>              //TResourceReader
+#include  <Stifui.rsg>
+#include  "TestSetMenuView.h"
+#include  "TestSetMenuContainer.h"
+#include  "AppUIAppUi.h"
+#include  "Stifui.hrh" 
+
+
+
+// ================= MEMBER FUNCTIONS =========================================
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_TESTSETMENUVIEW );
+    iCurrentTestCase = 0;
+    iSaveNeeded = ETrue;
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::~CTestSetMenuView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetMenuView::~CTestSetMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestSetMenuView::Id() const
+    {
+    return TUid::Uid(ETestSetMenuViewId);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::HandleCommandL(TInt aCommand)
+    {   
+    if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
+        || aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
+        {
+        iContainer->HandleMarkCommandL( aCommand );
+        }
+    else
+        {
+        switch ( aCommand )
+            {
+            case ECmdStartTestSet:
+                {
+                const CTestSetInfo& testSetInfo = 
+                    iUIStore->TestSetL( iCurrentTestSet );
+                const RRefArray<const CTestInfo>* allCases = 
+                    &testSetInfo.TestCases();
+                
+                TInt testCaseCount = allCases->Count();
+                if (testCaseCount > 0 )
+                    {
+                    StartTestSetL();
+                    }
+                break;
+                }
+            case ECmdShowStartedTestSet:
+                {
+                AppUi()->HandleCommandL(ECmdShowStartedTestSet);
+                break;
+                }
+            case ECmdSaveTestSet:
+                {
+                SaveCurrentTestSetL();
+                break;
+                }
+            case ECmdInsertTestCases:
+                {
+                // iSaveNeeded is set from 
+                // CTestSetInsertMenuView::ShowInsertCasesDialog()
+                //iSaveNeeded = ETrue;
+                AppUi()->HandleCommandL(ECmdInsertTestCases);
+                break;
+                }
+            case ECmdRemoveTestCases:
+                {
+                RemoveSelectedTestCasesL();
+                break;
+                }
+            case EAknSoftkeyBack:
+                {
+                //iCurrentTestCase = 0;
+               // AppUi()->HandleCommandL(ECmdLoadTestSet/*EAppUIGoToTestSetsMenu*/);
+                //( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
+                SaveCurrentTestSetL();
+                break;
+                }
+            default:
+                {
+                AppUi()->HandleCommandL( aCommand );
+                break;
+                }
+            }
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log( 
+            _L("TestSetMenuView: DoActivateL") );
+        iContainer = new (ELeave) CTestSetMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+        ((CAppUIAppUi*)AppUi())->iLogger->Log( 
+            _L("TestSetMenuView: container constructed") );
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+   
+    //testing
+    iContainer->SetCurrentItemIndex(iCurrentTestCase);
+    
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+    CAknNavigationControlContainer* np = 
+        (CAknNavigationControlContainer *)sp->ControlL(
+        TUid::Uid(EEikStatusPaneUidNavi));
+    
+    TResourceReader reader;
+    iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET );
+    iNaviDecorator = np->CreateNavigationLabelL( reader );
+    CleanupStack::PopAndDestroy(); // resource reader
+    np->PushL(*iNaviDecorator);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+
+    // Test modules are added to filter by test module submenu 
+    // if the submenu is opened
+    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
+        {
+        RRefArray<TDesC> modules;
+        TInt ret = iUIStore->Modules( modules );
+        if( KErrNone != ret )
+            {
+            modules.Reset();
+            modules.Close();
+            User::Leave( ret );
+            }
+
+        TInt moduleCount = modules.Count();
+        
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByModule;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < moduleCount; i++)
+            {
+            item.iText = modules[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // Command IDs 0x1000 - 0x1FFF are reserved
+                               // for modules in hrh file.
+            }
+        
+        modules.Reset();
+        modules.Close();
+        }
+
+    // Test case files are added to filter by test case file submenu
+    // if the submenu is opened.
+    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
+        {
+        RRefArray<TDesC> testCaseFiles;
+        TInt ret = iUIStore->TestCaseFiles( testCaseFiles );
+        if( KErrNone != ret )
+            {
+            testCaseFiles.Reset();
+            testCaseFiles.Close();
+            User::Leave( ret );
+            }
+
+        TInt testCaseFileCount = testCaseFiles.Count();
+
+        TInt i;
+        CEikMenuPaneItem::SData item;
+
+        item.iCommandId = ECmdFilterByTestCaseFile;
+        item.iFlags = 0;
+        item.iCascadeId = 0;
+
+        for (i = 0; i < testCaseFileCount; i++)
+            {
+            item.iText = testCaseFiles[i];
+            aMenuPane->AddMenuItemL(item);
+            item.iCommandId++; // Command IDs 0x2000 - 0x2FFF are reserved for
+                               // test case files in hrh file.
+            }
+        }
+        
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, 
+    TListBoxEvent aEventType)
+    {
+
+    if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+        {
+        const CTestSetInfo& testSetInfo = 
+            iUIStore->TestSetL( iCurrentTestSet );
+        const RRefArray<const CTestInfo>* allCases = &testSetInfo.TestCases();
+
+        TInt testCaseCount = allCases->Count();
+           if (testCaseCount > 0 )
+            {
+            StartTestSetL();
+            }
+        }
+   }
+ 
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::CreateTestSet
+// 
+// Creates new test set.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuView::CreateTestSetL( const TDesC& aTestSetName )
+    {
+    TInt error = 0;
+    TBuf<100> message;
+    
+    _LIT(KPath, "c:\\TestFramework\\");
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+    TEntry entry;
+    // we check if the c:\testframework directory exists
+    // It is mandatory for this dir to exist if we want to save a test set.
+    // This dir must be localised on the C drive of the device
+    if(fs.Entry(KPath, entry) != KErrNone)
+    	{	// if the dir does not exist 
+    	TInt err = fs.MkDirAll(KPath);	// we create it
+    	if(err != KErrNone)
+    		{	// if of any reason it was impossible to create the dir - inform user about it
+	    	CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue);
+	    	note->ExecuteLD( _L("Could not create c:\\TestFramework dir!") );
+    		}
+    	}
+    CleanupStack::PopAndDestroy(&fs);	// close and remove RFs object 
+    
+    error = iUIStore->LoadTestSet( aTestSetName );
+    
+    // If testset is either active or already created and saved.
+ /*   if ( KErrNone == error)// || KErrAlreadyExists == error )
+        {
+        CEikonEnv::Static()->ReadResource( message, 
+            R_OVERWRITE_TESTSET_QUESTION );
+        CAknQueryDialog * dlg = 
+            CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
+        // Confirm overwrite
+        if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
+            {
+            error = iUIStore->RemoveTestSet( aTestSetName );
+            error = iUIStore->CreateTestSet( aTestSetName );
+            if ( error == KErrNone )
+                {
+                iCurrentTestSet = aTestSetName;
+                iSaveNeeded = ETrue;
+                }
+            }
+        // Else load saved default test set
+        else
+            {
+            iSaveNeeded = EFalse;
+            iCurrentTestSet = aTestSetName;
+            error = KErrAlreadyExists;
+            }
+        }
+    else if ( KErrNotFound == error )
+        {
+        error = iUIStore->CreateTestSet( aTestSetName );
+        if ( KErrNone == error )
+            {
+            iCurrentTestSet = aTestSetName;
+            iSaveNeeded = ETrue;
+            }
+        }
+    else if ( KErrPathNotFound == error )
+          {
+          error = iUIStore->CreateTestSet( aTestSetName );
+          iCurrentTestSet = aTestSetName;
+          iSaveNeeded = EFalse;
+          }
+    else
+        {
+        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("Test set creation fails with error: %d"), error );
+        CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
+        informationNote->ExecuteLD( _L("UNDEFINED ERROR!") );
+        }*/
+    
+    error = iUIStore->CreateTestSet( aTestSetName );
+    iCurrentTestSet = aTestSetName;
+    iSaveNeeded = ETrue;
+    return error;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::LoadTestSetL
+// 
+// Loads saved test set.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuView::LoadTestSetL( const TDesC& aTestSetName )
+    {
+    TInt error = 0;
+    TBuf<100> message;
+    error = iUIStore->LoadTestSet( aTestSetName );
+    if ( KErrNone == error || KErrAlreadyExists == error )
+        {
+        iCurrentTestSet = aTestSetName;
+        iSaveNeeded = EFalse;
+        }
+    else
+        {
+        CEikonEnv::Static()->ReadResource( message, 
+            R_LOAD_TESTSET_FAILED );
+        
+        CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
+        informationNote->ExecuteLD(message);
+        }
+    
+    return error;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::SaveCurrentTestSet
+// 
+// Saves current test set.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuView::SaveCurrentTestSetL()
+    {
+    TInt error = 0;
+    TBuf<100> message;
+    
+    CEikonEnv::Static()->ReadResource( message, 
+        R_SAVE_TESTSET_QUESTION );
+        
+    CAknQueryDialog * dlg = 
+        CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
+    
+   if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
+       {
+        error = iUIStore->SaveTestSet2( iCurrentTestSet );
+        iSaveNeeded = EFalse;
+        
+      }
+   AppUi()->HandleCommandL(EAppUIGoBack);
+
+    return error;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::RemoveActiveTestSet
+// 
+// Removes current test set.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetMenuView::RemoveActiveTestSet()
+    {
+    TInt error = 0;
+    
+    error = iUIStore->RemoveTestSet( iCurrentTestSet );
+    
+    return error;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::StartTestSetL
+// 
+// Shows confirmation dialog and verify if user really want to start test set.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::StartTestSetL()
+    {
+    _LIT( KErrorStartingTestSet, 
+        "TestSetMenuView: StartTestSetL() fails (%d)" );
+    
+    TInt ret(KErrNone);
+    TInt index(0);
+    TInt selectedItem(0);
+    
+    // Default mode is parallel.
+    CStartedTestSet::TSetType mode = CStartedTestSet::ESetParallel;
+    
+    CAknListQueryDialog* startDialog = 
+        new (ELeave) CAknListQueryDialog(&selectedItem);
+    
+    // Show confirmation dialog.
+    if ( startDialog->ExecuteLD(R_START_MULTIPLE_TESTCASES_LIST_QUERY) )
+        {
+        index = ((CAppUIAppUi*)AppUi())->iStartedTestSet;
+        // Check mode
+        if ( 1 == selectedItem )
+            {
+            mode = CStartedTestSet::ESetSequential;
+            }
+        
+        // Start test set cases.
+        ret = iUIStore->StartTestSet( 
+            iUIStore->TestSetL( iCurrentTestSet ), index, mode );
+            
+        if ( ret != KErrNone )
+            {
+            ((CAppUIAppUi*)AppUi())->iStartedTestSet = -1;
+            ((CAppUIAppUi*)AppUi())->iLogger->Log( 
+                KErrorStartingTestSet, ret );
+            }
+        else
+            {
+            ((CAppUIAppUi*)AppUi())->iStartedTestSet = index;
+            }
+        }
+        
+    }
+   
+// ----------------------------------------------------------------------------
+// CTestSetMenuView::RemoveSelectedTestCasesL
+// 
+// Removes marked test cases from test set.
+// ----------------------------------------------------------------------------
+//
+void CTestSetMenuView::RemoveSelectedTestCasesL()
+    {
+    TInt positionToRemove(0);
+    
+    const CTestSetInfo& testSetInfo = iUIStore->TestSetL( iCurrentTestSet );
+    const RRefArray<const CTestInfo>* allCases = &testSetInfo.TestCases();
+    CEikListBox* listBox = iContainer->ListBox();
+
+    iSaveNeeded = ETrue;
+    positionToRemove = listBox->CurrentItemIndex();
+    // Remove selected test case from test set.
+    TInt ret = iUIStore->RemoveFromTestSet(iCurrentTestSet, allCases->operator[](positionToRemove));
+    iContainer->RemoveListBoxItemL(positionToRemove);
+    
+    if( ret != KErrNone )
+        {
+        RDebug::Print( _L("RemoveFromTestSet failed with value: %d"), ret );
+        }
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetStartedCasesContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,466 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetStartedCasesContainer 
+* class definition.
+*
+*/
+
+// INCLUDE FILES
+
+#include <aknlists.h>  // ListBox
+#include <AknIconArray.h>  // CAknIconArray
+#include <badesca.h> // CDesCArray
+#include <eikclbd.h> // CColumnListBoxData
+#include <aknnotewrappers.h>
+
+#include <Stifui.rsg>
+
+//#include "UIStoreIf.h"         
+//#include "UIStore.h"            
+//#include "UIEngine.h"           
+//#include "UIEngineContainer.h"  
+
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStore.h>
+#include <stifinternal/UIEngine.h>
+#include <stifinternal/UIEngineContainer.h>
+
+#include "TestSetStartedCasesContainer.h"
+#include "ShowStartedCasesContainer.h"
+#include "Stifui.hrh"
+#include "AppUIAppUi.h"
+
+#include "MenuListBox.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::ConstructL
+// 
+// Symbian OS two phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
+    {
+    CreateWindowL();
+
+    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
+    
+	iListBox = CMenuListBox::NewL(ETestSetStartedCasesViewId); /*CAknSingleStyleListBox();*/
+	iListBox->SetContainerWindowL( *this );
+	iListBox->SetListBoxObserver( aListBoxObserver );
+    iListBox->ConstructL(this, EAknListBoxSelectionList);
+
+    //Create Scroller control for ListBox and set its visibility
+    iListBox->CreateScrollBarFrameL(ETrue);
+    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
+
+    if ( iUIStore )
+        {
+        
+        iListBoxModel = CStartedTestsListBoxModel::NewL( &iStartedTestsPtrs );
+        iListBox->Model()->SetItemTextArray(iListBoxModel);
+        ConstructListBoxModelL();
+        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
+        iListBox->HandleItemAdditionL();
+
+        }
+    else
+        {
+        //User::Leave( syy?? )
+        }
+	iListBox->ActivateL();
+	((CMenuListBox*)iListBox)->SetPreviousFocus();
+
+    SetRect(aRect);
+    ActivateL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::ConstructListBoxModelL
+// 
+// Constructs list box model without any filtering.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::ConstructListBoxModelL()
+    {
+    TInt items(0);
+    TInt index = ((CAppUIAppUi*)iCoeEnv->AppUi())->iStartedTestSet;
+    
+    // Check if there is started test sets and if there is,
+    // show test set´s info.
+    if ( index != -1 )
+        {
+        const RRefArray<CStartedTestCase>* startedTestCases;
+        CStartedTestSet* startedTestSet =
+     	    &iUIStore->StartedTestSetL( index );
+        startedTestCases = &startedTestSet->TestCases();
+        
+        const TInt KStartedCaseCount = startedTestCases->Count();
+
+        items = iStartedTestsPtrs.Count();
+        iStartedTestsPtrs.Reset(); // Remove all pointers (does not delete objects)
+        iListBox->HandleItemRemovalL();
+        
+        const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
+        
+        // Loop through all started cases
+        for( TInt i=0; i < KStartedCaseCount; i++ )
+            {
+            switch ( KSelectedMode )
+                {
+                case EShowAllStartedCases:
+                    {
+                    iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                    break;
+                    }
+                case EShowOngoingCases:
+                    {
+                    // Note: PAUSE IS ALSO RUNNIN STATUS
+                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusRunning )
+                        {
+                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                        }
+                    break;
+                    }
+                case EShowPassedCases:
+                    {
+                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusPassed )
+                        {
+                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                        }
+                    break;
+                    }
+                case EShowPausedCases:
+                    {
+                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusRunning )
+                        {
+                        if( startedTestCases->operator[](i).UIEngineContainer().State() == CUIEngineContainer::EPaused )
+                            {
+                            iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                            }
+                        }
+                    break;
+                    }
+                case EShowFailedCases:
+                    {
+                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusFailed )
+                        {
+                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                        }
+                    break;
+                    }
+                case EShowCrashedAbortedCases:
+                    {
+                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusAborted
+                    		||
+                    	 startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusCrashed)
+                        {
+                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
+                        }
+                    break;
+                    }
+                }
+        }   
+
+        if ( items < iStartedTestsPtrs.Count() )
+            {
+            iListBox->HandleItemAdditionL();
+            }
+        else
+            {
+            iListBox->HandleItemRemovalL();
+            }
+           
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::~CTestSetStartedCasesContainer
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetStartedCasesContainer::~CTestSetStartedCasesContainer()
+    {
+    delete iListBox;
+    
+    iStartedTestsPtrs.Close(); // does not delete objects whose pointers are contained in the array
+    
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::SizeChanged
+// 
+// Called by framework when the view size is changed.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::SizeChanged()
+    {
+    if ( iListBox )
+		{
+		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
+		}
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::CountComponentControls
+// 
+// Gets a count of the component controls of this list box control.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetStartedCasesContainer::CountComponentControls() const
+    {
+    return 1; // return nbr of controls inside this container
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::ComponentControl
+// 
+// Gets a pointer to the specified component control.
+// ----------------------------------------------------------------------------
+//
+CCoeControl* CTestSetStartedCasesContainer::ComponentControl(TInt aIndex) const
+    {
+    switch ( aIndex )
+        {
+		case 0: 
+			return iListBox;
+        default:
+            return NULL;
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::Draw
+// 
+// Draw a control, called by window server.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::Draw(const TRect& /*aRect*/) const
+    {
+    // CWindowGc& gc = SystemGc();
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::OfferKeyEventL
+// 
+// Handles key events.
+// ----------------------------------------------------------------------------
+//
+TKeyResponse CTestSetStartedCasesContainer::OfferKeyEventL(
+	const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    if (aType != EEventKey)
+    {
+		return EKeyWasNotConsumed;
+	}
+
+	if (iListBox)
+		{
+		return iListBox->OfferKeyEventL( aKeyEvent, aType );
+		}
+	else
+		{
+		return EKeyWasNotConsumed;
+		}
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::SelectedTestCase
+// 
+// Returns reference to currently selected test case in view (listbox).
+// ----------------------------------------------------------------------------
+//
+CStartedTestCase* CTestSetStartedCasesContainer::SelectedTestCase()
+    {
+    if ( iStartedTestsPtrs.Count() > 0 )
+        {
+        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
+        }
+    else
+        {
+        return NULL;
+        }
+/*
+    //if ( iListBox->ItemExists(0)  ) // Check that list box is not empty
+    if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount()  ) // Check that list box is not empty
+        {
+        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
+        }
+    else
+        {
+        return NULL;
+        }
+*/
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::DrawListBox
+// 
+// Draws the list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::DrawListBox()
+    {
+    if ( iListBox )
+        {
+        iListBox->DrawNow();
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::HandleItemAdditionL
+// 
+// Handles the addition of an item to the model.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::HandleItemAdditionL()
+    {
+    iListBox->HandleItemAdditionL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::HandleItemRemovalL
+// 
+// Handles the removal of an item from the model.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::HandleItemRemovalL()
+    {
+    //TInt itemIndexBeforeRemoval = iListBox->CurrentItemIndex();
+
+    iListBox->HandleItemRemovalL();
+
+    // HandleItemRemovalL "loses selection" if current item is removed
+    // -> we have to check it and set one item as current item to make it possible for
+    // user to select one item from items left after remove
+    if ( iListBox->CurrentItemIndex() == -1 ) // No item selected
+        if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount() > 0 ) // there are items
+            SetCurrentItemIndex(0);
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::TestsInViewCount
+// 
+// Returns count of test cases in view.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetStartedCasesContainer::TestsInViewCount()
+    {
+    return ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::CurrentTestCase
+// 
+// Returns pointer to currently selected test case.
+// ----------------------------------------------------------------------------
+//
+CStartedTestCase* CTestSetStartedCasesContainer::CurrentTestCase()
+    {
+    return &iStartedTestsPtrs[ iListBox->CurrentItemIndex() ];
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::CurrentItemIndex
+// 
+// Gets the index number of the current item in the view.
+// ----------------------------------------------------------------------------
+//
+TInt CTestSetStartedCasesContainer::CurrentItemIndex()
+    {
+    return iListBox->CurrentItemIndex();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::SetCurrentItemIndex
+// 
+// Sets the current item.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::SetCurrentItemIndex(TInt aIndex)
+    {
+    TInt itemCount = ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
+    if ( aIndex < itemCount )
+        {
+        iListBox->SetCurrentItemIndex(aIndex);
+        }
+    else
+        {
+        iListBox->SetCurrentItemIndex(itemCount);
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::ResetListBox
+// 
+// Resets the selection indices, top and current item indices,
+// the selection, and the horizontal scroll offset of this list box.
+// This function does not redraw the list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::ResetListBox()
+    {
+    iListBox->Reset();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::RemoveSelectedExecutionsL
+// 
+// Removes items from list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::RemoveSelectedExecutionsL()
+    {
+    TInt indexOfRemovedExecution = 0;
+    iStartedTestsPtrs.Remove(indexOfRemovedExecution);
+    HandleItemRemovalL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::RemoveAllExecutionsInViewL
+// 
+// Removes all started test cases from list box.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesContainer::RemoveAllExecutionsInViewL()
+    {
+    TInt exutionsInViewCount = iStartedTestsPtrs.Count();
+    iStartedTestsPtrs.Reset(); //Empties the array, does not delete the objects whose pointers are contained in the array
+    HandleItemRemovalL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesContainer::SaveActiveLine
+//
+// Makes the iListBox member save its focus position
+// ----------------------------------------------------------------------------
+//	
+void CTestSetStartedCasesContainer::SaveActiveLine()
+	{
+	((CMenuListBox*)iListBox)->SaveFocusPosition();
+	}
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/TestSetStartedCasesView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,485 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestSetStartedCasesView class
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <eikmenub.h>
+#include  <aknViewAppUi.h>
+#include  <barsread.h>	//TResourceReader
+#include  <Stifui.rsg>
+
+//#include  "UIEngineContainer.h"  
+#include <stifinternal/UIEngineContainer.h>
+
+#include  "Stifui.hrh" 
+
+#include  "TestSetStartedCasesView.h"
+#include  "TestSetStartedCasesContainer.h"
+#include  "AppUIAppUi.h"
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_TESTSET_STARTEDCASESVIEW );
+    iFilterModule.Zero();
+    iFilterTestCaseFile.Zero();
+    iSelectedTestCase=0;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::~CTestSetStartedCasesView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestSetStartedCasesView::~CTestSetStartedCasesView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestSetStartedCasesView::Id() const
+    {
+    return TUid::Uid(ETestSetStartedCasesViewId);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::HandleCommandL(TInt aCommand)
+    {   
+	TBool refreshListBox = EFalse;
+    // Handle rest possible commands
+    switch ( aCommand )
+        {
+        case ECmdShowAllStartedCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowAllStartedCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowOngoingCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowOngoingCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowPausedCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowPausedCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowPassedCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowPassedCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowFailedCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowFailedCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowCrashedAbortedCases:
+            {
+            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowCrashedAbortedCases;
+            refreshListBox = ETrue;
+            break;
+            }
+        case ECmdShowStatistics:
+            {
+            //EShowStatistics
+            TMessageBoxUtil::ShowNotImplementedYetL();
+            break;
+            }
+        case ECmdViewOutput:
+            {
+            ViewTestCaseOutputL();
+            break;
+            }
+        case ECmdPauseTestCase:
+            {
+            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+            if ( NULL != startedTestCase )
+                {
+                startedTestCase->UIEngineContainer().PauseTest();
+                }
+            break;
+            }
+        case ECmdResumeTestCase:
+            {
+            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+            if ( NULL != startedTestCase )
+                {
+                startedTestCase->UIEngineContainer().ResumeTest();
+                }
+            break;
+            }
+        case ECmdAbortTestCase:
+            {
+            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+            if ( NULL != startedTestCase )
+                {
+                startedTestCase->UIEngineContainer().CancelTest();
+                }
+            break;
+            }
+        case EAknSoftkeyOk:
+            {
+            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
+            break;
+            }
+        case EAknSoftkeyBack:
+            {
+            // Remove possible filterings so that they does not affect when coming again to this view
+            iFilterModule.Zero();
+            iFilterTestCaseFile.Zero();
+            iSelectedTestCase=0; //Reset selected test case information
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+        
+        if ( refreshListBox )
+        	{
+        	RefreshNaviTitleL();
+        	iContainer->ConstructListBoxModelL();
+        	iContainer->DrawListBox();
+        	}
+
+    }
+    
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::RefreshNaviTitleL
+// 
+// Refreshes view name shown in the navi pane.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::RefreshNaviTitleL()
+    {
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	TResourceReader reader;
+
+    switch ( ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode )
+        {
+        case EShowAllStartedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED);
+            break;
+        case EShowOngoingCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ONGOING);
+            break;
+        case EShowPausedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PAUSED);
+            break;
+        case EShowPassedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PASSED);
+            break;
+        case EShowFailedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_FAILED);
+            break;
+        case EShowCrashedAbortedCases:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_CRASHED_ABORTED);
+            break;
+        default:
+            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET);
+            break;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;        
+    iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        ViewTestCaseOutputL();
+        }
+
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::ViewTestCaseOutput
+// 
+// Shows outputs of test case which is selected in Container.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::ViewTestCaseOutputL()
+	{
+    iSelectedTestCase = iContainer->CurrentItemIndex();
+    
+    // Sets index  of selected test case to AppUi
+    ( ( CAppUIAppUi* )AppUi() )->SetStartedTestCase( iContainer->CurrentTestCase() );
+    
+    AppUi()->HandleCommandL(ECmdViewOutput);
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CTestSetStartedCasesContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+
+    if ( iSelectedTestCase )
+        iContainer->SetCurrentItemIndex(iSelectedTestCase);
+
+    iContainer->DrawListBox();
+    
+    RefreshNaviTitleL();
+   }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;        
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::DynInitMenuPaneL(
+    TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+
+    // options menu
+    if ( R_TESTSET_STARTEDCASESVIEW_MENU == aResourceId )
+        {
+        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+        if ( NULL != startedTestCase )
+            {
+            switch ( startedTestCase->Status() )
+                {
+                // test case running
+                case CUIStoreIf::EStatusRunning:
+                    {
+                    switch ( startedTestCase->UIEngineContainer().State() )
+                        {
+                        case CUIEngineContainer::ERunning:
+                        case CUIEngineContainer::EPaused:
+                            {
+                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, EFalse );
+                            break;
+                            }
+                        //case CUIEngineContainer::ENotStarted:
+                        //case CUIEngineContainer::EExecuted:
+                        //case CUIEngineContainer::EFinished:
+                        default:
+                            {
+                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+                            }
+                        }
+                    break;
+                    }
+                        
+                // test case not running
+                //case CUIStoreIf::EStatusPassed:
+                //case CUIStoreIf::EStatusFailed:
+                //case CUIStoreIf::EStatusAborted:
+                //case CUIStoreIf::EStatusExecuted
+                default:
+                    {
+                    aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+                    }
+                }
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( ECmdViewOutput, ETrue );
+            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
+            }
+        }
+
+    // test case control menu
+    if ( R_TESTCASE_CONTROL_SUBMENU == aResourceId )
+        {
+        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
+        
+        if ( NULL != startedTestCase )
+            {
+            if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
+                {
+                switch ( startedTestCase->UIEngineContainer().State() )
+                    {
+                    case CUIEngineContainer::ERunning:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
+                        break;
+                        }
+                    case CUIEngineContainer::EPaused:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
+                        break;
+                        }
+                    //case CUIEngineContainer::ENotStarted:
+                    //case CUIEngineContainer::EExecuted:
+                    //case CUIEngineContainer::EFinished:
+                    default:
+                        {
+                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                        break;
+                        }
+                    }
+                }
+            else
+                {
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                }
+            }
+        else
+            {
+            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+            }
+        }
+            
+    }
+
+// ----------------------------------------------------------------------------
+// CTestSetStartedCasesView::TestCaseStateChangedL
+// 
+// Handles status changes of test cases in view.
+// ----------------------------------------------------------------------------
+//
+void CTestSetStartedCasesView::TestCaseStateChangedL()
+    {
+    if ( iContainer )
+        {
+
+        //CStartedTestCase* currentlySelectedTest = iContainer->SelectedTestCase();
+
+        TInt numOfTestsInViewBeforeStateChange = iContainer->TestsInViewCount();
+
+            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
+
+        iContainer->ConstructListBoxModelL();
+
+        // Check if filtering by module or by test case file is selected
+        /*
+        if ( iFilterModule.Length() )
+            {
+            iContainer->FilterCasesByModuleL(iFilterModule);
+            }
+        else if ( iFilterTestCaseFile.Length() )
+            {
+            iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
+            }
+        */
+
+        TInt numOfTestsInViewAfterStateChange = iContainer->TestsInViewCount();
+            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
+
+        if ( numOfTestsInViewAfterStateChange >= numOfTestsInViewBeforeStateChange )
+            iContainer->HandleItemAdditionL();
+        else
+            iContainer->HandleItemRemovalL();
+
+        iContainer->DrawListBox();
+
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/Testmodulesmenuview.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,280 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CTestModulesMenuView class 
+* definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <Stifui.rsg>
+
+#include  <barsread.h>	//TResourceReader
+#include  "TestModulesMenuView.h"
+#include  "TestModulesMenuContainer.h"
+#include  "Stifui.hrh"
+
+#include "AppUIAppUi.h" // For ShowNotImplementedYet() method
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::ConstructL()
+    {
+    CView::ConstructL();
+    BaseConstructL( R_APPUI_TESTMODULESMENUVIEW );
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::~CTestCaseOutputView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CTestModulesMenuView::~CTestModulesMenuView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CTestModulesMenuView::Id() const
+    {
+    return TUid::Uid(ETestModulesMenuViewId); //KTestCaseMenuViewId;
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EAknSoftkeyOk:
+            {
+            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
+            break;
+            }
+        case EAknSoftkeyBack:
+            {
+            AppUi()->HandleCommandL(EAppUIGoBack);
+            break;
+            }
+        // Next is removed from Stifui.rss file in 
+        // RESOURCE MENU_PANE r_appui_testmodulesmenuview_menu's
+        // items section. If want back to use remeve comment there
+        //case ECmdOpenModule:
+        //    {
+            //TFileName fileName;
+            //AknCommonDialogs::RunSelectDlgLD (fileName,
+            //                                  R_MEMORY_SELECTION_DIALOG,
+            //                                  R_FILE_SELECTION_DIALOG
+            //
+            //);
+        //    ShowNotImplementedYet();
+        //    break;
+        //    }
+        case ECmdAddModule:
+            {
+            TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->LoadAllModules();
+            if( KErrNone != ret )
+                {
+                iEikonEnv->InfoMsg( _L("Module adding fails!") );
+                break;
+                }
+
+            AppUi()->HandleCommandL( EAppUIGoBack );
+            //ShowNotImplementedYet();
+            break;
+            }
+        case ECmdRemoveModule:
+            {
+            TInt moduleNumber = iContainer->CurrentItemIndex();
+            RRefArray<TDesC> allModules;
+            TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
+            if( KErrNone != ret )
+                {
+                allModules.Reset();
+                allModules.Close();
+                User::Leave( ret );
+                }
+            // No modules exist...break...
+            if( allModules.Count() == 0 )
+                {
+                iEikonEnv->InfoMsg( _L("No modules available!") );
+                allModules.Reset();
+                allModules.Close();
+                break;
+                }
+            // Module found...remove module...
+            ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->RemoveTestModule(
+                                        allModules[ moduleNumber ] );
+            if( KErrNone != ret )
+                {
+                User::Leave( ret );
+                }
+            allModules.Reset();
+            allModules.Close();
+
+            //iContainer->UpdateView();
+            AppUi()->HandleCommandL( EAppUIGoBack );
+            //ShowNotImplementedYet();
+            break;
+            }
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::DynInitMenuPaneL
+// 
+// Initializes menu pane.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* /* aMenuPane */)
+    {
+
+    if (R_APPUI_TESTMODULESMENUVIEW_MENU == aResourceId)
+        {
+        /*switch ( iData->StartedCaseInOutputView()->State() )
+            {
+            case ENotStarted:
+                {
+                aMenuPane->SetItemDimmed( ECmdOpenModule, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAddModule, ETrue );
+                aMenuPane->SetItemDimmed( ECmdRemoveModule, ETrue );
+                break;
+                }
+            case ERunning:
+                {
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                break;
+                }
+            case EPaused:
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                break;
+                }
+            case EPassed:
+            case EFailed:
+            case EAborted:
+            case EExecuted:
+                {
+                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
+                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
+                break;
+                }
+            }*/
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::HandleListBoxEventL
+// 
+// Handles listbox events.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+	{
+	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
+		{
+        // Open or edit test module or ???
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CTestModulesMenuContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect(), this);
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
+	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
+	
+	TResourceReader reader;
+	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_MODULES);
+	iNaviDecorator = np->CreateNavigationLabelL( reader );
+	CleanupStack::PopAndDestroy(); // resource reader
+	np->PushL(*iNaviDecorator);
+   }
+
+// ----------------------------------------------------------------------------
+// CTestModulesMenuView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CTestModulesMenuView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        iContainer->SaveActiveLine();
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    delete iNaviDecorator;
+    iNaviDecorator = NULL;
+    }
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/UIStoreHandler.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains implementation of 
+* CUIStoreHandler class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "UIStoreHandler.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
+class CUIStore;
+
+// ==================== LOCAL FUNCTIONS =======================================
+// None
+
+// ================= MEMBER FUNCTIONS =========================================
+// ----------------------------------------------------------------------------
+// CUIStoreHandler::CUIStoreHandler
+// 
+// Default constructor.
+// C++ default constructor can NOT contain any code, that might leave.
+// ----------------------------------------------------------------------------
+//
+CUIStoreHandler::CUIStoreHandler( CAppUIAppUi* aAppUIAppUI ) :
+    iAppUIAppUI( aAppUIAppUI ),
+    iExecutedTestCaseCount( 0 )
+    {
+
+    }
+
+// ----------------------------------------------------------------------------
+// CUIStoreHandler::ConstructL
+// 
+// Symbian OS second phase constructor.
+// Symbian OS default constructor can leave.
+// ----------------------------------------------------------------------------
+//
+void CUIStoreHandler::ConstructL()
+    {
+    CUIStoreIf::ConstructL();
+
+    }
+
+// ----------------------------------------------------------------------------
+// CUIStoreHandler::NewL
+// 
+// Two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+CUIStoreHandler* CUIStoreHandler::NewL( CAppUIAppUi* aAppUIAppUI )
+    {
+    // Create CUIStoreHandler object uistorehandler
+    CUIStoreHandler* uistorehandler = new (ELeave) CUIStoreHandler( aAppUIAppUI );
+
+    CleanupStack::PushL( uistorehandler );
+    uistorehandler->ConstructL();
+    CleanupStack::Pop( uistorehandler );
+
+    return uistorehandler;
+
+    }
+
+// ----------------------------------------------------------------------------
+// CUIStoreHandler::~CUIStoreHandler
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CUIStoreHandler::~CUIStoreHandler()
+    {
+
+    }
+
+// ----------------------------------------------------------------------------
+// CUIStoreHandler::Update
+// 
+// Receives output update notify from started test case.
+// Checks if that test case is currently in output view then
+// sends notification to AppUI which handles notification onward.
+// ----------------------------------------------------------------------------
+//
+void CUIStoreHandler::Update( CStartedTestCase* aTestCase, TInt aStatus )
+    {
+	_LIT( KErrorMsg, "Error during output update" );
+    TRAPD(err,iAppUIAppUI->OutputUpdateL( aTestCase, aStatus ));
+	if ( err != KErrNone )
+		{
+		RDebug::Print( KErrorMsg );
+		}
+
+        //iAppUi->OutputUpdate();
+    //if( aStatus == EPrintUpdate )
+    //    {
+        //iAppUIAppUI->OutputUpdate( aTestCase );
+    //    }
+    //else
+    //    {
+        //iAppUIAppUI->TestCaseStateChanged();
+    //    }
+
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS =================================
+// None
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/stifui/src/View.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,100 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains CView class definition.
+*
+*/
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <Stifui.rsg>
+#include  "AppUIAppUi.h"
+#include  "View.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+// ----------------------------------------------------------------------------
+// CView::ConstructL
+// 
+// Symbian OS two-phased constructor.
+// ----------------------------------------------------------------------------
+//
+void CView::ConstructL()
+    {
+    iUIStore = ( (CAppUIAppUi*)AppUi() )->UIStoreHandler();
+    }
+
+// ----------------------------------------------------------------------------
+// CView::~CView
+// 
+// Destructor.
+// ----------------------------------------------------------------------------
+//
+CView::~CView()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CView::Id
+// 
+// Returns view´s id.
+// ----------------------------------------------------------------------------
+//
+TUid CView::Id() const
+    {
+    return TUid::Uid(0);
+    }
+
+// ----------------------------------------------------------------------------
+// CView::HandleCommandL
+// 
+// Handles a command.
+// ----------------------------------------------------------------------------
+//
+void CView::HandleCommandL(TInt /*aCommand*/)
+    {   
+    }
+
+// ----------------------------------------------------------------------------
+// CView::HandleClientRectChange
+// 
+// Handles client rect changes.
+// ----------------------------------------------------------------------------
+//
+void CView::HandleClientRectChange()
+    {
+    }
+
+// ----------------------------------------------------------------------------
+// CView::DoActivateL
+// 
+// Initializes view when activated.
+// ----------------------------------------------------------------------------
+//
+void CView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/ )
+	{
+	}
+
+// ----------------------------------------------------------------------------
+// CView::DoDeactivate
+// 
+// Deactivates view.
+// ----------------------------------------------------------------------------
+//
+void CView::DoDeactivate()
+    {
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/data/UITestServerStarter.rls	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains name of uitestserverstarter.
+*
+*/
+
+//  LOCALISATION STRINGS
+
+// Caption string for app.
+#define qtn_caption_string "UITestServerStarter"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/data/UITestServerStarter.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file defines UITestServerStarter resources.
+*
+*/
+
+//  RESOURCE IDENTIFIER
+NAME UITE	// 4 letter ID
+
+
+//  INCLUDES
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include "UITestServerStarter.hrh"
+#include "UITestServerStarter.rls"
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+//	Define the resource file signature
+//	This resource should be empty.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE
+	{
+	}
+
+// -----------------------------------------------------------------------------
+//
+//	Default Document Name
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name
+	{
+	buf="UITE";
+	}
+
+// -----------------------------------------------------------------------------
+//
+//	Define default menu and CBA key.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+	{
+	//menubar = r_menubar;
+	cba = R_AVKON_SOFTKEYS_EXIT;
+	}
+
+
+// -----------------------------------------------------------------------------
+//
+//   r_menubar
+//   Main menubar
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_menubar
+	{
+	titles =
+		{
+		MENU_TITLE { menu_pane = r_menu; }
+		};
+	}
+
+
+// -----------------------------------------------------------------------------
+//
+//   r_menu
+//   Menu for "Options"
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_menu
+	{
+	items =
+		{
+		MENU_ITEM
+				{
+				command = EAknSoftkeyExit;
+				txt = qtn_exit;
+				}
+		};
+	}
+
+// -----------------------------------------------------------------------------
+//
+// About dialog resource.
+//
+// -----------------------------------------------------------------------------
+//
+// None
+
+// -----------------------------------------------------------------------------
+//
+// Resources for messages.
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF32 r_caption_string { buf=qtn_caption_string; }
+
+// ---------------------------------------------------------------------------- 
+//
+// r_localisable_app_info
+//
+// ---------------------------------------------------------------------------- 
+//
+RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
+	{
+	short_caption = qtn_caption_string;
+	caption_and_icon = 
+	CAPTION_AND_ICON_INFO
+		{
+		caption = qtn_caption_string;
+
+		number_of_icons = 1;
+	   	icon_file = "\\resource\\apps\\UITestServerStarter.mif";
+		};
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/data/UITestServerStarter_reg.rss	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file defines UITestServerStarter resources.
+*
+*/
+
+#include "UITestServerStarter.hrh"
+#include "UITestServerStarter.rls"
+#include <appinfo.rh>
+#include <UITestServerStarter.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 _UID3
+
+RESOURCE APP_REGISTRATION_INFO
+	{
+	app_file="UITestServerStarter";
+//	localisable_resource_file =  qtn_loc_resource_file_1;
+//	localisable_resource_id = R_LOCALISABLE_APP_INFO;
+	hidden=KAppIsHidden;
+	embeddability=KAppNotEmbeddable;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/group/UITestServerStarter.mmp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: MMP file of UITestServerStarter.
+*
+*/
+
+#include <platform_paths.hrh>
+
+SMPSAFE
+
+TARGET			UITestServerStarter.exe
+TARGETTYPE		exe
+UID		  		0x100039CE 0x2000F8E8
+VENDORID		0x101FB657
+SECUREID		0x2000F8E8
+CAPABILITY		ALL -TCB
+
+START RESOURCE	../data/UITestServerStarter.rss
+	HEADER
+	TARGETPATH resource/apps
+END
+
+SOURCEPATH		../data
+START RESOURCE	UITestServerStarter_reg.rss
+	DEPENDS uitestserverstarter.rsg
+	TARGETPATH		/private/10003a3f/apps
+END
+
+SOURCEPATH		../src
+
+SOURCE			TestServerThreadStarter.cpp
+SOURCE			UITestServerStarter.cpp 
+SOURCE			UITestServerStarterAppView.cpp
+SOURCE			UITestServerStarterAppUi.cpp
+SOURCE			AknUiEnvProxy.cpp
+SOURCE			EventUtil.cpp
+SOURCE			UITestServerStarterApplication.cpp
+SOURCE			UITestServerStarterDocument.cpp
+SOURCE			UITestServerStarterAppContainer.cpp
+
+USERINCLUDE ../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY		   euser.lib
+LIBRARY		   apparc.lib
+LIBRARY		   cone.lib
+LIBRARY		   eikcore.lib
+LIBRARY		   avkon.lib
+LIBRARY		   commonengine.lib
+LIBRARY		   efsrv.lib 
+LIBRARY		   estor.lib
+LIBRARY        aknnotify.lib
+LIBRARY        hlplch.lib
+LIBRARY        apgrfx.lib 
+LIBRARY        ws32.lib
+LIBRARY        aknskins.lib 
+LIBRARY        aknskinsrv.lib
+
+LIBRARY         stiftestserver.lib
+
+START WINS      
+// ?wins_specific_information
+END
+
+START MARM
+// ?marm_specific_information
+END
+
+/* Test Server requires large stack. In case of change update also thread creation parameters
+   in "void CTestServerThreadStarter::RunL" method.
+*/
+EPOCSTACKSIZE   40960
+EPOCHEAPSIZE 	0x001000 0x400000
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/group/bld.inf	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: bld.inf build information for UITestServerStarter.
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+// Specify the platforms your component needs to be built for here.
+// ARM4 not supported in SDK
+
+	DEFAULT
+
+
+PRJ_EXPORTS
+// None
+
+PRJ_TESTEXPORTS
+// None
+
+PRJ_MMPFILES
+	
+	UITestServerStarter.mmp
+
+PRJ_TESTMMPFILES
+// None
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/AknUiEnvProxy.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,166 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the Akn UI 
+* Proxy class implementations.
+*
+*/
+
+#ifndef AKNUIENVPROXY_H_
+#define AKNUIENVPROXY_H_
+
+//  INCLUDES
+#include <stifinternal/UiEnvProxy.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CUITestServerStarterAppUi;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// Akn implementation of UI Proxy interface.
+class CAknUiEnvProxy: public CUiEnvProxy
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+	
+	public:  // Constructors and destructor
+	    /**
+	    * C++ destructor.
+	    */
+	    ~CAknUiEnvProxy();
+	
+	public: // New functions
+	    /**
+	    * NewL is first phase of two-phased constructor.
+	    */		
+		static CAknUiEnvProxy* NewL( CUITestServerStarterAppUi* aAppUi );
+		
+    public: // Functions from base classes
+
+		/**
+		 * Parses key code.
+		 */
+		virtual TInt ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode ) const;
+	
+		/**
+		 * Parses key scan code.
+		 */
+		virtual TInt ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode ) const;
+	
+		/**
+		 * Parses key modifier.
+		 */
+		virtual TInt ParseModifier( const TDesC& aModifierName, TUint& aModifier ) const;
+	    
+		/**
+		 * Parse pointer event type
+		 */
+		virtual TInt ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType ) const;
+
+		/**
+		 * Brings UI control container to foreground.
+		 */
+		virtual void BringToForeground();
+
+		/**
+		 * Sends UI control container to background.
+		 */
+		virtual void SendToBackground();
+
+		/**
+		 * Sends local key event to UI control.
+		 */
+		virtual void PressKeyL( TRequestStatus* aStatus, TUint aKeyCode, TInt aKeyScanCode = 0, 
+				   TUint aKeyModifiers = 0, TInt aKeyRepeats = 0 );
+
+		/**
+		 * Sends global key event to UI control.
+		 */
+		virtual void PressKeyL( TUint aKeyCode, TInt aKeyScanCode = 0, 
+				   TUint aKeyModifiers = 0, TInt aKeyRepeats = 0 );
+
+		/**
+		 * Sends text to UI control.
+		 */
+		virtual void TypeTextL( TRequestStatus* aStatus, const TDesC& aText );
+
+		/**
+		 * Sends global text to UI control.
+		 */
+		virtual void TypeTextL( const TDesC& aText );
+		
+		/**
+		 * Send pointer event
+		 */
+		virtual void SendPointerEventL( TUint aType, const TPoint& aPosition );		
+		
+		/**
+		 * Send local pointer event
+		 */
+		virtual void SendPointerEventL( TRequestStatus* aStatus, TUint aType, const TPoint& aPosition );
+		
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+        
+    private:	// New functions
+	    /**
+	    * C++ default constructor.
+	    */
+		CAknUiEnvProxy();
+    
+	    /**
+	    * By default Symbian OS constructor is private.
+	    */
+    	void ConstructL( CUITestServerStarterAppUi* aAppUi );
+    
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+    	CUITestServerStarterAppUi* iAppUi;	// Pointer to AppUi
+		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None
+};
+
+#endif // AKNUIENVPROXY_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/EventUtil.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains TEventUtil class declaration.
+*
+*/
+
+#ifndef EVENTUTIL_H_
+#define EVENTUTIL_H_
+
+//  INCLUDES
+#include <e32base.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// Utility class for key codes parsing.
+class TEventUtil
+    {
+    private: // Enumerations
+    	// none
+
+    public: // Enumerations
+		enum TCustomPointerEventType { EButton1 = 1000, EButton2, EButton3 };
+    
+    public: // Constructors and destructor
+
+    public: // Constructors and destructor
+
+    public: // New functions
+    	/**
+    	 * Returns descriptive key code name.
+    	 */
+        static TPtrC GetKeyCodeName( TUint aKeyCode );
+        
+        /**
+         * Parses key code.
+         */ 
+        static TInt ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode );
+
+		/**
+		 * Returns descriptive key scan code name.
+		 */
+        static TPtrC GetKeyScanCodeName( TInt aKeyScanCode );
+        
+        /**
+         * Parses key scan code.
+         */
+        static TInt ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode );
+
+        /**
+         * Returns descriptive key modifier name.
+         */
+        static TPtrC GetModifierName( TUint aModifier );
+        
+        /**
+         * Parses key modifier.
+         */
+        static TInt ParseModifier( const TDesC& aModifierName, TUint& aModifier );
+        
+        /**
+         * Parses pointer event type.
+         */
+        static TInt ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType );
+
+    public: // Functions from base classes
+
+    protected:  // New functions
+
+    protected:  // Functions from base classes
+
+    private:    // New functions
+
+    public:     // Data
+
+    protected:  // Data
+
+    private:    // Data
+
+    public:     // Friend classes
+
+    protected:  // Friend classes
+
+    private:    // Friend classes
+
+    };
+
+#endif /*EVENTUTIL_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/TestServerThreadStarter.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* TestServerThreadStarter class.
+*
+*/
+
+
+#ifndef TESTSERVERTHREADSTARTER_H_
+#define TESTSERVERTHREADSTARTER_H_
+
+//  INCLUDES
+#include "e32base.h"
+
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CTestThreadContainerRunnerFactory;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// Class used to create thread in which testserver execution code is placed.
+class CTestServerThreadStarter: public CActive
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+	
+	public:  // Constructors and destructor
+	    /**
+	    * C++ destructor.
+	    */
+		~CTestServerThreadStarter();
+	
+	public: // New functions
+	    /**
+	    * NewL is first phase of two-phased constructor.
+	    */		
+		static CTestServerThreadStarter* NewL();
+	
+		/**
+		 * Performs testserver execution request.
+		 */
+		TInt RunTestServerThread( CTestThreadContainerRunnerFactory* aTestThreadContainerRunnerFactory );
+	public: // Functions from base classes
+		/**
+		 * RunL derived from CActive handles the completed requests.
+		 */
+		void RunL();
+		
+		/**
+		 * DoCancel derived from CActive handles the Cancel.
+		 */
+		void DoCancel();
+
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+        
+    private:	// New functions
+    	/**
+    	 * Thread function in which testserver execution code is placed.
+    	 */
+		static TInt TestServerStarterThreadFunction( TAny* aParameters );
+	    
+		/**
+	    * C++ default constructor.
+	    */
+		CTestServerThreadStarter();
+
+	    /**
+	    * By default Symbian OS constructor is private.
+	    */
+		void ConstructL();		
+	
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+		RTimer iTimer;	// Timer which complets testserver execution request
+		CTestThreadContainerRunnerFactory* iTestThreadContainerRunnerFactory; 	// Pointer to test thread container
+																				// runner factory passed as a parameter
+																				// to function which executes testserver
+		TThreadId iMainThreadId;	// UITestServerStarter main thread id 
+		TInt iReturnCode;			// TestServer execution return code
+		RSemaphore iServerThreadStartedSemaphore;	// Semaphore which indicates that testserver execution thread
+													// was successfully created		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None
+	};
+
+
+
+#endif // TESTSERVERTHREADSTARTER_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarter.hrh	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains UID3 definition.
+*
+*/
+
+#ifndef __UITESTSERVERSTARTER_HRH__
+#define __UITESTSERVERSTARTER_HRH__
+
+#define _UID3 0x2000F8E8
+
+#endif // __UITESTSERVERSTARTER_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppContainer.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* UITestServerStarter AppUi container class.
+*
+*/
+
+#ifndef UITESTSERVERSTARTERAPPCONTAINER_H_
+#define UITESTSERVERSTARTERAPPCONTAINER_H_
+
+//  INCLUDES
+#include <coecntrl.h>
+#include <coemop.h>
+
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CAknsBasicBackgroundControlContext;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// UITestServerStarter standard AppUi container class.
+class CUITestServerStarterAppContainer: public CCoeControl
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+	
+	public:  // Constructors and destructor
+		/**
+		 * Virtual Destructor.
+		 */
+		~CUITestServerStarterAppContainer();
+
+	private:  // Constructors and destructor
+		/**
+		 * C++ default constructor.
+		 */
+		CUITestServerStarterAppContainer();
+
+		/**
+		 * Perform the second phase construction of a
+		 * CUITestServerStarterAppView object.
+		 */
+		void ConstructL( const TRect& aRect );
+		
+	public: // New functions
+		/**
+		 * Two-phased constructor.
+		 * Create a CUITestServerStarterAppContainer object, which will draw itself to aRect.
+		 */
+		static CUITestServerStarterAppContainer* NewL( const TRect& aRect );
+
+		/**
+		* Two-phased constructor.
+		* Create a CUITestServerStarterAppContainer object, which will draw itself
+		*/
+		static CUITestServerStarterAppContainer* NewLC( const TRect& aRect );
+
+		
+		/**
+		 * This function is used to allow controls to ask their owners 
+		 * for access to other objects that they own
+		 */
+		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
+	public: // Functions from base classes
+		// None
+	
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+        
+    private:	// New functions
+    	// None
+
+    private:	// Functions from base classes
+    
+    	/**
+    	 * Draws the control
+    	 */
+        void Draw( const TRect& aRect ) const;
+        
+        /**
+         * Responds to changes to the size and position of the 
+         * contents of this control
+         */
+        void SizeChanged();
+    
+        //void HandleResourceChange( TInt aType );
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+    	CAknsBasicBackgroundControlContext* iBgContext; // Skin background object context pointer
+		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None
+	};
+
+#endif /*UITESTSERVERSTARTERAPPCONTAINER_H_*/
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppUi.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,172 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* UITestServerStarter AppUi class
+*
+*/
+
+#ifndef UITESTSERVERSTARTERAPPUI_H_
+#define UITESTSERVERSTARTERAPPUI_H_
+
+//  INCLUDES
+#include <aknViewAppUi.h> 
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CUITestServerStarterAppView;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// UITestServerStarter AppUi class
+class CUITestServerStarterAppUi : public CAknViewAppUi
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+		/**
+		 * Currently handled event type.
+		 */
+		enum TEventType { 
+			ENone,		// None 
+			EPressKey,  // Press key event
+			ETypeText, 	// Type text event
+			EPointerEvent, // Pointer event
+			};
+	
+	public:  // Constructors and destructor
+		/**
+		 * C++ default constructor. This needs to be public due to
+		 * the way the framework constructs the AppUi
+		 */
+		CUITestServerStarterAppUi();
+	
+		/**
+		 * Virtual Destructor.
+		 */
+		virtual ~CUITestServerStarterAppUi();
+	
+	public: // New functions
+		/**
+		 * ConstructL.
+		 * 2nd phase constructor.
+		 */
+		void ConstructL();
+
+		/**
+	     * Prepares AppUi to recive type text event
+	     */	
+		virtual void PrepareToTypeText( TInt aTextLength );
+	
+		/**
+	     * Prepares AppUi to recive key press event
+	     */	
+		virtual void PrepareToPressKey();			
+
+		/**
+	     * Prepares AppUi to recive pointer event
+	     */	
+		virtual void PrepareToPointerEvent();			
+		
+		/**
+	     * Notifies that key press event was recived.
+	     */	
+		virtual void KeyPressHandled();
+	
+		/**
+	     * Notifies that text type event was recived.
+	     */	
+		virtual void TextTypeHandled();
+		
+		/**
+	     * Notifies that pointer event was recived.
+	     */	
+		virtual void PointerEventHandled();
+		
+		/**
+	     * Requests notification when key press event is handled.
+	     */	
+		virtual void NotifyAboutHandledKeyPress( TRequestStatus* aStatus );
+	
+		/**
+	     * Requests notification when text type event is handled.
+	     */	
+		virtual void NotifyAboutHandledTextType( TRequestStatus* aStatus );	
+
+		/**
+	     * Requests notification when pointer event is handled.
+	     */	
+		virtual void NotifyAboutHandledPointerEvent( TRequestStatus* aStatus );	
+
+	public: // Functions from base classes
+		/**
+	     * Overwritten version of CCoeAppUi::HandleWsEventL() method.
+	     */	
+		void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
+
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+        
+    private:	// New functions
+    	// None
+
+    private: 	// Functions from base classes
+		/**
+		 * From CEikAppUi, HandleCommandL.
+		 * Takes care of command handling.
+		 * @param aCommand Command to be handled.
+		 */
+		void HandleCommandL( TInt aCommand );
+	        
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+		CUITestServerStarterAppView* iAppView;	// The application view owned by CUITestServerStarterAppUi		
+		TRequestStatus* iEventStatus;	// Pointer to request statuc which is completed when 
+										// selected event is handled.		
+		TEventType iEventType;	// Currently handled event type;		
+		TInt iTypeTextLength;	// Length of text send by typetext testscripter keyword
+		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None
+	};
+
+#endif // UITESTSERVERSTARTERAPPUI_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarterAppView.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,142 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* UITestServerStarter AppUi view class.
+*
+*/
+
+#ifndef UITESTSERVERSTARTERAPPVIEW_H_
+#define UITESTSERVERSTARTERAPPVIEW_H_
+
+//  INCLUDES
+#include <aknview.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CUITestServerStarterAppContainer;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+// UITestServerStarter standard AppUi view class.
+class CUITestServerStarterAppView : public CAknView
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+	
+	public:  // Constructors and destructor
+		/**
+		 * Virtual Destructor.
+		 */
+		virtual ~CUITestServerStarterAppView();
+	
+	private:  // Constructors and destructor
+
+		/**
+		 * Perform the second phase construction of a
+		 * CUITestServerStarterAppView object.
+		 */
+		void ConstructL();
+
+		/**
+		 * C++ default constructor.
+		 */
+		CUITestServerStarterAppView();
+	
+	public: // New functions
+		/**
+		 * Two-phased constructor.
+		 * Create a CUITestServerStarterAppView object.
+		 */
+		static CUITestServerStarterAppView* NewL();
+	
+		/**
+		* Two-phased constructor.
+		* Create a CUITestServerStarterAppView object
+		*/
+		static CUITestServerStarterAppView* NewLC();
+
+	public: // Functions from base classes
+	    /**
+	    * Return Uid
+	    */
+	    TUid Id() const;
+	
+	    /**
+	    * Handle Commands
+	    */
+	    void HandleCommandL(TInt aCommand);
+	
+	    /**
+	    * Handle size changes
+	    */
+	    void HandleClientRectChange();
+		
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+        
+    private:	// New functions
+    	// None
+
+    private:	// Functions from base classes
+	    /**
+	    * From AknView, Activates view
+	    */
+	    void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+	        const TDesC8& aCustomMessage);
+	
+	    /**
+	    * From AknView, Deactivates view
+	    */
+	    void DoDeactivate();
+    
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+    	CUITestServerStarterAppContainer* iContainer; // View container
+		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None
+	};
+
+#endif // UITESTSERVERSTARTERAPPVIEW_H_
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarterApplication.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,111 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* CUITestServerStarterApplication class.
+*
+*/
+
+#ifndef UITESTSERVERSTARTERAPPLICATION_H_
+#define UITESTSERVERSTARTERAPPLICATION_H_
+
+
+//  INCLUDES
+#include <aknapp.h>
+#include "UITestServerStarter.hrh"
+
+// CONSTANTS
+
+// UID for the application;
+const TUid KUidUITestServerStarterApp =
+	{
+	_UID3
+	};
+
+const TUid KMainViewId = { 1982 };
+// CLASS DECLARATION
+
+// CLASS DECLARATION
+// DESCRIPTION
+/**
+ * UITestServerStarterApplication application class.
+ * Provides factory to create concrete document object.
+ * An instance of CUITestServerStarterApplication is the application part of the
+ * AVKON application framework for the CUITestServerStarterApplication application.
+ */
+class CUITestServerStarterApplication : public CAknApplication
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+	
+	public:  // Constructors and destructor
+	    /**
+	    * C++ destructor.
+	    */
+	
+	public:
+	// Functions from base classes
+	
+	/**
+	 * From CApaApplication, AppDllUid.
+	 * @return Application's UID (KUidUITestServerStarterApplication).
+	 */
+	TUid AppDllUid () const;
+	
+	protected: // Functions from base classes
+	
+	/**
+	 * From CApaApplication, CreateDocumentL.
+	 * Creates CUITestServerStarterDocument document object. The returned
+	 * pointer in not owned by the CUITestServerStarterApplication object.
+	 * @return A pointer to the created document object.
+	 */
+	CApaDocument* CreateDocumentL ();
+	
+	virtual void PreDocConstructL();
+	
+	
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None	
+	
+    private:	// New functions
+    	// None
+	
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+    	// None
+			
+	public:		// Friend classes
+		// None
+	
+	protected:	// Friend classes
+		// None
+	
+	private:	// Friend classes
+		// None		
+	};
+
+
+
+#endif /*UITESTSERVERSTARTERAPPLICATION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/inc/UITestServerStarterDocument.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains the header file of the 
+* UITestServerStarter Document class.
+*
+*/
+
+#ifndef UITESTSERVERSTARTERDOCUMENT_H_
+#define UITESTSERVERSTARTERDOCUMENT_H_
+
+//  INCLUDES
+#include <AknDoc.h>
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+// DATA TYPES
+// None
+
+// FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+class CUITestServerStarterAppUi;
+class CEikApplication;
+
+// CLASS DECLARATION
+
+// DESCRIPTION
+/**
+ * CClockTestDocument application class.
+ * An instance of class CClockTestDocument is the Document part of the
+ * AVKON application framework for the ClockTest example application.
+ */
+class CUITestServerStarterDocument : public CAknDocument
+	{
+	public: // Enumerations
+	    // None
+	
+	private: // Enumerations
+	    // None
+
+	private:  // Constructors and destructor
+		// None
+	public: // New functions
+	
+	/**
+	 * NewL.
+	 * Two-phased constructor.
+	 * Construct a CUITestServerStarterDocument for the AVKON application aApp
+	 * using two phase construction, and return a pointer
+	 * to the created object.
+	 * @param aApp Application creating this document.
+	 * @return A pointer to the created instance of CUITestServerStarterDocument.
+	 */
+	static CUITestServerStarterDocument* NewL (CEikApplication& aApp);
+	
+	/**
+	 * NewLC.
+	 * Two-phased constructor.
+	 * Construct a CUITestServerStarterDocument for the AVKON application aApp
+	 * using two phase construction, and return a pointer
+	 * to the created object.
+	 * @param aApp Application creating this document.
+	 * @return A pointer to the created instance of CUITestServerStarterDocument.
+	 */
+	static CUITestServerStarterDocument* NewLC (CEikApplication& aApp);
+	
+	/**
+	 * ~CUITestServerStarterDocument
+	 * Virtual Destructor.
+	 */
+	virtual ~CUITestServerStarterDocument();
+	
+	public: // Functions from base classes
+	
+		/**
+		 * CreateAppUiL
+		 * From CEikDocument, CreateAppUiL.
+		 * Create a CUITestServerStarterAppUi object and return a pointer to it.
+		 * The object returned is owned by the Uikon framework.
+		 * @return Pointer to created instance of AppUi.
+		 */
+		CEikAppUi* CreateAppUiL ();
+	
+    protected:	// New functions
+        // None
+        
+    protected:	// Functions from base classes
+        // None
+
+    private:	// New functions
+	
+		/**
+		 * ConstructL
+		 * 2nd phase constructor.
+		 */
+		void ConstructL ();
+		
+		/**
+		 * CUITestServerStarterDocument.
+		 * C++ default constructor.
+		 * @param aApp Application creating this document.
+		 */
+		CUITestServerStarterDocument( CEikApplication& aApp );
+    
+	private:	// Functions from base classes
+        // None    
+    
+	public:		//Data
+	    // None
+        
+	protected:	// Data
+        // None
+        
+    private:	// Data
+        // None
+		
+    public:		// Friend classes
+        // None
+
+    protected:	// Friend classes
+        // None
+
+    private:	// Friend classes
+        // None	
+	};
+
+
+#endif /*UITESTSERVERSTARTERDOCUMENT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/AknUiEnvProxy.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,683 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CAknUiEnvProxy class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "AknUiEnvProxy.h"
+#include "UITestServerStarterAppUi.h"
+#include "EventUtil.h"
+
+#include <coeaui.h>
+#include <eikenv.h>
+#include <apgtask.h>
+#include <w32std.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
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: NewL
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: CUITestServerStarterAppUi* aAppUi: in: Pointer to CUITestServerStarterAppUi.
+     
+     Return Values: Pointer to new CAknUiEnvProxy object.
+
+     Errors/Exceptions: Leaves if new or ConstructL leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CAknUiEnvProxy* CAknUiEnvProxy::NewL( CUITestServerStarterAppUi* aAppUi )
+	{
+	CAknUiEnvProxy* self = new(ELeave)CAknUiEnvProxy();
+	CleanupStack::PushL( self );
+	self->ConstructL( aAppUi );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ConstructL
+
+     Description: ConstructL is second phase of two-phased constructor.
+
+     Performs construction of CAknUiEnvProxy object.
+
+     Parameters: CUITestServerStarterAppUi* aAppUi: in: Pointer to CUITestServerStarterAppUi.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::ConstructL( CUITestServerStarterAppUi* aAppUi )
+	{	
+	iAppUi = aAppUi;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: BringToForeground
+
+     Description: Brings UI component container to foreground.
+
+     Brings UI component container to foreground. 
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::BringToForeground()
+	{
+	TApaTask task( CCoeEnv::Static()->WsSession() );
+	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() );
+	task.BringToForeground();	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: SendToBackground
+
+     Description: Sends UI component container to background.
+
+     Sends UI component container to background.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::SendToBackground(  )
+	{
+	TApaTask task( CCoeEnv::Static()->WsSession() );
+	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() ); 
+	task.SendToBackground();		
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: PressKeyL
+
+     Description: Sends local key press event to UI component.
+
+     Sends key press event to UI component. UI component must be first added to 
+     AppUi stack to be able to recive this key event. 
+
+     Parameters: TRequestStatus* aStatus: out: Pointer to request status used to notify that
+     										   key event was recived.
+     			 TUint aKeyCode: in: Key code.
+     			 TInt aKeyScanCode: in: Key scan code.
+     			 TUint aKeyModifiers: in: Key modifiers
+     			 TInt aKeyRepeats: in: Key press repeats count.
+     
+     Return Values: None.
+
+     Errors/Exceptions: Leaves if some error occurs during key event sending.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::PressKeyL( TRequestStatus* aStatus, TUint aKeyCode, TInt aKeyScanCode, 
+							   TUint aKeyModifiers, TInt aKeyRepeats )
+	{
+	// Fill key event structure
+	TWsEvent wsEvent;
+	wsEvent.SetType(EEventKey);
+	TKeyEvent* keyEvent = wsEvent.Key();
+	keyEvent->iCode = aKeyCode;
+	keyEvent->iScanCode = aKeyScanCode;
+	keyEvent->iModifiers = aKeyModifiers;
+	keyEvent->iRepeats = aKeyRepeats;
+		
+	// Send info to AppUi that we are going to send key event
+	iAppUi->PrepareToPressKey();
+	
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+	TInt wgId = CCoeEnv::Static()->RootWin().Identifier();	
+	// Send key event
+	TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );
+	User::LeaveIfError( ret );
+	
+	wsSession.Flush();
+	
+	// Request notification when key press is handled
+	*aStatus = KRequestPending;
+	iAppUi->NotifyAboutHandledKeyPress( aStatus );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: PressKeyL
+
+     Description: Sends global key press event to UI component.
+
+     Sends key press event to UI component which is currently focuused. 
+
+     Parameters: TUint aKeyCode: in: Key code.
+     			 TInt aKeyScanCode: in: Key scan code.
+     			 TUint aKeyModifiers: in: Key modifiers
+     			 TInt aKeyRepeats: in: Key press repeats count.
+     
+     Return Values: None.
+
+     Errors/Exceptions: Leaves if some error occurs during key event sending.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::PressKeyL( TUint aKeyCode, TInt aKeyScanCode, 
+							   TUint aKeyModifiers, TInt aKeyRepeats )
+	{	
+	// Fill key event structure
+	TWsEvent wsEvent;
+	wsEvent.SetType(EEventKey);
+	TKeyEvent* keyEvent = wsEvent.Key();
+	keyEvent->iCode = aKeyCode;
+	keyEvent->iScanCode = aKeyScanCode;
+	keyEvent->iModifiers = aKeyModifiers;
+	keyEvent->iRepeats = aKeyRepeats;
+		
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();	
+	TInt wgId = wsSession.GetFocusWindowGroup();	
+	TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );	
+	User::LeaveIfError( ret );
+	wsSession.Flush();
+	}
+
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: TypeTextL
+
+     Description: Sends text to UI component.
+
+     Sends text to UI component. UI component must be first added to 
+     AppUi stack to be able to recive this key event. 
+
+     Parameters: TRequestStatus* aStatus: out: Pointer to request status used to notify that
+     										   key event was recived.
+    			 TPtrC aText: in: Text which will be send to UI component. 
+     
+     Return Values: None.
+
+     Errors/Exceptions: Leaves if some error occurs during key event sending.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::TypeTextL( TRequestStatus* aStatus, const TDesC& aText )
+	{
+	TLex textParser( aText );
+
+	// Send info to AppUi that we are going to send text
+	iAppUi->PrepareToTypeText( aText.Length() );
+	
+	TInt wgId = CCoeEnv::Static()->RootWin().Identifier();
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+
+	TChar character = 0;
+	while ( ( character = textParser.Get() ) != 0 )
+		{
+		// Fill key event structure
+		TWsEvent wsEvent;
+		wsEvent.SetType(EEventKey);
+		TKeyEvent* keyEvent = wsEvent.Key();
+		keyEvent->iCode = character;
+		keyEvent->iScanCode = 0;
+		keyEvent->iModifiers = 0;
+		keyEvent->iRepeats = 0;
+		
+		// Send single character from text to UI component
+		TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );
+		User::LeaveIfError( ret );
+		wsSession.Flush();
+		}
+		
+	// Request notification when send text is recived
+	*aStatus = KRequestPending;
+	iAppUi->NotifyAboutHandledTextType( aStatus );	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: TypeTextL
+
+     Description: Sends global text to UI component.
+
+     Sends global text to UI component. UI component must be focused to receive that event. 
+
+     Parameters: TPtrC aText: in: Text which will be send to UI component. 
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::TypeTextL( const TDesC& aText )
+	{
+	TLex textParser( aText );
+
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+	TInt wgId = wsSession.GetFocusWindowGroup();
+
+	TChar character = 0;	
+	while ( ( character = textParser.Get() ) != 0 )
+		{
+		// Fill key event structure
+		TWsEvent wsEvent;
+		wsEvent.SetType(EEventKey);
+		TKeyEvent* keyEvent = wsEvent.Key();
+		keyEvent->iCode = character;
+		keyEvent->iScanCode = 0;
+		keyEvent->iModifiers = 0;
+		keyEvent->iRepeats = 0;
+		
+		// Send single character from text to UI component
+		TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );			
+		User::LeaveIfError( ret );
+		wsSession.Flush();
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: SendPointerEventL
+
+     Description: Send pointer event
+
+     Send pointer event.
+
+     Parameters: TUint aType: in: KEvent type.
+     			 const TPoint& aPosition: in: Position.
+     			      
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::SendPointerEventL( TUint aType, const TPoint& aPosition )
+	{
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+	TRawEvent pointerEvent;
+
+	if ( aType < TEventUtil::EButton1 ) {
+		pointerEvent.Set( ( TRawEvent::TType )aType, aPosition.iX, aPosition.iY );
+		wsSession.SimulateRawEvent( pointerEvent );
+		} 
+	else if ( ( aType >= TEventUtil::EButton1 ) && ( aType <= TEventUtil::EButton3 ) )
+		{
+		TRawEvent pointerEventDown;
+		TRawEvent pointerEventUp;
+		
+		switch ( aType )
+			{
+			case TEventUtil::EButton1:
+				{
+				pointerEventDown.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			case TEventUtil::EButton2:
+				{
+				pointerEventDown.Set( TRawEvent::EButton2Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton2Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			case TEventUtil::EButton3:
+				{
+				pointerEventDown.Set( TRawEvent::EButton3Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton3Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			default:
+				User::Leave( KErrArgument );
+			}
+		wsSession.SimulateRawEvent( pointerEventDown );
+		wsSession.Flush();
+		wsSession.SimulateRawEvent( pointerEventUp );
+		wsSession.Flush();
+		}
+	else
+		{
+		User::Leave( KErrArgument );
+		}	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: SendPointerEventL
+
+     Description: Send pointer event
+
+     Send pointer event.
+
+     Parameters: TRequestStatus* aStatus: in: Pointer to request status used to notify that
+     										  pointer event was recived.
+     			 TUint aType: in: KEvent type.
+     			 const TPoint& aPosition: in: Position.
+     			      
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CAknUiEnvProxy::SendPointerEventL( TRequestStatus* aStatus, TUint aType, const TPoint& aPosition )
+	{
+	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
+
+	if ( aType < TEventUtil::EButton1 ) {
+		TRawEvent pointerEvent;
+		pointerEvent.Set( ( TRawEvent::TType )aType, aPosition.iX, aPosition.iY );
+		// Send info to AppUi that we are going to send key event
+		iAppUi->PrepareToPointerEvent();
+		wsSession.SimulateRawEvent( pointerEvent );
+		// Request notification when key press is handled
+		*aStatus = KRequestPending;
+		iAppUi->NotifyAboutHandledPointerEvent( aStatus );	
+		} 
+	else if ( ( aType >= TEventUtil::EButton1 ) && ( aType <= TEventUtil::EButton3 ) )
+		{
+		TRawEvent pointerEventDown;
+		TRawEvent pointerEventUp;
+		switch ( aType )
+			{
+			case TEventUtil::EButton1:
+				{
+				pointerEventDown.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			case TEventUtil::EButton2:
+				{
+				pointerEventDown.Set( TRawEvent::EButton2Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton2Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			case TEventUtil::EButton3:
+				{
+				pointerEventDown.Set( TRawEvent::EButton3Down, aPosition.iX, aPosition.iY );
+				pointerEventUp.Set( TRawEvent::EButton3Up, aPosition.iX, aPosition.iY );
+				}
+				break;
+			default:
+				User::Leave( KErrArgument );
+			}
+		
+			CCoeEnv::Static()->RootWin().SimulatePointerEvent( pointerEventDown );
+			wsSession.Flush();
+			
+			// Send info to AppUi that we are going to send key event
+			iAppUi->PrepareToPointerEvent();
+	
+			CCoeEnv::Static()->RootWin().SimulatePointerEvent( pointerEventUp );
+			wsSession.Flush();
+	
+			// Request notification when key press is handled
+			*aStatus = KRequestPending;
+			iAppUi->NotifyAboutHandledPointerEvent( aStatus );	
+		} 
+	else
+		{
+		User::Leave( KErrArgument );
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ParseKeyCode
+
+     Description: Parses key code.
+
+     Parses key code.
+
+     Parameters: TDesC& aKeyCodeName: in: Key code name.
+     			 TUint& aKeyCode: out: Parsed key code.
+     
+     Return Values: KErrNone if no error occures during parsing.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CAknUiEnvProxy::ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode ) const
+	{
+	return TEventUtil::ParseKeyCode( aKeyCodeName, aKeyCode );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ParseKeyScanCode
+
+     Description: Parses key scan code.
+
+     Parses key scan code.
+
+     Parameters: TDesC& aKeyScanCodeName: in: Key scan code name.
+     			 TUint& aKeyScanCode: out: Parsed key scan code.
+     
+     Return Values: KErrNone if no error occures during parsing.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CAknUiEnvProxy::ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode ) const
+	{
+	return TEventUtil::ParseKeyScanCode( aKeyScanCodeName, aKeyScanCode );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ParseModifier
+
+     Description: Parses key modifier.
+
+     Parses key modifier.
+
+     Parameters: TDesC& aModifierName: in: Key modifier.
+     			 TUint& aModifier: out: Parsed key modifier.
+     
+     Return Values: KErrNone if no error occures during parsing.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CAknUiEnvProxy::ParseModifier( const TDesC& aModifierName, TUint& aModifier ) const
+	{
+	return TEventUtil::ParseModifier( aModifierName, aModifier );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ParsePointerEventType
+
+     Description: Parses pointer event type.
+
+     Parses key modifier.
+
+     Parameters: const TDesC& aPointerEventTypeName: in: Pointer event type.
+     			 TUint& aModifier: out: Parsed pointer event type.
+     
+     Return Values: KErrNone if no error occures during parsing.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CAknUiEnvProxy::ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType ) const
+	{
+	return TEventUtil::ParsePointerEventType( aPointerEventTypeName, aPointerEventType );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: CAknUiEnvProxy
+
+     Description: C++ constructor.
+
+     C++ constructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CAknUiEnvProxy::CAknUiEnvProxy()
+	{	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ~CAknUiEnvProxy
+
+     Description: C++ destructor.
+
+     C++ destructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CAknUiEnvProxy::~CAknUiEnvProxy()
+	{	
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/EventUtil.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,1100 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CAknUiEnvProxy class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "EventUtil.h"
+#include <e32def.h>
+#include <e32keys.h>
+#include <w32std.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None
+
+// CONSTANTS
+// None
+
+// MACROS
+
+/**
+ * Key code names definition macro
+ */
+#define DefineKeyCodeNames( varName ) 			\
+	static TText* const varName[] =				\
+        {										\
+        (TText*)L"ekeynull",			\
+        (TText*)L"ekeybell",			\
+        (TText*)L"ekeybackspace",		\
+        (TText*)L"ekeytab",				\
+        (TText*)L"ekeylinefeed",		\
+        (TText*)L"ekeyverticaltab",		\
+        (TText*)L"ekeyformfeed",		\
+        (TText*)L"ekeyenter",			\
+        (TText*)L"ekeyescape",			\
+        (TText*)L"ekeyspace",			\
+        (TText*)L"ekeydelete",			\
+        (TText*)L"ekeyprintscreen",		\
+        (TText*)L"ekeypause",			\
+        (TText*)L"ekeyhome",			\
+        (TText*)L"ekeyend",				\
+        (TText*)L"ekeypageup",			\
+        (TText*)L"ekeypagedown",		\
+        (TText*)L"ekeyinsert",			\
+        (TText*)L"ekeyleftarrow",		\
+        (TText*)L"ekeyrightarrow",		\
+        (TText*)L"ekeyuparrow",			\
+        (TText*)L"ekeydownarrow",		\
+        (TText*)L"ekeyleftshift",		\
+        (TText*)L"ekeyrightshift",		\
+        (TText*)L"ekeyleftalt",			\
+        (TText*)L"ekeyrightalt",		\
+        (TText*)L"ekeyleftctrl",		\
+        (TText*)L"ekeyrightctrl",		\
+        (TText*)L"ekeyleftfunc",		\
+        (TText*)L"ekeyrightfunc",		\
+        (TText*)L"ekeycapslock",		\
+        (TText*)L"ekeynumlock",			\
+        (TText*)L"ekeyscrolllock",		\
+        (TText*)L"ekeyf1",				\
+        (TText*)L"ekeyf2",				\
+        (TText*)L"ekeyf3",				\
+        (TText*)L"ekeyf4",				\
+        (TText*)L"ekeyf5",				\
+        (TText*)L"ekeyf6",				\
+        (TText*)L"ekeyf7",				\
+        (TText*)L"ekeyf8",				\
+        (TText*)L"ekeyf9",				\
+        (TText*)L"ekeyf10",				\
+        (TText*)L"ekeyf11",				\
+        (TText*)L"ekeyf12",				\
+        (TText*)L"ekeyf13",				\
+        (TText*)L"ekeyf14",				\
+        (TText*)L"ekeyf15",				\
+        (TText*)L"ekeyf16",				\
+        (TText*)L"ekeyf17",				\
+        (TText*)L"ekeyf18",				\
+        (TText*)L"ekeyf19",				\
+        (TText*)L"ekeyf20",				\
+        (TText*)L"ekeyf21",				\
+        (TText*)L"ekeyf22",				\
+        (TText*)L"ekeyf23",				\
+        (TText*)L"ekeyf24",				\
+        (TText*)L"ekeyoff",				\
+        (TText*)L"ekeyinccontrast",		\
+        (TText*)L"ekeydeccontrast",		\
+        (TText*)L"ekeybacklighton",		\
+        (TText*)L"ekeybacklightoff",	\
+        (TText*)L"ekeybacklighttoggle",	\
+        (TText*)L"ekeysliderdown",		\
+        (TText*)L"ekeysliderup",		\
+        (TText*)L"ekeymenu",			\
+        (TText*)L"ekeydictaphoneplay",	\
+        (TText*)L"ekeydictaphonestop",	\
+        (TText*)L"ekeydictaphonerecord",\
+        (TText*)L"ekeyhelp",			\
+        (TText*)L"ekeydial",			\
+        (TText*)L"ekeyscreendimension0",\
+        (TText*)L"ekeyscreendimension1",\
+        (TText*)L"ekeyscreendimension2",\
+        (TText*)L"ekeyscreendimension3",\
+        (TText*)L"ekeyincvolume",		\
+        (TText*)L"ekeydecvolume",		\
+        (TText*)L"ekeydevice0",			\
+        (TText*)L"ekeydevice1",			\
+        (TText*)L"ekeydevice2",			\
+        (TText*)L"ekeydevice3",			\
+        (TText*)L"ekeydevice4",			\
+        (TText*)L"ekeydevice5",			\
+        (TText*)L"ekeydevice6",			\
+        (TText*)L"ekeydevice7",			\
+        (TText*)L"ekeydevice8",			\
+        (TText*)L"ekeydevice9",			\
+        (TText*)L"ekeydevicea",			\
+        (TText*)L"ekeydeviceb",			\
+        (TText*)L"ekeydevicec",			\
+        (TText*)L"ekeydeviced",			\
+        (TText*)L"ekeydevicee",			\
+        (TText*)L"ekeydevicef",			\
+        (TText*)L"ekeyapplication0",	\
+        (TText*)L"ekeyapplication1",	\
+        (TText*)L"ekeyapplication2",	\
+        (TText*)L"ekeyapplication3",	\
+        (TText*)L"ekeyapplication4",	\
+        (TText*)L"ekeyapplication5",	\
+        (TText*)L"ekeyapplication6",	\
+        (TText*)L"ekeyapplication7",	\
+        (TText*)L"ekeyapplication8",	\
+        (TText*)L"ekeyapplication9",	\
+        (TText*)L"ekeyapplicationa",	\
+        (TText*)L"ekeyapplicationb",	\
+        (TText*)L"ekeyapplicationc",	\
+        (TText*)L"ekeyapplicationd",	\
+        (TText*)L"ekeyapplicatione",	\
+        (TText*)L"ekeyapplicationf",	\
+        (TText*)L"ekeyyes",				\
+        (TText*)L"ekeyno",				\
+        (TText*)L"ekeyincbrightness",	\
+        (TText*)L"ekeydecbrightness",	\
+        (TText*)L"ekeykeyboardextend",	\
+        (TText*)L"ekeydevice10",		\
+        (TText*)L"ekeydevice11",		\
+        (TText*)L"ekeydevice12",		\
+        (TText*)L"ekeydevice13",		\
+        (TText*)L"ekeydevice14",		\
+        (TText*)L"ekeydevice15",		\
+        (TText*)L"ekeydevice16",		\
+        (TText*)L"ekeydevice17",		\
+        (TText*)L"ekeydevice18",		\
+        (TText*)L"ekeydevice19",		\
+        (TText*)L"ekeydevice1a",		\
+        (TText*)L"ekeydevice1b",		\
+        (TText*)L"ekeydevice1c",		\
+        (TText*)L"ekeydevice1d",		\
+        (TText*)L"ekeydevice1e",		\
+        (TText*)L"ekeydevice1f",		\
+        (TText*)L"ekeyapplication10",	\
+        (TText*)L"ekeyapplication11",	\
+        (TText*)L"ekeyapplication12",	\
+        (TText*)L"ekeyapplication13",	\
+        (TText*)L"ekeyapplication14",	\
+        (TText*)L"ekeyapplication15",	\
+        (TText*)L"ekeyapplication16",	\
+        (TText*)L"ekeyapplication17",	\
+        (TText*)L"ekeyapplication18",	\
+        (TText*)L"ekeyapplication19",	\
+        (TText*)L"ekeyapplication1a",	\
+        (TText*)L"ekeyapplication1b",	\
+        (TText*)L"ekeyapplication1c",	\
+        (TText*)L"ekeyapplication1d",	\
+        (TText*)L"ekeyapplication1e",	\
+        (TText*)L"ekeyapplication1f",	\
+        }
+
+/**
+ * Key codes definition macro
+ */
+#define DefineKeyCodes( varName )		\
+	static TUint const varName[] = 		\
+		{								\
+        (TUint)EKeyNull,				\
+        (TUint)EKeyBell,				\
+        (TUint)EKeyBackspace,			\
+        (TUint)EKeyTab,					\
+        (TUint)EKeyLineFeed,			\
+        (TUint)EKeyVerticalTab,			\
+        (TUint)EKeyFormFeed,			\
+        (TUint)EKeyEnter,				\
+        (TUint)EKeyEscape,				\
+        (TUint)EKeySpace,				\
+        (TUint)EKeyDelete,				\
+        (TUint)EKeyPrintScreen,			\
+        (TUint)EKeyPause,				\
+        (TUint)EKeyHome,				\
+        (TUint)EKeyEnd,					\
+        (TUint)EKeyPageUp,				\
+        (TUint)EKeyPageDown,			\
+        (TUint)EKeyInsert,				\
+        (TUint)EKeyLeftArrow,			\
+        (TUint)EKeyRightArrow,			\
+        (TUint)EKeyUpArrow,				\
+        (TUint)EKeyDownArrow,			\
+        (TUint)EKeyLeftShift,			\
+        (TUint)EKeyRightShift,			\
+        (TUint)EKeyLeftAlt,				\
+        (TUint)EKeyRightAlt,			\
+        (TUint)EKeyLeftCtrl,			\
+        (TUint)EKeyRightCtrl,			\
+        (TUint)EKeyLeftFunc,			\
+        (TUint)EKeyRightFunc,			\
+        (TUint)EKeyCapsLock,			\
+        (TUint)EKeyNumLock,				\
+        (TUint)EKeyScrollLock,			\
+        (TUint)EKeyF1,					\
+        (TUint)EKeyF2,					\
+        (TUint)EKeyF3,					\
+        (TUint)EKeyF4,					\
+        (TUint)EKeyF5,					\
+        (TUint)EKeyF6,					\
+        (TUint)EKeyF7,					\
+        (TUint)EKeyF8,					\
+        (TUint)EKeyF9,					\
+        (TUint)EKeyF10,					\
+        (TUint)EKeyF11,					\
+        (TUint)EKeyF12,					\
+        (TUint)EKeyF13,					\
+        (TUint)EKeyF14,					\
+        (TUint)EKeyF15,					\
+        (TUint)EKeyF16,					\
+        (TUint)EKeyF17,					\
+        (TUint)EKeyF18,					\
+        (TUint)EKeyF19,					\
+        (TUint)EKeyF20,					\
+        (TUint)EKeyF21,					\
+        (TUint)EKeyF22,					\
+        (TUint)EKeyF23,					\
+        (TUint)EKeyF24,					\
+        (TUint)EKeyOff,					\
+        (TUint)EKeyIncContrast,			\
+        (TUint)EKeyDecContrast,			\
+        (TUint)EKeyBacklightOn,			\
+        (TUint)EKeyBacklightOff,		\
+        (TUint)EKeyBacklightToggle,		\
+        (TUint)EKeySliderDown,			\
+        (TUint)EKeySliderUp,			\
+        (TUint)EKeyMenu,				\
+        (TUint)EKeyDictaphonePlay,		\
+        (TUint)EKeyDictaphoneStop,		\
+        (TUint)EKeyDictaphoneRecord,	\
+        (TUint)EKeyHelp,				\
+        (TUint)EKeyDial,				\
+        (TUint)EKeyScreenDimension0,	\
+        (TUint)EKeyScreenDimension1,	\
+        (TUint)EKeyScreenDimension2,	\
+        (TUint)EKeyScreenDimension3,	\
+        (TUint)EKeyIncVolume,			\
+        (TUint)EKeyDecVolume,			\
+        (TUint)EKeyDevice0,				\
+        (TUint)EKeyDevice1,				\
+        (TUint)EKeyDevice2,				\
+        (TUint)EKeyDevice3,				\
+        (TUint)EKeyDevice4,				\
+        (TUint)EKeyDevice5,				\
+        (TUint)EKeyDevice6,				\
+        (TUint)EKeyDevice7,				\
+        (TUint)EKeyDevice8,				\
+        (TUint)EKeyDevice9,				\
+        (TUint)EKeyDeviceA,				\
+        (TUint)EKeyDeviceB,				\
+        (TUint)EKeyDeviceC,				\
+        (TUint)EKeyDeviceD,				\
+        (TUint)EKeyDeviceE,				\
+        (TUint)EKeyDeviceF,				\
+        (TUint)EKeyApplication0,		\
+        (TUint)EKeyApplication1,		\
+        (TUint)EKeyApplication2,		\
+        (TUint)EKeyApplication3,		\
+        (TUint)EKeyApplication4,		\
+        (TUint)EKeyApplication5,		\
+        (TUint)EKeyApplication6,		\
+        (TUint)EKeyApplication7,		\
+        (TUint)EKeyApplication8,		\
+        (TUint)EKeyApplication9,		\
+        (TUint)EKeyApplicationA,		\
+        (TUint)EKeyApplicationB,		\
+        (TUint)EKeyApplicationC,		\
+        (TUint)EKeyApplicationD,		\
+        (TUint)EKeyApplicationE,		\
+        (TUint)EKeyApplicationF,		\
+        (TUint)EKeyYes,					\
+        (TUint)EKeyNo,					\
+        (TUint)EKeyIncBrightness,		\
+        (TUint)EKeyDecBrightness,		\
+        (TUint)EKeyKeyboardExtend,		\
+        (TUint)EKeyDevice10,			\
+        (TUint)EKeyDevice11,			\
+        (TUint)EKeyDevice12,			\
+        (TUint)EKeyDevice13,			\
+        (TUint)EKeyDevice14,			\
+        (TUint)EKeyDevice15,			\
+        (TUint)EKeyDevice16,			\
+        (TUint)EKeyDevice17,			\
+        (TUint)EKeyDevice18,			\
+        (TUint)EKeyDevice19,			\
+        (TUint)EKeyDevice1A,			\
+        (TUint)EKeyDevice1B,			\
+        (TUint)EKeyDevice1C,			\
+        (TUint)EKeyDevice1D,			\
+        (TUint)EKeyDevice1E,			\
+        (TUint)EKeyDevice1F,			\
+        (TUint)EKeyApplication10,		\
+        (TUint)EKeyApplication11,		\
+        (TUint)EKeyApplication12,		\
+        (TUint)EKeyApplication13,		\
+        (TUint)EKeyApplication14,		\
+        (TUint)EKeyApplication15,		\
+        (TUint)EKeyApplication16,		\
+        (TUint)EKeyApplication17,		\
+        (TUint)EKeyApplication18,		\
+        (TUint)EKeyApplication19,		\
+        (TUint)EKeyApplication1A,		\
+        (TUint)EKeyApplication1B,		\
+        (TUint)EKeyApplication1C,		\
+        (TUint)EKeyApplication1D,		\
+        (TUint)EKeyApplication1E,		\
+        (TUint)EKeyApplication1F,		\
+		}
+
+/**
+ * Key scan code names definition macro.
+ */
+#define DefineKeyScanCodeNames( varName ) 			\
+	static TText* const varName[] =					\
+        {											\
+        (TText*)L"estdkeynull",						\
+        (TText*)L"estdkeybackspace",				\
+        (TText*)L"estdkeytab",						\
+        (TText*)L"estdkeyenter",					\
+        (TText*)L"estdkeyescape",					\
+        (TText*)L"estdkeyspace",					\
+        (TText*)L"estdkeyprintscreen",				\
+        (TText*)L"estdkeypause",					\
+        (TText*)L"estdkeyhome",						\
+        (TText*)L"estdkeyend",						\
+        (TText*)L"estdkeypageup",					\
+        (TText*)L"estdkeypagedown",					\
+        (TText*)L"estdkeyinsert",					\
+        (TText*)L"estdkeydelete",					\
+        (TText*)L"estdkeyleftarrow",				\
+        (TText*)L"estdkeyrightarrow",				\
+        (TText*)L"estdkeyuparrow",					\
+        (TText*)L"estdkeydownarrow",				\
+        (TText*)L"estdkeyleftshift",				\
+        (TText*)L"estdkeyrightshift",				\
+        (TText*)L"estdkeyleftalt",					\
+        (TText*)L"estdkeyrightalt",					\
+        (TText*)L"estdkeyleftctrl",					\
+        (TText*)L"estdkeyrightctrl",				\
+        (TText*)L"estdkeyleftfunc",					\
+        (TText*)L"estdkeyrightfunc",				\
+        (TText*)L"estdkeycapslock",					\
+        (TText*)L"estdkeynumlock",					\
+        (TText*)L"estdkeyscrolllock",				\
+        (TText*)L"estdkeyf1",						\
+        (TText*)L"estdkeyf2",						\
+        (TText*)L"estdkeyf3",						\
+        (TText*)L"estdkeyf4",						\
+        (TText*)L"estdkeyf5",						\
+        (TText*)L"estdkeyf6",						\
+        (TText*)L"estdkeyf7",						\
+        (TText*)L"estdkeyf8",						\
+        (TText*)L"estdkeyf9",						\
+        (TText*)L"estdkeyf10",						\
+        (TText*)L"estdkeyf11",						\
+        (TText*)L"estdkeyf12",						\
+        (TText*)L"estdkeyf13",						\
+        (TText*)L"estdkeyf14",						\
+        (TText*)L"estdkeyf15",						\
+        (TText*)L"estdkeyf16",						\
+        (TText*)L"estdkeyf17",						\
+        (TText*)L"estdkeyf18",						\
+        (TText*)L"estdkeyf19",						\
+        (TText*)L"estdkeyf20",						\
+        (TText*)L"estdkeyf21",						\
+        (TText*)L"estdkeyf22",						\
+        (TText*)L"estdkeyf23",						\
+        (TText*)L"estdkeyf24",						\
+        (TText*)L"estdkeyxxx",						\
+        (TText*)L"estdkeycomma",					\
+        (TText*)L"estdkeyfullstop",					\
+        (TText*)L"estdkeyforwardslash",				\
+        (TText*)L"estdkeybackslash",				\
+        (TText*)L"estdkeysemicolon",				\
+        (TText*)L"estdkeysinglequote",				\
+        (TText*)L"estdkeyhash",						\
+        (TText*)L"estdkeysquarebracketleft",		\
+        (TText*)L"estdkeysquarebracketright",		\
+        (TText*)L"estdkeyminus",					\
+        (TText*)L"estdkeyequals",					\
+        (TText*)L"estdkeynkpforwardslash",			\
+        (TText*)L"estdkeynkpasterisk",				\
+        (TText*)L"estdkeynkpminus",					\
+        (TText*)L"estdkeynkpplus",					\
+        (TText*)L"estdkeynkpenter",					\
+        (TText*)L"estdkeynkp1",						\
+        (TText*)L"estdkeynkp2",						\
+        (TText*)L"estdkeynkp3",						\
+        (TText*)L"estdkeynkp4",						\
+        (TText*)L"estdkeynkp5",						\
+        (TText*)L"estdkeynkp6",						\
+        (TText*)L"estdkeynkp7",						\
+        (TText*)L"estdkeynkp8",						\
+        (TText*)L"estdkeynkp9",						\
+        (TText*)L"estdkeynkp0",						\
+        (TText*)L"estdkeynkpfullstop",				\
+        (TText*)L"estdkeymenu",						\
+        (TText*)L"estdkeybacklighton",				\
+        (TText*)L"estdkeybacklightoff",				\
+        (TText*)L"estdkeybacklighttoggle",			\
+        (TText*)L"estdkeyinccontrast",				\
+        (TText*)L"estdkeydeccontrast",				\
+        (TText*)L"estdkeysliderdown",				\
+        (TText*)L"estdkeysliderup",					\
+        (TText*)L"estdkeydictaphoneplay",			\
+        (TText*)L"estdkeydictaphonestop",			\
+        (TText*)L"estdkeydictaphonerecord",			\
+        (TText*)L"estdkeyhelp",						\
+        (TText*)L"estdkeyoff",						\
+        (TText*)L"estdkeydial",						\
+        (TText*)L"estdkeyincvolume",				\
+        (TText*)L"estdkeydecvolume",				\
+        (TText*)L"estdkeydevice0",					\
+        (TText*)L"estdkeydevice1",					\
+        (TText*)L"estdkeydevice2",					\
+        (TText*)L"estdkeydevice3",					\
+        (TText*)L"estdkeydevice4",					\
+        (TText*)L"estdkeydevice5",					\
+        (TText*)L"estdkeydevice6",					\
+        (TText*)L"estdkeydevice7",					\
+        (TText*)L"estdkeydevice8",					\
+        (TText*)L"estdkeydevice9",					\
+        (TText*)L"estdkeydevicea",					\
+        (TText*)L"estdkeydeviceb",					\
+        (TText*)L"estdkeydevicec",					\
+        (TText*)L"estdkeydeviced",					\
+        (TText*)L"estdkeydevicee",					\
+        (TText*)L"estdkeydevicef",					\
+        (TText*)L"estdkeyapplication0",				\
+        (TText*)L"estdkeyapplication1",				\
+        (TText*)L"estdkeyapplication2",				\
+        (TText*)L"estdkeyapplication3",				\
+        (TText*)L"estdkeyapplication4",				\
+        (TText*)L"estdkeyapplication5",				\
+        (TText*)L"estdkeyapplication6",				\
+        (TText*)L"estdkeyapplication7",				\
+        (TText*)L"estdkeyapplication8",				\
+        (TText*)L"estdkeyapplication9",				\
+        (TText*)L"estdkeyapplicationa",				\
+        (TText*)L"estdkeyapplicationb",				\
+        (TText*)L"estdkeyapplicationc",				\
+        (TText*)L"estdkeyapplicationd",				\
+        (TText*)L"estdkeyapplicatione",				\
+        (TText*)L"estdkeyapplicationf",				\
+        (TText*)L"estdkeyyes",						\
+        (TText*)L"estdkeyno",						\
+        (TText*)L"estdkeyincbrightness",			\
+        (TText*)L"estdkeydecbrightness",			\
+        (TText*)L"estdkeykeyboardextend",			\
+        (TText*)L"estdkeydevice10",					\
+        (TText*)L"estdkeydevice11",					\
+        (TText*)L"estdkeydevice12",					\
+        (TText*)L"estdkeydevice13",					\
+        (TText*)L"estdkeydevice14",					\
+        (TText*)L"estdkeydevice15",					\
+        (TText*)L"estdkeydevice16",					\
+        (TText*)L"estdkeydevice17",					\
+        (TText*)L"estdkeydevice18",					\
+        (TText*)L"estdkeydevice19",					\
+        (TText*)L"estdkeydevice1a",					\
+        (TText*)L"estdkeydevice1b",					\
+        (TText*)L"estdkeydevice1c",					\
+        (TText*)L"estdkeydevice1d",					\
+        (TText*)L"estdkeydevice1e",					\
+        (TText*)L"estdkeydevice1f",					\
+        (TText*)L"estdkeyapplication10",			\
+        (TText*)L"estdkeyapplication11",			\
+        (TText*)L"estdkeyapplication12",			\
+        (TText*)L"estdkeyapplication13",			\
+        (TText*)L"estdkeyapplication14",			\
+        (TText*)L"estdkeyapplication15",			\
+        (TText*)L"estdkeyapplication16",			\
+        (TText*)L"estdkeyapplication17",			\
+        (TText*)L"estdkeyapplication18",			\
+        (TText*)L"estdkeyapplication19",			\
+        (TText*)L"estdkeyapplication1a",			\
+        (TText*)L"estdkeyapplication1b",			\
+        (TText*)L"estdkeyapplication1c",			\
+        (TText*)L"estdkeyapplication1d",			\
+        (TText*)L"estdkeyapplication1e",			\
+        (TText*)L"estdkeyapplication1f",			\
+        }
+
+/**
+ * Key scan codes definition macro.
+ */
+#define DefineKeyScanCodes( varName )		\
+	static TUint const varName[] = 			\
+		{									\
+        (TUint)EStdKeyNull,					\
+        (TUint)EStdKeyBackspace,			\
+        (TUint)EStdKeyTab,					\
+        (TUint)EStdKeyEnter,				\
+        (TUint)EStdKeyEscape,				\
+        (TUint)EStdKeySpace,				\
+        (TUint)EStdKeyPrintScreen,			\
+        (TUint)EStdKeyPause,				\
+        (TUint)EStdKeyHome,					\
+        (TUint)EStdKeyEnd,					\
+        (TUint)EStdKeyPageUp,				\
+        (TUint)EStdKeyPageDown,				\
+        (TUint)EStdKeyInsert,				\
+        (TUint)EStdKeyDelete,				\
+        (TUint)EStdKeyLeftArrow,			\
+        (TUint)EStdKeyRightArrow,			\
+        (TUint)EStdKeyUpArrow,				\
+        (TUint)EStdKeyDownArrow,			\
+        (TUint)EStdKeyLeftShift,			\
+        (TUint)EStdKeyRightShift,			\
+        (TUint)EStdKeyLeftAlt,				\
+        (TUint)EStdKeyRightAlt,				\
+        (TUint)EStdKeyLeftCtrl,				\
+        (TUint)EStdKeyRightCtrl,			\
+        (TUint)EStdKeyLeftFunc,				\
+        (TUint)EStdKeyRightFunc,			\
+        (TUint)EStdKeyCapsLock,				\
+        (TUint)EStdKeyNumLock,				\
+        (TUint)EStdKeyScrollLock,			\
+        (TUint)EStdKeyF1,					\
+        (TUint)EStdKeyF2,					\
+        (TUint)EStdKeyF3,					\
+        (TUint)EStdKeyF4,					\
+        (TUint)EStdKeyF5,					\
+        (TUint)EStdKeyF6,					\
+        (TUint)EStdKeyF7,					\
+        (TUint)EStdKeyF8,					\
+        (TUint)EStdKeyF9,					\
+        (TUint)EStdKeyF10,					\
+        (TUint)EStdKeyF11,					\
+        (TUint)EStdKeyF12,					\
+        (TUint)EStdKeyF13,					\
+        (TUint)EStdKeyF14,					\
+        (TUint)EStdKeyF15,					\
+        (TUint)EStdKeyF16,					\
+        (TUint)EStdKeyF17,					\
+        (TUint)EStdKeyF18,					\
+        (TUint)EStdKeyF19,					\
+        (TUint)EStdKeyF20,					\
+        (TUint)EStdKeyF21,					\
+        (TUint)EStdKeyF22,					\
+        (TUint)EStdKeyF23,					\
+        (TUint)EStdKeyF24,					\
+        (TUint)EStdKeyXXX,					\
+        (TUint)EStdKeyComma,				\
+        (TUint)EStdKeyFullStop,				\
+        (TUint)EStdKeyForwardSlash,			\
+        (TUint)EStdKeyBackSlash,			\
+        (TUint)EStdKeySemiColon,			\
+        (TUint)EStdKeySingleQuote,			\
+        (TUint)EStdKeyHash,					\
+        (TUint)EStdKeySquareBracketLeft,	\
+        (TUint)EStdKeySquareBracketRight,	\
+        (TUint)EStdKeyMinus,				\
+        (TUint)EStdKeyEquals,				\
+        (TUint)EStdKeyNkpForwardSlash,		\
+        (TUint)EStdKeyNkpAsterisk,			\
+        (TUint)EStdKeyNkpMinus,				\
+        (TUint)EStdKeyNkpPlus,				\
+        (TUint)EStdKeyNkpEnter,				\
+        (TUint)EStdKeyNkp1,					\
+        (TUint)EStdKeyNkp2,					\
+        (TUint)EStdKeyNkp3,					\
+        (TUint)EStdKeyNkp4,					\
+        (TUint)EStdKeyNkp5,					\
+        (TUint)EStdKeyNkp6,					\
+        (TUint)EStdKeyNkp7,					\
+        (TUint)EStdKeyNkp8,					\
+        (TUint)EStdKeyNkp9,					\
+        (TUint)EStdKeyNkp0,					\
+        (TUint)EStdKeyNkpFullStop,			\
+        (TUint)EStdKeyMenu,					\
+        (TUint)EStdKeyBacklightOn,			\
+        (TUint)EStdKeyBacklightOff,			\
+        (TUint)EStdKeyBacklightToggle,		\
+        (TUint)EStdKeyIncContrast,			\
+        (TUint)EStdKeyDecContrast,			\
+        (TUint)EStdKeySliderDown,			\
+        (TUint)EStdKeySliderUp,				\
+        (TUint)EStdKeyDictaphonePlay,		\
+        (TUint)EStdKeyDictaphoneStop,		\
+        (TUint)EStdKeyDictaphoneRecord,		\
+        (TUint)EStdKeyHelp,					\
+        (TUint)EStdKeyOff,					\
+        (TUint)EStdKeyDial,					\
+        (TUint)EStdKeyIncVolume,			\
+        (TUint)EStdKeyDecVolume,			\
+        (TUint)EStdKeyDevice0,				\
+        (TUint)EStdKeyDevice1,				\
+        (TUint)EStdKeyDevice2,				\
+        (TUint)EStdKeyDevice3,				\
+        (TUint)EStdKeyDevice4,				\
+        (TUint)EStdKeyDevice5,				\
+        (TUint)EStdKeyDevice6,				\
+        (TUint)EStdKeyDevice7,				\
+        (TUint)EStdKeyDevice8,				\
+        (TUint)EStdKeyDevice9,				\
+        (TUint)EStdKeyDeviceA,				\
+        (TUint)EStdKeyDeviceB,				\
+        (TUint)EStdKeyDeviceC,				\
+        (TUint)EStdKeyDeviceD,				\
+        (TUint)EStdKeyDeviceE,				\
+        (TUint)EStdKeyDeviceF,				\
+        (TUint)EStdKeyApplication0,			\
+        (TUint)EStdKeyApplication1,			\
+        (TUint)EStdKeyApplication2,			\
+        (TUint)EStdKeyApplication3,			\
+        (TUint)EStdKeyApplication4,			\
+        (TUint)EStdKeyApplication5,			\
+        (TUint)EStdKeyApplication6,			\
+        (TUint)EStdKeyApplication7,			\
+        (TUint)EStdKeyApplication8,			\
+        (TUint)EStdKeyApplication9,			\
+        (TUint)EStdKeyApplicationA,			\
+        (TUint)EStdKeyApplicationB,			\
+        (TUint)EStdKeyApplicationC,			\
+        (TUint)EStdKeyApplicationD,			\
+        (TUint)EStdKeyApplicationE,			\
+        (TUint)EStdKeyApplicationF,			\
+        (TUint)EStdKeyYes,					\
+        (TUint)EStdKeyNo,					\
+        (TUint)EStdKeyIncBrightness,		\
+        (TUint)EStdKeyDecBrightness,		\
+        (TUint)EStdKeyKeyboardExtend,		\
+        (TUint)EStdKeyDevice10,				\
+        (TUint)EStdKeyDevice11,				\
+        (TUint)EStdKeyDevice12,				\
+        (TUint)EStdKeyDevice13,				\
+        (TUint)EStdKeyDevice14,				\
+        (TUint)EStdKeyDevice15,				\
+        (TUint)EStdKeyDevice16,				\
+        (TUint)EStdKeyDevice17,				\
+        (TUint)EStdKeyDevice18,				\
+        (TUint)EStdKeyDevice19,				\
+        (TUint)EStdKeyDevice1A,				\
+        (TUint)EStdKeyDevice1B,				\
+        (TUint)EStdKeyDevice1C,				\
+        (TUint)EStdKeyDevice1D,				\
+        (TUint)EStdKeyDevice1E,				\
+        (TUint)EStdKeyDevice1F,				\
+        (TUint)EStdKeyApplication10,		\
+        (TUint)EStdKeyApplication11,		\
+        (TUint)EStdKeyApplication12,		\
+        (TUint)EStdKeyApplication13,		\
+        (TUint)EStdKeyApplication14,		\
+        (TUint)EStdKeyApplication15,		\
+        (TUint)EStdKeyApplication16,		\
+        (TUint)EStdKeyApplication17,		\
+        (TUint)EStdKeyApplication18,		\
+        (TUint)EStdKeyApplication19,		\
+        (TUint)EStdKeyApplication1A,		\
+        (TUint)EStdKeyApplication1B,		\
+        (TUint)EStdKeyApplication1C,		\
+        (TUint)EStdKeyApplication1D,		\
+        (TUint)EStdKeyApplication1E,		\
+        (TUint)EStdKeyApplication1F,		\
+        }
+
+/**
+ * Key modifier names definition macro.
+ */
+#define DefineModifiers( varName )			\
+	static TUint const varName[] = 			\
+		{									\
+        (TUint)EModifierAutorepeatable,		\
+        (TUint)EModifierKeypad,				\
+        (TUint)EModifierLeftAlt,			\
+        (TUint)EModifierRightAlt,			\
+        (TUint)EModifierAlt,				\
+        (TUint)EModifierLeftCtrl,			\
+        (TUint)EModifierRightCtrl,			\
+        (TUint)EModifierCtrl,				\
+        (TUint)EModifierLeftShift,			\
+        (TUint)EModifierRightShift,			\
+        (TUint)EModifierShift,				\
+        (TUint)EModifierLeftFunc,			\
+        (TUint)EModifierRightFunc,			\
+        (TUint)EModifierFunc,				\
+        (TUint)EModifierCapsLock,			\
+        (TUint)EModifierNumLock,			\
+        (TUint)EModifierScrollLock,			\
+        (TUint)EModifierKeyUp,				\
+        (TUint)EModifierSpecial,			\
+        (TUint)EModifierDoubleClick,		\
+        (TUint)EModifierPureKeycode,		\
+        (TUint)EModifierKeyboardExtend,		\
+        (TUint)EModifierCancelRotation,		\
+        (TUint)EModifierRotateBy90,			\
+        (TUint)EModifierRotateBy180,		\
+        (TUint)EModifierRotateBy270,		\
+        (TUint)EModifierPointer3DButton1,	\
+        (TUint)EModifierPointer3DButton2,	\
+        (TUint)EModifierPointer3DButton3,	\
+        (TUint)EAllModifiers,				\
+    }
+
+/**
+ * Key modifiers definition macro.
+ */
+#define DefineModifierNames( varName ) 				\
+	static TText* const varName[] =					\
+        {											\
+        (TText*)L"estdkeynull",						\
+        (TText*)L"emodifierautorepeatable",			\
+        (TText*)L"emodifierkeypad",					\
+        (TText*)L"emodifierleftalt",				\
+        (TText*)L"emodifierrightalt",				\
+        (TText*)L"emodifieralt",					\
+        (TText*)L"emodifierleftctrl",				\
+        (TText*)L"emodifierrightctrl",				\
+        (TText*)L"emodifierctrl",					\
+        (TText*)L"emodifierleftshift",				\
+        (TText*)L"emodifierrightshift",				\
+        (TText*)L"emodifiershift",					\
+        (TText*)L"emodifierleftfunc",				\
+        (TText*)L"emodifierrightfunc",				\
+        (TText*)L"emodifierfunc",					\
+        (TText*)L"emodifiercapslock",				\
+        (TText*)L"emodifiernumlock",				\
+        (TText*)L"emodifierscrolllock",				\
+        (TText*)L"emodifierkeyup",					\
+        (TText*)L"emodifierspecial",				\
+        (TText*)L"emodifierdoubleclick",			\
+        (TText*)L"emodifierpurekeycode",			\
+        (TText*)L"emodifierkeyboardextend",			\
+        (TText*)L"emodifiercancelrotation",			\
+        (TText*)L"emodifierrotateby90",				\
+        (TText*)L"emodifierrotateby180",			\
+        (TText*)L"emodifierrotateby270",			\
+        (TText*)L"emodifierpointer3dbutton1",		\
+        (TText*)L"emodifierpointer3dbutton2",		\
+        (TText*)L"emodifierpointer3dbutton3",		\
+        (TText*)L"eallmodifiers",					\
+        }
+        
+
+/**
+ * Pointer event type names definition macro
+ */
+#define DefinePointerEventTypeNames( varName ) 			\
+	static TText* const varName[] =						\
+        {												\
+        (TText*)L"epointermove",						\
+        (TText*)L"epointerswitchon",							\
+        (TText*)L"ebutton1down",						\
+        (TText*)L"ebutton1up",							\
+        (TText*)L"ebutton2down",						\
+        (TText*)L"ebutton2up",							\
+        (TText*)L"ebutton3down",						\
+        (TText*)L"ebutton3up",							\
+        (TText*)L"ebutton1",							\
+        (TText*)L"ebutton2",							\
+        (TText*)L"ebutton3",							\
+        }
+
+/**
+ * Pointer event type codes definition macro.
+ */
+#define DefinePointerEventTypes( varName )					\
+	static TInt const varName[] = 							\
+		{													\
+        (TUint)TRawEvent::EPointerMove,						\
+        (TUint)TRawEvent::EPointerSwitchOn,					\
+        (TUint)TRawEvent::EButton1Down,						\
+        (TUint)TRawEvent::EButton1Up,						\
+        (TUint)TRawEvent::EButton2Down,						\
+        (TUint)TRawEvent::EButton2Up,						\
+        (TUint)TRawEvent::EButton3Down,						\
+        (TUint)TRawEvent::EButton3Up,						\
+        (TUint)TEventUtil::EButton1,						\
+        (TUint)TEventUtil::EButton2,						\
+        (TUint)TEventUtil::EButton3,						\
+		}
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: GetKeyCodeName
+
+     Description: Gets key name.
+
+     Returns selected key name. 
+
+     Parameters: TUint aKeyCode: out: Key code.
+     
+     Return Values: Key name.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TPtrC TEventUtil::GetKeyCodeName( TUint aKeyCode )
+	{
+	DefineKeyCodeNames( keyCodeNames );
+	DefineKeyCodes( keyCodes );
+	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
+	
+	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
+		if ( keyCodes[ i ] == aKeyCode ) 
+			{
+			return keyCodeNames[ i ];
+			}
+	}
+
+	return NULL;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: GetKeyScanCodeName
+
+     Description: Gets key scan code name.
+
+     Returns selected key scan code name. 
+
+     Parameters: TUint aKeyCode: out: Key scan code.
+     
+     Return Values: Key scan code name.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TPtrC TEventUtil::GetKeyScanCodeName( TInt aKeyScanCode )
+	{	
+	DefineKeyScanCodeNames( keyScanCodeNames );
+	DefineKeyScanCodes( keyScanCodes );
+	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
+	
+	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
+		if ( keyScanCodes[ i ] == aKeyScanCode ) 
+			{
+			return keyScanCodeNames[ i ];
+			}
+	}
+	
+	return NULL;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: GetModifierName
+
+     Description: Gets key modifier name.
+
+     Returns selected key modifier name. 
+
+     Parameters: TUint aModifier: out: Key modifier.
+     
+     Return Values: Key modifier name.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TPtrC TEventUtil::GetModifierName( TUint aModifier )
+	{
+	DefineModifierNames( modifierNames );
+	DefineModifiers( modifiers );
+	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
+	
+	for ( int i = 0; i < modifierNamesCount; i++ ) {
+		if ( modifiers[ i ] == aModifier ) 
+			{
+			return modifierNames[ i ];
+			}
+	}
+	
+	return NULL;	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: ParseKeyCode
+
+     Description: Parses key code.
+
+     Parses key code. 
+
+     Parameters: TDesC& aKeyCodeName: in: Key code name.
+     			 TUint& aKeyCode: out: Parsed key code.
+     
+     Return Values: KErrNone if key code was parsed successfuly, 
+     				KErrNotFound in other case.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt TEventUtil::ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode )
+	{
+	DefineKeyCodeNames( keyCodeNames );
+	DefineKeyCodes( keyCodes );
+	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
+	
+	TBuf<64> keyCodeNameLowerCase( aKeyCodeName );
+	keyCodeNameLowerCase.LowerCase();
+	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
+		if ( TPtrC( keyCodeNames[ i ] ).Compare( keyCodeNameLowerCase ) == 0 ) 
+			{
+			aKeyCode = keyCodes[ i ];
+			return KErrNone;
+			}
+	}
+	
+	return KErrNotFound;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: ParseKeyScanCode
+
+     Description: Parses key scan code.
+
+     Parses key scan code. 
+
+     Parameters: TDesC& aKeyScanCodeName: in: Key scan code name.
+     			 TUint& aKeyScanCode: out: Parsed key scan code.
+     
+     Return Values: KErrNone if key scan code was parsed successfuly, 
+     				KErrNotFound in other case.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt TEventUtil::ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode )
+	{
+	DefineKeyScanCodeNames( keyScanCodeNames );
+	DefineKeyScanCodes( keyScanCodes );
+	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
+	
+	TBuf<64> keyScanCodeNameLowerCase( aKeyScanCodeName );
+	keyScanCodeNameLowerCase.LowerCase();
+	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
+		if ( TPtrC( keyScanCodeNames[ i ] ).Compare( keyScanCodeNameLowerCase ) == 0 )
+			{
+			aKeyScanCode = keyScanCodes[ i ];
+			return KErrNone;
+			}
+	}
+	
+	return KErrNotFound;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: TEventUtil
+
+     Method: ParseModifier
+
+     Description: Parses key modifier.
+
+     Parses key modifier. 
+
+     Parameters: TDesC& aModifierName: in: Key modifier name.
+     			 TUint& aModifier: out: Parsed key modifier.
+     
+     Return Values: KErrNone if key modifier was parsed successfuly, 
+     				KErrNotFound in other case.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt TEventUtil::ParseModifier( const TDesC& aModifierName, TUint& aModifier )
+	{
+	DefineModifierNames( modifierNames );
+	DefineModifiers( modifiers );
+	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
+	
+	TBuf<64> modifierNameLowerCase( aModifierName );
+	modifierNameLowerCase.LowerCase();
+	for ( int i = 0; i < modifierNamesCount; i++ ) {
+		if ( TPtrC( modifierNames[ i ] ).Compare( modifierNameLowerCase ) == 0 )
+			{
+			aModifier = modifiers[ i ];
+			return KErrNone;
+			}
+	}
+	
+	return KErrNotFound;	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CAknUiEnvProxy
+
+     Method: ParsePointerEventType
+
+     Description: Parses pointer event type.
+
+     Parses key modifier.
+
+     Parameters: const TDesC& aPointerEventTypeName: in: Pointer event type.
+     			 TUint& aModifier: out: Parsed pointer event type.
+     
+     Return Values: KErrNone if no error occures during parsing.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt TEventUtil::ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType )
+	{
+	DefinePointerEventTypeNames( pointerEventTypeNames );
+	DefinePointerEventTypes( pointerEventTypes );
+	int pointerEventTypeNamesCount = (sizeof( pointerEventTypeNames )/sizeof(TText*));
+	
+	TBuf<64> pointerEventTypeNamesLowerCase( aPointerEventTypeName );
+	pointerEventTypeNamesLowerCase.LowerCase();
+	for ( int i = 0; i < pointerEventTypeNamesCount; i++ ) {
+		if ( TPtrC( pointerEventTypeNames[ i ] ).Compare( pointerEventTypeNamesLowerCase ) == 0 )
+			{
+			aPointerEventType = pointerEventTypes[ i ];
+			return KErrNone;
+			}
+	}
+	
+	return KErrNotFound;	
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/TestServerThreadStarter.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,393 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CTestServerThreadStarter class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "TestServerThreadStarter.h"
+#include <stifinternal/TestServerClient.h>
+
+// EXTERNAL DATA STRUCTURES
+// None
+
+// EXTERNAL FUNCTION PROTOTYPES  
+// None
+
+// CONSTANTS
+// None
+
+// MACROS
+// None
+
+/**
+ * CTestServerThreadStarter thread heap size.
+ */
+const TUint KDefaultHeapSize = 0x10000;     // 64 K
+
+/**
+ * CTestServerThreadStarter thread max heap size.
+ */
+const TUint KMaxHeapSize     = 0x20000;     // 128 K 
+
+// LOCAL CONSTANTS AND MACROS
+// None
+
+// MODULE DATA STRUCTURES
+// None
+
+// LOCAL FUNCTION PROTOTYPES
+// None
+
+// FORWARD DECLARATIONS
+// None
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: TestServerStarterThreadFunction
+
+     Description: CTestServerThreadStarter thread function.
+
+	 CTestServerThreadStarter thread function in which testserver creation code
+	 is executed.
+
+     Parameters: TAny* aParameters: in: Pointer to CTestServerThreadStarter object
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CTestServerThreadStarter::TestServerStarterThreadFunction( TAny* aParameters )
+	{
+	RDebug::Printf( "UITESTING: CTestServerThreadStarter::TestServerStarterThreadFunction" );
+    
+    CTestServerThreadStarter* testServerStarter = (CTestServerThreadStarter*)aParameters;
+    TThreadId mainThreadId = testServerStarter->iMainThreadId;
+    CTestThreadContainerRunnerFactory* testThreadContainerRunnerFactory = 
+    	testServerStarter->iTestThreadContainerRunnerFactory;
+    
+   	// Signal that all needed data is copied and main thread can continue its execution 
+    testServerStarter->iServerThreadStartedSemaphore.Signal();
+    	
+    // Get module name from command line
+	const TInt length = User().CommandLineLength();
+
+    HBufC* cmdLine = HBufC::New( length );
+    
+    if ( cmdLine == NULL )
+        {
+        return KErrNoMemory;
+        }
+
+    TPtr moduleName = cmdLine->Des();
+
+	User().CommandLine( moduleName );
+
+    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Received data [%S]"), &moduleName);
+
+    // Extract semaphore name passed in data
+    TInt index = moduleName.Find(_L(" "));
+    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Space separator found at position [%d]"), index);
+    TPtrC semaphoreName = moduleName.Mid(index + 1);
+    moduleName = moduleName.Left(index);
+
+    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Extracted module name [%S] and sempahore name [%S]"), &moduleName, &semaphoreName);
+
+    // Open start-up synchronization semaphore
+    RSemaphore startup;
+    RDebug::Print(_L(" Openingstart-up semaphore"));
+    //TName semaphoreName = _L("startupSemaphore");
+    //semaphoreName.Append( moduleName );
+    
+    TInt res = startup.OpenGlobal(semaphoreName);
+    RDebug::Print(_L("Opening result %d"), res);    
+
+
+    TFileName serverName;
+    TInt r = StartNewServer ( moduleName, serverName, EFalse, startup, true, testThreadContainerRunnerFactory );
+
+    if ( r ==   KErrAlreadyExists )
+        {        
+        // Ok, server was already started
+        RDebug::Print(_L("UI TestServer already started, signaling semaphore and exiting"));
+        startup.Signal();        
+
+        delete cmdLine;
+
+        return KErrNone;
+        }
+    else
+        {       
+        RDebug::Print(_L("UI TestServer is finished, code %d"), r);
+        }
+
+    delete cmdLine;
+    
+    //delete testThreadContainerRunnerFactory;
+    testThreadContainerRunnerFactory = NULL;
+    
+    // Kill main thread to end UITestServerStarter application
+    // when testserver is finished    
+    RThread mainThread;
+    TInt ret = mainThread.Open( mainThreadId );
+	if( ret != KErrNone )
+		{
+		User::Panic( _L("ThreadHandleOpenError"), ret );
+		}
+    mainThread.Kill( KErrNone );
+    
+    return r;	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: NewL
+
+     Description: NewL is first phase of two-phased constructor.
+
+	 NewL is first phase of two-phased constructor.
+
+     Parameters: None.
+     
+     Return Values: Pointer to new CTestServerThreadStarter object.
+
+     Errors/Exceptions: Leaves if new or ConstructL leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CTestServerThreadStarter* CTestServerThreadStarter::NewL( )
+	{
+	CTestServerThreadStarter* self = new(ELeave) CTestServerThreadStarter();
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: CTestServerThreadStarter
+
+     Description: Default constructor.
+
+	 Default constructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CTestServerThreadStarter::CTestServerThreadStarter()
+:CActive( EPriorityNormal )
+	{
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: NewL
+
+     Description: Default destructor.
+
+	 Default destructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CTestServerThreadStarter::~CTestServerThreadStarter()
+	{
+	Cancel();
+	iTimer.Close();
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: ConstructL
+
+     Description: Second phase of two-phased constructor.
+
+	 Second phase of two-phased constructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CTestServerThreadStarter::ConstructL()
+	{
+	TInt ret = iTimer.CreateLocal();
+	if ( ret != KErrNone )
+		{
+		User::Leave( ret );
+		}
+
+	CActiveScheduler::Add( this );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: RunTestServerThread
+
+     Description: Starts-up testserver.
+
+	 Starts-up testserver.
+
+     Parameters: None.
+     
+     Return Values: KErrNone when there was no error.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TInt CTestServerThreadStarter::RunTestServerThread( CTestThreadContainerRunnerFactory* aTestThreadContainerRunnerFactory )
+	{
+	if ( IsActive() )
+		{
+		User::Panic( _L("E32USER-CBase"), 42 );
+		}
+		
+	TInt ret = iServerThreadStartedSemaphore.CreateLocal( 0 );
+	if ( ret != KErrNone )
+		{
+		User::Leave( ret );
+		}
+	
+	iTestThreadContainerRunnerFactory = aTestThreadContainerRunnerFactory;
+	iMainThreadId = RThread().Id();
+	iReturnCode = KErrNone;
+	
+	iStatus = KRequestPending;
+
+	SetActive();
+	iTimer.After( iStatus, 0 );
+	
+	return KErrNone;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: RunL
+
+     Description: RunL derived from CActive handles the completed requests.
+
+	 RunL derived from CActive handles the completed requests.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: Leaves if one of the called method leavs.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CTestServerThreadStarter::RunL()
+	{
+	RThread testServerStarterThread;	
+	TInt ret = testServerStarterThread.Create( _L("testserverstarterthread"), 
+			TestServerStarterThreadFunction, 10 * KDefaultStackSize, 10 * KDefaultHeapSize, 10 * KMaxHeapSize, this );
+	
+	User::LeaveIfError( ret );
+		
+	testServerStarterThread.Resume();	
+	testServerStarterThread.Close();
+	
+	iServerThreadStartedSemaphore.Wait();
+	iServerThreadStartedSemaphore.Close();
+	
+	// Delete CTestServerThreadStarter after testserver is started
+	delete this;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CTestServerThreadStarter
+
+     Method: DoCancel
+
+     Description: DoCancel derived from CActive handles the Cancel.
+
+	 DoCancel derived from CActive handles the Cancel.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CTestServerThreadStarter::DoCancel()
+	{
+	if ( IsActive() )
+		{
+		iTimer.Cancel();
+		}
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarter.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of application  
+* main function.
+*
+*/
+
+// INCLUDE FILES
+#include <eikstart.h>
+#include "UITestServerStarterAppUi.h"
+#include "UITestServerStarterApplication.h"
+#include <eikenv.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
+
+/**
+ * Application factory function.
+ */
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CUITestServerStarterApplication;
+	}
+
+// ================= MEMBER FUNCTIONS =========================================
+/**
+ * Application main function.
+ */
+GLDEF_C TInt E32Main()
+	{
+	
+	RDebug::Printf( "UITESTING: UITestServerStarter - E32Main" );
+	
+	TInt ret = EikStart::RunApplication( NewApplication );
+	
+    RDebug::Printf( "UITESTING: UITestServerStarter - E32Main End" );
+    
+    return ret;
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarterAppContainer.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,291 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CUITestServerStarterAppContainer class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "UITestServerStarterAppContainer.h"
+#include <AknsDrawUtils.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknDef.h>
+#include <AknUtils.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
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: NewL
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: const TRect& aRect: container rectangle.
+     
+     Return Values: Pointer to new CUITestServerStarterAppContainer object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewL( const TRect& aRect )
+	{
+	CUITestServerStarterAppContainer* self = NewLC( aRect );
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: NewLC
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: const TRect& aRect: container rect
+     
+     Return Values: Pointer to new CUITestServerStarterAppContainer object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewLC( const TRect& aRect )
+	{
+	CUITestServerStarterAppContainer* self = 
+		new(ELeave)CUITestServerStarterAppContainer;
+	CleanupStack::PushL( self );
+	self->ConstructL( aRect );
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: CUITestServerStarterAppContainer
+
+     Description: C++ constructor.
+
+     C++ constructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppContainer::CUITestServerStarterAppContainer()
+	{	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: CUITestServerStarterAppContainer
+
+     Description: C++ destructor.
+
+     C++ destructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppContainer::~CUITestServerStarterAppContainer()
+	{
+	delete iBgContext;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: ConstructL
+
+     Description: ConstructL is second phase of two-phased constructor.
+
+     ConstructL is second phase of two-phased constructor.
+
+     Parameters: const TRect& aRect: container rectangle.
+     
+     Return Values: None
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppContainer::ConstructL( const TRect& aRect )
+	{
+	CreateWindowL();
+	
+	iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, aRect, ETrue );	
+	
+	SetRect( aRect );
+	ActivateL();
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: Draw
+
+     Description: Draws the control.
+
+     Draws the control.
+
+     Parameters: const TRect& aRect: rectangle which should be redrawn.
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppContainer::Draw( const TRect& aRect ) const
+	{
+	// Get the standard graphics context 
+	CWindowGc& gc = SystemGc();
+
+	// Redraw the background using the default skin
+	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+	MAknsControlContext* controlContext = AknsDrawUtils::ControlContext( this );
+	AknsDrawUtils::Background( skin, controlContext, this, gc, aRect );	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: SizeChanged
+
+     Description: Responds to changes to the size and position of the contents of this control
+
+     Responds to changes to the size and position of the 
+     contents of this control
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppContainer::SizeChanged()
+	{
+	if ( iBgContext )
+		{
+		iBgContext->SetRect( Rect() );
+		if ( &Window() )
+			{
+			iBgContext->SetParentPos( PositionRelativeToScreen() );
+			}
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppContainer
+
+     Method: MopSupplyObject
+
+     Description: This function is used to allow controls to ask their owners for access to other objects that they own
+
+     This function is used to allow controls to ask their owners 
+	 for access to other objects that they own
+	 
+     Parameters: TTypeUid aId: requested object type id.
+     
+     Return Values: Pointer to requested object.
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TTypeUid::Ptr CUITestServerStarterAppContainer::MopSupplyObject( TTypeUid aId )
+	{
+	if ( iBgContext )
+		{
+		return MAknsControlContext::SupplyMopObject( aId, iBgContext );
+		}
+	return CCoeControl::MopSupplyObject( aId );
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarterAppUi.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,508 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CUITestServerStarterAppUi class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include <avkon.hrh>
+#include <aknmessagequerydialog.h>
+#include <aknnotewrappers.h>
+#include <StringLoader.h>
+#include <f32file.h>
+#include <s32file.h>
+#include <hlplch.h>
+
+#include <UITestServerStarter.rsg>
+
+#include "UITestServerStarter.hrh"
+#include "UITestServerStarterAppUi.h"
+#include "UITestServerStarterAppView.h"
+
+#include "TestServerThreadStarter.h"
+#include <stifinternal/TestThreadContainerRunnerFactory.h>
+#include "AknUiEnvProxy.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
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: ConstructL
+
+     Description: ConstructL is second phase of two-phased constructor.
+
+     ConstructL is second phase of two-phased constructor.
+
+     Parameters: None
+     
+     Return Values: None.
+
+     Errors/Exceptions: Leaves if one of called functions leave.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::ConstructL()
+	{
+	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Begin" );
+
+	// Initialise app UI with standard value.
+	BaseConstructL( ENoAppResourceFile || CAknAppUi::EAknEnableSkin );
+
+	CEikonEnv::Static()->DisableExitChecks( true );
+	
+	// Create view object
+	iAppView = CUITestServerStarterAppView::NewL();
+	
+	AddViewL( iAppView );
+	SetDefaultViewL( *iAppView );
+		
+	CAknUiEnvProxy* uiEnvProxy = CAknUiEnvProxy::NewL( this );
+	
+	CTestThreadContainerRunnerFactory* testThreadContainerRunnerFactory = 
+		CTestThreadContainerRunnerFactory::NewL( RThread().Id(), CActiveScheduler::Current(), uiEnvProxy );
+	
+	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Starting TestServer" );
+	CTestServerThreadStarter* testServerThreadStarter = CTestServerThreadStarter::NewL( );
+	testServerThreadStarter->RunTestServerThread( testThreadContainerRunnerFactory );
+		
+	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Move to background" );
+	
+	TApaTask task( CCoeEnv::Static()->WsSession() );
+	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() ); 
+	task.SendToBackground();
+	
+	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - End" );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: CUITestServerStarterAppUi
+
+     Description: C++ default constructor can NOT contain any code, that might leave.
+
+     C++ default constructor can NOT contain any code, that might leave.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppUi::CUITestServerStarterAppUi()
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: ~CUITestServerStarterAppUi
+
+     Description: C++ destructor.
+
+     C++ destructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppUi::~CUITestServerStarterAppUi()
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: HandleCommandL
+
+     Description: Handles user commands.
+
+     Derived from CCoeAppUi. Handles user commands.
+
+     Parameters: TInt aCommand: in: User command code.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::HandleCommandL( TInt )
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: HandleWsEventL
+
+     Description: Handles window server event.
+
+     Derived from CCoeAppUi. Handles window server event.
+
+     Parameters: const TWsEvent& aEvent: in: Event.
+     			 CCoeControl* aDestination: in: Destination control.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
+	{	
+	CAknAppUi::HandleWsEventL( aEvent, aDestination );
+
+	if ( ( aEvent.Type() == EEventKey ) )
+		{
+		switch( iEventType )
+			{
+			case EPressKey:
+				{
+				if ( iEventStatus != NULL )
+					{
+					KeyPressHandled();					
+					}
+				}
+				break;
+			case ETypeText:
+				{
+				iTypeTextLength--;
+				if ( ( iEventStatus != NULL ) && ( iTypeTextLength == 0 ) )
+					{
+					TextTypeHandled();
+					}
+				}
+				break;
+			}
+		}
+	else if ( aEvent.Type() == EEventPointer )
+		{
+		if ( iEventType == EPointerEvent )
+			{
+			PointerEventHandled();
+			}
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: PrepareToTypeText
+
+     Description: Prepares AppUi to recive type text event
+
+     Prepares AppUi to recive type text event
+
+     Parameters: TInt aTextLength: in: Text length.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::PrepareToTypeText( TInt aTextLength )
+	{
+	iTypeTextLength = aTextLength;
+	iEventType = ETypeText;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: PrepareToPressKey
+
+     Description: Prepares AppUi to recive key press event
+
+     Prepares AppUi to recive key press event
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::PrepareToPressKey()
+	{
+	iEventType = EPressKey;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: PrepareToPointerEvent
+
+     Description: Prepares AppUi to recive pointer event
+
+     Prepares AppUi to recive key press event
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::PrepareToPointerEvent()
+	{
+	iEventType = EPointerEvent;
+	}
+
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: KeyPressHandled
+
+     Description: Sends notification that key press was handled.
+
+     Notifies client that key press was handled.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::KeyPressHandled()
+	{
+	if ( ( iEventType == EPressKey ) && ( iEventStatus != NULL ) && ( iEventType == EPressKey ) )
+		{
+		iEventType = ENone;
+		User::RequestComplete( iEventStatus, KErrNone );
+		iEventStatus = NULL;
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: TextTypeHandled
+
+     Description: Sends notification that type text was handled.
+
+     Notifies client that type text was handled.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::TextTypeHandled()
+	{
+	if ( ( iEventType == ETypeText ) && ( iEventStatus != NULL ) && ( iEventType == ETypeText ) )
+		{
+		iEventType = ENone;
+		iTypeTextLength = 0;
+		User::RequestComplete( iEventStatus, KErrNone );
+		iEventStatus = NULL;
+		}
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: PointerEventHandled
+
+     Description: Sends notification that pointer event was handled.
+
+     Notifies client that pointer event was handled.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::PointerEventHandled()
+	{
+	if ( ( iEventType == EPointerEvent ) && ( iEventStatus != NULL ) )
+		{
+		iEventType = ENone;
+		User::RequestComplete( iEventStatus, KErrNone );
+		iEventStatus = NULL;
+		}
+	}
+
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: NotifyAboutHandledKeyPress
+
+     Description: Requests notification of press key completion.
+
+     Requests notification of press key completion.
+
+     Parameters: TRequestStatus* aStatus: in: Request status pointer.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::NotifyAboutHandledKeyPress( TRequestStatus* aStatus )
+	{
+	iEventStatus = aStatus;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: NotifyAboutHandledTextType
+
+     Description: Requests notification when text type event is handled.
+
+     Requests notification when text type event is handled.
+
+     Parameters: TRequestStatus* aStatus: in: Request status pointer.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::NotifyAboutHandledTextType( TRequestStatus* aStatus )
+	{
+	iEventStatus = aStatus;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppUi
+
+     Method: NotifyAboutHandledPointerEvent
+
+     Description: Requests notification when pointer event is handled.
+
+     Requests notification when pointer event is handled.
+
+     Parameters: TRequestStatus* aStatus: in: Request status pointer.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppUi::NotifyAboutHandledPointerEvent( TRequestStatus* aStatus )
+	{
+	iEventStatus = aStatus;
+	}
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarterAppView.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,345 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: 
+* Description: This module contains the 
+* implementation of CUITestServerStarterAppView class member 
+* functions.
+*
+*/
+
+// INCLUDE FILES
+#include <coemain.h>
+#include <aknViewAppUi.h> 
+#include "UITestServerStarterAppView.h"
+#include "UITestServerStarterApplication.h"
+#include "UITestServerStarterAppContainer.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
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: NewL
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: None
+     
+     Return Values: Pointer to new CUITestServerStarterAppView object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppView* CUITestServerStarterAppView::NewL()
+	{
+	CUITestServerStarterAppView* self = CUITestServerStarterAppView::NewLC();
+	CleanupStack::Pop( self );
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: NewLC
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: None
+     
+     Return Values: Pointer to new CUITestServerStarterAppView object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppView* CUITestServerStarterAppView::NewLC()
+	{
+	CUITestServerStarterAppView* self = new ( ELeave ) CUITestServerStarterAppView;
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: ConstructL
+
+     Description: ConstructL is second phase of two-phased constructor.
+
+     ConstructL is second phase of two-phased constructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppView::ConstructL()
+	{
+	BaseConstructL( 0 );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: CUITestServerStarterAppView
+
+     Description: C++ constructor.
+
+     C++ constructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppView::CUITestServerStarterAppView()
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: CUITestServerStarterAppView
+
+     Description: C++ destructor.
+
+     C++ destructor.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterAppView::~CUITestServerStarterAppView()
+	{
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+
+    delete iContainer;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: Id
+
+     Description: Returns view Uid.
+
+     Returns view Uid.
+
+     Parameters: None
+     
+     Return Values: View Uid
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TUid CUITestServerStarterAppView::Id() const
+	{
+	return KMainViewId;	
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: HandleCommandL
+
+     Description: Handle Commands.
+
+     Handle Commands.
+
+     Parameters: TInt aCommand: command id
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppView::HandleCommandL( TInt aCommand )
+    {   
+    AppUi()->HandleCommandL( aCommand );
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: HandleClientRectChange
+
+     Description: Handle size changes.
+
+     Handle size changes.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: DoActivateL
+
+     Description: From AknView, Activates view.
+
+     From AknView, Activates view.
+
+     Parameters: const TVwsViewId& aPrevViewId: previouse view id
+     			 TUid aCustomMessageId: custom message id
+   				 const TDesC8& aCustomMessage: custom message data
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if ( !iContainer )
+        {
+        // Create view container
+        iContainer = CUITestServerStarterAppContainer::NewL( ClientRect() );
+        iContainer->SetMopParent( this );
+        // Add container to view stack
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+   }
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterAppView
+
+     Method: DoDeactivate
+
+     Description: From AknView, Deactivates view.
+
+     From AknView, Deactivates view.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterAppView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        // Remove container from view stack
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+    
+    // Delete container since it's not longer needed.
+    delete iContainer;
+    iContainer = NULL;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarterApplication.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CUITestServerStarterApplication class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "UITestServerStarter.hrh"
+#include "UITestServerStarterDocument.h"
+#include "UITestServerStarterApplication.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
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterApplication
+
+     Method: CreateDocumentL 
+
+     Creates CUITestServerStarterDocument document object.
+
+	 Creates CUITestServerStarterDocument document object. The returned
+	 pointer in not owned by the CUITestServerStarterApplication object.
+
+     Parameters: None
+     
+     Return Values: A pointer to the created document object.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CApaDocument* CUITestServerStarterApplication::CreateDocumentL ()
+	{
+	return (static_cast<CApaDocument*> (CUITestServerStarterDocument::NewL ( *this) ) );
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterApplication
+
+     Method: AppDllUid
+
+     Gets application Uid
+
+	 Gets application Uid
+
+     Parameters: None
+     
+     Return Values: Application Uid.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+TUid CUITestServerStarterApplication::AppDllUid() const
+	{
+	return KUidUITestServerStarterApp;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: PreDocConstructL
+
+     Method: AppDllUid
+
+     Preconstructs document.
+
+     Preconstructs document.
+
+     Parameters: None
+     
+     Return Values: None
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterApplication::PreDocConstructL()
+	{
+	// This call allow us to run multiple instances of UI application in same time.
+	CEikApplication::PreDocConstructL();
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/avkon/uitestserverstarter/src/UITestServerStarterDocument.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,214 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This module contains the implementation of 
+* CUITestServerStarterDocument class member functions.
+*
+*/
+
+// INCLUDE FILES
+#include "UITestServerStarterAppUi.h"
+#include "UITestServerStarterDocument.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
+
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: NewL
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: CEikApplication& aApp: in: Reference to application..
+     
+     Return Values: Pointer to new CUITestServerStarterDocument object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterDocument* CUITestServerStarterDocument::NewL( CEikApplication& aApp )
+	{
+	CUITestServerStarterDocument* self = NewLC (aApp);
+	CleanupStack::Pop (self);
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: NewLC
+
+     Description: NewL is first phase of two-phased constructor.
+
+     NewL is first phase of two-phased constructor.
+
+     Parameters: CEikApplication& aApp: in: Reference to application.
+     
+     Return Values: Pointer to new CUITestServerStarterDocument object.
+
+     Errors/Exceptions: Leave if one of the called functions leaves.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterDocument* CUITestServerStarterDocument::NewLC (CEikApplication& aApp)
+	{
+	CUITestServerStarterDocument* self = new ( ELeave ) CUITestServerStarterDocument( aApp );
+
+	CleanupStack::PushL (self);
+	self->ConstructL ();
+	return self;
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: ConstructL
+
+     Description: This is second phase of two-phased constructor.
+
+     This is second phase of two-phased constructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+void CUITestServerStarterDocument::ConstructL()
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: CUITestServerStarterDocument
+
+     Description: Constructor.
+
+     Constructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterDocument::CUITestServerStarterDocument( CEikApplication& aApp ) :
+	CAknDocument(aApp)
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: ~CUITestServerStarterDocument
+
+     Description: Destructor.
+
+     Destructor.
+
+     Parameters: None.
+     
+     Return Values: None.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CUITestServerStarterDocument::~CUITestServerStarterDocument ()
+	{
+	// No implementation required
+	}
+
+/*
+-------------------------------------------------------------------------------
+
+     Class: CUITestServerStarterDocument
+
+     Method: CreateAppUiL
+
+     Description: Creates AppUi object.
+
+     Creates AppUi object.
+
+     Parameters: None.
+     
+     Return Values: Pointer to AppUi object.
+
+     Errors/Exceptions: None.
+
+     Status: Draft
+    
+-------------------------------------------------------------------------------
+*/
+CEikAppUi* CUITestServerStarterDocument::CreateAppUiL ()
+	{
+	return ( static_cast <CEikAppUi*>( new ( ELeave ) CUITestServerStarterAppUi ) );
+	}
+
+// End of File
--- a/stifui/group/ReleaseNote.txt	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-========================================================================
-RELEASE NOTE FOR STIF UI - STIF_201010 (7.3.28)
-SUPPORTING SERIES 60 3.0 ->
-========================================================================
-
-Product Description:
-====================
-STIF UI is Series 60 UI application for STIF project.
-STIF is a test harness for testing Symbian & S60 non-UI components.
-This widely used test framework can be used for both test case implementation and test cases execution.
-
-Features :
-=========
-- Easy to use
-- Multiple test cases can be executed concurrently.
-
-
-Enhancements:
-=============
-N/A
-
-
-New Features:
-=============
-N/A
-
-
-System Requirements:
-====================
-Basic Requirements:
-- S60/Symbian OS development environment installed 
-
-- stif project needs to be compiled/installed before stifui can be used
-
-
-Compatibility Issues:
-=====================
-N/A 
-
-Known Issues:
-===========
-If problems with compilation appears (missing platform_paths.hrh file error message), 
-please use EnvPatcher.pl script from stif/envpatcher folder to fix environment. 
-
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
--- a/stifui/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: bld.inf Toplevel build information for STIF UI
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-// Specify the platforms your component needs to be built for here.
-// If not specified all platforms can be built.
-
-// Note that if you want to build STIF to GCCE platform, GCCE must be
-// specified separately - it is not part of default platforms.
-// DEFAULT GCCE
-
-	DEFAULT
-
-
-PRJ_EXPORTS
-// This is added in order to export iby files automaticly in 5.0 env
-	../rom/Stifui.iby     CORE_IBY_EXPORT_PATH(tools,Stifui.iby)
-
-PRJ_TESTEXPORTS
-
-PRJ_MMPFILES
-	// StifUI
-	#include "../stifui/group/bld.inf"
-
-	// UiTestServerStarter
-	#include "../uitestserverstarter/group/bld.inf"
-
-
-// End of File
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/ReleaseNote.txt	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,45 @@
+========================================================================
+RELEASE NOTE FOR STIFQTUI - STIF_201016 (7.3.31)
+========================================================================
+
+Product Description:
+====================
+STIFQTUI is Series QT UI application for STIF project.
+STIF is a test harness for testing Symbian components.
+This widely used test framework can be used for both test case implementation and test cases execution.
+
+Features :
+=========
+- Easy to use
+- Multiple test cases can be executed concurrently.
+
+
+Enhancements:
+=============
+N/A
+
+
+New Features:
+=============
+N/A
+
+
+System Requirements:
+====================
+Basic Requirements:
+
+- StifQtUI project is written by QT C++ and Symbian C++.
+- It should be compiled by QT for S60 4.6.0 under proper S60 SDK.
+
+You can get QT for S60 from: http://qt.nokia.com/downloads/downloads
+
+- stif project needs to be compiled/installed before stifui can be used
+
+
+Compatibility Issues:
+=====================
+N/A 
+
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/cstfcase.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              CSTFCase used to describe a test case.
+*
+*/
+#ifndef CSTFCASE_H
+#define CSTFCASE_H
+#include "QString"
+
+enum TSTFCaseRunningType
+    {
+    Sequentially = 0,
+    Parallel    
+    };
+
+enum TSTFCaseStatusType
+    {
+    EStatusRunning  = 0x00000001,
+    EStatusExecuted = 0x00000002,
+    EStatusPassed   = 0x00000004,
+    EStatusFailed   = 0x00000008,
+    EStatusAborted  = 0x00000010,
+    EStatusCrashed  = 0x00000020,
+    EStatusAll      = 0x000000ff,    
+    };
+
+class CSTFCase
+{
+public:
+    CSTFCase()    {isActive = true; caseIndex=-1;}
+    CSTFCase(QString name, int index)    {caseName = name; caseIndex = index; isActive = true;}
+
+public:
+    QString& Name(){return caseName;}
+    int Index(){return caseIndex;}
+    bool IsActive(){return isActive;}
+    QString& ModuleName() {return moduleName;}
+
+public:
+    void SetName(const QString name){caseName = name; }
+    void SetIndex(const int index){caseIndex = index;}
+    void SetActive(const bool active) {isActive = active;}
+    void SetModuleName(const QString name){moduleName = name;}
+
+private:
+    QString caseName;
+    int caseIndex;
+    bool isActive;
+    QString moduleName;
+};
+#endif // CSTFCASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/cstfmodule.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              CSTFModule used to describe a test module.
+*
+*/
+#ifndef CSTFMODULE_H
+#define CSTFMODULE_H
+#include "QString"
+
+class CSTFModule
+{
+public:
+    CSTFModule(){isActive = true;}
+    CSTFModule(QString name, QString inifile, QString cfgfile)
+    {moduleName = name; iniFile = inifile; configFile = cfgfile; isActive = true;}
+
+public:
+    QString& Name(){return moduleName;}
+    QString& IniFile(){return iniFile;}
+    QString& ConfigFile(){return configFile;}
+    bool IsActive(){return isActive;}
+    
+
+public:
+    void SetName(const QString& name){moduleName = name; }
+    void SetIniFile(const QString& inifile){iniFile = inifile;}
+    void SetConfigFile(const QString& cfgfile){configFile = cfgfile;}
+    void SetActive(const bool active) {isActive = active;}
+
+private:
+    QString moduleName;
+    QString iniFile;
+    QString configFile;
+    bool isActive;
+
+
+};
+#endif // CSTFMODULE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/dlgoutput.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              DlgOutput is a QT based dialog.
+*              Used to display case execution output and control the test case (pause/resume/abort).
+*
+*/
+#ifndef DLGOUTPUT_H_
+#define DLGOUTPUT_H_
+
+#include <QDialog>
+#include <QHash>
+#include "istfqtuicontroller.h"
+
+
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+class QGridLayout;
+class QPlainTextEdit;
+class QPushButton;
+QT_END_NAMESPACE
+
+class DlgOutput : public QDialog, public IStfEventListener {
+    Q_OBJECT
+
+public:
+    DlgOutput(IStfQtUIController* ctl, QWidget *parent = 0);
+    ~DlgOutput();
+    
+private:
+    void CreateItem(QString index, QString item);
+    void CloseItem(QString index);
+    void ShowMessage(QString index, QString msg);
+    
+private://implement IStfEventListener
+    void OnGetMessage(const QString& ){};
+    void OnSetListChanged(){};
+    void OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd, const QString& index, const QString& msg);
+    
+private slots:
+    void on_btnPause_clicked();
+    void on_btnAbort_clicked();
+    
+    
+private:
+    IStfQtUIController* controller;
+    QTabWidget* tabMain;
+    QPushButton* btnPause;
+    QPushButton* btnAbort;
+    QHash<QString , QPlainTextEdit*> tabList;
+    
+private:
+    void on_btnClose_clicked();
+    
+    
+};
+
+
+#endif /* DLGOUTPUT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/dlgsetting.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*/
+
+#ifndef DLGSETTING_H_
+#define DLGSETTING_H_
+#include <QDialog>
+#include "uisetting.h"
+
+
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+class QGridLayout;
+class QCheckBox;
+class QPushButton;
+QT_END_NAMESPACE
+
+class DlgSetting : public QDialog {    
+    Q_OBJECT
+    
+public:
+    DlgSetting(UiSetting* settingObj, QWidget *parent = 0);
+    
+private:
+    void SetupUI();
+    
+private:
+    QPushButton* btnOk;
+    QPushButton* btnCancel;
+    QCheckBox* chkShowoutput;
+    
+private slots:
+    void on_btnOk_clicked();
+    void on_btnCancel_clicked();
+    
+private:
+    UiSetting* setting;
+    
+    };
+
+#endif /* DLGSETTING_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/frmmain.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              frmMain is a QT based Window.
+*              Used to display STF executor main GUI.
+*
+*/
+#ifndef FRMMAIN_H
+#define FRMMAIN_H
+
+#include <QMainWindow>
+#include "istfqtuicontroller.h"
+#include "istfqtuimodel.h"
+#include "dlgoutput.h"
+#include "uisetting.h"
+#include "dlgsetting.h"
+
+QT_BEGIN_NAMESPACE
+class QAction;
+class QLabel;
+class QMenu;
+class QTabWidget;
+class QWidget;
+class QPushButton;
+class QComboBox;
+class QPlainTextEdit;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QListWidget;
+class QCheckBox;
+class QMessageBox;
+class QFileDialog;
+QT_END_NAMESPACE
+
+const QString QtUIVersion = "StfQtUI v1.0.1";
+
+class frmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener
+{
+    Q_OBJECT
+
+public:
+    frmMain();
+    ~frmMain();
+    
+    
+public: //Implement IStfEventListener
+    void OnGetMessage(const QString& aMessage);
+    void OnSetListChanged();
+    void OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd, const QString& index, const QString& msg);
+
+    
+public: //Implement IStifModelEventListener
+    void OnCaseStatisticChanged() ;
+    void OnRunningCaseChanged() ;
+    
+protected slots:
+    void onTabWidgetSelectIndexChanged();
+
+
+private:
+    void createMenus();
+    void LoadSubMenu();
+    void load();
+    void loadContent();
+    void loadModuleList();
+    void loadSetList();
+    void loadStatistic();
+    QList<CSTFCase> getSelectedCases();
+    void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type);
+    void setSetting();
+    
+private:
+    IStfQtUIController* controller;
+    IStfQtUIModel* model;
+    DlgOutput* dlgOutput;
+    UiSetting* uiSetting; 
+    
+
+private: //UI Components
+    QWidget *MainWidget;
+    //menus and actions
+    QMenu *operateMenu;
+    //output panel
+    QPlainTextEdit *txtOutput;
+    //tab control.
+    QTabWidget *tabWidget;
+    QWidget *tabCase;
+    QWidget *tabSet;
+    QWidget *tabStarted;
+    QWidget *tabStatistic;
+
+    //Cases Tab
+    QTreeWidget *treeModuleList;
+    
+    //Statistic Tab
+    QTreeWidget *treeStatistic;
+    QTreeWidgetItem *executedItems;
+    QTreeWidgetItem *passedItems;
+    QTreeWidgetItem *failedItems;
+    QTreeWidgetItem *abortedItems;
+    QTreeWidgetItem *crashedItems;
+        
+    
+    //Set Tab
+    QComboBox *cboSetList;
+    QListWidget *lstSetCases;
+
+    //Started Tab
+    QListWidget *lstStartedCases;
+    QPushButton *btnPauseCase;
+    QPushButton *btnAbortCase;
+    QPlainTextEdit *txtCaseOutput;
+
+    //menu actions
+    QAction *actExit;
+    QAction *actAbout;
+
+    //cases actoins
+    QAction *actOpenFile;
+    QAction *actRunCaseSeq;
+    QAction *actRunCasePar;
+    QAction *actAddtoSet;
+    QAction *actSelectAll;
+    QAction *actExpandAll;
+    QAction *actCollapseAll;
+    QAction *actSetting;
+    //sets actions
+    QAction *actRunSetSeq;
+    QAction *actRunSetPar;
+    QAction *actNewSet;
+    QAction *actDelSet;
+    //running actions.
+    QAction *actPause;
+    QAction *actAbort;
+    //statistics actions
+    QAction *actClearStatistics;
+
+private slots:
+    void on_cboSetList_currentIndexChanged(QString );
+    
+    void on_actAbout_triggered();    
+    void on_actOpenFile_triggered();
+    void on_actRunCaseSeq_triggered();
+    void on_actRunCasePar_triggered();
+    void on_actAddtoSet_triggered();
+    void on_actSelectAll_triggered();
+    void on_actExpandAll_triggered();
+    void on_actCollapseAll_triggered();
+    void on_actSetting_triggered();
+        
+    void on_actRunSetSeq_triggered();
+    void on_actRunSetPar_triggered();
+    void on_actNewSet_triggered();
+    void on_actDelSet_triggered();
+    void on_actPause_triggered();
+    void on_actAbort_triggered();
+    void on_actClearStatistics_triggered();
+    void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column);
+
+    
+        
+    
+
+
+
+};
+
+#endif // FRMMAIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/istfqtuicontroller.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              IStfQtUIController is interface of appliction controller.
+*              IStfEventListener is interface of Stf view observer.
+*
+*/
+#ifndef ISTFQTUICONTROLLER_H
+#define ISTFQTUICONTROLLER_H
+#include "cstfmodule.h"
+#include "cstfcase.h"
+#include <QList>
+#include "istfqtuimodel.h"
+
+class IStfEventListener
+{
+public:
+    enum CaseOutputCommand
+        {
+        ECreate,
+        EOutput,
+        EClose
+        };
+public:
+    virtual void OnGetMessage(const QString& aMessage) = 0;
+    virtual void OnSetListChanged() = 0;
+    virtual void OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd, const QString& index, const QString& msg) = 0;
+};
+
+class IStfQtUIController
+{
+public:
+    inline virtual ~IStfQtUIController(){}
+    //for cases
+    virtual bool OpenEngineIniFile(const QString& fileName) = 0;
+    virtual QList<QString> GetModuleList() = 0;
+    virtual QList<QString> GetCaseListByModule(const QString& moduleName) = 0;
+    virtual CSTFCase GetCase(const QString& moduleName, const int index) = 0;
+    virtual void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type) = 0;
+    virtual void AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName) = 0;
+    
+    //for set
+    virtual QList<QString> GetSetList() = 0;
+    virtual QList<QString> GetCaseListBySet(const QString& setName) = 0;
+    virtual void CreateSet(const QString& setName) = 0;
+    virtual void DeleteSet(const QString& setName) = 0;
+    virtual void RunSets(const QString& setName, const TSTFCaseRunningType& type) = 0;
+    
+    //for Started
+    virtual void PauseCase() = 0;
+    virtual void ResumeCase() = 0;
+    virtual void AbortCase() = 0;
+    virtual bool ShowOutput() = 0;
+    virtual void SetShowOutput(bool isShow) = 0;
+    
+    //for staticstic
+    virtual QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type) = 0;
+    
+    //listener
+    virtual void AddStfEventListener(IStfEventListener* listener) = 0;
+    virtual void RemoveStfEventListener(IStfEventListener* listener) = 0;
+    
+
+};
+
+
+
+#endif // ISTFQTUICONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/istfqtuimodel.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              IStfQtUIModel is interface of appliction data model.
+*              IStifModelEventListener is used to listen event from data model.
+*
+*/
+#ifndef ISTFQTUIMODEL_H
+#define ISTFQTUIMODEL_H
+
+//#include <TestModuleInfo.h>
+#include "cstfcase.h"
+#include "cstfmodule.h"
+#include <UIStoreIf.h>
+#include <UIStore.h>
+#include <UIEngine.h>
+
+class IStifModelEventListener
+    {    
+public:
+    virtual void OnCaseStatisticChanged() = 0; 
+    virtual void OnRunningCaseChanged() = 0;
+    };
+
+class IStfQtUIModel
+{  
+public:
+    inline virtual ~IStfQtUIModel(){}
+    virtual void ClearCasesStatus() = 0;
+    virtual QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type) = 0;
+    virtual void AddRunningCase(const CStartedTestCase* startedCase, const CSTFCase& stfCase) = 0;
+    virtual void RemoveRunningCase(const CStartedTestCase* startedCase) = 0;
+    virtual void AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase) = 0;
+    virtual void PauseCase() = 0;
+    virtual void ResumeCase() = 0;
+    virtual void AbortCase() = 0;
+    
+    virtual void AddStifModelEventListener(IStifModelEventListener* listener) = 0;
+    virtual void RemoveStifModelEventListener(IStifModelEventListener* listener) = 0;
+    
+
+};
+
+#endif // ISTFQTUIMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/stfqtuicontroller.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              Application's controller.
+*
+*/
+#ifndef STFQTUICONTROLLER_H_
+#define STFQTUICONTROLLER_H_
+
+#include "istfqtuicontroller.h"
+#include "istfqtuimodel.h"
+#include "stifexecutor.h"
+
+class StfQtUIController : public IStfQtUIController, public IStifCaseUpdateListener
+    {
+public:
+    StfQtUIController(IStfQtUIModel* aModel);
+    ~StfQtUIController();
+public: //Implement IStfQtUIController.
+    //for cases
+
+    bool OpenEngineIniFile(const QString& fileName);
+    QList<QString> GetModuleList();
+    QList<QString> GetCaseListByModule(const QString& moduleName);
+    CSTFCase GetCase(const QString& moduleName, const int index);
+    void RunCases(const QList<CSTFCase>& caseList, const TSTFCaseRunningType& type);
+    void AddCaseToSet(const QList<CSTFCase>& aCase, const QString& setName);
+    
+    //for set
+    QList<QString> GetSetList();
+    QList<QString> GetCaseListBySet(const QString& setName);
+    void CreateSet(const QString& setName);
+    void DeleteSet(const QString& setName);
+    void RunSets(const QString& setName, const TSTFCaseRunningType& type);
+    
+    //for Started
+    void PauseCase();
+    void ResumeCase();
+    void AbortCase();
+    bool ShowOutput();
+    void SetShowOutput(bool isShow);
+    
+    //for staticstic
+    QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type);
+    
+    //listener
+    void AddStfEventListener(IStfEventListener* listener);
+    void RemoveStfEventListener(IStfEventListener* listener);
+
+public://implement IStifCaseUpdateListener
+    void OnGetCaseUpdated(CStartedTestCase* aCase, CSTFCase& stfcase, int flags);
+    void OnGetCaseOutput(CStartedTestCase* aCase, QString& msg);
+    
+private: //Fire event
+    void FireOnGetOutput(QString message);
+    void FireOnSetListChanged();
+    void FireOnCaseOutputChanged(IStfEventListener::CaseOutputCommand cmd, int index, QString msg);
+    
+private://help methods
+    CSTFModule GetModuleByName(const QString& moduleName);
+    
+private:
+    CStifExecutor* executor;
+    IStfQtUIModel* model;
+    QList<IStfEventListener*> listenerList;
+    bool isShowOutput;
+    
+    
+        
+    };
+
+
+
+
+#endif /* STFQTUICONTROLLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/stfqtuimodel.h	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              application data model.
+*
+*/
+#include "istfqtuimodel.h"
+#include "stifexecutor.h"
+#include <QHash>
+
+class StfQtUIModel : public IStfQtUIModel
+    {
+public:
+    StfQtUIModel();
+    virtual ~StfQtUIModel();
+public://implement IStfQtUIModel
+    void ClearCasesStatus();
+    QList<CSTFCase> GetCasesByStatus(const TSTFCaseStatusType& type);
+    void AddRunningCase(const CStartedTestCase* startedCase, const CSTFCase& stfCase);
+    void RemoveRunningCase(const CStartedTestCase* startedCase);
+    void AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase);
+    void AddStifModelEventListener(IStifModelEventListener* listener);
+    void RemoveStifModelEventListener(IStifModelEventListener* listener);
+    void PauseCase();
+    void ResumeCase();
+    void AbortCase();
+    
+private:
+    void FireOnCaseStatisticChangedEvent();
+    void FireOnRunningCaseChangedEvent();
+    
+private:
+    QList<IStifModelEventListener*> listenerList;
+    QList<CSTFCase> executedCaseList;
+    QList<CSTFCase> passedCaseList;
+    QList<CSTFCase> failedCaseList;
+    QList<CSTFCase> abortCaseList;
+    QList<CSTFCase> crashedCaseList;
+    QHash<const CStartedTestCase*, CSTFCase> runningCaseList;
+    
+    
+    
+    
+    
+    
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/stifexecutor.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ and Symbian C++ combination Class.
+*              Call STIF UI engine and UI interface to perform test operation.
+*              All the public methods are QT C++ based object.
+*
+*/
+#ifndef STIFEXECUTOR_H_
+#define STIFEXECUTOR_H_
+
+//#include <TestModuleInfo.h>
+#include "cstfcase.h"
+#include "cstfmodule.h"
+#include <UIStoreIf.h>
+#include <UIStore.h>
+#include <UIEngine.h>
+#include <QList>
+
+class IStifCaseUpdateListener
+    {
+public:
+    virtual void OnGetCaseUpdated(CStartedTestCase* aCase,CSTFCase& stfcase, int flags) = 0;
+    virtual void OnGetCaseOutput(CStartedTestCase* aCase, QString& msg) = 0;
+    };
+
+
+class CStifExecutor : public CUIStoreIf 
+    {
+public:
+    CStifExecutor();
+    ~CStifExecutor();
+public: 
+    void AddStifCaseUpdateListener(IStifCaseUpdateListener* listener);
+    void RemoveStifCaseUpdateListener(IStifCaseUpdateListener* listener);
+    bool OpenIniFile(const QString& filename);
+    QList<CSTFModule> GetModuleList();
+    QList<CSTFCase> GetCaseList(const QString& moduleName);
+    void ExecuteSingleCase(const QString& moduleName, int caseIndex);
+    QList<QString> GetSetList();
+    QList<CSTFCase> GetCaseListFromSet(const QString& setName);
+    void CreateSet(const QString& setName);
+    void SaveSet(QString& setName);
+    void RemoveSet(const QString& setName);
+    void AddtoSet(const QString& setName, CSTFCase& caseInfo);
+    void ExecuteSet(const QString& SetName, const int startIndex, const TSTFCaseRunningType type);
+    
+public://implement CUIStoreIf 
+     void Update( CStartedTestCase* aTestCase,
+                          TInt aFlags);
+     
+public:
+     TPtrC QString2TPtrC(const QString& aString);
+     QString TDesC2QString(const TDesC& des);
+     //CTestInfo* GetTestInfo(CSTFCase aCase);
+private:
+   QList<IStifCaseUpdateListener*> *listenerList;
+   HBufC*  iBuffer;
+    };
+
+
+
+#endif /* STIFEXECUTOR_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/uisetting.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*/
+
+#ifndef UISETTING_H_
+#define UISETTING_H_
+#include <QHash>
+
+class UiSetting
+    {
+public:
+    UiSetting();
+    ~UiSetting();
+    
+public:
+    QString ReadSetting(const QString& item);
+    void SetSetting(const QString& item,const QString& value);
+    
+private:
+    bool load();
+    bool save();
+    void loadDefault();
+    
+private:
+    QHash<QString, QString> settingList;
+    };
+
+#endif /* UISETTING_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/inc/version.h	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: STIF QT UI version declaration
+*
+*/
+
+#ifndef VERSION_H_
+#define VERSION_H_
+
+#define STIF_MAJOR_VERSION 7
+#define STIF_MINOR_VERSION 3
+#define STIF_BUILD_VERSION 26
+
+#define STIF_REL_DATE "09th Feb 2010"
+
+#define TO_UNICODE(text) _L(text) 
+
+#endif /*VERSION_H_*/
Binary file stifui/qt/sis/stifqtui.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/dlgoutput.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,122 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ * 
+ */
+#include "dlgoutput.h"
+#include <QtGui>
+
+DlgOutput::DlgOutput(IStfQtUIController* ctl, QWidget *parent) :
+    QDialog(parent), controller(ctl)
+    {
+    QSize btnSize(100,30);
+    QGridLayout *mainLayout = new QGridLayout(this);
+    this->setLayout(mainLayout);
+    this->setContextMenuPolicy(Qt::NoContextMenu);
+
+    tabMain = new QTabWidget();
+    tabMain->setContextMenuPolicy(Qt::NoContextMenu);
+
+    QWidget *toolWidget = new QWidget(this);
+    toolWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *toolLayout = new QGridLayout();
+    toolWidget->setLayout(toolLayout);
+    btnPause = new QPushButton(tr("Pause"), toolWidget);
+    btnPause->setContextMenuPolicy(Qt::NoContextMenu);
+    btnPause->setFixedSize(btnSize);
+    QObject::connect(btnPause, SIGNAL(clicked()), this,
+            SLOT(on_btnPause_clicked()));
+    btnAbort = new QPushButton(tr("Abort"), toolWidget);
+    btnAbort->setContextMenuPolicy(Qt::NoContextMenu);
+    btnAbort->setFixedSize(btnSize);
+    QObject::connect(btnAbort, SIGNAL(clicked()), this,
+            SLOT(on_btnAbort_clicked()));
+    toolLayout->addWidget(btnPause, 0, 0);
+    toolLayout->addWidget(btnAbort, 0, 1);
+
+    mainLayout->addWidget(toolWidget, 0, 0);
+    mainLayout->addWidget(tabMain, 1, 0);
+    controller->AddStfEventListener(this);
+    }
+
+DlgOutput::~DlgOutput()
+    {
+    controller->RemoveStfEventListener(this);
+    }
+
+void DlgOutput::CreateItem(QString index, QString item)
+    {
+    QPlainTextEdit* edit = new QPlainTextEdit(this);
+    edit->setContextMenuPolicy(Qt::NoContextMenu);
+    tabMain->addTab(edit, item);
+    tabList.insert(index, edit);
+    }
+
+void DlgOutput::CloseItem(QString index)
+    {
+    int u = tabList.keys().indexOf(index);
+    tabList.remove(index);
+    tabMain->removeTab(u);
+    if (tabMain->count() == 0)
+        {
+        this->close();
+        }
+    }
+
+void DlgOutput::ShowMessage(QString index, QString msg)
+    {
+    if(tabList.contains(index))
+        {
+        tabList.value(index)->setPlainText(msg);    
+        }
+    }
+
+void DlgOutput::on_btnPause_clicked()
+    {
+    if (btnPause->text() == "Pause")
+        {
+        controller->PauseCase();
+        btnPause->setText(tr("Resume"));
+        }
+    else
+        {
+        controller->ResumeCase();
+        btnPause->setText(tr("Pause"));
+        }
+    }
+
+void DlgOutput::on_btnAbort_clicked()
+    {
+    controller->AbortCase();
+    }
+
+void DlgOutput::OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd,
+        const QString& index, const QString& msg)
+    {
+    this->showMaximized();
+    switch (cmd)
+        {
+        case IStfEventListener::ECreate:
+            CreateItem(index, msg);
+            break;
+        case IStfEventListener::EClose:
+            CloseItem(index);
+            break;
+        default:
+            ShowMessage(index, msg);
+            break;
+        }
+
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/dlgsetting.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ * 
+ */
+
+#include "dlgsetting.h"
+#include <QtGui>
+
+DlgSetting::DlgSetting(UiSetting* settingObj, QWidget *parent)
+    : QDialog(parent), setting(settingObj)
+    {
+    SetupUI();
+    }
+
+void DlgSetting::SetupUI()
+    {
+    this->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *mainLayout = new QGridLayout(this);
+    this->setLayout(mainLayout);
+    
+    chkShowoutput = new QCheckBox(this);
+    chkShowoutput->setText(tr("Show output in execution."));
+    chkShowoutput->setChecked(setting->ReadSetting("showoutput") == "true");
+    
+    QWidget *toolWidget = new QWidget(this);
+    QGridLayout *toolLayout = new QGridLayout();
+    
+    toolWidget->setLayout(toolLayout);
+    btnOk = new QPushButton(tr("Ok"), toolWidget);
+    btnOk->setFixedSize(100, 30);
+    QObject::connect(btnOk, SIGNAL(clicked()), this,
+            SLOT(on_btnOk_clicked()));
+    btnCancel = new QPushButton(tr("Cancel"), toolWidget);
+    btnCancel->setFixedSize(100, 30);
+    QObject::connect(btnCancel, SIGNAL(clicked()), this,
+            SLOT(on_btnCancel_clicked()));
+    toolLayout->addWidget(btnOk, 0, 0);
+    toolLayout->addWidget(btnCancel, 0, 1);
+
+    mainLayout->addWidget(chkShowoutput, 0, 0);
+    mainLayout->addWidget(toolWidget, 2, 0);    
+    }
+
+void DlgSetting::on_btnOk_clicked()
+    {
+    if(chkShowoutput->checkState() == Qt::Checked)
+        {
+        setting->SetSetting("showoutput", "true");
+        }
+    else
+        {
+        setting->SetSetting("showoutput", "false");    
+        }
+    this->accept();
+    }
+
+void DlgSetting::on_btnCancel_clicked()
+    {
+    this->reject();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/frmmain.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,809 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ *              
+ */
+#include <QtGui>
+#include "frmmain.h"
+#include "stfqtuicontroller.h"
+#include "stfqtuimodel.h"
+#include <QList>
+#include "version.h"
+#include <QCursor>
+
+const QString SELECTITEMHEADER = " * ";
+const QString UNSELECTITEMHEADER = "   ";
+
+frmMain::frmMain()
+    {
+    uiSetting = new UiSetting();
+    createMenus();
+    load();
+    LoadSubMenu();
+    model = new StfQtUIModel();
+    model->AddStifModelEventListener(this);
+    controller = new StfQtUIController(model);
+    controller->AddStfEventListener(this);
+    loadContent();
+    dlgOutput = new DlgOutput(controller);
+    setSetting();
+    }
+
+frmMain::~frmMain()
+    {
+    model->AbortCase();
+    controller->RemoveStfEventListener(this);
+    model->RemoveStifModelEventListener(this);
+    
+    delete uiSetting;
+    delete dlgOutput;
+    delete controller;
+    delete model;
+    }
+
+void frmMain::setSetting()
+    {
+    controller->SetShowOutput(uiSetting->ReadSetting("showoutput") == "true");    
+    }
+
+void frmMain::OnGetMessage(const QString& aMessage)
+    {
+    txtOutput->appendPlainText(aMessage);
+    }
+
+void frmMain::OnRunningCaseChanged()
+    {
+    QList<CSTFCase> caseList = controller->GetCasesByStatus(EStatusRunning);
+    lstStartedCases->clear();
+    foreach(CSTFCase aCase, caseList)
+            {
+            lstStartedCases->addItem(aCase.Name());
+            }
+    if (caseList.size() != 0)
+        {
+        btnPauseCase->setEnabled(true);
+        btnAbortCase->setEnabled(true);
+        actPause->setEnabled(true);
+        actAbort->setEnabled(true);
+        }
+    else
+        {
+        btnPauseCase->setEnabled(false);
+        btnAbortCase->setEnabled(false);
+        actPause->setEnabled(false);
+        actAbort->setEnabled(false);
+        }
+    }
+
+void frmMain::OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& /*cmd*/, const QString& /*index*/, const QString& /*msg*/)
+    {
+    //nothing to do.
+    }
+
+void frmMain::OnSetListChanged()
+    {
+    loadSetList();
+    }
+
+void frmMain::OnCaseStatisticChanged()
+    {
+    loadStatistic();
+    }
+
+void frmMain::createMenus()
+    {
+    //operateMenu = menuBar()->addMenu(tr("&Operation"));
+    actAbout = new QAction(tr("&About"), this);
+    connect(actAbout, SIGNAL(triggered()), this,
+            SLOT(on_actAbout_triggered()));
+
+    actExit = new QAction(tr("&Exit"), this);
+    connect(actExit, SIGNAL(triggered()), this, SLOT(close()));
+
+    actOpenFile = new QAction(tr("&Open Ini File"), this);
+    connect(actOpenFile, SIGNAL(triggered()), this,
+            SLOT(on_actOpenFile_triggered()));
+
+    actRunCaseSeq = new QAction(tr("Run Case Sequentially"), this);
+    connect(actRunCaseSeq, SIGNAL(triggered()), this,
+            SLOT(on_actRunCaseSeq_triggered()));
+
+    actRunCasePar = new QAction(tr("Run Case Parallel"), this);
+    connect(actRunCasePar, SIGNAL(triggered()), this,
+            SLOT(on_actRunCasePar_triggered()));
+
+    actAddtoSet = new QAction(tr("Add cases to Set"), this);
+    connect(actAddtoSet, SIGNAL(triggered()), this,
+            SLOT(on_actAddtoSet_triggered()));
+
+    actSelectAll = new QAction(tr("Select All"), this);
+    connect(actSelectAll, SIGNAL(triggered()), this,
+            SLOT(on_actSelectAll_triggered()));
+
+    actExpandAll = new QAction(tr("Expand All"), this);
+    connect(actExpandAll, SIGNAL(triggered()), this,
+            SLOT(on_actExpandAll_triggered()));
+
+    actCollapseAll = new QAction(tr("Collapse All"), this);
+    connect(actCollapseAll, SIGNAL(triggered()), this,
+            SLOT(on_actCollapseAll_triggered()));
+
+    actSetting = new QAction(tr("Setting"), this);
+    connect(actSetting, SIGNAL(triggered()), this,
+            SLOT(on_actSetting_triggered()));
+
+    actRunSetSeq = new QAction(tr("Run Set Sequentially"), this);
+    connect(actRunSetSeq, SIGNAL(triggered()), this,
+            SLOT(on_actRunSetSeq_triggered()));
+
+    actRunSetPar = new QAction(tr("Run Set Parallel"), this);
+    connect(actRunSetPar, SIGNAL(triggered()), this,
+            SLOT(on_actRunSetPar_triggered()));
+
+    actNewSet = new QAction(tr("Create New Set"), this);
+    connect(actNewSet, SIGNAL(triggered()), this,
+            SLOT(on_actNewSet_triggered()));
+
+    actDelSet = new QAction(tr("Delete Set"), this);
+    connect(actDelSet, SIGNAL(triggered()), this,
+            SLOT(on_actDelSet_triggered()));
+
+    actPause = new QAction(tr("Pause"), this);
+    actPause->setEnabled(false);
+    connect(actPause, SIGNAL(triggered()), this,
+            SLOT(on_actPause_triggered()));
+
+    actAbort = new QAction(tr("Abort"), this);
+    actAbort->setEnabled(false);
+    connect(actAbort, SIGNAL(triggered()), this,
+            SLOT(on_actAbort_triggered()));
+
+    actClearStatistics = new QAction(tr("Clear Statistics"), this);
+    connect(actClearStatistics, SIGNAL(triggered()), this,
+            SLOT(on_actClearStatistics_triggered()));
+
+    }
+
+void frmMain::load()
+    {
+    this->setContextMenuPolicy(Qt::NoContextMenu);
+    QSize btnSize(100,35);
+    QGridLayout *mainLayout = new QGridLayout(this);
+    mainLayout->setVerticalSpacing(2);
+    mainLayout->setHorizontalSpacing(2);
+    mainLayout->setSpacing(2);
+    mainLayout->setMargin(2);
+
+    MainWidget = new QWidget(this);
+    MainWidget->setContextMenuPolicy(Qt::NoContextMenu);
+
+    //tab control
+    tabWidget = new QTabWidget(this);
+    tabWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    tabCase = new QWidget(tabWidget);
+    tabCase->setContextMenuPolicy(Qt::NoContextMenu);
+    tabWidget->addTab(tabCase, tr("Cases"));
+    tabSet = new QWidget(tabWidget);
+    tabSet->setContextMenuPolicy(Qt::NoContextMenu);
+    tabWidget->addTab(tabSet, tr(" Set "));
+    tabStarted = new QWidget(tabWidget);
+    tabStarted->setContextMenuPolicy(Qt::NoContextMenu);
+    tabWidget->addTab(tabStarted, tr("Running"));
+    tabStatistic = new QWidget(tabWidget);
+    tabStatistic->setContextMenuPolicy(Qt::NoContextMenu);
+    tabWidget->addTab(tabStatistic, tr("Statistics"));
+    connect(tabWidget, SIGNAL(currentChanged(int)), this,
+            SLOT(onTabWidgetSelectIndexChanged()));
+
+    //output panel
+    QGroupBox *groupBox = new QGroupBox(this);
+    groupBox->setFixedHeight(150);
+    groupBox->setContextMenuPolicy(Qt::NoContextMenu);
+    groupBox->setTitle(tr("Information"));
+    QFont serifFont("Times", 5, QFont::Normal);
+    txtOutput = new QPlainTextEdit(groupBox);
+    txtOutput->setFont(serifFont);
+    txtOutput->setContextMenuPolicy(Qt::NoContextMenu);
+    txtOutput->setReadOnly(true);
+    txtOutput->setFocusPolicy(Qt::NoFocus);
+    //txtOutput->setEditFocus(false);
+    QGridLayout *groupBoxLayout = new QGridLayout(this);
+    groupBoxLayout->setVerticalSpacing(2);
+    groupBoxLayout->setHorizontalSpacing(2);
+    groupBoxLayout->setSpacing(2);
+    groupBoxLayout->setMargin(2);   
+    groupBoxLayout->addWidget(txtOutput, 0, 0);
+    groupBox->setLayout(groupBoxLayout);
+
+    //Create MainLayout and MainWidget
+    mainLayout->addWidget(tabWidget, 0, 0);
+    mainLayout->addWidget(groupBox, 1, 0, Qt::AlignBottom);
+    MainWidget->setLayout(mainLayout);
+    
+
+    //Tab page: Case
+    QGridLayout *tabCaseLayout = new QGridLayout(this);
+    tabCaseLayout->setVerticalSpacing(2);
+    tabCaseLayout->setHorizontalSpacing(2);
+    tabCaseLayout->setSpacing(2);
+    tabCaseLayout->setMargin(2);   
+    treeModuleList = new QTreeWidget(tabCase);
+    treeModuleList->setContextMenuPolicy(Qt::NoContextMenu);
+    treeModuleList->headerItem()->setText(0, tr("Module List"));
+    treeModuleList->setSelectionBehavior(QAbstractItemView::SelectRows);
+    treeModuleList->setEditFocus(false);
+    connect(treeModuleList, SIGNAL(itemClicked(QTreeWidgetItem* , int)), this, 
+            SLOT(on_treeModuleList_itemClicked(QTreeWidgetItem* , int)));
+    
+
+    QWidget *caseToolWidget = new QWidget(tabCase);
+    caseToolWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *caseToolWidgetLayout = new QGridLayout;
+    QPushButton *btnRunCase = new QPushButton(tr("Run"), caseToolWidget);
+    btnRunCase->setContextMenuPolicy(Qt::NoContextMenu);
+    btnRunCase->setFixedSize(btnSize);
+    connect(btnRunCase, SIGNAL(clicked()), this,
+            SLOT(on_actRunCaseSeq_triggered()));
+    QPushButton *btnExpandAll = new QPushButton(tr("Expand"), caseToolWidget);
+    btnExpandAll->setContextMenuPolicy(Qt::NoContextMenu);
+    btnExpandAll->setFixedSize(btnSize);
+    connect(btnExpandAll, SIGNAL(clicked()), this,
+            SLOT(on_actExpandAll_triggered()));
+    QPushButton *btnCollapseAll = new QPushButton(tr("Collapse"),
+            caseToolWidget);
+    btnCollapseAll->setContextMenuPolicy(Qt::NoContextMenu);
+    btnCollapseAll->setFixedSize(btnSize);
+    connect(btnCollapseAll, SIGNAL(clicked()), this,
+            SLOT(on_actCollapseAll_triggered()));
+
+    caseToolWidgetLayout->addWidget(btnRunCase, 0, 0);
+    caseToolWidgetLayout->addWidget(btnExpandAll, 0, 1);
+    caseToolWidgetLayout->addWidget(btnCollapseAll, 0, 2);
+    caseToolWidget->setLayout(caseToolWidgetLayout);
+
+    tabCaseLayout->addWidget(caseToolWidget, 1, 0);
+    tabCaseLayout->addWidget(treeModuleList, 0, 0);
+    tabCase->setLayout(tabCaseLayout);
+
+    //Tab page: Set
+
+    QGridLayout *tabSetLayout = new QGridLayout(this);
+    tabSetLayout->setVerticalSpacing(2);
+    tabSetLayout->setHorizontalSpacing(2);
+    tabSetLayout->setSpacing(2);
+    tabSetLayout->setMargin(2);   
+
+    QGridLayout *tabSetMainLayout = new QGridLayout(this);
+    tabSetMainLayout->setVerticalSpacing(2);
+    tabSetMainLayout->setHorizontalSpacing(2);
+    tabSetMainLayout->setSpacing(2);
+    tabSetMainLayout->setMargin(2);   
+    QWidget *tabSetMainWidget = new QWidget(tabSet);
+    tabSetMainWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    QLabel *lblSet = new QLabel(tr("Test Set:"), tabSetMainWidget);
+    lblSet->setContextMenuPolicy(Qt::NoContextMenu);
+    QLabel *lblCase = new QLabel(tr("Cases:"), tabSetMainWidget);
+    lblCase->setContextMenuPolicy(Qt::NoContextMenu);
+    cboSetList = new QComboBox(tabSetMainWidget);
+    cboSetList->setContextMenuPolicy(Qt::NoContextMenu);
+    cboSetList->setEditable(false);
+    connect(cboSetList, SIGNAL(currentIndexChanged(QString)), this,
+            SLOT(on_cboSetList_currentIndexChanged(QString)));
+    lstSetCases = new QListWidget(tabSetMainWidget);
+    lstSetCases->setContextMenuPolicy(Qt::NoContextMenu);
+    tabSetMainLayout->addWidget(lblSet, 0, 0);
+    tabSetMainLayout->addWidget(cboSetList, 0, 1);
+    tabSetMainLayout->addWidget(lblCase, 1, 0,
+            (Qt::AlignTop | Qt::AlignRight));
+    tabSetMainLayout->addWidget(lstSetCases, 1, 1);
+    tabSetMainWidget->setLayout(tabSetMainLayout);
+
+    QWidget *setToolWidget = new QWidget(tabSet);
+    setToolWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *setToolWidgetLayout = new QGridLayout(this);
+    setToolWidgetLayout->setVerticalSpacing(2);
+    setToolWidgetLayout->setHorizontalSpacing(2);
+    setToolWidgetLayout->setSpacing(2);
+    setToolWidgetLayout->setMargin(2);     
+    QPushButton *btnRunSetCase = new QPushButton(tr("Run"), setToolWidget);
+    btnRunSetCase->setContextMenuPolicy(Qt::NoContextMenu);
+    btnRunSetCase->setFixedSize(btnSize);
+    connect(btnRunSetCase, SIGNAL(clicked()), this,
+            SLOT(on_actRunSetSeq_triggered()));
+    QPushButton *btnNewSet = new QPushButton(tr("New Set"), setToolWidget);
+    btnNewSet->setContextMenuPolicy(Qt::NoContextMenu);
+    btnNewSet->setFixedSize(btnSize);
+    connect(btnNewSet, SIGNAL(clicked()), this,
+            SLOT(on_actNewSet_triggered()));
+    QPushButton *btnDelSet = new QPushButton(tr("Delete Set"), setToolWidget);
+    btnDelSet->setContextMenuPolicy(Qt::NoContextMenu);
+    btnDelSet->setFixedSize(btnSize);
+    connect(btnDelSet, SIGNAL(clicked()), this,
+            SLOT(on_actDelSet_triggered()));
+
+    setToolWidgetLayout->addWidget(btnRunSetCase, 0, 0);
+    setToolWidgetLayout->addWidget(btnNewSet, 0, 1);
+    setToolWidgetLayout->addWidget(btnDelSet, 0, 2);
+    setToolWidget->setLayout(setToolWidgetLayout);
+
+    tabSetLayout->addWidget(tabSetMainWidget, 0, 0);
+    tabSetLayout->addWidget(setToolWidget, 1, 0);
+    tabSet->setLayout(tabSetLayout);
+
+    //Tab Started
+    QGridLayout *tabStartedLayout = new QGridLayout(this);
+    tabStartedLayout->setVerticalSpacing(2);
+    tabStartedLayout->setHorizontalSpacing(2);
+    tabStartedLayout->setSpacing(2);
+    tabStartedLayout->setMargin(2);     
+    lstStartedCases = new QListWidget(tabStarted);
+    lstStartedCases->setContextMenuPolicy(Qt::NoContextMenu);
+    QWidget *startedToolWidget = new QWidget(tabStarted);
+    startedToolWidget->setContextMenuPolicy(Qt::NoContextMenu);
+    QGridLayout *startedToolWidgetLayout = new QGridLayout(this);
+    startedToolWidgetLayout->setVerticalSpacing(2);
+    startedToolWidgetLayout->setHorizontalSpacing(2);
+    startedToolWidgetLayout->setSpacing(2);
+    startedToolWidgetLayout->setMargin(2);
+    btnPauseCase = new QPushButton(tr("Pause"), startedToolWidget);
+    btnPauseCase->setContextMenuPolicy(Qt::NoContextMenu);
+    btnPauseCase->setFixedSize(btnSize);
+    connect(btnPauseCase, SIGNAL(clicked()), this,
+            SLOT(on_actPause_triggered()));
+    btnPauseCase->setEnabled(false);
+
+    btnAbortCase = new QPushButton(tr("Abort"), startedToolWidget);
+    btnAbortCase->setContextMenuPolicy(Qt::NoContextMenu);
+    btnAbortCase->setFixedSize(btnSize);
+    connect(btnAbortCase, SIGNAL(clicked()), this,
+            SLOT(on_actAbort_triggered()));
+    btnAbortCase->setEnabled(false);
+    //    
+    //    QPushButton *btnShowOutput = new QPushButton(tr("Output"), startedToolWidget);
+    //    connect(btnShowOutput, SIGNAL(clicked()), this,
+    //                SLOT(on_btnShowOutput_clicked()));
+
+
+    startedToolWidgetLayout->addWidget(btnPauseCase, 0, 0);
+    startedToolWidgetLayout->addWidget(btnAbortCase, 0, 1);
+    //startedToolWidgetLayout->addWidget(btnShowOutput, 0, 2);
+    startedToolWidget->setLayout(startedToolWidgetLayout);
+
+    tabStartedLayout->addWidget(lstStartedCases, 0, 0);
+    tabStartedLayout->addWidget(startedToolWidget, 1, 0);
+    tabStarted->setLayout(tabStartedLayout);
+
+    //Tab Statistic
+    QGridLayout *tabStatisticLayout = new QGridLayout(this);
+    tabStatisticLayout->setVerticalSpacing(2);
+    tabStatisticLayout->setHorizontalSpacing(2);
+    tabStatisticLayout->setSpacing(2);
+    tabStatisticLayout->setMargin(2);
+
+    treeStatistic = new QTreeWidget(tabStatistic);
+    treeStatistic->setContextMenuPolicy(Qt::NoContextMenu);
+    treeStatistic->headerItem()->setText(0, tr("Statistics"));
+    tabStatisticLayout->addWidget(treeStatistic, 0, 0);
+    tabStatistic->setLayout(tabStatisticLayout);
+
+    executedItems = new QTreeWidgetItem(treeStatistic);
+    executedItems->setText(0, tr("Executed Cases(0)"));
+    passedItems = new QTreeWidgetItem(treeStatistic);
+    passedItems->setText(0, tr("Passed Cases(0)"));
+    failedItems = new QTreeWidgetItem(treeStatistic);
+    failedItems->setText(0, tr("Failed Cases(0)"));
+    crashedItems = new QTreeWidgetItem(treeStatistic);
+    crashedItems->setText(0, tr("Crashed Cases(0)"));
+    abortedItems = new QTreeWidgetItem(treeStatistic);
+    abortedItems->setText(0, tr("Aborted Cases(0)"));
+    
+    
+    setCentralWidget(MainWidget);
+
+    }
+
+void frmMain::LoadSubMenu()
+    {
+    menuBar()->clear();
+    menuBar()->setContextMenuPolicy(Qt::NoContextMenu);
+    if (tabWidget->currentIndex() == 0)
+        {
+        //Cases Tab
+        menuBar()->addAction(actOpenFile);
+        menuBar()->addAction(actRunCaseSeq);
+        menuBar()->addAction(actRunCasePar);
+        menuBar()->addSeparator();
+        menuBar()->addAction(actAddtoSet);
+        menuBar()->addSeparator();
+        menuBar()->addAction(actSelectAll);
+        menuBar()->addAction(actExpandAll);
+        menuBar()->addAction(actCollapseAll);
+        }
+    else if (tabWidget->currentIndex() == 1)
+        {
+        //Set Tab
+        menuBar()->addAction(actRunSetSeq);
+        menuBar()->addAction(actRunSetPar);
+        menuBar()->addSeparator();
+        menuBar()->addAction(actNewSet);
+        menuBar()->addAction(actDelSet);
+        }
+    else if (tabWidget->currentIndex() == 2)
+        {
+        //Started Tab
+        menuBar()->addAction(actPause);
+        menuBar()->addAction(actAbort);
+        
+        }
+    else
+        {
+        //Staticstic tab
+        menuBar()->addAction(actClearStatistics);
+        }
+    menuBar()->addSeparator();
+    menuBar()->addAction(actSetting);
+    menuBar()->addAction(actAbout);
+    menuBar()->addAction(actExit);
+
+    }
+
+void frmMain::onTabWidgetSelectIndexChanged()
+    {
+    LoadSubMenu();
+    }
+
+void frmMain::loadContent()
+    {
+    //Load ModuleList
+    loadModuleList();
+    //Load SetList
+    loadSetList();
+    //Load Statistic List
+    loadStatistic();
+    }
+
+void frmMain::loadModuleList()
+    {
+    treeModuleList->clear();
+    
+    QList<QString> moduleList = controller->GetModuleList();
+    foreach(QString moduleName, moduleList)
+            {
+            QTreeWidgetItem* item = new QTreeWidgetItem(treeModuleList);
+            item->setText(0, UNSELECTITEMHEADER + moduleName);
+            
+            QList<QString> caseList = controller->GetCaseListByModule(
+                    moduleName);
+
+            foreach(QString caseName, caseList)
+                    {
+                    QTreeWidgetItem* caseItem = new QTreeWidgetItem(item);        
+                    caseItem->setText(0, UNSELECTITEMHEADER + caseName);
+                    }
+            }
+    if (moduleList.size() > 0)
+        {
+        treeModuleList->setCurrentItem(treeModuleList->topLevelItem(0));
+        }
+    }
+
+void frmMain::reloadStatisticItem(QString name, QTreeWidgetItem* item,
+        TSTFCaseStatusType type)
+    {
+    QList<CSTFCase> caseList = controller->GetCasesByStatus(type);
+    while (item->childCount() != 0)
+        {
+        item->removeChild(item->child(0));
+        }
+    item->setText(0, name + "(" + QString::number(caseList.size(), 10) + ")");
+    foreach(CSTFCase aCase, caseList)
+            {
+            QTreeWidgetItem* child = new QTreeWidgetItem(item);
+            child->setText(0, aCase.Name());
+            }
+    }
+
+void frmMain::loadStatistic()
+    {
+    //executedItems;
+    reloadStatisticItem("Executed Cases", executedItems, EStatusExecuted);
+
+    //passedItems;
+    reloadStatisticItem("Passed Cases", passedItems, EStatusPassed);
+
+    //failedItems;
+    reloadStatisticItem("Failed Cases", failedItems, EStatusFailed);
+
+    //crashedItems;
+    reloadStatisticItem("Crashed Cases", crashedItems, EStatusCrashed);
+
+    //abortedItems;
+    reloadStatisticItem("Aborted Cases", abortedItems, EStatusAborted);
+
+    }
+
+void frmMain::loadSetList()
+    {
+    cboSetList->clear();
+
+    QList<QString> setList = controller->GetSetList();
+    foreach(QString setName, setList)
+            {
+            cboSetList->addItem(setName);
+            }
+//    if (setList.size() > 0)
+//        {
+//        //cboSetList->setCurrentIndex(0);
+//        on_cboSetList_currentIndexChanged(setList.at(0));
+//        }
+    }
+
+QList<CSTFCase> frmMain::getSelectedCases()
+    {
+    int index = 0;
+    QTreeWidgetItem* item = treeModuleList->topLevelItem(index);
+    QList<CSTFCase> caseList;
+    while (item != 0)
+        {
+        for (int i = 0; i < item->childCount(); i++)
+            {
+            QTreeWidgetItem* child = item->child(i);
+            if (child->text(0).startsWith(SELECTITEMHEADER))
+                {
+                CSTFCase aCase(child->text(0).remove(0,3), i);
+                aCase.SetIndex(i);
+                //aCase.SetModuleName(moduleBox->text());
+                aCase.SetModuleName(item->text(0).remove(0,3));
+                caseList.append(aCase);
+                }
+            }
+        index++;
+        item = treeModuleList->topLevelItem(index);
+        }
+    return caseList;
+    }
+
+void frmMain::on_cboSetList_currentIndexChanged(QString item)
+    {
+    lstSetCases->clear();
+    QList<QString> list = controller->GetCaseListBySet(item);
+    foreach(QString caseName, list)
+            {
+            lstSetCases->addItem(caseName);
+            }
+    }
+
+void frmMain::on_actRunCaseSeq_triggered()
+    {
+    //run case seq
+    controller->RunCases(getSelectedCases(), Sequentially);
+    }
+
+void frmMain::on_actRunCasePar_triggered()
+    {
+    controller->RunCases(getSelectedCases(), Parallel);
+    }
+
+void frmMain::on_actAddtoSet_triggered()
+    {
+
+    QList<CSTFCase> list = getSelectedCases();
+    if (list.size() == 0)
+        {
+        QErrorMessage *errorMessageDialog = new QErrorMessage(this);
+        errorMessageDialog->showMessage(tr(
+                "Please select cases you want to added to set."));
+        return;
+        }
+
+    QList<QString> setList = controller->GetSetList();
+
+    /*    
+     bool ok;
+     QString setName = QInputDialog::getItem(this, tr(
+     "Add select cases to Set"), tr("Sets:"), setList, 0, false, &ok);
+     if (ok && !setName.isEmpty())
+     {
+     controller->AddCaseToSet(list, setName);
+     }
+     */
+
+    //temp code, because UIStore()->AddCaseToSet() is not support to define a set name.
+    controller->AddCaseToSet(list, "");
+    tabWidget->setCurrentIndex(1);
+
+    }
+
+void frmMain::on_actSelectAll_triggered()
+    {
+    QString header = UNSELECTITEMHEADER;
+    if(actSelectAll->text() == "Select All")
+        {
+        actSelectAll->setText("UnSelect All");
+        header = SELECTITEMHEADER;
+        }
+    else
+        {
+        actSelectAll->setText("Select All");    
+        }
+    
+    int index = 0;
+    QTreeWidgetItem* item = treeModuleList->topLevelItem(index);
+    while (item != 0)
+        {
+        item->setText(0, item->text(0).replace(0,3, header));
+        for (int i = 0; i < item->childCount(); i++)
+            {
+            QTreeWidgetItem* child = item->child(i);
+            child->setText(0,child->text(0).replace(0,3,header));
+            }
+        index++;
+        item = treeModuleList->topLevelItem(index);
+        }
+    }
+
+void frmMain::on_actExpandAll_triggered()
+    {
+    treeModuleList->expandAll();
+    }
+
+void frmMain::on_actCollapseAll_triggered()
+    {
+    treeModuleList->collapseAll();
+    }
+
+void frmMain::on_actSetting_triggered()
+    {
+    DlgSetting dlgSet(uiSetting);
+    int result = dlgSet.exec();
+    if(result == QDialog::Accepted)
+        {
+        setSetting();
+        }
+    }
+
+void frmMain::on_actRunSetSeq_triggered()
+    {
+    QString setName = cboSetList->currentText();
+    controller->RunSets(setName, Sequentially);
+    }
+
+void frmMain::on_actRunSetPar_triggered()
+    {
+    QString setName = cboSetList->currentText();
+    controller->RunSets(setName, Parallel);
+    }
+
+void frmMain::on_actNewSet_triggered()
+    {
+    //not supported.
+    QErrorMessage *errorMessageDialog = new QErrorMessage(this);
+    errorMessageDialog->showMessage(
+            tr(
+                    "The feature is not supported in this version.\r\n    \
+            If you want to Add test set.\r\n           \
+            Please switch to \"Case\" tab, Select case(s) and perform \"Add case to set\"."));
+    return;
+    /*
+     * These function is not supported in this version.
+     * Unless this function has been impelemented:
+     * UIStore()->AddSet(setName);
+     * 
+     bool ok;
+     QString text = QInputDialog::getText(this, tr("Create a new Set"), tr(
+     "Input a set name:"), QLineEdit::Normal, QDir::home().dirName(),
+     &ok);
+     if (ok && !text.isEmpty())
+     {
+     controller->CreateSet(text);
+     }
+     */
+    }
+
+void frmMain::on_actDelSet_triggered()
+    {
+    //not supported.
+    QErrorMessage *errorMessageDialog = new QErrorMessage(this);
+    errorMessageDialog->showMessage(
+            tr(
+                    "The feature is not supported in this version.\r\n    \
+            If you want to remove test set.\r\n           \
+            Please delete them under {epoc root}\\winscw\\c\\TestFramework  \
+            And restart Application"));
+    return;
+    /*
+     * These function is not supported in this version.
+     * Unless this function has been impelemented:
+     * UIStore()->RemoveSet(setName);
+     * 
+     QString setName = cboSetList->currentText();
+     QMessageBox msgBox(QMessageBox::Warning, tr("Delete a Set"), tr(
+     "Do you really want to delete the set?"), 0, this);
+     msgBox.addButton(tr("&Delete"), QMessageBox::AcceptRole);
+     msgBox.addButton(tr("&Cancel"), QMessageBox::RejectRole);
+     if (msgBox.exec() == QMessageBox::AcceptRole)
+     {
+     controller->DeleteSet(setName);
+     }
+     
+     
+     */
+    }
+
+void frmMain::on_actPause_triggered()
+    {
+    if (btnPauseCase->text() == "Pause")
+        {
+        controller->PauseCase();
+        btnPauseCase->setText(tr("Resume"));
+        actPause->setText(tr("Resume"));
+        }
+    else
+        {
+        controller->ResumeCase();
+        btnPauseCase->setText(tr("Pause"));
+        actPause->setText(tr("Pause"));
+        }
+    }
+
+void frmMain::on_actAbort_triggered()
+    {
+    controller->AbortCase();
+    }
+
+void frmMain::on_treeModuleList_itemClicked(QTreeWidgetItem* item, int /*column*/)
+    {
+    QString header = UNSELECTITEMHEADER;
+    if(item->text(0).startsWith(UNSELECTITEMHEADER))
+        {
+            header = SELECTITEMHEADER;
+        }
+    item->setText(0 , item->text(0).replace(0, 3, header));
+    for(int i=0;i<item->childCount();i++)
+        {
+            item->child(i)->setText(0, item->child(i)->text(0).replace(0, 3, header));
+        }
+    }
+
+void frmMain::on_actAbout_triggered()
+    {
+    QString str = QtUIVersion;
+    str.append("\r\n").append("STF version:");
+    
+    str.append(QString::number(STIF_MAJOR_VERSION, 10)).append(".");
+    str.append(QString::number(STIF_MINOR_VERSION, 10)).append(".");
+    str.append(QString::number(STIF_BUILD_VERSION, 10));
+    str.append("  --").append(STIF_REL_DATE).append("\r\n");
+    str.append("---");
+    str.append("\r\nCopyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. ");
+
+    QMessageBox::information(this, tr("About"), str);
+    }
+
+void frmMain::on_actOpenFile_triggered()
+    {
+    QString fileName = QFileDialog::getOpenFileName(this, tr(
+            "Select ini file"), tr("c:\\"), tr(
+            "Ini Files (*.ini);;All Files (*)"));
+    if (!fileName.isEmpty())
+        {
+        controller->OpenEngineIniFile(fileName);
+        this->loadModuleList();
+        }
+    }
+
+void frmMain::on_actClearStatistics_triggered()
+    {
+    model->ClearCasesStatus();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/main.cpp	Fri May 14 15:53:02 2010 +0300
@@ -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 "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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: QT C++ based Class.
+*              Application entrance.
+*
+*/
+#include <QApplication>
+#include "frmmain.h"
+
+int main(int argc, char* argv[])
+{
+    QApplication app(argc, argv);
+    frmMain win;
+    win.showMaximized();
+    return app.exec();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/stfqtuicontroller.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,324 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ *              Stf Controller implementation.
+ *
+ */
+#include "stfqtuicontroller.h"
+#include <stifinternal/UIStoreIf.h>
+#include <stifinternal/UIStoreContainer.h>
+//#include "stiflogger.h"
+#include <QDateTime>
+
+const QString TEMPSETNAME = "TEMPSET";
+const QString DEFAULTINI = "c:\\testframework\\testframework.ini";
+
+//__DECLARE_LOG
+
+StfQtUIController::StfQtUIController(IStfQtUIModel* aModel) :
+    model(aModel), isShowOutput(false)
+    {
+//    __OPENLOGL ("\\STFQtUI\\", "StifQtUi.log" );
+    executor = new CStifExecutor();
+    executor->OpenIniFile(DEFAULTINI);
+    executor->AddStifCaseUpdateListener(this);
+    }
+
+StfQtUIController::~StfQtUIController()
+    {
+    executor->RemoveStifCaseUpdateListener(this);
+    delete executor;
+    executor = NULL;
+//    __CLOSELOG;
+    }
+//for cases
+
+bool StfQtUIController::OpenEngineIniFile(const QString& fileName)
+    {
+    delete executor;
+    executor = new CStifExecutor();
+    bool rst = executor->OpenIniFile(fileName);
+    executor->AddStifCaseUpdateListener(this);
+    return rst;
+    }
+
+QList<QString> StfQtUIController::GetModuleList()
+    {
+    QList<CSTFModule> modules = executor->GetModuleList();
+    QList<QString> moduleList;
+    foreach(CSTFModule m, modules)
+            {
+            moduleList.append(m.Name());
+            }
+    return moduleList;
+    }
+
+CSTFModule StfQtUIController::GetModuleByName(const QString& moduleName)
+    {
+    QList<CSTFModule> modules = executor->GetModuleList();
+    CSTFModule module;
+    foreach(CSTFModule m, modules)
+        {
+        if(m.Name() == moduleName)
+            {
+            module = m;
+            break;
+            }
+        }
+    return module;
+        
+    }
+
+QList<QString> StfQtUIController::GetCaseListByModule(const QString& moduleName)
+    {
+    QList<QString> caseList;
+    if (moduleName != "")
+        {
+        QList<CSTFCase> cases = executor->GetCaseList(moduleName);
+        foreach(CSTFCase c, cases)
+                {
+                caseList.append(c.Name());
+                }
+        }
+
+    return caseList;
+    }
+
+CSTFCase StfQtUIController::GetCase(const QString& moduleName, const int index)
+    {
+    CSTFCase rst;
+    if(moduleName != "")
+        {
+        QList<CSTFCase> cases = executor->GetCaseList(moduleName);
+        if(index < cases.length())
+            {
+            rst = cases.at(index);
+            }
+        }
+    return rst;
+    }
+
+void StfQtUIController::RunCases(const QList<CSTFCase>& caseList,
+        const TSTFCaseRunningType& type)
+    {
+    if (caseList.size() == 1)
+        {
+        CSTFCase aCase = caseList.at(0);
+        QString msg = "Start execute case:" + aCase.Name();
+        FireOnGetOutput(msg);
+        executor->ExecuteSingleCase(aCase.ModuleName(), aCase.Index());
+        }
+    else
+        {
+        //create a temp set, append cases into the set and execute it.
+        executor->CreateSet(TEMPSETNAME);
+        foreach(CSTFCase aCase, caseList)
+                {
+                executor->AddtoSet(TEMPSETNAME, aCase);
+                }
+        RunSets(TEMPSETNAME, type);
+        executor->RemoveSet(TEMPSETNAME);
+        }
+    }
+
+void StfQtUIController::AddCaseToSet(const QList<CSTFCase>& caseList,
+        const QString& /*setName*/)
+    {
+    QString setName = QDateTime::currentDateTime().toString("hh_mm_ss");
+    setName.append(".set");
+    executor->CreateSet(setName);
+    foreach(CSTFCase aCase, caseList)
+            {
+            executor->AddtoSet(setName, aCase);
+            }
+    executor->SaveSet(setName);
+    executor->RemoveSet(setName);
+    FireOnSetListChanged();
+    }
+
+//for set
+
+QList<QString> StfQtUIController::GetSetList()
+    {
+    return executor->GetSetList();
+    }
+QList<QString> StfQtUIController::GetCaseListBySet(const QString& setName)
+    {
+    QList<CSTFCase> cases = executor->GetCaseListFromSet(setName);
+    QList<QString> caseList;
+    foreach(CSTFCase c, cases)
+            {
+            caseList.append(c.Name());
+            }
+    return caseList;
+    }
+
+void StfQtUIController::CreateSet(const QString& setName)
+    {
+    executor->CreateSet(setName);
+    //executor->SaveSet(setName);
+    FireOnSetListChanged();
+    }
+
+void StfQtUIController::DeleteSet(const QString& setName)
+    {
+    executor->RemoveSet(setName);
+    //executor->SaveSet(setName);
+    FireOnSetListChanged();
+    }
+
+void StfQtUIController::RunSets(const QString& setName, const TSTFCaseRunningType& type)
+    {
+    executor->ExecuteSet(setName, 0, type);
+    }
+
+//for Started
+void StfQtUIController::PauseCase()
+    {
+    model->PauseCase();
+    QString msg = "Execution Paused";
+    FireOnGetOutput(msg);
+    }
+
+void StfQtUIController::ResumeCase()
+    {
+    model->ResumeCase();
+    FireOnGetOutput("Execution Resumed");
+    }
+
+void StfQtUIController::AbortCase()
+    {
+    model->AbortCase();
+    FireOnGetOutput("Case Aborted");
+    }
+
+bool StfQtUIController::ShowOutput()
+    {
+    return isShowOutput;
+    }
+
+void StfQtUIController::SetShowOutput(bool isShow)
+    {
+    isShowOutput = isShow;
+    }
+
+QList<CSTFCase> StfQtUIController::GetCasesByStatus(const TSTFCaseStatusType& type)
+    {
+    return model->GetCasesByStatus(type);
+    }
+
+void StfQtUIController::AddStfEventListener(IStfEventListener* listener)
+    {
+    if (!listenerList.contains(listener))
+        {
+        listenerList.append(listener);
+        }
+    }
+void StfQtUIController::RemoveStfEventListener(IStfEventListener* listener)
+    {
+    if (listenerList.contains(listener))
+        {
+        listenerList.removeOne(listener);
+        }
+    }
+
+void StfQtUIController::OnGetCaseUpdated(CStartedTestCase* aCase,
+        CSTFCase& stfcase, int flags)
+    {
+    if (flags & CUIStoreIf::EPrintUpdate || aCase == NULL)
+        {
+        return;
+        }
+    QString msg = "case Name:";
+    msg += stfcase.Name() + "\r\n Status:";
+    flags = aCase->Status();
+    if (flags & CUIStoreIf::EStatusRunning)
+        {
+        model->AddRunningCase(aCase, stfcase);
+        msg += "start running";
+        FireOnCaseOutputChanged(IStfEventListener::ECreate, (int) aCase,
+                stfcase.Name());
+        }
+    else if (flags & CUIStoreIf::EStatusAborted)
+        {
+        FireOnCaseOutputChanged(IStfEventListener::EClose, (int) aCase, "");
+        model->RemoveRunningCase(aCase);
+        model->AddCaseByStatus(EStatusAborted, stfcase);
+        msg += "aborted";
+
+        }
+    else if (flags & CUIStoreIf::EStatusExecuted)
+        {
+        FireOnCaseOutputChanged(IStfEventListener::EClose, (int) aCase, "");
+        model->RemoveRunningCase(aCase);
+        model->AddCaseByStatus(EStatusExecuted, stfcase);
+
+        if (flags & CUIStoreIf::EStatusCrashed)
+            {
+            model->AddCaseByStatus(EStatusCrashed, stfcase);
+            msg += "crashed";
+            }
+        else if (flags & CUIStoreIf::EStatusFailed)
+            {
+            model->AddCaseByStatus(EStatusFailed, stfcase);
+            msg += "failed";
+            }
+        else if (flags & CUIStoreIf::EStatusPassed)
+            {
+            model->AddCaseByStatus(EStatusPassed, stfcase);
+            msg += "passed";
+            }
+
+        }
+    else
+        {
+        return;
+        }
+
+    FireOnGetOutput(msg);
+    }
+
+void StfQtUIController::OnGetCaseOutput(CStartedTestCase* aCase, QString& msg)
+    {
+    FireOnCaseOutputChanged(IStfEventListener::EOutput, (int) aCase, msg);
+    }
+
+void StfQtUIController::FireOnCaseOutputChanged(
+        IStfEventListener::CaseOutputCommand cmd, int index, QString msg)
+    {
+    if (ShowOutput())
+        {
+        foreach(IStfEventListener* listener, listenerList)
+                {
+                listener->OnCaseOutputChanged(cmd,
+                        QString::number(index, 10), msg);
+                }
+        }
+    }
+
+void StfQtUIController::FireOnGetOutput(QString message)
+    {
+    foreach(IStfEventListener* listener, listenerList)
+            {
+            listener->OnGetMessage(message);
+            }
+    }
+
+void StfQtUIController::FireOnSetListChanged()
+    {
+    foreach(IStfEventListener* listener, listenerList)
+            {
+            listener->OnSetListChanged();
+            }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/stfqtuimodel.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,156 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ *              application model implementation.
+ *
+ */
+#include "stfqtuimodel.h"
+#include <UIEngineContainer.h>
+
+StfQtUIModel::StfQtUIModel()
+    {
+    //nothing to do.
+    }
+
+StfQtUIModel::~StfQtUIModel()
+    {
+    //nothing to do.
+    }
+
+void StfQtUIModel::PauseCase()
+    {
+    foreach(const CStartedTestCase* startedCase, runningCaseList.keys())
+            {
+            startedCase->UIEngineContainer().PauseTest();
+            }
+    }
+
+void StfQtUIModel::ResumeCase()
+    {
+    foreach(const CStartedTestCase* startedCase, runningCaseList.keys())
+            {
+            startedCase->UIEngineContainer().ResumeTest();
+            }
+    }
+
+void StfQtUIModel::AbortCase()
+    {
+    foreach(const CStartedTestCase* startedCase, runningCaseList.keys())
+            {
+            startedCase->UIEngineContainer().CancelTest();
+            }
+    }
+
+void StfQtUIModel::AddRunningCase(const CStartedTestCase* startedCase,
+        const CSTFCase& stfCase)
+    {
+    runningCaseList.insert(startedCase, stfCase);
+    FireOnRunningCaseChangedEvent();
+    }
+
+void StfQtUIModel::RemoveRunningCase(const CStartedTestCase* startedCase)
+    {
+    runningCaseList.remove(startedCase);
+    FireOnRunningCaseChangedEvent();
+    }
+
+void StfQtUIModel::AddCaseByStatus(const TSTFCaseStatusType& type, const CSTFCase& aCase)
+    {
+    switch (type)
+        {
+        case EStatusRunning:
+            break;
+        case EStatusExecuted:
+            executedCaseList.append(aCase);
+            break;
+        case EStatusPassed:
+            passedCaseList.append(aCase);
+            break;
+        case EStatusFailed:
+            failedCaseList.append(aCase);
+            break;
+        case EStatusAborted:
+            abortCaseList.append(aCase);
+            break;
+        case EStatusCrashed:
+            crashedCaseList.append(aCase);
+            break;
+        }
+    FireOnCaseStatisticChangedEvent();
+    }
+
+QList<CSTFCase> StfQtUIModel::GetCasesByStatus(const TSTFCaseStatusType& type)
+    {
+    switch (type)
+        {
+        case EStatusRunning:
+            return runningCaseList.values();
+        case EStatusExecuted:
+            return executedCaseList;
+        case EStatusPassed:
+            return passedCaseList;
+        case EStatusFailed:
+            return failedCaseList;
+        case EStatusAborted:
+            return abortCaseList;
+        case EStatusCrashed:
+            return crashedCaseList;
+        }
+    QList<CSTFCase> list;
+    return list;
+    }
+
+void StfQtUIModel::AddStifModelEventListener(
+        IStifModelEventListener* listener)
+    {
+    if (!listenerList.contains(listener))
+        {
+        listenerList.append(listener);
+        }
+    }
+
+void StfQtUIModel::RemoveStifModelEventListener(
+        IStifModelEventListener* listener)
+    {
+    if (!listenerList.contains(listener))
+        {
+        listenerList.removeOne(listener);
+        }
+    }
+
+void StfQtUIModel::FireOnCaseStatisticChangedEvent()
+    {
+    foreach(IStifModelEventListener* listener, listenerList)
+            {
+            listener->OnCaseStatisticChanged();
+            }
+    }
+
+void StfQtUIModel::FireOnRunningCaseChangedEvent()
+    {
+    foreach(IStifModelEventListener* listener, listenerList)
+            {
+            listener->OnRunningCaseChanged();
+            }
+    }
+
+void StfQtUIModel::ClearCasesStatus()
+    {
+    executedCaseList.clear();
+    passedCaseList.clear();
+    failedCaseList.clear();
+    abortCaseList.clear();
+    crashedCaseList.clear();
+    FireOnCaseStatisticChangedEvent();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/stifexecutor.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,360 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ and Symbian C++ combination Class.
+ *              STIF UI interface and engine caller implementaion.
+ *
+ */
+#include <e32base.h>
+#include <e32cons.h>
+#include <e32svr.h>
+#include <f32file.h>
+#include <HAL.h>
+#include <hal_data.h>
+#include <stiflogger.h>
+#include <QString>
+#include "stifexecutor.h"
+#include "StifTFwIf.h"
+
+
+CStifExecutor::CStifExecutor() :
+    listenerList(NULL)
+    {
+//    __LOG(_L("started"));
+    TInt result;
+    TRAP(result, CUIStoreIf::ConstructL());
+//    __LOG1(_L("CUIStoreIf ConstructL, result=%d"), result);
+    if (result != KErrNone)
+        {
+        return;
+        }
+    TRAP(result, iBuffer = HBufC::NewL(500));
+//    __LOG1(_L("Create Case Execution output buffer, result=%d"), result);
+
+    }
+
+CStifExecutor::~CStifExecutor()
+    {
+    UIStore().Close();
+    delete iBuffer;
+    if (listenerList)
+        {
+        delete listenerList;
+        listenerList = NULL;
+        }
+//    __LOG(_L("finished"));
+    }
+
+bool CStifExecutor::OpenIniFile(const QString& filename)
+    {
+    TInt result = UIStore().Open(QString2TPtrC(filename));
+//    __LOG2(_L("Open ini file %s.result=%d"),QString2TPtrC(filename).Ptr(),result);
+    return (result == KErrNone);
+    }
+
+TPtrC CStifExecutor::QString2TPtrC(const QString& aString)
+    {
+    TPtrC ret(reinterpret_cast<const TText*> (aString.constData()),
+            aString.length());
+    return ret;
+    }
+QString CStifExecutor::TDesC2QString(const TDesC& des)
+    {
+    //#ifdef QT_NO_UNICODE
+    //return QString::fromLocal8Bit((char*)des.Ptr(), des.Length());
+    //#else
+    QString rst = QString::fromUtf16(des.Ptr(), des.Length());
+    return rst;
+    //#endif
+    }
+
+void CStifExecutor::AddStifCaseUpdateListener(
+        IStifCaseUpdateListener* listener)
+    {
+//    __LOG(_L("AddStifCaseUpdateListener"));
+    if (!listenerList)
+        {
+        listenerList = new QList<IStifCaseUpdateListener*> ();
+        }
+    if (!listenerList->contains(listener))
+        {
+        listenerList->append(listener);
+        }
+    }
+
+void CStifExecutor::RemoveStifCaseUpdateListener(
+        IStifCaseUpdateListener* listener)
+    {
+//    __LOG(_L("RemoveStifCaseUpdateListener"));
+    if (!listenerList)
+        {
+        return;
+        }
+
+    if (listenerList->contains(listener))
+        {
+        listenerList->removeOne(listener);
+        }
+
+    }
+
+QList<CSTFModule> CStifExecutor::GetModuleList()
+    {
+    QList<CSTFModule> list;
+    RRefArray<TDesC> modules;
+//    __LOG(_L("GetModuleList"));
+    TInt ret = UIStore().Modules(modules);
+//    __LOG1(_L("LoadAllModules %d"), ret);
+//    __LOG1(_L("Modules number=%d"), modules.Count());
+    for (TInt i = 0; i < modules.Count(); i++)
+        {
+//        __LOG1(_L("Get Module Names %d"), i);
+        CSTFModule module;
+        module.SetName(QString::fromUtf16(modules[i].Ptr(),
+                modules[i].Length()));
+        //module.SetName(TDesC2QString(modules[i]));
+        list.append(module);
+        }
+    modules.Reset();
+    modules.Close();
+    return list;
+    }
+
+QList<CSTFCase> CStifExecutor::GetCaseList(const QString& moduleName)
+    {
+    TPtrC name = QString2TPtrC(moduleName);
+    QList<CSTFCase> list;
+    RRefArray<CTestInfo> testCases;
+    TInt ret = UIStore().TestCases(testCases, name, KNullDesC);
+//    __LOG1(_L("Get TestCases: %d"), ret);
+    for (TInt i = 0; i < testCases.Count(); i++)
+        {
+//       __LOG1(_L("Case Number: %d"),testCases[i].TestCaseNum());
+        CSTFCase testcase;
+        testcase.SetName(TDesC2QString(testCases[i].TestCaseTitle()));
+        testcase.SetIndex(i);
+        list.append(testcase);
+        }
+    testCases.Reset();
+    testCases.Close();
+    return list;
+    }
+
+void CStifExecutor::ExecuteSingleCase(const QString& moduleName, const int caseIndex)
+    {
+//    __LOG(_L("ExecuteCase start"));
+    TPtrC name = QString2TPtrC(moduleName);
+    RRefArray<CTestInfo> testCases;
+    TInt ret = UIStore().TestCases(testCases, name, KNullDesC);
+//    __LOG1(_L("Get TestCases return code=%d"), ret);
+    if (testCases.Count() > caseIndex)
+        {
+        TInt index;
+        UIStore().StartTestCase(testCases[caseIndex], index);
+//        __LOG1(_L("start test case index=%d"), index);
+        }
+    testCases.Reset();
+    testCases.Close();
+//    __LOG(_L("ExecuteCase end"));
+
+    }
+
+QList<QString> CStifExecutor::GetSetList()
+    {
+    QList<QString> list;
+    RRefArray<TDesC> aArray;
+    TInt ret = UIStore().GetTestSetsList(aArray);
+//    __LOG1(_L("Get TestSet list return code=%d"), ret);
+    if (ret != KErrNone) //setInfos.Count() != 1
+        {
+        return list;
+        }
+    for (int i = 0; i < aArray.Count(); i++)
+        {
+        list.append(TDesC2QString(aArray[i]));
+        }
+    aArray.Reset();
+    aArray.Close();
+    return list;
+    }
+
+QList<CSTFCase> CStifExecutor::GetCaseListFromSet(const QString& setName)
+    {
+//    __LOG(_L("GetCaseListFromSet start."));
+    QList<CSTFCase> list;
+    TPtrC name = QString2TPtrC(setName);
+
+    //__LOG(name);
+    if (name.Length() == 0)
+        {
+        return list;
+        }
+
+//    __LOG1(_L("name.Length()=%d"), name.Length());
+    TInt ret = UIStore().LoadTestSet(name);
+//    __LOG1(_L("Load Test Set return=%d"),ret);
+    const CTestSetInfo* set = NULL;
+    TRAP(ret , set = &UIStore().TestSetL(name));
+//    __LOG(_L("GetCaseListFromSet TestSetL."));
+    if(ret != KErrNone)
+        {
+        return list;
+        }
+    const RRefArray<const CTestInfo>& testCases = set->TestCases();
+//    __LOG(_L("GetCaseListFromSet TestCases."));
+    TInt count = testCases.Count();
+    for (TInt i = 0; i < count; i++)
+        {
+        CSTFCase testcase;
+        testcase.SetName(TDesC2QString(testCases[i].TestCaseTitle()));
+        testcase.SetIndex(testCases[i].TestCaseNum());
+        testcase.SetModuleName(TDesC2QString(testCases[i].ModuleName()));
+        list.append(testcase);
+        }
+//    __LOG(_L("GetCaseListFromSet end."));
+    return list;
+    }
+
+void CStifExecutor::CreateSet(const QString& setName)
+    {
+    TPtrC name = QString2TPtrC(setName);
+    TInt ret = UIStore().CreateTestSet(name);
+//    __LOG1(_L("CreateSet return: %d"), ret);
+//    ret = UIStore().LoadTestSet(name);
+//    __LOG1(_L("Load Set after CreateSet return: %d"), ret);
+        
+        
+    }
+
+void CStifExecutor::SaveSet(QString& setName)
+    {
+    TPtrC name = QString2TPtrC(setName);
+    TFileName testSetName;
+    testSetName.Copy(name);
+    TInt ret = UIStore().SaveTestSet(testSetName);
+    setName = TDesC2QString(testSetName);
+//    __LOG1(_L("SaveSet return: %d"),ret);
+    }
+
+void CStifExecutor::RemoveSet(const QString& setName)
+    {
+    //This method wil not work at this stage.
+    TPtrC name = QString2TPtrC(setName);
+    UIStore().RemoveTestSet(name);
+    }
+
+void CStifExecutor::AddtoSet(const QString& setName, CSTFCase& caseInfo)
+    {
+    //IMPORT_C TInt AddToTestSet( const TDesC& aSetName, const CTestInfo& aTestInfo );
+    TPtrC modulename = QString2TPtrC(caseInfo.ModuleName());
+    RRefArray<CTestInfo> testCases;
+    TInt ret = UIStore().TestCases(testCases, modulename, KNullDesC);
+//    __LOG1(_L("Get TestCases: %d"), ret);
+    for (TInt i = 0; i < testCases.Count(); i++)
+        {
+//        __LOG1(_L("Case Number: %d"),testCases[i].TestCaseNum());
+        if (TDesC2QString(testCases[i].TestCaseTitle()) == caseInfo.Name()
+                && testCases[i].TestCaseNum() == caseInfo.Index())
+            {
+            ret = UIStore().AddToTestSet(QString2TPtrC(setName), testCases[i]);
+//            __LOG1(_L("AddToTestSet: %d"), ret);
+            break;
+            }
+        }
+    testCases.Reset();
+    testCases.Close();
+    }
+
+void CStifExecutor::ExecuteSet(const QString& SetName, const int startIndex,
+        const TSTFCaseRunningType type)
+    {
+    CStartedTestSet::TSetType setType = CStartedTestSet::ESetSequential;
+    if (type == Parallel)
+        {
+        setType = CStartedTestSet::ESetParallel;
+        }
+    const CTestSetInfo* set = NULL;
+    TInt ret;
+    TBuf<30> test;
+    test.Append(QString2TPtrC(SetName));
+//    __LOG(_L("StartTestSet GetSetName:"));
+//    __LOG(test);
+    TRAP(ret, set = &UIStore().TestSetL(test));
+            
+    //const CTestSetInfo& set = UIStore().TestSetL(QString2TPtrC(SetName));
+    if(ret != KErrNone)
+        {
+//        __LOG1(_L("StartTestSet GetTestSet Error return=%d"),ret);
+        return;
+        }
+    int a = startIndex;
+    ret = UIStore().StartTestSet(*set, a, setType);
+//    __LOG1(_L("StartTestSet return=%d"),ret);
+    }
+
+void CStifExecutor::Update(CStartedTestCase* aCase, int flags)
+    {
+//    __LOG1(_L("CStifExecutor::Update return case=%d"),aCase);
+//    __LOG1(_L("CStifExecutor::Update return status=%d"),flags);
+    
+    if(aCase == NULL)
+        {
+        return;
+        }
+
+    if (flags & CUIStoreIf::EPrintUpdate)
+        {
+        //Cases output information update.
+        const RPointerArray<CTestProgress> printArray = aCase->PrintArray();
+        TInt rows = aCase->PrintArray().Count();
+        TPtr buffer(iBuffer->Des());
+        buffer.Zero();
+        for (int i = 0; i < rows; i++)
+            {
+            buffer.Append(_L("\r\n"));
+            buffer.Append(printArray[i]->iDescription);
+            buffer.Append(_L(" "));
+            buffer.Append(printArray[i]->iText);
+            buffer.Append(_L("\r\n"));
+            }
+        QString msg = TDesC2QString(buffer);
+//        __LOG(_L("Get output msg:"));
+//        __LOG(buffer);
+        if (listenerList)
+            {
+            for (int i = 0; i < listenerList->size(); i++)
+                {
+                listenerList->at(i)->OnGetCaseOutput(aCase, msg);
+                }
+            }
+
+        }
+    else
+        {
+        //case status changed update.
+        CSTFCase testcase;
+        testcase.SetName(TDesC2QString(aCase->TestInfo().TestCaseTitle()));
+        testcase.SetIndex(aCase->TestInfo().TestCaseNum());
+        testcase.SetModuleName(TDesC2QString(aCase->TestInfo().ModuleName()));
+        if (listenerList)
+            {
+            for (int i = 0; i < listenerList->size(); i++)
+                {
+                listenerList->at(i)->OnGetCaseUpdated(aCase, testcase, flags);
+                }
+            }
+
+        }
+
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/src/uisetting.cpp	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,114 @@
+/*
+ * 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 "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:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: QT C++ based Class.
+ *
+ */
+
+#include <QFile>
+#include <QTextStream>
+#include <QDateTime>
+#include "uisetting.h"
+const QString SETTINGFILE = "c:\\TestFramework\\StfQtUISetting.ini";
+
+UiSetting::UiSetting()
+    {
+    if(!load())
+        {
+        loadDefault();
+        }
+    }
+
+UiSetting::~UiSetting()
+    {
+    }
+
+QString UiSetting::ReadSetting(const QString& item)
+    {
+    QString value = "";
+    if(settingList.contains(item))
+        {
+        value = settingList.value(item);
+        }
+    return value;
+    }
+
+
+void UiSetting::SetSetting(const QString& item, const QString& value)
+    {
+    if(settingList.contains(item))
+        {
+        settingList.remove(item);
+        }
+    settingList.insert(item, value);
+    save();
+    }
+
+
+void UiSetting::loadDefault()
+    {
+    settingList.clear();
+    settingList.insert("showoutput", "true");
+    //add mor default setting here.
+    }
+
+
+bool UiSetting::load()
+    {
+    QFile file(SETTINGFILE);
+    if(!file.open(QIODevice::ReadOnly))
+        {
+        return false;
+        }
+    QTextStream in(&file);
+    QString line, item, value;
+    int index;
+    while(!in.atEnd())
+        {
+        line = in.readLine().trimmed().toLower();
+        if(!line.startsWith("//"))
+            {
+            index = line.indexOf("=");
+            if(index > 0 && index < line.length() - 1)
+                {
+                item = line.left(index).trimmed();
+                value = line.right(line.length() - index  -1);
+                settingList.insert(item, value);
+                }
+            }
+        //end while.
+        }
+    return true;
+    }
+
+bool UiSetting::save()
+    {
+    QFile file(SETTINGFILE);
+    if(!file.open(QIODevice::WriteOnly))
+        {
+        return false;
+        }
+    QTextStream in(&file);
+    in << "//STFQtUI Setting.\r\n";
+    in << "//Created at: " + QDateTime::currentDateTime().toString("yyyy.mm.dd hh:mm::ss");
+    in << "\r\n";
+    for(int i=0;i< settingList.size();i++)
+        {
+        in << settingList.keys()[i];
+        in << "=";
+        in << settingList.value(settingList.keys()[i]);
+        in << "\r\n";
+        }
+    return true;    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stifui/qt/stifqtui.pro	Fri May 14 15:53:02 2010 +0300
@@ -0,0 +1,66 @@
+#
+# 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 "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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: QT project file.              
+#
+
+HEADERS += inc\version.h \
+    inc\frmmain.h \
+    inc\istfqtuicontroller.h \
+    inc\stfqtuicontroller.h \
+    inc\cstfcase.h \
+    inc\cstfmodule.h \
+    inc\istfqtuimodel.h \
+    inc\stfqtuimodel.h \
+    inc\dlgoutput.h \
+    inc\uisetting.h \
+    inc\dlgsetting.h \
+   
+SOURCES += src\frmmain.cpp \
+    src\main.cpp \
+    src\stfqtuimodel.cpp \
+    src\stfqtuicontroller.cpp \
+    src\dlgoutput.cpp \
+    src\uisetting.cpp \
+    src\dlgsetting.cpp \
+    
+RESOURCES += 
+symbian { 
+    TARGET.UID3 = 0x2002BCA0
+    TARGET.EPOCALLOWDLLDATA = 1
+    //HEADERS += ../../../inc/.
+    INCLUDEPATH += /epoc32/include/mw
+    INCLUDEPATH += /epoc32/include/platform
+    INCLUDEPATH += /epoc32/include/platform/stifinternal
+    INCLUDEPATH += /epoc32/include/domain/osextensions
+    INCLUDEPATH += /epoc32/include/domain/osextensions/stif
+    HEADERS += inc\stifexecutor.h
+    SOURCES += src\stifexecutor.cpp
+    LIBS += -leuser \
+        -lefsrv \
+        -lstiftestinterface \
+        -lstiftfwif \
+        -lstiftestengine \
+        -lecons \
+        -lhal \
+        -lflogger
+    TARGET.CAPABILITY = AllFiles \
+        CommDD
+    
+    # Export headers to SDK Epoc32/include directory
+    deploy.path = $$EPOCROOT
+    exportheaders.sources = $$PUBLIC_HEADERS
+    exportheaders.path = epoc32/include
+    for(header, exportheaders.sources)
+    :BLD_INF_RULES.prj_exports += "$$header $$deploy.path$$exportheaders.path/$$basename(header)"
+}
--- a/stifui/rom/Stifui.iby	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: Stifui.iby file specifies needed STIF and STIF UI 
-* and UITetsServerstarter components for ROM image
-*
-*/
-
-#ifndef __STIF_UI_IBY__
-#define __STIF_UI_IBY__
-
-S60_APP_EXE(Stifui)
-
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(Stifui)
-#else
-  S60_APP_AIF_RSC(Stifui)
-#endif
-
-S60_APP_RESOURCE(Stifui)
-
-S60_APP_EXE(UITestServerStarter)
-
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(UITestServerStarter)
-#else
-  S60_APP_AIF_RSC(UITestServerStarter)
-#endif
-
-
-S60_APP_RESOURCE(UITestServerStarter)
-
-// Note: before creating image, copy Stifui_31_Stub.sis from \stifui\sis\ to \epoc32\data\Z\system\install\
-data=ZSYSTEM\install\Stifui_31_Stub.sis    System\Install\Stifui_31_Stub.sis
-
-#endif
-// End of File
--- a/stifui/sis/Stifui.pkg	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-;
-; 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 "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:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-; 
-; Description: Installation file for STIF UI
-;
-
-; Languages
-&EN
-
-; Package header, uid is the Stifui's uid
-#{"STIF UI"},(0x1028311D),0,1,0,TYPE=SA
-
-; Series60 product id for S60 3.0
-[0x101F7961], 0, 0, 0, {"Series60ProductID"}
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-
-   ;// Note: STIF needs to be installed before STIF UI can be used
-
-  "\epoc32\release\armv5\udeb\Stifui.exe"-"!:\Sys\Bin\Stifui.exe"
-  "\epoc32\data\z\private\10003a3f\apps\Stifui_reg.rsc"-"!:\Private\10003a3f\import\apps\Stifui_reg.rsc"
-  "\epoc32\data\z\Resource\apps\Stifui.rsc"-"!:\Resource\apps\Stifui.rsc"
-
-  "\epoc32\release\armv5\udeb\UITestServerStarter.exe"-"!:\Sys\Bin\UITestServerStarter.exe"
-  "\epoc32\data\z\private\10003a3f\apps\UITestServerStarter_reg.rsc"-"!:\Private\10003a3f\import\apps\UITestServerStarter_reg.rsc"
-  "\epoc32\data\z\Resource\apps\UITestServerStarter.rsc"-"!:\Resource\apps\UITestServerStarter.rsc"  
-
-; Embedded SIS 
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
\ No newline at end of file
Binary file stifui/sis/Stifui_31.sis has changed
Binary file stifui/sis/Stifui_31_Stub.SIS has changed
--- a/stifui/stifui/data/Stifui.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2057 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file defines StifUI resources.
-*
-*/
-
-//	RESOURCE IDENTIFIER
-NAME	STIF // 4 letter ID
-
-//	INCLUDES
-
-#include <eikon.rh>
-#include "Stifui.hrh"
-#include "Stifui_loc.hrh"
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <avkon.mbg>
-#include <avkon.hrh>
-#include <CommonDialogs.hrh> // Enumerations of memory selection, file selection, save etc dialogs
-#include <CommonDialogs.rh> // Resource structures of memory selection, file selection, save etc dialogs
-#if defined (__S60_)
-    #include <data_caging_paths_strings.hrh>
-#endif
-#include <appinfo.rh>
-
-//	CONSTANTS  
-
-
-//	MACROS	
-
-
-//	RESOURCE DEFINITIONS 
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf="STIF UI"; }
-
-RESOURCE EIK_APP_INFO
-	{
-	status_pane = r_appui_status_pane;
-	}
-
-STRUCT STRING 
-    { 
-	BUF text;
-    }
-
-
-//  RESOURCE DEFINITIONS 
-//-----------------------------------------------------------------------------
-//	 
-// r_appui_hotkeys
-// ?description
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE HOTKEYS r_appui_hotkeys
-	{
-	control=
-		{
-		HOTKEY { command=EAknCmdExit; key='e'; }
-		};
-	}
-
-
-// APPUI
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_status_pane
-//	  Applications status panel.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STATUS_PANE_APP_MODEL r_appui_status_pane
-	{
-	panes=
-		{
-		//SPANE_PANE
-		//	{
-		//	id = EEikStatusPaneUidNavi;
-		//	//type = EEikCtLabel;
-		//	//type = EAknCtTitlePane;
-		//	type = EAknCtNaviPane;
-		//	//resource = r_appui_statuspane_text;
-		//	resource = r_appui_navi_decorator;
-		//	},
-		SPANE_PANE
-			{
-			id = EEikStatusPaneUidTitle;
-			type = EAknCtTitlePane;
-			resource = r_appui_overriden_app_name;
-			}
-		//SPANE_PANE
-		//	{
-		//	id = EEikStatusPaneUidContext;
-		//	type = EAknCtContextPane;
-		//	resource = ;
-		//	}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_status_pane
-//	  Status panel text.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LABEL r_appui_statuspane_text
-    {
-    txt = "STIF UI";
-    }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_overriden_app_name
-//	  Application name.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE TITLE_PANE r_appui_overriden_app_name
-	{
-	txt = qtn_app_caption_string;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_navi_decorator
-//	  ?description
-//
-//-----------------------------------------------------------------------------
-//
-/*
-RESOURCE NAVI_DECORATOR r_appui_navi_decorator
-	{
-	type = ENaviDecoratorControlTabGroup;
-	control = TAB_GROUP
-		{
-		tab_width = EAknTabWidthWithTwoTabs;  // two tabs
-		active = 0;
-		tabs = {
-			TAB
-				{
-				id = ETestCaseMenuTab; // from application hrh
-				txt = qtn_testcase_menu_tab;
-				},
-			TAB
-				{
-				id = ETestModulesMenuTab; // from application hrh
-				txt = qtn_testmodules_menu_tab;
-				},
-			TAB
-				{
-				id = ETestSetsMenuTab; // from application hrh
-				txt = qtn_testsets_menu_tab;
-				}
-			};
-		};
-	}
-*/
-
-// MAIN MENU
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_mainmenuview
-//	  Mainmenu view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_mainmenuview
-	{
-	menubar=r_appui_menubar_mainmenuview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_mainmenuview
-//	  Main menu menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_mainmenuview
-	{
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_mainmenuview_menu;
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_mainmenuview_menu
-//	  Main menu options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_mainmenuview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command= EAknCmdOpen; 
-				txt = "Open"; 
-				},
-			MENU_ITEM
-				{
-				command = ECmdShowAbout;
-				txt = "About";
-				},
-        	MENU_ITEM 
-				{
-				command = EAknSoftkeyExit;   
-				txt = "Exit";
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_main_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LISTBOX r_main_menu_listbox
-	{
-	array_id = r_main_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_main_menu_items
-//	  Items array for Main Menu
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_main_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = qtn_mainmenulist_test_cases;
-			},
-		LBUF
-			{
-			txt = qtn_mainmenulist_modules;
-			},
-		LBUF
-			{
-			txt = qtn_mainmenulist_test_sets;
-			}
-		};
-	}
-
-
-
-// TEST CASES MENU
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testcasemenuview
-//	  Test case menu view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_testcasemenuview
-	{
-	menubar=r_appui_menubar_testcasemenuview;
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_testcasemenuview
-//	  Test case view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_testcasemenuview
-	  {
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_testcasemenuview_menu;
-				}
-		};
-
-	  }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testcasemenuview_menu
-//	  Testcase view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_testcasemenuview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command= EAknCmdOpen; 
-				txt = "Open"; 
-				},
-        	MENU_ITEM 
-				{
-				command = EAknSoftkeyExit;   
-				txt = "Exit";
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testcase_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LISTBOX r_testcase_menu_listbox
-	{
-	array_id = r_testcase_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testcase_menu_items
-//	  Items array for Test Case Menu
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_testcase_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = qtn_testcasemenu_startcase; // "\tStart Case(s)";
-			},
-		LBUF
-			{
-			txt = qtn_testcasemenu_startedcases; // "\tStarted Cases";
-			}
-		};
-	}
-
-
-
-// START CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_startcasesview
-//	  Startcases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_startcasesview
-	{
-	hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_startcasesview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_startcasesview
-//	  Startcases view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_startcasesview
-	{
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_startcasesview_menu;
-				//menu_pane=R_AVKON_MENUPANE_MARKABLE_LIST;
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_loadtestsetview_menu
-//	  loadtestset view options menu.
-//
-//-----------------------------------------------------------------------------
-RESOURCE MENU_PANE r_appui_loadtestsetview_menu
-	{
-	items= 
-		{
-		MENU_ITEM 
-			{ 
-			command=EAknCmdOpen; 
-			txt = qtn_start; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_loadtestsetview
-//	  Started cases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_loadtestsetview
-	{
-	//hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_startedcasesmenuview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_startedcasesmenuview
-//	  Started cases menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_loadtestsetview
-	  {
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_loadtestsetview_menu;
-				}
-		};
-
-	  }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_startcasesview_menu
-//	  Startcases view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_startcasesview_menu
-	{
-	items=
-		{
-		MENU_ITEM
-		    {
-		    command = ECmdFilterMenu;
-		    txt = qtn_filter_menu;
-		    cascade = r_appui_filtermenu;
-		    },
-		/*
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByModule; 
-			txt = qtn_filter_by_modules; 
-			cascade = r_appui_filterbymodules_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByTestCaseFile; 
-			txt = qtn_filter_by_test_case_file;
-			cascade = r_appui_filter_by_testcasefile_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdNOFiltering; 
-			txt = qtn_no_filtering; 
-			},
-		*/
-		MENU_ITEM 
-			{ 
-			command=ECmdMarkMenu;
-		    txt = qtn_markmenu_title; 
-		    cascade = r_appui_markunmark_menu;
-		    },
-		MENU_ITEM 
-			{ 
-			command=ECmdStartCases; 
-			txt = qtn_start_test_cases; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-
-
-
-// STARTED CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_startedcasesmenuview
-//	  Started cases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_startedcasesmenuview
-	{
-	//hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_startedcasesmenuview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_startedcasesmenuview
-//	  Started cases menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_startedcasesmenuview
-	  {
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_startedcasesmenuview_menu;
-				}
-		};
-
-	  }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_startedcasesmenuview_menu
-//	  Started cases view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_startedcasesmenuview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command= EAknCmdOpen; 
-				txt = "Open"; 
-				},
-        	MENU_ITEM 
-				{
-				command = EAknSoftkeyExit;   
-				txt = "Exit";
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_started_cases_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LISTBOX r_started_cases_menu_listbox
-	{
-	array_id = r_startedcases_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-
-
-
-//-----------------------------------------------------------------------------
-//
-//	  r_startedcases_menu_items
-//	  Items array for Test Case Menu
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_startedcases_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = qtn_startedcases_allcases;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_ongoing;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_paused;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_passed;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_failed;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_crashed_aborted;
-			},
-		LBUF
-			{
-			txt = qtn_startedcases_statistics;
-			}
-		};
-	}
-
-
-
-// SHOW STARTED CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_showstartedcasesview
-//	  Show started cases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_showstartedcasesview
-	{
-	hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_showstartedcasesview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_showstartedcasesview
-//	  Show started cases view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_showstartedcasesview
-	{
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_showstartedcasesview_menu;
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_showstartedcasesview_menu
-//	  Show started cases view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_showstartedcasesview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=ECmdViewOutput; 
-			txt = qtn_view_output; 
-			},
-		MENU_ITEM
-		    {
-		    command = ECmdFilterMenu;
-		    txt = qtn_filter_menu;
-		    cascade = r_appui_filtermenu;
-		    },
-		MENU_ITEM
-		    { 
-			command=ECmdShowSetMenu;
-			txt = qtn_testcase_control_menu;
-			cascade = r_testcase_control_submenu;
-			},
-		MENU_ITEM 
-		    { 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-			
-        /*
-		MENU_ITEM 
-				{ 
-				command=ECmdPauseTestCase; 
-				txt = qtn_pause_testcase; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdResumeTestCase; 
-				txt = qtn_resume_testcase; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdAbortTestCase; 
-				txt = qtn_abort_testcase; 
-				},
-        */
-        
-        /*
-		MENU_ITEM 
-				{ 
-				command=ECmdFilterByModule; 
-				txt = qtn_filter_by_modules; 
-				cascade = r_appui_filterbymodules_menu; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdFilterByTestCaseFile; 
-				txt = qtn_filter_by_test_case_file;
-				cascade = r_appui_filter_by_testcasefile_menu; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdNOFiltering; 
-				txt = qtn_no_filtering; 
-				},
-		*/
-		
-		/*
-		MENU_ITEM 
-				{ 
-				command=ECmdRemoveExecution; 
-				txt = qtn_remove_execution; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdRemoveAllExecutions; 
-				txt = qtn_remove_all_executions; 
-				},
-	    */
-
-		};
-	}
-
-
-// STATISTICS VIEW
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_statisticsview
-//	  Statistics view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_statisticsview
-	{
-	menubar= r_appui_menubar_statisticsview;
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_statisticsview
-//	  Statistics view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_statisticsview
-	{
-	titles=
-		{
-		MENU_TITLE 
-			{ 
-			menu_pane=r_appui_statisticsview_menu; 
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_statisticsview_menu
-//	  Statistics view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_statisticsview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByModule; 
-			txt = qtn_filter_by_modules; 
-			cascade = r_appui_filterbymodules_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByTestCaseFile; 
-			txt = qtn_filter_by_test_case_file;
-			cascade = r_appui_filter_by_testcasefile_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdNOFiltering; 
-			txt = qtn_no_filtering; 
-			},
-
-		MENU_ITEM 
-			{ 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-
-
-// TESTCASE OUTPUT VIEW
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testcaseoutputview
-//	  Testcase output view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_testcaseoutputview
-	{
-	hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_testcaseoutputview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_testcaseoutputview
-//	  Testcase output view menub bar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_testcaseoutputview
-	{
-	titles=
-		{
-		MENU_TITLE 
-			{ 
-			menu_pane=r_appui_testcaseoutputview_menu; 
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testcaseoutputview_menu
-//	  Testcase output view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_testcaseoutputview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=ECmdPauseTestCase; 
-			txt = qtn_pause_testcase; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdResumeTestCase; 
-			txt = qtn_resume_testcase; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdAbortTestCase; 
-			txt = qtn_abort_testcase; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-
-
-
-// MODULES MENU
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testmodulesmenuview
-//	  Test modules menu view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_testmodulesmenuview
-	{
-	hotkeys=r_appui_hotkeys;
-	menubar=r_appui_menubar_testmodulesmenuview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_testmodulesmenuview
-//	  Test modules view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_testmodulesmenuview
-	{
-	titles=
-		{
-		MENU_TITLE 
-			{ 
-			menu_pane=r_appui_testmodulesmenuview_menu; 
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testmodulesmenuview_menu
-//	  Testmodules view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_testmodulesmenuview_menu
-	{
-	items=
-		{
-		// MENU_ITEM 
-		//	{ 
-		//	command=ECmdOpenModule; 
-		//	txt = qtn_open_module; 
-		//	},
-		MENU_ITEM 
-			{ 
-			command=ECmdAddModule; 
-			txt = qtn_add_module; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdRemoveModule; 
-			txt = qtn_remove_module; 
-			},
-	        MENU_ITEM 
-			{ 
-			command=EAknCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	  r_testmodules_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-/*
-RESOURCE LISTBOX r_testmodules_menu_listbox
-	{
-	array_id = r_testmodules_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-*/
-
-//-----------------------------------------------------------------------------
-//	  r_testmodules_menu_items
-//	  Items array for Test Case Menu
-//
-//-----------------------------------------------------------------------------
-//
-/*
-RESOURCE ARRAY r_testmodules_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = "\tModule1";
-			},
-		LBUF
-			{
-			txt = "\tModule2";
-			}
-		};
-	}
-*/
-
-
-// TEST SET BASE
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testsetbasemenuview
-//	  Testset base menu view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_testsetbasemenuview
-	{
-	menubar=r_appui_menubar_testsetbasemenuview;
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_testsetbasemenuview
-//	  Testset base menu view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_testsetbasemenuview
-	  {
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_testsetbasemenuview_menu;
-				}
-		};
-
-	  }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testsetbasemenuview_menu
-//	  Testset base menu view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_testsetbasemenuview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command= ECmdCreateTestSet; 
-				txt = "Create test set";
-				},
-		MENU_ITEM 
-				{ 
-				command= ECmdLoadTestSet; 
-				txt = "Load test set";
-				},
-        	MENU_ITEM 
-				{
-				command = EAknSoftkeyExit;   
-				txt = "Exit";
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testsetbase_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LISTBOX r_testsetbase_menu_listbox
-	{
-	array_id = r_testsetbase_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-
-
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testsetbase_menu_items
-//	  Items array for Test Sets Base Menu
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_testsetbase_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = qtn_testsetbasemenu_createtestset;
-			},
-		LBUF
-			{
-			txt = qtn_testsetbasemenu_loadtestset;
-			}
-		};
-	}
-
-
-// TESTSET MENU
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testsetmenuview
-//	  Test set menu view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_appui_testsetmenuview
-	{
-	menubar=r_appui_menubar_testsetmenuview;
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_menubar_testsetmenuview
-//	  Test set menu view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_appui_menubar_testsetmenuview
-	  {
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_appui_testsetmenuview_menu;
-				}
-		};
-
-	  }
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_testsetmenuview_menu
-//	  Test set menu view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_testsetmenuview_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command= ECmdStartTestSet; 
-				txt = "Start testing";
-				},
-		MENU_ITEM 
-				{ 
-				command= ECmdShowStartedTestSet; 
-				txt = "View started cases";
-				},				
-		MENU_ITEM 
-				{ 
-				command= ECmdSaveTestSet; 
-				txt = "Save test set"; 
-				},
-		MENU_ITEM 
-				{ 
-				command= ECmdInsertTestCases; 
-				txt = "Insert test case(s)";
-				},
-		MENU_ITEM 
-				{ 
-				command= ECmdRemoveTestCases; 
-				txt = "Remove test case"; 
-				},
-        MENU_ITEM 
-				{
-				command = EAknSoftkeyExit;   
-				txt = "Exit";
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testset_menu_listbox
-//	  ListBox( Single )
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE LISTBOX r_testset_menu_listbox
-	{
-	array_id = r_testset_menu_items;
-	flags = EAknListBoxSelectionList;
-	}
-
-
-
-//-----------------------------------------------------------------------------
-//
-//	  r_testset_menu_items
-//	  Items array for Test Sets Menu
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_testset_menu_items
-	{
-	items =
-		{
-		LBUF
-			{
-			txt = "";
-			}			
-		};
-	}
-
-
-// TESTSET STARTED CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_test_set_startedcasesview
-//	  Test set started cases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_testset_startedcasesview
-	{
-	//hotkeys=r_appui_hotkeys;
-	menubar=r_testset_menubar_startedcasesview;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_test_set_menubar_startedcasesview
-//	  Test set started cases view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_testset_menubar_startedcasesview
-	{
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_testset_startedcasesview_menu;
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_testset_startedcasesview_menu
-//	  Test set started cases view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_testset_startedcasesview_menu
-	{
-	items=
-		{
-		MENU_ITEM
-				{
-				txt = qtn_testset_started_menu;
-				cascade = r_testset_startedcases_submenu;
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdViewOutput; 
-				txt = qtn_view_output; 
-				},
-        MENU_ITEM 
-				{ 
-				command=ECmdShowSetMenu;
-				txt = qtn_testcase_control_menu;
-				cascade = r_testcase_control_submenu;
-				},
-		MENU_ITEM 
-				{ 
-				command=EEikCmdExit; 
-				txt = qtn_exit; 
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_testset_startedcases_submenu
-//	  Test set started cases view sub menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_testset_startedcases_submenu
-	{
-	items=
-		{
-		MENU_ITEM
-				{
-				command = ECmdShowAllStartedCases;
-				txt = qtn_testset_started_allcases;
-				},
-		MENU_ITEM
-				{
-				command = ECmdShowOngoingCases;
-				txt = qtn_testset_started_ongoing;
-				},
-		MENU_ITEM
-				{
-				command = ECmdShowPausedCases;
-				txt = qtn_testset_started_paused;
-				},
-		MENU_ITEM
-				{
-				command = ECmdShowPassedCases;
-				txt = qtn_testset_started_passed;
-				},
-		MENU_ITEM
-				{
-				command = ECmdShowFailedCases;
-				txt = qtn_testset_started_failed;
-				},
-		MENU_ITEM
-				{
-				command = ECmdShowCrashedAbortedCases;
-				txt = qtn_testset_started_crashed_aborted;
-				}
-		};
-	}
-
-
-// TESTSET INSERT CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_testcases_view
-//	  Insert test cases view.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_VIEW r_insert_testcases_view
-	{
-	//hotkeys=r_appui_hotkeys;
-	menubar=r_insert_testcases_menubar;  
-	cba=R_AVKON_SOFTKEYS_OPTIONS_CANCEL;	  
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_testcases_menubar
-//	  Insert test cases view menubar.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_insert_testcases_menubar
-	{
-	titles=
-		{
-		MENU_TITLE 
-				{ 
-				menu_pane=r_insert_testcases_menu;
-				}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_testcases_menu
-//	  Insert test cases view options menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_insert_testcases_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=ECmdInsertSelectedCases;
-			txt = qtn_testsetinsert_add_selected; 
-			},
-        MENU_ITEM
-		    {
-		    command = ECmdFilterMenu;
-		    txt = qtn_filter_menu;
-		    cascade = r_appui_filtermenu;
-		    },
-		MENU_ITEM 
-			{ 
-			command=ECmdMarkMenu;
-		    txt = qtn_markmenu_title; 
-		    cascade = r_appui_markunmark_menu;
-		    },
-		MENU_ITEM 
-			{ 
-			command=EEikCmdExit; 
-			txt = qtn_exit; 
-			}
-		};
-	}
-
-
-
-// GENERAL
-// MARKMENU
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_markunmark_menu
-//	  Submenu for marking items.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_markunmark_menu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=EAknCmdMark; 
-			txt = qtn_markmenu_mark; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EAknCmdUnmark; 
-			txt = qtn_markmenu_unmark; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EAknMarkAll; 
-			txt = qtn_markmenu_markall; 
-			},
-		MENU_ITEM 
-			{ 
-			command=EAknUnmarkAll; 
-			txt = qtn_markmenu_unmarkall; 
-			}
-		};
-	}
-
-// TEST CASE CONTROL
-//-----------------------------------------------------------------------------
-//	 
-//	  r_testset_stertedcases_setmenu
-//	  Test set started cases view set menu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_testcase_control_submenu
-	{
-	items=
-		{
-		MENU_ITEM 
-				{ 
-				command=ECmdPauseTestCase; 
-				txt = qtn_pause_testcase; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdResumeTestCase; 
-				txt = qtn_resume_testcase; 
-				},
-		MENU_ITEM 
-				{ 
-				command=ECmdAbortTestCase; 
-				txt = qtn_abort_testcase; 
-				}
-		};
-	}
-
-// FILTERING			
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_filtermenu
-//	  MenuPane for Filter submenu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_filtermenu
-	{
-	items=
-		{
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByModule; 
-			txt = qtn_filter_by_modules; 
-			cascade = r_appui_filterbymodules_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdFilterByTestCaseFile; 
-			txt = qtn_filter_by_test_case_file;
-			cascade = r_appui_filter_by_testcasefile_menu; 
-			},
-		MENU_ITEM 
-			{ 
-			command=ECmdNOFiltering; 
-			txt = qtn_no_filtering; 
-			}
-	    };
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_filterbymodules_menu
-//	  MenuPane for Filter submenu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_filterbymodules_menu
-	{
-	items=
-		{
-		// items (modules) are added dynamically when
-		// Filter by module submenu is opened
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_appui_filter_by_testcasefile_menu
-//	  MenuPane for Filter submenu.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_appui_filter_by_testcasefile_menu
-	{
-	items=
-		{
-		// Items (testcase files are added dynamically when
-		// Filter by testcase file menu is opened
-		};
-	}
-
-
-// DIALOGS
-// START TEST CASES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_start_testcase_list_query
-//	  Query dialog for starting single test case.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_LIST_QUERY r_start_testcase_list_query
-	{
-	flags = EGeneralQueryFlags;
-	softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
-	items = 
-		{
-		DLG_LINE   //AVKON_LIST_QUERY_DLG_LINE
-			{
-			type = EAknCtListQueryControl;
-			id = EListQueryControl;
-			control = AVKON_LIST_QUERY_CONTROL
-				{
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = LISTBOX		//AVKON_LIST_QUERY_LIST
-					{
-					flags = EAknListBoxMenuList;
-					height = 3;
-					width = 3;
-					array_id = r_start_testcase_listbox_item_array;
-					};
-				heading = qtn_starting_test_case;
-				};
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_start_testcase_listbox_item_array
-//	  Listbox items in query dialog for starting single test case.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_start_testcase_listbox_item_array
-	{
-	items =
-		{
-		LBUF { txt = qtn_start_test; },
-		LBUF { txt = qtn_start_test_output; }
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_start_multiple_testcases_list_query
-//	  Query dialog for starting multiple test cases.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE AVKON_LIST_QUERY r_start_multiple_testcases_list_query
-	{
-	flags = EGeneralQueryFlags;
-	softkeys = R_AVKON_SOFTKEYS_OK_CANCEL;
-	items = 
-		{
-		DLG_LINE   //AVKON_LIST_QUERY_DLG_LINE
-			{
-			type = EAknCtListQueryControl;
-			id = EListQueryControl;
-			control = AVKON_LIST_QUERY_CONTROL
-				{
-				listtype = EAknCtSinglePopupMenuListBox;
-				listbox = LISTBOX		//AVKON_LIST_QUERY_LIST
-					{
-					flags = EAknListBoxMenuList;
-					height = 3;
-					width = 3;
-					array_id = r_start_multiple_testcases_listbox_item_array;
-					};
-				heading = qtn_starting_test_cases;
-				};
-			}
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_start_multiple_testcases_listbox_item_array
-//	  Listbox items in query dialog for starting single test case.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE ARRAY r_start_multiple_testcases_listbox_item_array
-	{
-	items =
-		{
-		LBUF { txt = qtn_start_tests_parallel; },
-		LBUF { txt = qtn_start_tests_serial; }
-		};
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_general_confirmation_dialog
-//	  General confirmation dialog with empty label.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_general_confirmation_dialog
-	{
-	flags = EGeneralQueryFlags;
-	buttons = R_AVKON_SOFTKEYS_YES_NO;
-	items = 
-		{
-		DLG_LINE
-			{
-			type = EAknCtQuery;
-			id = EGeneralQuery;
-			control = AVKON_CONFIRMATION_QUERY
-				{
-				layout = EConfirmationQueryLayout;
-        		label = "";
-				};
-			}
-		};
-
-	} 
-
-//-----------------------------------------------------------------------------
-//	 
-//    r_stifui_about_dialog
-//	  "About" dialog
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE DIALOG r_stifui_about_dialog
-{
-    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
-    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
-    items=
-    {
-        DLG_LINE
-        {
-            type = EAknCtPopupHeadingPane;
-            id = EAknMessageQueryHeaderId;
-            control = AVKON_HEADING
-            {
-                label = "About STIF";
-                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
-            };
-        },
-        DLG_LINE
-        {
-            type = EAknCtMessageQuery;
-            id = EAknMessageQueryContentId;
-            control = AVKON_MESSAGE_QUERY
-            {
-                
-            };
-        }
-    };
-}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_memory_selection_dialog
-//	  Selection dialog for selectiong either C or E drive.
-//        Not yet used.
-//
-//-----------------------------------------------------------------------------
-//
-/*
-RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog
-	{
-	title = "Choose memory:";
-	softkey_1 = "Ok";
-	softkey_2 = "Cancel";
-	locations = 
-		{
-		LOCATION { root_path = "C:\\"; },
-		LOCATION { root_path = "E:\\";  //default_folder = "TestFramework\\";
-                 }
-		};
-	}
-*/
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_file_selection_dialog
-//	  Fileselection dialog.
-//        Not yet used.
-//
-//-----------------------------------------------------------------------------
-//
-/*
-RESOURCE FILESELECTIONDIALOG r_file_selection_dialog
-	{
-	title = "Select-a-file:";
-	root_path = "C:\\";
-	filters =
-		{
-		FILTER
-			{
-			filter_type = EAttributeFilter; //EAttributeFilter;
-			filter_style = EExclusiveFilter; //EExclusiveFilter;
-			filter_data = 
-				{
-				"SH",
-				"R"
-				}; // Excludes system, hidden and read-only attributes
-			}
-		};
-	}
-*/
-    
-
-// APPLICATION NAVIPANEL TITLES
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_main
-//	  Main menu title.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE NAVI_LABEL r_navititle_main
-	{
-	txt = qtn_navi_main;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_testcases
-//	  Test cases menu title.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE NAVI_LABEL r_navititle_testcases
-	{
-	txt = qtn_navi_testcases;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_startcases
-//	  Startcases menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_startcases
-	{
-	txt = qtn_navi_startcases;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_loadtestset
-//	  Startcases menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_loadtestset
-	{
-	txt = qtn_navi_load_test_set;
-	}
-
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_startedcases
-//	  Started cases menu title.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE NAVI_LABEL r_navititle_startedcases
-	{
-	txt = qtn_navi_startedcases;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_testcase_output
-//	  Test case output view title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_testcase_output
-	{
-	txt = qtn_navi_testcase_output;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_modules
-//	  Modules menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_modules
-	{
-	txt = qtn_navi_modules;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_testset_base
-//	  Testset base menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_testset_base
-	{
-	txt = qtn_navi_testset_base;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_testset
-//	  Testset menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_testset
-	{
-	txt = qtn_navi_testset;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_testset_insert
-//	  Testset insert menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_testset_insert
-	{
-	txt = qtn_navi_testset_insert;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started
-//	  Started cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE NAVI_LABEL r_navititle_started
-	{
-	txt = qtn_navi_started;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_all
-//	  All started cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_all
-	{
-	txt = qtn_navi_started_all;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_ongoing
-//	  Ongoing cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_ongoing
-	{
-	txt = qtn_navi_started_ongoing;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_paused
-//	  Paused cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_paused
-	{
-	txt = qtn_navi_started_paused;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_passed
-//	  Passed cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_passed
-	{
-	txt = qtn_navi_started_passed;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_failed
-//	  Failed cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_failed
-	{
-	txt = qtn_navi_started_failed;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_crashed_aborted
-//	  Crashed cases view menu title.
-//
-//-----------------------------------------------------------------------------
-//	
-RESOURCE NAVI_LABEL r_navititle_started_crashed_aborted
-	{
-	txt = qtn_navi_started_crashed_aborted;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_navititle_started_stats
-//	  Statistics view menu title.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE NAVI_LABEL r_navititle_started_stats
-	{
-	txt = qtn_navi_started_stats;
-	}
-
-
-// RESOURCE TEXTS
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_confirmation_question
-//	  Insert test cases confirmation query text.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STRING r_insert_confirmation_question
-	{
-	text = qtn_insert_confirmation;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_nocases_text
-//	  Infomsg text to inform user that there´s no test cases selected when 
-//    trying to insert test cases.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STRING r_insert_nocases_text
-	{
-	text = qtn_insert_none_selected;
-	}
-	
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_confirmation_question
-//	  Overwrite existing test set confirmation query text.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STRING r_overwrite_testset_question
-	{
-	text = qtn_owerwrite_testset_confirmation;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_confirmation_question
-//	  Save test set confirmation query text.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STRING r_save_testset_question
-	{
-	text = qtn_save_testset_confirmation;
-	}
-
-//-----------------------------------------------------------------------------
-//	 
-//	  r_insert_confirmation_question
-//	  Loading test set failed text.
-//
-//-----------------------------------------------------------------------------
-//
-RESOURCE STRING r_load_testset_failed
-	{
-	text = qtn_load_testset_errornote;
-	}
-
-	
-// TEST CASE STATES
-RESOURCE STRING r_testcase_state_running
-	{
-	text = qtn_testcase_state_running;
-	}
-
-RESOURCE STRING r_testcase_state_passed
-	{
-	text = qtn_testcase_state_passed;
-	}
-
-RESOURCE STRING r_testcase_state_failed
-	{
-	text = qtn_testcase_state_failed;
-	}
-
-RESOURCE STRING r_testcase_state_crashed_aborted
-	{
-	text = qtn_testcase_state_crashed_aborted;
-	}
-	
-RESOURCE STRING r_testcase_state_unknown
-	{
-	text = qtn_testcase_state_unknown;
-	}
-
-RESOURCE LOCALISABLE_APP_INFO r_stifui_localisable_app_info
-    {
-    short_caption = qtn_app_short_caption_string;
-    caption_and_icon = 
-    CAPTION_AND_ICON_INFO
-        {
-        caption = qtn_app_caption_string;
-        };
-    }	
-			
-// End of File
--- a/stifui/stifui/data/Stifui_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file defines StifUI resources.
-*
-*/
-
-#include <Stifui.rsg>
-#include <appinfo.rh>
-#if defined (__S60_)
-  #include <data_caging_paths_strings.hrh>
-#endif
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x1028311D
-
-RESOURCE APP_REGISTRATION_INFO
-    {
-    app_file = "Stifui";
-    localisable_resource_file = APP_RESOURCE_DIR"\\Stifui";
-    localisable_resource_id = R_STIFUI_LOCALISABLE_APP_INFO;
-    group_name = "RnD Tools";
-    }
-
-// End of File
-
-
--- a/stifui/stifui/group/Stifui.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: STIFUI MMP file.
-*
-*/
-
-#include <platform_paths.hrh>
-
-SMPSAFE
-
-TARGET 			Stifui.exe
-TARGETTYPE 		exe
-UID             0x100039ce 0x1028311D 
-VENDORID	    0x101FB657
-SECUREID        0x102073DC
-CAPABILITY      AllFiles SwEvent CommDD
-
-START RESOURCE  ../data/Stifui.rss
-	HEADER
-	TARGETPATH  resource/apps
-END 
-
-SOURCEPATH      ../data
-START RESOURCE  ./Stifui_reg.rss
-	DEPENDS stifui.rsg
-	TARGETPATH  /private/10003a3f/apps
-END
-
-SOURCEPATH ../src
-
-
-SOURCE  AppUIApp.cpp 
-SOURCE  AppUIAppUi.cpp
-SOURCE  AppUIDocument.cpp
-SOURCE  View.cpp
-SOURCE  Container.cpp
-SOURCE  UIStoreHandler.cpp
-
-SOURCE  MainMenuView.cpp
-SOURCE  MainMenuContainer.cpp
-
-SOURCE  TestCaseMenuView.cpp
-SOURCE  TestCaseMenuContainer.cpp
-
-SOURCE  StartCasesView.cpp
-SOURCE  StartCasesContainer.cpp
-
-SOURCE  StartedCasesMenuView.cpp
-SOURCE  StartedCasesMenuContainer.cpp
-
-SOURCE  ShowStartedCasesView.cpp
-SOURCE  ShowStartedCasesContainer.cpp
-
-SOURCE  TestCaseOutputView.cpp
-SOURCE  TestCaseOutputContainer.cpp
-
-SOURCE  Testmodulesmenuview.cpp
-SOURCE  TestModulesMenuContainer.cpp
-
-SOURCE	StatisticsView.cpp
-SOURCE	StatisticsContainer.cpp
-
-SOURCE  TestSetBaseMenuView.cpp
-SOURCE  TestSetBaseMenuContainer.cpp
-
-SOURCE  TestSetMenuView.cpp
-SOURCE  TestSetMenuContainer.cpp
-
-SOURCE  TestSetInsertMenuView.cpp
-SOURCE  TestSetInsertMenuContainer.cpp
-
-SOURCE  TestSetStartedCasesView.cpp
-SOURCE  TestSetStartedCasesContainer.cpp
-
-//SOURCE  MenuListBox.cpp
-
-SOURCE  MenuListBox.cpp CreatedTestSetMenuContainer.cpp CreatedTestSetMenuView.cpp
-
-USERINCLUDE ../inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY apparc.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib 
-
-LIBRARY eikcoctl.lib
-LIBRARY avkon.lib
-
-LIBRARY stiftestengine.lib
-LIBRARY stiftestinterface.lib
-LIBRARY bafl.lib
-LIBRARY eikctl.lib 		// For adding icons
-LIBRARY StifTFwIf.lib 
-LIBRARY efsrv.lib
-
-LIBRARY egul.lib
-LIBRARY aknskins.lib
-LIBRARY aknicon.lib
-
-START WINS      
-// ?wins_specific_information
-END
-
-START MARM
-// ?marm_specific_information
-END
- 
-EPOCHEAPSIZE    0x10000 0x500000
-EPOCSTACKSIZE   32768
-// End of file
--- a/stifui/stifui/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: bld.inf build information for STIF UI.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-// Specify the platforms your component needs to be built for here.
-// ARM4 not supported in SDK
-	
-	DEFAULT
-
-
-PRJ_EXPORTS
-// None
-
-PRJ_TESTEXPORTS
-// None
-
-PRJ_MMPFILES
-	
-	Stifui.mmp
-
-PRJ_TESTMMPFILES
-// None
-
-// End of file
--- a/stifui/stifui/inc/AppUIApp.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CAppUIApp class declaration.
-*
-*/
-
-#ifndef APPUIAPP_H
-#define APPUIAPP_H
-
-// INCLUDES
-#include <aknapp.h>
-
-// CONSTANTS
-// UID of the application
-const TUid KUidAppUI = { 0x1028311D };
-
-// CLASS DECLARATION
-
-/**
-* CAppUIApp application class.
-* Provides factory to create concrete document object.
-* 
-*/
-class CAppUIApp : public CAknApplication
-    {
-    
-    public: // Functions from base classes
-    private:
-
-        /**
-        * From CApaApplication, creates CAppUIDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-        
-        /**
-        * From CApaApplication, returns application's UID (KUidAppUI).
-        * @return The value of KUidAppUI.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-// End of File
-
-// End of File
--- a/stifui/stifui/inc/AppUIAppUi.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CAppUIAppUi class declaration.
-*
-*/
-
-#ifndef APPUIAPPUI_H
-#define APPUIAPPUI_H
-
-// INCLUDES
-#include <eikapp.h>
-#include <e32std.h>
-#include <aknViewAppUi.h>
-#include <akntabgrp.h>
-#include <aknnavide.h>
-#include <StifLogger.h>
-#include "Stifui.hrh"
-
-//#include "UIStoreIf.h"             
-//#include "UIStore.h"               
-//#include "UIEngine.h"              
-//#include "SettingServerClient.h"   
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <SettingServerClient.h>
-
-#include "UIStoreHandler.h"
-
-
-// FORWARD DECLARATIONS
-class CAppUIContainer;
-class CUIStoreHandler;
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-_LIT( KDefaultPathAndIni, "C:\\TestFramework\\TestFramework.ini" );
-
-// CLASS DECLARATION
-
-
-/**
- * Class contains static methods for calling different
- * types of message dialog boxes.
- */
-class TMessageBoxUtil 
-	{
-	public:
-	
-	    /**
-	     * Display message that executed funtion is not implemented yet.
-	     */      
-		static void ShowNotImplementedYetL();
-
-	    /**
-	     * Display error note.
-	     * @param aMessage Error message to display.
-	     */      
-		static void ShowErrorNoteL( const TDesC& aMessage );
-	};
-
-
-/**
-* Application UI class.
-* Provides support for the following features:
-* - EIKON control architecture
-* - view architecture
-* - status pane
-* 
-*/
-class CAppUIAppUi : public CAknViewAppUi
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */      
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */      
-        ~CAppUIAppUi();
-
-    public: // New functions
-
-        /**
-        * Returns pointer to UIStoreHandler object, 
-        * which handles test cases and test modules.
-        * @return UIStoreHandler to CData object
-        */
-        CUIStore* UIStoreHandler();
-
-        /**
-        * Shows outputs of the test case.
-        * @param aTestCase Pointer to started test case.
-        */
-        void ShowTestCaseOutput(CStartedTestCase* aTestCase);
-
-        /**
-        * Receives output update notification from CData.
-        * @param aTestCase Pointer to started test case.
-        * @param aStatus Status.
-        */
-        void OutputUpdateL( CStartedTestCase* aTestCase, TInt aStatus );
-        
-		/**
-        * Sets pointer to selected test case for viewing output.
-        * @param aStartedCase Pointer to started test case.
-        */
-        void SetStartedTestCase( CStartedTestCase* aStartedCase );   
-         
-        /**
-        * Returns pointer to started test case for viewing output.
-        * @return Poiner to started test case.
-        */
-		CStartedTestCase* GetStartedTestCase( ); 
-		
-		/**
-		 * Saves position of focus of any specific view
-		 * @param aViewId ID of view under which the position will be stored
-		 * @param aPosition is a number to be stored
-		 */
-		void SaveFocusPosition(TAppUIViewNumber aViewId, TInt aPosition);
-		
-		/**
-		 * Used to retrieve previous focus position in a specific view
-		 * @param aViewId - ID of view that the position should be retrieved for
-		 * @return the previous focus position
-		 */
-		TInt GetFocusPosition(TAppUIViewNumber aViewId);
-		
-
-    public: // Functions from base classes
-
-    private:
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-    private:
-        /**
-        * From CEikAppUi, takes care of command handling.
-        * @param aCommand command to be handled
-        */
-        void HandleCommandL(TInt aCommand);
-
-        /**
-        * From CEikAppUi, handles key events.
-        * @param aKeyEvent Event to handled.
-        * @param aType Type of the key event. 
-        * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). 
-        */
-        virtual TKeyResponse HandleKeyEventL(
-            const TKeyEvent& aKeyEvent,TEventCode aType);
-
-    private: //Data
-        CUIStoreHandler*                iUIStoreHandler;
-        CStartedTestCase*               iStartedTestCase;
-        TInt                            iPreviousView; // For Back function
-        
-        RArray<TInt>					iPreviousFocusPosition;	
-        // used to store positions in different views
-        
-        TBool							iPreviousPositionListValid; 
-        // used to mark validity of iPreviousFocusPosition array
-		
-    public: //Data
-        
-        /**
-        * Pointer to logger.
-        */
-        CStifLogger*                        iLogger;
-        
-        /**
-        * Mode of view started cases.
-        */
-        TInt /*enum TShowStartedCasesMode*/ iShowStartedCasesMode;
-        
-        /**
-        * Index of started test set.
-        */
-		TInt								iStartedTestSet;
-		
-	    /**
-        * Handle to Setting server.
-        */	
-		RSettingServer                      iSettingServer;
-		
-    public:     // Friend classes
-
-    protected:  // Friend classes
-
-    private:    // Friend classes
-                
-        // For iExecutedTestCaseCount moving
-        friend class CStartCasesView;
-        friend class CStatisticsView;
-        friend class CTestCaseOutputView;
-        friend class CTestSetInsertMenuView;
-        friend class CTestSetMenuView;
-
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/AppUIDocument.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CAppUIDocument class declaration.
-*
-*/
-
-#ifndef APPUIDOCUMENT_H
-#define APPUIDOCUMENT_H
-
-// INCLUDES
-#include <AknDoc.h>
-   
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class  CEikAppUi;
-
-// CLASS DECLARATION
-
-/**
-*  CAppUIDocument application class.
-*/
-class CAppUIDocument : public CAknDocument
-    {
-    public: // Constructors and destructor
-        /**
-        * Two-phased constructor.
-        */
-        static CAppUIDocument* NewL(CEikApplication& aApp);
-
-        /**
-        * Destructor.
-        */
-        virtual ~CAppUIDocument();
-
-    public: // New functions
-
-    protected:  // New functions
-
-    protected:  // Functions from base classes
-
-    private:
-
-        /**
-        * Symbian OS default constructor.
-        */
-        CAppUIDocument(CEikApplication& aApp);
-        void ConstructL();
-
-    private:
-
-        /**
-        * From CEikDocument, create CAppUIAppUi "App UI" object.
-        */
-        CEikAppUi* CreateAppUiL();
-    };
-
-#endif
-
-// End of File
-
-// End of File
--- a/stifui/stifui/inc/Container.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseListBoxModel class
-* declaration
-*
-*/
-
-#ifndef CCONTAINER_H
-#define CCONTAINER_H
-
-#include <e32std.h>
-// Define *.mbm file name.
-_LIT(KListMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
-
-// INCLUDES
-#include "View.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h>     //  MEikListBoxObserver
-#include <bamdesca.h>   //  MDesCArray
-#include <aknsfld.h>
-
-//#include "RRefArray.h"        
-//#include "UIEngine.h"         
-//#include "UIStoreIf.h"        
-//#include "UIStoreContainer.h" 
-
-#include <stifinternal/RRefArray.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStoreContainer.h>
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-//class CTestSetInsertMenuView;
-class CEikColumnListBox;
-class CStartedTestCase;
-
-class CUIStoreHandler;
-class CUIStore;
-class CUIStoreIf;
-class CUIEngineContainer;
-class CUIEngine;
-
-// CLASS DECLARATION
-
-class CTestCaseListBoxModel : public CBase, public MDesCArray
-    {
-    public:
-        /**
-        * Destructor.
-        */
-        ~CTestCaseListBoxModel();
-        
-        /**
-        * Two-phased constructor.
-        * @param aTestCasesInView Array of test cases in view.
-        * @return Pointer to created list box model.
-        */
-        static CTestCaseListBoxModel* NewL(
-            RPointerArray<CTestInfo>* aTestCasesInView);
-
-    public: // Functions from base classes
-    
-        /**
-        * Returns the number of descriptor elements in the array.
-        * @return The number of descriptor elements.
-        */
-        virtual TInt MdcaCount() const;
-        
-        /**
-        * Indexes into a descriptor array.
-        * @param aIndex The position of the descriptor element within the
-        *               array. The position is relative to zero; i.e. zero
-        *               implies the first descriptor element in the array. 
-        *               This value must be non-negative and less than the 
-        *               number of descriptors currently within the array 
-        *               otherwise the operator panics with 
-        *               EArrayIndexOutOfRange. 
-        * @return A non-modifiable pointer descriptor representing the 
-        *         descriptor element located at position aIndex within 
-        *         the array.
-        */
-        virtual TPtrC MdcaPoint(TInt aIndex) const;
-
-    protected:
-        /**
-        * Symbian OS two phased constructor.
-        * Completes the construction of the object.
-        */
-        void ConstructL();
-    
-    protected: //data
-        RPointerArray<CTestInfo>*   iTestCasesInView;
-        HBufC*                      iBuffer;
-        
-    private: //data
-        
-    };
-    
-/**
-*  CContainer  container control class.
-*  
-*/
-class CContainer : public CCoeControl
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CContainer();
-
-    public: // New functions
-    
-        /**
-        * Show only testcases which are defined is specified module.
-        * @param aModuleName Module which test cases are shown.
-        */
-        virtual void FilterCasesByModuleL(TName aModuleName);
-        
-        /**
-        * Show only testcases which are defined in specified test case file.
-        * @param aTestCaseFileName Test cases file name.
-        */
-        virtual void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
-        
-        /**
-        * Remove possible filtering of test cases -> show all test cases.
-        */
-        virtual void NoFilteringL();
-        
-        /**
-        * Returns pointers to selected test cases.
-        * @param aSelectedTestCases Currently selected test case.
-        */
-        virtual void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases);
-
-        /**
-        * Sets graphic icon using listbox as CEikColumnListBox.
-        * @param aListBox Pointer to list box.
-        */
-        virtual void SetGraphicIconL( CEikColumnListBox* aListBox );
-
-        /**
-        * Appends graphics data.
-        * @param aIcons Pointer array of icons.
-        */
-        virtual void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );
-        
-        /**
-        * Gets the index number of the current item in the view.
-        * @return Index number of the current item.
-        */
-        virtual TInt CurrentItemIndex();
-        
-        /**
-        * Sets the current item.
-        * @param aIndex Index of the item to make current.
-        */
-        virtual void SetCurrentItemIndex(TInt aCurrentTestCase);
-		
-		/**
-		* Inline function for getting pointer to list box.
-		* @return Pointer to list box.
-		*/
-		virtual inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; };
-		
-		
-		
-		/**
-		* Processes user commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		virtual void ProcessCommandL( TInt  aCommand );
-		
-		/**
-		* Processes user commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		virtual void SelectionListProcessCommandL( TInt  aCommand );
-		
-		/**
-		* Handles mark commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		virtual void HandleMarkCommandL( TInt aCommand );
-		
-		
-		
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        virtual void SizeChanged();
-
-
-
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        virtual TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        virtual CCoeControl* ComponentControl(TInt aIndex) const;
-
-
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        virtual void Draw(const TRect& aRect) const;
-        
-    protected: //data
-        
-        CView*                          iParentView;
-        CEikColumnListBox*              iListBox;
-        //CEikTextListBox*                iListBox;
-        CTestCaseListBoxModel*          iListBoxModel;
-        RPointerArray<CTestInfo>        iTestCasesInView;
-        CUIStore*                       iUIStore;
-                        
-    private: //data
-        
-    };
-
-#endif // CTestSetInsertMenuContainer_H
-
-// End of File
--- a/stifui/stifui/inc/CreatedTestSetMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CCreatedTestSetMenuContainer
-* class declaration.
-*
-*/
-
-#ifndef CREATETESTSETMENUCONTAINER_H
-#define CREATETESTSETMENUCONTAINER_H
-
-// INCLUDES
-#include "Container.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h> // MEikListBoxObserver
-#include <bamdesca.h> // MDesCArray
-#include <aknsfld.h>
-
-#include <stifinternal/RRefArray.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStoreContainer.h>
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-class CCreatedTestSetMenuView;
-class CEikColumnListBox;
-class CStartedTestCase;
-
-class CUIStoreHandler;
-class CUIStore;
-class CUIStoreIf;
-class CUIEngineContainer;
-class CUIEngine;
-
-// CLASS DECLARATION
-/**
-*  CCreatedTestSetMenuContainer  container control class.
-*  
-*/
-class CCreatedTestSetMenuContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CCreatedTestSetMenuContainer();
-
-    public: // New functions
-        
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-        
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-        
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		        
-    private: //data
-        
-        CCreatedTestSetMenuView*            iParentView;
-    };
-
-#endif // CREATETESTSETMENUCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/CreatedTestSetMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CCreatedTestSetMenuView class
-* declaration.
-*
-*/
-
-#ifndef CREATEDTESTSETSETMENUVIEW_H
-#define CREATEDTESTSETSETMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CCreatedTestSetMenuContainer;
-
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuView view class.
-* 
-*/
-class CCreatedTestSetMenuView : public CView, public MEikListBoxObserver //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CCreatedTestSetMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box.
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-    public: // New functions
-        
-     
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    
-    private: // New functions
-        
-        /**
-        * Checks listbox selections and launches 
-        * query dialog to start test cases.
-        * @param aListBox Pointer to listbox.
-        */
-        void CheckListBoxSelectionsL(CEikListBox* aListBox);
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CCreatedTestSetMenuContainer*       iContainer;
-        TInt                        iCurrentTestCase;
-        TBufC<50>                   iCurrentTestSet;
-        TBool                       iSaveNeeded;
-    };
-
-#endif //CREATEDTESTSETSETMENUVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/MainMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMainMenuContainer class definition.
-*
-*/
-
-#ifndef CMAINMENUCONTAINER_H
-#define CMAINMENUCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-
-// CLASS DECLARATION
-
-/**
-*  CMainMenuContainer  container control class.
-*  
-*/
-class CMainMenuContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect);
-
-        /**
-        * Destructor.
-        */
-        ~CMainMenuContainer();
-
-    public: // New functions
-    
-        /**
-        * Get currently selected items index.
-        * @return Current item index.
-        */		
-		TInt GetActiveLine();   
-		
-		/**
-		 * Makes the iListBox store its focus position to CAppUiAppUi object
-		 */
-		void SaveActiveLine();
-
-    public: // Functions from base classes
-   
-        /**
-        * Method HandleSelectedListItemL handles valix index.
-        * @param aIndex Current item index.
-        */
-        void HandleSelectedListItemL( TInt aIndex );    
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * @return Number of controls indside this container.
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets the specified component of a compound control.
-        * @param aIndex The index of the control to get.
-        * @return The component control with an index of aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates 
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * Handles list box events.
-        * @param aListBox The originating list box. 
-        * @param aEventType A code for the event. Further information may be
-        *                   obtained by accessing the list box itself.
-        */
-		void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		
-        
-    private: //data
-        
-		CEikTextListBox*    iListBox;
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/MainMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMainMenuView class declaration.
-*
-*/
-
-#ifndef MAINMENUVIEW_H
-#define MAINMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <aknnavide.h> 
-
-// CONSTANTS
-// UID of view
-const TUid KMainMenuViewId = {1};
-
-// FORWARD DECLARATIONS
-class CMainMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CMainMenuView view class.
-* 
-*/
-class CMainMenuView : public CView //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CMainMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-    private:
-        
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CMainMenuContainer*         iContainer;
-        CAknNavigationDecorator*    iNaviDecorator;
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/MenuListBox.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMenuListBox class declaration.
-*
-*/
-
-#ifndef MENULISTBOX_H_
-#define MENULISTBOX_H_
-
-// INCLUDES
-#include <eiktxlbx.h>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-#include <aknview.h>
-#include <aknlists.h>
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
-*  CMenuListBox class. Has ability to store and retrieve previous focus position
-*/
-class CMenuListBox : public CAknSingleStyleListBox
-    {
-    public: // Constructors and destructor
-
-        static CMenuListBox* NewL(TAppUIViewNumber aViewId);
-        
-        /**
-        * Destructor.
-        */
-        virtual ~CMenuListBox();
-        
-        /**
-         * Sets focus on last chosen position
-         */
-        void SetPreviousFocus();
-        
-        /**
-         * Saves position of focus to CAppUiAppUi object
-         */
-        void SaveFocusPosition();
-        
-    private: // Constructors and destructor
-    
-    	CMenuListBox(TAppUIViewNumber aViewId);
-    	
-    	/**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-    public: // Functions from base classes
-
-    private:
-
-    private: // Data
-    	const TAppUIViewNumber	iViewId;
-    };
-
-#endif /*MENULISTBOX_H_*/
--- a/stifui/stifui/inc/ShowStartedCasesContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedTestsListBoxModel class
-* declaration.
-*
-*/
-
-#ifndef CSHOWSTARTEDCASESCONTAINER_H
-#define CSHOWSTARTEDCASESCONTAINER_H
-
-// INCLUDES
-#include "Container.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h>
-#include <bamdesca.h> // MDesCArray
-
-//#include "RRefArray.h" 
-#include <stifinternal/RRefArray.h>
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CAknSingleGraphicStyleListBox;
-class CDesC16ArrayFlat;
-class CStartedTestCase;
-class CUIStore;
-
-// CLASS DECLARATION
-
-class CStartedTestsListBoxModel : public CTestCaseListBoxModel //public CBase, public MDesCArray
-    {
-    public:
-        /**
-        * Destructor.
-        */
-        ~CStartedTestsListBoxModel();
-        
-        /**
-        * Two-phased constructor.
-        * @param aTestsInView Array of test cases in view.
-        * @return Pointer to created list box model.
-        */
-        static CStartedTestsListBoxModel* NewL(
-                            RRefArray<CStartedTestCase>* aTestsInView);
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns the number of descriptor elements in the array.
-        * @return The number of descriptor elements.
-        */
-        TInt MdcaCount() const;
-        
-        /**
-        * Indexes into a descriptor array.
-        * @param aIndex The position of the descriptor element within the
-        *               array. The position is relative to zero; i.e. zero
-        *               implies the first descriptor element in the array. 
-        *               This value must be non-negative and less than the 
-        *               number of descriptors currently within the array 
-        *               otherwise the operator panics with 
-        *               EArrayIndexOutOfRange. 
-        * @return A non-modifiable pointer descriptor representing the 
-        *         descriptor element located at position aIndex within 
-        *         the array.
-        */
-        TPtrC MdcaPoint(TInt aIndex) const;
-
-    private:
-
-        /**
-        * Symbian OS two phased constructor.
-        * Completes the construction of the object.
-        */
-        void ConstructL();
-
-    private: //data
-        RRefArray<CStartedTestCase>*        iTestCasesInView;
-    };
-
-/**
-*  CShowStartedCasesContainer  container control class.
-*  
-*/
-class CShowStartedCasesContainer : public CContainer //public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        * @return Observer for list box.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CShowStartedCasesContainer();
-
-    public: // New functions
-        
-        /**
-        * Show only testcases which are defined is specified module.
-        * @param aModuleName Module which test cases are shown.
-        */
-        void FilterCasesByModuleL(TName aModuleName);
-        
-        /**
-        * Show only testcases which are defined in specified test case file.
-        * @param aTestCaseFileName Test cases file name.
-        */
-        void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
-        
-        /**
-        * Remove possible filtering of test cases -> show all test cases.
-        */
-        void NoFilteringL();
-        
-        /**
-        * Returns reference to currently selected test case in view (listbox).
-        * @return Currently selected test case.
-        */
-        CStartedTestCase* SelectedTestCase();
-        
-        /**
-        * Constructs list box model without any filtering.
-        */
-        void ConstructListBoxModelL();
-        
-        /**
-        * Draws the list box.
-        */
-        void DrawListBox();
-        
-        /**
-        * Returns count of test cases in view.
-        * @return Count of test cases in view.
-        */
-        TInt TestsInViewCount();
-        
-        /**
-        * Handles the addition of an item to the model.
-        */
-        void HandleItemAdditionL();
-        
-        /**
-        * Handles the removal of an item from the model.
-        */
-        void HandleItemRemovalL();
-        
-        /**
-        * Returns pointer to currently selected test case.
-        * @param Current test case.
-        */
-        CStartedTestCase* CurrentTestCase();
-        
-        /**
-        * Sets the current item.
-        * @param aIndex Index of the item to make current.
-        */
-        void SetCurrentItemIndex(TInt aIndex);
-        
-        /**
-        * Resets the selection indices, top and current item indices,
-        * the selection, and the horizontal scroll offset of this list box.
-        * This function does not redraw the list box.
-        */
-        void ResetListBox();
-        
-        /**
-        * Removes items from list box.
-        */
-        void RemoveSelectedExecutionsL();
-        
-        /**
-        * Removes all started test cases from list box.
-        */
-        void RemoveAllExecutionsInViewL();
-        
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-
-    private: // New functions
-
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-	
-    private: //data
-        
-        CStartedTestsListBoxModel*  iListBoxModel;    
-        RRefArray<CStartedTestCase> iStartedTestsPtrs;
-    };
-
-#endif // CSHOWSTARTEDCASESCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/ShowStartedCasesView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CShowStartedCasesView class 
-* declaration.
-*
-*/
-
-#ifndef SHOWSTARTEDCASESVIEW_H
-#define SHOWSTARTEDCASESVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h>     // MEikListBoxObserver
-#include <aknnavide.h>  //CAknNavigationDecorator
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CShowStartedCasesContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CShowStartedCasesView view class.
-* 
-*/
-class CShowStartedCasesView : public CView, public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CShowStartedCasesView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box (not used).
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
-
-    public: // New functions
-        
-        /**
-        * Handles status changes of test cases in view.
-        */
-        void TestCaseStateChangedL();
-        
-        /**
-        * Handles call to view test case´s output data.
-        */
-        void ViewTestCaseOutputL();
-
-    private:
-    
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /** From MEikMenuObserver
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID
-        * @param aMenuPane Menu pane pointer
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-        
-        /**
-        * Refreshes view name shown in the navi pane.
-        */
-        void RefreshNaviTitleL();
-
-    private: // Data
-        CShowStartedCasesContainer* iContainer;
-        CAknNavigationDecorator*    iNaviDecorator;
-        TName                       iFilterModule;
-        TFileName                   iFilterTestCaseFile;
-        TInt                        iSelectedTestCase; // Which testcase was 
-                                                       // selected when view 
-                                                       // was active earlier.
-    };
-
-#endif //SHOWSTARTEDCASESVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/StartCasesContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartCasesContainer class 
-* declaration.
-*
-*/
-
-#ifndef CSTARTCASESCONTAINER_H
-#define CSTARTCASESCONTAINER_H
-
-// INCLUDES
-#include "Container.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h> // MEikListBoxObserver
-#include <bamdesca.h> // MDesCArray
-#include <aknsfld.h>
-
-//#include "RRefArray.h"        
-//#include "UIEngine.h"         
-//#include "UIStoreIf.h"        
-//#include "UIStoreContainer.h" 
-
-#include <stifinternal/RRefArray.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStoreContainer.h>
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-class CStartCasesView;
-class CEikColumnListBox;
-class CStartedTestCase;
-
-class CUIStoreHandler;
-class CUIStore;
-class CUIStoreIf;
-class CUIEngineContainer;
-class CUIEngine;
-
-// CLASS DECLARATION
-/**
-*  CStartCasesContainer  container control class.
-*  
-*/
-class CStartCasesContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CStartCasesContainer();
-
-    public: // New functions
-        
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-        
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-        
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		        
-    private: //data
-        
-        CStartCasesView*            iParentView;
-    };
-
-#endif // CSTARTCASESCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/StartCasesView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartCasesView class declaration.
-*
-*/
-
-#ifndef STARTCASESVIEW_H
-#define STARTCASESVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CStartCasesContainer;
-
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuView view class.
-* 
-*/
-class CStartCasesView : public CView, public MEikListBoxObserver //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CStartCasesView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box.
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-    public: // New functions
-        
-        /** 
-        * Starts test case.
-        */
-        void StartTestCaseL();
-        
-        /**
-        * Starts multiple test cases.
-        * @param aSelectedÍndexes Indexes of selected test cases.
-        */
-        void StartTestCasesL( RArray<TInt> aSelectedIndexes );
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-    
-    private: // New functions
-        
-        /**
-        * Checks listbox selections and launches 
-        * query dialog to start test cases.
-        * @param aListBox Pointer to listbox.
-        */
-        void CheckListBoxSelectionsL(CEikListBox* aListBox);
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CStartCasesContainer*       iContainer;
-        TInt                        iCurrentTestCase;
-    };
-
-#endif //STARTCASESVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/StartedCasesMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedCasesMenuContainer class
-* declaration.
-*
-*/
-
-#ifndef CSTARTEDCASESMENUCONTAINER_H
-#define CSTARTEDCASESMENUCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-
-// CLASS DECLARATION
-
-/**
-*  CStartedCasesMenuContainer  container control class.
-*  
-*/
-class CStartedCasesMenuContainer : public CCoeControl , public MEikListBoxObserver  /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect );
-
-        /**
-        * Destructor.
-        */
-        ~CStartedCasesMenuContainer();
-
-    public: // New functions
-    
-        /**
-        * Get currently selected items index.
-        * @return Current item index.
-        */			
-		TInt GetActiveLine();   
-
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-		void SaveActiveLine();
-		
-    public: // Functions from base classes
-    
-        /**
-        * Method HandleSelectedListItemL handles valix index.
-        * @param        TInt aIndex
-        * @return       nothing
-        */
-        void HandleSelectedListItemL( TInt aIndex );        
-
-    private: // Functions from base classes
-        
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-       
-        /**
-        * Handles list box events.
-        * @param aListBox The originating list box. 
-        * @param aEventType A code for the event. Further information may be
-        *                   obtained by accessing the list box itself.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		
-        
-    private: //data
-        
-		CEikTextListBox*    iListBox;
-    };
-
-#endif // CSTARTEDCASESMENUCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/StartedCasesMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedCasesMenuView class
-* declaration.
-*
-*/
-
-#ifndef STARTEDCASESMENUVIEW_H
-#define STARTEDCASESMENUVIEW_H
-
-// INCLUDES
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-#include "View.h"
-
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CStartedCasesMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CStartedCasesMenuView view class.
-* 
-*/
-class CStartedCasesMenuView : public CView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CStartedCasesMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CStartedCasesMenuContainer* iContainer;
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/StatisticsContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStatisticsContainer class
-* declaration.
-*
-*/
-
-#ifndef CSTATISTICSCONTAINER_H
-#define CSTATISTICSCONTAINER_H
-
-// INCLUDES
-#include "Container.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h>     // MEikListBoxObserver
-#include <bamdesca.h>   // MDesCArray
-#include <aknsfld.h>
-
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-class CStartCasesView;
-class CEikColumnListBox;
-
-// CLASS DECLARATION
-/**
-*  StatisticsContainer container control class.
-*  
-*/
-class CStatisticsContainer : public CContainer//public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CStatisticsContainer();
-
-    public: // New functions
-
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		        
-    private: //data
-        
-        CStartCasesView*            iParentView;
-        CDesC16ArrayFlat*           iTestCaseArray;
-    };
-
-#endif // CSTATISTICSCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/StatisticsView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStatisticsView class declaration.
-*
-*/
-
-#ifndef STATISTICSVIEW_H
-#define STATISTICSVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CStatisticsContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuView view class.
-* 
-*/
-class CStatisticsView : public CView, public MEikListBoxObserver //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CStatisticsView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box.
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-    public: // New functions
-
-        /** 
-        * Starts test case.
-        */
-        void StartTestCasesL();
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /** From MEikMenuObserver
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID
-        * @param aMenuPane Menu pane pointer
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CStatisticsContainer*       iContainer;
-        TInt                        iCurrentTestCase;
-    };
-
-#endif //STATISTICSVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/Stifui.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: Const definitions file.
-*
-*/
-
-#ifndef STIF_UI_HRH
-#define STIF_UI_HRH
-
-enum TAppUICommandIds
-    {
-    EAppUIGoBack = 1,
-    EAppUIGoToMainMenu,
-    EAppUIGoToTestCaseMenu,
-    EAppUIGoToModulesMenu,
-    EAppUIGoToTestSetsMenu,
-	ECmdGoToStartCasesView,
-	ECmdGoToStartedCasesView,
-    ECmdShowStartedTestSet,
-    ECmdCreateTestSet,
-    ECmdLoadTestSet,
-    ECmdStartTestSet,
-    ECmdSaveTestSet,
-    ECmdInsertTestCases,
-    ECmdRemoveTestCases,
-	ECmdFilterCases,
-	ECmdMarkMenu,
-    ECmdInsertSelectedCases,
-    ECmdShowSetMenu,
-	ECmdStartCases,
-	ECmdShowAllStartedCases,
-	ECmdShowOngoingCases,
-	ECmdShowPassedCases,
-	ECmdShowFailedCases,
-	ECmdShowPausedCases,
-	ECmdShowCrashedAbortedCases,
-	ECmdShowStatistics,
-    ECmdViewOutput,
-	ECmdPauseTestCase,
-	ECmdResumeTestCase,
-	ECmdAbortTestCase,
-	ECmdRemoveExecution,
-	ECmdRemoveAllExecutions,
-	ECmdOpenModule,
-	ECmdAddModule,
-	ECmdRemoveModule,
-    ECmdFilterMenu,
-    ECmdShowAbout,
-	ECmdFilterByModule = 0x1000,
-	ECmdFilterByTestCaseFile = 0x2000,
-	ECmdNOFiltering = 0x3000,
-	ECmdGoToTestSetView
-    };
-
-
-enum TAppUITabViewId
-    {
-	ETestCaseMenuTab = 1,
-    ETestModulesMenuTab,
-    ETestSetsMenuTab
-    };
- 
-// Application view ids.
-enum TAppUIViewNumber
-	{
-    EMainMenuViewId = 1,
-    ETestCaseMenuViewId,
-    EStartCaseMenuViewId,
-    EStartedCasesMenuViewId,
-    ETestModulesMenuViewId,
-    ETestSetBaseMenuViewId,
-    ETestSetMenuViewId,
-    ETestSetInsertMenuViewId,
-    ETestSetStartedCasesViewId,
-    ETestSetsMenuViewId, /*???*/
-    EShowStartedCasesViewId,
-    EShowStatisticsViewId,
-	ETestCaseOutputViewId,
-	EStatisticsViewId,
-	ECreatedTestSetMenuViewId
-	};
-
-enum TPanic
-    {
-    EModuleIndexOutOfBound,
-    EShowCasesOutOfSync
-    };
-
-enum TShowStartedCasesMode
-    {
-    EShowAllStartedCases,
-    EShowOngoingCases,
-    EShowPausedCases,
-    EShowPassedCases,
-    EShowFailedCases,
-    EShowCrashedAbortedCases,
-    EShowStatistics
-    };
-
-#endif      // STIF_UI_HRH
-// End of File
--- a/stifui/stifui/inc/Stifui_loc.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains localized strings.
-*
-*/
-
-// LOCALISATION STRINGS
-
-//#define qtn_testcase_menu_tab           "Cases"
-//#define qtn_testmodules_menu_tab        "Modules"
-//#define qtn_testsets_menu_tab           "Sets"
-
-// Main menu
-#define qtn_mainmenulist_test_cases     "\tTest Cases"
-#define qtn_mainmenulist_modules        "\tModules"
-#define qtn_mainmenulist_test_sets      "\tTest Sets"
-
-// Test cases menu
-#define qtn_testcasemenu_startcase      "\tStart Case(s)"
-#define qtn_testcasemenu_startedcases   "\tStarted Cases"
-
-// Started cases menu
-#define qtn_startedcases_allcases       "\tAll Started Cases"
-#define qtn_startedcases_ongoing        "\tOngoing Cases"
-#define qtn_startedcases_paused         "\tPaused Cases"
-#define qtn_startedcases_passed         "\tPassed Cases"
-#define qtn_startedcases_failed         "\tFailed Cases"
-#define qtn_startedcases_crashed_aborted        "\tCrashed/Aborted Cases"
-#define qtn_startedcases_statistics     "\tStatistics"
-
-// Modules menu
-#define qtn_open_module                 "Open module"
-#define qtn_add_module                  "Load all module(s)"
-#define qtn_remove_module               "Remove module"
-
-// Test set menu.
-#define qtn_testsetbasemenu_createtestset	"\tCreate test set"
-#define qtn_testsetbasemenu_loadtestset		"\tLoad test set"
-#define qtn_owerwrite_testset_confirmation	"Test set already created. Do you want to overwrite it?"
-#define qtn_save_testset_confirmation       "Save current test?"//changes for STIF-451
-#define qtn_load_testset_errornote          "Error loading test set."
-
-#define qtn_testsetinsert_add_selected  "Add selected"
-#define qtn_insert_confirmation			"Add selected test case(s) to test set?"
-#define qtn_insert_none_selected        "No test cases selected."
-
-#define qtn_testset_started_menu        "Show"
-#define qtn_testset_set_menu            "Set"
-
-#define qtn_testset_started_allcases    "Started Cases"
-#define qtn_testset_started_ongoing     "Ongoing Cases"
-#define qtn_testset_started_paused      "Paused Cases"
-#define qtn_testset_started_passed      "Passed Cases"
-#define qtn_testset_started_failed      "Failed Cases"
-#define qtn_testset_started_crashed_aborted     "Crashed/Aborted Cases"
-
-#define qtn_filter_test_cases           "Filter"
-#define qtn_by_module                   "By module"
-#define qtn_by_testcasefile             "By test case file"
-
-// Test case operations and menu texts
-#define qtn_markmenu_title				"Mark/Unmark"
-#define qtn_markmenu_mark				"Mark"
-#define qtn_markmenu_unmark				"Unmark"
-#define qtn_markmenu_markall			"Mark All"
-#define qtn_markmenu_unmarkall			"Unmark All"
-#define qtn_mark_test_case              "Mark"
-#define qtn_unmark_test_case            "Unmark"
-
-#define qtn_filter_menu                 "Filtering"
-#define qtn_filter_by_modules 		    "Filter by module"
-#define qtn_filter_by_test_case_file 	"Filter by test case file"
-#define qtn_no_filtering 		        "No filtering"
-
-
-//#define qtn_remove_execution            "Remove execution"
-//#define qtn_remove_all_executions       "Remove all executions"
-#define qtn_testcase_control_menu       "Test case control"
-#define qtn_view_output                 "View ouput of case"
-#define qtn_pause_testcase              "Pause"
-#define qtn_resume_testcase             "Resume"
-#define qtn_abort_testcase              "Abort"
-
-#define qtn_exit                        "Exit"
-
-// Start test cases queries.
-#define qtn_start_test_cases            "Start Case(s)"
-#define qtn_starting_test_case          "Start test?"
-#define qtn_starting_test_cases         "Start tests?"
-
-#define qtn_start                       "Start"
-#define qtn_start_and_view_output       "Start and view output"
-
-#define qtn_start_test					"Start"
-#define qtn_start_test_output			"Start&view output"
-#define qtn_start_tests_parallel		"Parallel"
-#define qtn_start_tests_serial			"Sequential"
-
-// example caption strings for app
-#define qtn_app_caption_string          "STIF UI"
-#define qtn_appui_demo              	"Demo"
-
-#define qtn_app_short_caption_string    "STIF UI"
-
-// Navipanel titles
-#define qtn_navi_load_test_set			"Load Test Set"
-#define qtn_navi_main					"Main menu"
-#define qtn_navi_testcases				"Test cases menu"
-#define qtn_navi_startcases				"Start cases"
-#define qtn_navi_startedcases			"Started cases"
-#define qtn_navi_testcase_output		"Test case output"
-#define qtn_navi_modules				"Modules menu"
-#define qtn_navi_testset_base			"Test set menu"
-#define qtn_navi_testset				"Test set"
-#define qtn_navi_testset_insert			"Insert test case"
-
-#define qtn_navi_started    			"Started cases"
-#define qtn_navi_started_all			"All started cases"
-#define qtn_navi_started_ongoing		"Ongoing cases"
-#define qtn_navi_started_paused			"Paused cases"
-#define qtn_navi_started_passed			"Passed cases"
-#define qtn_navi_started_failed			"Failed cases"
-#define qtn_navi_started_crashed_aborted		"Crashed/Aborted cases"
-#define qtn_navi_started_stats			"Statistics"
-
-// Test case states
-#define qtn_testcase_state_running      "Running"
-#define qtn_testcase_state_passed       "Passed"
-#define qtn_testcase_state_failed       "Failed"
-#define qtn_testcase_state_crashed_aborted      "Crashed/Aborted"
-#define qtn_testcase_state_unknown      "Undefined state!"
-
-// End of File
-
--- a/stifui/stifui/inc/TestCaseMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseMenuContainer class 
-* declaration.
-*
-*/
-
-#ifndef CTESTCASEMENUCONTAINER_H
-#define CTESTCASEMENUCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuContainer  container control class.
-*  
-*/
-class CTestCaseMenuContainer : public CCoeControl, public MEikListBoxObserver  /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect);
-
-        /**
-        * Destructor.
-        */
-        ~CTestCaseMenuContainer();
-
-    public: // New functions
-
-        /**
-        * Get currently selected items index.
-        * @return Current item index.
-        */	
-		TInt GetActiveLine();
-		
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-		void SaveActiveLine();
-    
-    public: // Functions from base classes
-     
-        /**
-        * Method HandleSelectedListItemL handles valix index.
-        * @param        TInt aIndex
-        * @return       nothing
-        */
-        void HandleSelectedListItemL( TInt aIndex );      
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-       
-        /**
-        * Handles list box events.
-        * @param aListBox The originating list box. 
-        * @param aEventType A code for the event. Further information may be
-        *                   obtained by accessing the list box itself.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		        
-    private: //data
-        
-		CEikTextListBox*    iListBox;
-    };
-
-#endif // CTESTCASEMENUCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/TestCaseMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseMenuView class 
-* declaration.
-*
-*/
-
-#ifndef TESTCASEMENUVIEW_H
-#define TESTCASEMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <aknnavide.h> 
-
-
-// CONSTANTS
-// UID of view
-const TUid KTestCaseMenuViewId = {2};
-
-// FORWARD DECLARATIONS
-class CTestCaseMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuView view class.
-* 
-*/
-class CTestCaseMenuView : public CView //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestCaseMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-        
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestCaseMenuContainer*     iContainer;
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/TestCaseOutputContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestOutputListBoxModel class
-* declaration.
-*
-*/
-
-#ifndef TESTCASEOUTPUTCONTAINER_H
-#define TESTCASEOUTPUTCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-#include <bamdesca.h>   // MDesCArray
-
-// #include "RRefArray.h"  
-#include <stifinternal/RRefArray.h>
-
-
-// Define *.mbm file name.
-_LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
-
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CAknSingleGraphicStyleListBox;
-class CDesC16ArrayFlat;
-class CStartedTestCase;
-
-class CUIStore;
-
-// CLASS DECLARATION
-
-class CTestOutputListBoxModel : public CBase, public MDesCArray
-    {
-    public:
-        /**
-        * Destructor.
-        */
-        ~CTestOutputListBoxModel();
-        
-        /**
-        * Two-phased constructor.
-        * @param aStartedTestCase Pointer to started test case.
-        * @return Pointer to created list box model.
-        */
-        static CTestOutputListBoxModel* NewL(CStartedTestCase* aStartedTestCase);
-
-    public: // Functions from base classes
-    
-        /**
-        * Returns the number of descriptor elements in the array.
-        * @return The number of descriptor elements.
-        */
-        TInt MdcaCount() const;
-        
-        /**
-        * Indexes into a descriptor array.
-        * @param aIndex The position of the descriptor element within the
-        *               array. The position is relative to zero; i.e. zero
-        *               implies the first descriptor element in the array. 
-        *               This value must be non-negative and less than the 
-        *               number of descriptors currently within the array 
-        *               otherwise the operator panics with 
-        *               EArrayIndexOutOfRange. 
-        * @return A non-modifiable pointer descriptor representing the 
-        *         descriptor element located at position aIndex within 
-        *         the array.
-        */
-        TPtrC MdcaPoint(TInt aIndex) const;
-
-    private:
-        /**
-        * Symbian OS two phased constructor.
-        * Completes the construction of the object.
-        */
-        void ConstructL();
-
-    private: //data
-        CStartedTestCase* iStartedTestCase;
-        HBufC*            iBuffer;
-
-    };
-
-/**
-*  CTestCaseOutputContainer  container control class.
-*  
-*/
-class CTestCaseOutputContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        //void ConstructL(const TRect& aRect, TInt aExecutedTestCaseCount );
-        void ConstructL(const TRect& aRect, CStartedTestCase* aStartedTestCase );
-
-        /**
-        * Destructor.
-        */
-        ~CTestCaseOutputContainer();
-
-    public: // New functions
-        /**
-        * Handles addition of item to list box.
-        */
-        void OutputUpdateL();
-
-    private:
-
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-    
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-       
-        /**
-        * Handles list box events.
-        * @param aListBox The originating list box. 
-        * @param aEventType A code for the event. Further information may be
-        *                   obtained by accessing the list box itself.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-        
-    private: //data
-        
-        CEikTextListBox*            iListBox;
-        CTestOutputListBoxModel*    iListBoxModel;
-        CUIStore*                   iUIStore;
-
-    };
-
-#endif // TESTCASEOUTPUTCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/TestCaseOutputView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseOutputView class 
-* declaration.
-*
-*/
-
-#ifndef TESTCASEOUTPUTVIEW_H
-#define TESTCASEOUTPUTVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <aknnavide.h> 
-
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestCaseOutputContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseOutputView view class.
-* 
-*/
-class CTestCaseOutputView : public CView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestCaseOutputView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-    public: // New functions
-        
-        /**
-        * Receives output update notification from AppUI
-        * @param aTestCase A pointer to started test case.
-        */
-        void OutputUpdateL( CStartedTestCase* aTestCase );
-
-        /**
-        * Prints test case state to title pane
-        */
-        void PrintTestCaseStateL();
-
-        /**
-        * Handles test case state changed notification
-        */
-        void TestCaseStateChangedL();
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /** From MEikMenuObserver
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID
-        * @param aMenuPane Menu pane pointer
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestCaseOutputContainer*   iContainer;
-        CStartedTestCase* 			iCurrentTestCase;
-
-    };
-
-#endif //SHOWSTARTEDCASESVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/TestModulesMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestModulesListBoxModel class 
-* declaration.
-*
-*/
-
-#ifndef CTESTMODULESMENUCONTAINER_H
-#define CTESTMODULESMENUCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-// #include "RRefArray.h" 
-#include <stifinternal/RRefArray.h>
-
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CUIStore;
-
-// CLASS DECLARATION
-class CTestModulesListBoxModel : public CBase, public MDesCArray
-    {
-    public:
-        /**
-        * Destructor.
-        */
-        ~CTestModulesListBoxModel();
-
-        /**
-        * Two-phased constructor.
-        * @param aTestModules Array of test modules names.
-        * @return Pointer to created list box model.
-        */
-        static CTestModulesListBoxModel* NewL(RRefArray<TDesC> aTestModules);
-
-    public: // Functions from base classes
-    
-        /**
-        * Returns the number of descriptor elements in the array.
-        * @return The number of descriptor elements.
-        */
-        TInt MdcaCount() const;
-        
-        /**
-        * Indexes into a descriptor array.
-        * @param aIndex The position of the descriptor element within the
-        *               array. The position is relative to zero; i.e. zero
-        *               implies the first descriptor element in the array. 
-        *               This value must be non-negative and less than the 
-        *               number of descriptors currently within the array 
-        *               otherwise the operator panics with 
-        *               EArrayIndexOutOfRange. 
-        * @return A non-modifiable pointer descriptor representing the 
-        *         descriptor element located at position aIndex within 
-        *         the array.
-        */
-        TPtrC MdcaPoint(TInt aIndex) const;
-
-    private:
-        /**
-        * Symbian OS two phased constructor.
-        * Completes the construction of the object.
-        */
-        void ConstructL();
-
-    private: //data
-        RRefArray<TDesC>            iTestModules;
-        HBufC*                      iBuffer;
-    };
-
-/**
-*  CTestModulesMenuContainer  container control class.
-*  
-*/
-class CTestModulesMenuContainer : public CCoeControl
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CTestModulesMenuContainer();
-
-    public: // New functions
-
-        /**
-        * Gets the index number of the current item in the view.
-        * @return Index number of the current item.
-        */
-        TInt CurrentItemIndex();
-
-    public: // New functions
-    	
-	    /**
-	     * Stores current position of focus of iListBox to the CAppUiAppUi object
-	     */
-    	void SaveActiveLine();
-
-    private: // Functions from base classes
-
-       /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-        
-    private: //data
-        
-		CEikTextListBox*            iListBox;
-        CTestModulesListBoxModel*   iListBoxModel;
-        CUIStore*                   iUIStore;
-        RRefArray<TDesC>            iModules;
-    };
-
-#endif // CTESTMODULESMENUCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/TestModulesMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestModulesMenuView class
-* declaration.
-*
-*/
-
-#ifndef TESTMODULEMENUVIEW_H
-#define TESTMODULEMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestModulesMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestModulesMenuView view class.
-* 
-*/
-class CTestModulesMenuView : public CView, public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestModulesMenuView();
-
-    public: // Functions from base classes
-        
-         /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box (not used).
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
-        
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestModulesMenuContainer*  iContainer;
-    };
-
-#endif // TESTMODULEMENUVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetBaseMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetBaseMenuContainer 
-* class declaration.
-*
-*/
-
-#ifndef CTestSetBaseMenuContainer_H
-#define CTestSetBaseMenuContainer_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-
-   
-// FORWARD DECLARATIONS
-//class CEikLabel;        // for example labels
-class CEikTextListBox;
-
-// CLASS DECLARATION
-
-/**
-*  CTestSetBaseMenuContainer  container control class.
-*  
-*/
-class CTestSetBaseMenuContainer : public CCoeControl
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        * @return Observer for list box.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetBaseMenuContainer();
-
-    public: // New functions
-
-        /**
-        * Get currently selected items index.
-        * @return Current item index.
-        */		
-		TInt GetActiveLine();    
-		
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-		void SaveActiveLine();
-    
-    public: // Functions from base classes
-     
-        /**
-        * Method HandleSelectedListItemL handles valix index.
-        * @param        TInt aIndex
-        * @return       nothing
-        */
-        void HandleSelectedListItemL( TInt aIndex );      
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-		
-        
-    private: //data
-        
-		CEikTextListBox*    iListBox;
-    };
-
-#endif // CTestSetBaseMenuContainer_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetBaseMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetBaseMenuView class declaration.
-*
-*/
-
-#ifndef TESTSETBASEMENUVIEW_H
-#define TESTSETBASEMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestSetBaseMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestSetBaseMenuView view class.
-* 
-*/
-class CTestSetBaseMenuView : public CView, public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetBaseMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box.
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestSetBaseMenuContainer*  iContainer;
-    };
-
-#endif
-
-// End of File
--- a/stifui/stifui/inc/TestSetInsertMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetInsertMenuContainer 
-* class definition.
-*
-*/
-
-#ifndef TESTSETINSERTMENUCONTAINER_H
-#define TESTSETINSERTMENUCONTAINER_H
-
-// INCLUDES
-#include "Container.h"
-
-#include <coecntrl.h>
-#include <eiklbo.h>     // MEikListBoxObserver
-#include <bamdesca.h>   // MDesCArray
-#include <aknsfld.h>
-
-//#include "RRefArray.h"        
-//#include "UIEngine.h"         
-//#include "UIStoreIf.h"        
-//#include "UIStoreContainer.h" 
-
-#include <stifinternal/RRefArray.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStoreContainer.h>
-
-
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-class CTestSetInsertMenuView;
-class CEikColumnListBox;
-class CStartedTestCase;
-
-class CUIStoreHandler;
-class CUIStore;
-class CUIStoreIf;
-class CUIEngineContainer;
-class CUIEngine;
-
-// CLASS DECLARATION
-/**
-*  CTestSetInsertMenuContainer  container control class.
-*  
-*/
-class CTestSetInsertMenuContainer : public CContainer //public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetInsertMenuContainer();
-
-    public: // New functions
-        
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-        
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-        
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-         
-    private: //data
-        
-        CTestSetInsertMenuView*         iParentView;
-    };
-
-#endif // CTestSetInsertMenuContainer_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetInsertMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This  file contains CTestSetInsertMenuView class 
-* declaration.
-*
-*/
-
-#ifndef TESTSETINSERTMENUVIEW_H
-#define TESTSETINSERTMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestSetInsertMenuContainer;
-
-
-// CLASS DECLARATION
-
-/**
-*  CTestCaseMenuView view class.
-* 
-*/
-class CTestSetInsertMenuView : public CView, public MEikListBoxObserver //CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetInsertMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box.
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
-
-    public: // New functions
-        
-        /**
-        * Adds selected test cases to the current test set.
-        * @param aSelectedIndexes Indexes of selected test cases.
-        */
-        void AddCasesToTestSet( RArray<TInt> aSelectedIndexes );
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-               
-        /**
-        * Show confirmation dialog for inserting test cases.
-        */
-        void ShowInsertCasesDialogL();
-
-    private: // Data
-        CAknNavigationDecorator*        iNaviDecorator;
-        CTestSetInsertMenuContainer*    iContainer;
-        TInt                            iCurrentTestCase;
-    };
-
-#endif //TestSetInsertMenuView_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetMenuContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetMenuContainer class 
-* declaration.
-*
-*/
-
-#ifndef TestSetMenuContainer_H
-#define TestSetMenuContainer_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>     // MEikListBoxObserver
-#include <bamdesca.h>   // MDesCArray
-#include <aknsfld.h>
-
-//#include "RRefArray.h"        
-//#include "UIEngine.h"         
-//#include "UIStoreIf.h"        
-//#include "UIStoreContainer.h" 
-
-#include <stifinternal/RRefArray.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStoreContainer.h>
-   
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CDesC16Array;
-
-class CTestSetMenuView;
-class CEikColumnListBox;
-class CTestCaseListBoxModel;
-
-class CUIStoreHandler;
-class CUIStore;
-class CUIStoreIf;
-class CUIEngineContainer;
-class CUIEngine;
-
-// CLASS DECLARATION
-/**
-*  CTestSetMenuContainer  container control class.
-*  
-*/
-class CTestSetMenuContainer : public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetMenuContainer();
-
-    public: // New functions
-        /**
-        * Show only testcases which are defined is specified module.
-        * @param aModuleName Module which test cases are shown.
-        */
-        void FilterCasesByModuleL(TName aModuleName);
-        
-        /**
-        * Show only testcases which are defined in specified test case file.
-        * @param aTestCaseFileName Test cases file name.
-        */
-        void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
-        
-        /**
-        * Remove possible filtering of test cases -> show all test cases.
-        */
-        void NoFilteringL();
-        
-        /**
-        * Returns pointers to selected test cases.
-        * @param aSelectedTestCases Currently selected test case.
-        */
-        void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases);
-
-        /**
-        * Sets graphic icon using listbox as CEikColumnListBox.
-        * @param aListBox Pointer to list box.
-        */
-        void SetGraphicIconL( CEikColumnListBox* aListBox );
-
-        /**
-        * Appends graphics data.
-        * @param aIcons Pointer array of icons.
-        */
-        void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );
-        
-        /**
-        * Gets the index number of the current item in the view.
-        * @return Index number of the current item.
-        */
-        TInt CurrentItemIndex();
-        
-        /**
-        * Sets the current item.
-        * @param aIndex Index of the item to make current.
-        */
-        void SetCurrentItemIndex(TInt aCurrentTestCase);
-		
-		/**
-		* Inline function for getting pointer to list box.
-		* @return Pointer to list box.
-		*/
-		inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; };
-		
-		/**
-		* Processes user commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		void ProcessCommandL( TInt  aCommand );
-		
-		/**
-		* Processes user commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		void SelectionListProcessCommandL( TInt  aCommand );
-		
-		/**
-		* Handles mark commands.
-		* @param aCommand ID of the command to respond to.
-		*/
-		void HandleMarkCommandL( TInt aCommand );
-        
-        /**
-		* Removes items from list box.
-		* @param aSelected Indexes of removed items.
-		*/
-		void RemoveListBoxItemL( TInt aSelected );
-		
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-		void SaveActiveLine();
-		
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-        
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-        
-    private: //data
-        
-        CTestSetMenuView*           iParentView;
-        CEikColumnListBox*          iListBox;
-        CTestCaseListBoxModel*      iListBoxModel;
-        RPointerArray<CTestInfo>    iTestCasesInView;
-        CUIStore*                   iUIStore;
-    };
-
-#endif // CTestSetMenuContainer_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetMenuView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetMenuView class declaration.
-*
-*/
-
-#ifndef TESTSETMENUVIEW_H
-#define TESTSETMENUVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> 
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestSetMenuContainer;
-
-// CLASS DECLARATION
-/**
-*  CTestCaseMenuView view class.
-*/
-class CTestSetMenuView : public CView, public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetMenuView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-    
-    public: // From MEikListBoxObserver
-        
-        /**
-        * Handles list box event.
-        * @param aListBox Pointer to list box.
-        * @param aEventType List box event.
-        */
-        void HandleListBoxEventL(CEikListBox* aListBox, 
-            TListBoxEvent aEventType);
-                
-    public: // New functions
-        
-        /**
-        * Starts all cases in active test set.
-        */
-        void StartTestSetL();
-        
-        /**
-        * Removes selected test cases from active test set.
-        */
-        void RemoveSelectedTestCasesL();
-        
-        /**
-        * Creates new test set.
-        * @param aTestSetName Name of the test set.
-        * @return Symbian OS error code.
-.       */
-        TInt CreateTestSetL( const TDesC& aTestSetName );
-        
-        /**
-        * Loads saved test set.
-        * @param aTestSetName Name of the test set.
-        * @return Symbian OS error code.
-        */
-        TInt LoadTestSetL( const TDesC& aTestSetName );
-        
-        /**
-        * Saves current test set.
-        * @return Symbian OS error code.
-        */
-        TInt SaveCurrentTestSetL();
-        
-        /**
-        * Removes current test set.
-        * @return Symbian OS error code.
-        */
-        TInt RemoveActiveTestSet();
-        
-        /**
-        * Get name of the current test set.
-        * @return Name of the current test set.
-        */
-        inline const TDesC& CurrentTestSet()
-            { return iCurrentTestSet; }
-        
-        /**
-        * Set save needed flag.
-        */
-        inline void SetSaveNeeded( TBool aSave )
-            { iSaveNeeded = aSave; }
-                
-    private: // From AknView
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-    private: // From MEikMenuObserver
-        
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestSetMenuContainer*      iContainer;
-        CUIStore*                   iUIStore;
-        TInt                        iCurrentTestCase;
-        TInt                        iTestSetIndex;
-        TBuf<50>                    iCurrentTestSet;
-        TBool                       iSaveNeeded;
-        
-    };
-
-#endif // TESTSETMENUVIEW_H
-
-// End of File
\ No newline at end of file
--- a/stifui/stifui/inc/TestSetStartedCasesContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetStartedCasesContainer
-* class declaration.
-*
-*/
-
-#ifndef TESTSETSTARTEDCASESCONTAINER_H
-#define TESTSETSTARTEDCASESCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-#include <eiklbo.h>
-#include <bamdesca.h> // MDesCArray
-
-//#include "RRefArray.h" 
-#include <stifinternal/RRefArray.h>
-
-
-// Define *.mbm file name.
-_LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
-
-// FORWARD DECLARATIONS
-class CEikTextListBox;
-class CAknSingleGraphicStyleListBox;
-class CDesC16ArrayFlat;
-class CStartedTestCase;
-
-class CUIStore;
-class CStartedTestsListBoxModel;
-
-// CLASS DECLARATION
-
-/**
-*  CTestSetStartedCasesContainer  container control class.
-*  
-*/
-class CTestSetStartedCasesContainer : public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */
-    {
-    public: // Constructors and destructor
-        
-        /**
-        * Symbian OS default constructor.
-        * @param aRect Frame rectangle for container.
-        */
-        void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver);
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetStartedCasesContainer();
-
-    public: // New functions
-    
-        /**
-        * Returns reference to currently selected test case in view (listbox).
-        * @return Currently selected test case.
-        */
-        CStartedTestCase* SelectedTestCase();
-        
-        /**
-        * Constructs list box model.
-        */
-        void ConstructListBoxModelL();
-        
-        /**
-        * Draws the list box.
-        */
-        void DrawListBox();
-        
-        /**
-        * Returns count of test cases in view.
-        * @return Count of test cases in view.
-        */
-        TInt TestsInViewCount();
-        
-        /**
-        * Handles the addition of an item to the model.
-        */
-        void HandleItemAdditionL();
-        
-        /**
-        * Handles the removal of an item from the model.
-        */
-        void HandleItemRemovalL();
-        
-        /**
-        * Returns pointer to currently selected test case.
-        * @param Current test case.
-        */
-        CStartedTestCase* CurrentTestCase();
-        
-        /**
-        * Gets the index number of the current item in the view.
-        * @return Index number of the current item.
-        */
-        TInt CurrentItemIndex();
-        
-        /**
-        * Sets the current item.
-        * @param aIndex Index of the item to make current.
-        */
-        void SetCurrentItemIndex(TInt aIndex);
-        
-        /**
-        * Resets the selection indices, top and current item indices,
-        * the selection, and the horizontal scroll offset of this list box.
-        * This function does not redraw the list box.
-        */
-        void ResetListBox();
-        
-        /**
-        * Removes items from list box.
-        */
-        void RemoveSelectedExecutionsL();
-        
-        /**
-        * Removes all started test cases from list box.
-        */
-        void RemoveAllExecutionsInViewL();
-        
-        /**
-         * Stores current position of focus of iListBox to the CAppUiAppUi object
-         */
-        void SaveActiveLine();
-
-    private: // New functions
-
-    public: // Functions from base classes
-
-    private: // Functions from base classes
-    
-        /**
-        * From CoeControl,SizeChanged.
-        * Called by framework when the view size is changed.
-        */
-        void SizeChanged();
-
-        /**
-        * From CoeControl,CountComponentControls.
-        * Gets a count of the component controls of this list box control.
-        * This information is used for DrawNow().
-        */
-        TInt CountComponentControls() const;
-
-        /**
-        * From CCoeControl,ComponentControl.
-        * Gets a pointer to the specified component control.
-        * @param aIndex Index of the component control to look up.
-        * @return The control at aIndex.
-        */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-
-        /**
-        * From CCoeControl,Draw.
-        * Draw a control, called by window server.
-        * @param aRect The region of the control to be redrawn. Co-ordinates
-        *              are relative to the control's origin (top left corner).
-        */
-        void Draw(const TRect& aRect) const;
-
-        /**
-        * From CCoeControl,OfferKeyEventL
-        * Handles key events.
-        * @param aKeyEvent The key event.
-        * @param aType The type of key event.
-        * @return Indicates whether or not the key event was used 
-        *         by this control.
-        */
-		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
-	    
-    private: //data
-        
-        CEikTextListBox*            iListBox;
-        CStartedTestsListBoxModel*  iListBoxModel;    
-        RRefArray<CStartedTestCase> iStartedTestsPtrs;
-        CUIStore*                   iUIStore;
-    };
-
-#endif // CTestSetStartedCasesCONTAINER_H
-
-// End of File
--- a/stifui/stifui/inc/TestSetStartedCasesView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetStartedCasesView class
-* declaration.
-*
-*/
-
-#ifndef TESTSETSTARTEDCASESVIEW_H
-#define TESTSETSTARTEDCASESVIEW_H
-
-// INCLUDES
-#include "View.h"
-#include <eiklbo.h> // MEikListBoxObserver
-#include <aknnavide.h> //CAknNavigationDecorator
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CTestSetStartedCasesContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CTestSetStartedCasesView view class.
-* 
-*/
-class CTestSetStartedCasesView : public CView, public MEikListBoxObserver
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CTestSetStartedCasesView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        void HandleClientRectChange();
-
-        /**
-        * Handles a list box event.
-        * @param aListBox A pointer to list box (not used).
-        * @param aEventType Type of list box event.
-        */
-        void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType);
-
-    public: // New functions
-        
-        /**
-        * Handles status changes of test cases in view.
-        */
-        void TestCaseStateChangedL();
-        
-        /**
-        * Handles call to view test case´s output data.
-        */
-        void ViewTestCaseOutputL();
-
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        void DoDeactivate();
-
-        /**
-        * Initializes menu pane.
-        * @param aResourceId Menu pane resource ID.
-        * @param aMenuPane Menu pane pointer.
-        */
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-        
-        /**
-        * Refreshes view name shown in the navi pane.
-        */
-        void RefreshNaviTitleL();
-
-    private: // Data
-        CAknNavigationDecorator*    iNaviDecorator;
-        CTestSetStartedCasesContainer* iContainer;
-        TName                       iFilterModule;
-        TFileName                   iFilterTestCaseFile;
-        TInt                        iSelectedTestCase;  // Which testcase was 
-                                                        // selected when view 
-                                                        // was active earlier.
-    };
-
-#endif //TestSetStartedCasesVIEW_H
-
-// End of File
--- a/stifui/stifui/inc/UIStoreHandler.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CUIStoreHandler class declaration.
-*
-*/
-
-#ifndef UISTOREHANDLER_H
-#define UISTOREHANDLER_H
-
-//  INCLUDES
-//#include "UIStoreIf.h"  
-//#include "UIStore.h"   
-//#include "UIEngine.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-
-#include "AppUIAppUi.h"
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-// None
-
-// CLASS DECLARATION
-// None
-class CAppUIAppUi;
-
-// DESCRIPTION
-// CUIStoreHandler is a STIF Test Framework Series60 UI class.
-// CUIStoreHandler's methods purpose is to offer handle to UI Engine.
-// Because multible inheritance in not allowed in SOS we cannot 
-// inheritance CUIStore class direct so we use this class.
-
-class CUIStoreHandler 
-            :public CUIStoreIf
-    {
-    public:     // Enumerations
-
-    private:    // Enumerations
-
-    public:     // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        * @param aAppUIAppUI Pointer to application ui.
-        * @return Pointer to UIStoreHandler.
-        */
-        static CUIStoreHandler* NewL( CAppUIAppUi* aAppUIAppUI );
-
-        /**
-        * Destructor.
-        */
-        ~CUIStoreHandler();
-
-    public:     // New functions
-
-        /**
-        * C++ default constructor.
-        * @param aAppUIAppUI Pointer to application ui.
-        */
-        CUIStoreHandler( CAppUIAppUi* aAppUIAppUI );
-
-        /**
-        * Receives output update notify from started test case.
-        * Checks if that test case is currently in output view then
-        * sends notification to AppUI which handles notification onward.
-        * @param aTestCase
-        * @param aStatus
-        */
-        void Update( CStartedTestCase* aTestCase, TInt aStatus );
-
-    public:     // Functions from base classes
-
-    protected:  // New functions
-
-    protected:  // Functions from base classes
-
-    private:
-
-        /**
-        * By default Symbian OS constructor is private.
-        */
-        void ConstructL();
-
-    public:     // Data
-
-        /**
-        * Returns the AppUI of the application
-        * @return Pointer to the Application UI.
-        */
-        CAppUIAppUi* iAppUIAppUI;
-        
-        /**
-        * Counter for executed test cases
-        */
-        TInt iExecutedTestCaseCount;
-
-    protected:  // Data
-
-    private:    // Data
-
-    public:     // Friend classes
-
-    protected:  // Friend classes
-
-    private:    // Friend classes
-
-    };
-
-#endif      // UISTOREHANDLER_H
-
-// End of File
--- a/stifui/stifui/inc/View.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CView class declaration.
-*
-*/
-
-#ifndef VIEW_H
-#define VIEW_H
-
-// INCLUDES
-#include <aknview.h>
-
-//#include "UIStoreIf.h" 
-#include <stifinternal/UIStoreIf.h>
-
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-//class CMainMenuContainer;
-
-// CLASS DECLARATION
-
-/**
-*  CMainMenuView view class.
-* 
-*/
-class CView : public CAknView
-    {
-    public: // Constructors and destructor
-
-        /**
-        * Symbian OS default constructor.
-        */
-        void ConstructL();
-
-        /**
-        * Destructor.
-        */
-        ~CView();
-
-    public: // Functions from base classes
-        
-        /**
-        * Returns view´s id.
-        * @return View id.
-        */
-        virtual TUid Id() const;
-
-        /**
-        * Handles a command.
-        * @param aCommand A command ID.
-        */
-        virtual void HandleCommandL( TInt aCommand );
-
-        /**
-        * Handles client rect changes.
-        */
-        virtual void HandleClientRectChange();
-        
-    private:
-
-        /**
-        * Initializes view when activated.
-        * @param aPrevViewId Id of the previous view (not used).
-        * @param aCustomMessageId Custom message id (not used).
-        * @param aCustomMessage Custom message (not used).
-        */
-        virtual void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-            const TDesC8& aCustomMessage);
-
-        /**
-        * Deactivates view.
-        */
-        virtual void DoDeactivate();
-
-    protected: // Data
-        
-        /**
-        * Pointer to UI Store.
-        */
-        CUIStore*     iUIStore;
-		
-		
-    private: // Data
-
-    };
-
-#endif // VIEW_H
-
-// End of File
--- a/stifui/stifui/inc/version.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains STIF UI version declaration.
-*
-*/
-
-#ifndef VERSION_H_
-#define VERSION_H_
-
-#define STIFUI_MAJOR_VERSION 7
-#define STIFUI_MINOR_VERSION 3
-#define STIFUI_BUILD_VERSION 28
-
-#define STIFUI_REL_DATE "09th Mar 2010"
-
-#define TO_UNICODE(text) _L(text) 
-
-#endif /*VERSION_H_*/
--- a/stifui/stifui/src/AppUIApp.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CAppUIApp class definition.
-*
-*/
-
-// INCLUDE FILES
-#include    "AppUIApp.h"
-#include    "AppUIDocument.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CSTIFAppUIApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CAppUIApp::AppDllUid() const
-    {
-    return KUidAppUI;
-    }
-
-   
-// ---------------------------------------------------------
-// CSTIFAppUIApp::CreateDocumentL()
-// Creates CSTIFAppUIDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CAppUIApp::CreateDocumentL()
-    {
-    return CAppUIDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-//
-
-	#include <eikstart.h>
-	// ---------------------------------------------------------
-	// NewApplication() 
-	// Exported function
-	// Returns: CApaApplication: 
-	// ---------------------------------------------------------
-	//
-	LOCAL_C CApaApplication* NewApplication()
-		{
-		return new CAppUIApp;
-		}
-	// ---------------------------------------------------------
-	// E32Main() 
-	// EXE Entry point
-	// Returns: KErrNone: No error
-	// ---------------------------------------------------------
-	//
-	GLDEF_C TInt E32Main()
-		{
-		return EikStart::RunApplication(NewApplication);
-		}
-
-
-// End of File
--- a/stifui/stifui/src/AppUIAppUi.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains TMessageBoxUtil class definition.
-*
-*/
-
-// INCLUDE FILES
-#include "AppUIAppUi.h"
-
-#include "MainMenuView.h"
-#include "TestCaseMenuView.h"
-#include "StartCasesView.h"
-#include "TestModulesMenuView.h"
-#include "StartedCasesMenuView.h"
-#include "ShowStartedCasesView.h"
-#include "TestCaseOutputView.h"
-#include "StatisticsView.h"
-#include "TestSetBaseMenuView.h"
-#include "TestSetMenuView.h"
-#include "TestSetInsertMenuView.h"
-#include "TestSetStartedCasesView.h"
-#include <aknmessagequerydialog.h> 
-#include "version.h"
-
-#include "CreatedTestSetMenuView.h"
-
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-
-
-#include <StifTestInterface.h>
-
-#include <aknnotewrappers.h>
-#include <StringLoader.h>
-
-_LIT( KTestSet, "DefaultSet" );
-
-static const TInt KCopyrightChar = 169;
-
-// ----------------------------------------------------------
-// CMessageBoxUtil::ShowNotImplementedYetL
-// Displays message that executed funtion is not implemented yet.
-// ----------------------------------------------------------
-//
-void TMessageBoxUtil::ShowNotImplementedYetL()
-    {
-    _LIT(message, "Not implemented yet");
-    CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
-    informationNote->ExecuteLD(message);
-    }
-
-// ----------------------------------------------------------
-// Display error note.
-// @param aMessage Error message to display.
-// ----------------------------------------------------------
-//
-void TMessageBoxUtil::ShowErrorNoteL( const TDesC& aMessage )
-	{
-	CAknErrorNote* errorNote = new (ELeave) CAknErrorNote(ETrue);
-	// set timeout to 5 sec	
-	errorNote->SetTimeout( (CAknNoteDialog::TTimeout)5000000 );
-	errorNote->ExecuteLD( aMessage );
-	}
-
-// ================= MEMBER FUNCTIONS =======================
-//
-// ----------------------------------------------------------
-// CAppUIAppUi::ConstructL()
-// ?implementation_description
-// ----------------------------------------------------------
-//
-void CAppUIAppUi::ConstructL()
-    {
-    TInt error(0);
-
-    BaseConstructL( EAknEnableSkin );
-
-    // connection to setting server needs to be open as long as STIF Series 60 UI APP is alive
-    TInt ret = iSettingServer.Connect();
-    if ( ret != KErrNone )
-        {
-        User::Leave( ret );
-        }
-    
-    iLogger = CStifLogger::NewL( _L("E\x3a\\"), _L("stif_tfw_ui"),
-                                CStifLogger::ETxt, CStifLogger::EFile,
-                                ETrue, EFalse, ETrue, EFalse, EFalse );
-
-    iLogger->Log( _L("--- UI log starts ---") );
-    iLogger->Log( _L(" ") );
-    iLogger->Log( _L("appui: ConstructL") );
-
-	// Create CData object which handles all test cases data and running of them
-    iUIStoreHandler = CUIStoreHandler::NewL( this );
-    
-    // CUIStore open 
-    error = UIStoreHandler()->Open( KDefaultPathAndIni );
-    if ( KErrNone != error )
-    	{
-    	User::Leave( error );
-    	}
-
-    CMainMenuView* mainMenuView = new (ELeave) CMainMenuView;
-    CleanupStack::PushL( mainMenuView );
-    mainMenuView->ConstructL();
-    AddViewL( mainMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // MainMenuView
-
-    iLogger->Log(_L("appui:mainview "));
-
-    CCreatedTestSetMenuView* testCreatedTestSetMenuView = new (ELeave) CCreatedTestSetMenuView;
-        CleanupStack::PushL( testCreatedTestSetMenuView );
-       testCreatedTestSetMenuView->ConstructL();
-        AddViewL( testCreatedTestSetMenuView );      // transfer ownership to CAknViewAppUi
-        CleanupStack::Pop();    // testCaseMenuView
-    CTestCaseMenuView* testCaseMenuView = new (ELeave) CTestCaseMenuView;
-    CleanupStack::PushL( testCaseMenuView );
-    testCaseMenuView->ConstructL();
-    AddViewL( testCaseMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testCaseMenuView
-
-    iLogger->Log(_L("appui:caseview "));
-
-    CStartCasesView* startCasesView = new (ELeave) CStartCasesView;
-    CleanupStack::PushL( startCasesView );
-    startCasesView->ConstructL();
-    AddViewL( startCasesView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // startCasesView
-
-    iLogger->Log(_L("appui:startcaseview "));
-
-    CStartedCasesMenuView* startedCasesMenuView = new (ELeave) CStartedCasesMenuView;
-    CleanupStack::PushL( startedCasesMenuView );
-    startedCasesMenuView->ConstructL();
-    AddViewL( startedCasesMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // startedCasesMenuView
-
-    iLogger->Log(_L("appui:started cases view created"));
-
-    CShowStartedCasesView* showStartedCasesView = new (ELeave) CShowStartedCasesView;
-    CleanupStack::PushL( showStartedCasesView );
-    showStartedCasesView->ConstructL();
-    AddViewL( showStartedCasesView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // showStartedCasesView
-
-    iLogger->Log(_L("appui: show started cases view created"));
-
-    CTestCaseOutputView* testCaseOutputView = new (ELeave) CTestCaseOutputView;
-    CleanupStack::PushL( testCaseOutputView );
-    testCaseOutputView->ConstructL();
-    AddViewL( testCaseOutputView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testCaseOutputView
-
-    iLogger->Log(_L("appui: test case output view created"));
-
-    CTestModulesMenuView* testModulesMenuView = new (ELeave) CTestModulesMenuView;
-    CleanupStack::PushL( testModulesMenuView );
-    testModulesMenuView->ConstructL();
-    AddViewL( testModulesMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testModulesMenuView
-
-    iLogger->Log(_L("appui:modulesview "));
-
-    CStatisticsView* statisticsMenuView = new (ELeave) CStatisticsView;
-    CleanupStack::PushL( statisticsMenuView );
-    statisticsMenuView->ConstructL();
-    AddViewL( statisticsMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // statisticsMenuView
-
-    iLogger->Log(_L("appui:modulesview "));
-
-	//
-	CTestSetBaseMenuView* testSetBaseMenuView = new (ELeave) CTestSetBaseMenuView;
-    CleanupStack::PushL( testSetBaseMenuView );
-    testSetBaseMenuView->ConstructL();
-    AddViewL( testSetBaseMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testSetBaseMenuView
-
-    iLogger->Log(_L("appui:testsetsbaseview "));
-    
-    CTestSetMenuView* testSetMenuView = new (ELeave) CTestSetMenuView;
-    CleanupStack::PushL( testSetMenuView );
-    testSetMenuView->ConstructL();
-    AddViewL( testSetMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testSetMenuView
-
-    iLogger->Log(_L("appui:testsetsview "));
-	
-	CTestSetInsertMenuView* testSetInsertMenuView = new (ELeave) CTestSetInsertMenuView;
-    CleanupStack::PushL( testSetInsertMenuView );
-    testSetInsertMenuView->ConstructL();
-    AddViewL( testSetInsertMenuView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testSetInsertMenuView
-   	
-   	iLogger->Log(_L("appui:testsetinsertview "));
-   	
-   	CTestSetStartedCasesView* testSetStartedCasesView = new (ELeave) CTestSetStartedCasesView;
-    CleanupStack::PushL( testSetStartedCasesView );
-    testSetStartedCasesView->ConstructL();
-    AddViewL( testSetStartedCasesView );      // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();    // testSetStartedCasesView
-
-    iLogger->Log(_L("appui:testsetStartedCasesView "));
-    
-
-    SetDefaultViewL( *mainMenuView );
-
-    iLogger->Log(_L("appui:setdefview "));
-    
-    iStartedTestCase = NULL;
-    iStartedTestSet = -1;
-    
-    iPreviousPositionListValid = ETrue;
-    }
-
-// ----------------------------------------------------
-// CAppUIAppUi::~CAppUIAppUi()
-// Destructor
-// Frees reserved resources
-// ----------------------------------------------------
-//
-CAppUIAppUi::~CAppUIAppUi()
-    {
-    
-    if ( iLogger )
-    {
-    iLogger->Log( _L(" ") );
-    iLogger->Log( _L("--- UI log ends ---") );    	
-    }
-
-    delete iLogger;
-    iSettingServer.Close();
-    UIStoreHandler()->Close();
-    delete iUIStoreHandler;
-    
-    // Closing of array of positions of focus in various menus
-    iPreviousFocusPosition.Close();
-    // iPreviousFocusPosition is no longer valid and cannot be used any more
-    iPreviousPositionListValid = EFalse;
-    //RemoveView(EMainMenuViewId);
-    }
-
-// ------------------------------------------------------------------------------
-// CAppUIAppUi::Data( )
-// Just returns pointer to CUIStore object, which is created by CAppUIAppUi
-// ------------------------------------------------------------------------------
-//
-CUIStore* CAppUIAppUi::UIStoreHandler()
-    {
-    return &iUIStoreHandler->UIStore();
-
-    }
-
-// ------------------------------------------------------------------------------
-// CAppUIAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ------------------------------------------------------------------------------
-//
-void CAppUIAppUi::DynInitMenuPaneL(
-    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
-    {
-
-    }
-
-// ----------------------------------------------------
-// CAppUIAppUi::HandleKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-// ?implementation_description
-// ----------------------------------------------------
-//
-TKeyResponse CAppUIAppUi::HandleKeyEventL(
-    const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
-    {
-	TInt currentView;
-
-	if ( iView )
-	{
-    currentView = (iView->Id()).iUid;
- 			
-    
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-			{
-			switch ( currentView )
-				{
-				case ETestModulesMenuViewId:
-					{
-                    HandleCommandL( EAppUIGoToTestCaseMenu );
-					break;
-					}
-				case ETestSetBaseMenuViewId:
-					{
-                    HandleCommandL( EAppUIGoToModulesMenu );
-					ActivateLocalViewL(TUid::Uid(ETestModulesMenuViewId));
-					break;
-					}
-                }
-            break;
-			}
-        case EKeyRightArrow:
-			{
-			switch ( currentView )
-				{
-				case ETestCaseMenuViewId:
-					{
-                    HandleCommandL( EAppUIGoToModulesMenu ); // TestCaseMenu --> TestModuleMenu
-					ActivateLocalViewL(TUid::Uid(ETestModulesMenuViewId));
-					break;
-					}
-				case ETestModulesMenuViewId:
-					{
-					HandleCommandL( EAppUIGoToTestSetsMenu );
-					ActivateLocalViewL(TUid::Uid(ETestSetBaseMenuViewId));
-					break;
-					}
-				case ETestSetsMenuViewId:
-					{
-					break;
-					}
-
-				}
-            break;
-			}
-
-        default:
-			{
-            return EKeyWasNotConsumed;
-            //break; 
-			}
-        }
-	}
-
-    return EKeyWasConsumed;
-
-    }
-
-// ----------------------------------------------------
-// CAppUIAppUi::HandleCommandL(TInt aCommand)
-// ?implementation_description
-// ----------------------------------------------------
-//
-void CAppUIAppUi::HandleCommandL(TInt aCommand)
-    {
-	TInt currentView, newView;
-    TInt error(0);
-    
-    currentView = (iView->Id()).iUid;
-
-    switch ( aCommand )
-        {
-        case EEikCmdExit:
-        case EAknSoftkeyExit:
-            {
-            PrepareToExit();
-            Exit();
-			newView = currentView;
-            break;
-            }
-        case EAppUIGoBack:
-            {
-			switch ( currentView )
-				{
-				case ETestCaseMenuViewId:
-					{
-					newView = EMainMenuViewId;  // Test Cases Menu --> Main Menu
-					break;
-					}
-				case EStartCaseMenuViewId:
-					{
-					newView = ETestCaseMenuViewId; // Start Cases Menu --> Test Cases Menu
-                    //iTabGroup->SetActiveTabByIndex(0);
-					break;
-					}
-				case ETestModulesMenuViewId:
-					{
-					newView = EMainMenuViewId; // Test Modules Menu --> Main Menu
-					break;
-					}
-				case EStartedCasesMenuViewId:
-					{
-					newView = ETestCaseMenuViewId; // Started Cases Menu --> Test Case Menu
-					break;
-					}
-				case EShowStartedCasesViewId:
-					{
-					newView = EStartedCasesMenuViewId; // Show started cases --> Started Cases Menu
-					break;
-					}
-				case ETestCaseOutputViewId:
-					{
-                    newView = iPreviousView; // Test case output view --> previous view
-					break;
-					}
-				case EStatisticsViewId:
-					{
-                    newView = EStartedCasesMenuViewId; // Statistic view --> Started Cases Menu
-					break;
-					}
-				case ETestSetBaseMenuViewId:
-					{
-					newView = EMainMenuViewId;  // Test Sets Base Menu --> Main Menu
-					break;
-					}
-				case ETestSetMenuViewId:
-					{
-					newView = ETestSetBaseMenuViewId;  // Test Sets Menu --> Test Sets Base Menu
-					break;
-					}
-				case ETestSetInsertMenuViewId:
-					{
-					newView = ETestSetMenuViewId;  // Test Set Insert Menu --> Test Sets Menu
-					break;
-					}
-				case ETestSetStartedCasesViewId:
-					{
-					newView = ETestSetMenuViewId;  // Test Set Started Cases Menu --> Test Sets Menu
-					break;
-					}
-				default:
-					{
-					newView = currentView; // Back does not work. This should not happen ever
-					break;
-					}
-				}
-            break;
-			}
-		case EAppUIGoToMainMenu:
-			{
-			newView = EMainMenuViewId;
-			break;
-			}
-		case EAppUIGoToTestCaseMenu:
-			{
-			newView = ETestCaseMenuViewId;
-			break;
-			}
-		case ECmdGoToStartCasesView:
-			{
-			newView = EStartCaseMenuViewId;
-			break;
-			}
-		case ECmdGoToStartedCasesView:
-			{
-			newView = EStartedCasesMenuViewId;
-			break;
-			}
-		case EAppUIGoToModulesMenu:
-			{
-			newView = ETestModulesMenuViewId;
-            //iTabGroup->SetActiveTabByIndex(1);
-			break;
-			}
-		case EAppUIGoToTestSetsMenu:
-			{
-            newView = ETestSetBaseMenuViewId;
-            
-            //ShowNotImplementedYet();
-            //newView = currentView;
-			break;
-			}
-        case ECmdCreateTestSet:
-	        {
-	        CTestSetMenuView* testSetMenu = (CTestSetMenuView*)View( TUid::Uid(ETestSetMenuViewId) );
-	        error = testSetMenu->CreateTestSetL( KTestSet );
-	        if ( KErrNone == error ||  KErrAlreadyExists == error)
-	            {
-	            newView = ETestSetInsertMenuViewId;
-	            currentView = ETestSetMenuViewId; // Store previous view for Back function
-	            }
-	        else
-	            {
-	            newView = ETestSetMenuViewId;
-	            }
-            break;
-    	    }
-    	case ECmdLoadTestSet:
-	        {
-	        newView = ECreatedTestSetMenuViewId; /*ETestSetBaseMenuViewId;*/
-	        break;
-			}
-    	case ECmdGoToTestSetView:
-    		{
-
-    		newView = ETestSetMenuViewId; 
-    		break;
-    		}
-        case ECmdInsertTestCases:
-	        {
-    		newView = ETestSetInsertMenuViewId;
-    		break;
-        	}
-        case ECmdShowStartedTestSet:
-	        {
-    		newView = ETestSetStartedCasesViewId;
-    		iShowStartedCasesMode = EShowAllStartedCases;
-    		break;
-        	}
-        case ECmdShowAllStartedCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowAllStartedCases;
-			break;
-        case ECmdShowOngoingCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowOngoingCases;
-        	break;
-        case ECmdShowPassedCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowPassedCases;
-			break;
-        case ECmdShowPausedCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowPausedCases;
-			break;
-        case ECmdShowFailedCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowFailedCases;
-			break;
-        case ECmdShowCrashedAbortedCases:
-            newView = EShowStartedCasesViewId;
-            iShowStartedCasesMode = EShowCrashedAbortedCases;
-			break;
-        case ECmdShowStatistics:
-            newView = EStatisticsViewId;
-			break;
-        case ECmdViewOutput:
-            newView = ETestCaseOutputViewId;
-            break;
-        case ECmdShowAbout:
-        	{
-        	CAknMessageQueryDialog* dlg = new (ELeave) CAknMessageQueryDialog;
-        	TBuf<200> version;
-        	version.Format(_L("STIF UI - Version %d.%d.%d - "), STIFUI_MAJOR_VERSION, STIFUI_MINOR_VERSION, STIFUI_BUILD_VERSION);
-        	version.Append(TO_UNICODE(STIFUI_REL_DATE));
-        	version.Append(_L("\n"));
-        	
-        	TInt stifMajorV;
-        	TInt stifMinorV;
-        	TInt stifBuildV;
-        	TBuf<30> relDate;
-        	TStifUtil::STIFVersion(stifMajorV, stifMinorV, stifBuildV, relDate);
-        	
-        	TBuf<40> stifVersion;
-        	stifVersion.Format(_L("STIF - Version %d.%d.%d - "), stifMajorV, stifMinorV, stifBuildV);
-        	stifVersion.Append(relDate);
-        	stifVersion.Append(_L("\n"));
-        	
-        	version.Append(stifVersion);
-        	
-        	version.Append(_L("Copyright "));
-			version.Append( KCopyrightChar );
-			version.Append(_L(" 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved."));
-        	
-        	dlg->SetMessageText(version);
-        	dlg->ExecuteLD(R_STIFUI_ABOUT_DIALOG);
-        	newView = currentView;
-        	break;
-        	}
-        default:
-			{
-            TMessageBoxUtil::ShowNotImplementedYetL();
-			newView = currentView;
-            break;
-			}
-        }
-
-	if( newView != currentView )
-		{
-        iPreviousView = currentView; // Store previous view for Back function
-		ActivateLocalViewL( TUid::Uid(newView) );
-
-		/*switch ( newView )
-			{
-			case EMainMenuViewId:
-            case EStartedCasesMenuViewId:
-            case EStartCaseMenuViewId:
-            case ETestCaseOutputViewId:
-				{
-		        //StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
-                //iTabGroup->DimTab (ETestCaseMenuTab, ETrue);
-                //iTabGroup->DimTab (ETestModulesMenuTab, ETrue);
-                //iTabGroup->DimTab (ETestSetsMenuTab, ETrue);
-
-                //StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_EMPTY);
-				//StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_IDLE);
-				break;
-				}
-			case ETestCaseMenuViewId:
-			case ETestModulesMenuViewId:
-			case ETestSetsMenuViewId:
-				{
-				//StatusPane()->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
-                //iTabGroup->DimTab (ETestCaseMenuTab, EFalse);
-                //iTabGroup->DimTab (ETestModulesMenuTab, EFalse);
-                //iTabGroup->DimTab (ETestSetsMenuTab, EFalse);
-                break;
-				}
-			default:
-				{
-                break;
-				}
-			}*/
-		}
-
-    }
-
-/**
-* Receives output update notification from UI Storehandler
-* @param
-* @return
-*/
-void CAppUIAppUi::OutputUpdateL( CStartedTestCase* aTestCase, TInt /* aStatus */ )
-    {
-    if( iView->Id().iUid == ETestCaseOutputViewId )
-        {
-        ( ( CTestCaseOutputView* )iView )->OutputUpdateL( aTestCase );
-        }
-    else if( iView->Id().iUid == EShowStartedCasesViewId )
-        {
-        ( ( CShowStartedCasesView* )iView )->TestCaseStateChangedL();
-        }
-    else if( iView->Id().iUid == ETestCaseOutputViewId )
-        {
-        ( ( CTestCaseOutputView* )iView )->TestCaseStateChangedL();
-        }
-    }
-  
-/**
-* Sets index of selected test case for viewing test case output
-* @param
-* @return
-*/    
-void CAppUIAppUi::SetStartedTestCase( CStartedTestCase* aStartedTestCase )
-    {
-    iStartedTestCase = aStartedTestCase;
-    }    
-  
-/**
-* Returns index of selected test case for viewing test case output
-* @param
-* @return
-*/    
-CStartedTestCase* CAppUIAppUi::GetStartedTestCase( )
-    {
-    return iStartedTestCase;
-    }        
-
-/**
- * Stores focus position of focus from a specyfic view to iPreviousFocusPosition object.
- * Value is than used to retrieve previous position of focus in the menu
- * @param aViewId - identification of view
- * @param aPosition - value to store for a specyfic view
- */
-void CAppUIAppUi::SaveFocusPosition(TAppUIViewNumber aViewId, TInt aPosition)
-	{
-	if(!iPreviousPositionListValid)
-		{
-		return;
-		}
-	for(TInt counter = iPreviousFocusPosition.Count(); counter <= aViewId; counter++)
-		{
-		iPreviousFocusPosition.Append(0);
-		}
-	iPreviousFocusPosition[aViewId] = aPosition;
-	}
-
-/**
- * Restores focus position of focus for a specyfic view from iPreviousFocusPosition object.
- * @param aViewId - identification of view
- * @return - previous position of focus in the requested view
- */
-TInt CAppUIAppUi::GetFocusPosition(TAppUIViewNumber aViewId)
-	{
-	if(iPreviousFocusPosition.Count() > aViewId)
-		{
-		return iPreviousFocusPosition[aViewId];
-		}
-	else
-		{
-		return KErrNotFound;
-		}
-	}
-
-// End of File
--- a/stifui/stifui/src/AppUIDocument.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CAppUIDocument class definition.
-*
-*/
-
-// INCLUDE FILES
-#include "AppUIDocument.h"
-#include "AppUIAppUi.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// constructor
-CAppUIDocument::CAppUIDocument(CEikApplication& aApp)
-: CAknDocument(aApp)    
-    {
-    }
-
-// destructor
-CAppUIDocument::~CAppUIDocument()
-    {
-    }
-
-// Symbian OS default constructor can leave.
-void CAppUIDocument::ConstructL()
-    {
-    }
-
-// Two-phased constructor.
-CAppUIDocument* CAppUIDocument::NewL(
-        CEikApplication& aApp)     // CAppUIApp reference
-    {
-    CAppUIDocument* self = new (ELeave) CAppUIDocument( aApp );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-    }
-    
-// ----------------------------------------------------
-// CAppUIDocument::CreateAppUiL()
-// constructs CAppUIAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CAppUIDocument::CreateAppUiL()
-    {
-    return new (ELeave) CAppUIAppUi;
-    }
-
-// End of File  
--- a/stifui/stifui/src/Container.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,410 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseListBoxModel class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> //  CColumnListBoxData
-
-#include "Container.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestCaseListBoxModel::NewL
-// 
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-
-CTestCaseListBoxModel* CTestCaseListBoxModel::NewL(RPointerArray<CTestInfo>* aTestCasesInView)
-    {
-    CTestCaseListBoxModel* self = new ( ELeave ) CTestCaseListBoxModel();
-    CleanupStack::PushL( self );
-    self->iBuffer = HBufC::NewL( 130 );
-    self->iTestCasesInView = aTestCasesInView;
-    CleanupStack::Pop();
-    return self;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseListBoxModel::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-
-void CTestCaseListBoxModel::ConstructL()
-    {
-    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseListBoxModel::~CTestCaseListBoxModel
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestCaseListBoxModel::~CTestCaseListBoxModel()
-    {
-    delete iBuffer;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseListBoxModel::MdcaCount
-// 
-// Returns the number of descriptor elements in the array.
-// ----------------------------------------------------------------------------
-//
-
-TInt CTestCaseListBoxModel::MdcaCount() const
-    {
-    return iTestCasesInView->Count();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseListBoxModel::MdcaPoint
-// 
-// Indexes into a descriptor array.
-// ----------------------------------------------------------------------------
-//
-TPtrC CTestCaseListBoxModel::MdcaPoint(TInt aIndex) const
-    {
-    CTestInfo* testCasePtr = (*iTestCasesInView)[aIndex];
-    TPtr buffer( iBuffer->Des() );
-    buffer.Zero();
-    buffer.Append(_L("\t"));
-    buffer.Append(testCasePtr->TestCaseTitle() );
-    return *iBuffer;
-    }
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CContainer::ConstructL()
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::~CContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CContainer::~CContainer()
-    {
-    iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
-    delete iListBox;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CContainer::SetGraphicIconL
-// 
-// Sets graphic icon using listbox as CEikColumnListBox.
-// ----------------------------------------------------------------------------
-//
-void CContainer::SetGraphicIconL( CEikColumnListBox* aListBox )
-	{
-	    if ( aListBox )
-	        {
-	        // Creates gul icon.
-	        CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
-	        CleanupStack::PushL( iconArray );
-	        
-	        GraphicIconL( iconArray ); // Appends graphic data.
-	        
-	        // Sets graphics as ListBox icon.
-	        aListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
-	        
-	        CleanupStack::Pop();
-	        }
-	    }
-
-// ----------------------------------------------------------------------------
-// CContainer::CurrentItemIndex
-// 
-// Returns current item index in list box.
-// ----------------------------------------------------------------------------
-//
-TInt CContainer::CurrentItemIndex()
-    {
-    return iListBox->CurrentItemIndex();
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::SetCurrentItemIndex
-// 
-// Sets current item index in list box.
-// ----------------------------------------------------------------------------
-//
-void CContainer::SetCurrentItemIndex(TInt aCurrentTestCase)
-    {
-    iListBox->SetCurrentItemIndexAndDraw(aCurrentTestCase);
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::GraphicIconL
-// 
-// Appends graphics data.
-// ----------------------------------------------------------------------------
-//
-void CContainer::GraphicIconL( CArrayPtr<CGulIcon>* aIcons )
-    {
-    if ( aIcons )
-            {
-            CFbsBitmap* markBitmap = NULL;
-            CFbsBitmap* markBitmapMask = NULL;
-    	
-            TRgb defaultColor;
-            defaultColor = CEikonEnv::Static()->Color(EColorControlText);
-    	
-            AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
-            		KAknsIIDQgnIndiMarkedAdd,
-            		KAknsIIDQsnIconColors,
-            		EAknsCIQsnIconColorsCG13,
-            		markBitmap,
-            		markBitmapMask,
-            		AknIconUtils::AvkonIconFileName(),
-            		EMbmAvkonQgn_indi_marked_add,
-            		EMbmAvkonQgn_indi_marked_add_mask,
-            		defaultColor );
-            
-            CGulIcon* markIcon = CGulIcon::NewL(markBitmap,markBitmapMask);
-            aIcons->AppendL(markIcon); 
-            }
-        }
-
-
-// ----------------------------------------------------------------------------
-// CContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::SelectedTestCases
-// 
-// Returns pointers to selected test cases.
-// ----------------------------------------------------------------------------
-//
-void CContainer::SelectedTestCases
-                            (RPointerArray<CTestInfo>& aSelectedTestCases)
-    {
-    aSelectedTestCases.Append( iTestCasesInView[iListBox->CurrentItemIndex()] );
-    }
-
-    
-// ----------------------------------------------------------------------------
-// CContainer::HandleMarkCommandL
-// 
-// Handles mark commands.
-// ----------------------------------------------------------------------------
-//
-void CContainer::HandleMarkCommandL( TInt aCommand )
-	{
-	if (iListBox)
-		{
-		AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );		
-		}
-	}
-
-// ----------------------------------------------------------------------------
-// CContainer::ProcessCommandL
-// 
-// Processes user commands.
-// ----------------------------------------------------------------------------
-//
-void CContainer::ProcessCommandL( TInt  aCommand )
-	{
-	AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );
-    }
-    
-// ----------------------------------------------------------------------------
-// CContainer::SelectionListProcessCommandL
-// 
-// Processes user commands.
-// ----------------------------------------------------------------------------
-//     
-void CContainer::SelectionListProcessCommandL( TInt  aCommand )
-	{
-	AknSelectionService::HandleSelectionListProcessCommandL( aCommand, iListBox );
-    }
-    
-// ----------------------------------------------------------------------------
-// CContainer::FilterCasesByModuleL
-// 
-// Show only testcases which are defined is specified module.
-// ----------------------------------------------------------------------------
-//
-void CContainer::FilterCasesByModuleL( TName aModuleName )
-    {
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-   
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        if ( allCases[i].ModuleName() == aModuleName )
-            {
-            iTestCasesInView.Append( &( allCases[i] ) );
-            }
-        }
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::FilterCasesByTCFileNameL
-// 
-// Show only testcases which are defined is specified test case file.
-// ----------------------------------------------------------------------------
-//
-void CContainer::FilterCasesByTCFileNameL( 
-                                                TFileName aTestCaseFileName )
-    {
-
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-  
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        if ( allCases[i].TestCaseFile() == aTestCaseFileName )
-            {
-            iTestCasesInView.Append( &( allCases[i] ) );
-            }
-        }
-
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::NoFilteringL
-// 
-// Remove possible filtering of test cases -> show all test cases.
-// ----------------------------------------------------------------------------
-//
-void CContainer::NoFilteringL()
-    {
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-
-    // Add all cases to iTestCasesInView pointer array
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        iTestCasesInView.Append( &( allCases[i] ) );
-        }
-
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// End of File
--- a/stifui/stifui/src/CreatedTestSetMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,210 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This fiole contains CreatedTestSetMenuContainer class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>   // ListBox
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> // CColumnListBoxData
-
-#include "CreatedTestSetMenuContainer.h"
-#include "StartCasesView.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "Container.h"
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ConstructL"));
-
-	iParentView = (CCreatedTestSetMenuView*)aListBoxObserver;
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    iTestCasesInView.Reset();
-    
-	iListBox = CMenuListBox::NewL(ECreatedTestSetMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // 
-    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-
-    if ( iUIStore )
-        {
-        CDesCArray* items = static_cast<CDesCArray*> (iListBox->Model()->ItemTextArray());
-        
-        //Create list of available Test Set
-        RRefArray<TDesC>    allSet;      
-        RRefArray<CTestInfo> allCases;
-        TInt ret = iUIStore->GetTestSetsList( allSet );
-        if( KErrNone != ret )
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->GetTestSetsList() fails"));
-            allSet.Reset();
-            allSet.Close();
-            User::Leave( ret );
-            }
-
-        const TInt KTestCaseCount = allSet.Count();
-        for (TInt i=0; i <KTestCaseCount; i++)
-            {
-            _LIT(KItemFromat, "0\t%S\t\t");
-     
-           RBuf tmp;
-           tmp.Create(allSet[i].Length() + 6);
-           tmp.Format( KItemFromat, &allSet[i] );
-           items->AppendL( tmp );
-           tmp.Close();
-           }
-       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: ListBox model"));         
-       iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-       iListBox->HandleItemAdditionL();
- 
-        allSet.Reset();
-        allSet.Close();
-        }
-    else
-        {
-        User::Leave( KErrGeneral );
-        }
-
-    // Creates graphic.
-    SetGraphicIconL( iListBox );
-       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("CCreatedTestSetMenuContainer: icons created"));
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-//CreatedTestSetMenuContainer::~CStartCasesContainer
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CCreatedTestSetMenuContainer::~CCreatedTestSetMenuContainer()
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuContainer::SizeChanged()
-    {
-    
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-//CreatedTestSetMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CCreatedTestSetMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CCreatedTestSetMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CCreatedTestSetMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-	if (iListBox)
-		{
-	
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuContainer:::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File
--- a/stifui/stifui/src/CreatedTestSetMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartCasesView class definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <aknlistquerydialog.h> 
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "CreatedTestSetMenuView.h"
-#include  "CreatedTestSetMenuContainer.h"
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-#include "TestSetMenuView.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStartCasesView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::ConstructL()
-    {
-    CView::ConstructL();  
-    BaseConstructL(R_APPUI_LOADTESTSETVIEW);
-    iCurrentTestCase = 0;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::~CStartCasesView
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CCreatedTestSetMenuView::~CCreatedTestSetMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CCreatedTestSetMenuView::Id() const
-    {
-    return TUid::Uid(ECreatedTestSetMenuViewId);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-            {
-            case EAknSoftkeyBack:
-                {
-                AppUi()->HandleCommandL(EAppUIGoToTestSetsMenu);
-                break;
-                }
-    		case EAknCmdOpen:
-    			{
-    		   		HandleListBoxEventL(iContainer->ListBox(), EEventEnterKeyPressed);	
-    			break;
-    			}
-            default:
-                {
-                AppUi()->HandleCommandL( aCommand );
-                break;
-                }
-            }
-
-    }
-
-// ----------------------------------------------------------------------------
-//CreatedTestSetMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("CreatedTestSetMenuView: DoActivateL"));
-        iContainer = new (ELeave) CCreatedTestSetMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("CreatedTestSetMenuView: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-
-    iContainer->SetCurrentItemIndex(iCurrentTestCase);
-    
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_LOADTESTSET);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CreatedTestSetMenuView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CCreatedTestSetMenuView::HandleListBoxEventL( CEikListBox* aListBox, 
-    TListBoxEvent aEventType )
-	{
-	if (  aEventType == MEikListBoxObserver::EEventEnterKeyPressed    )
-		{
-	 	// Checking with item from list was selected	
-		CTextListBoxModel* tmp = (CTextListBoxModel*)aListBox->Model();
-		TPtrC item = tmp->ItemText(aListBox->CurrentItemIndex());
-		// Geting propper format of item from list (ex. 2008_8_10_13_16.set ). 
-		TPtrC substracted(item.Left(item.Length()-2));
-		substracted.Set(substracted.Right(substracted.Length()-2));
-		// Creating new view containing 		
-       	CTestSetMenuView* testSetMenu = (CTestSetMenuView*)AppUi()->View( TUid::Uid(ETestSetMenuViewId) ); 
-       	TInt	error = testSetMenu->LoadTestSetL( substracted );
-		AppUi()->HandleCommandL(ECmdGoToTestSetView);
-		
-        }
- 
-    }
-
-
-// End of File
--- a/stifui/stifui/src/MainMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMainMenuContainer class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>  // ListBox
-
-#include <barsread.h> // for TResourceReader
-
-#include <aknnotewrappers.h>
-
-#include "MainMenuContainer.h"
-#include "Stifui.hrh"
-#include <Stifui.rsg>
-#include "MenuListBox.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CMainMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor
-// ---------------------------------------------------------
-//
-void CMainMenuContainer::ConstructL(const TRect& aRect)
-    {
-    CreateWindowL();
-
-	iListBox = CMenuListBox::NewL(EMainMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC( reader, R_MAIN_MENU_LISTBOX );
-	iListBox->SetListBoxObserver( this );
-	iListBox->ConstructFromResourceL( reader );
-	CleanupStack::PopAndDestroy(); // resource stuffs. 
-	iListBox->ActivateL(); // Sets control as ready to be drawn
-	
-	// retrieve previous position of focus for this view/continer and set focus to this value
-	((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-
-// ---------------------------------------------------------
-// CMainMenuContainer::~CMainMenuContainer
-//
-// Destructor
-// ---------------------------------------------------------
-//
-CMainMenuContainer::~CMainMenuContainer()
-    {
-	if( iListBox )
-		{
-		delete iListBox;
-		iListBox = NULL;
-		}
-	}
-
-// ---------------------------------------------------------
-// CMainMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-//
-void CMainMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ---------------------------------------------------------
-// CMainMenuContainer::CountComponentControls
-//
-// Returns number of controls indside this container.
-// ---------------------------------------------------------
-//
-TInt CMainMenuContainer::CountComponentControls() const
-    {
-    return 1;
-    }
-
-// ---------------------------------------------------------
-// CMainMenuContainer::ComponentControl
-// 
-// Gets the specified component of a compound control.
-// ---------------------------------------------------------
-//
-CCoeControl* CMainMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// CMainMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ---------------------------------------------------------
-//
-void CMainMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-// ---------------------------------------------------------
-// CMainMenuContainer::HandleListBoxEventL
-//
-// Handles list box events.
-// ---------------------------------------------------------
-//
-void CMainMenuContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
-	{
-
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{	
-        HandleSelectedListItemL( aListBox->CurrentItemIndex() );
-		}
-
-	}
-	
-// ----------------------------------------------------------------------------
-// CMainMenuContainer::HandleSelectedListItemL
-//
-// Method HandleSelectedListItemL handles valix index.
-// ----------------------------------------------------------------------------
-//
-void CMainMenuContainer::HandleSelectedListItemL( TInt aIndex )
-	{	 
-		TInt selection = aIndex;
-        
-        // Change active view.
-	    switch ( selection )
-        {
-		    case 0:
-				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestCaseMenu);
-				break;
-			case 1:
-				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToModulesMenu);
-				break;
-			case 2: 
-				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
-				break;
-	        default:
-				break;
-		}
-	}
-
-// ---------------------------------------------------------
-// CMainMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ---------------------------------------------------------
-//
-TKeyResponse CMainMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-{
-	if (aType != EEventKey)
-	{
-		return EKeyWasNotConsumed;
-	}
-
-	// Offers key events to list box
-	if (iListBox)
-	{
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-	}
-	else
-	{
-		return EKeyWasNotConsumed;
-	}
-}
-
-// ----------------------------------------------------------------------------
-// CMainMenuContainer:::GetActiveLine
-//
-// Get currently selected items index.
-// ----------------------------------------------------------------------------
-//
-TInt CMainMenuContainer::GetActiveLine()
-	{
-	return iListBox->CurrentItemIndex();
-	}
-
-// ----------------------------------------------------------------------------
-// CMainMenuContainer:::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CMainMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File  
--- a/stifui/stifui/src/MainMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMainMenuView class definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "MainMenuView.h"
-#include  "MainMenuContainer.h" 
-#include  "Stifui.hrh"
-#include  "AppUIAppUi.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CMainMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor
-// ---------------------------------------------------------
-//
-void CMainMenuView::ConstructL()
-    {
-    BaseConstructL( R_APPUI_MAINMENUVIEW );
-    }
-
-// ---------------------------------------------------------
-// CMainMenuView::~CMainMenuView
-// 
-// Destructor
-// ---------------------------------------------------------
-//
-CMainMenuView::~CMainMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ---------------------------------------------------------
-// TUid CMainMenuView::Id
-// 
-// Returns view´s id.
-// ---------------------------------------------------------
-//
-TUid CMainMenuView::Id() const
-    {
-    return TUid::Uid(EMainMenuViewId); //KMainMenuViewId;
-    }
-
-// ---------------------------------------------------------
-// CMainMenuView::HandleCommandL
-// 
-// Handles a command.
-// ---------------------------------------------------------
-//
-void CMainMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EEikCmdExit);
-            break;
-            }
-		case EAknCmdOpen:
-			{
-			TInt a = iContainer->GetActiveLine();
-			iContainer->HandleSelectedListItemL( a );
-			}
-			break;              
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CMainMenuView::HandleClientRectChange
-//
-// Handles client rect changes.
-// ---------------------------------------------------------
-//
-void CMainMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CMainMenuView::DoActivateL
-//
-// Initializes view when activated.
-// ---------------------------------------------------------
-//
-void CMainMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CMainMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-		
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_MAIN);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	
-	np->PushL(*iNaviDecorator);
-   }
-
-// ---------------------------------------------------------
-// CAppUIView::DoDeactivate
-// 
-// Deactivates view.
-// ---------------------------------------------------------
-//
-void CMainMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// End of File
-
-// End of File
--- a/stifui/stifui/src/MenuListBox.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CMenuListBox class definition.
-*
-*/
-
-// INCLUDE FILES
-#include "MenuListBox.h"
-#include <aknview.h>
-
-// ================= MEMBER FUNCTIONS =======================
-// ---------------------------------------------------------
-// CMainMenuView::CMenuListBox
-// 
-// c++ constructor
-// ---------------------------------------------------------
-//
-CMenuListBox::CMenuListBox(TAppUIViewNumber aViewId) 
-	: CAknSingleStyleListBox(), iViewId(aViewId)
-	{
-	}
-
-// ---------------------------------------------------------
-// CMenuListBox::ConstructL
-// 
-// Symbian OS two-phased constructor
-// ---------------------------------------------------------
-//
-void CMenuListBox::ConstructL()
-	{
-	
-	}
-
-// ---------------------------------------------------------
-// CMenuListBox::~CMenuListBox
-// 
-// Destructor
-// ---------------------------------------------------------
-//
-CMenuListBox::~CMenuListBox()
-	{
-
-	}
-
-// ---------------------------------------------------------
-// CMenuListBox::NewL
-// 
-// Symbian OS public constructor
-// @param aViewId - id of view to identify position in array where focus position will be saved to
-// or retrieved from
-//
-// @return - pointer to an instance of CMenuListBOx
-// ---------------------------------------------------------
-//
-CMenuListBox* CMenuListBox::NewL(TAppUIViewNumber aViewId)
-	{
-	CMenuListBox* self = new(ELeave) CMenuListBox(aViewId);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-// ---------------------------------------------------------
-// CMenuListBox::SaveFocusPosition
-// 
-// Saves current focus position to CAppUiAppUi object
-// ---------------------------------------------------------
-//
-void CMenuListBox::SaveFocusPosition()
-	{
-	((CAppUIAppUi*)iCoeEnv->AppUi())->SaveFocusPosition(iViewId, this->CurrentItemIndex());
-	}
-
-// ---------------------------------------------------------
-// CMenuListBox::SetPreviousFocus
-// 
-// Retrieves previous focus position from CAppUiAppUi object and sets focus
-// to that position
-// ---------------------------------------------------------
-//
-void CMenuListBox::SetPreviousFocus()
-	{
-	TInt previousPosition = ((CAppUIAppUi*)iCoeEnv->AppUi())->GetFocusPosition(iViewId);
-	if(previousPosition != KErrNotFound)
-		{
-		if(previousPosition < this->Model()->NumberOfItems() && previousPosition != 0)
-			{
-			this->SetCurrentItemIndex(previousPosition);
-			}
-		if(previousPosition >= this->Model()->NumberOfItems()) 
-			{
-			this->SetCurrentItemIndex(0); // setting current item to first element if pervious position is grater then current. 
-			}
-		this->SetTopItemIndex(0);
-		}
-	}
--- a/stifui/stifui/src/ShowStartedCasesContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,648 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedTestsListBoxModel class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h>  // CAknIconArray
-#include <badesca.h> // CDesCArray
-#include <eikclbd.h> // CColumnListBoxData
-#include <aknnotewrappers.h>
-
-#include <Stifui.rsg>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include "ShowStartedCasesContainer.h"
-
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ---------------------------------------------------------
-// CStartedTestsListBoxModel::NewL
-// 
-// Symbian OS two phased constructor
-// ---------------------------------------------------------
-//
-CStartedTestsListBoxModel* CStartedTestsListBoxModel::NewL 
-            ( RRefArray<CStartedTestCase>* aTestCasesInView )
-    {
-    CStartedTestsListBoxModel* self = new ( ELeave ) CStartedTestsListBoxModel();
-    CleanupStack::PushL( self );
-    self->iBuffer = HBufC::NewL( 130 );
-    self->iTestCasesInView = aTestCasesInView;
-    CleanupStack::Pop();
-    return self;
-
-    }
-
-// ---------------------------------------------------------
-// CStartedTestsListBoxModel::ConstructL
-// 
-// Symbian OS two phased constructor
-// Completes the construction of the object.
-// ---------------------------------------------------------
-//
-
-void CStartedTestsListBoxModel::ConstructL()
-    {
-    }
-
-// ---------------------------------------------------------
-// CStartedTestsListBoxModel::~CStartedTestsListBoxModel
-// 
-// Destructor
-// ---------------------------------------------------------
-//
-
-CStartedTestsListBoxModel::~CStartedTestsListBoxModel()
-    {
-    }
-
-// ---------------------------------------------------------
-// CStartedTestsListBoxModel::MdcaCount
-// 
-// Returns the number of descriptor elements in the array.
-// ---------------------------------------------------------
-//
-
-TInt CStartedTestsListBoxModel::MdcaCount() const
-    {
-    return iTestCasesInView->Count();
-
-    }
-
-// ---------------------------------------------------------
-// CStartedTestsListBoxModel::MdcaPoint
-// 
-// Indexes into a descriptor array.
-// ---------------------------------------------------------
-//
-TPtrC CStartedTestsListBoxModel::MdcaPoint(TInt aIndex) const
-    {
-    TPtr buffer( iBuffer->Des() );
-    buffer.Zero();
-    switch ( (*iTestCasesInView)[aIndex].Status() )
-        {
-        case CUIStoreIf::EStatusRunning:
-            {
-            if( (*iTestCasesInView)[aIndex].UIEngineContainer().State() ==
-                CUIEngineContainer::ERunning )
-                {
-                buffer.Append(_L("Running\t"));
-                }
-            else
-                {
-                buffer.Append(_L("Paused\t"));
-                }
-            break;
-            }
-        case CUIStoreIf::EStatusPassed:
-            {
-            buffer.Append(_L("Passed\t"));
-            break;
-            }
-        case CUIStoreIf::EStatusFailed:
-            {
-            buffer.Append(_L("Failed\t"));
-            break;
-            }
-        /*case ECrashed:
-            buffer.Append(_L("Crashed\t"));
-            break;*/
-        case CUIStoreIf::EStatusAborted:
-        	{
-            buffer.Append(_L("Aborted\t"));
-            break;
-        	}
-        default:
-        	{
-            if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusPassed)
-            	{
-            	buffer.Append(_L("Passed\t"));
-            	}
-        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusFailed)
-            	{
-            	buffer.Append(_L("Failed\t"));
-            	}
-        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusAborted)
-            	{
-            	buffer.Append(_L("Aborted\t"));
-            	}
-        	else if((*iTestCasesInView)[aIndex].Status() & CUIStoreIf::EStatusCrashed)
-	        	{
-	            buffer.Append(_L("Crashed\t"));
-	        	}
-        	else
-        		{
-        		buffer.Append(_L("\t"));
-        		}
-        	break;
-        	}
-        }
-        
-    buffer.Append((*iTestCasesInView)[aIndex].TestInfo().TestCaseTitle() );
-    
-    return *iBuffer;
-    
-    }
-
-
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::ConstructL
-// 
-// Symbian OS two phased constructor
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-    
-    if(KSelectedMode == EShowOngoingCases || KSelectedMode == EShowPausedCases
-    		|| KSelectedMode == EShowCrashedAbortedCases  || KSelectedMode == EShowAllStartedCases)
-    	{
-    	iListBox = new (ELeave) CAknSingleHeadingStyleListBox();
-    	}
-    else
-    	{
-    	iListBox = CMenuListBox::NewL(EShowStartedCasesViewId); //CAknSingleStyleListBox();
-    	}
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver );
-    iListBox->ConstructL(this, EAknListBoxSelectionList);
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-
-    if ( iUIStore )
-        {
-        ConstructListBoxModelL();
-        iListBoxModel = CStartedTestsListBoxModel::NewL( &iStartedTestsPtrs );
-        iListBox->Model()->SetItemTextArray(iListBoxModel);
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-	iListBox->ActivateL();
-	if(KSelectedMode != EShowOngoingCases && KSelectedMode != EShowPausedCases
-	    	&& KSelectedMode != EShowCrashedAbortedCases  && KSelectedMode != EShowAllStartedCases)
-		{
-		((CMenuListBox*)iListBox)->SetPreviousFocus();
-		}
-
-    SetRect(aRect);
-    ActivateL();
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::ConstructListBoxModelL
-// 
-// Constructs list box model without any filtering.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::ConstructListBoxModelL()
-    {
-    TInt ret( 0 );
-    RRefArray<CStartedTestCase> startedTestCases;
-    ret = iUIStore->StartedTestCases( startedTestCases );
-    if( KErrNone != ret )
-        {
-        startedTestCases.Reset();
-        startedTestCases.Close();
-        User::Leave( ret );
-        }
-    CleanupClosePushL( startedTestCases ); // Closes the handle
-
-    const TInt KStartedCaseCount = startedTestCases.Count();
-
-    iStartedTestsPtrs.Reset(); // Remove all pointers (does not delete objects)
-
-    const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-
-    // Loop through all started cases
-    for( TInt i=0; i < KStartedCaseCount; i++ )
-        {
-        switch ( KSelectedMode )
-            {
-            case EShowAllStartedCases:
-                {
-                iStartedTestsPtrs.Append( startedTestCases[i] );
-                break;
-                }
-            case EShowOngoingCases:
-                {
-                // Note: PAUSE IS ALSO RUNNIN STATUS
-                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusRunning )
-                    {
-                    iStartedTestsPtrs.Append(startedTestCases[i]);
-                    }
-                break;
-                }
-            case EShowPassedCases:
-                {
-                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusPassed )
-                    {
-                    iStartedTestsPtrs.Append( startedTestCases[i] );
-                    }
-                break;
-                }
-            case EShowPausedCases:
-                {
-                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusRunning )
-                    {
-                    if( startedTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused )
-                        {
-                        iStartedTestsPtrs.Append( startedTestCases[i] );
-                        }
-                    }
-                break;
-                }
-            case EShowFailedCases:
-                {
-                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusFailed )
-                    {
-                    iStartedTestsPtrs.Append( startedTestCases[i] );
-                    }
-                break;
-                }
-            case EShowCrashedAbortedCases:
-                {
-                if ( startedTestCases[i].Status() & CUIStoreIf::EStatusAborted 
-                		|| startedTestCases[i].Status() & CUIStoreIf::EStatusCrashed)
-                    {
-                    iStartedTestsPtrs.Append( startedTestCases[i] );
-                    }
-                break;
-                }
-            }
-        }
-    startedTestCases.Reset();
-    startedTestCases.Close();
-
-    CleanupStack::PopAndDestroy(); // startedTestCases
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::~CShowStartedCasesContainer
-// 
-// Destructor
-// ---------------------------------------------------------
-//
-CShowStartedCasesContainer::~CShowStartedCasesContainer()
-    {
-    iStartedTestsPtrs.Close(); // does not delete objects whose pointers are contained in the array
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::SizeChanged
-// 
-// Called by framework when the view size is changed
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::CountComponentControls
-//
-// Gets a count of the component controls of this list box control.
-// ---------------------------------------------------------
-//
-TInt CShowStartedCasesContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::ComponentControl
-//
-// Gets a pointer to the specified component control.
-// ---------------------------------------------------------
-//
-CCoeControl* CShowStartedCasesContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::Draw
-// 
-// Draw a control, called by window server.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ---------------------------------------------------------
-//
-TKeyResponse CShowStartedCasesContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-	if (iListBox)
-		{
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-		
-	}
-	
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::SelectedTestCase
-// 
-// Returns reference to currently selected test case in view (listbox).
-// ---------------------------------------------------------
-//
-CStartedTestCase* CShowStartedCasesContainer::SelectedTestCase()
-    {
-    if ( iStartedTestsPtrs.Count() > 0 )
-        {
-        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
-        }
-    else
-        {
-        return NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::DrawListBox
-// 
-// Refresh ListBox, if aSelectedTestCase is still found from ListBox
-// it is set as selected test case.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::DrawListBox()
-    {
-    if ( iListBox )
-        {
-        iListBox->DrawNow();
-        }
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::HandleItemAdditionL
-// 
-// Refresh ListBox after new item was added to listbox model.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::HandleItemAdditionL()
-    {
-    iListBox->HandleItemAdditionL();
-
-    }
-
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::HandleItemRemovalL
-// 
-// Refresh ListBox after item is removed from listbox model.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::HandleItemRemovalL()
-    {
-    iListBox->HandleItemRemovalL();
-
-    // HandleItemRemovalL "loses selection" if current item is removed
-    // -> we have to check it and set one item as current item to make it possible for
-    // user to select one item from items left after remove
-    if ( iListBox->CurrentItemIndex() == -1 ) // No item selected
-        if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount() > 0 ) // there are items
-            SetCurrentItemIndex(0);
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::TestsInViewCount
-// 
-// Returns count of test cases in view.
-// ---------------------------------------------------------
-//
-TInt CShowStartedCasesContainer::TestsInViewCount()
-    {
-    return ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
-
-    }
-    
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::CurrentTestCase
-// 
-// Returns pointer to currently selected test case.
-// ---------------------------------------------------------
-//
-CStartedTestCase* CShowStartedCasesContainer::CurrentTestCase()
-    {
-    return &iStartedTestsPtrs[ iListBox->CurrentItemIndex() ];
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::SetCurrentItemIndex
-// 
-// Sets the current item.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::SetCurrentItemIndex(TInt aIndex)
-    {
-    TInt itemCount = ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
-    if ( aIndex < itemCount )
-        {
-        iListBox->SetCurrentItemIndex(aIndex);
-        }
-    else
-        {
-        iListBox->SetCurrentItemIndex(itemCount);
-        }
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::ResetListBox
-// 
-// Resets the selection indices, top and current item indices,
-// the selection, and the horizontal scroll offset of this list box.
-// This function does not redraw the list box.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::ResetListBox()
-    {
-    iListBox->Reset();
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::RemoveSelectedExecutionsL
-// 
-// Removes items from list box.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::RemoveSelectedExecutionsL()
-    {
-    TInt indexOfRemovedExecution = 0;
-    iStartedTestsPtrs.Remove(indexOfRemovedExecution);
-    HandleItemRemovalL();
-
-    }
-
-// ---------------------------------------------------------
-// CShowStartedCasesContainer::RemoveAllExecutionsInViewL
-// 
-// Removes all started test cases from list box.
-// ---------------------------------------------------------
-//
-void CShowStartedCasesContainer::RemoveAllExecutionsInViewL()
-    {
-    TInt exutionsInViewCount = iStartedTestsPtrs.Count();
-    iStartedTestsPtrs.Reset(); //Empties the array, does not delete the objects whose pointers are contained in the array
-    HandleItemRemovalL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::FilterCasesByModuleL
-// 
-// Show only testcases which are defined is specified module.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesContainer::FilterCasesByModuleL(TName aModuleName)
-    {
-    //First the list box model have to be reconstructed to make sure that all
-    //possible earlier filtering does not affect
-    ConstructListBoxModelL();
-    
-    TInt i;
-    const TInt KCurrentShowedCaseCount = iStartedTestsPtrs.Count();
-
-    for ( i = KCurrentShowedCaseCount-1; i >= 0; i-- )
-        {
-        RRefArray<CStartedTestCase> startedTestCases;
-        TInt ret = iUIStore->StartedTestCases( startedTestCases );
-        if( ret != KErrNone )
-            {
-            startedTestCases.Reset();
-            startedTestCases.Close();
-            }
-        if ( startedTestCases[i].TestInfo().ModuleName() != aModuleName )
-            {
-            iStartedTestsPtrs.Remove(i); // delete pointer to CStartedTestCase
-            }
-        startedTestCases.Reset();
-        startedTestCases.Close();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::FilterCasesByTCFileNameL
-// 
-// Show only testcases which are defined is specified test case file.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesContainer::FilterCasesByTCFileNameL(TFileName aTestCaseFileName)
-    {
-
-    //First the list box model have to be reconstructed to make sure that all
-    //possible earlier filtering does not affect
-    ConstructListBoxModelL();
-
-    const TInt KCurrentShowedCaseCount = iStartedTestsPtrs.Count();
-
-    for ( TInt i = KCurrentShowedCaseCount-1; i >= 0; i-- )
-        {
-        RRefArray<CStartedTestCase> startedTestCases;
-        TInt ret = iUIStore->StartedTestCases( startedTestCases );
-        if( ret != KErrNone )
-            {
-            startedTestCases.Reset();
-            startedTestCases.Close();
-            }
-        if ( startedTestCases[i].TestInfo().TestCaseFile() != aTestCaseFileName )
-            {
-            iStartedTestsPtrs.Remove(i); // delete pointer to CStartedTestCase
-            }
-        startedTestCases.Reset();
-        startedTestCases.Close();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CContainer::NoFilteringL
-// 
-// Remove possible filtering of test cases -> show all test cases.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesContainer::NoFilteringL()
-    {
-    ConstructListBoxModelL();
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesContainer:::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File  
--- a/stifui/stifui/src/ShowStartedCasesView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,668 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CShowStartedCasesView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-
-//#include  "UIEngineContainer.h"  
-#include <stifinternal/UIEngineContainer.h>
-
-#include  "Stifui.hrh" 
-#include  "ShowStartedCasesView.h"
-#include  "ShowStartedCasesContainer.h"
-#include  "AppUIAppUi.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::ConstructL
-// 
-// Symbian OS two-phased constructor
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_SHOWSTARTEDCASESVIEW );
-    iFilterModule.Zero();
-    iFilterTestCaseFile.Zero();
-    iSelectedTestCase=0;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::~CShowStartedCasesView()
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CShowStartedCasesView::~CShowStartedCasesView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// TUid CShowStartedCasesView::Id()
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CShowStartedCasesView::Id() const
-    {
-    return TUid::Uid(EShowStartedCasesViewId);
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::HandleCommandL(TInt aCommand)
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::HandleCommandL(TInt aCommand)
-    {   
-    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile )
-        {
-        TInt moduleNumber = aCommand - ECmdFilterByModule;
-        RRefArray<TDesC> testModules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( testModules );
-        if( KErrNone != ret )
-            {
-            testModules.Reset();
-            testModules.Close();
-            User::Leave( ret );
-            }
-        iFilterModule = testModules[moduleNumber];
-            
-        iFilterTestCaseFile.Zero();
-        
-        iContainer->FilterCasesByModuleL(iFilterModule);
-        //iContainer->ResetListBox();
-        //iContainer->DrawListBox();
-        
-        testModules.Reset();
-        testModules.Close();
-
-        return;
-        }
-
-    else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
-        {
-        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }
-
-        iFilterTestCaseFile = testCaseFiles[ testCaseFileNumber ];
-        iFilterModule.Zero();
-        //iContainer->FilterCasesByTCFileNameL(testCaseFileName);
-        iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
-        iContainer->ResetListBox();
-        iContainer->DrawListBox();
-
-        testCaseFiles.Reset();
-        testCaseFiles.Close();
-
-        return;
-        }
-
-    else if ( aCommand == ECmdNOFiltering )
-        {
-        iFilterModule.Zero();
-        iFilterTestCaseFile.Zero();
-        iContainer->NoFilteringL();
-        iContainer->ResetListBox();
-        iContainer->DrawListBox();
-        return;
-        }
-
-    // Handle rest possible commands
-    switch ( aCommand )
-        {
-        case ECmdViewOutput:
-            {
-            ViewTestCaseOutputL();
-            break;
-            }
-        case ECmdRemoveExecution:
-            {
-            iContainer->RemoveSelectedExecutionsL();
-            break;
-            }
-        case ECmdRemoveAllExecutions:
-            {
-            iContainer->RemoveAllExecutionsInViewL();
-            break;
-            }
-        case ECmdPauseTestCase:
-            {
-            TInt index = iContainer->CurrentItemIndex();
-            RRefArray<CStartedTestCase> runningTestCases;
-            TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-			TInt ret = KErrNone;
-			if(currentMode == EShowAllStartedCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
-			else if(currentMode == EShowOngoingCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
- 			if( KErrNone != ret )
- 			    {
- 			    User::Leave( ret );
- 			    }
- 			runningTestCases[index].UIEngineContainer().PauseTest();
- 			runningTestCases.Close();
-            break;
-            }
-        case ECmdResumeTestCase:
-            {
-            TInt index = iContainer->CurrentItemIndex();
-            RRefArray<CStartedTestCase> runningTestCases;
-            TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-			TInt ret = KErrNone;
-			if(currentMode == EShowAllStartedCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
-			else if(currentMode == EShowOngoingCases || currentMode == EShowPausedCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
- 			if( KErrNone != ret )
- 			    {
- 			    User::Leave( ret );
- 			    }
- 			TInt testCaseToControl = 0;
- 			if(currentMode == EShowAllStartedCases || currentMode == EShowOngoingCases)
-				{
-				testCaseToControl = index;
-				}
-			else if(currentMode == EShowPausedCases)
-				{
-				TInt pausedTestCasesCounter = 0;
-				for(int i = 0; i < runningTestCases.Count(); i++)
-					{
-					if(runningTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused)
-						{
-						if(pausedTestCasesCounter == index)
-							{
-							testCaseToControl = i;
-							break;
-							}
-						pausedTestCasesCounter++;
-						}
-					}
-				}
- 			
- 			runningTestCases[testCaseToControl].UIEngineContainer().ResumeTest();
- 			runningTestCases.Close();
-            break;
-            }
-        case ECmdAbortTestCase:
-            { 
-			TInt index = iContainer->CurrentItemIndex();
-			RRefArray<CStartedTestCase> runningTestCases;
-			TShowStartedCasesMode currentMode = (TShowStartedCasesMode)((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-			TInt ret = KErrNone;
-			if(currentMode == EShowAllStartedCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusAll);
-			else if(currentMode == EShowOngoingCases || currentMode == EShowPausedCases)
-				ret = iUIStore->StartedTestCases(runningTestCases, CUIStoreIf::EStatusRunning);
-				
-			if( KErrNone != ret )
-			    {
-			    User::Leave( ret );
-			    }
-			TInt testCaseToControl = 0;
-			
-			if(currentMode == EShowAllStartedCases || currentMode == EShowOngoingCases)
-				{
-				testCaseToControl = index;
-				}
-			else if(currentMode == EShowPausedCases)
-				{
-				TInt pausedTestCasesCounter = 0;
-				for(int i = 0; i < runningTestCases.Count(); i++)
-					{
-					if(runningTestCases[i].UIEngineContainer().State() == CUIEngineContainer::EPaused)
-						{
-						if(pausedTestCasesCounter == index)
-							{
-							testCaseToControl = i;
-							break;
-							}
-						pausedTestCasesCounter++;
-						}
-					}
-				}
-			
-			runningTestCases[testCaseToControl].UIEngineContainer().CancelTest();
-			runningTestCases.Close();
-            break;
-            }
-        case EAknSoftkeyOk:
-            {
-            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
-            break;
-            }
-        case EAknSoftkeyBack:
-            {
-            // Remove possible filterings so that they does not affect when coming again to this view
-            iFilterModule.Zero();
-            iFilterTestCaseFile.Zero();
-            iSelectedTestCase=0; //Reset selected test case information
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        ViewTestCaseOutputL();
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::ViewTestCaseOutputL
-// 
-// Shows outputs of test case which is selected in Container.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::ViewTestCaseOutputL()
-	{
-    iSelectedTestCase = iContainer->CurrentItemIndex();
-    
-    // Sets index  of selected test case to AppUi
-    //( ( CAppUIAppUi* )AppUi() )->SetTestCaseIndex( iSelectedTestCase );
-    ( ( CAppUIAppUi* )AppUi() )->SetStartedTestCase( iContainer->CurrentTestCase() );
-    
-    AppUi()->HandleCommandL(ECmdViewOutput);
-    }
-
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::HandleClientRectChange()
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CShowStartedCasesContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-
-    // Check if filtering by module or by test case file is selected
-    if ( iFilterModule.Length() )
-        {
-        iContainer->FilterCasesByModuleL(iFilterModule);
-        }
-    else if ( iFilterTestCaseFile.Length() )
-        {
-        iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
-        }
-    if ( iSelectedTestCase )
-        iContainer->SetCurrentItemIndex(iSelectedTestCase);
-    
-    RefreshNaviTitleL();
-    
-    iContainer->DrawListBox();
-   }
-
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::RefreshNaviTitle
-// 
-// Refreshes view name shown in the navi pane.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::RefreshNaviTitleL()
-    {
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	TResourceReader reader;
-
-    switch ( ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode )
-        {
-        case EShowAllStartedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ALL);
-            break;
-        case EShowOngoingCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ONGOING);
-            break;
-        case EShowPausedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PAUSED);
-            break;
-        case EShowPassedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PASSED);
-            break;
-        case EShowFailedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_FAILED);
-            break;
-        case EShowCrashedAbortedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_CRASHED_ABORTED);
-            break;
-        default:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET);
-            break;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;        
-    iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-    }
-    
-    
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        TInt mode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-        if(mode != EShowOngoingCases && mode != EShowPausedCases
-		    	&& mode != EShowCrashedAbortedCases  && mode != EShowAllStartedCases)
-        	{
-        	iContainer->SaveActiveLine();
-        	}
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;        
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-
-    }
-
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    // options menu
-    if ( R_APPUI_SHOWSTARTEDCASESVIEW_MENU == aResourceId )
-        {
-        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-        if ( NULL != startedTestCase )
-            {
-            aMenuPane->SetItemDimmed( ECmdFilterMenu, EFalse );
-            switch ( startedTestCase->Status() )
-                {
-                // test case running
-                case CUIStoreIf::EStatusRunning:
-                    {
-                    switch ( startedTestCase->UIEngineContainer().State() )
-                        {
-                        case CUIEngineContainer::ERunning:
-                        case CUIEngineContainer::EPaused:
-                            {
-                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, EFalse );
-                            break;
-                            }
-                        //case CUIEngineContainer::ENotStarted:
-                        //case CUIEngineContainer::EExecuted:
-                        //case CUIEngineContainer::EFinished:
-                        default:
-                            {
-                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-                            }
-                        }
-                    break;
-                    }
-                        
-                // test case not running
-                //case CUIStoreIf::EStatusPassed:
-                //case CUIStoreIf::EStatusFailed:
-                //case CUIStoreIf::EStatusAborted:
-                //case CUIStoreIf::EStatusExecuted
-                default:
-                    {
-                    aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-                    }
-                }
-            }
-        else
-            {
-            //aMenuPane->SetItemDimmed( ECmdFilterMenu, ETrue );
-            aMenuPane->SetItemDimmed( ECmdViewOutput, ETrue );
-            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-            }
-        }
-
-    // test case control menu
-    if ( R_TESTCASE_CONTROL_SUBMENU == aResourceId )
-        {
-        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-        
-        if ( NULL != startedTestCase )
-            {
-            if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
-                {
-                switch ( startedTestCase->UIEngineContainer().State() )
-                    {
-                    case CUIEngineContainer::ERunning:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
-                        break;
-                        }
-                    case CUIEngineContainer::EPaused:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
-                        break;
-                        }
-                    //case CUIEngineContainer::ENotStarted:
-                    //case CUIEngineContainer::EExecuted:
-                    //case CUIEngineContainer::EFinished:
-                    default:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                        break;
-                        }
-                    }
-                }
-            else
-                {
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                }
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-            }
-        }
-
-    // Test modules are added to filter by test module submenu if the submenu is opened
-    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testModules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( testModules );
-        if( KErrNone != ret )
-            {
-            testModules.Reset();
-            testModules.Close();
-            User::Leave( ret );
-            }        
-        TInt moduleCount = testModules.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByModule;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < moduleCount; i++)
-            {
-            item.iText = testModules[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
-            }
-        
-        testModules.Reset();
-        testModules.Close();
-
-        }
-
-    // Test case files are added to filter by test case file submenu if the submenu is opened
-    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }        
-        TInt testCaseFileCount = testCaseFiles.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByTestCaseFile;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < testCaseFileCount; i++)
-            {
-            item.iText = testCaseFiles[i];
-            // If there´s no test case file, don´t add item to menu.
-            if ( testCaseFiles[i].Length() > 0 )
-                {
-                aMenuPane->AddMenuItemL(item);
-                }
-            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
-            }
-        
-        testCaseFiles.Reset();
-        testCaseFiles.Close();
-
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CShowStartedCasesView::TestCaseStateChangedL
-// 
-// Handles status changes of test cases in view.
-// ----------------------------------------------------------------------------
-//
-void CShowStartedCasesView::TestCaseStateChangedL()
-    {
-    if ( iContainer )
-        {
-
-        //CStartedTestCase* currentlySelectedTest = iContainer->SelectedTestCase();
-
-        TInt numOfTestsInViewBeforeStateChange = iContainer->TestsInViewCount();
-
-            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
-
-        iContainer->ConstructListBoxModelL();
-
-        // Check if filtering by module or by test case file is selected
-        if ( iFilterModule.Length() )
-            {
-            iContainer->FilterCasesByModuleL(iFilterModule);
-            }
-        else if ( iFilterTestCaseFile.Length() )
-            {
-            iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
-            }
-
-        TInt numOfTestsInViewAfterStateChange = iContainer->TestsInViewCount();
-            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
-
-        if ( numOfTestsInViewAfterStateChange >= numOfTestsInViewBeforeStateChange )
-            iContainer->HandleItemAdditionL();
-        else
-            iContainer->HandleItemRemovalL();
-        
-        if(iContainer->CurrentItemIndex() < 0)
-        	{
-        	iContainer->SetCurrentItemIndex(0);
-        	}
-        iContainer->DrawListBox();
-
-        }
-    }
-
-// End of File
--- a/stifui/stifui/src/StartCasesContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartCasesContainer class 
-* definition
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>   // ListBox
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> // CColumnListBoxData
-
-#include "StartCasesContainer.h"
-#include "StartCasesView.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "Container.h"
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ConstructL"));
-
-	iParentView = (CStartCasesView*)aListBoxObserver;
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    iTestCasesInView.Reset();
-        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: iTCInV Reset"));
-    
-	iListBox = CMenuListBox::NewL(EStartCaseMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
-    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-
-    if ( iUIStore )
-        {
-        RRefArray<CTestInfo> allCases;
-        TInt ret = iUIStore->TestCases( allCases );
-        if( KErrNone != ret )
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
-            allCases.Reset();
-            allCases.Close();
-            User::Leave( ret );
-            }
-
-        const TInt KTestCaseCount = allCases.Count();
-        for (TInt i=0; i < KTestCaseCount; i++)
-            {
-            ret = iTestCasesInView.Append( &allCases[i] );
-            if( ret != KErrNone )
-            	{
-            	((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("Test case append fails with: %d"), ret );
-    			User::Leave( ret );
-	            }
-            }
-
-        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model"));
-
-        iListBox->Model()->SetItemTextArray(iListBoxModel);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model set"));
-
-        allCases.Reset();
-        allCases.Close();
-        }
-    else
-        {
-        User::Leave( KErrGeneral );
-        }
-
-    // Creates graphic.
-    SetGraphicIconL( iListBox );
-       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: icons created"));
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::~CStartCasesContainer
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CStartCasesContainer::~CStartCasesContainer()
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CStartCasesContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CStartCasesContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesContainer::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CStartCasesContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-	if (iListBox)
-		{
-		//if multiple items selected
-		if ( iListBox->SelectionIndexes()->Count() > 0 )
-			{
-			TUint mask = 0x40488;
-			
-			//if event is enter key,
-			//don´t send it to listbox
-			if ( aKeyEvent.iScanCode == 0xa7 
-				&& ( aKeyEvent.iModifiers & mask ) == 0 )
-				{
-				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
-				return EKeyWasConsumed;	
-				}
-			}
-			
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesContainer:::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CStartCasesContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File
--- a/stifui/stifui/src/StartCasesView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,474 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartCasesView class definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <aknlistquerydialog.h> 
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "StartCasesView.h"
-#include  "StartCasesContainer.h"
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStartCasesView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_STARTCASESVIEW );
-    iCurrentTestCase = 0;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::~CStartCasesView
-// 
-// Destructor
-// ----------------------------------------------------------------------------
-//
-CStartCasesView::~CStartCasesView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CStartCasesView::Id() const
-    {
-    return TUid::Uid(EStartCaseMenuViewId);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::HandleCommandL(TInt aCommand)
-    {   
-    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
-        {
-        TInt moduleNumber = aCommand - ECmdFilterByModule;
-        RRefArray<TDesC> allModules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
-        if( KErrNone != ret )
-            {
-            allModules.Reset();
-            allModules.Close();
-            User::Leave( ret );
-            }
-        TName moduleName = allModules[ moduleNumber ];
-
-        iContainer->FilterCasesByModuleL( moduleName );
-
-        allModules.Reset();
-        allModules.Close();
-        }
-	else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
-        {
-        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
-        RRefArray<TDesC> allTestCases;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( allTestCases );
-        if( KErrNone != ret )
-            {
-            allTestCases.Reset();
-            allTestCases.Close();
-            User::Leave( ret );
-            }
-        TFileName testCaseFileName = allTestCases[ testCaseFileNumber ];
-
-        iContainer->FilterCasesByTCFileNameL( testCaseFileName );
-
-        allTestCases.Reset();
-        allTestCases.Close();
-        }
-	else if ( aCommand == ECmdNOFiltering )
-        {
-        iContainer->NoFilteringL();
-        }
-    else if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
-    	|| aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
-    	{
-    	iContainer->HandleMarkCommandL( aCommand );
-    	}
-    else
-	    {
- 	    switch ( aCommand )
-	        {
-	        case ECmdStartCases:
-	            {
-	            CheckListBoxSelectionsL( iContainer->ListBox() );
-	            break;
-	            }
-	        case EAknSoftkeyBack:
-	            {
-	            iCurrentTestCase = 0;
-	            AppUi()->HandleCommandL(EAppUIGoBack);
-	            break;
-	            }
-	        default:
-	            {
-	            AppUi()->HandleCommandL( aCommand );
-	            break;
-	            }
-	        }
-	    }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StartCasesView: DoActivateL"));
-        iContainer = new (ELeave) CStartCasesContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StartCasesView: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-
-    iContainer->SetCurrentItemIndex(iCurrentTestCase);
-    
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTCASES);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-
-    // Test modules are added to filter by test module submenu if the submenu is opened
-    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
-        {
-        RRefArray<TDesC> modules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
-        if( KErrNone != ret )
-            {
-            modules.Reset();
-            modules.Close();
-            User::Leave( ret );
-            }
-
-        TInt moduleCount = modules.Count();
-        
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByModule;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < moduleCount; i++)
-            {
-            //item.iText = modules[i].iModuleName;
-            item.iText = modules[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
-            }
-        
-        modules.Reset();
-        modules.Close();
-
-        }
-
-    // Test case files are added to filter by test case file submenu if the submenu is opened
-    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }
-
-        TInt testCaseFileCount = testCaseFiles.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByTestCaseFile;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < testCaseFileCount; i++)
-            {
-            item.iText = testCaseFiles[i];
-            // If there´s no test case file, don´t add item to menu.
-            if ( testCaseFiles[i].Length() > 0 )
-                {
-                aMenuPane->AddMenuItemL(item);
-                }
-            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
-            }
-        
-        testCaseFiles.Reset();
-        testCaseFiles.Close();
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::HandleListBoxEventL( CEikListBox* aListBox, 
-    TListBoxEvent aEventType )
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-		CheckListBoxSelectionsL( aListBox );
-        }
-        
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::CheckListBoxSelectionsL
-// 
-// Checks listbox selections and launches query dialog to start test cases.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::CheckListBoxSelectionsL( CEikListBox* aListBox )
-    {
-    TInt i(0);
-	TInt count = aListBox->SelectionIndexes()->Count();
-
-	RArray<TInt> selectedIndices;
-	CleanupClosePushL( selectedIndices );
-
-	if ( count > 0 )
-	{
-		for( i = 0; i < count; i++ )
-			{
-			selectedIndices.InsertInOrder( 
-			    (*aListBox->SelectionIndexes())[i] );
-			}
-	}
-	
-	// Check count of selected items.
-	if ( count == 1 )
-		{
-		iCurrentTestCase = selectedIndices[0];
-       	StartTestCaseL();
-		}
-	else if (count > 1)
-		{
-       	StartTestCasesL( selectedIndices );	
-		}
-	else
-		{
-		iCurrentTestCase = iContainer->CurrentItemIndex();
-       	StartTestCaseL();	
-		}
-
-    CleanupStack::PopAndDestroy();
-    
-    }
-    
-// ----------------------------------------------------------------------------
-// CStartCasesView::StartTestCaseL
-// 
-// Starts test case which is selected in containers list box.
-// First shows a list query if user wants just start test case or
-// if he wants to start test case and view test case output.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::StartTestCaseL()
-    {
-    TInt selectedItem(0);
-    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
-    if ( startDialog->ExecuteLD(R_START_TESTCASE_LIST_QUERY) )
-        {
-        RRefArray<CTestInfo> testInfo;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases( testInfo );
-        if( KErrNone != ret )
-            {
-            testInfo.Reset();
-            testInfo.Close();
-            User::Leave( ret );
-            }
-        TInt testCaseNumber = iCurrentTestCase;   
-       
-        TInt testCaseIndex( 0 );
-
-        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestCase( testInfo[testCaseNumber], testCaseIndex );
-      
-        if( KErrNone != ret )
-            {
-            User::Leave( ret );
-            }
-        testInfo.Reset();
-        testInfo.Close();
-
-        // Increment the counter value
-        ((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
-     
-        if ( selectedItem == 1 ) // if view output was selected
-            {
-            CStartedTestCase* startedCase = 
-                &((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartedTestCaseL( 
-                testCaseIndex );
-            ((CAppUIAppUi*)AppUi())->SetStartedTestCase( startedCase );
-                
-            AppUi()->HandleCommandL( ECmdViewOutput );
-
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStartCasesView::StartTestCasesL
-// 
-// Starts multiple test cases which are selected in containers list box.
-// Shows a list query if user wants to start cases parallel or sequential.
-// ----------------------------------------------------------------------------
-//
-void CStartCasesView::StartTestCasesL( RArray<TInt> aSelectedIndexes )
-    {
-    _LIT( KTempSet, "TempSet");
-    TInt selectedItem(0);
-    TInt i(0);
-    TInt ret(0);
-    
-    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
-    if ( startDialog->ExecuteLD(R_START_MULTIPLE_TESTCASES_LIST_QUERY) )
-    	{
-    	RRefArray<CTestInfo> testInfo;
-    	CleanupClosePushL( testInfo );
-
-    	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->CreateTestSet( KTempSet );
-    	
-        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases( testInfo );
-        if( KErrNone != ret )
-            {
-            testInfo.Reset();
-            testInfo.Close();
-            User::Leave( ret );
-            }
-        
-        for( i = 0; i < aSelectedIndexes.Count(); i++ )
-        	{
-    		ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->AddToTestSet( KTempSet,
-    		 testInfo[ aSelectedIndexes[i] ] );
-    		if( KErrNone != ret )
-    			{
-    			User::Leave( ret );
-    			}
-    		// Increment the counter value
-        	((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
-	        }
-	    
-	    //start cases
-	    if ( selectedItem == 0 )
-	    	{
-			ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestSet( 
-		        ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestSetL( KTempSet ),
-				i, CStartedTestSet::ESetParallel);
-		    }
-	    else if (selectedItem == 1)
-		    {
-	    	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestSet(
-	    	    ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestSetL( KTempSet ),
-	    	    i, CStartedTestSet::ESetSequential);
-	    	}
-
-        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->RemoveTestSet( KTempSet );
-
-  		CleanupStack::PopAndDestroy();
-    	}
-    }
-
-// End of File
--- a/stifui/stifui/src/StartedCasesMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedCasesMenuContainer
-* class definition.
-*
-*/
-
-// INCLUDE FILES
-#include "StartedCasesMenuContainer.h"
-#include "Stifui.hrh"
-#include <Stifui.rsg>
-
-#include <aknlists.h>  //ListBox
-#include <barsread.h> // for TResourceReader
-
-#include <aknnotewrappers.h>
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::ConstructL
-// 
-// Symbian OS default constructor.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::ConstructL(
-                    const TRect& aRect )
-    {
-    CreateWindowL();
-
-	iListBox = CMenuListBox::NewL(EStartedCasesMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC( reader, R_STARTED_CASES_MENU_LISTBOX );
-	iListBox->SetListBoxObserver( this ); // jos peritty MEikListBoxObserver:sta
-	//iListBox->SetObserver( this /*iMainMenuObserver*/ ); //jos peritty MCoeControlObserver:sta
-	iListBox->ConstructFromResourceL( reader );
-    CleanupStack::PopAndDestroy(); // resource stuffs. 
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-	iListBox->ActivateL();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// Destructor
-CStartedCasesMenuContainer::~CStartedCasesMenuContainer()
-    {
-    if ( iListBox )
-		{    
-    	iListBox->Reset();
-    	delete iListBox;
-        }	
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CStartedCasesMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CStartedCasesMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::HandleListBoxEventL
-// 
-// Handles list box events.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::HandleListBoxEventL(
-                                CEikListBox* aListBox,
-                                TListBoxEvent aEventType )
-	{
-
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-		    HandleSelectedListItemL( aListBox->CurrentItemIndex() );
-		}
-	}
-
-
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::HandleSelectedListItemL
-// 
-// Method HandleSelectedListItemL handles valid index.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::HandleSelectedListItemL( TInt aIndex )
-	{	 
-		TInt selection = aIndex;
-
-	    switch ( selection )
-			{
-            case 0: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowAllStartedCases);
-				break;
-            case 1:	( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowOngoingCases);
-				break;
-            case 2: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowPausedCases);
-				break;
-            case 3: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowPassedCases);
-				break;
-            case 4: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowFailedCases);
-				break;
-            case 5: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowCrashedAbortedCases);
-				break;
-            case 6: ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdShowStatistics);
-				break;
-	        default:
-				break;
-			}
-	}	
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CStartedCasesMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-        case EKeyRightArrow:
-			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
-			return EKeyWasNotConsumed;
-            //break;
-            }
-        default:
-			{
-			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
-			if (iListBox)
-				{
-				return iListBox->OfferKeyEventL( aKeyEvent, aType );
-				}
-			}
-        }
-    return EKeyWasNotConsumed;        
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer::GetActiveLine
-// 
-// Get currently selected items index.
-// ----------------------------------------------------------------------------
-//
-TInt CStartedCasesMenuContainer::GetActiveLine()
-	{
-	return iListBox->CurrentItemIndex();
-	}
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuContainer:::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-
-// End of File  
--- a/stifui/stifui/src/StartedCasesMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStartedCasesMenuView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "StartedCasesMenuView.h"
-#include  "StartedCasesMenuContainer.h"
-#include  "Stifui.hrh" 
-#include  "AppUIAppUi.h"
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_STARTEDCASESMENUVIEW );
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::~CStartedCasesMenuView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CStartedCasesMenuView::~CStartedCasesMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CStartedCasesMenuView::Id() const
-    {
-    return TUid::Uid(EStartedCasesMenuViewId); //KTestCaseMenuViewId;
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-		case EAknCmdOpen:
-			{
-			TInt a = iContainer->GetActiveLine();
-			iContainer->HandleSelectedListItemL( a );
-			}
-			break;              
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CStartedCasesMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-        
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTEDCASES);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-   }
-
-// ----------------------------------------------------------------------------
-// CStartedCasesMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CStartedCasesMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// End of File
-
--- a/stifui/stifui/src/StatisticsContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStatisticsContainer class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>  // ListBox 
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> // CColumnListBoxData
-
-#include <Stifui.rsg>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include "StatisticsContainer.h"
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsContainer::ConstructL( const TRect& aRect, 
-                                        MEikListBoxObserver* aListBoxObserver )
-    {
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(
-                            _L("StatisticsContainer: ConstructL"));
-
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    //iTestCasesInView.Reset();
-        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: iTCInV Reset"));
-    
-	iListBox = CMenuListBox::NewL(EStatisticsViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
-    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-
-    if ( iUIStore )
-        {
-        //RRefArray<CStartedTestCase> allStarted;
-        RRefArray<CStartedTestCase> allStarted;
-        TInt ret = iUIStore->StartedTestCases( allStarted );
-        if( KErrNone != ret )
-            {
-            allStarted.Reset();
-            allStarted.Close();
-            User::Leave( ret );
-            }
-        TInt count = allStarted.Count();
-        // TInt notstarted( 0 );
-        TInt ongoing( 0 );
-        TInt passed( 0 );
-        TInt failed( 0 );
-        TInt other( 0 );
-        //TInt aborted( 0 );
-        // TInt paused( 0 );
-        //TInt crashed( 0 );
-        //TInt executed( 0 );
-        // TInt state( 0 );
-
-        for( TInt a = 0; a < count; a++ )
-            {
-            switch ( allStarted[a].Status() )
-                {
-                case CUIStoreIf::EStatusRunning:
-                    {
-                    ongoing++;
-                    break;
-                    }
-                case CUIStoreIf::EStatusExecuted | CUIStoreIf::EStatusPassed:
-                    {
-                    passed++;
-                    break;
-                    }
-                case CUIStoreIf::EStatusExecuted |CUIStoreIf::EStatusFailed:
-                    {
-                    failed++;
-                    break;
-                    }
-                //case CUIStoreIf::EStatusAborted:
-                //    {
-                //    aborted++;
-                //    break;
-                //    }
-                /*case ECrashed:
-                    {
-                    crashed++;
-                    break;
-                    }
-                */
-                /*case EExecuted:
-                    {
-                    executed++;
-                    break;
-                    }
-                */
-                default:
-                    {
-                    other++;
-                    break;
-                    }
-                }
-            }
-
-        allStarted.Reset();
-        allStarted.Close();
-
-        iTestCaseArray = new (ELeave) CDesC16ArrayFlat(6);
-        iTestCaseArray->Reset();
-
-        HBufC* tmpHBuf = HBufC::NewL( 40 );
-        TPtr buffer( tmpHBuf->Des() );
-
-        buffer = ( _L("\t") );
-        buffer.AppendNum( ongoing );
-        buffer.Append( _L(" Running") );
-        iTestCaseArray->AppendL( buffer );
-
-        buffer = ( _L("\t") );
-        buffer.AppendNum( passed );
-        buffer.Append( _L(" Passed") );
-        iTestCaseArray->AppendL( buffer );
-
-        buffer = ( _L("\t") );
-        buffer.AppendNum( failed );
-        buffer.Append( _L(" Failed") );
-        iTestCaseArray->AppendL( buffer );
-
-        buffer = ( _L("\t") );
-        buffer.AppendNum( other );
-        buffer.Append( _L(" Crashed/Aborted") );
-        iTestCaseArray->AppendL( buffer );
-
-        delete tmpHBuf;
-
-        iListBox->Model()->SetItemTextArray( iTestCaseArray );
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: ListBox model set"));
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-
-    // Creates graphic.
-    //SetGraphicIconL( iListBox );
-    //   ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StatisticsContainer: icons created"));
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::~CStatisticsContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CStatisticsContainer::~CStatisticsContainer()
-    {
-    //iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
-    //delete iListBox;
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CStatisticsContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-
-CCoeControl* CStatisticsContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CStatisticsContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-	{
-		return EKeyWasNotConsumed;
-	}
-
-	if (iListBox)
-		{
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CStatisticsContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File
--- a/stifui/stifui/src/StatisticsView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CStatisticsView class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <aknlistquerydialog.h> 
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-#include  "StatisticsView.h"
-#include  "StatisticsContainer.h"
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CStatisticsView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_STATISTICSVIEW );
-    iCurrentTestCase = 0;
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::~CStatisticsView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CStatisticsView::~CStatisticsView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CStatisticsView::Id() const
-    {
-    return TUid::Uid(EStatisticsViewId);
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::HandleCommandL(TInt aCommand)
-    {   
-    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
-        {
-        TInt moduleNumber = aCommand - ECmdFilterByModule;
-
-        RRefArray<TDesC> moduleName;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( moduleName );
-        if( KErrNone != ret )
-            {
-            moduleName.Reset();
-            moduleName.Close();
-            User::Leave( ret );
-            }
-        //iFilterModule = testModules[moduleNumber];
-
-        iContainer->FilterCasesByModuleL( moduleName[moduleNumber] );
-
-        moduleName.Reset();
-        moduleName.Close();
-
-        return;
-        }
-
-    if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
-        {
-        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
-        RRefArray<TDesC> testCaseFileName;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFileName );
-        if( KErrNone != ret )
-            {
-            testCaseFileName.Reset();
-            testCaseFileName.Close();
-            User::Leave( ret );
-            }
-
-        iContainer->FilterCasesByTCFileNameL( testCaseFileName[testCaseFileNumber] );
-
-        testCaseFileName.Reset();
-        testCaseFileName.Close();
-
-        return;
-        }
-
-    if ( aCommand == ECmdNOFiltering )
-        {
-        iContainer->NoFilteringL();
-        return;
-        }
-
-    switch ( aCommand )
-        {
-        case ECmdStartCases:
-            {
-            iCurrentTestCase = iContainer->CurrentItemIndex();
-            StartTestCasesL();
-            break;
-            }
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL( EAppUIGoBack );
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StatisticsView: DoActivateL"));
-        //message = _L("eng.open ret:");
-        //message.AppendNum( ret , EDecimal );
-        //AppUi()->iLogger->Log( message );
-        iContainer = new (ELeave) CStatisticsContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("StatisticsView: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-    iContainer->SetCurrentItemIndex(iCurrentTestCase);
-	
-	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_STATS);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-
-    // Test modules are added to filter by test module submenu if the submenu is opened
-    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
-        {
-        RRefArray<TDesC> modules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
-        if( KErrNone != ret )
-            {
-            modules.Reset();
-            modules.Close();
-            User::Leave( ret );
-            }
-
-        TInt moduleCount = modules.Count();
-        
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByModule;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < moduleCount; i++)
-            {
-            item.iText = modules[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
-            }
-        
-        modules.Reset();
-        modules.Close();
-        }
-
-    // Test case files are added to filter by test case file submenu if the submenu is opened
-    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }
-
-        TInt testCaseFileCount = testCaseFiles.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByTestCaseFile;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < testCaseFileCount; i++)
-            {
-            item.iText = testCaseFiles[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
-            }
-
-        testCaseFiles.Reset();
-        testCaseFiles.Close();
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::HandleListBoxEventL
-// 
-// Handles a list box event.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        //iCurrentTestCase = aListBox->CurrentItemIndex();
-        //iCurrentTestCase = iContainer->CurrentItemIndex();
-        //StartTestCases();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CStatisticsView::StartTestCases
-// 
-// Starts test case(s) which is selected in containers list box.
-// First shows a list query if user wants just start test case or
-// if he wants to start test case and view test case output.
-// ----------------------------------------------------------------------------
-//
-void CStatisticsView::StartTestCasesL()
-    {
-    TInt selectedItem(0);
-    CAknListQueryDialog* startDialog = new (ELeave) CAknListQueryDialog(&selectedItem);
-    if ( startDialog->ExecuteLD(R_START_TESTCASE_LIST_QUERY) )
-        {
-        RRefArray<CTestInfo> testInfo;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases( testInfo );
-        if( KErrNone != ret )
-            {
-            testInfo.Reset();
-            testInfo.Close();
-            User::Leave( ret );
-            }
-        TInt testCaseNumber = testInfo[0].TestCaseNum();
-        TInt testCaseIndex( 0 );
-
-        //CUIEngineContainer* container = NULL;
-        ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->StartTestCase( testInfo[testCaseNumber], testCaseIndex );
-        if( KErrNone != ret )
-            {
-            User::Leave( ret );
-            }
-        testInfo.Reset();
-        testInfo.Close();
-
-        // Increment the counter value
-        ((CAppUIAppUi*)AppUi())->iUIStoreHandler->iExecutedTestCaseCount++;
-
-        }
-
-    }
-
-// End of File
--- a/stifui/stifui/src/TestCaseMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseMenuContainer class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include "TestCaseMenuContainer.h"
-#include "Stifui.hrh"
-#include <Stifui.rsg>
-
-#include <aknlists.h>  //ListBox
-#include <barsread.h> // for TResourceReader
-
-#include <aknnotewrappers.h>
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::ConstructL(const TRect& aRect)
-    {
-    CreateWindowL();
-     
-	iListBox = CMenuListBox::NewL(ETestCaseMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC( reader, R_TESTCASE_MENU_LISTBOX );
-	iListBox->SetListBoxObserver( this );
-	iListBox->ConstructFromResourceL( reader );
-	CleanupStack::PopAndDestroy(); // resource stuffs. 
-
-    // Create Scroller control for ListBox and set its visibility
-    // !!! Not needed yet because there are only two items in list box.
-    // If items are added later, scroller may be taken to use
-    //iListBox->CreateScrollBarFrameL(ETrue);
-    //iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-    
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// Destructor
-CTestCaseMenuContainer::~CTestCaseMenuContainer()
-    {
-    if ( iListBox )
-		{
-		iListBox->Reset();
-    	delete iListBox;
-    	}	
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestCaseMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestCaseMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::HandleListBoxEventL
-// 
-// Handles list box events.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-		    HandleSelectedListItemL( aListBox->CurrentItemIndex() );
-
-		}	
-
-	}
-	
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::HandleSelectedListItemL
-// 
-// Method HandleSelectedListItemL handles valid index.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::HandleSelectedListItemL( TInt aIndex )
-	{	 
-		TInt selection = aIndex;
-
-	    switch ( selection )
-			{
-		    case 0:
-				//Vaihda StartCasesView aktiiviseksi
-				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdGoToStartCasesView);
-				break;
-			case 1:
-				( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(ECmdGoToStartedCasesView);
-				break;
-	        default:
-				break;
-			}
-	}	
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestCaseMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-    	{
-		return EKeyWasNotConsumed;
-	    }
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-        case EKeyRightArrow:
-			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
-			return EKeyWasNotConsumed;
-            //break;
-            }
-        default:
-			{
-			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
-			if (iListBox)
-				{
-				return iListBox->OfferKeyEventL( aKeyEvent, aType );
-				}
-			}
-        }     
-    return EKeyWasNotConsumed;        
-}
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::GetActiveLine
-// 
-// Get currently selected items index.
-// ----------------------------------------------------------------------------
-//
-TInt CTestCaseMenuContainer::GetActiveLine()
-	{
-	return iListBox->CurrentItemIndex();
-	}
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File  
--- a/stifui/stifui/src/TestCaseMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseMenuView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "TestCaseMenuView.h"
-#include  "TestCaseMenuContainer.h"
-#include  "Stifui.hrh" 
-#include  "AppUIAppUi.h" // loggerin kayttoa varten, muuten ei tarvittaisi
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_TESTCASEMENUVIEW );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::~CTestCaseMenuView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestCaseMenuView::~CTestCaseMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestCaseMenuView::Id() const
-    {
-    return TUid::Uid(ETestCaseMenuViewId); //KTestCaseMenuViewId;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-		case EAknCmdOpen:
-			{
-			TInt a = iContainer->GetActiveLine();
-			iContainer->HandleSelectedListItemL( a );
-			}
-			break;             
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestCaseMenu: DoActivateL"));
-        //message = _L("eng.open ret:");
-        //message.AppendNum( ret , EDecimal );
-        //AppUi->iLogger->Log( message );
-        iContainer = new (ELeave) CTestCaseMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestCaseMenu: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-    
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTCASES);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-   }
-
-// ----------------------------------------------------------------------------
-// CTestCaseMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;         
-        }  
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;      
-    }
-
-// End of File
--- a/stifui/stifui/src/TestCaseOutputContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseOutputContainer class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include "TestCaseOutputContainer.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h>  // CAknIconArray
-#include <badesca.h> // CDesCArray
-#include <eikclbd.h> // CColumnListBoxData
-#include <aknnotewrappers.h>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include "MenuListBox.h"
-
-//#include <gdi.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputContainer::ConstructL(const TRect& aRect, CStartedTestCase* aStartedTestCase ) //TInt aExecutedTestCaseCount )
-    {
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-    
-	iListBox = CMenuListBox::NewL(ETestCaseOutputViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( this );
-    iListBox->ConstructL(this, EAknListBoxSelectionList);
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    
-    if( iUIStore )
-        {
-        iListBoxModel = CTestOutputListBoxModel::NewL( aStartedTestCase );
-        iListBox->Model()->SetItemTextArray( iListBoxModel );
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-	iListBox->ActivateL();
-	((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::~CTestCaseOutputContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestCaseOutputContainer::~CTestCaseOutputContainer()
-    {
-    // Discard and destroy the font
-    //CWindowGc* listBoxGc = iListBox->View()->ItemDrawer()->Gc();
-    //listBoxGc->DiscardFont();
-
-    //CWindowGc& gc = SystemGc();
-    //gc.DiscardFont();
-    
-    //iCoeEnv->ScreenDevice()->ReleaseFont(iListBoxFont);
-
-    delete iListBox;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestCaseOutputContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestCaseOutputContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::HandleListBoxEventL
-// 
-// Handles list box events.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        //TBuf<200> outputLine;
-        //CAknNoteDialog* outputLineNote = new (ELeave) CAknNoteDialog;
-        //outputLineNote->SetTextL( iListBoxModel->MdcaPoint(iListBox->CurrentItemIndex()) );
-        //outputLineNote->RunDlgLD();
-
-
-
-        //CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
-        //informationNote->SetTextL( iListBoxModel->MdcaPoint(iListBox->CurrentItemIndex()) );
-		//informationNote->SetTextPluralityL( ETrue );
-        //informationNote->SetTextL( _L("Number of cases: %d") );
-        //informationNote->SetTextNumberL( count );
-        //informationNote->ExecuteLD();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestCaseOutputContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-{
-	if (aType != EEventKey)
-	{
-		return EKeyWasNotConsumed;
-	}
-
-	if (iListBox)
-		{
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-
-    /*
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-        case EKeyRightArrow:
-			{ */  /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
-    /*			return EKeyWasNotConsumed;
-            break;
-            }
-        default:
-			{
-			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
-			if (iListBox)
-				{
-				return iListBox->OfferKeyEventL( aKeyEvent, aType );
-				}
-			else
-				{
-				return EKeyWasNotConsumed;
-				}
-            break;
-			}
-        }*/
-}
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputContainer::OutputUpdateL
-// 
-// Handles addition of item to list box.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputContainer::OutputUpdateL()
-    {
-    if ( iListBox )
-        {
-        iListBox->HandleItemAdditionL();
-        iListBox->DrawNow();
-        }
-    }
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------------------------
-// CTestOutputListBoxModel::NewL
-// 
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CTestOutputListBoxModel* CTestOutputListBoxModel::NewL(CStartedTestCase* aStartedTestCase /*, HBufC* aBuffer*/)
-    {
-
-    CTestOutputListBoxModel* self = new ( ELeave ) CTestOutputListBoxModel();
-    CleanupStack::PushL( self );
-    //self->ConstructL();
-    //self->iBuffer = aBuffer;
-    self->iBuffer = HBufC::NewL( 150 );
-    self->iStartedTestCase = aStartedTestCase;
-    CleanupStack::Pop();
-    return self;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestOutputListBoxModel::ConstructL
-// 
-// Symbian OS two phased constructor.
-// Completes the construction of the object.
-// ----------------------------------------------------------------------------
-//
-void CTestOutputListBoxModel::ConstructL()
-    {
-    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestOutputListBoxModel::~CTestCaseOutputContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestOutputListBoxModel::~CTestOutputListBoxModel()
-    {
-    delete iBuffer;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestOutputListBoxModel::MdcaCount
-// 
-// Returns the number of descriptor elements in the array.
-// ----------------------------------------------------------------------------
-//
-TInt CTestOutputListBoxModel::MdcaCount() const
-    {
-
-    TInt rows = iStartedTestCase->PrintArray().Count();
-    return rows;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestOutputListBoxModel::MdcaPoint
-// 
-// Indexes into a descriptor array.
-// ----------------------------------------------------------------------------
-//
-TPtrC CTestOutputListBoxModel::MdcaPoint(TInt aIndex) const
-    {
-    const RPointerArray<CTestProgress> printArray = iStartedTestCase->PrintArray();
-
-    TPtr buffer( iBuffer->Des() );
-    buffer.Zero();
-    buffer.Append(_L("\t"));
-    buffer.Append(printArray[aIndex]->iDescription);
-    buffer.Append(_L(" "));
-    buffer.Append(printArray[aIndex]->iText);
-    
-    return *iBuffer;
-
-    }
-
-// End of File
--- a/stifui/stifui/src/TestCaseOutputView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestCaseOutputView class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <akntitle.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include  "TestCaseOutputView.h"
-#include  "TestCaseOutputContainer.h"
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_TESTCASEOUTPUTVIEW );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::~CTestCaseOutputView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestCaseOutputView::~CTestCaseOutputView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    
-    iCurrentTestCase = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestCaseOutputView::Id() const
-    {
-    return TUid::Uid(ETestCaseOutputViewId);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-        case ECmdPauseTestCase:
-            {
-            /*
-            TInt index( 0 );
-			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
-             CStartedTestCase* startedTestCase = NULL;
-             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
-             if( ret != KErrNone )
-                 {
-                 // Leave
-                 }
-            */
-            CStartedTestCase* startedTestCase = 
-                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
-            startedTestCase->UIEngineContainer().PauseTest(); 
-            break;
-            }
-        case ECmdResumeTestCase:
-            {
-            /*
-            TInt index( 0 );
-			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
-             CStartedTestCase* startedTestCase = NULL;
-             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
-             if( ret != KErrNone )
-                 {
-                 // Leave
-                 }
-            */
-            CStartedTestCase* startedTestCase = 
-                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
-            startedTestCase->UIEngineContainer().ResumeTest();            
-            break;
-            }
-        case ECmdAbortTestCase:
-            {
-            /*
-            TInt index( 0 );
-			index = ( ( CAppUIAppUi* )AppUi() )->GetTestCaseIndex();
-             CStartedTestCase* startedTestCase = NULL;
-             TRAPD( ret, startedTestCase = &iUIStore->StartedTestCaseL( index ) );
-             if( ret != KErrNone )
-                 {
-                 // Leave
-                 }
-            */
-            CStartedTestCase* startedTestCase = 
-                ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
-            startedTestCase->UIEngineContainer().CancelTest();             
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CTestCaseOutputContainer;
-        iContainer->SetMopParent(this);
-
-        iCurrentTestCase = ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
-        iContainer->ConstructL( ClientRect(), iCurrentTestCase );
-        
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-    PrintTestCaseStateL();
-	
-	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTCASE_OUTPUT);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-	
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    // Because DoDeactivate method can't leave we must 
-    // catch unexpected leaves.
-	TInt ret = KErrNone;
-    TRAP( ret,
-    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-    if ( tp != NULL )
-    	{
-    	tp->SetTextToDefaultL(); // Set application name.
-    	}
-    ); // TRAPD end
-    
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    
-    iCurrentTestCase = NULL;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    CStartedTestCase* startedTestCase = 
-        ( ( CAppUIAppUi* )AppUi() )->GetStartedTestCase();
-
-    if (R_APPUI_TESTCASEOUTPUTVIEW_MENU == aResourceId)
-        {
-  
-        if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
-            {
-            if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::ENotStarted )
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                }
-            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::ERunning )
-                {
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
-                }
-            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EPaused )
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
-                }
-            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EExecuted )
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                }
-            else if( startedTestCase->UIEngineContainer().State() == CUIEngineContainer::EFinished )
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                }
-                                                                                     
-            }
-		else
-            {
-            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-            }
-        }
-        
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::OutputUpdate
-// 
-// Receives output update notification from AppUI.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::OutputUpdateL( CStartedTestCase* /*aTestCase*/ )
-    {
-    PrintTestCaseStateL();
-    iContainer->OutputUpdateL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::TestCaseStateChangedL
-// 
-// Receives test case state changed notification from AppUI.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::TestCaseStateChangedL()
-    {
-    PrintTestCaseStateL();
-    iContainer->OutputUpdateL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestCaseOutputView::PrintTestCaseState
-// 
-// Prints test case state to title pane.
-// ----------------------------------------------------------------------------
-//
-void CTestCaseOutputView::PrintTestCaseStateL()
-    {
-    TBuf<50> statusMessage;
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-
-    if ( iCurrentTestCase != NULL )
-        {
-        TUint status = iCurrentTestCase->Status();
-
-        if( status & CUIStoreIf::EStatusRunning )
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage,
-                R_TESTCASE_STATE_RUNNING );
-            }
-        else if( status & CUIStoreIf::EStatusExecuted && 
-                            status & CUIStoreIf::EStatusPassed )
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage, 
-                R_TESTCASE_STATE_PASSED );
-            }
-        else if( status & CUIStoreIf::EStatusExecuted && 
-                            status & CUIStoreIf::EStatusFailed )
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage, 
-                R_TESTCASE_STATE_FAILED );
-            }
-        else if( status & CUIStoreIf::EStatusAborted )
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage, 
-                R_TESTCASE_STATE_CRASHED_ABORTED );
-            }
-        else if( status & CUIStoreIf::EStatusCrashed )
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage, 
-                R_TESTCASE_STATE_CRASHED_ABORTED );
-            }
-        else
-            {
-            CEikonEnv::Static()->ReadResource( statusMessage, 
-                R_TESTCASE_STATE_UNKNOWN );
-            }
-        
-        tp->SetTextL( statusMessage );
-        tp->DrawNow();
-
-        }
-
-    }
-
-// End of File
--- a/stifui/stifui/src/TestModulesMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,310 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestModulesListBoxModel class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>  // ListBox
-#include <barsread.h> // for TResourceReader
-#include <aknnotewrappers.h>
-
-#include "Stifui.hrh"
-#include <Stifui.rsg>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include "TestModulesMenuContainer.h"
-#include "AppUIAppUi.h"
-
-#include "MenuListBox.h"
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestModulesListBoxModel::NewL
-// 
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CTestModulesListBoxModel* CTestModulesListBoxModel::NewL(RRefArray<TDesC> aTestModules)
-    {
-
-    CTestModulesListBoxModel* self = new ( ELeave ) CTestModulesListBoxModel();
-    CleanupStack::PushL( self );
-    self->iBuffer = HBufC::NewL( 130 );
-    self->iTestModules = aTestModules;
-    CleanupStack::Pop();
-    return self;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesListBoxModel::ConstructL
-// 
-// Symbian OS two phased constructor.
-// Completes the construction of the object.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesListBoxModel::ConstructL()
-    {
-    //iBuffer = HBufC::NewLC( KMaxInfoName + KMaxName + 2 );
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesListBoxModel::~CTestCaseOutputView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestModulesListBoxModel::~CTestModulesListBoxModel()
-    {
-    delete iBuffer;
-    
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesListBoxModel::MdcaCount
-// 
-// Returns the number of descriptor elements in the array.
-// ----------------------------------------------------------------------------
-//
-TInt CTestModulesListBoxModel::MdcaCount() const
-    {
-    return iTestModules.Count();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesListBoxModel::MdcaPoint
-// 
-// Indexes into a descriptor array.
-// ----------------------------------------------------------------------------
-//
-TPtrC CTestModulesListBoxModel::MdcaPoint(TInt aIndex) const
-    {
-    TPtrC testModule = (iTestModules)[aIndex];
-    TPtr buffer( iBuffer->Des() );
-    buffer.Zero();
-
-    buffer.Append(_L("\t"));
-    buffer.Append( testModule );
-    
-    return *iBuffer;
-    
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    _LIT( KErrMessage, "Error loading modules! Check Test engine log.");
-    CreateWindowL();
-
-  	iListBox = CMenuListBox::NewL(ETestModulesMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
-    iListBox->ConstructL(this, EAknListBoxSelectionList /*EAknListBoxMarkableList*/ );
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    if( iUIStore )
-        {
-        /*const CFixedFlatArray<TTestInfo>& allCases = iData->AllCases();
-        const TInt KTestCaseCount = allCases.Count();
-        for (TInt i=0; i < KTestCaseCount; i++)
-            {
-            iTestCasesInView.Append(&(allCases[i]));
-            } */
-
-        //RRefArray<TDesC> modules;
-        TInt ret = iUIStore->Modules( iModules );
-        if( ret != KErrNone )
-            {
-             //iModules.Reset();
-             //iModules.Close();
-			TMessageBoxUtil::ShowErrorNoteL( KErrMessage );
-            }
-       
-        iListBoxModel = CTestModulesListBoxModel::NewL( iModules );
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model"));
-
-
-         iListBox->Model()->SetItemTextArray(iListBoxModel);
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("StartCasesContainer: ListBox model set"));
-        
-        }
-    else
-        {
-        // General error becouse UIStore should be opened in AppUI when
-        // program starts.
-        User::Leave( KErrGeneral );
-        }
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::~CTestCaseOutputView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestModulesMenuContainer::~CTestModulesMenuContainer()
-    {
-    
-		iModules.Reset();
-        iModules.Close();
-
-	if( iListBox )
-		{
-		delete iListBox;
-		iListBox = NULL;
-		}
-		
-	}
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestModulesMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestModulesMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestModulesMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-        case EKeyRightArrow:
-			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
-			return EKeyWasNotConsumed;
-            //break;
-            }
-        default:
-			{
-			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
-			if (iListBox)
-				{
-				return iListBox->OfferKeyEventL( aKeyEvent, aType );
-				}
-			}
-        }
-    return EKeyWasNotConsumed;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::CurrentItemIndex
-// 
-// Returns current item index in list box.
-// ----------------------------------------------------------------------------
-//
-TInt CTestModulesMenuContainer::CurrentItemIndex()
-    {
-    return iListBox->CurrentItemIndex();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File
--- a/stifui/stifui/src/TestSetBaseMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetBaseMenuContainer class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include "TestSetBaseMenuContainer.h"
-#include "Stifui.hrh"
-
-#include <Stifui.rsg>
-
-#include <aknlists.h>  //ListBox
-#include <barsread.h> // for TResourceReader
-
-#include <aknnotewrappers.h>
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    CreateWindowL();
-     
-	iListBox = CMenuListBox::NewL(ETestSetMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC( reader, R_TESTSETBASE_MENU_LISTBOX );
-	iListBox->SetListBoxObserver( aListBoxObserver );
-	iListBox->ConstructFromResourceL( reader );
-	CleanupStack::PopAndDestroy(); // resource stuffs. 
-
-    // Create Scroller control for ListBox and set its visibility
-    // !!! Not needed yet because there are only two items in list box.
-    // If items are added later, scroller may be taken to use
-    //iListBox->CreateScrollBarFrameL(ETrue);
-    //iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-    
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::~CTestSetBaseMenuContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetBaseMenuContainer::~CTestSetBaseMenuContainer()
-    {
-    if ( iListBox )
-		{
-		iListBox->Reset();
-    	delete iListBox;
-    	}	
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetBaseMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestSetBaseMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::OfferKeyEventL
-// 
-// Handles key events..
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestSetBaseMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-	if (aType != EEventKey)
-	{
-		return EKeyWasNotConsumed;
-	}
-	
-    switch ( aKeyEvent.iCode )
-        {
-        case EKeyLeftArrow:
-        case EKeyRightArrow:
-			{   /* Left ja right key eventit valitetaan AppUille joka hoitaa siirtymisen toisiin nakymiin */
-			return EKeyWasNotConsumed;
-            //break;
-            }
-        default:
-			{
-			//Muut Key eventit valitetaan listboxille, joka hoitaa ne
-			if (iListBox)
-				{
-				return iListBox->OfferKeyEventL( aKeyEvent, aType );
-				}
-	    	}
-        }     
-    return EKeyWasNotConsumed;        
-}
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::GetActiveLine
-// 
-// Get currently selected items index.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetBaseMenuContainer::GetActiveLine()
-	{
-	return iListBox->CurrentItemIndex();
-	}
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-// End of File  
--- a/stifui/stifui/src/TestSetBaseMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetBaseMenuView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <aknlists.h> 
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "TestSetBaseMenuView.h"
-#include  "TestSetBaseMenuContainer.h"
-#include  "Stifui.hrh" 
-#include  "AppUIAppUi.h" // loggerin kayttoa varten, muuten ei tarvittaisi
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CTestSetBaseMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ---------------------------------------------------------
-//
-void CTestSetBaseMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_TESTSETBASEMENUVIEW );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::~CTestSetBaseMenuView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetBaseMenuView::~CTestSetBaseMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestSetBaseMenuView::Id() const
-    {
-    return TUid::Uid(ETestSetBaseMenuViewId); //KTestSetBaseMenuViewId;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-		case EAknCmdOpen:
-			{
-			break;
-			}
-		case ECmdCreateTestSet:
-            {
-            AppUi()->HandleCommandL(ECmdCreateTestSet);
-            break;
-            }
-		case ECmdLoadTestSet:
-            {
-            AppUi()->HandleCommandL(ECmdLoadTestSet);
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::HandleListBoxEventL
-// 
-// Handles a list box event.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuView::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-	    switch ( aListBox->CurrentItemIndex() )
-			{
-		    case 0:
-		    	HandleCommandL( ECmdCreateTestSet );
-				break;
-			case 1:
-				HandleCommandL( ECmdLoadTestSet );
-				break;
-			}
-		}
-	}
-	
-		
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetBaseMenu: DoActivateL"));
-        //message = _L("eng.open ret:");
-        //message.AppendNum( ret , EDecimal );
-        //AppUi->iLogger->Log( message );
-        iContainer = new (ELeave) CTestSetBaseMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetBaseMenu: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-	
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET_BASE);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-
-   }
-
-// ----------------------------------------------------------------------------
-// CTestSetBaseMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestSetBaseMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;         
-        }    
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;    
-    }
-
-// End of File
--- a/stifui/stifui/src/TestSetInsertMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetInsertMenuContainer class
-* definition.
-*
-*/
-
-// INCLUDE FILES 
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> // CColumnListBoxData
-
-#include "TestSetInsertMenuContainer.h"
-#include "TestSetInsertMenuView.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ConstructL"));
-
-	iParentView = (CTestSetInsertMenuView*)aListBoxObserver;
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    iTestCasesInView.Reset();
-        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: iTCInV Reset"));
-    
-	iListBox = CMenuListBox::NewL(ETestSetInsertMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
-    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-
-    if ( iUIStore )
-        {
-        RRefArray<CTestInfo> allCases;
-        TInt ret = iUIStore->TestCases( allCases );
-        if( KErrNone != ret )
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
-            allCases.Reset();
-            allCases.Close();
-            User::Leave( ret );
-            }
-
-        const TInt KTestCaseCount = allCases.Count();
-        for (TInt i=0; i < KTestCaseCount; i++)
-            {
-            iTestCasesInView.Append( &allCases[i] );
-            }
-
-        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox model"));
-
-        iListBox->Model()->SetItemTextArray(iListBoxModel);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: ListBox model set"));
-
-        allCases.Reset();
-        allCases.Close();
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-
-    // Creates graphic.
-    SetGraphicIconL( iListBox );
-       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetInsertMenuContainer: icons created"));
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::~CTestSetInsertMenuContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetInsertMenuContainer::~CTestSetInsertMenuContainer()
-    {
-    //iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
-    //delete iListBox;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetInsertMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestSetInsertMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestSetInsertMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-	if (iListBox)
-		{
-		//if multiple items selected
-		if ( iListBox->SelectionIndexes()->Count() > 0 )
-			{
-			TUint mask = 0x40488;
-			
-			//if event is enter key,
-			//don´t send it to listbox
-			if ( aKeyEvent.iScanCode == 0xa7 
-				&& ( aKeyEvent.iModifiers & mask ) == 0 )
-				{
-				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
-				return EKeyWasConsumed;	
-				}
-			}
-			
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-    
-// End of File
--- a/stifui/stifui/src/TestSetInsertMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,399 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetInsertMenuView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <aknlistquerydialog.h> 
-#include  <aknnotewrappers.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-#include  "TestSetInsertMenuView.h"
-#include  "TestSetInsertMenuContainer.h"
-#include  "TestSetMenuView.h"
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL(  R_INSERT_TESTCASES_VIEW );
-    iCurrentTestCase = 0;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::~CTestSetInsertMenuView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetInsertMenuView::~CTestSetInsertMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestSetInsertMenuView::Id() const
-    {
-    return TUid::Uid(ETestSetInsertMenuViewId);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::HandleCommandL(TInt aCommand)
-    {   
-    if ( aCommand >= ECmdFilterByModule && aCommand < ECmdFilterByTestCaseFile ) // 0x1000 - 0x1FFF
-        {
-        TInt moduleNumber = aCommand - ECmdFilterByModule;
-        RRefArray<TDesC> allModules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
-        if( KErrNone != ret )
-            {
-            allModules.Reset();
-            allModules.Close();
-            User::Leave( ret );
-            }
-        TName moduleName = allModules[ moduleNumber ];
-
-        iContainer->FilterCasesByModuleL( moduleName );
-
-        allModules.Reset();
-        allModules.Close();
-        }
-	else if ( aCommand >= ECmdFilterByTestCaseFile && aCommand < ECmdNOFiltering )
-        {
-        TInt testCaseFileNumber = aCommand - ECmdFilterByTestCaseFile;
-        RRefArray<TDesC> allTestCases;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( allTestCases );
-        if( KErrNone != ret )
-            {
-            allTestCases.Reset();
-            allTestCases.Close();
-            User::Leave( ret );
-            }
-        TFileName testCaseFileName = allTestCases[ testCaseFileNumber ];
-
-        iContainer->FilterCasesByTCFileNameL( testCaseFileName );
-
-        allTestCases.Reset();
-        allTestCases.Close();
-        }
-	else if ( aCommand == ECmdNOFiltering )
-        {
-        iContainer->NoFilteringL();
-        }
-    else if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
-    	|| aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
-    	{
-    	iContainer->HandleMarkCommandL( aCommand );
-    	}
-    else
-	    {
- 	    switch ( aCommand )
-	        {
-	        case ECmdInsertSelectedCases:
-	            {
-                ShowInsertCasesDialogL();
-	            break;
-	            }
-	        case EAknSoftkeyCancel:
-	            {
-	            //iCurrentTestCase = 0;
-	            ( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
-	            break;
-	            }
-	        default:
-	            {
-	            AppUi()->HandleCommandL( aCommand );
-	            break;
-	            }
-	        }
-	    }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetInsertMenuView: DoActivateL"));
-        //message = _L("eng.open ret:");
-        //message.AppendNum( ret , EDecimal );
-        //AppUi()->iLogger->Log( message );
-        iContainer = new (ELeave) CTestSetInsertMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-           ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("TestSetInsertMenuView: container constructed"));
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-   
-   //testing
-    iContainer->SetCurrentItemIndex(iCurrentTestCase);
-	
-	CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET_INSERT);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-
-    // Test modules are added to filter by test module submenu if the submenu is opened
-    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
-        {
-        RRefArray<TDesC> modules;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( modules );
-        if( KErrNone != ret )
-            {
-            modules.Reset();
-            modules.Close();
-            User::Leave( ret );
-            }
-
-        TInt moduleCount = modules.Count();
-        
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByModule;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < moduleCount; i++)
-            {
-            //item.iText = modules[i].iModuleName;
-            item.iText = modules[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x1000 - 0x1FFF are reserved for modules in hrh file
-            }
-        
-        modules.Reset();
-        modules.Close();
-
-        }
-
-    // Test case files are added to filter by test case file submenu if the submenu is opened
-    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }
-
-        TInt testCaseFileCount = testCaseFiles.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByTestCaseFile;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < testCaseFileCount; i++)
-            {
-            item.iText = testCaseFiles[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // command IDs 0x2000 - 0x2FFF are reserved for test case files in hrh file
-            }
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        ShowInsertCasesDialogL();
-		}
-		
-	}
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::ShowInsertCasesDialogL
-// 
-// Show confirmation dialog for inserting test cases.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::ShowInsertCasesDialogL()
-    {
-    TInt i(0);
-    TBuf<50> message;
-    CEikListBox* listBox = iContainer->ListBox();
-	TInt count = listBox->SelectionIndexes()->Count();
-	
-	if ( count > 0 )
-	    {
-    	CEikonEnv::Static()->ReadResource( message, R_INSERT_CONFIRMATION_QUESTION );
-    		
-    	CAknQueryDialog * dlg = CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
-    	if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
-    		{
-    		CEikListBox* newListBox = iContainer->ListBox();
-		    TInt newCount = newListBox->SelectionIndexes()->Count();
-    		RArray<TInt> selectedIndices;
-		    CleanupClosePushL( selectedIndices );
-		    if ( newCount > 0 )
-    			{
-    			for( i = 0; i < newCount; i++ )
-	    			{
-    				selectedIndices.InsertInOrder( (*newListBox->SelectionIndexes())[i] );
-		    		}	
-    				
-	    		AddCasesToTestSet( selectedIndices );
-	    		// Test cases added, set save needed flag to true.
-		    	((CTestSetMenuView*)AppUi()->View( 
-		    	    TUid::Uid(ETestSetMenuViewId) ))->SetSaveNeeded(ETrue);
-			    }
-    		CleanupStack::PopAndDestroy();
-	    	
-		    // Test cases added -> go to test set menu
-    		AppUi()->HandleCommandL(EAppUIGoBack);
-	    	}
-	    }
-	else
-	    {
-	    CAknWarningNote* dialog = new(ELeave)CAknWarningNote();
-	    CEikonEnv::Static()->ReadResource( message, R_INSERT_NOCASES_TEXT );
-	    dialog->ExecuteLD(message);
-	    }
-	    
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetInsertMenuView::AddCasesToTestSet
-// 
-// Adds selected test cases to the current test set.
-// ----------------------------------------------------------------------------
-//
-void CTestSetInsertMenuView::AddCasesToTestSet( RArray<TInt> aSelectedIndexes )
-	{
-	TInt ret(0);
-	TInt i(0);
-	RRefArray<CTestInfo> allCases;
-	CTestSetMenuView* testSetMenuView = 
-    	(CTestSetMenuView*)((CAppUIAppUi*)AppUi())->View( TUid::Uid(ETestSetMenuViewId) );
-
-	ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->TestCases(allCases);
-    
-	for ( i = 0; i < aSelectedIndexes.Count(); i++ )
-		{
-		ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->AddToTestSet( 
-    		testSetMenuView->CurrentTestSet(),
-   			allCases[ aSelectedIndexes[i] ] );
-		}    
-    if( ret != KErrNone )		
-        {
-        RDebug::Print( _L("AddCasesToTestSet failed with value: %d"), ret );
-        }
-    
-	allCases.Reset();
-	allCases.Close();
-
-	}
-
-// End of File
--- a/stifui/stifui/src/TestSetMenuContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,486 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetMenuContainer class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h> // CAknIconArray
-#include <aknnotewrappers.h>
-
-#include <eikclbd.h> // CColumnListBoxData
-
-#include "TestSetMenuContainer.h"
-#include "TestSetMenuView.h"
-#include "StartCasesContainer.h"
-#include <Stifui.rsg>
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "MenuListBox.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ConstructL"));
-
-	iParentView = (CTestSetMenuView*)aListBoxObserver;
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-
-    iTestCasesInView.Reset();
-        //((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: iTCInV Reset"));
-    
-	iListBox = CMenuListBox::NewL(ETestSetMenuViewId);
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver /*this*/ ); // jos peritty MEikListBoxObserver:sta
-    iListBox->ConstructL(this, EAknListBoxMarkableList /*EAknListBoxSelectionList*/);
-
-    ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox constructed"));
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
-    iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-                     iListBox->HandleItemAdditionL();   
-
-    if ( iUIStore )
-        {
-        //RRefArray<const CTestInfo> allCases;
-        //CTestSetInfo* testSetInfo;
-        //IMPORT_C const CTestSetInfo& TestSetL( const TDesC& aSetName  );
-        
-        TPtrC ptr = iParentView->CurrentTestSet();
-        
-        const CTestSetInfo* testSetInfo = 
-        	&iUIStore->TestSetL( ptr );
-        
-        //inline const RRefArray<const CTestInfo>& TestCases() const
-   		const RRefArray<const CTestInfo>* allCases = &testSetInfo->TestCases();
-        
-        /*if( ret != KErrNone )
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("iUIStore->TestCases() fails"));
-            // Leave
-            }
-		*/
-
-        const TInt KTestCaseCount = allCases->Count();
-        for (TInt i=0; i < KTestCaseCount; i++)
-            {
-            iTestCasesInView.Append( &allCases->operator[](i) );
-            }
-
-        iListBoxModel = CTestCaseListBoxModel::NewL(&iTestCasesInView);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox model"));
-
-        iListBox->Model()->SetItemTextArray(iListBoxModel);
-             ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: ListBox model set"));
-
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-
-    // Creates graphic.
-    SetGraphicIconL( iListBox );
-       ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("TestSetMenuContainer: icons created"));
-
-    iListBox->ActivateL();
-    ((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SetGraphicIconL
-// 
-// Sets graphic icon using listbox as CEikColumnListBox.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::SetGraphicIconL( CEikColumnListBox* aListBox )
-    {
-	if ( aListBox )
-        {
-        // Creates gul icon.
-        CAknIconArray* iconArray = new(ELeave) CAknIconArray(1);
-        CleanupStack::PushL( iconArray );
-        
-        GraphicIconL( iconArray ); // Appends graphic data.
-        
-        // Sets graphics as ListBox icon.
-        aListBox->ItemDrawer()->ColumnData()->SetIconArray( iconArray );
-        
-        CleanupStack::Pop();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::CurrentItemIndex
-// 
-// Returns current item index in list box.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuContainer::CurrentItemIndex()
-    {
-    return iListBox->CurrentItemIndex();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SetCurrentItemIndex
-// 
-// Sets current item index in list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::SetCurrentItemIndex(TInt aCurrentTestCase)
-    {
-    iListBox->SetCurrentItemIndexAndDraw(aCurrentTestCase);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::GraphicIconL
-// 
-// Appends graphics data.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::GraphicIconL( CArrayPtr<CGulIcon>* aIcons )
-    {
-    if ( aIcons )
-        {
-        CFbsBitmap* markBitmap = NULL;
-        CFbsBitmap* markBitmapMask = NULL;
-	
-        TRgb defaultColor;
-        defaultColor = CEikonEnv::Static()->Color(EColorControlText);
-	
-        AknsUtils::CreateColorIconL(AknsUtils::SkinInstance(),
-        		KAknsIIDQgnIndiMarkedAdd,
-        		KAknsIIDQsnIconColors,
-        		EAknsCIQsnIconColorsCG13,
-        		markBitmap,
-        		markBitmapMask,
-        		AknIconUtils::AvkonIconFileName(),
-        		EMbmAvkonQgn_indi_marked_add,
-        		EMbmAvkonQgn_indi_marked_add_mask,
-        		defaultColor );
-        
-        CGulIcon* markIcon = CGulIcon::NewL(markBitmap,markBitmapMask);
-        aIcons->AppendL(markIcon); 
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::~CTestSetMenuContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetMenuContainer::~CTestSetMenuContainer()
-    {
-    iTestCasesInView.Close(); // does not delete objects whose pointers are contained in the array
-    delete iListBox;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestSetMenuContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SelectedTestCases
-// 
-// Returns pointers to selected test cases.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::SelectedTestCases
-                            (RPointerArray<CTestInfo>& aSelectedTestCases)
-    {
-    aSelectedTestCases.Append( iTestCasesInView[iListBox->CurrentItemIndex()] );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestSetMenuContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType )
-    {
-	if (aType != EEventKey)
-	    {
-		return EKeyWasNotConsumed;
-	    }
-
-	if (iListBox)
-		{
-		//if multiple items selected
-		if ( iListBox->SelectionIndexes()->Count() > 0 )
-			{
-			TUint mask = 0x40488;
-			
-			//if event is enter key,
-			//don´t send it to listbox
-			if ( aKeyEvent.iScanCode == 0xa7 
-				&& ( aKeyEvent.iModifiers & mask ) == 0 )
-				{
-				iParentView->HandleListBoxEventL( iListBox, MEikListBoxObserver::EEventEnterKeyPressed );
-				return EKeyWasConsumed;	
-				}
-			}
-			
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-    }
-    
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::HandleMarkCommandL
-// 
-// Handles mark commands.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::HandleMarkCommandL( TInt aCommand )
-	{
-	if (iListBox)
-		{
-		AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );		
-		}
-	}
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::ProcessCommandL
-// 
-// Processes user commands.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::ProcessCommandL( TInt  aCommand )
-	{
-	AknSelectionService::HandleMarkableListProcessCommandL( aCommand, iListBox );
-    }
-    
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SelectionListProcessCommandL
-// 
-// Processes user commands.
-// ----------------------------------------------------------------------------
-//    
-void CTestSetMenuContainer::SelectionListProcessCommandL( TInt  aCommand )
-	{
-	AknSelectionService::HandleSelectionListProcessCommandL( aCommand, iListBox );
-    }
-    
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::FilterCasesByModuleL
-// 
-// Show only testcases which are defined is specified module.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::FilterCasesByModuleL( TName aModuleName )
-    {
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-   
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        if ( allCases[i].ModuleName() == aModuleName )
-            {
-            iTestCasesInView.Append( &( allCases[i] ) );
-            }
-        }
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::FilterCasesByTCFileNameL
-// 
-// Show only testcases which are defined is specified test case file.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::FilterCasesByTCFileNameL( 
-                                                TFileName aTestCaseFileName )
-    {
-
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-  
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        if ( allCases[i].TestCaseFile() == aTestCaseFileName )
-            {
-            iTestCasesInView.Append( &( allCases[i] ) );
-            }
-        }
-
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::NoFilteringL
-// 
-// Remove possible filtering of test cases -> show all test cases.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::NoFilteringL()
-    {
-    iTestCasesInView.Reset(); // Clear testCasesInView pointer array
-
-    RRefArray<CTestInfo> allCases;
-    TInt ret = iUIStore->TestCases( allCases );
-    if( KErrNone != ret )
-        {
-        ((CAppUIAppUi*)iCoeEnv->AppUi())->iLogger->Log(_L("FilterCasesByModuleL(): iUIStore->TestCases() fails"));
-        allCases.Reset();
-        allCases.Close();
-        User::Leave( ret );
-        }
-    const TInt KTestCaseCount = allCases.Count();
-
-    // Add all cases to iTestCasesInView pointer array
-    for( TInt i=0; i < KTestCaseCount; i++ )
-        {
-        iTestCasesInView.Append( &( allCases[i] ) );
-        }
-
-    allCases.Reset();
-    allCases.Close();
-
-    iListBox->Reset();
-    iListBox->DrawNow();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::RemoveListBoxItemsL
-// 
-// Removes items from list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuContainer::RemoveListBoxItemL( TInt aSelected )
-	{
-	TInt currentItem(0);
-    TBool remCurr(EFalse);
-	
-	currentItem = iListBox->CurrentItemIndex();
-	if( aSelected == currentItem )
-	    {
-	    remCurr = ETrue;
-	    }
-	    
-	iTestCasesInView.Remove( aSelected );
-	AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(iListBox, aSelected, remCurr);
-	 iListBox->HandleItemAdditionL();
-	}
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//	
-void CTestSetMenuContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File
--- a/stifui/stifui/src/TestSetMenuView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,554 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetMenuView class ddefinition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <aknlistquerydialog.h> 
-#include  <aknnotewrappers.h>
-#include  <barsread.h>              //TResourceReader
-#include  <Stifui.rsg>
-#include  "TestSetMenuView.h"
-#include  "TestSetMenuContainer.h"
-#include  "AppUIAppUi.h"
-#include  "Stifui.hrh" 
-
-
-
-// ================= MEMBER FUNCTIONS =========================================
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_TESTSETMENUVIEW );
-    iCurrentTestCase = 0;
-    iSaveNeeded = ETrue;
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::~CTestSetMenuView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetMenuView::~CTestSetMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestSetMenuView::Id() const
-    {
-    return TUid::Uid(ETestSetMenuViewId);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::HandleCommandL(TInt aCommand)
-    {   
-    if ( aCommand == EAknCmdMark || aCommand == EAknCmdUnmark 
-        || aCommand == EAknMarkAll || aCommand == EAknUnmarkAll )
-        {
-        iContainer->HandleMarkCommandL( aCommand );
-        }
-    else
-        {
-        switch ( aCommand )
-            {
-            case ECmdStartTestSet:
-                {
-                const CTestSetInfo& testSetInfo = 
-                    iUIStore->TestSetL( iCurrentTestSet );
-                const RRefArray<const CTestInfo>* allCases = 
-                    &testSetInfo.TestCases();
-                
-                TInt testCaseCount = allCases->Count();
-                if (testCaseCount > 0 )
-                    {
-                    StartTestSetL();
-                    }
-                break;
-                }
-            case ECmdShowStartedTestSet:
-                {
-                AppUi()->HandleCommandL(ECmdShowStartedTestSet);
-                break;
-                }
-            case ECmdSaveTestSet:
-                {
-                SaveCurrentTestSetL();
-                break;
-                }
-            case ECmdInsertTestCases:
-                {
-                // iSaveNeeded is set from 
-                // CTestSetInsertMenuView::ShowInsertCasesDialog()
-                //iSaveNeeded = ETrue;
-                AppUi()->HandleCommandL(ECmdInsertTestCases);
-                break;
-                }
-            case ECmdRemoveTestCases:
-                {
-                RemoveSelectedTestCasesL();
-                break;
-                }
-            case EAknSoftkeyBack:
-                {
-                //iCurrentTestCase = 0;
-               // AppUi()->HandleCommandL(ECmdLoadTestSet/*EAppUIGoToTestSetsMenu*/);
-                //( (CEikAppUi*)iCoeEnv->AppUi() )->HandleCommandL(EAppUIGoToTestSetsMenu);
-                SaveCurrentTestSetL();
-                break;
-                }
-            default:
-                {
-                AppUi()->HandleCommandL( aCommand );
-                break;
-                }
-            }
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log( 
-            _L("TestSetMenuView: DoActivateL") );
-        iContainer = new (ELeave) CTestSetMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-        ((CAppUIAppUi*)AppUi())->iLogger->Log( 
-            _L("TestSetMenuView: container constructed") );
-        AppUi()->AddToStackL( *this, iContainer );
-        }
-   
-    //testing
-    iContainer->SetCurrentItemIndex(iCurrentTestCase);
-    
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    CAknNavigationControlContainer* np = 
-        (CAknNavigationControlContainer *)sp->ControlL(
-        TUid::Uid(EEikStatusPaneUidNavi));
-    
-    TResourceReader reader;
-    iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET );
-    iNaviDecorator = np->CreateNavigationLabelL( reader );
-    CleanupStack::PopAndDestroy(); // resource reader
-    np->PushL(*iNaviDecorator);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-
-    // Test modules are added to filter by test module submenu 
-    // if the submenu is opened
-    if (R_APPUI_FILTERBYMODULES_MENU == aResourceId)
-        {
-        RRefArray<TDesC> modules;
-        TInt ret = iUIStore->Modules( modules );
-        if( KErrNone != ret )
-            {
-            modules.Reset();
-            modules.Close();
-            User::Leave( ret );
-            }
-
-        TInt moduleCount = modules.Count();
-        
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByModule;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < moduleCount; i++)
-            {
-            item.iText = modules[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // Command IDs 0x1000 - 0x1FFF are reserved
-                               // for modules in hrh file.
-            }
-        
-        modules.Reset();
-        modules.Close();
-        }
-
-    // Test case files are added to filter by test case file submenu
-    // if the submenu is opened.
-    if (R_APPUI_FILTER_BY_TESTCASEFILE_MENU == aResourceId)
-        {
-        RRefArray<TDesC> testCaseFiles;
-        TInt ret = iUIStore->TestCaseFiles( testCaseFiles );
-        if( KErrNone != ret )
-            {
-            testCaseFiles.Reset();
-            testCaseFiles.Close();
-            User::Leave( ret );
-            }
-
-        TInt testCaseFileCount = testCaseFiles.Count();
-
-        TInt i;
-        CEikMenuPaneItem::SData item;
-
-        item.iCommandId = ECmdFilterByTestCaseFile;
-        item.iFlags = 0;
-        item.iCascadeId = 0;
-
-        for (i = 0; i < testCaseFileCount; i++)
-            {
-            item.iText = testCaseFiles[i];
-            aMenuPane->AddMenuItemL(item);
-            item.iCommandId++; // Command IDs 0x2000 - 0x2FFF are reserved for
-                               // test case files in hrh file.
-            }
-        }
-        
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, 
-    TListBoxEvent aEventType)
-    {
-
-    if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-        {
-        const CTestSetInfo& testSetInfo = 
-            iUIStore->TestSetL( iCurrentTestSet );
-        const RRefArray<const CTestInfo>* allCases = &testSetInfo.TestCases();
-
-        TInt testCaseCount = allCases->Count();
-           if (testCaseCount > 0 )
-            {
-            StartTestSetL();
-            }
-        }
-   }
- 
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::CreateTestSet
-// 
-// Creates new test set.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuView::CreateTestSetL( const TDesC& aTestSetName )
-    {
-    TInt error = 0;
-    TBuf<100> message;
-    
-    _LIT(KPath, "c:\\TestFramework\\");
-    RFs fs;
-    User::LeaveIfError(fs.Connect());
-    CleanupClosePushL(fs);
-    TEntry entry;
-    // we check if the c:\testframework directory exists
-    // It is mandatory for this dir to exist if we want to save a test set.
-    // This dir must be localised on the C drive of the device
-    if(fs.Entry(KPath, entry) != KErrNone)
-    	{	// if the dir does not exist 
-    	TInt err = fs.MkDirAll(KPath);	// we create it
-    	if(err != KErrNone)
-    		{	// if of any reason it was impossible to create the dir - inform user about it
-	    	CAknInformationNote* note = new (ELeave) CAknInformationNote(ETrue);
-	    	note->ExecuteLD( _L("Could not create c:\\TestFramework dir!") );
-    		}
-    	}
-    CleanupStack::PopAndDestroy(&fs);	// close and remove RFs object 
-    
-    error = iUIStore->LoadTestSet( aTestSetName );
-    
-    // If testset is either active or already created and saved.
- /*   if ( KErrNone == error)// || KErrAlreadyExists == error )
-        {
-        CEikonEnv::Static()->ReadResource( message, 
-            R_OVERWRITE_TESTSET_QUESTION );
-        CAknQueryDialog * dlg = 
-            CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
-        // Confirm overwrite
-        if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
-            {
-            error = iUIStore->RemoveTestSet( aTestSetName );
-            error = iUIStore->CreateTestSet( aTestSetName );
-            if ( error == KErrNone )
-                {
-                iCurrentTestSet = aTestSetName;
-                iSaveNeeded = ETrue;
-                }
-            }
-        // Else load saved default test set
-        else
-            {
-            iSaveNeeded = EFalse;
-            iCurrentTestSet = aTestSetName;
-            error = KErrAlreadyExists;
-            }
-        }
-    else if ( KErrNotFound == error )
-        {
-        error = iUIStore->CreateTestSet( aTestSetName );
-        if ( KErrNone == error )
-            {
-            iCurrentTestSet = aTestSetName;
-            iSaveNeeded = ETrue;
-            }
-        }
-    else if ( KErrPathNotFound == error )
-          {
-          error = iUIStore->CreateTestSet( aTestSetName );
-          iCurrentTestSet = aTestSetName;
-          iSaveNeeded = EFalse;
-          }
-    else
-        {
-        ((CAppUIAppUi*)AppUi())->iLogger->Log(_L("Test set creation fails with error: %d"), error );
-        CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
-        informationNote->ExecuteLD( _L("UNDEFINED ERROR!") );
-        }*/
-    
-    error = iUIStore->CreateTestSet( aTestSetName );
-    iCurrentTestSet = aTestSetName;
-    iSaveNeeded = ETrue;
-    return error;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::LoadTestSetL
-// 
-// Loads saved test set.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuView::LoadTestSetL( const TDesC& aTestSetName )
-    {
-    TInt error = 0;
-    TBuf<100> message;
-    error = iUIStore->LoadTestSet( aTestSetName );
-    if ( KErrNone == error || KErrAlreadyExists == error )
-        {
-        iCurrentTestSet = aTestSetName;
-        iSaveNeeded = EFalse;
-        }
-    else
-        {
-        CEikonEnv::Static()->ReadResource( message, 
-            R_LOAD_TESTSET_FAILED );
-        
-        CAknInformationNote* informationNote = new (ELeave) CAknInformationNote(ETrue);
-        informationNote->ExecuteLD(message);
-        }
-    
-    return error;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::SaveCurrentTestSet
-// 
-// Saves current test set.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuView::SaveCurrentTestSetL()
-    {
-    TInt error = 0;
-    TBuf<100> message;
-    
-    CEikonEnv::Static()->ReadResource( message, 
-        R_SAVE_TESTSET_QUESTION );
-        
-    CAknQueryDialog * dlg = 
-        CAknQueryDialog::NewL(CAknQueryDialog::ENoTone);
-    
-   if ( dlg->ExecuteLD( R_GENERAL_CONFIRMATION_DIALOG, message ) )
-       {
-        error = iUIStore->SaveTestSet2( iCurrentTestSet );
-        iSaveNeeded = EFalse;
-        
-      }
-   AppUi()->HandleCommandL(EAppUIGoBack);
-
-    return error;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::RemoveActiveTestSet
-// 
-// Removes current test set.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetMenuView::RemoveActiveTestSet()
-    {
-    TInt error = 0;
-    
-    error = iUIStore->RemoveTestSet( iCurrentTestSet );
-    
-    return error;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::StartTestSetL
-// 
-// Shows confirmation dialog and verify if user really want to start test set.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::StartTestSetL()
-    {
-    _LIT( KErrorStartingTestSet, 
-        "TestSetMenuView: StartTestSetL() fails (%d)" );
-    
-    TInt ret(KErrNone);
-    TInt index(0);
-    TInt selectedItem(0);
-    
-    // Default mode is parallel.
-    CStartedTestSet::TSetType mode = CStartedTestSet::ESetParallel;
-    
-    CAknListQueryDialog* startDialog = 
-        new (ELeave) CAknListQueryDialog(&selectedItem);
-    
-    // Show confirmation dialog.
-    if ( startDialog->ExecuteLD(R_START_MULTIPLE_TESTCASES_LIST_QUERY) )
-        {
-        index = ((CAppUIAppUi*)AppUi())->iStartedTestSet;
-        // Check mode
-        if ( 1 == selectedItem )
-            {
-            mode = CStartedTestSet::ESetSequential;
-            }
-        
-        // Start test set cases.
-        ret = iUIStore->StartTestSet( 
-            iUIStore->TestSetL( iCurrentTestSet ), index, mode );
-            
-        if ( ret != KErrNone )
-            {
-            ((CAppUIAppUi*)AppUi())->iStartedTestSet = -1;
-            ((CAppUIAppUi*)AppUi())->iLogger->Log( 
-                KErrorStartingTestSet, ret );
-            }
-        else
-            {
-            ((CAppUIAppUi*)AppUi())->iStartedTestSet = index;
-            }
-        }
-        
-    }
-   
-// ----------------------------------------------------------------------------
-// CTestSetMenuView::RemoveSelectedTestCasesL
-// 
-// Removes marked test cases from test set.
-// ----------------------------------------------------------------------------
-//
-void CTestSetMenuView::RemoveSelectedTestCasesL()
-    {
-    TInt positionToRemove(0);
-    
-    const CTestSetInfo& testSetInfo = iUIStore->TestSetL( iCurrentTestSet );
-    const RRefArray<const CTestInfo>* allCases = &testSetInfo.TestCases();
-    CEikListBox* listBox = iContainer->ListBox();
-
-    iSaveNeeded = ETrue;
-    positionToRemove = listBox->CurrentItemIndex();
-    // Remove selected test case from test set.
-    TInt ret = iUIStore->RemoveFromTestSet(iCurrentTestSet, allCases->operator[](positionToRemove));
-    iContainer->RemoveListBoxItemL(positionToRemove);
-    
-    if( ret != KErrNone )
-        {
-        RDebug::Print( _L("RemoveFromTestSet failed with value: %d"), ret );
-        }
-    }
-
-
-// End of File
--- a/stifui/stifui/src/TestSetStartedCasesContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,466 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetStartedCasesContainer 
-* class definition.
-*
-*/
-
-// INCLUDE FILES
-
-#include <aknlists.h>  // ListBox
-#include <AknIconArray.h>  // CAknIconArray
-#include <badesca.h> // CDesCArray
-#include <eikclbd.h> // CColumnListBoxData
-#include <aknnotewrappers.h>
-
-#include <Stifui.rsg>
-
-//#include "UIStoreIf.h"         
-//#include "UIStore.h"            
-//#include "UIEngine.h"           
-//#include "UIEngineContainer.h"  
-
-#include <stifinternal/UIStoreIf.h>
-#include <stifinternal/UIStore.h>
-#include <stifinternal/UIEngine.h>
-#include <stifinternal/UIEngineContainer.h>
-
-#include "TestSetStartedCasesContainer.h"
-#include "ShowStartedCasesContainer.h"
-#include "Stifui.hrh"
-#include "AppUIAppUi.h"
-
-#include "MenuListBox.h"
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::ConstructL
-// 
-// Symbian OS two phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver)
-    {
-    CreateWindowL();
-
-    iUIStore = ( (CAppUIAppUi*)iCoeEnv->AppUi() )->UIStoreHandler();
-    
-	iListBox = CMenuListBox::NewL(ETestSetStartedCasesViewId); /*CAknSingleStyleListBox();*/
-	iListBox->SetContainerWindowL( *this );
-	iListBox->SetListBoxObserver( aListBoxObserver );
-    iListBox->ConstructL(this, EAknListBoxSelectionList);
-
-    //Create Scroller control for ListBox and set its visibility
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-
-    if ( iUIStore )
-        {
-        
-        iListBoxModel = CStartedTestsListBoxModel::NewL( &iStartedTestsPtrs );
-        iListBox->Model()->SetItemTextArray(iListBoxModel);
-        ConstructListBoxModelL();
-        iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray);
-        iListBox->HandleItemAdditionL();
-
-        }
-    else
-        {
-        //User::Leave( syy?? )
-        }
-	iListBox->ActivateL();
-	((CMenuListBox*)iListBox)->SetPreviousFocus();
-
-    SetRect(aRect);
-    ActivateL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::ConstructListBoxModelL
-// 
-// Constructs list box model without any filtering.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::ConstructListBoxModelL()
-    {
-    TInt items(0);
-    TInt index = ((CAppUIAppUi*)iCoeEnv->AppUi())->iStartedTestSet;
-    
-    // Check if there is started test sets and if there is,
-    // show test set´s info.
-    if ( index != -1 )
-        {
-        const RRefArray<CStartedTestCase>* startedTestCases;
-        CStartedTestSet* startedTestSet =
-     	    &iUIStore->StartedTestSetL( index );
-        startedTestCases = &startedTestSet->TestCases();
-        
-        const TInt KStartedCaseCount = startedTestCases->Count();
-
-        items = iStartedTestsPtrs.Count();
-        iStartedTestsPtrs.Reset(); // Remove all pointers (does not delete objects)
-        iListBox->HandleItemRemovalL();
-        
-        const TInt KSelectedMode = ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode;
-        
-        // Loop through all started cases
-        for( TInt i=0; i < KStartedCaseCount; i++ )
-            {
-            switch ( KSelectedMode )
-                {
-                case EShowAllStartedCases:
-                    {
-                    iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                    break;
-                    }
-                case EShowOngoingCases:
-                    {
-                    // Note: PAUSE IS ALSO RUNNIN STATUS
-                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusRunning )
-                        {
-                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                        }
-                    break;
-                    }
-                case EShowPassedCases:
-                    {
-                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusPassed )
-                        {
-                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                        }
-                    break;
-                    }
-                case EShowPausedCases:
-                    {
-                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusRunning )
-                        {
-                        if( startedTestCases->operator[](i).UIEngineContainer().State() == CUIEngineContainer::EPaused )
-                            {
-                            iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                            }
-                        }
-                    break;
-                    }
-                case EShowFailedCases:
-                    {
-                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusFailed )
-                        {
-                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                        }
-                    break;
-                    }
-                case EShowCrashedAbortedCases:
-                    {
-                    if ( startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusAborted
-                    		||
-                    	 startedTestCases->operator[](i).Status() & CUIStoreIf::EStatusCrashed)
-                        {
-                        iStartedTestsPtrs.Append( startedTestCases->operator[](i) );
-                        }
-                    break;
-                    }
-                }
-        }   
-
-        if ( items < iStartedTestsPtrs.Count() )
-            {
-            iListBox->HandleItemAdditionL();
-            }
-        else
-            {
-            iListBox->HandleItemRemovalL();
-            }
-           
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::~CTestSetStartedCasesContainer
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetStartedCasesContainer::~CTestSetStartedCasesContainer()
-    {
-    delete iListBox;
-    
-    iStartedTestsPtrs.Close(); // does not delete objects whose pointers are contained in the array
-    
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::SizeChanged
-// 
-// Called by framework when the view size is changed.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::SizeChanged()
-    {
-    if ( iListBox )
-		{
-		iListBox->SetRect( Rect() ); // Sets rectangle of listbox.
-		}
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::CountComponentControls
-// 
-// Gets a count of the component controls of this list box control.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetStartedCasesContainer::CountComponentControls() const
-    {
-    return 1; // return nbr of controls inside this container
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::ComponentControl
-// 
-// Gets a pointer to the specified component control.
-// ----------------------------------------------------------------------------
-//
-CCoeControl* CTestSetStartedCasesContainer::ComponentControl(TInt aIndex) const
-    {
-    switch ( aIndex )
-        {
-		case 0: 
-			return iListBox;
-        default:
-            return NULL;
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::Draw
-// 
-// Draw a control, called by window server.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::Draw(const TRect& /*aRect*/) const
-    {
-    // CWindowGc& gc = SystemGc();
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::OfferKeyEventL
-// 
-// Handles key events.
-// ----------------------------------------------------------------------------
-//
-TKeyResponse CTestSetStartedCasesContainer::OfferKeyEventL(
-	const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    if (aType != EEventKey)
-    {
-		return EKeyWasNotConsumed;
-	}
-
-	if (iListBox)
-		{
-		return iListBox->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::SelectedTestCase
-// 
-// Returns reference to currently selected test case in view (listbox).
-// ----------------------------------------------------------------------------
-//
-CStartedTestCase* CTestSetStartedCasesContainer::SelectedTestCase()
-    {
-    if ( iStartedTestsPtrs.Count() > 0 )
-        {
-        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
-        }
-    else
-        {
-        return NULL;
-        }
-/*
-    //if ( iListBox->ItemExists(0)  ) // Check that list box is not empty
-    if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount()  ) // Check that list box is not empty
-        {
-        return &(iStartedTestsPtrs[ iListBox->CurrentItemIndex() ]);
-        }
-    else
-        {
-        return NULL;
-        }
-*/
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::DrawListBox
-// 
-// Draws the list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::DrawListBox()
-    {
-    if ( iListBox )
-        {
-        iListBox->DrawNow();
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::HandleItemAdditionL
-// 
-// Handles the addition of an item to the model.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::HandleItemAdditionL()
-    {
-    iListBox->HandleItemAdditionL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::HandleItemRemovalL
-// 
-// Handles the removal of an item from the model.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::HandleItemRemovalL()
-    {
-    //TInt itemIndexBeforeRemoval = iListBox->CurrentItemIndex();
-
-    iListBox->HandleItemRemovalL();
-
-    // HandleItemRemovalL "loses selection" if current item is removed
-    // -> we have to check it and set one item as current item to make it possible for
-    // user to select one item from items left after remove
-    if ( iListBox->CurrentItemIndex() == -1 ) // No item selected
-        if ( ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount() > 0 ) // there are items
-            SetCurrentItemIndex(0);
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::TestsInViewCount
-// 
-// Returns count of test cases in view.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetStartedCasesContainer::TestsInViewCount()
-    {
-    return ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::CurrentTestCase
-// 
-// Returns pointer to currently selected test case.
-// ----------------------------------------------------------------------------
-//
-CStartedTestCase* CTestSetStartedCasesContainer::CurrentTestCase()
-    {
-    return &iStartedTestsPtrs[ iListBox->CurrentItemIndex() ];
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::CurrentItemIndex
-// 
-// Gets the index number of the current item in the view.
-// ----------------------------------------------------------------------------
-//
-TInt CTestSetStartedCasesContainer::CurrentItemIndex()
-    {
-    return iListBox->CurrentItemIndex();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::SetCurrentItemIndex
-// 
-// Sets the current item.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::SetCurrentItemIndex(TInt aIndex)
-    {
-    TInt itemCount = ((CStartedTestsListBoxModel*)iListBox->Model())->MdcaCount();
-    if ( aIndex < itemCount )
-        {
-        iListBox->SetCurrentItemIndex(aIndex);
-        }
-    else
-        {
-        iListBox->SetCurrentItemIndex(itemCount);
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::ResetListBox
-// 
-// Resets the selection indices, top and current item indices,
-// the selection, and the horizontal scroll offset of this list box.
-// This function does not redraw the list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::ResetListBox()
-    {
-    iListBox->Reset();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::RemoveSelectedExecutionsL
-// 
-// Removes items from list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::RemoveSelectedExecutionsL()
-    {
-    TInt indexOfRemovedExecution = 0;
-    iStartedTestsPtrs.Remove(indexOfRemovedExecution);
-    HandleItemRemovalL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::RemoveAllExecutionsInViewL
-// 
-// Removes all started test cases from list box.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesContainer::RemoveAllExecutionsInViewL()
-    {
-    TInt exutionsInViewCount = iStartedTestsPtrs.Count();
-    iStartedTestsPtrs.Reset(); //Empties the array, does not delete the objects whose pointers are contained in the array
-    HandleItemRemovalL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesContainer::SaveActiveLine
-//
-// Makes the iListBox member save its focus position
-// ----------------------------------------------------------------------------
-//	
-void CTestSetStartedCasesContainer::SaveActiveLine()
-	{
-	((CMenuListBox*)iListBox)->SaveFocusPosition();
-	}
-
-// End of File  
--- a/stifui/stifui/src/TestSetStartedCasesView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,485 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestSetStartedCasesView class
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <eikmenub.h>
-#include  <aknViewAppUi.h>
-#include  <barsread.h>	//TResourceReader
-#include  <Stifui.rsg>
-
-//#include  "UIEngineContainer.h"  
-#include <stifinternal/UIEngineContainer.h>
-
-#include  "Stifui.hrh" 
-
-#include  "TestSetStartedCasesView.h"
-#include  "TestSetStartedCasesContainer.h"
-#include  "AppUIAppUi.h"
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_TESTSET_STARTEDCASESVIEW );
-    iFilterModule.Zero();
-    iFilterTestCaseFile.Zero();
-    iSelectedTestCase=0;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::~CTestSetStartedCasesView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestSetStartedCasesView::~CTestSetStartedCasesView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestSetStartedCasesView::Id() const
-    {
-    return TUid::Uid(ETestSetStartedCasesViewId);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::HandleCommandL(TInt aCommand)
-    {   
-	TBool refreshListBox = EFalse;
-    // Handle rest possible commands
-    switch ( aCommand )
-        {
-        case ECmdShowAllStartedCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowAllStartedCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowOngoingCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowOngoingCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowPausedCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowPausedCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowPassedCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowPassedCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowFailedCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowFailedCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowCrashedAbortedCases:
-            {
-            ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode = EShowCrashedAbortedCases;
-            refreshListBox = ETrue;
-            break;
-            }
-        case ECmdShowStatistics:
-            {
-            //EShowStatistics
-            TMessageBoxUtil::ShowNotImplementedYetL();
-            break;
-            }
-        case ECmdViewOutput:
-            {
-            ViewTestCaseOutputL();
-            break;
-            }
-        case ECmdPauseTestCase:
-            {
-            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-            if ( NULL != startedTestCase )
-                {
-                startedTestCase->UIEngineContainer().PauseTest();
-                }
-            break;
-            }
-        case ECmdResumeTestCase:
-            {
-            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-            if ( NULL != startedTestCase )
-                {
-                startedTestCase->UIEngineContainer().ResumeTest();
-                }
-            break;
-            }
-        case ECmdAbortTestCase:
-            {
-            CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-            if ( NULL != startedTestCase )
-                {
-                startedTestCase->UIEngineContainer().CancelTest();
-                }
-            break;
-            }
-        case EAknSoftkeyOk:
-            {
-            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
-            break;
-            }
-        case EAknSoftkeyBack:
-            {
-            // Remove possible filterings so that they does not affect when coming again to this view
-            iFilterModule.Zero();
-            iFilterTestCaseFile.Zero();
-            iSelectedTestCase=0; //Reset selected test case information
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-        
-        if ( refreshListBox )
-        	{
-        	RefreshNaviTitleL();
-        	iContainer->ConstructListBoxModelL();
-        	iContainer->DrawListBox();
-        	}
-
-    }
-    
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::RefreshNaviTitleL
-// 
-// Refreshes view name shown in the navi pane.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::RefreshNaviTitleL()
-    {
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	TResourceReader reader;
-
-    switch ( ((CAppUIAppUi*)iCoeEnv->AppUi())->iShowStartedCasesMode )
-        {
-        case EShowAllStartedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED);
-            break;
-        case EShowOngoingCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_ONGOING);
-            break;
-        case EShowPausedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PAUSED);
-            break;
-        case EShowPassedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_PASSED);
-            break;
-        case EShowFailedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_FAILED);
-            break;
-        case EShowCrashedAbortedCases:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_STARTED_CRASHED_ABORTED);
-            break;
-        default:
-            iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_TESTSET);
-            break;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;        
-    iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        ViewTestCaseOutputL();
-        }
-
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::ViewTestCaseOutput
-// 
-// Shows outputs of test case which is selected in Container.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::ViewTestCaseOutputL()
-	{
-    iSelectedTestCase = iContainer->CurrentItemIndex();
-    
-    // Sets index  of selected test case to AppUi
-    ( ( CAppUIAppUi* )AppUi() )->SetStartedTestCase( iContainer->CurrentTestCase() );
-    
-    AppUi()->HandleCommandL(ECmdViewOutput);
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CTestSetStartedCasesContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-
-    if ( iSelectedTestCase )
-        iContainer->SetCurrentItemIndex(iSelectedTestCase);
-
-    iContainer->DrawListBox();
-    
-    RefreshNaviTitleL();
-   }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;        
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::DynInitMenuPaneL(
-    TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-
-    // options menu
-    if ( R_TESTSET_STARTEDCASESVIEW_MENU == aResourceId )
-        {
-        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-        if ( NULL != startedTestCase )
-            {
-            switch ( startedTestCase->Status() )
-                {
-                // test case running
-                case CUIStoreIf::EStatusRunning:
-                    {
-                    switch ( startedTestCase->UIEngineContainer().State() )
-                        {
-                        case CUIEngineContainer::ERunning:
-                        case CUIEngineContainer::EPaused:
-                            {
-                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, EFalse );
-                            break;
-                            }
-                        //case CUIEngineContainer::ENotStarted:
-                        //case CUIEngineContainer::EExecuted:
-                        //case CUIEngineContainer::EFinished:
-                        default:
-                            {
-                            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-                            }
-                        }
-                    break;
-                    }
-                        
-                // test case not running
-                //case CUIStoreIf::EStatusPassed:
-                //case CUIStoreIf::EStatusFailed:
-                //case CUIStoreIf::EStatusAborted:
-                //case CUIStoreIf::EStatusExecuted
-                default:
-                    {
-                    aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-                    }
-                }
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( ECmdViewOutput, ETrue );
-            aMenuPane->SetItemDimmed( ECmdShowSetMenu, ETrue );
-            }
-        }
-
-    // test case control menu
-    if ( R_TESTCASE_CONTROL_SUBMENU == aResourceId )
-        {
-        CStartedTestCase* startedTestCase = iContainer->SelectedTestCase();
-        
-        if ( NULL != startedTestCase )
-            {
-            if ( startedTestCase->Status() == CUIStoreIf::EStatusRunning )
-                {
-                switch ( startedTestCase->UIEngineContainer().State() )
-                    {
-                    case CUIEngineContainer::ERunning:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, EFalse );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
-                        break;
-                        }
-                    case CUIEngineContainer::EPaused:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, EFalse );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, EFalse );
-                        break;
-                        }
-                    //case CUIEngineContainer::ENotStarted:
-                    //case CUIEngineContainer::EExecuted:
-                    //case CUIEngineContainer::EFinished:
-                    default:
-                        {
-                        aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                        aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                        break;
-                        }
-                    }
-                }
-            else
-                {
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                }
-            }
-        else
-            {
-            aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-            aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-            }
-        }
-            
-    }
-
-// ----------------------------------------------------------------------------
-// CTestSetStartedCasesView::TestCaseStateChangedL
-// 
-// Handles status changes of test cases in view.
-// ----------------------------------------------------------------------------
-//
-void CTestSetStartedCasesView::TestCaseStateChangedL()
-    {
-    if ( iContainer )
-        {
-
-        //CStartedTestCase* currentlySelectedTest = iContainer->SelectedTestCase();
-
-        TInt numOfTestsInViewBeforeStateChange = iContainer->TestsInViewCount();
-
-            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
-
-        iContainer->ConstructListBoxModelL();
-
-        // Check if filtering by module or by test case file is selected
-        /*
-        if ( iFilterModule.Length() )
-            {
-            iContainer->FilterCasesByModuleL(iFilterModule);
-            }
-        else if ( iFilterTestCaseFile.Length() )
-            {
-            iContainer->FilterCasesByTCFileNameL(iFilterTestCaseFile);
-            }
-        */
-
-        TInt numOfTestsInViewAfterStateChange = iContainer->TestsInViewCount();
-            //((CStartedTestsListBoxModel*)iContainer->iListBox->Model())->MdcaCount();
-
-        if ( numOfTestsInViewAfterStateChange >= numOfTestsInViewBeforeStateChange )
-            iContainer->HandleItemAdditionL();
-        else
-            iContainer->HandleItemRemovalL();
-
-        iContainer->DrawListBox();
-
-        }
-    }
-
-// End of File
--- a/stifui/stifui/src/Testmodulesmenuview.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CTestModulesMenuView class 
-* definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <Stifui.rsg>
-
-#include  <barsread.h>	//TResourceReader
-#include  "TestModulesMenuView.h"
-#include  "TestModulesMenuContainer.h"
-#include  "Stifui.hrh"
-
-#include "AppUIAppUi.h" // For ShowNotImplementedYet() method
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::ConstructL()
-    {
-    CView::ConstructL();
-    BaseConstructL( R_APPUI_TESTMODULESMENUVIEW );
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::~CTestCaseOutputView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CTestModulesMenuView::~CTestModulesMenuView()
-    {
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CTestModulesMenuView::Id() const
-    {
-    return TUid::Uid(ETestModulesMenuViewId); //KTestCaseMenuViewId;
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::HandleCommandL(TInt aCommand)
-    {   
-    switch ( aCommand )
-        {
-        case EAknSoftkeyOk:
-            {
-            iEikonEnv->InfoMsg( _L("TestCase Menu ok") );
-            break;
-            }
-        case EAknSoftkeyBack:
-            {
-            AppUi()->HandleCommandL(EAppUIGoBack);
-            break;
-            }
-        // Next is removed from Stifui.rss file in 
-        // RESOURCE MENU_PANE r_appui_testmodulesmenuview_menu's
-        // items section. If want back to use remeve comment there
-        //case ECmdOpenModule:
-        //    {
-            //TFileName fileName;
-            //AknCommonDialogs::RunSelectDlgLD (fileName,
-            //                                  R_MEMORY_SELECTION_DIALOG,
-            //                                  R_FILE_SELECTION_DIALOG
-            //
-            //);
-        //    ShowNotImplementedYet();
-        //    break;
-        //    }
-        case ECmdAddModule:
-            {
-            TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->LoadAllModules();
-            if( KErrNone != ret )
-                {
-                iEikonEnv->InfoMsg( _L("Module adding fails!") );
-                break;
-                }
-
-            AppUi()->HandleCommandL( EAppUIGoBack );
-            //ShowNotImplementedYet();
-            break;
-            }
-        case ECmdRemoveModule:
-            {
-            TInt moduleNumber = iContainer->CurrentItemIndex();
-            RRefArray<TDesC> allModules;
-            TInt ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->Modules( allModules );
-            if( KErrNone != ret )
-                {
-                allModules.Reset();
-                allModules.Close();
-                User::Leave( ret );
-                }
-            // No modules exist...break...
-            if( allModules.Count() == 0 )
-                {
-                iEikonEnv->InfoMsg( _L("No modules available!") );
-                allModules.Reset();
-                allModules.Close();
-                break;
-                }
-            // Module found...remove module...
-            ret = ((CAppUIAppUi*)AppUi())->UIStoreHandler()->RemoveTestModule(
-                                        allModules[ moduleNumber ] );
-            if( KErrNone != ret )
-                {
-                User::Leave( ret );
-                }
-            allModules.Reset();
-            allModules.Close();
-
-            //iContainer->UpdateView();
-            AppUi()->HandleCommandL( EAppUIGoBack );
-            //ShowNotImplementedYet();
-            break;
-            }
-        default:
-            {
-            AppUi()->HandleCommandL( aCommand );
-            break;
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::DynInitMenuPaneL
-// 
-// Initializes menu pane.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* /* aMenuPane */)
-    {
-
-    if (R_APPUI_TESTMODULESMENUVIEW_MENU == aResourceId)
-        {
-        /*switch ( iData->StartedCaseInOutputView()->State() )
-            {
-            case ENotStarted:
-                {
-                aMenuPane->SetItemDimmed( ECmdOpenModule, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAddModule, ETrue );
-                aMenuPane->SetItemDimmed( ECmdRemoveModule, ETrue );
-                break;
-                }
-            case ERunning:
-                {
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                break;
-                }
-            case EPaused:
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                break;
-                }
-            case EPassed:
-            case EFailed:
-            case EAborted:
-            case EExecuted:
-                {
-                aMenuPane->SetItemDimmed( ECmdPauseTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdResumeTestCase, ETrue );
-                aMenuPane->SetItemDimmed( ECmdAbortTestCase, ETrue );
-                break;
-                }
-            }*/
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::HandleListBoxEventL
-// 
-// Handles listbox events.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-	{
-	if ( ( aEventType == EEventEnterKeyPressed ) || ( aEventType == EEventItemDoubleClicked ) )
-		{
-        // Open or edit test module or ???
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CTestModulesMenuContainer;
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect(), this);
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-	CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
-	
-	TResourceReader reader;
-	iCoeEnv->CreateResourceReaderLC(reader,R_NAVITITLE_MODULES);
-	iNaviDecorator = np->CreateNavigationLabelL( reader );
-	CleanupStack::PopAndDestroy(); // resource reader
-	np->PushL(*iNaviDecorator);
-   }
-
-// ----------------------------------------------------------------------------
-// CTestModulesMenuView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CTestModulesMenuView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        iContainer->SaveActiveLine();
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    delete iNaviDecorator;
-    iNaviDecorator = NULL;
-    }
-
-// End of File
-
--- a/stifui/stifui/src/UIStoreHandler.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains implementation of 
-* CUIStoreHandler class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "UIStoreHandler.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
-class CUIStore;
-
-// ==================== LOCAL FUNCTIONS =======================================
-// None
-
-// ================= MEMBER FUNCTIONS =========================================
-// ----------------------------------------------------------------------------
-// CUIStoreHandler::CUIStoreHandler
-// 
-// Default constructor.
-// C++ default constructor can NOT contain any code, that might leave.
-// ----------------------------------------------------------------------------
-//
-CUIStoreHandler::CUIStoreHandler( CAppUIAppUi* aAppUIAppUI ) :
-    iAppUIAppUI( aAppUIAppUI ),
-    iExecutedTestCaseCount( 0 )
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// CUIStoreHandler::ConstructL
-// 
-// Symbian OS second phase constructor.
-// Symbian OS default constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CUIStoreHandler::ConstructL()
-    {
-    CUIStoreIf::ConstructL();
-
-    }
-
-// ----------------------------------------------------------------------------
-// CUIStoreHandler::NewL
-// 
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CUIStoreHandler* CUIStoreHandler::NewL( CAppUIAppUi* aAppUIAppUI )
-    {
-    // Create CUIStoreHandler object uistorehandler
-    CUIStoreHandler* uistorehandler = new (ELeave) CUIStoreHandler( aAppUIAppUI );
-
-    CleanupStack::PushL( uistorehandler );
-    uistorehandler->ConstructL();
-    CleanupStack::Pop( uistorehandler );
-
-    return uistorehandler;
-
-    }
-
-// ----------------------------------------------------------------------------
-// CUIStoreHandler::~CUIStoreHandler
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CUIStoreHandler::~CUIStoreHandler()
-    {
-
-    }
-
-// ----------------------------------------------------------------------------
-// CUIStoreHandler::Update
-// 
-// Receives output update notify from started test case.
-// Checks if that test case is currently in output view then
-// sends notification to AppUI which handles notification onward.
-// ----------------------------------------------------------------------------
-//
-void CUIStoreHandler::Update( CStartedTestCase* aTestCase, TInt aStatus )
-    {
-	_LIT( KErrorMsg, "Error during output update" );
-    TRAPD(err,iAppUIAppUI->OutputUpdateL( aTestCase, aStatus ));
-	if ( err != KErrNone )
-		{
-		RDebug::Print( KErrorMsg );
-		}
-
-        //iAppUi->OutputUpdate();
-    //if( aStatus == EPrintUpdate )
-    //    {
-        //iAppUIAppUI->OutputUpdate( aTestCase );
-    //    }
-    //else
-    //    {
-        //iAppUIAppUI->TestCaseStateChanged();
-    //    }
-
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS =================================
-// None
-
-//  End of File
--- a/stifui/stifui/src/View.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains CView class definition.
-*
-*/
-
-// INCLUDE FILES
-#include  <aknViewAppUi.h>
-#include  <Stifui.rsg>
-#include  "AppUIAppUi.h"
-#include  "View.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-// ----------------------------------------------------------------------------
-// CView::ConstructL
-// 
-// Symbian OS two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-void CView::ConstructL()
-    {
-    iUIStore = ( (CAppUIAppUi*)AppUi() )->UIStoreHandler();
-    }
-
-// ----------------------------------------------------------------------------
-// CView::~CView
-// 
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CView::~CView()
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CView::Id
-// 
-// Returns view´s id.
-// ----------------------------------------------------------------------------
-//
-TUid CView::Id() const
-    {
-    return TUid::Uid(0);
-    }
-
-// ----------------------------------------------------------------------------
-// CView::HandleCommandL
-// 
-// Handles a command.
-// ----------------------------------------------------------------------------
-//
-void CView::HandleCommandL(TInt /*aCommand*/)
-    {   
-    }
-
-// ----------------------------------------------------------------------------
-// CView::HandleClientRectChange
-// 
-// Handles client rect changes.
-// ----------------------------------------------------------------------------
-//
-void CView::HandleClientRectChange()
-    {
-    }
-
-// ----------------------------------------------------------------------------
-// CView::DoActivateL
-// 
-// Initializes view when activated.
-// ----------------------------------------------------------------------------
-//
-void CView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/ )
-	{
-	}
-
-// ----------------------------------------------------------------------------
-// CView::DoDeactivate
-// 
-// Deactivates view.
-// ----------------------------------------------------------------------------
-//
-void CView::DoDeactivate()
-    {
-    }
-
-// End of File
--- a/stifui/uitestserverstarter/data/UITestServerStarter.rls	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains name of uitestserverstarter.
-*
-*/
-
-//  LOCALISATION STRINGS
-
-// Caption string for app.
-#define qtn_caption_string "UITestServerStarter"
-
-// End of File
--- a/stifui/uitestserverstarter/data/UITestServerStarter.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file defines UITestServerStarter resources.
-*
-*/
-
-//  RESOURCE IDENTIFIER
-NAME UITE	// 4 letter ID
-
-
-//  INCLUDES
-#include <eikon.rh>
-#include <avkon.rsg>
-#include <avkon.rh>
-#include <appinfo.rh>
-#include "UITestServerStarter.hrh"
-#include "UITestServerStarter.rls"
-
-//  RESOURCE DEFINITIONS
-// -----------------------------------------------------------------------------
-//
-//	Define the resource file signature
-//	This resource should be empty.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE RSS_SIGNATURE
-	{
-	}
-
-// -----------------------------------------------------------------------------
-//
-//	Default Document Name
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE TBUF r_default_document_name
-	{
-	buf="UITE";
-	}
-
-// -----------------------------------------------------------------------------
-//
-//	Define default menu and CBA key.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE EIK_APP_INFO
-	{
-	//menubar = r_menubar;
-	cba = R_AVKON_SOFTKEYS_EXIT;
-	}
-
-
-// -----------------------------------------------------------------------------
-//
-//   r_menubar
-//   Main menubar
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_BAR r_menubar
-	{
-	titles =
-		{
-		MENU_TITLE { menu_pane = r_menu; }
-		};
-	}
-
-
-// -----------------------------------------------------------------------------
-//
-//   r_menu
-//   Menu for "Options"
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE MENU_PANE r_menu
-	{
-	items =
-		{
-		MENU_ITEM
-				{
-				command = EAknSoftkeyExit;
-				txt = qtn_exit;
-				}
-		};
-	}
-
-// -----------------------------------------------------------------------------
-//
-// About dialog resource.
-//
-// -----------------------------------------------------------------------------
-//
-// None
-
-// -----------------------------------------------------------------------------
-//
-// Resources for messages.
-//
-// -----------------------------------------------------------------------------
-//
-RESOURCE TBUF32 r_caption_string { buf=qtn_caption_string; }
-
-// ---------------------------------------------------------------------------- 
-//
-// r_localisable_app_info
-//
-// ---------------------------------------------------------------------------- 
-//
-RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
-	{
-	short_caption = qtn_caption_string;
-	caption_and_icon = 
-	CAPTION_AND_ICON_INFO
-		{
-		caption = qtn_caption_string;
-
-		number_of_icons = 1;
-	   	icon_file = "\\resource\\apps\\UITestServerStarter.mif";
-		};
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/data/UITestServerStarter_reg.rss	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file defines UITestServerStarter resources.
-*
-*/
-
-#include "UITestServerStarter.hrh"
-#include "UITestServerStarter.rls"
-#include <appinfo.rh>
-#include <UITestServerStarter.rsg>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 _UID3
-
-RESOURCE APP_REGISTRATION_INFO
-	{
-	app_file="UITestServerStarter";
-//	localisable_resource_file =  qtn_loc_resource_file_1;
-//	localisable_resource_id = R_LOCALISABLE_APP_INFO;
-	hidden=KAppIsHidden;
-	embeddability=KAppNotEmbeddable;
-	}
-
--- a/stifui/uitestserverstarter/group/UITestServerStarter.mmp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: MMP file of UITestServerStarter.
-*
-*/
-
-#include <platform_paths.hrh>
-
-SMPSAFE
-
-TARGET			UITestServerStarter.exe
-TARGETTYPE		exe
-UID		  		0x100039CE 0x2000F8E8
-VENDORID		0x101FB657
-SECUREID		0x2000F8E8
-CAPABILITY		ALL -TCB
-
-START RESOURCE	../data/UITestServerStarter.rss
-	HEADER
-	TARGETPATH resource/apps
-END
-
-SOURCEPATH		../data
-START RESOURCE	UITestServerStarter_reg.rss
-	DEPENDS uitestserverstarter.rsg
-	TARGETPATH		/private/10003a3f/apps
-END
-
-SOURCEPATH		../src
-
-SOURCE			TestServerThreadStarter.cpp
-SOURCE			UITestServerStarter.cpp 
-SOURCE			UITestServerStarterAppView.cpp
-SOURCE			UITestServerStarterAppUi.cpp
-SOURCE			AknUiEnvProxy.cpp
-SOURCE			EventUtil.cpp
-SOURCE			UITestServerStarterApplication.cpp
-SOURCE			UITestServerStarterDocument.cpp
-SOURCE			UITestServerStarterAppContainer.cpp
-
-USERINCLUDE ../inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY		   euser.lib
-LIBRARY		   apparc.lib
-LIBRARY		   cone.lib
-LIBRARY		   eikcore.lib
-LIBRARY		   avkon.lib
-LIBRARY		   commonengine.lib
-LIBRARY		   efsrv.lib 
-LIBRARY		   estor.lib
-LIBRARY        aknnotify.lib
-LIBRARY        hlplch.lib
-LIBRARY        apgrfx.lib 
-LIBRARY        ws32.lib
-LIBRARY        aknskins.lib 
-LIBRARY        aknskinsrv.lib
-
-LIBRARY         stiftestserver.lib
-
-START WINS      
-// ?wins_specific_information
-END
-
-START MARM
-// ?marm_specific_information
-END
-
-/* Test Server requires large stack. In case of change update also thread creation parameters
-   in "void CTestServerThreadStarter::RunL" method.
-*/
-EPOCSTACKSIZE   40960
-EPOCHEAPSIZE 	0x001000 0x400000
-
-// End of File
--- a/stifui/uitestserverstarter/group/bld.inf	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: bld.inf build information for UITestServerStarter.
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-// Specify the platforms your component needs to be built for here.
-// ARM4 not supported in SDK
-
-	DEFAULT
-
-
-PRJ_EXPORTS
-// None
-
-PRJ_TESTEXPORTS
-// None
-
-PRJ_MMPFILES
-	
-	UITestServerStarter.mmp
-
-PRJ_TESTMMPFILES
-// None
-
-// End of file
--- a/stifui/uitestserverstarter/inc/AknUiEnvProxy.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the Akn UI 
-* Proxy class implementations.
-*
-*/
-
-#ifndef AKNUIENVPROXY_H_
-#define AKNUIENVPROXY_H_
-
-//  INCLUDES
-#include <stifinternal/UiEnvProxy.h>
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CUITestServerStarterAppUi;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// Akn implementation of UI Proxy interface.
-class CAknUiEnvProxy: public CUiEnvProxy
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-	
-	public:  // Constructors and destructor
-	    /**
-	    * C++ destructor.
-	    */
-	    ~CAknUiEnvProxy();
-	
-	public: // New functions
-	    /**
-	    * NewL is first phase of two-phased constructor.
-	    */		
-		static CAknUiEnvProxy* NewL( CUITestServerStarterAppUi* aAppUi );
-		
-    public: // Functions from base classes
-
-		/**
-		 * Parses key code.
-		 */
-		virtual TInt ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode ) const;
-	
-		/**
-		 * Parses key scan code.
-		 */
-		virtual TInt ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode ) const;
-	
-		/**
-		 * Parses key modifier.
-		 */
-		virtual TInt ParseModifier( const TDesC& aModifierName, TUint& aModifier ) const;
-	    
-		/**
-		 * Parse pointer event type
-		 */
-		virtual TInt ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType ) const;
-
-		/**
-		 * Brings UI control container to foreground.
-		 */
-		virtual void BringToForeground();
-
-		/**
-		 * Sends UI control container to background.
-		 */
-		virtual void SendToBackground();
-
-		/**
-		 * Sends local key event to UI control.
-		 */
-		virtual void PressKeyL( TRequestStatus* aStatus, TUint aKeyCode, TInt aKeyScanCode = 0, 
-				   TUint aKeyModifiers = 0, TInt aKeyRepeats = 0 );
-
-		/**
-		 * Sends global key event to UI control.
-		 */
-		virtual void PressKeyL( TUint aKeyCode, TInt aKeyScanCode = 0, 
-				   TUint aKeyModifiers = 0, TInt aKeyRepeats = 0 );
-
-		/**
-		 * Sends text to UI control.
-		 */
-		virtual void TypeTextL( TRequestStatus* aStatus, const TDesC& aText );
-
-		/**
-		 * Sends global text to UI control.
-		 */
-		virtual void TypeTextL( const TDesC& aText );
-		
-		/**
-		 * Send pointer event
-		 */
-		virtual void SendPointerEventL( TUint aType, const TPoint& aPosition );		
-		
-		/**
-		 * Send local pointer event
-		 */
-		virtual void SendPointerEventL( TRequestStatus* aStatus, TUint aType, const TPoint& aPosition );
-		
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-        
-    private:	// New functions
-	    /**
-	    * C++ default constructor.
-	    */
-		CAknUiEnvProxy();
-    
-	    /**
-	    * By default Symbian OS constructor is private.
-	    */
-    	void ConstructL( CUITestServerStarterAppUi* aAppUi );
-    
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-    	CUITestServerStarterAppUi* iAppUi;	// Pointer to AppUi
-		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None
-};
-
-#endif // AKNUIENVPROXY_H_
-
-// End of File
--- a/stifui/uitestserverstarter/inc/EventUtil.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains TEventUtil class declaration.
-*
-*/
-
-#ifndef EVENTUTIL_H_
-#define EVENTUTIL_H_
-
-//  INCLUDES
-#include <e32base.h>
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-// None
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// Utility class for key codes parsing.
-class TEventUtil
-    {
-    private: // Enumerations
-    	// none
-
-    public: // Enumerations
-		enum TCustomPointerEventType { EButton1 = 1000, EButton2, EButton3 };
-    
-    public: // Constructors and destructor
-
-    public: // Constructors and destructor
-
-    public: // New functions
-    	/**
-    	 * Returns descriptive key code name.
-    	 */
-        static TPtrC GetKeyCodeName( TUint aKeyCode );
-        
-        /**
-         * Parses key code.
-         */ 
-        static TInt ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode );
-
-		/**
-		 * Returns descriptive key scan code name.
-		 */
-        static TPtrC GetKeyScanCodeName( TInt aKeyScanCode );
-        
-        /**
-         * Parses key scan code.
-         */
-        static TInt ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode );
-
-        /**
-         * Returns descriptive key modifier name.
-         */
-        static TPtrC GetModifierName( TUint aModifier );
-        
-        /**
-         * Parses key modifier.
-         */
-        static TInt ParseModifier( const TDesC& aModifierName, TUint& aModifier );
-        
-        /**
-         * Parses pointer event type.
-         */
-        static TInt ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType );
-
-    public: // Functions from base classes
-
-    protected:  // New functions
-
-    protected:  // Functions from base classes
-
-    private:    // New functions
-
-    public:     // Data
-
-    protected:  // Data
-
-    private:    // Data
-
-    public:     // Friend classes
-
-    protected:  // Friend classes
-
-    private:    // Friend classes
-
-    };
-
-#endif /*EVENTUTIL_H_*/
-
-// End of File
--- a/stifui/uitestserverstarter/inc/TestServerThreadStarter.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* TestServerThreadStarter class.
-*
-*/
-
-
-#ifndef TESTSERVERTHREADSTARTER_H_
-#define TESTSERVERTHREADSTARTER_H_
-
-//  INCLUDES
-#include "e32base.h"
-
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CTestThreadContainerRunnerFactory;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// Class used to create thread in which testserver execution code is placed.
-class CTestServerThreadStarter: public CActive
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-	
-	public:  // Constructors and destructor
-	    /**
-	    * C++ destructor.
-	    */
-		~CTestServerThreadStarter();
-	
-	public: // New functions
-	    /**
-	    * NewL is first phase of two-phased constructor.
-	    */		
-		static CTestServerThreadStarter* NewL();
-	
-		/**
-		 * Performs testserver execution request.
-		 */
-		TInt RunTestServerThread( CTestThreadContainerRunnerFactory* aTestThreadContainerRunnerFactory );
-	public: // Functions from base classes
-		/**
-		 * RunL derived from CActive handles the completed requests.
-		 */
-		void RunL();
-		
-		/**
-		 * DoCancel derived from CActive handles the Cancel.
-		 */
-		void DoCancel();
-
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-        
-    private:	// New functions
-    	/**
-    	 * Thread function in which testserver execution code is placed.
-    	 */
-		static TInt TestServerStarterThreadFunction( TAny* aParameters );
-	    
-		/**
-	    * C++ default constructor.
-	    */
-		CTestServerThreadStarter();
-
-	    /**
-	    * By default Symbian OS constructor is private.
-	    */
-		void ConstructL();		
-	
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-		RTimer iTimer;	// Timer which complets testserver execution request
-		CTestThreadContainerRunnerFactory* iTestThreadContainerRunnerFactory; 	// Pointer to test thread container
-																				// runner factory passed as a parameter
-																				// to function which executes testserver
-		TThreadId iMainThreadId;	// UITestServerStarter main thread id 
-		TInt iReturnCode;			// TestServer execution return code
-		RSemaphore iServerThreadStartedSemaphore;	// Semaphore which indicates that testserver execution thread
-													// was successfully created		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None
-	};
-
-
-
-#endif // TESTSERVERTHREADSTARTER_H_
-
-// End of File
--- a/stifui/uitestserverstarter/inc/UITestServerStarter.hrh	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains UID3 definition.
-*
-*/
-
-#ifndef __UITESTSERVERSTARTER_HRH__
-#define __UITESTSERVERSTARTER_HRH__
-
-#define _UID3 0x2000F8E8
-
-#endif // __UITESTSERVERSTARTER_HRH__
--- a/stifui/uitestserverstarter/inc/UITestServerStarterAppContainer.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* UITestServerStarter AppUi container class.
-*
-*/
-
-#ifndef UITESTSERVERSTARTERAPPCONTAINER_H_
-#define UITESTSERVERSTARTERAPPCONTAINER_H_
-
-//  INCLUDES
-#include <coecntrl.h>
-#include <coemop.h>
-
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CAknsBasicBackgroundControlContext;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// UITestServerStarter standard AppUi container class.
-class CUITestServerStarterAppContainer: public CCoeControl
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-	
-	public:  // Constructors and destructor
-		/**
-		 * Virtual Destructor.
-		 */
-		~CUITestServerStarterAppContainer();
-
-	private:  // Constructors and destructor
-		/**
-		 * C++ default constructor.
-		 */
-		CUITestServerStarterAppContainer();
-
-		/**
-		 * Perform the second phase construction of a
-		 * CUITestServerStarterAppView object.
-		 */
-		void ConstructL( const TRect& aRect );
-		
-	public: // New functions
-		/**
-		 * Two-phased constructor.
-		 * Create a CUITestServerStarterAppContainer object, which will draw itself to aRect.
-		 */
-		static CUITestServerStarterAppContainer* NewL( const TRect& aRect );
-
-		/**
-		* Two-phased constructor.
-		* Create a CUITestServerStarterAppContainer object, which will draw itself
-		*/
-		static CUITestServerStarterAppContainer* NewLC( const TRect& aRect );
-
-		
-		/**
-		 * This function is used to allow controls to ask their owners 
-		 * for access to other objects that they own
-		 */
-		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
-	public: // Functions from base classes
-		// None
-	
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-        
-    private:	// New functions
-    	// None
-
-    private:	// Functions from base classes
-    
-    	/**
-    	 * Draws the control
-    	 */
-        void Draw( const TRect& aRect ) const;
-        
-        /**
-         * Responds to changes to the size and position of the 
-         * contents of this control
-         */
-        void SizeChanged();
-    
-        //void HandleResourceChange( TInt aType );
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-    	CAknsBasicBackgroundControlContext* iBgContext; // Skin background object context pointer
-		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None
-	};
-
-#endif /*UITESTSERVERSTARTERAPPCONTAINER_H_*/
-
-// End of File
--- a/stifui/uitestserverstarter/inc/UITestServerStarterAppUi.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* UITestServerStarter AppUi class
-*
-*/
-
-#ifndef UITESTSERVERSTARTERAPPUI_H_
-#define UITESTSERVERSTARTERAPPUI_H_
-
-//  INCLUDES
-#include <aknViewAppUi.h> 
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CUITestServerStarterAppView;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// UITestServerStarter AppUi class
-class CUITestServerStarterAppUi : public CAknViewAppUi
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-		/**
-		 * Currently handled event type.
-		 */
-		enum TEventType { 
-			ENone,		// None 
-			EPressKey,  // Press key event
-			ETypeText, 	// Type text event
-			EPointerEvent, // Pointer event
-			};
-	
-	public:  // Constructors and destructor
-		/**
-		 * C++ default constructor. This needs to be public due to
-		 * the way the framework constructs the AppUi
-		 */
-		CUITestServerStarterAppUi();
-	
-		/**
-		 * Virtual Destructor.
-		 */
-		virtual ~CUITestServerStarterAppUi();
-	
-	public: // New functions
-		/**
-		 * ConstructL.
-		 * 2nd phase constructor.
-		 */
-		void ConstructL();
-
-		/**
-	     * Prepares AppUi to recive type text event
-	     */	
-		virtual void PrepareToTypeText( TInt aTextLength );
-	
-		/**
-	     * Prepares AppUi to recive key press event
-	     */	
-		virtual void PrepareToPressKey();			
-
-		/**
-	     * Prepares AppUi to recive pointer event
-	     */	
-		virtual void PrepareToPointerEvent();			
-		
-		/**
-	     * Notifies that key press event was recived.
-	     */	
-		virtual void KeyPressHandled();
-	
-		/**
-	     * Notifies that text type event was recived.
-	     */	
-		virtual void TextTypeHandled();
-		
-		/**
-	     * Notifies that pointer event was recived.
-	     */	
-		virtual void PointerEventHandled();
-		
-		/**
-	     * Requests notification when key press event is handled.
-	     */	
-		virtual void NotifyAboutHandledKeyPress( TRequestStatus* aStatus );
-	
-		/**
-	     * Requests notification when text type event is handled.
-	     */	
-		virtual void NotifyAboutHandledTextType( TRequestStatus* aStatus );	
-
-		/**
-	     * Requests notification when pointer event is handled.
-	     */	
-		virtual void NotifyAboutHandledPointerEvent( TRequestStatus* aStatus );	
-
-	public: // Functions from base classes
-		/**
-	     * Overwritten version of CCoeAppUi::HandleWsEventL() method.
-	     */	
-		void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination );
-
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-        
-    private:	// New functions
-    	// None
-
-    private: 	// Functions from base classes
-		/**
-		 * From CEikAppUi, HandleCommandL.
-		 * Takes care of command handling.
-		 * @param aCommand Command to be handled.
-		 */
-		void HandleCommandL( TInt aCommand );
-	        
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-		CUITestServerStarterAppView* iAppView;	// The application view owned by CUITestServerStarterAppUi		
-		TRequestStatus* iEventStatus;	// Pointer to request statuc which is completed when 
-										// selected event is handled.		
-		TEventType iEventType;	// Currently handled event type;		
-		TInt iTypeTextLength;	// Length of text send by typetext testscripter keyword
-		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None
-	};
-
-#endif // UITESTSERVERSTARTERAPPUI_H_
-
-// End of File
--- a/stifui/uitestserverstarter/inc/UITestServerStarterAppView.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* UITestServerStarter AppUi view class.
-*
-*/
-
-#ifndef UITESTSERVERSTARTERAPPVIEW_H_
-#define UITESTSERVERSTARTERAPPVIEW_H_
-
-//  INCLUDES
-#include <aknview.h>
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CUITestServerStarterAppContainer;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-// UITestServerStarter standard AppUi view class.
-class CUITestServerStarterAppView : public CAknView
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-	
-	public:  // Constructors and destructor
-		/**
-		 * Virtual Destructor.
-		 */
-		virtual ~CUITestServerStarterAppView();
-	
-	private:  // Constructors and destructor
-
-		/**
-		 * Perform the second phase construction of a
-		 * CUITestServerStarterAppView object.
-		 */
-		void ConstructL();
-
-		/**
-		 * C++ default constructor.
-		 */
-		CUITestServerStarterAppView();
-	
-	public: // New functions
-		/**
-		 * Two-phased constructor.
-		 * Create a CUITestServerStarterAppView object.
-		 */
-		static CUITestServerStarterAppView* NewL();
-	
-		/**
-		* Two-phased constructor.
-		* Create a CUITestServerStarterAppView object
-		*/
-		static CUITestServerStarterAppView* NewLC();
-
-	public: // Functions from base classes
-	    /**
-	    * Return Uid
-	    */
-	    TUid Id() const;
-	
-	    /**
-	    * Handle Commands
-	    */
-	    void HandleCommandL(TInt aCommand);
-	
-	    /**
-	    * Handle size changes
-	    */
-	    void HandleClientRectChange();
-		
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-        
-    private:	// New functions
-    	// None
-
-    private:	// Functions from base classes
-	    /**
-	    * From AknView, Activates view
-	    */
-	    void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
-	        const TDesC8& aCustomMessage);
-	
-	    /**
-	    * From AknView, Deactivates view
-	    */
-	    void DoDeactivate();
-    
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-    	CUITestServerStarterAppContainer* iContainer; // View container
-		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None
-	};
-
-#endif // UITESTSERVERSTARTERAPPVIEW_H_
-
-// End of File
--- a/stifui/uitestserverstarter/inc/UITestServerStarterApplication.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* CUITestServerStarterApplication class.
-*
-*/
-
-#ifndef UITESTSERVERSTARTERAPPLICATION_H_
-#define UITESTSERVERSTARTERAPPLICATION_H_
-
-
-//  INCLUDES
-#include <aknapp.h>
-#include "UITestServerStarter.hrh"
-
-// CONSTANTS
-
-// UID for the application;
-const TUid KUidUITestServerStarterApp =
-	{
-	_UID3
-	};
-
-const TUid KMainViewId = { 1982 };
-// CLASS DECLARATION
-
-// CLASS DECLARATION
-// DESCRIPTION
-/**
- * UITestServerStarterApplication application class.
- * Provides factory to create concrete document object.
- * An instance of CUITestServerStarterApplication is the application part of the
- * AVKON application framework for the CUITestServerStarterApplication application.
- */
-class CUITestServerStarterApplication : public CAknApplication
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-	
-	public:  // Constructors and destructor
-	    /**
-	    * C++ destructor.
-	    */
-	
-	public:
-	// Functions from base classes
-	
-	/**
-	 * From CApaApplication, AppDllUid.
-	 * @return Application's UID (KUidUITestServerStarterApplication).
-	 */
-	TUid AppDllUid () const;
-	
-	protected: // Functions from base classes
-	
-	/**
-	 * From CApaApplication, CreateDocumentL.
-	 * Creates CUITestServerStarterDocument document object. The returned
-	 * pointer in not owned by the CUITestServerStarterApplication object.
-	 * @return A pointer to the created document object.
-	 */
-	CApaDocument* CreateDocumentL ();
-	
-	virtual void PreDocConstructL();
-	
-	
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None	
-	
-    private:	// New functions
-    	// None
-	
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-    	// None
-			
-	public:		// Friend classes
-		// None
-	
-	protected:	// Friend classes
-		// None
-	
-	private:	// Friend classes
-		// None		
-	};
-
-
-
-#endif /*UITESTSERVERSTARTERAPPLICATION_H_*/
--- a/stifui/uitestserverstarter/inc/UITestServerStarterDocument.h	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This file contains the header file of the 
-* UITestServerStarter Document class.
-*
-*/
-
-#ifndef UITESTSERVERSTARTERDOCUMENT_H_
-#define UITESTSERVERSTARTERDOCUMENT_H_
-
-//  INCLUDES
-#include <AknDoc.h>
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-// DATA TYPES
-// None
-
-// FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-class CUITestServerStarterAppUi;
-class CEikApplication;
-
-// CLASS DECLARATION
-
-// DESCRIPTION
-/**
- * CClockTestDocument application class.
- * An instance of class CClockTestDocument is the Document part of the
- * AVKON application framework for the ClockTest example application.
- */
-class CUITestServerStarterDocument : public CAknDocument
-	{
-	public: // Enumerations
-	    // None
-	
-	private: // Enumerations
-	    // None
-
-	private:  // Constructors and destructor
-		// None
-	public: // New functions
-	
-	/**
-	 * NewL.
-	 * Two-phased constructor.
-	 * Construct a CUITestServerStarterDocument for the AVKON application aApp
-	 * using two phase construction, and return a pointer
-	 * to the created object.
-	 * @param aApp Application creating this document.
-	 * @return A pointer to the created instance of CUITestServerStarterDocument.
-	 */
-	static CUITestServerStarterDocument* NewL (CEikApplication& aApp);
-	
-	/**
-	 * NewLC.
-	 * Two-phased constructor.
-	 * Construct a CUITestServerStarterDocument for the AVKON application aApp
-	 * using two phase construction, and return a pointer
-	 * to the created object.
-	 * @param aApp Application creating this document.
-	 * @return A pointer to the created instance of CUITestServerStarterDocument.
-	 */
-	static CUITestServerStarterDocument* NewLC (CEikApplication& aApp);
-	
-	/**
-	 * ~CUITestServerStarterDocument
-	 * Virtual Destructor.
-	 */
-	virtual ~CUITestServerStarterDocument();
-	
-	public: // Functions from base classes
-	
-		/**
-		 * CreateAppUiL
-		 * From CEikDocument, CreateAppUiL.
-		 * Create a CUITestServerStarterAppUi object and return a pointer to it.
-		 * The object returned is owned by the Uikon framework.
-		 * @return Pointer to created instance of AppUi.
-		 */
-		CEikAppUi* CreateAppUiL ();
-	
-    protected:	// New functions
-        // None
-        
-    protected:	// Functions from base classes
-        // None
-
-    private:	// New functions
-	
-		/**
-		 * ConstructL
-		 * 2nd phase constructor.
-		 */
-		void ConstructL ();
-		
-		/**
-		 * CUITestServerStarterDocument.
-		 * C++ default constructor.
-		 * @param aApp Application creating this document.
-		 */
-		CUITestServerStarterDocument( CEikApplication& aApp );
-    
-	private:	// Functions from base classes
-        // None    
-    
-	public:		//Data
-	    // None
-        
-	protected:	// Data
-        // None
-        
-    private:	// Data
-        // None
-		
-    public:		// Friend classes
-        // None
-
-    protected:	// Friend classes
-        // None
-
-    private:	// Friend classes
-        // None	
-	};
-
-
-#endif /*UITESTSERVERSTARTERDOCUMENT_H_*/
--- a/stifui/uitestserverstarter/src/AknUiEnvProxy.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,674 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CAknUiEnvProxy class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "AknUiEnvProxy.h"
-#include "UITestServerStarterAppUi.h"
-#include "EventUtil.h"
-
-#include <coeaui.h>
-#include <eikenv.h>
-#include <apgtask.h>
-#include <w32std.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
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: NewL
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: CUITestServerStarterAppUi* aAppUi: in: Pointer to CUITestServerStarterAppUi.
-     
-     Return Values: Pointer to new CAknUiEnvProxy object.
-
-     Errors/Exceptions: Leaves if new or ConstructL leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CAknUiEnvProxy* CAknUiEnvProxy::NewL( CUITestServerStarterAppUi* aAppUi )
-	{
-	CAknUiEnvProxy* self = new(ELeave)CAknUiEnvProxy();
-	CleanupStack::PushL( self );
-	self->ConstructL( aAppUi );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ConstructL
-
-     Description: ConstructL is second phase of two-phased constructor.
-
-     Performs construction of CAknUiEnvProxy object.
-
-     Parameters: CUITestServerStarterAppUi* aAppUi: in: Pointer to CUITestServerStarterAppUi.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::ConstructL( CUITestServerStarterAppUi* aAppUi )
-	{	
-	iAppUi = aAppUi;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: BringToForeground
-
-     Description: Brings UI component container to foreground.
-
-     Brings UI component container to foreground. 
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::BringToForeground()
-	{
-	TApaTask task( CCoeEnv::Static()->WsSession() );
-	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() );
-	task.BringToForeground();	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: SendToBackground
-
-     Description: Sends UI component container to background.
-
-     Sends UI component container to background.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::SendToBackground(  )
-	{
-	TApaTask task( CCoeEnv::Static()->WsSession() );
-	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() ); 
-	task.SendToBackground();		
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: PressKeyL
-
-     Description: Sends local key press event to UI component.
-
-     Sends key press event to UI component. UI component must be first added to 
-     AppUi stack to be able to recive this key event. 
-
-     Parameters: TRequestStatus* aStatus: out: Pointer to request status used to notify that
-     										   key event was recived.
-     			 TUint aKeyCode: in: Key code.
-     			 TInt aKeyScanCode: in: Key scan code.
-     			 TUint aKeyModifiers: in: Key modifiers
-     			 TInt aKeyRepeats: in: Key press repeats count.
-     
-     Return Values: None.
-
-     Errors/Exceptions: Leaves if some error occurs during key event sending.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::PressKeyL( TRequestStatus* aStatus, TUint aKeyCode, TInt aKeyScanCode, 
-							   TUint aKeyModifiers, TInt aKeyRepeats )
-	{
-	// Fill key event structure
-	TWsEvent wsEvent;
-	wsEvent.SetType(EEventKey);
-	TKeyEvent* keyEvent = wsEvent.Key();
-	keyEvent->iCode = aKeyCode;
-	keyEvent->iScanCode = aKeyScanCode;
-	keyEvent->iModifiers = aKeyModifiers;
-	keyEvent->iRepeats = aKeyRepeats;
-		
-	// Send info to AppUi that we are going to send key event
-	iAppUi->PrepareToPressKey();
-	
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
-	TInt wgId = CCoeEnv::Static()->RootWin().Identifier();	
-	// Send key event
-	TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );
-	User::LeaveIfError( ret );
-	
-	// Request notification when key press is handled
-	*aStatus = KRequestPending;
-	iAppUi->NotifyAboutHandledKeyPress( aStatus );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: PressKeyL
-
-     Description: Sends global key press event to UI component.
-
-     Sends key press event to UI component which is currently focuused. 
-
-     Parameters: TUint aKeyCode: in: Key code.
-     			 TInt aKeyScanCode: in: Key scan code.
-     			 TUint aKeyModifiers: in: Key modifiers
-     			 TInt aKeyRepeats: in: Key press repeats count.
-     
-     Return Values: None.
-
-     Errors/Exceptions: Leaves if some error occurs during key event sending.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::PressKeyL( TUint aKeyCode, TInt aKeyScanCode, 
-							   TUint aKeyModifiers, TInt aKeyRepeats )
-	{	
-	// Fill key event structure
-	TWsEvent wsEvent;
-	wsEvent.SetType(EEventKey);
-	TKeyEvent* keyEvent = wsEvent.Key();
-	keyEvent->iCode = aKeyCode;
-	keyEvent->iScanCode = aKeyScanCode;
-	keyEvent->iModifiers = aKeyModifiers;
-	keyEvent->iRepeats = aKeyRepeats;
-		
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();	
-	TInt wgId = wsSession.GetFocusWindowGroup();	
-	TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );	
-	User::LeaveIfError( ret );
-	}
-
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: TypeTextL
-
-     Description: Sends text to UI component.
-
-     Sends text to UI component. UI component must be first added to 
-     AppUi stack to be able to recive this key event. 
-
-     Parameters: TRequestStatus* aStatus: out: Pointer to request status used to notify that
-     										   key event was recived.
-    			 TPtrC aText: in: Text which will be send to UI component. 
-     
-     Return Values: None.
-
-     Errors/Exceptions: Leaves if some error occurs during key event sending.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::TypeTextL( TRequestStatus* aStatus, const TDesC& aText )
-	{
-	TLex textParser( aText );
-
-	// Send info to AppUi that we are going to send text
-	iAppUi->PrepareToTypeText( aText.Length() );
-	
-	TInt wgId = CCoeEnv::Static()->RootWin().Identifier();
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
-
-	TChar character = 0;
-	while ( ( character = textParser.Get() ) != 0 )
-		{
-		// Fill key event structure
-		TWsEvent wsEvent;
-		wsEvent.SetType(EEventKey);
-		TKeyEvent* keyEvent = wsEvent.Key();
-		keyEvent->iCode = character;
-		keyEvent->iScanCode = 0;
-		keyEvent->iModifiers = 0;
-		keyEvent->iRepeats = 0;
-		
-		// Send single character from text to UI component
-		TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );
-		User::LeaveIfError( ret );
-		}
-		
-	// Request notification when send text is recived
-	*aStatus = KRequestPending;
-	iAppUi->NotifyAboutHandledTextType( aStatus );	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: TypeTextL
-
-     Description: Sends global text to UI component.
-
-     Sends global text to UI component. UI component must be focused to receive that event. 
-
-     Parameters: TPtrC aText: in: Text which will be send to UI component. 
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::TypeTextL( const TDesC& aText )
-	{
-	TLex textParser( aText );
-
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
-	TInt wgId = wsSession.GetFocusWindowGroup();
-
-	TChar character = 0;	
-	while ( ( character = textParser.Get() ) != 0 )
-		{
-		// Fill key event structure
-		TWsEvent wsEvent;
-		wsEvent.SetType(EEventKey);
-		TKeyEvent* keyEvent = wsEvent.Key();
-		keyEvent->iCode = character;
-		keyEvent->iScanCode = 0;
-		keyEvent->iModifiers = 0;
-		keyEvent->iRepeats = 0;
-		
-		// Send single character from text to UI component
-		TInt ret = wsSession.SendEventToWindowGroup( wgId, wsEvent );			
-		User::LeaveIfError( ret );
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: SendPointerEventL
-
-     Description: Send pointer event
-
-     Send pointer event.
-
-     Parameters: TUint aType: in: KEvent type.
-     			 const TPoint& aPosition: in: Position.
-     			      
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::SendPointerEventL( TUint aType, const TPoint& aPosition )
-	{
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
-	TRawEvent pointerEvent;
-
-	if ( aType < TEventUtil::EButton1 ) {
-		pointerEvent.Set( ( TRawEvent::TType )aType, aPosition.iX, aPosition.iY );
-		wsSession.SimulateRawEvent( pointerEvent );
-		} 
-	else if ( ( aType >= TEventUtil::EButton1 ) && ( aType <= TEventUtil::EButton3 ) )
-		{
-		TRawEvent pointerEventDown;
-		TRawEvent pointerEventUp;
-		
-		switch ( aType )
-			{
-			case TEventUtil::EButton1:
-				{
-				pointerEventDown.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			case TEventUtil::EButton2:
-				{
-				pointerEventDown.Set( TRawEvent::EButton2Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton2Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			case TEventUtil::EButton3:
-				{
-				pointerEventDown.Set( TRawEvent::EButton3Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton3Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			default:
-				User::Leave( KErrArgument );
-			}
-		wsSession.SimulateRawEvent( pointerEventDown );
-		wsSession.SimulateRawEvent( pointerEventUp );
-		}
-	else
-		{
-		User::Leave( KErrArgument );
-		}	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: SendPointerEventL
-
-     Description: Send pointer event
-
-     Send pointer event.
-
-     Parameters: TRequestStatus* aStatus: in: Pointer to request status used to notify that
-     										  pointer event was recived.
-     			 TUint aType: in: KEvent type.
-     			 const TPoint& aPosition: in: Position.
-     			      
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CAknUiEnvProxy::SendPointerEventL( TRequestStatus* aStatus, TUint aType, const TPoint& aPosition )
-	{
-	RWsSession& wsSession = CCoeEnv::Static()->WsSession();
-
-	if ( aType < TEventUtil::EButton1 ) {
-		TRawEvent pointerEvent;
-		pointerEvent.Set( ( TRawEvent::TType )aType, aPosition.iX, aPosition.iY );
-		// Send info to AppUi that we are going to send key event
-		iAppUi->PrepareToPointerEvent();
-		wsSession.SimulateRawEvent( pointerEvent );
-		// Request notification when key press is handled
-		*aStatus = KRequestPending;
-		iAppUi->NotifyAboutHandledPointerEvent( aStatus );	
-		} 
-	else if ( ( aType >= TEventUtil::EButton1 ) && ( aType <= TEventUtil::EButton3 ) )
-		{
-		TRawEvent pointerEventDown;
-		TRawEvent pointerEventUp;
-		switch ( aType )
-			{
-			case TEventUtil::EButton1:
-				{
-				pointerEventDown.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			case TEventUtil::EButton2:
-				{
-				pointerEventDown.Set( TRawEvent::EButton2Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton2Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			case TEventUtil::EButton3:
-				{
-				pointerEventDown.Set( TRawEvent::EButton3Down, aPosition.iX, aPosition.iY );
-				pointerEventUp.Set( TRawEvent::EButton3Up, aPosition.iX, aPosition.iY );
-				}
-				break;
-			default:
-				User::Leave( KErrArgument );
-			}
-		
-			CCoeEnv::Static()->RootWin().SimulatePointerEvent( pointerEventDown );
-			
-			// Send info to AppUi that we are going to send key event
-			iAppUi->PrepareToPointerEvent();
-	
-			CCoeEnv::Static()->RootWin().SimulatePointerEvent( pointerEventUp );
-	
-			// Request notification when key press is handled
-			*aStatus = KRequestPending;
-			iAppUi->NotifyAboutHandledPointerEvent( aStatus );	
-		} 
-	else
-		{
-		User::Leave( KErrArgument );
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ParseKeyCode
-
-     Description: Parses key code.
-
-     Parses key code.
-
-     Parameters: TDesC& aKeyCodeName: in: Key code name.
-     			 TUint& aKeyCode: out: Parsed key code.
-     
-     Return Values: KErrNone if no error occures during parsing.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CAknUiEnvProxy::ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode ) const
-	{
-	return TEventUtil::ParseKeyCode( aKeyCodeName, aKeyCode );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ParseKeyScanCode
-
-     Description: Parses key scan code.
-
-     Parses key scan code.
-
-     Parameters: TDesC& aKeyScanCodeName: in: Key scan code name.
-     			 TUint& aKeyScanCode: out: Parsed key scan code.
-     
-     Return Values: KErrNone if no error occures during parsing.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CAknUiEnvProxy::ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode ) const
-	{
-	return TEventUtil::ParseKeyScanCode( aKeyScanCodeName, aKeyScanCode );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ParseModifier
-
-     Description: Parses key modifier.
-
-     Parses key modifier.
-
-     Parameters: TDesC& aModifierName: in: Key modifier.
-     			 TUint& aModifier: out: Parsed key modifier.
-     
-     Return Values: KErrNone if no error occures during parsing.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CAknUiEnvProxy::ParseModifier( const TDesC& aModifierName, TUint& aModifier ) const
-	{
-	return TEventUtil::ParseModifier( aModifierName, aModifier );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ParsePointerEventType
-
-     Description: Parses pointer event type.
-
-     Parses key modifier.
-
-     Parameters: const TDesC& aPointerEventTypeName: in: Pointer event type.
-     			 TUint& aModifier: out: Parsed pointer event type.
-     
-     Return Values: KErrNone if no error occures during parsing.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CAknUiEnvProxy::ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType ) const
-	{
-	return TEventUtil::ParsePointerEventType( aPointerEventTypeName, aPointerEventType );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: CAknUiEnvProxy
-
-     Description: C++ constructor.
-
-     C++ constructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CAknUiEnvProxy::CAknUiEnvProxy()
-	{	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ~CAknUiEnvProxy
-
-     Description: C++ destructor.
-
-     C++ destructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CAknUiEnvProxy::~CAknUiEnvProxy()
-	{	
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/src/EventUtil.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1100 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CAknUiEnvProxy class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "EventUtil.h"
-#include <e32def.h>
-#include <e32keys.h>
-#include <w32std.h>
-
-// EXTERNAL DATA STRUCTURES
-// None
-
-// EXTERNAL FUNCTION PROTOTYPES  
-// None
-
-// CONSTANTS
-// None
-
-// MACROS
-
-/**
- * Key code names definition macro
- */
-#define DefineKeyCodeNames( varName ) 			\
-	static TText* const varName[] =				\
-        {										\
-        (TText*)L"ekeynull",			\
-        (TText*)L"ekeybell",			\
-        (TText*)L"ekeybackspace",		\
-        (TText*)L"ekeytab",				\
-        (TText*)L"ekeylinefeed",		\
-        (TText*)L"ekeyverticaltab",		\
-        (TText*)L"ekeyformfeed",		\
-        (TText*)L"ekeyenter",			\
-        (TText*)L"ekeyescape",			\
-        (TText*)L"ekeyspace",			\
-        (TText*)L"ekeydelete",			\
-        (TText*)L"ekeyprintscreen",		\
-        (TText*)L"ekeypause",			\
-        (TText*)L"ekeyhome",			\
-        (TText*)L"ekeyend",				\
-        (TText*)L"ekeypageup",			\
-        (TText*)L"ekeypagedown",		\
-        (TText*)L"ekeyinsert",			\
-        (TText*)L"ekeyleftarrow",		\
-        (TText*)L"ekeyrightarrow",		\
-        (TText*)L"ekeyuparrow",			\
-        (TText*)L"ekeydownarrow",		\
-        (TText*)L"ekeyleftshift",		\
-        (TText*)L"ekeyrightshift",		\
-        (TText*)L"ekeyleftalt",			\
-        (TText*)L"ekeyrightalt",		\
-        (TText*)L"ekeyleftctrl",		\
-        (TText*)L"ekeyrightctrl",		\
-        (TText*)L"ekeyleftfunc",		\
-        (TText*)L"ekeyrightfunc",		\
-        (TText*)L"ekeycapslock",		\
-        (TText*)L"ekeynumlock",			\
-        (TText*)L"ekeyscrolllock",		\
-        (TText*)L"ekeyf1",				\
-        (TText*)L"ekeyf2",				\
-        (TText*)L"ekeyf3",				\
-        (TText*)L"ekeyf4",				\
-        (TText*)L"ekeyf5",				\
-        (TText*)L"ekeyf6",				\
-        (TText*)L"ekeyf7",				\
-        (TText*)L"ekeyf8",				\
-        (TText*)L"ekeyf9",				\
-        (TText*)L"ekeyf10",				\
-        (TText*)L"ekeyf11",				\
-        (TText*)L"ekeyf12",				\
-        (TText*)L"ekeyf13",				\
-        (TText*)L"ekeyf14",				\
-        (TText*)L"ekeyf15",				\
-        (TText*)L"ekeyf16",				\
-        (TText*)L"ekeyf17",				\
-        (TText*)L"ekeyf18",				\
-        (TText*)L"ekeyf19",				\
-        (TText*)L"ekeyf20",				\
-        (TText*)L"ekeyf21",				\
-        (TText*)L"ekeyf22",				\
-        (TText*)L"ekeyf23",				\
-        (TText*)L"ekeyf24",				\
-        (TText*)L"ekeyoff",				\
-        (TText*)L"ekeyinccontrast",		\
-        (TText*)L"ekeydeccontrast",		\
-        (TText*)L"ekeybacklighton",		\
-        (TText*)L"ekeybacklightoff",	\
-        (TText*)L"ekeybacklighttoggle",	\
-        (TText*)L"ekeysliderdown",		\
-        (TText*)L"ekeysliderup",		\
-        (TText*)L"ekeymenu",			\
-        (TText*)L"ekeydictaphoneplay",	\
-        (TText*)L"ekeydictaphonestop",	\
-        (TText*)L"ekeydictaphonerecord",\
-        (TText*)L"ekeyhelp",			\
-        (TText*)L"ekeydial",			\
-        (TText*)L"ekeyscreendimension0",\
-        (TText*)L"ekeyscreendimension1",\
-        (TText*)L"ekeyscreendimension2",\
-        (TText*)L"ekeyscreendimension3",\
-        (TText*)L"ekeyincvolume",		\
-        (TText*)L"ekeydecvolume",		\
-        (TText*)L"ekeydevice0",			\
-        (TText*)L"ekeydevice1",			\
-        (TText*)L"ekeydevice2",			\
-        (TText*)L"ekeydevice3",			\
-        (TText*)L"ekeydevice4",			\
-        (TText*)L"ekeydevice5",			\
-        (TText*)L"ekeydevice6",			\
-        (TText*)L"ekeydevice7",			\
-        (TText*)L"ekeydevice8",			\
-        (TText*)L"ekeydevice9",			\
-        (TText*)L"ekeydevicea",			\
-        (TText*)L"ekeydeviceb",			\
-        (TText*)L"ekeydevicec",			\
-        (TText*)L"ekeydeviced",			\
-        (TText*)L"ekeydevicee",			\
-        (TText*)L"ekeydevicef",			\
-        (TText*)L"ekeyapplication0",	\
-        (TText*)L"ekeyapplication1",	\
-        (TText*)L"ekeyapplication2",	\
-        (TText*)L"ekeyapplication3",	\
-        (TText*)L"ekeyapplication4",	\
-        (TText*)L"ekeyapplication5",	\
-        (TText*)L"ekeyapplication6",	\
-        (TText*)L"ekeyapplication7",	\
-        (TText*)L"ekeyapplication8",	\
-        (TText*)L"ekeyapplication9",	\
-        (TText*)L"ekeyapplicationa",	\
-        (TText*)L"ekeyapplicationb",	\
-        (TText*)L"ekeyapplicationc",	\
-        (TText*)L"ekeyapplicationd",	\
-        (TText*)L"ekeyapplicatione",	\
-        (TText*)L"ekeyapplicationf",	\
-        (TText*)L"ekeyyes",				\
-        (TText*)L"ekeyno",				\
-        (TText*)L"ekeyincbrightness",	\
-        (TText*)L"ekeydecbrightness",	\
-        (TText*)L"ekeykeyboardextend",	\
-        (TText*)L"ekeydevice10",		\
-        (TText*)L"ekeydevice11",		\
-        (TText*)L"ekeydevice12",		\
-        (TText*)L"ekeydevice13",		\
-        (TText*)L"ekeydevice14",		\
-        (TText*)L"ekeydevice15",		\
-        (TText*)L"ekeydevice16",		\
-        (TText*)L"ekeydevice17",		\
-        (TText*)L"ekeydevice18",		\
-        (TText*)L"ekeydevice19",		\
-        (TText*)L"ekeydevice1a",		\
-        (TText*)L"ekeydevice1b",		\
-        (TText*)L"ekeydevice1c",		\
-        (TText*)L"ekeydevice1d",		\
-        (TText*)L"ekeydevice1e",		\
-        (TText*)L"ekeydevice1f",		\
-        (TText*)L"ekeyapplication10",	\
-        (TText*)L"ekeyapplication11",	\
-        (TText*)L"ekeyapplication12",	\
-        (TText*)L"ekeyapplication13",	\
-        (TText*)L"ekeyapplication14",	\
-        (TText*)L"ekeyapplication15",	\
-        (TText*)L"ekeyapplication16",	\
-        (TText*)L"ekeyapplication17",	\
-        (TText*)L"ekeyapplication18",	\
-        (TText*)L"ekeyapplication19",	\
-        (TText*)L"ekeyapplication1a",	\
-        (TText*)L"ekeyapplication1b",	\
-        (TText*)L"ekeyapplication1c",	\
-        (TText*)L"ekeyapplication1d",	\
-        (TText*)L"ekeyapplication1e",	\
-        (TText*)L"ekeyapplication1f",	\
-        }
-
-/**
- * Key codes definition macro
- */
-#define DefineKeyCodes( varName )		\
-	static TUint const varName[] = 		\
-		{								\
-        (TUint)EKeyNull,				\
-        (TUint)EKeyBell,				\
-        (TUint)EKeyBackspace,			\
-        (TUint)EKeyTab,					\
-        (TUint)EKeyLineFeed,			\
-        (TUint)EKeyVerticalTab,			\
-        (TUint)EKeyFormFeed,			\
-        (TUint)EKeyEnter,				\
-        (TUint)EKeyEscape,				\
-        (TUint)EKeySpace,				\
-        (TUint)EKeyDelete,				\
-        (TUint)EKeyPrintScreen,			\
-        (TUint)EKeyPause,				\
-        (TUint)EKeyHome,				\
-        (TUint)EKeyEnd,					\
-        (TUint)EKeyPageUp,				\
-        (TUint)EKeyPageDown,			\
-        (TUint)EKeyInsert,				\
-        (TUint)EKeyLeftArrow,			\
-        (TUint)EKeyRightArrow,			\
-        (TUint)EKeyUpArrow,				\
-        (TUint)EKeyDownArrow,			\
-        (TUint)EKeyLeftShift,			\
-        (TUint)EKeyRightShift,			\
-        (TUint)EKeyLeftAlt,				\
-        (TUint)EKeyRightAlt,			\
-        (TUint)EKeyLeftCtrl,			\
-        (TUint)EKeyRightCtrl,			\
-        (TUint)EKeyLeftFunc,			\
-        (TUint)EKeyRightFunc,			\
-        (TUint)EKeyCapsLock,			\
-        (TUint)EKeyNumLock,				\
-        (TUint)EKeyScrollLock,			\
-        (TUint)EKeyF1,					\
-        (TUint)EKeyF2,					\
-        (TUint)EKeyF3,					\
-        (TUint)EKeyF4,					\
-        (TUint)EKeyF5,					\
-        (TUint)EKeyF6,					\
-        (TUint)EKeyF7,					\
-        (TUint)EKeyF8,					\
-        (TUint)EKeyF9,					\
-        (TUint)EKeyF10,					\
-        (TUint)EKeyF11,					\
-        (TUint)EKeyF12,					\
-        (TUint)EKeyF13,					\
-        (TUint)EKeyF14,					\
-        (TUint)EKeyF15,					\
-        (TUint)EKeyF16,					\
-        (TUint)EKeyF17,					\
-        (TUint)EKeyF18,					\
-        (TUint)EKeyF19,					\
-        (TUint)EKeyF20,					\
-        (TUint)EKeyF21,					\
-        (TUint)EKeyF22,					\
-        (TUint)EKeyF23,					\
-        (TUint)EKeyF24,					\
-        (TUint)EKeyOff,					\
-        (TUint)EKeyIncContrast,			\
-        (TUint)EKeyDecContrast,			\
-        (TUint)EKeyBacklightOn,			\
-        (TUint)EKeyBacklightOff,		\
-        (TUint)EKeyBacklightToggle,		\
-        (TUint)EKeySliderDown,			\
-        (TUint)EKeySliderUp,			\
-        (TUint)EKeyMenu,				\
-        (TUint)EKeyDictaphonePlay,		\
-        (TUint)EKeyDictaphoneStop,		\
-        (TUint)EKeyDictaphoneRecord,	\
-        (TUint)EKeyHelp,				\
-        (TUint)EKeyDial,				\
-        (TUint)EKeyScreenDimension0,	\
-        (TUint)EKeyScreenDimension1,	\
-        (TUint)EKeyScreenDimension2,	\
-        (TUint)EKeyScreenDimension3,	\
-        (TUint)EKeyIncVolume,			\
-        (TUint)EKeyDecVolume,			\
-        (TUint)EKeyDevice0,				\
-        (TUint)EKeyDevice1,				\
-        (TUint)EKeyDevice2,				\
-        (TUint)EKeyDevice3,				\
-        (TUint)EKeyDevice4,				\
-        (TUint)EKeyDevice5,				\
-        (TUint)EKeyDevice6,				\
-        (TUint)EKeyDevice7,				\
-        (TUint)EKeyDevice8,				\
-        (TUint)EKeyDevice9,				\
-        (TUint)EKeyDeviceA,				\
-        (TUint)EKeyDeviceB,				\
-        (TUint)EKeyDeviceC,				\
-        (TUint)EKeyDeviceD,				\
-        (TUint)EKeyDeviceE,				\
-        (TUint)EKeyDeviceF,				\
-        (TUint)EKeyApplication0,		\
-        (TUint)EKeyApplication1,		\
-        (TUint)EKeyApplication2,		\
-        (TUint)EKeyApplication3,		\
-        (TUint)EKeyApplication4,		\
-        (TUint)EKeyApplication5,		\
-        (TUint)EKeyApplication6,		\
-        (TUint)EKeyApplication7,		\
-        (TUint)EKeyApplication8,		\
-        (TUint)EKeyApplication9,		\
-        (TUint)EKeyApplicationA,		\
-        (TUint)EKeyApplicationB,		\
-        (TUint)EKeyApplicationC,		\
-        (TUint)EKeyApplicationD,		\
-        (TUint)EKeyApplicationE,		\
-        (TUint)EKeyApplicationF,		\
-        (TUint)EKeyYes,					\
-        (TUint)EKeyNo,					\
-        (TUint)EKeyIncBrightness,		\
-        (TUint)EKeyDecBrightness,		\
-        (TUint)EKeyKeyboardExtend,		\
-        (TUint)EKeyDevice10,			\
-        (TUint)EKeyDevice11,			\
-        (TUint)EKeyDevice12,			\
-        (TUint)EKeyDevice13,			\
-        (TUint)EKeyDevice14,			\
-        (TUint)EKeyDevice15,			\
-        (TUint)EKeyDevice16,			\
-        (TUint)EKeyDevice17,			\
-        (TUint)EKeyDevice18,			\
-        (TUint)EKeyDevice19,			\
-        (TUint)EKeyDevice1A,			\
-        (TUint)EKeyDevice1B,			\
-        (TUint)EKeyDevice1C,			\
-        (TUint)EKeyDevice1D,			\
-        (TUint)EKeyDevice1E,			\
-        (TUint)EKeyDevice1F,			\
-        (TUint)EKeyApplication10,		\
-        (TUint)EKeyApplication11,		\
-        (TUint)EKeyApplication12,		\
-        (TUint)EKeyApplication13,		\
-        (TUint)EKeyApplication14,		\
-        (TUint)EKeyApplication15,		\
-        (TUint)EKeyApplication16,		\
-        (TUint)EKeyApplication17,		\
-        (TUint)EKeyApplication18,		\
-        (TUint)EKeyApplication19,		\
-        (TUint)EKeyApplication1A,		\
-        (TUint)EKeyApplication1B,		\
-        (TUint)EKeyApplication1C,		\
-        (TUint)EKeyApplication1D,		\
-        (TUint)EKeyApplication1E,		\
-        (TUint)EKeyApplication1F,		\
-		}
-
-/**
- * Key scan code names definition macro.
- */
-#define DefineKeyScanCodeNames( varName ) 			\
-	static TText* const varName[] =					\
-        {											\
-        (TText*)L"estdkeynull",						\
-        (TText*)L"estdkeybackspace",				\
-        (TText*)L"estdkeytab",						\
-        (TText*)L"estdkeyenter",					\
-        (TText*)L"estdkeyescape",					\
-        (TText*)L"estdkeyspace",					\
-        (TText*)L"estdkeyprintscreen",				\
-        (TText*)L"estdkeypause",					\
-        (TText*)L"estdkeyhome",						\
-        (TText*)L"estdkeyend",						\
-        (TText*)L"estdkeypageup",					\
-        (TText*)L"estdkeypagedown",					\
-        (TText*)L"estdkeyinsert",					\
-        (TText*)L"estdkeydelete",					\
-        (TText*)L"estdkeyleftarrow",				\
-        (TText*)L"estdkeyrightarrow",				\
-        (TText*)L"estdkeyuparrow",					\
-        (TText*)L"estdkeydownarrow",				\
-        (TText*)L"estdkeyleftshift",				\
-        (TText*)L"estdkeyrightshift",				\
-        (TText*)L"estdkeyleftalt",					\
-        (TText*)L"estdkeyrightalt",					\
-        (TText*)L"estdkeyleftctrl",					\
-        (TText*)L"estdkeyrightctrl",				\
-        (TText*)L"estdkeyleftfunc",					\
-        (TText*)L"estdkeyrightfunc",				\
-        (TText*)L"estdkeycapslock",					\
-        (TText*)L"estdkeynumlock",					\
-        (TText*)L"estdkeyscrolllock",				\
-        (TText*)L"estdkeyf1",						\
-        (TText*)L"estdkeyf2",						\
-        (TText*)L"estdkeyf3",						\
-        (TText*)L"estdkeyf4",						\
-        (TText*)L"estdkeyf5",						\
-        (TText*)L"estdkeyf6",						\
-        (TText*)L"estdkeyf7",						\
-        (TText*)L"estdkeyf8",						\
-        (TText*)L"estdkeyf9",						\
-        (TText*)L"estdkeyf10",						\
-        (TText*)L"estdkeyf11",						\
-        (TText*)L"estdkeyf12",						\
-        (TText*)L"estdkeyf13",						\
-        (TText*)L"estdkeyf14",						\
-        (TText*)L"estdkeyf15",						\
-        (TText*)L"estdkeyf16",						\
-        (TText*)L"estdkeyf17",						\
-        (TText*)L"estdkeyf18",						\
-        (TText*)L"estdkeyf19",						\
-        (TText*)L"estdkeyf20",						\
-        (TText*)L"estdkeyf21",						\
-        (TText*)L"estdkeyf22",						\
-        (TText*)L"estdkeyf23",						\
-        (TText*)L"estdkeyf24",						\
-        (TText*)L"estdkeyxxx",						\
-        (TText*)L"estdkeycomma",					\
-        (TText*)L"estdkeyfullstop",					\
-        (TText*)L"estdkeyforwardslash",				\
-        (TText*)L"estdkeybackslash",				\
-        (TText*)L"estdkeysemicolon",				\
-        (TText*)L"estdkeysinglequote",				\
-        (TText*)L"estdkeyhash",						\
-        (TText*)L"estdkeysquarebracketleft",		\
-        (TText*)L"estdkeysquarebracketright",		\
-        (TText*)L"estdkeyminus",					\
-        (TText*)L"estdkeyequals",					\
-        (TText*)L"estdkeynkpforwardslash",			\
-        (TText*)L"estdkeynkpasterisk",				\
-        (TText*)L"estdkeynkpminus",					\
-        (TText*)L"estdkeynkpplus",					\
-        (TText*)L"estdkeynkpenter",					\
-        (TText*)L"estdkeynkp1",						\
-        (TText*)L"estdkeynkp2",						\
-        (TText*)L"estdkeynkp3",						\
-        (TText*)L"estdkeynkp4",						\
-        (TText*)L"estdkeynkp5",						\
-        (TText*)L"estdkeynkp6",						\
-        (TText*)L"estdkeynkp7",						\
-        (TText*)L"estdkeynkp8",						\
-        (TText*)L"estdkeynkp9",						\
-        (TText*)L"estdkeynkp0",						\
-        (TText*)L"estdkeynkpfullstop",				\
-        (TText*)L"estdkeymenu",						\
-        (TText*)L"estdkeybacklighton",				\
-        (TText*)L"estdkeybacklightoff",				\
-        (TText*)L"estdkeybacklighttoggle",			\
-        (TText*)L"estdkeyinccontrast",				\
-        (TText*)L"estdkeydeccontrast",				\
-        (TText*)L"estdkeysliderdown",				\
-        (TText*)L"estdkeysliderup",					\
-        (TText*)L"estdkeydictaphoneplay",			\
-        (TText*)L"estdkeydictaphonestop",			\
-        (TText*)L"estdkeydictaphonerecord",			\
-        (TText*)L"estdkeyhelp",						\
-        (TText*)L"estdkeyoff",						\
-        (TText*)L"estdkeydial",						\
-        (TText*)L"estdkeyincvolume",				\
-        (TText*)L"estdkeydecvolume",				\
-        (TText*)L"estdkeydevice0",					\
-        (TText*)L"estdkeydevice1",					\
-        (TText*)L"estdkeydevice2",					\
-        (TText*)L"estdkeydevice3",					\
-        (TText*)L"estdkeydevice4",					\
-        (TText*)L"estdkeydevice5",					\
-        (TText*)L"estdkeydevice6",					\
-        (TText*)L"estdkeydevice7",					\
-        (TText*)L"estdkeydevice8",					\
-        (TText*)L"estdkeydevice9",					\
-        (TText*)L"estdkeydevicea",					\
-        (TText*)L"estdkeydeviceb",					\
-        (TText*)L"estdkeydevicec",					\
-        (TText*)L"estdkeydeviced",					\
-        (TText*)L"estdkeydevicee",					\
-        (TText*)L"estdkeydevicef",					\
-        (TText*)L"estdkeyapplication0",				\
-        (TText*)L"estdkeyapplication1",				\
-        (TText*)L"estdkeyapplication2",				\
-        (TText*)L"estdkeyapplication3",				\
-        (TText*)L"estdkeyapplication4",				\
-        (TText*)L"estdkeyapplication5",				\
-        (TText*)L"estdkeyapplication6",				\
-        (TText*)L"estdkeyapplication7",				\
-        (TText*)L"estdkeyapplication8",				\
-        (TText*)L"estdkeyapplication9",				\
-        (TText*)L"estdkeyapplicationa",				\
-        (TText*)L"estdkeyapplicationb",				\
-        (TText*)L"estdkeyapplicationc",				\
-        (TText*)L"estdkeyapplicationd",				\
-        (TText*)L"estdkeyapplicatione",				\
-        (TText*)L"estdkeyapplicationf",				\
-        (TText*)L"estdkeyyes",						\
-        (TText*)L"estdkeyno",						\
-        (TText*)L"estdkeyincbrightness",			\
-        (TText*)L"estdkeydecbrightness",			\
-        (TText*)L"estdkeykeyboardextend",			\
-        (TText*)L"estdkeydevice10",					\
-        (TText*)L"estdkeydevice11",					\
-        (TText*)L"estdkeydevice12",					\
-        (TText*)L"estdkeydevice13",					\
-        (TText*)L"estdkeydevice14",					\
-        (TText*)L"estdkeydevice15",					\
-        (TText*)L"estdkeydevice16",					\
-        (TText*)L"estdkeydevice17",					\
-        (TText*)L"estdkeydevice18",					\
-        (TText*)L"estdkeydevice19",					\
-        (TText*)L"estdkeydevice1a",					\
-        (TText*)L"estdkeydevice1b",					\
-        (TText*)L"estdkeydevice1c",					\
-        (TText*)L"estdkeydevice1d",					\
-        (TText*)L"estdkeydevice1e",					\
-        (TText*)L"estdkeydevice1f",					\
-        (TText*)L"estdkeyapplication10",			\
-        (TText*)L"estdkeyapplication11",			\
-        (TText*)L"estdkeyapplication12",			\
-        (TText*)L"estdkeyapplication13",			\
-        (TText*)L"estdkeyapplication14",			\
-        (TText*)L"estdkeyapplication15",			\
-        (TText*)L"estdkeyapplication16",			\
-        (TText*)L"estdkeyapplication17",			\
-        (TText*)L"estdkeyapplication18",			\
-        (TText*)L"estdkeyapplication19",			\
-        (TText*)L"estdkeyapplication1a",			\
-        (TText*)L"estdkeyapplication1b",			\
-        (TText*)L"estdkeyapplication1c",			\
-        (TText*)L"estdkeyapplication1d",			\
-        (TText*)L"estdkeyapplication1e",			\
-        (TText*)L"estdkeyapplication1f",			\
-        }
-
-/**
- * Key scan codes definition macro.
- */
-#define DefineKeyScanCodes( varName )		\
-	static TUint const varName[] = 			\
-		{									\
-        (TUint)EStdKeyNull,					\
-        (TUint)EStdKeyBackspace,			\
-        (TUint)EStdKeyTab,					\
-        (TUint)EStdKeyEnter,				\
-        (TUint)EStdKeyEscape,				\
-        (TUint)EStdKeySpace,				\
-        (TUint)EStdKeyPrintScreen,			\
-        (TUint)EStdKeyPause,				\
-        (TUint)EStdKeyHome,					\
-        (TUint)EStdKeyEnd,					\
-        (TUint)EStdKeyPageUp,				\
-        (TUint)EStdKeyPageDown,				\
-        (TUint)EStdKeyInsert,				\
-        (TUint)EStdKeyDelete,				\
-        (TUint)EStdKeyLeftArrow,			\
-        (TUint)EStdKeyRightArrow,			\
-        (TUint)EStdKeyUpArrow,				\
-        (TUint)EStdKeyDownArrow,			\
-        (TUint)EStdKeyLeftShift,			\
-        (TUint)EStdKeyRightShift,			\
-        (TUint)EStdKeyLeftAlt,				\
-        (TUint)EStdKeyRightAlt,				\
-        (TUint)EStdKeyLeftCtrl,				\
-        (TUint)EStdKeyRightCtrl,			\
-        (TUint)EStdKeyLeftFunc,				\
-        (TUint)EStdKeyRightFunc,			\
-        (TUint)EStdKeyCapsLock,				\
-        (TUint)EStdKeyNumLock,				\
-        (TUint)EStdKeyScrollLock,			\
-        (TUint)EStdKeyF1,					\
-        (TUint)EStdKeyF2,					\
-        (TUint)EStdKeyF3,					\
-        (TUint)EStdKeyF4,					\
-        (TUint)EStdKeyF5,					\
-        (TUint)EStdKeyF6,					\
-        (TUint)EStdKeyF7,					\
-        (TUint)EStdKeyF8,					\
-        (TUint)EStdKeyF9,					\
-        (TUint)EStdKeyF10,					\
-        (TUint)EStdKeyF11,					\
-        (TUint)EStdKeyF12,					\
-        (TUint)EStdKeyF13,					\
-        (TUint)EStdKeyF14,					\
-        (TUint)EStdKeyF15,					\
-        (TUint)EStdKeyF16,					\
-        (TUint)EStdKeyF17,					\
-        (TUint)EStdKeyF18,					\
-        (TUint)EStdKeyF19,					\
-        (TUint)EStdKeyF20,					\
-        (TUint)EStdKeyF21,					\
-        (TUint)EStdKeyF22,					\
-        (TUint)EStdKeyF23,					\
-        (TUint)EStdKeyF24,					\
-        (TUint)EStdKeyXXX,					\
-        (TUint)EStdKeyComma,				\
-        (TUint)EStdKeyFullStop,				\
-        (TUint)EStdKeyForwardSlash,			\
-        (TUint)EStdKeyBackSlash,			\
-        (TUint)EStdKeySemiColon,			\
-        (TUint)EStdKeySingleQuote,			\
-        (TUint)EStdKeyHash,					\
-        (TUint)EStdKeySquareBracketLeft,	\
-        (TUint)EStdKeySquareBracketRight,	\
-        (TUint)EStdKeyMinus,				\
-        (TUint)EStdKeyEquals,				\
-        (TUint)EStdKeyNkpForwardSlash,		\
-        (TUint)EStdKeyNkpAsterisk,			\
-        (TUint)EStdKeyNkpMinus,				\
-        (TUint)EStdKeyNkpPlus,				\
-        (TUint)EStdKeyNkpEnter,				\
-        (TUint)EStdKeyNkp1,					\
-        (TUint)EStdKeyNkp2,					\
-        (TUint)EStdKeyNkp3,					\
-        (TUint)EStdKeyNkp4,					\
-        (TUint)EStdKeyNkp5,					\
-        (TUint)EStdKeyNkp6,					\
-        (TUint)EStdKeyNkp7,					\
-        (TUint)EStdKeyNkp8,					\
-        (TUint)EStdKeyNkp9,					\
-        (TUint)EStdKeyNkp0,					\
-        (TUint)EStdKeyNkpFullStop,			\
-        (TUint)EStdKeyMenu,					\
-        (TUint)EStdKeyBacklightOn,			\
-        (TUint)EStdKeyBacklightOff,			\
-        (TUint)EStdKeyBacklightToggle,		\
-        (TUint)EStdKeyIncContrast,			\
-        (TUint)EStdKeyDecContrast,			\
-        (TUint)EStdKeySliderDown,			\
-        (TUint)EStdKeySliderUp,				\
-        (TUint)EStdKeyDictaphonePlay,		\
-        (TUint)EStdKeyDictaphoneStop,		\
-        (TUint)EStdKeyDictaphoneRecord,		\
-        (TUint)EStdKeyHelp,					\
-        (TUint)EStdKeyOff,					\
-        (TUint)EStdKeyDial,					\
-        (TUint)EStdKeyIncVolume,			\
-        (TUint)EStdKeyDecVolume,			\
-        (TUint)EStdKeyDevice0,				\
-        (TUint)EStdKeyDevice1,				\
-        (TUint)EStdKeyDevice2,				\
-        (TUint)EStdKeyDevice3,				\
-        (TUint)EStdKeyDevice4,				\
-        (TUint)EStdKeyDevice5,				\
-        (TUint)EStdKeyDevice6,				\
-        (TUint)EStdKeyDevice7,				\
-        (TUint)EStdKeyDevice8,				\
-        (TUint)EStdKeyDevice9,				\
-        (TUint)EStdKeyDeviceA,				\
-        (TUint)EStdKeyDeviceB,				\
-        (TUint)EStdKeyDeviceC,				\
-        (TUint)EStdKeyDeviceD,				\
-        (TUint)EStdKeyDeviceE,				\
-        (TUint)EStdKeyDeviceF,				\
-        (TUint)EStdKeyApplication0,			\
-        (TUint)EStdKeyApplication1,			\
-        (TUint)EStdKeyApplication2,			\
-        (TUint)EStdKeyApplication3,			\
-        (TUint)EStdKeyApplication4,			\
-        (TUint)EStdKeyApplication5,			\
-        (TUint)EStdKeyApplication6,			\
-        (TUint)EStdKeyApplication7,			\
-        (TUint)EStdKeyApplication8,			\
-        (TUint)EStdKeyApplication9,			\
-        (TUint)EStdKeyApplicationA,			\
-        (TUint)EStdKeyApplicationB,			\
-        (TUint)EStdKeyApplicationC,			\
-        (TUint)EStdKeyApplicationD,			\
-        (TUint)EStdKeyApplicationE,			\
-        (TUint)EStdKeyApplicationF,			\
-        (TUint)EStdKeyYes,					\
-        (TUint)EStdKeyNo,					\
-        (TUint)EStdKeyIncBrightness,		\
-        (TUint)EStdKeyDecBrightness,		\
-        (TUint)EStdKeyKeyboardExtend,		\
-        (TUint)EStdKeyDevice10,				\
-        (TUint)EStdKeyDevice11,				\
-        (TUint)EStdKeyDevice12,				\
-        (TUint)EStdKeyDevice13,				\
-        (TUint)EStdKeyDevice14,				\
-        (TUint)EStdKeyDevice15,				\
-        (TUint)EStdKeyDevice16,				\
-        (TUint)EStdKeyDevice17,				\
-        (TUint)EStdKeyDevice18,				\
-        (TUint)EStdKeyDevice19,				\
-        (TUint)EStdKeyDevice1A,				\
-        (TUint)EStdKeyDevice1B,				\
-        (TUint)EStdKeyDevice1C,				\
-        (TUint)EStdKeyDevice1D,				\
-        (TUint)EStdKeyDevice1E,				\
-        (TUint)EStdKeyDevice1F,				\
-        (TUint)EStdKeyApplication10,		\
-        (TUint)EStdKeyApplication11,		\
-        (TUint)EStdKeyApplication12,		\
-        (TUint)EStdKeyApplication13,		\
-        (TUint)EStdKeyApplication14,		\
-        (TUint)EStdKeyApplication15,		\
-        (TUint)EStdKeyApplication16,		\
-        (TUint)EStdKeyApplication17,		\
-        (TUint)EStdKeyApplication18,		\
-        (TUint)EStdKeyApplication19,		\
-        (TUint)EStdKeyApplication1A,		\
-        (TUint)EStdKeyApplication1B,		\
-        (TUint)EStdKeyApplication1C,		\
-        (TUint)EStdKeyApplication1D,		\
-        (TUint)EStdKeyApplication1E,		\
-        (TUint)EStdKeyApplication1F,		\
-        }
-
-/**
- * Key modifier names definition macro.
- */
-#define DefineModifiers( varName )			\
-	static TUint const varName[] = 			\
-		{									\
-        (TUint)EModifierAutorepeatable,		\
-        (TUint)EModifierKeypad,				\
-        (TUint)EModifierLeftAlt,			\
-        (TUint)EModifierRightAlt,			\
-        (TUint)EModifierAlt,				\
-        (TUint)EModifierLeftCtrl,			\
-        (TUint)EModifierRightCtrl,			\
-        (TUint)EModifierCtrl,				\
-        (TUint)EModifierLeftShift,			\
-        (TUint)EModifierRightShift,			\
-        (TUint)EModifierShift,				\
-        (TUint)EModifierLeftFunc,			\
-        (TUint)EModifierRightFunc,			\
-        (TUint)EModifierFunc,				\
-        (TUint)EModifierCapsLock,			\
-        (TUint)EModifierNumLock,			\
-        (TUint)EModifierScrollLock,			\
-        (TUint)EModifierKeyUp,				\
-        (TUint)EModifierSpecial,			\
-        (TUint)EModifierDoubleClick,		\
-        (TUint)EModifierPureKeycode,		\
-        (TUint)EModifierKeyboardExtend,		\
-        (TUint)EModifierCancelRotation,		\
-        (TUint)EModifierRotateBy90,			\
-        (TUint)EModifierRotateBy180,		\
-        (TUint)EModifierRotateBy270,		\
-        (TUint)EModifierPointer3DButton1,	\
-        (TUint)EModifierPointer3DButton2,	\
-        (TUint)EModifierPointer3DButton3,	\
-        (TUint)EAllModifiers,				\
-    }
-
-/**
- * Key modifiers definition macro.
- */
-#define DefineModifierNames( varName ) 				\
-	static TText* const varName[] =					\
-        {											\
-        (TText*)L"estdkeynull",						\
-        (TText*)L"emodifierautorepeatable",			\
-        (TText*)L"emodifierkeypad",					\
-        (TText*)L"emodifierleftalt",				\
-        (TText*)L"emodifierrightalt",				\
-        (TText*)L"emodifieralt",					\
-        (TText*)L"emodifierleftctrl",				\
-        (TText*)L"emodifierrightctrl",				\
-        (TText*)L"emodifierctrl",					\
-        (TText*)L"emodifierleftshift",				\
-        (TText*)L"emodifierrightshift",				\
-        (TText*)L"emodifiershift",					\
-        (TText*)L"emodifierleftfunc",				\
-        (TText*)L"emodifierrightfunc",				\
-        (TText*)L"emodifierfunc",					\
-        (TText*)L"emodifiercapslock",				\
-        (TText*)L"emodifiernumlock",				\
-        (TText*)L"emodifierscrolllock",				\
-        (TText*)L"emodifierkeyup",					\
-        (TText*)L"emodifierspecial",				\
-        (TText*)L"emodifierdoubleclick",			\
-        (TText*)L"emodifierpurekeycode",			\
-        (TText*)L"emodifierkeyboardextend",			\
-        (TText*)L"emodifiercancelrotation",			\
-        (TText*)L"emodifierrotateby90",				\
-        (TText*)L"emodifierrotateby180",			\
-        (TText*)L"emodifierrotateby270",			\
-        (TText*)L"emodifierpointer3dbutton1",		\
-        (TText*)L"emodifierpointer3dbutton2",		\
-        (TText*)L"emodifierpointer3dbutton3",		\
-        (TText*)L"eallmodifiers",					\
-        }
-        
-
-/**
- * Pointer event type names definition macro
- */
-#define DefinePointerEventTypeNames( varName ) 			\
-	static TText* const varName[] =						\
-        {												\
-        (TText*)L"epointermove",						\
-        (TText*)L"epointerswitchon",							\
-        (TText*)L"ebutton1down",						\
-        (TText*)L"ebutton1up",							\
-        (TText*)L"ebutton2down",						\
-        (TText*)L"ebutton2up",							\
-        (TText*)L"ebutton3down",						\
-        (TText*)L"ebutton3up",							\
-        (TText*)L"ebutton1",							\
-        (TText*)L"ebutton2",							\
-        (TText*)L"ebutton3",							\
-        }
-
-/**
- * Pointer event type codes definition macro.
- */
-#define DefinePointerEventTypes( varName )					\
-	static TInt const varName[] = 							\
-		{													\
-        (TUint)TRawEvent::EPointerMove,						\
-        (TUint)TRawEvent::EPointerSwitchOn,					\
-        (TUint)TRawEvent::EButton1Down,						\
-        (TUint)TRawEvent::EButton1Up,						\
-        (TUint)TRawEvent::EButton2Down,						\
-        (TUint)TRawEvent::EButton2Up,						\
-        (TUint)TRawEvent::EButton3Down,						\
-        (TUint)TRawEvent::EButton3Up,						\
-        (TUint)TEventUtil::EButton1,						\
-        (TUint)TEventUtil::EButton2,						\
-        (TUint)TEventUtil::EButton3,						\
-		}
-
-// LOCAL CONSTANTS AND MACROS
-// None
-
-// MODULE DATA STRUCTURES
-// None
-
-// LOCAL FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-// None
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: GetKeyCodeName
-
-     Description: Gets key name.
-
-     Returns selected key name. 
-
-     Parameters: TUint aKeyCode: out: Key code.
-     
-     Return Values: Key name.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TPtrC TEventUtil::GetKeyCodeName( TUint aKeyCode )
-	{
-	DefineKeyCodeNames( keyCodeNames );
-	DefineKeyCodes( keyCodes );
-	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
-	
-	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
-		if ( keyCodes[ i ] == aKeyCode ) 
-			{
-			return keyCodeNames[ i ];
-			}
-	}
-
-	return NULL;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: GetKeyScanCodeName
-
-     Description: Gets key scan code name.
-
-     Returns selected key scan code name. 
-
-     Parameters: TUint aKeyCode: out: Key scan code.
-     
-     Return Values: Key scan code name.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TPtrC TEventUtil::GetKeyScanCodeName( TInt aKeyScanCode )
-	{	
-	DefineKeyScanCodeNames( keyScanCodeNames );
-	DefineKeyScanCodes( keyScanCodes );
-	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
-	
-	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
-		if ( keyScanCodes[ i ] == aKeyScanCode ) 
-			{
-			return keyScanCodeNames[ i ];
-			}
-	}
-	
-	return NULL;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: GetModifierName
-
-     Description: Gets key modifier name.
-
-     Returns selected key modifier name. 
-
-     Parameters: TUint aModifier: out: Key modifier.
-     
-     Return Values: Key modifier name.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TPtrC TEventUtil::GetModifierName( TUint aModifier )
-	{
-	DefineModifierNames( modifierNames );
-	DefineModifiers( modifiers );
-	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
-	
-	for ( int i = 0; i < modifierNamesCount; i++ ) {
-		if ( modifiers[ i ] == aModifier ) 
-			{
-			return modifierNames[ i ];
-			}
-	}
-	
-	return NULL;	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: ParseKeyCode
-
-     Description: Parses key code.
-
-     Parses key code. 
-
-     Parameters: TDesC& aKeyCodeName: in: Key code name.
-     			 TUint& aKeyCode: out: Parsed key code.
-     
-     Return Values: KErrNone if key code was parsed successfuly, 
-     				KErrNotFound in other case.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt TEventUtil::ParseKeyCode( const TDesC& aKeyCodeName, TUint& aKeyCode )
-	{
-	DefineKeyCodeNames( keyCodeNames );
-	DefineKeyCodes( keyCodes );
-	int keyCodeNamesCount = (sizeof( keyCodeNames )/sizeof(TText*));
-	
-	TBuf<64> keyCodeNameLowerCase( aKeyCodeName );
-	keyCodeNameLowerCase.LowerCase();
-	for ( int i = 0; i < keyCodeNamesCount; i++ ) {
-		if ( TPtrC( keyCodeNames[ i ] ).Compare( keyCodeNameLowerCase ) == 0 ) 
-			{
-			aKeyCode = keyCodes[ i ];
-			return KErrNone;
-			}
-	}
-	
-	return KErrNotFound;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: ParseKeyScanCode
-
-     Description: Parses key scan code.
-
-     Parses key scan code. 
-
-     Parameters: TDesC& aKeyScanCodeName: in: Key scan code name.
-     			 TUint& aKeyScanCode: out: Parsed key scan code.
-     
-     Return Values: KErrNone if key scan code was parsed successfuly, 
-     				KErrNotFound in other case.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt TEventUtil::ParseKeyScanCode( const TDesC& aKeyScanCodeName, TInt& aKeyScanCode )
-	{
-	DefineKeyScanCodeNames( keyScanCodeNames );
-	DefineKeyScanCodes( keyScanCodes );
-	int keyScanCodeNamesCount = (sizeof( keyScanCodeNames )/sizeof(TText*));
-	
-	TBuf<64> keyScanCodeNameLowerCase( aKeyScanCodeName );
-	keyScanCodeNameLowerCase.LowerCase();
-	for ( int i = 0; i < keyScanCodeNamesCount; i++ ) {
-		if ( TPtrC( keyScanCodeNames[ i ] ).Compare( keyScanCodeNameLowerCase ) == 0 )
-			{
-			aKeyScanCode = keyScanCodes[ i ];
-			return KErrNone;
-			}
-	}
-	
-	return KErrNotFound;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: TEventUtil
-
-     Method: ParseModifier
-
-     Description: Parses key modifier.
-
-     Parses key modifier. 
-
-     Parameters: TDesC& aModifierName: in: Key modifier name.
-     			 TUint& aModifier: out: Parsed key modifier.
-     
-     Return Values: KErrNone if key modifier was parsed successfuly, 
-     				KErrNotFound in other case.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt TEventUtil::ParseModifier( const TDesC& aModifierName, TUint& aModifier )
-	{
-	DefineModifierNames( modifierNames );
-	DefineModifiers( modifiers );
-	int modifierNamesCount = (sizeof( modifierNames )/sizeof(TText*));
-	
-	TBuf<64> modifierNameLowerCase( aModifierName );
-	modifierNameLowerCase.LowerCase();
-	for ( int i = 0; i < modifierNamesCount; i++ ) {
-		if ( TPtrC( modifierNames[ i ] ).Compare( modifierNameLowerCase ) == 0 )
-			{
-			aModifier = modifiers[ i ];
-			return KErrNone;
-			}
-	}
-	
-	return KErrNotFound;	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CAknUiEnvProxy
-
-     Method: ParsePointerEventType
-
-     Description: Parses pointer event type.
-
-     Parses key modifier.
-
-     Parameters: const TDesC& aPointerEventTypeName: in: Pointer event type.
-     			 TUint& aModifier: out: Parsed pointer event type.
-     
-     Return Values: KErrNone if no error occures during parsing.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt TEventUtil::ParsePointerEventType( const TDesC& aPointerEventTypeName, TUint& aPointerEventType )
-	{
-	DefinePointerEventTypeNames( pointerEventTypeNames );
-	DefinePointerEventTypes( pointerEventTypes );
-	int pointerEventTypeNamesCount = (sizeof( pointerEventTypeNames )/sizeof(TText*));
-	
-	TBuf<64> pointerEventTypeNamesLowerCase( aPointerEventTypeName );
-	pointerEventTypeNamesLowerCase.LowerCase();
-	for ( int i = 0; i < pointerEventTypeNamesCount; i++ ) {
-		if ( TPtrC( pointerEventTypeNames[ i ] ).Compare( pointerEventTypeNamesLowerCase ) == 0 )
-			{
-			aPointerEventType = pointerEventTypes[ i ];
-			return KErrNone;
-			}
-	}
-	
-	return KErrNotFound;	
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/src/TestServerThreadStarter.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CTestServerThreadStarter class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "TestServerThreadStarter.h"
-#include <stifinternal/TestServerClient.h>
-
-// EXTERNAL DATA STRUCTURES
-// None
-
-// EXTERNAL FUNCTION PROTOTYPES  
-// None
-
-// CONSTANTS
-// None
-
-// MACROS
-// None
-
-/**
- * CTestServerThreadStarter thread heap size.
- */
-const TUint KDefaultHeapSize = 0x10000;     // 64 K
-
-/**
- * CTestServerThreadStarter thread max heap size.
- */
-const TUint KMaxHeapSize     = 0x20000;     // 128 K 
-
-// LOCAL CONSTANTS AND MACROS
-// None
-
-// MODULE DATA STRUCTURES
-// None
-
-// LOCAL FUNCTION PROTOTYPES
-// None
-
-// FORWARD DECLARATIONS
-// None
-
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: TestServerStarterThreadFunction
-
-     Description: CTestServerThreadStarter thread function.
-
-	 CTestServerThreadStarter thread function in which testserver creation code
-	 is executed.
-
-     Parameters: TAny* aParameters: in: Pointer to CTestServerThreadStarter object
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CTestServerThreadStarter::TestServerStarterThreadFunction( TAny* aParameters )
-	{
-	RDebug::Printf( "UITESTING: CTestServerThreadStarter::TestServerStarterThreadFunction" );
-    
-    CTestServerThreadStarter* testServerStarter = (CTestServerThreadStarter*)aParameters;
-    TThreadId mainThreadId = testServerStarter->iMainThreadId;
-    CTestThreadContainerRunnerFactory* testThreadContainerRunnerFactory = 
-    	testServerStarter->iTestThreadContainerRunnerFactory;
-    
-   	// Signal that all needed data is copied and main thread can continue its execution 
-    testServerStarter->iServerThreadStartedSemaphore.Signal();
-    	
-    // Get module name from command line
-	const TInt length = User().CommandLineLength();
-
-    HBufC* cmdLine = HBufC::New( length );
-    
-    if ( cmdLine == NULL )
-        {
-        return KErrNoMemory;
-        }
-
-    TPtr moduleName = cmdLine->Des();
-
-	User().CommandLine( moduleName );
-
-    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Received data [%S]"), &moduleName);
-
-    // Extract semaphore name passed in data
-    TInt index = moduleName.Find(_L(" "));
-    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Space separator found at position [%d]"), index);
-    TPtrC semaphoreName = moduleName.Mid(index + 1);
-    moduleName = moduleName.Left(index);
-
-    RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Extracted module name [%S] and sempahore name [%S]"), &moduleName, &semaphoreName);
-
-    // Open start-up synchronization semaphore
-    RSemaphore startup;
-    RDebug::Print(_L(" Openingstart-up semaphore"));
-    //TName semaphoreName = _L("startupSemaphore");
-    //semaphoreName.Append( moduleName );
-    
-    TInt res = startup.OpenGlobal(semaphoreName);
-    RDebug::Print(_L("Opening result %d"), res);    
-
-
-    TFileName serverName;
-    TInt r = StartNewServer ( moduleName, serverName, EFalse, startup, true, testThreadContainerRunnerFactory );
-
-    if ( r ==   KErrAlreadyExists )
-        {        
-        // Ok, server was already started
-        RDebug::Print(_L("UI TestServer already started, signaling semaphore and exiting"));
-        startup.Signal();        
-
-        delete cmdLine;
-
-        return KErrNone;
-        }
-    else
-        {       
-        RDebug::Print(_L("UI TestServer is finished, code %d"), r);
-        }
-
-    delete cmdLine;
-    
-    //delete testThreadContainerRunnerFactory;
-    testThreadContainerRunnerFactory = NULL;
-    
-    // Kill main thread to end UITestServerStarter application
-    // when testserver is finished    
-    RThread mainThread;
-    TInt ret = mainThread.Open( mainThreadId );
-	if( ret != KErrNone )
-		{
-		User::Panic( _L("ThreadHandleOpenError"), ret );
-		}
-    mainThread.Kill( KErrNone );
-    
-    return r;	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: NewL
-
-     Description: NewL is first phase of two-phased constructor.
-
-	 NewL is first phase of two-phased constructor.
-
-     Parameters: None.
-     
-     Return Values: Pointer to new CTestServerThreadStarter object.
-
-     Errors/Exceptions: Leaves if new or ConstructL leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CTestServerThreadStarter* CTestServerThreadStarter::NewL( )
-	{
-	CTestServerThreadStarter* self = new(ELeave) CTestServerThreadStarter();
-	CleanupStack::PushL( self );
-	self->ConstructL();
-	CleanupStack::Pop( self );
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: CTestServerThreadStarter
-
-     Description: Default constructor.
-
-	 Default constructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CTestServerThreadStarter::CTestServerThreadStarter()
-:CActive( EPriorityNormal )
-	{
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: NewL
-
-     Description: Default destructor.
-
-	 Default destructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CTestServerThreadStarter::~CTestServerThreadStarter()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: ConstructL
-
-     Description: Second phase of two-phased constructor.
-
-	 Second phase of two-phased constructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CTestServerThreadStarter::ConstructL()
-	{
-	TInt ret = iTimer.CreateLocal();
-	if ( ret != KErrNone )
-		{
-		User::Leave( ret );
-		}
-
-	CActiveScheduler::Add( this );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: RunTestServerThread
-
-     Description: Starts-up testserver.
-
-	 Starts-up testserver.
-
-     Parameters: None.
-     
-     Return Values: KErrNone when there was no error.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TInt CTestServerThreadStarter::RunTestServerThread( CTestThreadContainerRunnerFactory* aTestThreadContainerRunnerFactory )
-	{
-	if ( IsActive() )
-		{
-		User::Panic( _L("E32USER-CBase"), 42 );
-		}
-		
-	TInt ret = iServerThreadStartedSemaphore.CreateLocal( 0 );
-	if ( ret != KErrNone )
-		{
-		User::Leave( ret );
-		}
-	
-	iTestThreadContainerRunnerFactory = aTestThreadContainerRunnerFactory;
-	iMainThreadId = RThread().Id();
-	iReturnCode = KErrNone;
-	
-	iStatus = KRequestPending;
-
-	SetActive();
-	iTimer.After( iStatus, 0 );
-	
-	return KErrNone;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: RunL
-
-     Description: RunL derived from CActive handles the completed requests.
-
-	 RunL derived from CActive handles the completed requests.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: Leaves if one of the called method leavs.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CTestServerThreadStarter::RunL()
-	{
-	RThread testServerStarterThread;	
-	TInt ret = testServerStarterThread.Create( _L("testserverstarterthread"), 
-			TestServerStarterThreadFunction, 10 * KDefaultStackSize, 10 * KDefaultHeapSize, 10 * KMaxHeapSize, this );
-	
-	User::LeaveIfError( ret );
-		
-	testServerStarterThread.Resume();	
-	testServerStarterThread.Close();
-	
-	iServerThreadStartedSemaphore.Wait();
-	iServerThreadStartedSemaphore.Close();
-	
-	// Delete CTestServerThreadStarter after testserver is started
-	delete this;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CTestServerThreadStarter
-
-     Method: DoCancel
-
-     Description: DoCancel derived from CActive handles the Cancel.
-
-	 DoCancel derived from CActive handles the Cancel.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CTestServerThreadStarter::DoCancel()
-	{
-	if ( IsActive() )
-		{
-		iTimer.Cancel();
-		}
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarter.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of application  
-* main function.
-*
-*/
-
-// INCLUDE FILES
-#include <eikstart.h>
-#include "UITestServerStarterAppUi.h"
-#include "UITestServerStarterApplication.h"
-#include <eikenv.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
-
-/**
- * Application factory function.
- */
-LOCAL_C CApaApplication* NewApplication()
-	{
-	return new CUITestServerStarterApplication;
-	}
-
-// ================= MEMBER FUNCTIONS =========================================
-/**
- * Application main function.
- */
-GLDEF_C TInt E32Main()
-	{
-	
-	RDebug::Printf( "UITESTING: UITestServerStarter - E32Main" );
-	
-	TInt ret = EikStart::RunApplication( NewApplication );
-	
-    RDebug::Printf( "UITESTING: UITestServerStarter - E32Main End" );
-    
-    return ret;
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarterAppContainer.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CUITestServerStarterAppContainer class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "UITestServerStarterAppContainer.h"
-#include <AknsDrawUtils.h>
-#include <AknsBasicBackgroundControlContext.h>
-#include <AknDef.h>
-#include <AknUtils.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
-
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: NewL
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: const TRect& aRect: container rectangle.
-     
-     Return Values: Pointer to new CUITestServerStarterAppContainer object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewL( const TRect& aRect )
-	{
-	CUITestServerStarterAppContainer* self = NewLC( aRect );
-	CleanupStack::Pop( self );
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: NewLC
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: const TRect& aRect: container rect
-     
-     Return Values: Pointer to new CUITestServerStarterAppContainer object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewLC( const TRect& aRect )
-	{
-	CUITestServerStarterAppContainer* self = 
-		new(ELeave)CUITestServerStarterAppContainer;
-	CleanupStack::PushL( self );
-	self->ConstructL( aRect );
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: CUITestServerStarterAppContainer
-
-     Description: C++ constructor.
-
-     C++ constructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppContainer::CUITestServerStarterAppContainer()
-	{	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: CUITestServerStarterAppContainer
-
-     Description: C++ destructor.
-
-     C++ destructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppContainer::~CUITestServerStarterAppContainer()
-	{
-	delete iBgContext;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: ConstructL
-
-     Description: ConstructL is second phase of two-phased constructor.
-
-     ConstructL is second phase of two-phased constructor.
-
-     Parameters: const TRect& aRect: container rectangle.
-     
-     Return Values: None
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppContainer::ConstructL( const TRect& aRect )
-	{
-	CreateWindowL();
-	
-	iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, aRect, ETrue );	
-	
-	SetRect( aRect );
-	ActivateL();
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: Draw
-
-     Description: Draws the control.
-
-     Draws the control.
-
-     Parameters: const TRect& aRect: rectangle which should be redrawn.
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppContainer::Draw( const TRect& aRect ) const
-	{
-	// Get the standard graphics context 
-	CWindowGc& gc = SystemGc();
-
-	// Redraw the background using the default skin
-	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-	MAknsControlContext* controlContext = AknsDrawUtils::ControlContext( this );
-	AknsDrawUtils::Background( skin, controlContext, this, gc, aRect );	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: SizeChanged
-
-     Description: Responds to changes to the size and position of the contents of this control
-
-     Responds to changes to the size and position of the 
-     contents of this control
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppContainer::SizeChanged()
-	{
-	if ( iBgContext )
-		{
-		iBgContext->SetRect( Rect() );
-		if ( &Window() )
-			{
-			iBgContext->SetParentPos( PositionRelativeToScreen() );
-			}
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppContainer
-
-     Method: MopSupplyObject
-
-     Description: This function is used to allow controls to ask their owners for access to other objects that they own
-
-     This function is used to allow controls to ask their owners 
-	 for access to other objects that they own
-	 
-     Parameters: TTypeUid aId: requested object type id.
-     
-     Return Values: Pointer to requested object.
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TTypeUid::Ptr CUITestServerStarterAppContainer::MopSupplyObject( TTypeUid aId )
-	{
-	if ( iBgContext )
-		{
-		return MAknsControlContext::SupplyMopObject( aId, iBgContext );
-		}
-	return CCoeControl::MopSupplyObject( aId );
-	}
-
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarterAppUi.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,508 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CUITestServerStarterAppUi class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include <avkon.hrh>
-#include <aknmessagequerydialog.h>
-#include <aknnotewrappers.h>
-#include <StringLoader.h>
-#include <f32file.h>
-#include <s32file.h>
-#include <hlplch.h>
-
-#include <UITestServerStarter.rsg>
-
-#include "UITestServerStarter.hrh"
-#include "UITestServerStarterAppUi.h"
-#include "UITestServerStarterAppView.h"
-
-#include "TestServerThreadStarter.h"
-#include <stifinternal/TestThreadContainerRunnerFactory.h>
-#include "AknUiEnvProxy.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
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: ConstructL
-
-     Description: ConstructL is second phase of two-phased constructor.
-
-     ConstructL is second phase of two-phased constructor.
-
-     Parameters: None
-     
-     Return Values: None.
-
-     Errors/Exceptions: Leaves if one of called functions leave.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::ConstructL()
-	{
-	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Begin" );
-
-	// Initialise app UI with standard value.
-	BaseConstructL( ENoAppResourceFile || CAknAppUi::EAknEnableSkin );
-
-	CEikonEnv::Static()->DisableExitChecks( true );
-	
-	// Create view object
-	iAppView = CUITestServerStarterAppView::NewL();
-	
-	AddViewL( iAppView );
-	SetDefaultViewL( *iAppView );
-		
-	CAknUiEnvProxy* uiEnvProxy = CAknUiEnvProxy::NewL( this );
-	
-	CTestThreadContainerRunnerFactory* testThreadContainerRunnerFactory = 
-		CTestThreadContainerRunnerFactory::NewL( RThread().Id(), CActiveScheduler::Current(), uiEnvProxy );
-	
-	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Starting TestServer" );
-	CTestServerThreadStarter* testServerThreadStarter = CTestServerThreadStarter::NewL( );
-	testServerThreadStarter->RunTestServerThread( testThreadContainerRunnerFactory );
-		
-	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - Move to background" );
-	
-	TApaTask task( CCoeEnv::Static()->WsSession() );
-	task.SetWgId( CCoeEnv::Static()->RootWin().Identifier() ); 
-	task.SendToBackground();
-	
-	RDebug::Printf( "UITESTING: CUITestServerStarterAppUi::ConstructL - End" );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: CUITestServerStarterAppUi
-
-     Description: C++ default constructor can NOT contain any code, that might leave.
-
-     C++ default constructor can NOT contain any code, that might leave.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppUi::CUITestServerStarterAppUi()
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: ~CUITestServerStarterAppUi
-
-     Description: C++ destructor.
-
-     C++ destructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppUi::~CUITestServerStarterAppUi()
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: HandleCommandL
-
-     Description: Handles user commands.
-
-     Derived from CCoeAppUi. Handles user commands.
-
-     Parameters: TInt aCommand: in: User command code.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::HandleCommandL( TInt )
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: HandleWsEventL
-
-     Description: Handles window server event.
-
-     Derived from CCoeAppUi. Handles window server event.
-
-     Parameters: const TWsEvent& aEvent: in: Event.
-     			 CCoeControl* aDestination: in: Destination control.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
-	{	
-	CAknAppUi::HandleWsEventL( aEvent, aDestination );
-
-	if ( ( aEvent.Type() == EEventKey ) )
-		{
-		switch( iEventType )
-			{
-			case EPressKey:
-				{
-				if ( iEventStatus != NULL )
-					{
-					KeyPressHandled();					
-					}
-				}
-				break;
-			case ETypeText:
-				{
-				iTypeTextLength--;
-				if ( ( iEventStatus != NULL ) && ( iTypeTextLength == 0 ) )
-					{
-					TextTypeHandled();
-					}
-				}
-				break;
-			}
-		}
-	else if ( aEvent.Type() == EEventPointer )
-		{
-		if ( iEventType == EPointerEvent )
-			{
-			PointerEventHandled();
-			}
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: PrepareToTypeText
-
-     Description: Prepares AppUi to recive type text event
-
-     Prepares AppUi to recive type text event
-
-     Parameters: TInt aTextLength: in: Text length.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::PrepareToTypeText( TInt aTextLength )
-	{
-	iTypeTextLength = aTextLength;
-	iEventType = ETypeText;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: PrepareToPressKey
-
-     Description: Prepares AppUi to recive key press event
-
-     Prepares AppUi to recive key press event
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::PrepareToPressKey()
-	{
-	iEventType = EPressKey;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: PrepareToPointerEvent
-
-     Description: Prepares AppUi to recive pointer event
-
-     Prepares AppUi to recive key press event
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::PrepareToPointerEvent()
-	{
-	iEventType = EPointerEvent;
-	}
-
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: KeyPressHandled
-
-     Description: Sends notification that key press was handled.
-
-     Notifies client that key press was handled.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::KeyPressHandled()
-	{
-	if ( ( iEventType == EPressKey ) && ( iEventStatus != NULL ) && ( iEventType == EPressKey ) )
-		{
-		iEventType = ENone;
-		User::RequestComplete( iEventStatus, KErrNone );
-		iEventStatus = NULL;
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: TextTypeHandled
-
-     Description: Sends notification that type text was handled.
-
-     Notifies client that type text was handled.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::TextTypeHandled()
-	{
-	if ( ( iEventType == ETypeText ) && ( iEventStatus != NULL ) && ( iEventType == ETypeText ) )
-		{
-		iEventType = ENone;
-		iTypeTextLength = 0;
-		User::RequestComplete( iEventStatus, KErrNone );
-		iEventStatus = NULL;
-		}
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: PointerEventHandled
-
-     Description: Sends notification that pointer event was handled.
-
-     Notifies client that pointer event was handled.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::PointerEventHandled()
-	{
-	if ( ( iEventType == EPointerEvent ) && ( iEventStatus != NULL ) )
-		{
-		iEventType = ENone;
-		User::RequestComplete( iEventStatus, KErrNone );
-		iEventStatus = NULL;
-		}
-	}
-
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: NotifyAboutHandledKeyPress
-
-     Description: Requests notification of press key completion.
-
-     Requests notification of press key completion.
-
-     Parameters: TRequestStatus* aStatus: in: Request status pointer.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::NotifyAboutHandledKeyPress( TRequestStatus* aStatus )
-	{
-	iEventStatus = aStatus;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: NotifyAboutHandledTextType
-
-     Description: Requests notification when text type event is handled.
-
-     Requests notification when text type event is handled.
-
-     Parameters: TRequestStatus* aStatus: in: Request status pointer.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::NotifyAboutHandledTextType( TRequestStatus* aStatus )
-	{
-	iEventStatus = aStatus;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppUi
-
-     Method: NotifyAboutHandledPointerEvent
-
-     Description: Requests notification when pointer event is handled.
-
-     Requests notification when pointer event is handled.
-
-     Parameters: TRequestStatus* aStatus: in: Request status pointer.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppUi::NotifyAboutHandledPointerEvent( TRequestStatus* aStatus )
-	{
-	iEventStatus = aStatus;
-	}
-
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarterAppView.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,345 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors: 
-* Description: This module contains the 
-* implementation of CUITestServerStarterAppView class member 
-* functions.
-*
-*/
-
-// INCLUDE FILES
-#include <coemain.h>
-#include <aknViewAppUi.h> 
-#include "UITestServerStarterAppView.h"
-#include "UITestServerStarterApplication.h"
-#include "UITestServerStarterAppContainer.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
-
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: NewL
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: None
-     
-     Return Values: Pointer to new CUITestServerStarterAppView object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppView* CUITestServerStarterAppView::NewL()
-	{
-	CUITestServerStarterAppView* self = CUITestServerStarterAppView::NewLC();
-	CleanupStack::Pop( self );
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: NewLC
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: None
-     
-     Return Values: Pointer to new CUITestServerStarterAppView object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppView* CUITestServerStarterAppView::NewLC()
-	{
-	CUITestServerStarterAppView* self = new ( ELeave ) CUITestServerStarterAppView;
-	CleanupStack::PushL( self );
-	self->ConstructL();
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: ConstructL
-
-     Description: ConstructL is second phase of two-phased constructor.
-
-     ConstructL is second phase of two-phased constructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppView::ConstructL()
-	{
-	BaseConstructL( 0 );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: CUITestServerStarterAppView
-
-     Description: C++ constructor.
-
-     C++ constructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppView::CUITestServerStarterAppView()
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: CUITestServerStarterAppView
-
-     Description: C++ destructor.
-
-     C++ destructor.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterAppView::~CUITestServerStarterAppView()
-	{
-    if ( iContainer )
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        }
-
-    delete iContainer;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: Id
-
-     Description: Returns view Uid.
-
-     Returns view Uid.
-
-     Parameters: None
-     
-     Return Values: View Uid
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TUid CUITestServerStarterAppView::Id() const
-	{
-	return KMainViewId;	
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: HandleCommandL
-
-     Description: Handle Commands.
-
-     Handle Commands.
-
-     Parameters: TInt aCommand: command id
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppView::HandleCommandL( TInt aCommand )
-    {   
-    AppUi()->HandleCommandL( aCommand );
-    }
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: HandleClientRectChange
-
-     Description: Handle size changes.
-
-     Handle size changes.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: DoActivateL
-
-     Description: From AknView, Activates view.
-
-     From AknView, Activates view.
-
-     Parameters: const TVwsViewId& aPrevViewId: previouse view id
-     			 TUid aCustomMessageId: custom message id
-   				 const TDesC8& aCustomMessage: custom message data
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if ( !iContainer )
-        {
-        // Create view container
-        iContainer = CUITestServerStarterAppContainer::NewL( ClientRect() );
-        iContainer->SetMopParent( this );
-        // Add container to view stack
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-   }
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterAppView
-
-     Method: DoDeactivate
-
-     Description: From AknView, Deactivates view.
-
-     From AknView, Deactivates view.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterAppView::DoDeactivate()
-    {
-    if ( iContainer )
-        {
-        // Remove container from view stack
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        }
-    
-    // Delete container since it's not longer needed.
-    delete iContainer;
-    iContainer = NULL;
-    }
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarterApplication.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CUITestServerStarterApplication class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "UITestServerStarter.hrh"
-#include "UITestServerStarterDocument.h"
-#include "UITestServerStarterApplication.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
-
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterApplication
-
-     Method: CreateDocumentL 
-
-     Creates CUITestServerStarterDocument document object.
-
-	 Creates CUITestServerStarterDocument document object. The returned
-	 pointer in not owned by the CUITestServerStarterApplication object.
-
-     Parameters: None
-     
-     Return Values: A pointer to the created document object.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CApaDocument* CUITestServerStarterApplication::CreateDocumentL ()
-	{
-	return (static_cast<CApaDocument*> (CUITestServerStarterDocument::NewL ( *this) ) );
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterApplication
-
-     Method: AppDllUid
-
-     Gets application Uid
-
-	 Gets application Uid
-
-     Parameters: None
-     
-     Return Values: Application Uid.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-TUid CUITestServerStarterApplication::AppDllUid() const
-	{
-	return KUidUITestServerStarterApp;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: PreDocConstructL
-
-     Method: AppDllUid
-
-     Preconstructs document.
-
-     Preconstructs document.
-
-     Parameters: None
-     
-     Return Values: None
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterApplication::PreDocConstructL()
-	{
-	// This call allow us to run multiple instances of UI application in same time.
-	CEikApplication::PreDocConstructL();
-	}
-
-// End of File
--- a/stifui/uitestserverstarter/src/UITestServerStarterDocument.cpp	Mon May 03 12:32:02 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
-* 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 "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:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: This module contains the implementation of 
-* CUITestServerStarterDocument class member functions.
-*
-*/
-
-// INCLUDE FILES
-#include "UITestServerStarterAppUi.h"
-#include "UITestServerStarterDocument.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
-
-
-// ================= MEMBER FUNCTIONS =========================================
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: NewL
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: CEikApplication& aApp: in: Reference to application..
-     
-     Return Values: Pointer to new CUITestServerStarterDocument object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterDocument* CUITestServerStarterDocument::NewL( CEikApplication& aApp )
-	{
-	CUITestServerStarterDocument* self = NewLC (aApp);
-	CleanupStack::Pop (self);
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: NewLC
-
-     Description: NewL is first phase of two-phased constructor.
-
-     NewL is first phase of two-phased constructor.
-
-     Parameters: CEikApplication& aApp: in: Reference to application.
-     
-     Return Values: Pointer to new CUITestServerStarterDocument object.
-
-     Errors/Exceptions: Leave if one of the called functions leaves.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterDocument* CUITestServerStarterDocument::NewLC (CEikApplication& aApp)
-	{
-	CUITestServerStarterDocument* self = new ( ELeave ) CUITestServerStarterDocument( aApp );
-
-	CleanupStack::PushL (self);
-	self->ConstructL ();
-	return self;
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: ConstructL
-
-     Description: This is second phase of two-phased constructor.
-
-     This is second phase of two-phased constructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-void CUITestServerStarterDocument::ConstructL()
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: CUITestServerStarterDocument
-
-     Description: Constructor.
-
-     Constructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterDocument::CUITestServerStarterDocument( CEikApplication& aApp ) :
-	CAknDocument(aApp)
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: ~CUITestServerStarterDocument
-
-     Description: Destructor.
-
-     Destructor.
-
-     Parameters: None.
-     
-     Return Values: None.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CUITestServerStarterDocument::~CUITestServerStarterDocument ()
-	{
-	// No implementation required
-	}
-
-/*
--------------------------------------------------------------------------------
-
-     Class: CUITestServerStarterDocument
-
-     Method: CreateAppUiL
-
-     Description: Creates AppUi object.
-
-     Creates AppUi object.
-
-     Parameters: None.
-     
-     Return Values: Pointer to AppUi object.
-
-     Errors/Exceptions: None.
-
-     Status: Draft
-    
--------------------------------------------------------------------------------
-*/
-CEikAppUi* CUITestServerStarterDocument::CreateAppUiL ()
-	{
-	return ( static_cast <CEikAppUi*>( new ( ELeave ) CUITestServerStarterAppUi ) );
-	}
-
-// End of File